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

443 lines
1.6 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[106,3,5,7,8,14],{"+92d":function(Kt,he,D){Kt.exports=D.p+"static/b1.8d46544a.svg"},"+NIl":function(Kt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(V,U){"use strict";function G(l,o){l.cmdState.push(o)}function P(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function I(l){var o=l.cmdState.pop();o&&o.closeBracket()}function K(l){for(var o=l.cmdState,a=o.length-1;a>=0;a--){var c=o[a];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function k(l,o,a){return function(){this.name=l,this.bracketNo=0,this.style=o,this.styles=a,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=k("importmodule","tag",["string","builtin"]),r.documentclass=k("documentclass","tag",["","atom"]),r.usepackage=k("usepackage","tag",["atom"]),r.begin=k("begin","tag",["atom"]),r.end=k("end","tag",["atom"]),r.label=k("label","tag",["atom"]),r.ref=k("ref","tag",["atom"]),r.eqref=k("eqref","tag",["atom"]),r.cite=k("cite","tag",["atom"]),r.bibitem=k("bibitem","tag",["atom"]),r.Bibitem=k("Bibitem","tag",["atom"]),r.RBibitem=k("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(l,o){l.f=o}function b(l,o){var a;if(l.match(/^\\[a-zA-Z@]+/)){var c=l.current().slice(1);return a=r.hasOwnProperty(c)?r[c]:r.DEFAULT,a=new a,G(o,a),M(o,m),a.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return M(o,function(i,n){return f(i,n,"\\]")}),"keyword";if(l.match("\\("))return M(o,function(i,n){return f(i,n,"\\)")}),"keyword";if(l.match("$$"))return M(o,function(i,n){return f(i,n,"$$")}),"keyword";if(l.match("$"))return M(o,function(i,n){return f(i,n,"$")}),"keyword";var s=l.next();if(s=="%")return l.skipToEnd(),"comment";if(s=="}"||s=="]"){if(a=P(o),a)a.closeBracket(s),M(o,m);else return"error";return"bracket"}else return s=="{"||s=="["?(a=r.DEFAULT,a=new a,G(o,a),"bracket"):/\d/.test(s)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),a=K(o),a.name=="begin"&&(a.argument=l.current()),a.styleIdentifier())}function f(l,o,a){if(l.eatSpace())return null;if(a&&l.match(a))return M(o,b),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=l.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(l.skipToEnd(),"comment"):"error"}function m(l,o){var a=l.peek(),c;return a=="{"||a=="["?(c=P(o),c.openBracket(a),l.eat(a),M(o,b),"bracket"):/[ \t\r]/.test(a)?(l.eat(a),null):(M(o,b),I(o),b(l,o))}return{startState:function(){var l=U.inMathMode?function(o,a){return f(o,a)}:b;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,o){return o.f(l,o)},blankLine:function(l){l.f=b,l.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(Kt,he,D){},"/cxE":function(Kt,he,D){"use strict";D.d(he,"f",function(){return U}),D.d(he,"g",function(){return G}),D.d(he,"h",function(){return P}),D.d(he,"e",function(){return K}),D.d(he,"b",function(){return k}),D.d(he,"c",function(){return r}),D.d(he,"d",function(){return M}),D.d(he,"a",function(){return b});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(m=>{m(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const V=new Z;function U(f){K(f)||V.onUnexpectedError(f);return}function G(f){K(f)||V.onUnexpectedExternalError(f);return}function P(f){if(f instanceof Error){let{name:m,message:l}=f;const o=f.stacktrace||f.stack;return{$isError:!0,name:m,message:l,stack:o}}return f}const I="Canceled";function K(f){return f instanceof Error&&f.name===I&&f.message===I}function k(){const f=new Error(I);return f.name=f.message,f}function r(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function M(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class b extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(Kt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(k,r,M){var b=M&&M!=Z.Init;if(r&&!b)k.on("blur",P),k.on("change",I),k.on("swapDoc",I),Z.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){G(k)}),I(k);else if(!r&&b){k.off("blur",P),k.off("change",I),k.off("swapDoc",I),Z.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),V(k);var f=k.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}r&&!k.hasFocus()&&P(k)});function V(k){k.state.placeholder&&(k.state.placeholder.parentNode.removeChild(k.state.placeholder),k.state.placeholder=null)}function U(k){V(k);var r=k.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=k.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var M=k.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),r.appendChild(M),k.display.lineSpace.insertBefore(r,k.display.lineSpace.firstChild)}function G(k){setTimeout(function(){var r=!1,M=k.getInputField();M.nodeName=="TEXTAREA"?r=!M.value:k.lineCount()==1&&(r=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),r?U(k):V(k)},20)}function P(k){K(k)&&U(k)}function I(k){var r=k.getWrapperElement(),M=K(k);r.className=r.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?U(k):V(k)}function K(k){return k.lineCount()===1&&k.getLine(0)===""}})},"1eCo":function(Kt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";var V={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},U={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(G,P){var I=G.indentUnit,K={},k=P.htmlMode?V:U;for(var r in k)K[r]=k[r];for(var r in P)K[r]=P[r];var M,b;function f(p,_){function g(B){return _.tokenize=B,B(p,_)}var w=p.next();if(w=="<")return p.eat("!")?p.eat("[")?p.match("CDATA[")?g(o("atom","]]>")):null:p.match("--")?g(o("comment","-->")):p.match("DOCTYPE",!0,!0)?(p.eatWhile(/[\w\._\-]/),g(a(1))):null:p.eat("?")?(p.eatWhile(/[\w\._\-]/),_.tokenize=o("meta","?>"),"meta"):(M=p.eat("/")?"closeTag":"openTag",_.tokenize=m,"tag bracket");if(w=="&"){var j;return p.eat("#")?p.eat("x")?j=p.eatWhile(/[a-fA-F\d]/)&&p.eat(";"):j=p.eatWhile(/[\d]/)&&p.eat(";"):j=p.eatWhile(/[\w\.\-:]/)&&p.eat(";"),j?"atom":"error"}else return p.eatWhile(/[^&<]/),null}f.isInText=!0;function m(p,_){var g=p.next();if(g==">"||g=="/"&&p.eat(">"))return _.tokenize=f,M=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return M="equals",null;if(g=="<"){_.tokenize=f,_.state=n,_.tagName=_.tagStart=null;var w=_.tokenize(p,_);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(g)?(_.tokenize=l(g),_.stringStartCol=p.column(),_.tokenize(p,_)):(p.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(p){var _=function(g,w){for(;!g.eol();)if(g.next()==p){w.tokenize=m;break}return"string"};return _.isInAttribute=!0,_}function o(p,_){return function(g,w){for(;!g.eol();){if(g.match(_)){w.tokenize=f;break}g.next()}return p}}function a(p){return function(_,g){for(var w;(w=_.next())!=null;){if(w=="<")return g.tokenize=a(p+1),g.tokenize(_,g);if(w==">")if(p==1){g.tokenize=f;break}else return g.tokenize=a(p-1),g.tokenize(_,g)}return"meta"}}function c(p,_,g){this.prev=p.context,this.tagName=_,this.indent=p.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(_)||p.context&&p.context.noIndent)&&(this.noIndent=!0)}function s(p){p.context&&(p.context=p.context.prev)}function i(p,_){for(var g;;){if(!p.context)return;if(g=p.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(_))return;s(p)}}function n(p,_,g){return p=="openTag"?(g.tagStart=_.column(),O):p=="closeTag"?T:n}function O(p,_,g){return p=="word"?(g.tagName=_.current(),b="tag",S):K.allowMissingTagName&&p=="endTag"?(b="tag bracket",S(p,_,g)):(b="error",O)}function T(p,_,g){if(p=="word"){var w=_.current();return g.context&&g.context.tagName!=w&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&s(g),g.context&&g.context.tagName==w||K.matchClosing===!1?(b="tag",C):(b="tag error",R)}else return K.allowMissingTagName&&p=="endTag"?(b="tag bracket",C(p,_,g)):(b="error",R)}function C(p,_,g){return p!="endTag"?(b="error",C):(s(g),n)}function R(p,_,g){return b="error",C(p,_,g)}function S(p,_,g){if(p=="word")return b="attribute",v;if(p=="endTag"||p=="selfcloseTag"){var w=g.tagName,j=g.tagStart;return g.tagName=g.tagStart=null,p=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(w)?i(g,w):(i(g,w),g.context=new c(g,w,j==g.indented)),n}return b="error",S}function v(p,_,g){return p=="equals"?E:(K.allowMissing||(b="error"),S(p,_,g))}function E(p,_,g){return p=="string"?h:p=="word"&&K.allowUnquoted?(b="string",S):(b="error",S(p,_,g))}function h(p,_,g){return p=="string"?h:S(p,_,g)}return{startState:function(p){var _={tokenize:f,state:n,indented:p||0,tagName:null,tagStart:null,context:null};return p!=null&&(_.baseIndent=p),_},token:function(p,_){if(!_.tagName&&p.sol()&&(_.indented=p.indentation()),p.eatSpace())return null;M=null;var g=_.tokenize(p,_);return(g||M)&&g!="comment"&&(b=null,_.state=_.state(M||g,p,_),b&&(g=b=="error"?g+" error":b)),g},indent:function(p,_,g){var w=p.context;if(p.tokenize.isInAttribute)return p.tagStart==p.indented?p.stringStartCol+1:p.indented+I;if(w&&w.noIndent)return Z.Pass;if(p.tokenize!=m&&p.tokenize!=f)return g?g.match(/^(\s*)/)[0].length:0;if(p.tagName)return K.multilineTagIndentPastTag!==!1?p.tagStart+p.tagName.length+2:p.tagStart+I*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var j=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(j&&j[1])for(;w;)if(w.tagName==j[2]){w=w.prev;break}else if(K.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(j)for(;w;){var B=K.contextGrabbers[w.tagName];if(B&&B.hasOwnProperty(j[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+I:p.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(p){p.state==E&&(p.state=S)},xmlCurrentTag:function(p){return p.tagName?{name:p.tagName,close:p.type=="closeTag"}:null},xmlCurrentContext:function(p){for(var _=[],g=p.context;g;g=g.prev)g.tagName&&_.push(g.tagName);return _.reverse()}}}),Z.defineMIME("text/xml","xml"),Z.defineMIME("application/xml","xml"),Z.mimeModes.hasOwnProperty("text/html")||Z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Kt,he,D){"use strict";D.d(he,"d",function(){return Wt}),D.d(he,"b",function(){return be}),D.d(he,"c",function(){return St}),D.d(he,"a",function(){return An});var Z=D("VTBJ"),V=D("1OyB"),U=D("vuIU"),G=D("JX7q"),P=D("Ji7U"),I=D("LK+K"),K=D("q1tI"),k=D("I8Z2"),r=D("BGR+"),M=D("wx14"),b=D("rePB"),f=D("4IlW"),m=D("2GS6"),l=D("Gytx"),o=D.n(l),a=D("TSYQ"),c=D.n(a),s=D("U8pU"),i=D("ODXe"),n=/iPhone/i,O=/iPod/i,T=/iPad/i,C=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,S=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,E=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,p=/BlackBerry/i,_=/BB10/i,g=/Opera Mini/i,w=/\b(CriOS|Chrome)(?:.+)Mobile/i,j=/Mobile(?:.+)Firefox\b/i;function B(Jt,Et){return Jt.test(Et)}function A(Jt){var Et=Jt||(typeof navigator!="undefined"?navigator.userAgent:""),Ct=Et.split("[FBAN");if(typeof Ct[1]!="undefined"){var st=Ct,de=Object(i.a)(st,1);Et=de[0]}if(Ct=Et.split("Twitter"),typeof Ct[1]!="undefined"){var Ae=Ct,kt=Object(i.a)(Ae,1);Et=kt[0]}var ct={apple:{phone:B(n,Et)&&!B(E,Et),ipod:B(O,Et),tablet:!B(n,Et)&&B(T,Et)&&!B(E,Et),device:(B(n,Et)||B(O,Et)||B(T,Et))&&!B(E,Et)},amazon:{phone:B(S,Et),tablet:!B(S,Et)&&B(v,Et),device:B(S,Et)||B(v,Et)},android:{phone:!B(E,Et)&&B(S,Et)||!B(E,Et)&&B(C,Et),tablet:!B(E,Et)&&!B(S,Et)&&!B(C,Et)&&(B(v,Et)||B(R,Et)),device:!B(E,Et)&&(B(S,Et)||B(v,Et)||B(C,Et)||B(R,Et))||B(/\bokhttp\b/i,Et)},windows:{phone:B(E,Et),tablet:B(h,Et),device:B(E,Et)||B(h,Et)},other:{blackberry:B(p,Et),blackberry10:B(_,Et),opera:B(g,Et),firefox:B(j,Et),chrome:B(w,Et),device:B(p,Et)||B(_,Et)||B(g,Et)||B(j,Et)||B(w,Et)},any:null,phone:null,tablet:null};return ct.any=ct.apple.device||ct.android.device||ct.windows.device||ct.other.device,ct.phone=ct.apple.phone||ct.android.phone||ct.windows.phone,ct.tablet=ct.apple.tablet||ct.android.tablet||ct.windows.tablet,ct}var H=Object(Z.a)(Object(Z.a)({},A()),{},{isMobile:A}),F=H;function x(){}function Y(Jt,Et,Ct){var st=Et||"";return Jt.key||"".concat(st,"item_").concat(Ct)}function q(Jt){return"".concat(Jt,"-menu-")}function ie(Jt,Et){var Ct=-1;K.Children.forEach(Jt,function(st){Ct+=1,st&&st.type&&st.type.isMenuItemGroup?K.Children.forEach(st.props.children,function(de){Ct+=1,Et(de,Ct)}):Et(st,Ct)})}function me(Jt,Et,Ct){if(!Jt||Ct.find)return;K.Children.forEach(Jt,function(st){if(st){var de=st.type;if(!de||!(de.isSubMenu||de.isMenuItem||de.isMenuItemGroup))return;Et.indexOf(st.key)!==-1?Ct.find=!0:st.props.children&&me(st.props.children,Et,Ct)}})}var $e=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],xe=function(Et){var Ct=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,st=Et&&typeof Et.getBoundingClientRect=="function"&&Et.getBoundingClientRect().width;if(st){if(Ct){var de=getComputedStyle(Et),Ae=de.marginLeft,kt=de.marginRight;st+=+Ae.replace("px","")+ +kt.replace("px","")}st=+st.toFixed(6)}return st||0},Ie=function(Et,Ct,st){Et&&Object(s.a)(Et.style)==="object"&&(Et.style[Ct]=st)},Je=function(){return F.any},Ye=D("KQm4"),ve=D("Ff2n"),fe=D("i8i4"),lt=D("bdgK"),qt=D("uciX"),Ft=D("8XRh"),Ot={adjustX:1,adjustY:1},Ve={topLeft:{points:["bl","tl"],overflow:Ot,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ot,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Ot,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Ot,offset:[4,0]}},vt={topLeft:{points:["bl","tl"],overflow:Ot,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Ot,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Ot,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Ot,offset:[4,0]}},ht=Ve,Bt=0,se={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Ue=function(Et,Ct,st){var de=q(Ct),Ae=Et.getState();Et.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Ae.defaultActiveFirst),{},Object(b.a)({},de,st))})},Ge=function(Jt){Object(P.a)(Ct,Jt);var Et=Object(I.a)(Ct);function Ct(st){var de;Object(V.a)(this,Ct),de=Et.call(this,st),de.onDestroy=function(Le){de.props.onDestroy(Le)},de.onKeyDown=function(Le){var qe=Le.keyCode,mt=de.menuInstance,jt=de.props,sn=jt.isOpen,yn=jt.store;if(qe===f.a.ENTER)return de.onTitleClick(Le),Ue(yn,de.props.eventKey,!0),!0;if(qe===f.a.RIGHT)return sn?mt.onKeyDown(Le):(de.triggerOpenChange(!0),Ue(yn,de.props.eventKey,!0)),!0;if(qe===f.a.LEFT){var nr;if(sn)nr=mt.onKeyDown(Le);else return;return nr||(de.triggerOpenChange(!1),nr=!0),nr}return sn&&(qe===f.a.UP||qe===f.a.DOWN)?mt.onKeyDown(Le):void 0},de.onOpenChange=function(Le){de.props.onOpenChange(Le)},de.onPopupVisibleChange=function(Le){de.triggerOpenChange(Le,Le?"mouseenter":"mouseleave")},de.onMouseEnter=function(Le){var qe=de.props,mt=qe.eventKey,jt=qe.onMouseEnter,sn=qe.store;Ue(sn,de.props.eventKey,!1),jt({key:mt,domEvent:Le})},de.onMouseLeave=function(Le){var qe=de.props,mt=qe.parentMenu,jt=qe.eventKey,sn=qe.onMouseLeave;mt.subMenuInstance=Object(G.a)(de),sn({key:jt,domEvent:Le})},de.onTitleMouseEnter=function(Le){var qe=de.props,mt=qe.eventKey,jt=qe.onItemHover,sn=qe.onTitleMouseEnter;jt({key:mt,hover:!0}),sn({key:mt,domEvent:Le})},de.onTitleMouseLeave=function(Le){var qe=de.props,mt=qe.parentMenu,jt=qe.eventKey,sn=qe.onItemHover,yn=qe.onTitleMouseLeave;mt.subMenuInstance=Object(G.a)(de),sn({key:jt,hover:!1}),yn({key:jt,domEvent:Le})},de.onTitleClick=function(Le){var qe=Object(G.a)(de),mt=qe.props;if(mt.onTitleClick({key:mt.eventKey,domEvent:Le}),mt.triggerSubMenuAction==="hover")return;de.triggerOpenChange(!mt.isOpen,"click"),Ue(mt.store,de.props.eventKey,!1)},de.onSubMenuClick=function(Le){typeof de.props.onClick=="function"&&de.props.onClick(de.addKeyPath(Le))},de.onSelect=function(Le){de.props.onSelect(Le)},de.onDeselect=function(Le){de.props.onDeselect(Le)},de.getPrefixCls=function(){return"".concat(de.props.rootPrefixCls,"-submenu")},de.getActiveClassName=function(){return"".concat(de.getPrefixCls(),"-active")},de.getDisabledClassName=function(){return"".concat(de.getPrefixCls(),"-disabled")},de.getSelectedClassName=function(){return"".concat(de.getPrefixCls(),"-selected")},de.getOpenClassName=function(){return"".concat(de.props.rootPrefixCls,"-submenu-open")},de.saveMenuInstance=function(Le){de.menuInstance=Le},de.addKeyPath=function(Le){return Object(Z.a)(Object(Z.a)({},Le),{},{keyPath:(Le.keyPath||[]).concat(de.props.eventKey)})},de.triggerOpenChange=function(Le,qe){var mt=de.props.eventKey,jt=function(){de.onOpenChange({key:mt,item:Object(G.a)(de),trigger:qe,open:Le})};qe==="mouseenter"?de.mouseenterTimeout=setTimeout(function(){jt()},0):jt()},de.isChildrenSelected=function(){var Le={find:!1};return me(de.props.children,de.props.selectedKeys,Le),Le.find},de.isOpen=function(){return de.props.openKeys.indexOf(de.props.eventKey)!==-1},de.adjustWidth=function(){if(!de.subMenuTitle||!de.menuInstance)return;var Le=fe.findDOMNode(de.menuInstance);if(Le.offsetWidth>=de.subMenuTitle.offsetWidth)return;Le.style.minWidth="".concat(de.subMenuTitle.offsetWidth,"px")},de.saveSubMenuTitle=function(Le){de.subMenuTitle=Le},de.getBaseProps=function(){var Le=Object(G.a)(de),qe=Le.props;return{mode:qe.mode==="horizontal"?"vertical":qe.mode,visible:de.props.isOpen,level:qe.level+1,inlineIndent:qe.inlineIndent,focusable:!1,onClick:de.onSubMenuClick,onSelect:de.onSelect,onDeselect:de.onDeselect,onDestroy:de.onDestroy,selectedKeys:qe.selectedKeys,eventKey:"".concat(qe.eventKey,"-menu-"),openKeys:qe.openKeys,motion:qe.motion,onOpenChange:de.onOpenChange,subMenuOpenDelay:qe.subMenuOpenDelay,parentMenu:Object(G.a)(de),subMenuCloseDelay:qe.subMenuCloseDelay,forceSubMenuRender:qe.forceSubMenuRender,triggerSubMenuAction:qe.triggerSubMenuAction,builtinPlacements:qe.builtinPlacements,defaultActiveFirst:qe.store.getState().defaultActiveFirst[q(qe.eventKey)],multiple:qe.multiple,prefixCls:qe.rootPrefixCls,id:de.internalMenuId,manualRef:de.saveMenuInstance,itemIcon:qe.itemIcon,expandIcon:qe.expandIcon,direction:qe.direction}},de.getMotion=function(Le,qe){var mt=Object(G.a)(de),jt=mt.haveRendered,sn=de.props,yn=sn.motion,nr=sn.rootPrefixCls,Kn=Object(Z.a)(Object(Z.a)({},yn),{},{leavedClassName:"".concat(nr,"-hidden"),removeOnLeave:!1,motionAppear:jt||!qe||Le!=="inline"});return Kn};var Ae=st.store,kt=st.eventKey,ct=Ae.getState(),Qt=ct.defaultActiveFirst;de.isRootMenu=!1;var un=!1;return Qt&&(un=Qt[kt]),Ue(Ae,kt,un),de}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var de=this,Ae=this.props,kt=Ae.mode,ct=Ae.parentMenu,Qt=Ae.manualRef;if(Qt&&Qt(this),kt!=="horizontal"||!ct.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return de.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var de=this.props,Ae=de.onDestroy,kt=de.eventKey;Ae&&Ae(kt),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(de){var Ae=this,kt=this.getBaseProps(),ct=this.getMotion(kt.mode,kt.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||kt.visible||kt.forceSubMenuRender,!this.haveOpened)return K.createElement("div",null);var Qt=kt.direction;return K.createElement(Ft.default,Object.assign({visible:kt.visible},ct),function(un){var Le=un.className,qe=un.style,mt=c()("".concat(kt.prefixCls,"-sub"),Le,Object(b.a)({},"".concat(kt.prefixCls,"-rtl"),Qt==="rtl"));return K.createElement(De,Object.assign({},kt,{id:Ae.internalMenuId,className:mt,style:qe}),de)})}},{key:"render",value:function(){var de,Ae=Object(Z.a)({},this.props),kt=Ae.isOpen,ct=this.getPrefixCls(),Qt=Ae.mode==="inline",un=c()(ct,"".concat(ct,"-").concat(Ae.mode),(de={},Object(b.a)(de,Ae.className,!!Ae.className),Object(b.a)(de,this.getOpenClassName(),kt),Object(b.a)(de,this.getActiveClassName(),Ae.active||kt&&!Qt),Object(b.a)(de,this.getDisabledClassName(),Ae.disabled),Object(b.a)(de,this.getSelectedClassName(),this.isChildrenSelected()),de));this.internalMenuId||(Ae.eventKey?this.internalMenuId="".concat(Ae.eventKey,"$Menu"):(Bt+=1,this.internalMenuId="$__$".concat(Bt,"$Menu")));var Le={},qe={},mt={};Ae.disabled||(Le={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},qe={onClick:this.onTitleClick},mt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var jt={},sn=Ae.direction;Qt&&(sn==="rtl"?jt.paddingRight=Ae.inlineIndent*Ae.level:jt.paddingLeft=Ae.inlineIndent*Ae.level);var yn={};this.props.isOpen&&(yn={"aria-owns":this.internalMenuId});var nr=null;Ae.mode!=="horizontal"&&(nr=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(nr=K.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Kn=K.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:jt,className:"".concat(ct,"-title"),role:"button"},mt,qe,{"aria-expanded":kt},yn,{"aria-haspopup":"true",title:typeof Ae.title=="string"?Ae.title:void 0}),Ae.title,nr||K.createElement("i",{className:"".concat(ct,"-arrow")})),wn=this.renderChildren(Ae.children),br=Ae.parentMenu.isRootMenu?Ae.parentMenu.props.getPopupContainer:function(ti){return ti.parentNode},Er=se[Ae.mode],rr=Ae.popupOffset?{offset:Ae.popupOffset}:{},cr=Ae.mode==="inline"?"":Ae.popupClassName;cr+=sn==="rtl"?" ".concat(ct,"-rtl"):"";var Pr=Ae.disabled,Kr=Ae.triggerSubMenuAction,hi=Ae.subMenuOpenDelay,pn=Ae.forceSubMenuRender,or=Ae.subMenuCloseDelay,mi=Ae.builtinPlacements;$e.forEach(function(ti){return delete Ae[ti]}),delete Ae.onClick;var wi=sn==="rtl"?Object.assign({},vt,mi):Object.assign({},Ve,mi);return delete Ae.direction,K.createElement("li",Object.assign({},Ae,Le,{className:un,role:"menuitem"}),Qt&&Kn,Qt&&wn,!Qt&&K.createElement(qt.a,{prefixCls:ct,popupClassName:c()("".concat(ct,"-popup"),cr),getPopupContainer:br,builtinPlacements:wi,popupPlacement:Er,popupVisible:kt,popupAlign:rr,popup:wn,action:Pr?[]:[Kr],mouseEnterDelay:hi,mouseLeaveDelay:or,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:pn},Kn))}}]),Ct}(K.Component);Ge.defaultProps={onMouseEnter:x,onMouseLeave:x,onTitleMouseEnter:x,onTitleMouseLeave:x,onTitleClick:x,manualRef:x,mode:"vertical",title:""};var et=Object(k.b)(function(Jt,Et){var Ct=Jt.openKeys,st=Jt.activeKey,de=Jt.selectedKeys,Ae=Et.eventKey,kt=Et.subMenuKey;return{isOpen:Ct.indexOf(Ae)>-1,active:st[kt]===Ae,selectedKeys:de}})(Ge);et.isSubMenu=!0;var Wt=et,Yt="menuitem-overflowed",on=.5,nt=function(Jt){Object(P.a)(Ct,Jt);var Et=Object(I.a)(Ct);function Ct(){var st;return Object(V.a)(this,Ct),st=Et.apply(this,arguments),st.resizeObserver=null,st.mutationObserver=null,st.originalTotalWidth=0,st.overflowedItems=[],st.menuItemSizes=[],st.cancelFrameId=null,st.state={lastVisibleIndex:void 0},st.getMenuItemNodes=function(){var de=st.props.prefixCls,Ae=fe.findDOMNode(Object(G.a)(st));return Ae?[].slice.call(Ae.children).filter(function(kt){return kt.className.split(" ").indexOf("".concat(de,"-overflowed-submenu"))<0}):[]},st.getOverflowedSubMenuItem=function(de,Ae,kt){var ct=st.props,Qt=ct.overflowedIndicator,un=ct.level,Le=ct.mode,qe=ct.prefixCls,mt=ct.theme;if(un!==1||Le!=="horizontal")return null;var jt=st.props.children[0],sn=jt.props,yn=sn.children,nr=sn.title,Kn=sn.style,wn=Object(ve.a)(sn,["children","title","style"]),br=Object(Z.a)({},Kn),Er="".concat(de,"-overflowed-indicator"),rr="".concat(de,"-overflowed-indicator");Ae.length===0&&kt!==!0?br=Object(Z.a)(Object(Z.a)({},br),{},{display:"none"}):kt&&(br=Object(Z.a)(Object(Z.a)({},br),{},{visibility:"hidden",position:"absolute"}),Er="".concat(Er,"-placeholder"),rr="".concat(rr,"-placeholder"));var cr=mt?"".concat(qe,"-").concat(mt):"",Pr={};return $e.forEach(function(Kr){wn[Kr]!==void 0&&(Pr[Kr]=wn[Kr])}),K.createElement(Wt,Object.assign({title:Qt,className:"".concat(qe,"-overflowed-submenu"),popupClassName:cr},Pr,{key:Er,eventKey:rr,disabled:!1,style:br}),Ae)},st.setChildrenWidthAndResize=function(){if(st.props.mode!=="horizontal")return;var de=fe.findDOMNode(Object(G.a)(st));if(!de)return;var Ae=de.children;if(!Ae||Ae.length===0)return;var kt=de.children[Ae.length-1];Ie(kt,"display","inline-block");var ct=st.getMenuItemNodes(),Qt=ct.filter(function(un){return un.className.split(" ").indexOf(Yt)>=0});Qt.forEach(function(un){Ie(un,"display","inline-block")}),st.menuItemSizes=ct.map(function(un){return xe(un,!0)}),Qt.forEach(function(un){Ie(un,"display","none")}),st.overflowedIndicatorWidth=xe(de.children[de.children.length-1],!0),st.originalTotalWidth=st.menuItemSizes.reduce(function(un,Le){return un+Le},0),st.handleResize(),Ie(kt,"display","none")},st.handleResize=function(){if(st.props.mode!=="horizontal")return;var de=fe.findDOMNode(Object(G.a)(st));if(!de)return;var Ae=xe(de);st.overflowedItems=[];var kt=0,ct;st.originalTotalWidth>Ae+on&&(ct=-1,st.menuItemSizes.forEach(function(Qt){kt+=Qt,kt+st.overflowedIndicatorWidth<=Ae&&(ct+=1)})),st.setState({lastVisibleIndex:ct})},st}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){var de=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Ae=fe.findDOMNode(this);if(!Ae)return;this.resizeObserver=new lt.default(function(kt){kt.forEach(function(){var ct=de.cancelFrameId;cancelAnimationFrame(ct),de.cancelFrameId=requestAnimationFrame(de.setChildrenWidthAndResize)})}),[].slice.call(Ae.children).concat(Ae).forEach(function(kt){de.resizeObserver.observe(kt)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){de.resizeObserver.disconnect(),[].slice.call(Ae.children).concat(Ae).forEach(function(kt){de.resizeObserver.observe(kt)}),de.setChildrenWidthAndResize()}),this.mutationObserver.observe(Ae,{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(de){var Ae=this,kt=this.state.lastVisibleIndex;return(de||[]).reduce(function(ct,Qt,un){var Le=Qt;if(Ae.props.mode==="horizontal"){var qe=Ae.getOverflowedSubMenuItem(Qt.props.eventKey,[]);kt!==void 0&&Ae.props.className.indexOf("".concat(Ae.props.prefixCls,"-root"))!==-1&&(un>kt&&(Le=K.cloneElement(Qt,{style:{display:"none"},eventKey:"".concat(Qt.props.eventKey,"-hidden"),className:"".concat(Yt)})),un===kt+1&&(Ae.overflowedItems=de.slice(kt+1).map(function(jt){return K.cloneElement(jt,{key:jt.props.eventKey,mode:"vertical-left"})}),qe=Ae.getOverflowedSubMenuItem(Qt.props.eventKey,Ae.overflowedItems)));var mt=[].concat(Object(Ye.a)(ct),[qe,Le]);return un===de.length-1&&mt.push(Ae.getOverflowedSubMenuItem(Qt.props.eventKey,[],!0)),mt}return[].concat(Object(Ye.a)(ct),[Le])},[])}},{key:"render",value:function(){var de=this.props,Ae=de.visible,kt=de.prefixCls,ct=de.overflowedIndicator,Qt=de.mode,un=de.level,Le=de.tag,qe=de.children,mt=de.theme,jt=Object(ve.a)(de,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),sn=Le;return K.createElement(sn,Object.assign({},jt),this.renderChildren(qe))}}]),Ct}(K.Component);nt.defaultProps={tag:"div",className:""};var tn=nt;function Ln(Jt){return Jt.length?Jt.every(function(Et){return!!Et.props.disabled}):!0}function We(Jt,Et,Ct){var st=Jt.getState();Jt.setState({activeKey:Object(Z.a)(Object(Z.a)({},st.activeKey),{},Object(b.a)({},Et,Ct))})}function Fe(Jt){return Jt.eventKey||"0-menu-"}function yt(Jt,Et){var Ct=Et,st=Jt.children,de=Jt.eventKey;if(Ct){var Ae;if(ie(st,function(kt,ct){kt&&kt.props&&!kt.props.disabled&&Ct===Y(kt,de,ct)&&(Ae=!0)}),Ae)return Ct}return Ct=null,Jt.defaultActiveFirst&&ie(st,function(kt,ct){!Ct&&kt&&!kt.props.disabled&&(Ct=Y(kt,de,ct))}),Ct}function At(Jt){if(Jt){var Et=this.instanceArray.indexOf(Jt);Et!==-1?this.instanceArray[Et]=Jt:this.instanceArray.push(Jt)}}var tt=function(Jt){Object(P.a)(Ct,Jt);var Et=Object(I.a)(Ct);function Ct(st){var de;return Object(V.a)(this,Ct),de=Et.call(this,st),de.onKeyDown=function(Ae,kt){var ct=Ae.keyCode,Qt;if(de.getFlatInstanceArray().forEach(function(Le){Le&&Le.props.active&&Le.onKeyDown&&(Qt=Le.onKeyDown(Ae))}),Qt)return 1;var un=null;return(ct===f.a.UP||ct===f.a.DOWN)&&(un=de.step(ct===f.a.UP?-1:1)),un?(Ae.preventDefault(),We(de.props.store,Fe(de.props),un.props.eventKey),typeof kt=="function"&&kt(un),1):void 0},de.onItemHover=function(Ae){var kt=Ae.key,ct=Ae.hover;We(de.props.store,Fe(de.props),ct?kt:null)},de.onDeselect=function(Ae){de.props.onDeselect(Ae)},de.onSelect=function(Ae){de.props.onSelect(Ae)},de.onClick=function(Ae){de.props.onClick(Ae)},de.onOpenChange=function(Ae){de.props.onOpenChange(Ae)},de.onDestroy=function(Ae){de.props.onDestroy(Ae)},de.getFlatInstanceArray=function(){return de.instanceArray},de.step=function(Ae){var kt=de.getFlatInstanceArray(),ct=de.props.store.getState().activeKey[Fe(de.props)],Qt=kt.length;if(!Qt)return null;Ae<0&&(kt=kt.concat().reverse());var un=-1;if(kt.every(function(jt,sn){return jt&&jt.props.eventKey===ct?(un=sn,!1):!0}),!de.props.defaultActiveFirst&&un!==-1&&Ln(kt.slice(un,Qt-1)))return;var Le=(un+1)%Qt,qe=Le;do{var mt=kt[qe];if(!mt||mt.props.disabled)qe=(qe+1)%Qt;else return mt}while(qe!==Le);return null},de.renderCommonMenuItem=function(Ae,kt,ct){var Qt=de.props.store.getState(),un=Object(G.a)(de),Le=un.props,qe=Y(Ae,Le.eventKey,kt),mt=Ae.props;if(!mt||typeof Ae.type=="string")return Ae;var jt=qe===Qt.activeKey,sn=Object(Z.a)(Object(Z.a)({mode:mt.mode||Le.mode,level:Le.level,inlineIndent:Le.inlineIndent,renderMenuItem:de.renderMenuItem,rootPrefixCls:Le.prefixCls,index:kt,parentMenu:Le.parentMenu,manualRef:mt.disabled?void 0:Object(m.a)(Ae.ref,At.bind(Object(G.a)(de))),eventKey:qe,active:!mt.disabled&&jt,multiple:Le.multiple,onClick:function(nr){(mt.onClick||x)(nr),de.onClick(nr)},onItemHover:de.onItemHover,motion:Le.motion,subMenuOpenDelay:Le.subMenuOpenDelay,subMenuCloseDelay:Le.subMenuCloseDelay,forceSubMenuRender:Le.forceSubMenuRender,onOpenChange:de.onOpenChange,onDeselect:de.onDeselect,onSelect:de.onSelect,builtinPlacements:Le.builtinPlacements,itemIcon:mt.itemIcon||de.props.itemIcon,expandIcon:mt.expandIcon||de.props.expandIcon},ct),{},{direction:Le.direction});return(Le.mode==="inline"||Je())&&(sn.triggerSubMenuAction="click"),K.cloneElement(Ae,sn)},de.renderMenuItem=function(Ae,kt,ct){if(!Ae)return null;var Qt=de.props.store.getState(),un={openKeys:Qt.openKeys,selectedKeys:Qt.selectedKeys,triggerSubMenuAction:de.props.triggerSubMenuAction,subMenuKey:ct};return de.renderCommonMenuItem(Ae,kt,un)},st.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},st.store.getState().activeKey),{},Object(b.a)({},st.eventKey,yt(st,st.activeKey)))}),de.instanceArray=[],de}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(de){return this.props.visible||de.visible||this.props.className!==de.className||!o()(this.props.style,de.style)}},{key:"componentDidUpdate",value:function(de){var Ae=this.props,kt="activeKey"in Ae?Ae.activeKey:Ae.store.getState().activeKey[Fe(Ae)],ct=yt(Ae,kt);if(ct!==kt)We(Ae.store,Fe(Ae),ct);else if("activeKey"in de){var Qt=yt(de,de.activeKey);ct!==Qt&&We(Ae.store,Fe(Ae),ct)}}},{key:"render",value:function(){var de=this,Ae=Object(M.a)({},this.props);this.instanceArray=[];var kt=c()(Ae.prefixCls,Ae.className,"".concat(Ae.prefixCls,"-").concat(Ae.mode)),ct={className:kt,role:Ae.role||"menu"};Ae.id&&(ct.id=Ae.id),Ae.focusable&&(ct.tabIndex=0,ct.onKeyDown=this.onKeyDown);var Qt=Ae.prefixCls,un=Ae.eventKey,Le=Ae.visible,qe=Ae.level,mt=Ae.mode,jt=Ae.overflowedIndicator,sn=Ae.theme;return $e.forEach(function(yn){return delete Ae[yn]}),delete Ae.onClick,K.createElement(tn,Object.assign({},Ae,{prefixCls:Qt,mode:mt,tag:"ul",level:qe,theme:sn,visible:Le,overflowedIndicator:jt},ct),K.Children.map(Ae.children,function(yn,nr){return de.renderMenuItem(yn,nr,un||"0-menu-")}))}}]),Ct}(K.Component);tt.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:x};var ot=Object(k.b)()(tt),De=ot,ye=D("Kwbf");function we(Jt,Et,Ct){var st=Jt.prefixCls,de=Jt.motion,Ae=Jt.defaultMotions,kt=Ae===void 0?{}:Ae,ct=Jt.openAnimation,Qt=Jt.openTransitionName,un=Et.switchingModeFromInline;if(de)return de;if(Object(s.a)(ct)==="object"&&ct)Object(ye.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof ct=="string")return{motionName:"".concat(st,"-open-").concat(ct)};if(Qt)return{motionName:Qt};var Le=kt[Ct];return Le||(un?null:kt.other)}var ae=function(Jt){Object(P.a)(Ct,Jt);var Et=Object(I.a)(Ct);function Ct(st){var de;Object(V.a)(this,Ct),de=Et.call(this,st),de.inlineOpenKeys=[],de.onSelect=function(ct){var Qt=Object(G.a)(de),un=Qt.props;if(un.selectable){var Le=de.store.getState(),qe=Le.selectedKeys,mt=ct.key;un.multiple?qe=qe.concat([mt]):qe=[mt],"selectedKeys"in un||de.store.setState({selectedKeys:qe}),un.onSelect(Object(Z.a)(Object(Z.a)({},ct),{},{selectedKeys:qe}))}},de.onClick=function(ct){var Qt=de.getRealMenuMode(),un=Object(G.a)(de),Le=un.store,qe=un.props.onOpenChange;Qt!=="inline"&&!("openKeys"in de.props)&&(Le.setState({openKeys:[]}),qe([])),de.props.onClick(ct)},de.onKeyDown=function(ct,Qt){de.innerMenu.getWrappedInstance().onKeyDown(ct,Qt)},de.onOpenChange=function(ct){var Qt=Object(G.a)(de),un=Qt.props,Le=de.store.getState().openKeys.concat(),qe=!1,mt=function(sn){var yn=!1;if(sn.open)yn=Le.indexOf(sn.key)===-1,yn&&Le.push(sn.key);else{var nr=Le.indexOf(sn.key);yn=nr!==-1,yn&&Le.splice(nr,1)}qe=qe||yn};Array.isArray(ct)?ct.forEach(mt):mt(ct),qe&&("openKeys"in de.props||de.store.setState({openKeys:Le}),un.onOpenChange(Le))},de.onDeselect=function(ct){var Qt=Object(G.a)(de),un=Qt.props;if(un.selectable){var Le=de.store.getState().selectedKeys.concat(),qe=ct.key,mt=Le.indexOf(qe);mt!==-1&&Le.splice(mt,1),"selectedKeys"in un||de.store.setState({selectedKeys:Le}),un.onDeselect(Object(Z.a)(Object(Z.a)({},ct),{},{selectedKeys:Le}))}},de.onMouseEnter=function(ct){de.restoreModeVerticalFromInline();var Qt=de.props.onMouseEnter;Qt&&Qt(ct)},de.onTransitionEnd=function(ct){var Qt=ct.propertyName==="width"&&ct.target===ct.currentTarget,un=ct.target.className,Le=Object.prototype.toString.call(un)==="[object SVGAnimatedString]"?un.animVal:un,qe=ct.propertyName==="font-size"&&Le.indexOf("anticon")>=0;(Qt||qe)&&de.restoreModeVerticalFromInline()},de.setInnerMenu=function(ct){de.innerMenu=ct},de.isRootMenu=!0;var Ae=st.defaultSelectedKeys,kt=st.defaultOpenKeys;return"selectedKeys"in st&&(Ae=st.selectedKeys||[]),"openKeys"in st&&(kt=st.openKeys||[]),de.store=Object(k.c)({selectedKeys:Ae,openKeys:kt,activeKey:{"0-menu-":yt(st,st.activeKey)}}),de.state={switchingModeFromInline:!1},de}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(de){this.updateOpentKeysWhenSwitchMode(de),this.updateMiniStore();var Ae=this.props,kt=Ae.siderCollapsed,ct=Ae.inlineCollapsed,Qt=Ae.onOpenChange;(!de.inlineCollapsed&&ct||!de.siderCollapsed&&kt)&&Qt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(de){var Ae=this.props,kt=this.store,ct=this.inlineOpenKeys,Qt=kt.getState(),un={};de.mode==="inline"&&Ae.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Ae||((Ae.inlineCollapsed&&!de.inlineCollapsed||Ae.siderCollapsed&&!de.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Qt.openKeys.concat(),un.openKeys=[]),(!Ae.inlineCollapsed&&de.inlineCollapsed||!Ae.siderCollapsed&&de.siderCollapsed)&&(un.openKeys=ct,this.inlineOpenKeys=[])),Object.keys(un).length&&kt.setState(un)}},{key:"updateMenuDisplay",value:function(){var de=this.props.collapsedWidth,Ae=this.store,kt=this.prevOpenKeys,ct=this.getInlineCollapsed()&&(de===0||de==="0"||de==="0px");ct?(this.prevOpenKeys=Ae.getState().openKeys.concat(),this.store.setState({openKeys:[]})):kt&&(this.store.setState({openKeys:kt}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var de=this.props.mode,Ae=this.state.switchingModeFromInline,kt=this.getInlineCollapsed();return Ae&&kt?"inline":kt?"vertical":de}},{key:"getInlineCollapsed",value:function(){var de=this.props,Ae=de.inlineCollapsed,kt=de.siderCollapsed;return kt!==void 0?kt:Ae}},{key:"restoreModeVerticalFromInline",value:function(){var de=this.state.switchingModeFromInline;de&&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 de=Object(Z.a)({},Object(r.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Ae=this.getRealMenuMode();return de.className+=" ".concat(de.prefixCls,"-root"),de.direction==="rtl"&&(de.className+=" ".concat(de.prefixCls,"-rtl")),de=Object(Z.a)(Object(Z.a)({},de),{},{mode:Ae,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:we(this.props,this.state,Ae)}),delete de.openAnimation,delete de.openTransitionName,K.createElement(k.a,{store:this.store},K.createElement(De,Object.assign({},de,{ref:this.setInnerMenu}),this.props.children))}}]),Ct}(K.Component);ae.defaultProps={selectable:!0,onClick:x,onSelect:x,onOpenChange:x,onDeselect:x,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:K.createElement("span",null,"\xB7\xB7\xB7")};var oe=ae,pe=function(Jt){Object(P.a)(Ct,Jt);var Et=Object(I.a)(Ct);function Ct(){var st;return Object(V.a)(this,Ct),st=Et.apply(this,arguments),st.onKeyDown=function(de){var Ae=de.keyCode;return Ae===f.a.ENTER?(st.onClick(de),!0):void 0},st.onMouseLeave=function(de){var Ae=st.props,kt=Ae.eventKey,ct=Ae.onItemHover,Qt=Ae.onMouseLeave;ct({key:kt,hover:!1}),Qt({key:kt,domEvent:de})},st.onMouseEnter=function(de){var Ae=st.props,kt=Ae.eventKey,ct=Ae.onItemHover,Qt=Ae.onMouseEnter;ct({key:kt,hover:!0}),Qt({key:kt,domEvent:de})},st.onClick=function(de){var Ae=st.props,kt=Ae.eventKey,ct=Ae.multiple,Qt=Ae.onClick,un=Ae.onSelect,Le=Ae.onDeselect,qe=Ae.isSelected,mt={key:kt,keyPath:[kt],item:Object(G.a)(st),domEvent:de};Qt(mt),ct?qe?Le(mt):un(mt):qe||un(mt)},st.saveNode=function(de){st.node=de},st}return Object(U.a)(Ct,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var de=this.props;de.onDestroy&&de.onDestroy(de.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 de,Ae=Object(Z.a)({},this.props),kt=c()(this.getPrefixCls(),Ae.className,(de={},Object(b.a)(de,this.getActiveClassName(),!Ae.disabled&&Ae.active),Object(b.a)(de,this.getSelectedClassName(),Ae.isSelected),Object(b.a)(de,this.getDisabledClassName(),Ae.disabled),de)),ct=Object(Z.a)(Object(Z.a)({},Ae.attribute),{},{title:typeof Ae.title=="string"?Ae.title:void 0,className:kt,role:Ae.role||"menuitem","aria-disabled":Ae.disabled});Ae.role==="option"?ct=Object(Z.a)(Object(Z.a)({},ct),{},{role:"option","aria-selected":Ae.isSelected}):(Ae.role===null||Ae.role==="none")&&(ct.role="none");var Qt={onClick:Ae.disabled?null:this.onClick,onMouseLeave:Ae.disabled?null:this.onMouseLeave,onMouseEnter:Ae.disabled?null:this.onMouseEnter},un=Object(Z.a)({},Ae.style);Ae.mode==="inline"&&(Ae.direction==="rtl"?un.paddingRight=Ae.inlineIndent*Ae.level:un.paddingLeft=Ae.inlineIndent*Ae.level),$e.forEach(function(qe){return delete Ae[qe]}),delete Ae.direction;var Le=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Le=K.createElement(this.props.itemIcon,this.props)),K.createElement("li",Object.assign({},Object(r.default)(Ae,["onClick","onMouseEnter","onMouseLeave","onSelect"]),ct,Qt,{style:un,ref:this.saveNode}),Ae.children,Le)}}]),Ct}(K.Component);pe.isMenuItem=!0,pe.defaultProps={onSelect:x,onMouseEnter:x,onMouseLeave:x,manualRef:x};var _e=Object(k.b)(function(Jt,Et){var Ct=Jt.activeKey,st=Jt.selectedKeys,de=Et.eventKey,Ae=Et.subMenuKey;return{active:Ct[Ae]===de,isSelected:st.indexOf(de)!==-1}})(pe),be=_e,Ke=function(Jt){Object(P.a)(Ct,Jt);var Et=Object(I.a)(Ct);function Ct(){var st;return Object(V.a)(this,Ct),st=Et.apply(this,arguments),st.renderInnerMenuItem=function(de){var Ae=st.props,kt=Ae.renderMenuItem,ct=Ae.index;return kt(de,ct,st.props.subMenuKey)},st}return Object(U.a)(Ct,[{key:"render",value:function(){var de=Object(M.a)({},this.props),Ae=de.className,kt=Ae===void 0?"":Ae,ct=de.rootPrefixCls,Qt="".concat(ct,"-item-group-title"),un="".concat(ct,"-item-group-list"),Le=de.title,qe=de.children;return $e.forEach(function(mt){return delete de[mt]}),delete de.onClick,delete de.direction,K.createElement("li",Object.assign({},de,{className:"".concat(kt," ").concat(ct,"-item-group")}),K.createElement("div",{className:Qt,title:typeof Le=="string"?Le:void 0},Le),K.createElement("ul",{className:un},K.Children.map(qe,this.renderInnerMenuItem)))}}]),Ct}(K.Component);Ke.isMenuItemGroup=!0,Ke.defaultProps={disabled:!0};var St=Ke,nn=function(Et){var Ct=Et.className,st=Et.rootPrefixCls,de=Et.style;return K.createElement("li",{className:"".concat(Ct," ").concat(st,"-item-divider"),style:de})};nn.defaultProps={disabled:!0,className:"",style:{}};var An=nn,bt=he.e=oe},"24hK":function(Kt,he,D){"use strict";D.d(he,"a",function(){return V});class Z{constructor(U){this.element=U,this.next=Z.Undefined,this.prev=Z.Undefined}}Z.Undefined=new Z(void 0);class V{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let U=this._first;for(;U!==Z.Undefined;){const G=U.next;U.prev=Z.Undefined,U.next=Z.Undefined,U=G}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(U){return this._insert(U,!1)}push(U){return this._insert(U,!0)}_insert(U,G){const P=new Z(U);if(this._first===Z.Undefined)this._first=P,this._last=P;else if(G){const K=this._last;this._last=P,P.prev=K,K.next=P}else{const K=this._first;this._first=P,P.next=K,K.prev=P}this._size+=1;let I=!1;return()=>{I||(I=!0,this._remove(P))}}shift(){if(this._first===Z.Undefined)return;{const U=this._first.element;return this._remove(this._first),U}}pop(){if(this._last===Z.Undefined)return;{const U=this._last.element;return this._remove(this._last),U}}_remove(U){if(U.prev!==Z.Undefined&&U.next!==Z.Undefined){const G=U.prev;G.next=U.next,U.next.prev=G}else U.prev===Z.Undefined&&U.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):U.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):U.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let U=this._first;for(;U!==Z.Undefined;)yield U.element,U=U.next}}},"3/fG":function(Kt,he,D){"use strict";D.d(he,"a",function(){return V});function Z(U,G){let P;return G.length===0?P=U:P=U.replace(/\{(\d+)\}/g,function(I,K){const k=K[0];return typeof G[k]!="undefined"?G[k]:I}),P}function V(U,G,...P){return Z(G,P)}},"4wi7":function(Kt,he,D){"use strict";var Z=D("14J3"),V=D("BMrR"),U=D("sRBo"),G=D("kaz8"),P=D("5NDa"),I=D("5rEg"),K=D("9og8"),k=D("tJVT"),r=D("WmNS"),M=D.n(r),b=D("q1tI"),f=D.n(b),m=D("oOBs"),l=D.n(m),o=D("xOL1"),a=D.n(o),c=D("BdwD"),s=function(n){var O=n.data,T=n.value,C=T===void 0?[]:T,R=n.handleChangePage,S=n.setSelectedRowKeys,v=n.selectedRowKeys,E=n.onChange,h=E===void 0?function(){}:E,p=Object(b.useState)([]),_=Object(k.a)(p,2),g=_[0],w=_[1],j=Object(b.useState)([]),B=Object(k.a)(j,2),A=B[0],H=B[1],F=Object(b.useState)([]),x=Object(k.a)(F,2),Y=x[0],q=x[1],ie=Object(b.useState)(1),me=Object(k.a)(ie,2),$e=me[0],xe=me[1],Ie=Object(b.useState)(),Je=Object(k.a)(Ie,2),Ye=Je[0],ve=Je[1];return Object(b.useEffect)(function(){w(O),H([]),q([])},[O]),Object(b.useEffect)(function(){S&&(H(v),q(v))},[v]),f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},f.a.createElement("div",{className:l.a.leftdiv},f.a.createElement(I.a.Search,{size:"large",onChange:function(){var fe=Object(K.a)(M.a.mark(function lt(qt){return M.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:w(O.filter(function(Ve){var vt;return Ve==null||((vt=Ve.name)===null||vt===void 0)?void 0:vt.includes(qt.target.value)}));case 1:case"end":return Ot.stop()}},lt)}));return function(lt){return fe.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),g.length===0&&f.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),f.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},f.a.createElement(G.a.Group,{value:A.map(function(fe){return"".concat(fe.id)}),onChange:function(lt){S(g.filter(function(qt){return lt.includes("".concat(qt.id))}))},style:{marginTop:"10px"}},g.map(function(fe,lt){return f.a.createElement(V.a,{key:fe.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},f.a.createElement(G.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:fe.is_published,value:"".concat(fe.id)},f.a.createElement("div",{className:l.a.listClass},f.a.createElement("span",{className:l.a.spantitle,style:{width:fe.is_published?"108px":"170px"}},fe.name),fe.is_published&&f.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),f.a.createElement("div",{className:l.a.rightdiv},f.a.createElement(I.a.Search,{onChange:function(lt){q(A.filter(function(qt){return qt.name.includes(lt.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),Y.length===0&&f.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),Y.length>0&&f.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},f.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},Y.map(function(fe,lt){return f.a.createElement(V.a,{justify:"space-between",style:{marginTop:"10px"},key:fe.id},f.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},fe.name),f.a.createElement("img",{src:a.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){S(A.filter(function(Ft){return"".concat(Ft.id)!="".concat(fe.id)}))}}))})))))};he.a=s},"55Ip":function(Kt,he,D){"use strict";D.d(he,"a",function(){return i});var Z=D("Ty5D"),V=D("dI71"),U=D("q1tI"),G=D.n(U),P=D("YS25"),I=D("17x9"),K=D.n(I),k=D("wx14"),r=D("zLVn"),M=D("9R94"),b=function(E){Object(V.a)(h,E);function h(){for(var _,g=arguments.length,w=new Array(g),j=0;j<g;j++)w[j]=arguments[j];return _=E.call.apply(E,[this].concat(w))||this,_.history=Object(P.a)(_.props),_}var p=h.prototype;return p.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},h}(G.a.Component),f=function(E){Object(V.a)(h,E);function h(){for(var _,g=arguments.length,w=new Array(g),j=0;j<g;j++)w[j]=arguments[j];return _=E.call.apply(E,[this].concat(w))||this,_.history=Object(P.b)(_.props),_}var p=h.prototype;return p.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},h}(G.a.Component),m=function(h,p){return typeof h=="function"?h(p):h},l=function(h,p){return typeof h=="string"?Object(P.c)(h,null,null,p):h},o=function(h){return h},a=G.a.forwardRef;typeof a=="undefined"&&(a=o);function c(E){return!!(E.metaKey||E.altKey||E.ctrlKey||E.shiftKey)}var s=a(function(E,h){var p=E.innerRef,_=E.navigate,g=E.onClick,w=Object(r.a)(E,["innerRef","navigate","onClick"]),j=w.target,B=Object(k.a)({},w,{onClick:function(H){try{g&&g(H)}catch(F){throw H.preventDefault(),F}!H.defaultPrevented&&H.button===0&&(!j||j==="_self")&&!c(H)&&(H.preventDefault(),_())}});return o!==a?B.ref=h||p:B.ref=p,G.a.createElement("a",B)}),i=a(function(E,h){var p=E.component,_=p===void 0?s:p,g=E.replace,w=E.to,j=E.innerRef,B=Object(r.a)(E,["component","replace","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(A){A||Object(M.a)(!1);var H=A.history,F=l(m(w,A.location),A.location),x=F?H.createHref(F):"",Y=Object(k.a)({},B,{href:x,navigate:function(){var ie=m(w,A.location),me=g?H.replace:H.push;me(ie)}});return o!==a?Y.ref=h||j:Y.innerRef=j,G.a.createElement(_,Y)})});if(!1)var n,O;var T=function(h){return h},C=G.a.forwardRef;typeof C=="undefined"&&(C=T);function R(){for(var E=arguments.length,h=new Array(E),p=0;p<E;p++)h[p]=arguments[p];return h.filter(function(_){return _}).join(" ")}var S=C(function(E,h){var p=E["aria-current"],_=p===void 0?"page":p,g=E.activeClassName,w=g===void 0?"active":g,j=E.activeStyle,B=E.className,A=E.exact,H=E.isActive,F=E.location,x=E.sensitive,Y=E.strict,q=E.style,ie=E.to,me=E.innerRef,$e=Object(r.a)(E,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(xe){xe||Object(M.a)(!1);var Ie=F||xe.location,Je=l(m(ie,Ie),Ie),Ye=Je.pathname,ve=Ye&&Ye.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),fe=ve?Object(Z.f)(Ie.pathname,{path:ve,exact:A,sensitive:x,strict:Y}):null,lt=!!(H?H(fe,Ie):fe),qt=lt?R(B,w):B,Ft=lt?Object(k.a)({},q,{},j):q,Ot=Object(k.a)({"aria-current":lt&&_||null,className:qt,style:Ft,to:Je},$e);return T!==C?Ot.ref=h||me:Ot.innerRef=me,G.a.createElement(i,Ot)})});if(!1)var v},"5VLF":function(Kt,he,D){"use strict";var Z,V;function U(G,P,I){var K=function(k,r){return G.js_beautify(k,r)};return K.js=G.js_beautify,K.css=P.css_beautify,K.html=I.html_beautify,K.js_beautify=G.js_beautify,K.css_beautify=P.css_beautify,K.html_beautify=I.html_beautify,K}!(Z=[D("6UM0"),D("TXwP"),D("psGv")],V=function(G,P,I){return U(G,P,I)}.apply(he,Z),V!==void 0&&(Kt.exports=V))},"5Y4S":function(Kt,he,D){"use strict";D.d(he,"a",function(){return U});var Z=D("MNsG");const V=Z.b.performance&&typeof Z.b.performance.now=="function";class U{constructor(G){this._highResolution=V&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new U(G)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?Z.b.performance.now():Date.now()}}},"6+eU":function(Kt,he,D){"use strict";D.d(he,"a",function(){return C});var Z=D("wx14"),V=D("rePB"),U=D("VTBJ"),G=D("1OyB"),P=D("vuIU"),I=D("Ji7U"),K=D("LK+K"),k=D("q1tI"),r=D.n(k),M=D("TSYQ"),b=D.n(M),f=function(S){var v,E="".concat(S.rootPrefixCls,"-item"),h=b()(E,"".concat(E,"-").concat(S.page),(v={},Object(V.a)(v,"".concat(E,"-active"),S.active),Object(V.a)(v,S.className,!!S.className),Object(V.a)(v,"".concat(E,"-disabled"),!S.page),v)),p=function(){S.onClick(S.page)},_=function(w){S.onKeyPress(w,S.onClick,S.page)};return r.a.createElement("li",{title:S.showTitle?S.page:null,className:h,onClick:p,onKeyPress:_,tabIndex:"0"},S.itemRender(S.page,"page",r.a.createElement("a",{rel:"nofollow"},S.page)))},m=f,l={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(R){Object(I.a)(v,R);var S=Object(K.a)(v);function v(){var E;Object(G.a)(this,v);for(var h=arguments.length,p=new Array(h),_=0;_<h;_++)p[_]=arguments[_];return E=S.call.apply(S,[this].concat(p)),E.state={goInputText:""},E.buildOptionText=function(g){return"".concat(g," ").concat(E.props.locale.items_per_page)},E.changeSize=function(g){E.props.changeSize(Number(g))},E.handleChange=function(g){E.setState({goInputText:g.target.value})},E.handleBlur=function(g){var w=E.props,j=w.goButton,B=w.quickGo,A=w.rootPrefixCls,H=E.state.goInputText;if(j||H==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;E.setState({goInputText:""}),B(E.getValidValue())},E.go=function(g){var w=E.state.goInputText;if(w==="")return;(g.keyCode===l.ENTER||g.type==="click")&&(E.setState({goInputText:""}),E.props.quickGo(E.getValidValue()))},E}return Object(P.a)(v,[{key:"getValidValue",value:function(){var h=this.state,p=h.goInputText,_=h.current;return!p||isNaN(p)?_:Number(p)}},{key:"getPageSizeOptions",value:function(){var h=this.props,p=h.pageSize,_=h.pageSizeOptions;return _.some(function(g){return g.toString()===p.toString()})?_:_.concat([p.toString()]).sort(function(g,w){var j=isNaN(Number(g))?0:Number(g),B=isNaN(Number(w))?0:Number(w);return j-B})}},{key:"render",value:function(){var h=this,p=this.props,_=p.pageSize,g=p.locale,w=p.rootPrefixCls,j=p.changeSize,B=p.quickGo,A=p.goButton,H=p.selectComponentClass,F=p.buildOptionText,x=p.selectPrefixCls,Y=p.disabled,q=this.state.goInputText,ie="".concat(w,"-options"),me=H,$e=null,xe=null,Ie=null;if(!j&&!B)return null;var Je=this.getPageSizeOptions();if(j&&me){var Ye=Je.map(function(ve,fe){return r.a.createElement(me.Option,{key:fe,value:ve.toString()},(F||h.buildOptionText)(ve))});$e=r.a.createElement(me,{disabled:Y,prefixCls:x,showSearch:!1,className:"".concat(ie,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||Je[0]).toString(),onChange:this.changeSize,getPopupContainer:function(fe){return fe.parentNode}},Ye)}return B&&(A&&(Ie=typeof A=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Y,className:"".concat(ie,"-quick-jumper-button")},g.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),xe=r.a.createElement("div",{className:"".concat(ie,"-quick-jumper")},g.jump_to,r.a.createElement("input",{disabled:Y,type:"text",value:q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,Ie)),r.a.createElement("li",{className:"".concat(ie)},$e,xe)}}]),v}(r.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var a=o,c=D("N2Kk");function s(){}function i(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function n(R,S,v){return v}function O(R,S,v){var E=typeof R=="undefined"?S.pageSize:R;return Math.floor((v.total-1)/E)+1}var T=function(R){Object(I.a)(v,R);var S=Object(K.a)(v);function v(E){var h;Object(G.a)(this,v),h=S.call(this,E),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(O(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(j,B){var A=h.props.prefixCls,H=j||r.a.createElement("button",{type:"button","aria-label":B,className:"".concat(A,"-item-link")});return typeof j=="function"&&(H=r.a.createElement(j,Object(U.a)({},h.props))),H},h.savePaginationNode=function(j){h.paginationNode=j},h.isValid=function(j){return i(j)&&j!==h.state.current},h.shouldDisplayQuickJumper=function(){var j=h.props,B=j.showQuickJumper,A=j.pageSize,H=j.total;return H<=A?!1:B},h.handleKeyDown=function(j){(j.keyCode===l.ARROW_UP||j.keyCode===l.ARROW_DOWN)&&j.preventDefault()},h.handleKeyUp=function(j){var B=h.getValidValue(j),A=h.state.currentInputValue;B!==A&&h.setState({currentInputValue:B}),j.keyCode===l.ENTER?h.handleChange(B):j.keyCode===l.ARROW_UP?h.handleChange(B-1):j.keyCode===l.ARROW_DOWN&&h.handleChange(B+1)},h.changePageSize=function(j){var B=h.state.current,A=O(j,h.state,h.props);B=B>A?A:B,A===0&&(B=h.state.current),typeof j=="number"&&("pageSize"in h.props||h.setState({pageSize:j}),"current"in h.props||h.setState({current:B,currentInputValue:B})),h.props.onShowSizeChange(B,j),"onChange"in h.props&&h.props.onChange&&h.props.onChange(B,j)},h.handleChange=function(j){var B=h.props.disabled,A=j;if(h.isValid(A)&&!B){var H=O(void 0,h.state,h.props);A>H?A=H:A<1&&(A=1),"current"in h.props||h.setState({current:A,currentInputValue:A});var F=h.state.pageSize;return h.props.onChange(A,F),A}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<O(void 0,h.state,h.props)},h.runIfEnter=function(j,B){if(j.key==="Enter"||j.charCode===13){for(var A=arguments.length,H=new Array(A>2?A-2:0),F=2;F<A;F++)H[F-2]=arguments[F];B.apply(void 0,H)}},h.runIfEnterPrev=function(j){h.runIfEnter(j,h.prev)},h.runIfEnterNext=function(j){h.runIfEnter(j,h.next)},h.runIfEnterJumpPrev=function(j){h.runIfEnter(j,h.jumpPrev)},h.runIfEnterJumpNext=function(j){h.runIfEnter(j,h.jumpNext)},h.handleGoTO=function(j){(j.keyCode===l.ENTER||j.type==="click")&&h.handleChange(h.state.currentInputValue)};var p=E.onChange!==s,_="current"in E;_&&!p&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var g=E.defaultCurrent;"current"in E&&(g=E.current);var w=E.defaultPageSize;return"pageSize"in E&&(w=E.pageSize),g=Math.min(g,O(w,void 0,E)),h.state={current:g,currentInputValue:g,pageSize:w},h}return Object(P.a)(v,[{key:"componentDidUpdate",value:function(h,p){var _=this.props.prefixCls;if(p.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(_,"-item-").concat(p.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(h){var p=h.target.value,_=O(void 0,this.state,this.props),g=this.state.currentInputValue,w;return p===""?w=p:isNaN(Number(p))?w=g:p>=_?w=_:w=Number(p),w}},{key:"getShowSizeChanger",value:function(){var h=this.props,p=h.showSizeChanger,_=h.total,g=h.totalBoundaryShowSizeChanger;return typeof p!="undefined"?p:_>g}},{key:"renderPrev",value:function(h){var p=this.props,_=p.prevIcon,g=p.itemRender,w=g(h,"prev",this.getItemIcon(_,"prev page")),j=!this.hasPrev();return Object(k.isValidElement)(w)?Object(k.cloneElement)(w,{disabled:j}):w}},{key:"renderNext",value:function(h){var p=this.props,_=p.nextIcon,g=p.itemRender,w=g(h,"next",this.getItemIcon(_,"next page")),j=!this.hasNext();return Object(k.isValidElement)(w)?Object(k.cloneElement)(w,{disabled:j}):w}},{key:"render",value:function(){var h=this,p=this.props,_=p.prefixCls,g=p.className,w=p.style,j=p.disabled,B=p.hideOnSinglePage,A=p.total,H=p.locale,F=p.showQuickJumper,x=p.showLessItems,Y=p.showTitle,q=p.showTotal,ie=p.simple,me=p.itemRender,$e=p.showPrevNextJumpers,xe=p.jumpPrevIcon,Ie=p.jumpNextIcon,Je=p.selectComponentClass,Ye=p.selectPrefixCls,ve=p.pageSizeOptions,fe=this.state,lt=fe.current,qt=fe.pageSize,Ft=fe.currentInputValue;if(B===!0&&A<=qt)return null;var Ot=O(void 0,this.state,this.props),Ve=[],vt=null,ht=null,Bt=null,se=null,Ue=null,Ge=F&&F.goButton,et=x?1:2,Wt=lt-1>0?lt-1:0,Yt=lt+1<Ot?lt+1:Ot,on=Object.keys(this.props).reduce(function(ae,oe){return(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(ae[oe]=h.props[oe]),ae},{});if(ie)return Ge&&(typeof Ge=="boolean"?Ue=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):Ue=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ge),Ue=r.a.createElement("li",{title:Y?"".concat(H.jump_to).concat(lt,"/").concat(Ot):null,className:"".concat(_,"-simple-pager")},Ue)),r.a.createElement("ul",Object(Z.a)({className:b()(_,"".concat(_,"-simple"),Object(V.a)({},"".concat(_,"-disabled"),j),g),style:w,ref:this.savePaginationNode},on),r.a.createElement("li",{title:Y?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(_,"-prev"),Object(V.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Wt)),r.a.createElement("li",{title:Y?"".concat(lt,"/").concat(Ot):null,className:"".concat(_,"-simple-pager")},r.a.createElement("input",{type:"text",value:Ft,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(_,"-slash")},"/"),Ot),r.a.createElement("li",{title:Y?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(_,"-next"),Object(V.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Yt)),Ue);if(Ot<=3+et*2){var nt={locale:H,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:Y,itemRender:me};Ot||Ve.push(r.a.createElement(m,Object(Z.a)({},nt,{key:"noPager",page:Ot,className:"".concat(_,"-disabled")})));for(var tn=1;tn<=Ot;tn+=1){var Ln=lt===tn;Ve.push(r.a.createElement(m,Object(Z.a)({},nt,{key:tn,page:tn,active:Ln})))}}else{var We=x?H.prev_3:H.prev_5,Fe=x?H.next_3:H.next_5;$e&&(vt=r.a.createElement("li",{title:Y?We:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(_,"-jump-prev"),Object(V.a)({},"".concat(_,"-jump-prev-custom-icon"),!!xe))},me(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),ht=r.a.createElement("li",{title:Y?Fe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(_,"-jump-next"),Object(V.a)({},"".concat(_,"-jump-next-custom-icon"),!!Ie))},me(this.getJumpNextPage(),"jump-next",this.getItemIcon(Ie,"next page")))),se=r.a.createElement(m,{locale:H,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Ot,page:Ot,active:!1,showTitle:Y,itemRender:me}),Bt=r.a.createElement(m,{locale:H,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:Y,itemRender:me});var yt=Math.max(1,lt-et),At=Math.min(lt+et,Ot);lt-1<=et&&(At=1+et*2),Ot-lt<=et&&(yt=Ot-et*2);for(var tt=yt;tt<=At;tt+=1){var ot=lt===tt;Ve.push(r.a.createElement(m,{locale:H,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:tt,page:tt,active:ot,showTitle:Y,itemRender:me}))}lt-1>=et*2&&lt!==1+2&&(Ve[0]=Object(k.cloneElement)(Ve[0],{className:"".concat(_,"-item-after-jump-prev")}),Ve.unshift(vt)),Ot-lt>=et*2&&lt!==Ot-2&&(Ve[Ve.length-1]=Object(k.cloneElement)(Ve[Ve.length-1],{className:"".concat(_,"-item-before-jump-next")}),Ve.push(ht)),yt!==1&&Ve.unshift(Bt),At!==Ot&&Ve.push(se)}var De=null;q&&(De=r.a.createElement("li",{className:"".concat(_,"-total-text")},q(A,[A===0?0:(lt-1)*qt+1,lt*qt>A?A:lt*qt])));var ye=!this.hasPrev()||!Ot,we=!this.hasNext()||!Ot;return r.a.createElement("ul",Object(Z.a)({className:b()(_,g,Object(V.a)({},"".concat(_,"-disabled"),j)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},on),De,r.a.createElement("li",{title:Y?H.prev_page:null,onClick:this.prev,tabIndex:ye?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(_,"-prev"),Object(V.a)({},"".concat(_,"-disabled"),ye)),"aria-disabled":ye},this.renderPrev(Wt)),Ve,r.a.createElement("li",{title:Y?H.next_page:null,onClick:this.next,tabIndex:we?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(_,"-next"),Object(V.a)({},"".concat(_,"-disabled"),we)),"aria-disabled":we},this.renderNext(Yt)),r.a.createElement(a,{disabled:j,locale:H,rootPrefixCls:_,selectComponentClass:Je,selectPrefixCls:Ye,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:lt,pageSize:qt,pageSizeOptions:ve,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ge}))}}],[{key:"getDerivedStateFromProps",value:function(h,p){var _={};if("current"in h&&(_.current=h.current,h.current!==p.current&&(_.currentInputValue=_.current)),"pageSize"in h&&h.pageSize!==p.pageSize){var g=p.current,w=O(h.pageSize,p,h);g=g>w?w:g,"current"in h||(_.current=g,_.currentInputValue=g),_.pageSize=h.pageSize}return _}}]),v}(r.a.Component);T.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:c.a,style:{},itemRender:n,totalBoundaryShowSizeChanger:50};var C=T},"6RRn":function(Kt,he,D){"use strict";var Z=D("wCXF"),V=D("n6Qo");D.d(he,"b",function(){return V.a});var U=D("IBYe"),G=D("6eGT"),P=D("hW8S");D.d(he,"a",function(){return P.a}),he.c=Z.b},"6UM0":function(Kt,he,D){var Z,V;(function(){var U;(function(){"use strict";var P=[function(r,M,b){var f=b(1).Beautifier,m=b(5).Options;function l(o,a){var c=new f(o,a);return c.beautify()}r.exports=l,r.exports.defaultOptions=function(){return new m}},function(r,M,b){var f=b(2).Output,m=b(3).Token,l=b(4),o=b(5).Options,a=b(7).Tokenizer,c=b(7).line_starters,s=b(7).positionable_operators,i=b(7).TOKEN;function n(x,Y){return Y.indexOf(x)!==-1}function O(x){return x.replace(/^\s+/g,"")}function T(x){for(var Y={},q=0;q<x.length;q++)Y[x[q].replace(/-/g,"_")]=x[q];return Y}function C(x,Y){return x&&x.type===i.RESERVED&&x.text===Y}function R(x,Y){return x&&x.type===i.RESERVED&&n(x.text,Y)}var S=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],E=T(v),h=[E.before_newline,E.preserve_newline],p={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(x,Y){if(Y.multiline_frame||Y.mode===p.ForInitializer||Y.mode===p.Conditional)return;x.remove_indent(Y.start_line_index)}function g(x){x=x.replace(l.allLineBreaks,`
`);for(var Y=[],q=x.indexOf(`
`);q!==-1;)Y.push(x.substring(0,q)),x=x.substring(q+1),q=x.indexOf(`
`);return x.length&&Y.push(x),Y}function w(x){return x===p.ArrayLiteral}function j(x){return n(x,[p.Expression,p.ForInitializer,p.Conditional])}function B(x,Y){for(var q=0;q<x.length;q++){var ie=x[q].trim();if(ie.charAt(0)!==Y)return!1}return!0}function A(x,Y){for(var q=0,ie=x.length,me;q<ie;q++)if(me=x[q],me&&me.indexOf(Y)!==0)return!1;return!0}function H(x,Y){Y=Y||{},this._source_text=x||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new o(Y)}H.prototype.create_flags=function(x,Y){var q=0;x&&(q=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>q&&(q=x.line_indent_level));var ie={mode:Y,parent:x,last_token:x?x.last_token:new m(i.START_BLOCK,""),last_word:x?x.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:q,alignment:0,line_indent_level:x?x.line_indent_level:q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},H.prototype._reset=function(x){var Y=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(p.BlockStatement);var q=new a(x,this._options);return this._tokens=q.tokenize(),x},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,Y=this._reset(this._source_text),q=this._options.eol;this._options.eol==="auto"&&(q=`
`,Y&&l.lineBreak.test(Y||"")&&(q=Y.match(l.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return x=this._output.get_code(q),x},H.prototype.handle_token=function(x,Y){x.type===i.START_EXPR?this.handle_start_expr(x):x.type===i.END_EXPR?this.handle_end_expr(x):x.type===i.START_BLOCK?this.handle_start_block(x):x.type===i.END_BLOCK?this.handle_end_block(x):x.type===i.WORD?this.handle_word(x):x.type===i.RESERVED?this.handle_word(x):x.type===i.SEMICOLON?this.handle_semicolon(x):x.type===i.STRING?this.handle_string(x):x.type===i.EQUALS?this.handle_equals(x):x.type===i.OPERATOR?this.handle_operator(x):x.type===i.COMMA?this.handle_comma(x):x.type===i.BLOCK_COMMENT?this.handle_block_comment(x,Y):x.type===i.COMMENT?this.handle_comment(x,Y):x.type===i.DOT?this.handle_dot(x):x.type===i.EOF?this.handle_eof(x):x.type===i.UNKNOWN?this.handle_unknown(x,Y):this.handle_unknown(x,Y)},H.prototype.handle_whitespace_and_comments=function(x,Y){var q=x.newlines,ie=this._options.keep_array_indentation&&w(this._flags.mode);if(x.comments_before)for(var me=x.comments_before.next();me;)this.handle_whitespace_and_comments(me,Y),this.handle_token(me,Y),me=x.comments_before.next();if(ie)for(var $e=0;$e<q;$e+=1)this.print_newline($e>0,Y);else if(this._options.max_preserve_newlines&&q>this._options.max_preserve_newlines&&(q=this._options.max_preserve_newlines),this._options.preserve_newlines&&q>1){this.print_newline(!1,Y);for(var xe=1;xe<q;xe+=1)this.print_newline(!0,Y)}};var F=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(x,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var q=this._options.preserve_newlines&&x.newlines||Y,ie=n(this._flags.last_token.text,s)||n(x.text,s);if(ie){var me=n(this._flags.last_token.text,s)&&n(this._options.operator_position,h)||n(x.text,s);q=q&&me}if(q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,F))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(x,Y){if(!Y&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var q=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&C(q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(x.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},H.prototype.print_token=function(x){if(this._output.raw){this._output.add_raw_token(x);return}if(this._options.comma_first&&x.previous&&x.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var Y=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(Y),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(x),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(x),this._output.non_breaking_space=!0,this._output.add_token(x.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===p.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(x){var Y=!1;return Y=Y||R(this._flags.last_token,["var","let","const"])&&x.type===i.WORD,Y=Y||C(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===p.ObjectLiteral&&this._flags.mode===p.Statement)&&R(this._flags.last_token,F)&&!x.newlines,Y=Y||C(this._flags.last_token,"else")&&!(C(x,"if")&&!x.comments_before),Y=Y||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===p.ForInitializer||this._previous_flags.mode===p.Conditional),Y=Y||this._flags.last_token.type===i.WORD&&this._flags.mode===p.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==i.WORD&&x.type!==i.RESERVED,Y=Y||this._flags.mode===p.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),Y?(this.set_mode(p.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,R(x,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var Y=p.Expression;if(x.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,c)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=p.ArrayLiteral,w(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),n(this._flags.last_token.type,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,Y=p.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=p.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(n(this._flags.last_token.text,c)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var q=this._tokens.peek(-3);if(this._options.space_after_named_function&&q){var ie=this._tokens.peek(-4);R(q,["async","function"])||q.text==="*"&&R(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===p.ObjectLiteral?(q.text==="{"||q.text===","||q.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(x);(this._flags.last_token.type===i.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&n(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(x,x.newlines),this.print_token(x),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(x){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(x),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===p.Conditional&&(this._previous_flags.mode=p.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var Y=this._tokens.peek(),q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(p.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(p.BlockStatement):q&&(n(q.text,[":",","])&&n(Y.type,[i.STRING,i.WORD,i.RESERVED])||n(Y.text,["get","set","..."])&&n(q.type,[i.WORD,i.RESERVED]))?n(this._last_last_text,["class","interface"])&&!n(q.text,[":",","])?this.set_mode(p.BlockStatement):this.set_mode(p.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(p.BlockStatement):n(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(p.ObjectLiteral):this.set_mode(p.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!Y.comments_before&&Y.text==="}",me=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var $e=0,xe=null;this._flags.inline_frame=!0;do if($e+=1,xe=this._tokens.peek($e-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==i.EOF&&!(xe.type===i.END_BLOCK&&xe.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(me||this._flags.last_token.type===i.EQUALS||R(this._flags.last_token,S)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(x),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===p.Statement;)this.restore_mode();var Y=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!Y?this._output.space_before_token=!0:this._options.brace_style==="expand"?Y||this.print_newline():Y||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},H.prototype.handle_word=function(x){if(x.type===i.RESERVED){if(n(x.text,["set","get"])&&this._flags.mode!==p.ObjectLiteral)x.type=i.WORD;else if(x.text==="import"&&n(this._tokens.peek().text,["(","."]))x.type=i.WORD;else if(n(x.text,["as","from"])&&!this._flags.import_block)x.type=i.WORD;else if(this._flags.mode===p.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(x.type=i.WORD)}}if(this.start_of_statement(x)?R(this._flags.last_token,["var","let","const"])&&x.type===i.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(C(x,"while")){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&C(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===p.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(x,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x)),C(x,"function")){(n(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(n(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,F)?this._output.space_before_token=!0:C(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var q="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?q="SPACE":R(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?q="NEWLINE":(q="SPACE",this._output.space_before_token=!0):q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===p.BlockStatement?q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&j(this._flags.mode)?q="SPACE":this._flags.last_token.type===i.STRING?q="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(n(this._last_last_text,["function","yield"])||this._flags.mode===p.ObjectLiteral&&n(this._last_last_text,["{",","]))?q="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?q="SPACE":q="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,q="NEWLINE"),R(x,c)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?q="SPACE":q="NEWLINE"),R(x,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===p.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else q==="NEWLINE"?R(this._flags.last_token,S)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!R(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(x,"if")&&C(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(x,c)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():q==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===i.WORD||x.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===i.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(x,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var Y=this._tokens.peek();this._flags.mode===p.Statement&&!(this._flags.if_block&&C(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},H.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x):x.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},H.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},H.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(j(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)):this._flags.mode===p.ObjectLiteral||this._flags.mode===p.Statement&&this._flags.parent.mode===p.ObjectLiteral?(this._flags.mode===p.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},H.prototype.handle_operator=function(x){var Y=x.text==="*"&&(R(this._flags.last_token,["function","yield"])||n(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),q=n(x.text,["-","+"])&&(n(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||n(this._flags.last_token.text,c)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var ie=!Y;this.handle_whitespace_and_comments(x,ie)}if(x.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(this._flags.last_token.type===i.OPERATOR&&n(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var me=!0,$e=!0,xe=!1;if(x.text===":"?this._flags.ternary_depth===0?me=!1:(this._flags.ternary_depth-=1,xe=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!q&&!Y&&this._options.preserve_newlines&&n(x.text,s)){var Ie=x.text===":",Je=Ie&&xe,Ye=Ie&&!xe;switch(this._options.operator_position){case E.before_newline:this._output.space_before_token=!Ye,this.print_token(x),(!Ie||Je)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case E.after_newline:this._output.space_before_token=!0,!Ie||Je?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case E.preserve_newline:Ye||this.allow_wrap_or_preserved_newline(x),me=!(this._output.just_added_newline()||Ye),this._output.space_before_token=me,this.print_token(x),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(x),me=!1;var ve=this._tokens.peek();$e=ve&&n(ve.type,[i.WORD,i.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),me=this._flags.last_token.type===i.START_BLOCK,$e=!1;else if(n(x.text,["--","++","!","~"])||q){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),me=!1,$e=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var fe=R(this._flags.last_token,S)&&x.newlines;fe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(fe,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(me=!0),this._flags.last_token.type===i.RESERVED?me=!0:this._flags.last_token.type===i.END_EXPR?me=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===i.OPERATOR&&(me=n(x.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(x.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&($e=!0)),(this._flags.mode===p.BlockStatement&&!this._flags.inline_frame||this._flags.mode===p.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||me,this.print_token(x),this._output.space_before_token=$e},H.prototype.handle_block_comment=function(x,Y){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,Y),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!l.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,Y)},H.prototype.print_block_commment=function(x,Y){var q=g(x.text),ie,me=!1,$e=!1,xe=x.whitespace_before,Ie=xe.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(x),this._output.add_token(q[0]),this.print_newline(!1,Y),q.length>1){for(q=q.slice(1),me=B(q,"*"),$e=A(q,xe),me&&(this._flags.alignment=1),ie=0;ie<q.length;ie++)me?(this.print_token_line_indentation(x),this._output.add_token(O(q[ie]))):$e&&q[ie]?(this.print_token_line_indentation(x),this._output.add_token(q[ie].substring(Ie))):(this._output.current_line.set_indent(-1),this._output.add_token(q[ie])),this.print_newline(!1,Y);this._flags.alignment=0}},H.prototype.handle_comment=function(x,Y){x.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,Y)},H.prototype.handle_dot=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,S)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(x,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(x)},H.prototype.handle_unknown=function(x,Y){this.print_token(x),x.text[x.text.length-1]===`
`&&this.print_newline(!1,Y)},H.prototype.handle_eof=function(x){for(;this._flags.mode===p.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},r.exports.Beautifier=H},function(r){function M(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}M.prototype.clone_empty=function(){var m=new M(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},M.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},M.prototype.has_match=function(m){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(m))return!0;return!1},M.prototype.set_indent=function(m,l){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},M.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},M.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},M.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},M.prototype.is_empty=function(){return this.__items.length===0},M.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},M.prototype.push=function(m){this.__items.push(m);var l=m.lastIndexOf(`
`);l!==-1?this.__character_count=m.length-l:this.__character_count+=m.length},M.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},M.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},M.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},M.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},M.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function b(m,l){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),l=l||"",m.indent_level>0&&(l=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}b.prototype.get_indent_size=function(m,l){var o=this.__base_string_length;return l=l||0,m<0&&(o=0),o+=m*this.__indent_size,o+=l,o},b.prototype.get_indent_string=function(m,l){var o=this.__base_string;return l=l||0,m<0&&(m=0,o=""),l+=m*this.__indent_size,this.__ensure_cache(l),o+=this.__cache[l],o},b.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var m=this.__cache.length,l=0,o="";this.__indent_size&&m>=this.__indent_size&&(l=Math.floor(m/this.__indent_size),m-=l*this.__indent_size,o=new Array(l+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function f(m,l){this.__indent_cache=new b(m,l),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new M(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(m,l){return this.__indent_cache.get_indent_string(m,l)},f.prototype.get_indent_size=function(m,l){return this.__indent_cache.get_indent_size(m,l)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(m){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return m!==`
`&&(o=o.replace(/[\n]/g,m)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(m,l){return m=m||0,l=l||0,this.next_line.set_indent(m,l),this.__lines.length>1?(this.current_line.set_indent(m,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(m){for(var l=0;l<m.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(m){for(var l=this.__lines.length;m<l;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(m,l){for(var o=this.__lines.length-2;o>=0;){var a=this.__lines[o];if(a.is_empty())break;if(a.item(0).indexOf(m)!==0&&a.item(-1)!==l){this.__lines.splice(o+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},r.exports.Output=f},function(r){function M(b,f,m,l){this.type=b,this.text=f,this.comments_before=null,this.newlines=m||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=M},function(r,M){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",l="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+b+m+"])",a="(?:\\\\u[0-9a-fA-F]{4}|["+f+m+l+"])*";M.identifier=new RegExp(o+a,"g"),M.identifierStart=new RegExp(o),M.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+m+l+"])+");var c=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;M.newline=/[\n\r\u2028\u2029]/,M.lineBreak=new RegExp(`\r
|`+M.newline.source),M.allLineBreaks=new RegExp(M.lineBreak.source,"g")},function(r,M,b){var f=b(6).Options,m=["before-newline","after-newline","preserve-newline"];function l(o){f.call(this,o,"js");var a=this.raw_options.brace_style||null;a==="expand-strict"?this.raw_options.brace_style="expand":a==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s<c.length;s++)c[s]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=c[s];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",m),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}l.prototype=new f,r.exports.Options=l},function(r){function M(m,l){this.raw_options=b(m,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}M.prototype._get_array=function(m,l){var o=this.raw_options[m],a=l||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(a=o.concat()):typeof o=="string"&&(a=o.split(/[^a-zA-Z0-9_\/\-]+/)),a},M.prototype._get_boolean=function(m,l){var o=this.raw_options[m],a=o===void 0?!!l:!!o;return a},M.prototype._get_characters=function(m,l){var o=this.raw_options[m],a=l||"";return typeof o=="string"&&(a=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},M.prototype._get_number=function(m,l){var o=this.raw_options[m];l=parseInt(l,10),isNaN(l)&&(l=0);var a=parseInt(o,10);return isNaN(a)&&(a=l),a},M.prototype._get_selection=function(m,l,o){var a=this._get_selection_list(m,l,o);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[m]+"'");return a[0]},M.prototype._get_selection_list=function(m,l,o){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[l[0]],!this._is_valid_selection(o,l))throw new Error("Invalid Default Value!");var a=this._get_array(m,o);if(!this._is_valid_selection(a,l))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[m]+"'");return a},M.prototype._is_valid_selection=function(m,l){return m.length&&l.length&&!m.some(function(o){return l.indexOf(o)===-1})};function b(m,l){var o={};m=f(m);var a;for(a in m)a!==l&&(o[a]=m[a]);if(l&&m[l])for(a in m[l])o[a]=m[l][a];return o}function f(m){var l={},o;for(o in m){var a=o.replace(/-/g,"_");l[a]=m[o]}return l}r.exports.Options=M,r.exports.normalizeOpts=f,r.exports.mergeOpts=b},function(r,M,b){var f=b(8).InputScanner,m=b(9).Tokenizer,l=b(9).TOKEN,o=b(13).Directives,a=b(4),c=b(12).Pattern,s=b(14).TemplatablePattern;function i(B,A){return A.indexOf(B)!==-1}var n={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:l.START,RAW:l.RAW,EOF:l.EOF},O=new o(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,C=/[0-9]/,R=/[^\d\.]/,S=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var E=new RegExp(v),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),p=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+p.join("|")+")$"),g,w=function(B,A){m.call(this,B,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new c(this._input),F=new s(this._input).read_options(this._options);this.__patterns={template:F,identifier:F.starting_with(a.identifier).matching(a.identifierMatch),number:H.matching(T),punct:H.matching(E),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(a.lineBreak),shebang:H.starting_with(/#!/).until_after(a.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:F.until(/['\\\n\r\u2028\u2029]/),double_quote:F.until(/["\\\n\r\u2028\u2029]/),template_text:F.until(/[`\\$]/),template_expression:F.until(/[`}\\]/)}};w.prototype=new m,w.prototype._is_comment=function(B){return B.type===n.COMMENT||B.type===n.BLOCK_COMMENT||B.type===n.UNKNOWN},w.prototype._is_opening=function(B){return B.type===n.START_BLOCK||B.type===n.START_EXPR},w.prototype._is_closing=function(B,A){return(B.type===n.END_BLOCK||B.type===n.END_EXPR)&&A&&(B.text==="]"&&A.text==="["||B.text===")"&&A.text==="("||B.text==="}"&&A.text==="{")},w.prototype._reset=function(){g=!1},w.prototype._get_next_token=function(B,A){var H=null;this._readWhitespace();var F=this._input.peek();return F===null?this._create_token(n.EOF,""):(H=H||this._read_non_javascript(F),H=H||this._read_string(F),H=H||this._read_word(B),H=H||this._read_singles(F),H=H||this._read_comment(F),H=H||this._read_regexp(F,B),H=H||this._read_xml(F,B),H=H||this._read_punctuation(),H=H||this._create_token(n.UNKNOWN,this._input.next()),H)},w.prototype._read_word=function(B){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(a.allLineBreaks,`
`),!(B.type===n.DOT||B.type===n.RESERVED&&(B.text==="set"||B.text==="get"))&&_.test(A)?(A==="in"||A==="of")&&(B.type===n.WORD||B.type===n.STRING)?this._create_token(n.OPERATOR,A):this._create_token(n.RESERVED,A):this._create_token(n.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(n.WORD,A)},w.prototype._read_singles=function(B){var A=null;return B==="("||B==="["?A=this._create_token(n.START_EXPR,B):B===")"||B==="]"?A=this._create_token(n.END_EXPR,B):B==="{"?A=this._create_token(n.START_BLOCK,B):B==="}"?A=this._create_token(n.END_BLOCK,B):B===";"?A=this._create_token(n.SEMICOLON,B):B==="."&&R.test(this._input.peek(1))?A=this._create_token(n.DOT,B):B===","&&(A=this._create_token(n.COMMA,B)),A&&this._input.next(),A},w.prototype._read_punctuation=function(){var B=this.__patterns.punct.read();if(B!=="")return B==="="?this._create_token(n.EQUALS,B):B==="?."?this._create_token(n.DOT,B):this._create_token(n.OPERATOR,B)},w.prototype._read_non_javascript=function(B){var A="";if(B==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(n.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(n.UNKNOWN,A.trim()+`
`);B=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(C)){do B=this._input.next(),H+=B;while(this._input.hasNext()&&B!=="#"&&B!=="=");return B==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,H)}this._input.back()}else if(B==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)A+=this._input.next();return g=!0,this._create_token(n.COMMENT,A)}}else if(g&&B==="-"&&(A=this.__patterns.html_comment_end.read(),A))return g=!1,this._create_token(n.COMMENT,A);return null},w.prototype._read_comment=function(B){var A=null;if(B==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var F=O.get_directives(H);F&&F.ignore==="start"&&(H+=O.readIgnored(this._input)),H=H.replace(a.allLineBreaks,`
`),A=this._create_token(n.BLOCK_COMMENT,H),A.directives=F}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),A=this._create_token(n.COMMENT,H))}return A},w.prototype._read_string=function(B){if(B==="`"||B==="'"||B==='"'){var A=this._input.next();return this.has_char_escapes=!1,B==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(B),this.has_char_escapes&&this._options.unescape_strings&&(A=j(A)),this._input.peek()===B&&(A+=this._input.next()),A=A.replace(a.allLineBreaks,`
`),this._create_token(n.STRING,A)}return null},w.prototype._allow_regexp_or_xml=function(B){return B.type===n.RESERVED&&i(B.text,["return","case","throw","else","do","typeof","yield"])||B.type===n.END_EXPR&&B.text===")"&&B.opened.previous.type===n.RESERVED&&i(B.opened.previous.text,["if","while","for"])||i(B.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},w.prototype._read_regexp=function(B,A){if(B==="/"&&this._allow_regexp_or_xml(A)){for(var H=this._input.next(),F=!1,x=!1;this._input.hasNext()&&(F||x||this._input.peek()!==B)&&!this._input.testChar(a.newline);)H+=this._input.peek(),F?F=!1:(F=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===B&&(H+=this._input.next(),H+=this._input.read(a.identifier)),this._create_token(n.STRING,H)}return null},w.prototype._read_xml=function(B,A){if(this._options.e4x&&B==="<"&&this._allow_regexp_or_xml(A)){var H="",F=this.__patterns.xml.read_match();if(F){for(var x=F[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=x.indexOf("{")===0,q=0;F;){var ie=!!F[1],me=F[2],$e=!!F[F.length-1]||me.slice(0,8)==="![CDATA[";if(!$e&&(me===x||Y&&me.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--q:++q),H+=F[0],q<=0)break;F=this.__patterns.xml.read_match()}return F||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(a.allLineBreaks,`
`),this._create_token(n.STRING,H)}}return null};function j(B){for(var A="",H=0,F=new f(B),x=null;F.hasNext();)if(x=F.match(/([\s]|[^\\]|\\\\)+/g),x&&(A+=x[0]),F.peek()==="\\"){if(F.next(),F.peek()==="x")x=F.match(/x([0-9A-Fa-f]{2})/g);else if(F.peek()==="u")x=F.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",F.hasNext()&&(A+=F.next());continue}if(!x)return B;if(H=parseInt(x[1],16),H>126&&H<=255&&x[0].indexOf("x")===0)return B;if(H>=0&&H<32){A+="\\"+x[0];continue}else H===34||H===39||H===92?A+="\\"+String.fromCharCode(H):A+=String.fromCharCode(H)}return A}w.prototype._read_string_recursive=function(B,A,H){var F,x;B==="'"?x=this.__patterns.single_quote:B==='"'?x=this.__patterns.double_quote:B==="`"?x=this.__patterns.template_text:B==="}"&&(x=this.__patterns.template_expression);for(var Y=x.read(),q="";this._input.hasNext();){if(q=this._input.next(),q===B||!A&&a.newline.test(q)){this._input.back();break}else q==="\\"&&this._input.hasNext()?(F=this._input.peek(),F==="x"||F==="u"?this.has_char_escapes=!0:F==="\r"&&this._input.peek(1)===`
`&&this._input.next(),q+=this._input.next()):H&&(H==="${"&&q==="$"&&this._input.peek()==="{"&&(q+=this._input.next()),H===q&&(B==="`"?q+=this._read_string_recursive("}",A,"`"):q+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(q+=this._input.next())));q+=x.read(),Y+=q}return Y},r.exports.Tokenizer=w,r.exports.TOKEN=n,r.exports.positionable_operators=S.slice(),r.exports.line_starters=h.slice()},function(r){var M=RegExp.prototype.hasOwnProperty("sticky");function b(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},b.prototype.peek=function(f){var m=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(m=this.__input.charAt(f)),m},b.prototype.__match=function(f,m){f.lastIndex=m;var l=f.exec(this.__input);return l&&!(M&&f.sticky)&&(l.index!==m&&(l=null)),l},b.prototype.test=function(f,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(f,m):!1},b.prototype.testChar=function(f,m){var l=this.peek(m);return f.lastIndex=0,l!==null&&f.test(l)},b.prototype.match=function(f){var m=this.__match(f,this.__position);return m?this.__position+=m[0].length:m=null,m},b.prototype.read=function(f,m,l){var o="",a;return f&&(a=this.match(f),a&&(o+=a[0])),m&&(a||!f)&&(o+=this.readUntil(m,l)),o},b.prototype.readUntil=function(f,m){var l="",o=this.__position;f.lastIndex=this.__position;var a=f.exec(this.__input);return a?(o=a.index,m&&(o+=a[0].length)):o=this.__input_length,l=this.__input.substring(this.__position,o),this.__position=o,l},b.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},b.prototype.get_regexp=function(f,m){var l=null,o="g";return m&&M&&(o="y"),typeof f=="string"&&f!==""?l=new RegExp(f,o):f&&(l=new RegExp(f.source,o)),l},b.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(f){var m=this.__position,l=this.readUntilAfter(f);return this.__position=m,l},b.prototype.lookBack=function(f){var m=this.__position-1;return m>=f.length&&this.__input.substring(m-f.length,m).toLowerCase()===f},r.exports.InputScanner=b},function(r,M,b){var f=b(8).InputScanner,m=b(3).Token,l=b(10).TokenStream,o=b(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(s,i){this._input=new f(s),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var s,i=new m(a.START,""),n=null,O=[],T=new l;i.type!==a.EOF;){for(s=this._get_next_token(i,n);this._is_comment(s);)T.add(s),s=this._get_next_token(i,n);T.isEmpty()||(s.comments_before=T,T=new l),s.parent=n,this._is_opening(s)?(O.push(n),n=s):n&&this._is_closing(s,n)&&(s.opened=n,n.closed=s,n=O.pop(),s.parent=n),s.previous=i,i.next=s,this.__tokens.add(s),i=s}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(s,i){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},c.prototype._is_comment=function(s){return!1},c.prototype._is_opening=function(s){return!1},c.prototype._is_closing=function(s,i){return!1},c.prototype._create_token=function(s,i){var n=new m(s,i,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return n},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=c,r.exports.TOKEN=a},function(r){function M(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}M.prototype.restart=function(){this.__position=0},M.prototype.isEmpty=function(){return this.__tokens_length===0},M.prototype.hasNext=function(){return this.__position<this.__tokens_length},M.prototype.next=function(){var b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},M.prototype.peek=function(b){var f=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(f=this.__tokens[b]),f},M.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},r.exports.TokenStream=M},function(r,M,b){var f=b(12).Pattern;function m(l,o){f.call(this,l,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new f,m.prototype.__set_whitespace_patterns=function(l,o){l+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var o=this.__split(this._newline_regexp,l);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return l},m.prototype.matching=function(l,o){var a=this._create();return a.__set_whitespace_patterns(l,o),a._update(),a},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(l,o){l.lastIndex=0;for(var a=0,c=[],s=l.exec(o);s;)c.push(o.substring(a,s.index)),a=s.index+s[0].length,s=l.exec(o);return a<o.length?c.push(o.substring(a,o.length)):c.push(""),c},r.exports.WhitespacePattern=m},function(r){function M(b,f){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}M.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},M.prototype.read_match=function(){return this._input.match(this._match_pattern)},M.prototype.until_after=function(b){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(b),f._update(),f},M.prototype.until=function(b){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(b),f._update(),f},M.prototype.starting_with=function(b){var f=this._create();return f._starting_pattern=this._input.get_regexp(b,!0),f._update(),f},M.prototype.matching=function(b){var f=this._create();return f._match_pattern=this._input.get_regexp(b,!0),f._update(),f},M.prototype._create=function(){return new M(this._input,this)},M.prototype._update=function(){},r.exports.Pattern=M},function(r){function M(b,f){b=typeof b=="string"?b:b.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+f,"g")}M.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(b);m;)f[m[1]]=m[2],m=this.__directive_pattern.exec(b);return f},M.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=M},function(r,M,b){var f=b(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(o,a){f.call(this,o,a),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var c=new f(o);this.__patterns={handlebars_comment:c.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:c.starting_with(/{{{/).until_after(/}}}/),handlebars:c.starting_with(/{{/).until_after(/}}/),php:c.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new f,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(o){var a=this._create();return a._disabled[o]=!0,a._update(),a},l.prototype.read_options=function(o){var a=this._create();for(var c in m)a._disabled[c]=o.templating.indexOf(c)===-1;return a._update(),a},l.prototype.exclude=function(o){var a=this._create();return a._excluded[o]=!0,a._update(),a},l.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),o+=a,a=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},l.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},l.prototype._read_template=function(){var o="",a=this._input.peek();if(a==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(o=o||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},r.exports.TemplatablePattern=l}],I={};function K(r){var M=I[r];if(M!==void 0)return M.exports;var b=I[r]={exports:{}};return P[r](b,b.exports,K),b.exports}var k=K(0);U=k})();var G=U;!(Z=[],V=function(){return{js_beautify:G}}.apply(he,Z),V!==void 0&&(Kt.exports=V))})()},"6eGT":function(Kt,he,D){"use strict";function Z(V){return null}he.a=Z},"746U":function(Kt,he,D){"use strict";D.d(he,"f",function(){return Z}),D.d(he,"l",function(){return V}),D.d(he,"k",function(){return U}),D.d(he,"j",function(){return G}),D.d(he,"g",function(){return P}),D.d(he,"m",function(){return I}),D.d(he,"h",function(){return K}),D.d(he,"n",function(){return k}),D.d(he,"c",function(){return r}),D.d(he,"a",function(){return M}),D.d(he,"i",function(){return b}),D.d(he,"o",function(){return f}),D.d(he,"e",function(){return o}),D.d(he,"d",function(){return a}),D.d(he,"p",function(){return c}),D.d(he,"b",function(){return s});function Z(i){return Array.isArray(i)}function V(i){return typeof i=="string"}function U(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function G(i){return typeof i=="number"&&!isNaN(i)}function P(i){return i===!0||i===!1}function I(i){return typeof i=="undefined"}function K(i){return!k(i)}function k(i){return I(i)||i===null}function r(i,n){if(!i)throw new Error(n?`Unexpected type, expected '${n}'`:"Unexpected type")}function M(i){if(k(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function b(i){return typeof i=="function"}function f(i,n){const O=Math.min(i.length,n.length);for(let T=0;T<O;T++)m(i[T],n[T])}function m(i,n){if(V(n)){if(typeof i!==n)throw new Error(`argument does not match constraint: typeof ${n}`)}else if(b(n)){try{if(i instanceof n)return}catch(O){}if(!k(i)&&i.constructor===n)return;if(n.length===1&&n.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function l(i){let n=[],O=Object.getPrototypeOf(i);for(;Object.prototype!==O;)n=n.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return n}function o(i){const n=[];for(const O of l(i))typeof i[O]=="function"&&n.push(O);return n}function a(i,n){const O=C=>function(){const R=Array.prototype.slice.call(arguments,0);return n(C,R)};let T={};for(const C of i)T[C]=O(C);return T}function c(i){return i===null?void 0:i}function s(i,n="Unreachable"){throw new Error(n)}},"7Cbv":function(Kt,he,D){"use strict";var Z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function U(){if(!Z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z(V)}var G=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(m){return typeof m=="string"&&G.test(m)}for(var I=P,K=[],k=0;k<256;++k)K.push((k+256).toString(16).substr(1));function r(m){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(K[m[l+0]]+K[m[l+1]]+K[m[l+2]]+K[m[l+3]]+"-"+K[m[l+4]]+K[m[l+5]]+"-"+K[m[l+6]]+K[m[l+7]]+"-"+K[m[l+8]]+K[m[l+9]]+"-"+K[m[l+10]]+K[m[l+11]]+K[m[l+12]]+K[m[l+13]]+K[m[l+14]]+K[m[l+15]]).toLowerCase();if(!I(o))throw TypeError("Stringified UUID is invalid");return o}var M=r;function b(m,l,o){m=m||{};var a=m.random||(m.rng||U)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,l){o=o||0;for(var c=0;c<16;++c)l[o+c]=a[c];return l}return M(a)}var f=he.a=b},"7ahc":function(Kt,he,D){"use strict";D.d(he,"a",function(){return O});var Z=D("k1fw"),V=D("0Owb"),U=D("+L6B"),G=D("2/Rp"),P=D("y8nQ"),I=D("Vl3Y"),K=D("tJVT"),k=D("OaEy"),r=D("2fM7"),M=D("q1tI"),b=D.n(M),f=D("VrN/"),m=D.n(f),l=D("p77/"),o=D.n(l),a=D("c5Ni"),c=D.n(a),s=r.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},n={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"]};he.b=function(T){var C=T.callback,R=T.onCancel,S=Object(M.useState)("python"),v=Object(K.a)(S,2),E=v[0],h=v[1];function p(g){h(n[g][1])}function _(g){C(g)}return b.a.createElement(I.a,Object(V.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),b.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(r.a,{onChange:p},Object.keys(n).map(function(g){return b.a.createElement(s,{key:g,value:g},n[g][0])}))),b.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(O,{mode:E})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(G.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function O(T){var C=T.value,R=T.onChange,S=T.mode,v=T.options,E=v===void 0?{}:v,h=Object(M.useRef)(),p=Object(M.useState)(),_=Object(K.a)(p,2),g=_[0],w=_[1];return Object(M.useEffect)(function(){if(g){function j(B){var A=B.getValue();R&&R(A)}return g.on("change",j),function(){g.off("change",j)}}},[g,R]),Object(M.useEffect)(function(){g&&g.setOption("mode",S)},[g,S]),Object(M.useEffect)(function(){g&&((C!==g.getValue()||C==="")&&setTimeout(function(){g.setValue(C||" ")},300))},[g,C]),Object(M.useEffect)(function(){if(h.current&&!g){var j=m.a.fromTextArea(h.current,Object(Z.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},E));w(j)}},[h.current,g]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:h}))}},"7ixt":function(Kt,he,D){"use strict";D.d(he,"a",function(){return U});var Z={adjustX:1,adjustY:1},V=[0,0],U={left:{points:["cr","cl"],overflow:Z,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:Z,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:Z,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:Z,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:Z,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:Z,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:Z,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:Z,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:Z,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:Z,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:Z,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:Z,offset:[-4,0],targetOffset:V}},G=U},"815F":function(Kt,he,D){"use strict";D.d(he,"e",function(){return K}),D.d(he,"c",function(){return r}),D.d(he,"d",function(){return M}),D.d(he,"a",function(){return f}),D.d(he,"f",function(){return m}),D.d(he,"b",function(){return l});var Z=D("KQm4"),V=D("VTBJ"),U=D("Ff2n"),G=D("Zm9Q"),P=D("Kwbf"),I=D("OZM5");function K(o,a){return o!=null?o:a}function k(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=new Map;function c(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(n){var O=n.key,T=n.children;Object(P.a)(O!=null,"Tree node must have a certain key: [".concat(i).concat(O,"]"));var C=String(O);Object(P.a)(!a.has(C)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(C)),a.set(C,!0),c(T,"".concat(i).concat(C," > "))})}c(o)}function r(o){function a(c){var s=Object(G.a)(c);return s.map(function(i){if(!Object(I.i)(i))return Object(P.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var n=i.key,O=i.props,T=O.children,C=Object(U.a)(O,["children"]),R=Object(V.a)({key:n},C),S=a(T);return S.length&&(R.children=S),R}).filter(function(i){return i})}return a(o)}function M(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(a===!0?[]:a),s=[];function i(n){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(T,C){var R=Object(I.h)(O?O.pos:"0",C),S=K(T.key,R),v=Object(V.a)(Object(V.a)({},T),{},{parent:O,pos:R,children:null,data:T,isStart:[].concat(Object(Z.a)(O?O.isStart:[]),[C===0]),isEnd:[].concat(Object(Z.a)(O?O.isEnd:[]),[C===n.length-1])});return s.push(v),a===!0||c.has(S)?v.children=i(T.children||[],v):v.children=[],v})}return i(o),s}function b(o,a,c){var s;c?typeof c=="string"?s=function(O){return O[c]}:typeof c=="function"&&(s=function(O){return c(O)}):s=function(O,T){return K(O.key,T)};function i(n,O,T){var C=n?n.children:o,R=n?Object(I.h)(T.pos,O):"0";if(n){var S=s(n,R),v={node:n,index:O,pos:R,key:S,parentPos:T.node?T.pos:null,level:T.level+1};a(v)}C&&C.forEach(function(E,h){i(E,h,{node:n,pos:R,level:T?T.level+1:-1})})}i(null)}function f(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=a.initWrapper,s=a.processEntity,i=a.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,O={},T={},C={posEntities:O,keyEntities:T};return c&&(C=c(C)||C),b(o,function(R){var S=R.node,v=R.index,E=R.pos,h=R.key,p=R.parentPos,_=R.level,g={node:S,index:v,key:h,pos:E,level:_},w=K(h,E);O[E]=g,T[w]=g,g.parent=O[p],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),s&&s(g,C)},n),i&&i(C),C}function m(o,a){var c=a.expandedKeys,s=a.selectedKeys,i=a.loadedKeys,n=a.loadingKeys,O=a.checkedKeys,T=a.halfCheckedKeys,C=a.dragOverNodeKey,R=a.dropPosition,S=a.keyEntities,v=S[o],E={eventKey:o,expanded:c.indexOf(o)!==-1,selected:s.indexOf(o)!==-1,loaded:i.indexOf(o)!==-1,loading:n.indexOf(o)!==-1,checked:O.indexOf(o)!==-1,halfChecked:T.indexOf(o)!==-1,pos:String(v?v.pos:""),dragOver:C===o&&R===0,dragOverGapTop:C===o&&R===-1,dragOverGapBottom:C===o&&R===1};return E}function l(o){var a=o.data,c=o.expanded,s=o.selected,i=o.checked,n=o.loaded,O=o.loading,T=o.halfChecked,C=o.dragOver,R=o.dragOverGapTop,S=o.dragOverGapBottom,v=o.pos,E=o.active,h=Object(V.a)(Object(V.a)({},a),{},{expanded:c,selected:s,checked:i,loaded:n,loading:O,halfChecked:T,dragOver:C,dragOverGapTop:R,dragOverGapBottom:S,pos:v,active:E});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),h}},"8EBN":function(Kt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var V=0;V<Z.modeInfo.length;V++){var U=Z.modeInfo[V];U.mimes&&(U.mime=U.mimes[0])}Z.findModeByMIME=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var I=Z.modeInfo[P];if(I.mime==G)return I;if(I.mimes){for(var K=0;K<I.mimes.length;K++)if(I.mimes[K]==G)return I}}if(/\+xml$/.test(G))return Z.findModeByMIME("application/xml");if(/\+json$/.test(G))return Z.findModeByMIME("application/json")},Z.findModeByExtension=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var I=Z.modeInfo[P];if(I.ext){for(var K=0;K<I.ext.length;K++)if(I.ext[K]==G)return I}}},Z.findModeByFileName=function(G){for(var P=0;P<Z.modeInfo.length;P++){var I=Z.modeInfo[P];if(I.file&&I.file.test(G))return I}var K=G.lastIndexOf("."),k=K>-1&&G.substring(K+1,G.length);if(k)return Z.findModeByExtension(k)},Z.findModeByName=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var I=Z.modeInfo[P];if(I.name.toLowerCase()==G)return I;if(I.alias){for(var K=0;K<I.alias.length;K++)if(I.alias[K].toLowerCase()==G)return I}}}})},"8HAY":function(Kt,he,D){"use strict";D.d(he,"a",function(){return P}),D.d(he,"b",function(){return I}),D.d(he,"d",function(){return K}),D.d(he,"e",function(){return k}),D.d(he,"c",function(){return r});var Z=D("MI8n"),V=D("pmY6"),U=D("3/fG"),G=function(M,b,f,m){function l(o){return o instanceof f?o:new f(function(a){a(o)})}return new(f||(f=Promise))(function(o,a){function c(n){try{i(m.next(n))}catch(O){a(O)}}function s(n){try{i(m.throw(n))}catch(O){a(O)}}function i(n){n.done?o(n.value):l(n.value).then(c,s)}i((m=m.apply(M,b||[])).next())})};class P extends V.a{constructor(M,b="",f="",m=!0,l){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=M,this._label=b,this._cssClass=f,this._enabled=m,this._actionCallback=l}get id(){return this._id}get label(){return this._label}set label(M){this._setLabel(M)}_setLabel(M){this._label!==M&&(this._label=M,this._onDidChange.fire({label:M}))}get tooltip(){return this._tooltip||""}set tooltip(M){this._setTooltip(M)}_setTooltip(M){this._tooltip!==M&&(this._tooltip=M,this._onDidChange.fire({tooltip:M}))}get class(){return this._cssClass}set class(M){this._setClass(M)}_setClass(M){this._cssClass!==M&&(this._cssClass=M,this._onDidChange.fire({class:M}))}get enabled(){return this._enabled}set enabled(M){this._setEnabled(M)}_setEnabled(M){this._enabled!==M&&(this._enabled=M,this._onDidChange.fire({enabled:M}))}get checked(){return this._checked}set checked(M){this._setChecked(M)}_setChecked(M){this._checked!==M&&(this._checked=M,this._onDidChange.fire({checked:M}))}run(M,b){return G(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(M))})}}class I extends V.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new Z.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new Z.b),this.onDidRun=this._onDidRun.event}run(M,b){return G(this,void 0,void 0,function*(){if(!M.enabled)return;this._onBeforeRun.fire({action:M});let f;try{yield this.runAction(M,b)}catch(m){f=m}this._onDidRun.fire({action:M,error:f})})}runAction(M,b){return G(this,void 0,void 0,function*(){yield M.run(b)})}}class K extends P{constructor(M){super(K.ID,M,M?"separator text":"separator");this.checked=!1,this.enabled=!1}}K.ID="vs.actions.separator";class k{constructor(M,b,f,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=M,this.label=b,this.class=m,this._actions=f}get actions(){return this._actions}dispose(){}run(){return G(this,void 0,void 0,function*(){})}}class r extends P{constructor(){super(r.ID,U.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(Kt,he,D){Kt.exports={button:"button___1wy9m"}},"9Bee":function(Kt,he,D){"use strict";var Z=D("DYRE"),V=D("zeV3"),U=D("+L6B"),G=D("2/Rp"),P=D("k1fw"),I=D("9og8"),K=D("tJVT"),k=D("WmNS"),r=D.n(k),M=D("q1tI"),b=D.n(M),f=D("vg9a"),m=D("DlQD"),l=D.n(m),o=D("rUJ1");function a(X,L){var N=X.match(/^(\s+)(?:```)/);if(N===null)return L;var z=N[1];return L.split(`
`).map(function(ne){var J=ne.match(/^\s+/);if(J===null)return ne;var je=Object(K.a)(J,1),$t=je[0];return $t.length>=z.length?ne.slice(z.length):ne}).join(`
`)}var c=[],s=["<ul>"],i=new l.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){c.length=0,s=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(X,L,N,z){if(L>=X.length||X[L].level<=N)return L;var ne=X[L];z.push("<li><a href='#"+ne.anchor+"'>"+ne.text+"</a>"),L++;var J=[];return L=C(X,L,ne.level,J),J.length>0&&(z.push("<ul>"),J.forEach(function(je){z.push(je)}),z.push("</ul>")),z.push("</li>"),L=C(X,L,N,z),L}function R(){return C(c,0,0,s),s.push("</ul>"),s.join("")}var S={heading:function(L){var N=n.exec(L);if(N)return{type:"heading",raw:N[0],depth:N[1].length,text:N[2]}},fences:function(L){var N=this.rules.block.fences.exec(L);if(N){var z=N[0],ne=a(z,N[3]||""),J=N[2]?N[2].trim():N[2];if(["latex","katex","math"].indexOf(J)>=0){var je=h(),$t=ne;ne=je,p[je]={type:"block",expression:$t}}return{type:"code",raw:z,lang:J,text:ne}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,E=0,h=function(){return"__special_katext_id_".concat(E++,"__")},p={};function _(){return p}function g(){E=0,p={}}function w(X){return X=X.replace(v,function(L,N){var z=h();return p[z]={type:"inline",expression:N},z}),X}var j=i.listitem;i.listitem=function(X){return j(w(X))};var B=i.paragraph;i.paragraph=function(X){return B(w(X))};var A=i.tablecell;i.tablecell=function(X,L){return A(w(X),L)},i.code=function(X,L,N){var z=(L||"").match(/\S*/)[0];return z?["latex","katex","math"].indexOf(z)>=0?"<p class='editormd-tex'>".concat(X,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(N?X:Object(o.escape)(X,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(N?X:Object(o.escape)(X,!0))+"</code></pre>"},i.heading=function(X,L,N){var z=this.options.headerPrefix+N.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:z,level:L,text:X}),"<h"+L+' id="'+z+'">'+X+"</h"+L+">"},l.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),l.a.use({tokenizer:S,renderer:i});var H=l.a,F=D("SJMd"),x=D("ulZh"),Y=D.n(x),q=D("m3rI"),ie=D("Oy/b"),me=D("p5ED"),$e=D("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var xe=function(X,L){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,z){N.__proto__=z}||function(N,z){for(var ne in z)Object.prototype.hasOwnProperty.call(z,ne)&&(N[ne]=z[ne])})(X,L)};function Ie(X,L){function N(){this.constructor=X}xe(X,L),X.prototype=L===null?Object.create(L):(N.prototype=L.prototype,new N)}function Je(X,L,N,z){return new(N||(N=Promise))(function(ne,J){function je(Jn){try{In(z.next(Jn))}catch(ln){J(ln)}}function $t(Jn){try{In(z.throw(Jn))}catch(ln){J(ln)}}function In(Jn){var ln;Jn.done?ne(Jn.value):(ln=Jn.value,ln instanceof N?ln:new N(function(tr){tr(ln)})).then(je,$t)}In((z=z.apply(X,L||[])).next())})}function Ye(X,L){var N,z,ne,J,je={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return J={next:$t(0),throw:$t(1),return:$t(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function $t(In){return function(Jn){return function(ln){if(N)throw new TypeError("Generator is already executing.");for(;je;)try{if(N=1,z&&(ne=2&ln[0]?z.return:ln[0]?z.throw||((ne=z.return)&&ne.call(z),0):z.next)&&!(ne=ne.call(z,ln[1])).done)return ne;switch(z=0,ne&&(ln=[2&ln[0],ne.value]),ln[0]){case 0:case 1:ne=ln;break;case 4:return je.label++,{value:ln[1],done:!1};case 5:je.label++,z=ln[1],ln=[0];continue;case 7:ln=je.ops.pop(),je.trys.pop();continue;default:if(!(ne=je.trys,(ne=ne.length>0&&ne[ne.length-1])||ln[0]!==6&&ln[0]!==2)){je=0;continue}if(ln[0]===3&&(!ne||ln[1]>ne[0]&&ln[1]<ne[3])){je.label=ln[1];break}if(ln[0]===6&&je.label<ne[1]){je.label=ne[1],ne=ln;break}if(ne&&je.label<ne[2]){je.label=ne[2],je.ops.push(ln);break}ne[2]&&je.ops.pop(),je.trys.pop();continue}ln=L.call(X,je)}catch(tr){ln=[6,tr],z=0}finally{N=ne=0}if(5&ln[0])throw ln[1];return{value:ln[0]?ln[1]:void 0,done:!0}}([In,Jn])}}}function ve(){for(var X=0,L=0,N=arguments.length;L<N;L++)X+=arguments[L].length;var z=Array(X),ne=0;for(L=0;L<N;L++)for(var J=arguments[L],je=0,$t=J.length;je<$t;je++,ne++)z[ne]=J[je];return z}var fe=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(L,N){for(var z=0,ne=N;z<ne.length;z++){var J=ne[z],je=J[0],$t=J[1];L.setAttribute(je,$t)}},X.createRect=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",N.toString()),z&&X.setAttributes(ne,z),ne},X.createLine=function(L,N,z,ne,J){var je=document.createElementNS("http://www.w3.org/2000/svg","line");return je.setAttribute("x1",L.toString()),je.setAttribute("y1",N.toString()),je.setAttribute("x2",z.toString()),je.setAttribute("y2",ne.toString()),J&&X.setAttributes(je,J),je},X.createPolygon=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",L),N&&X.setAttributes(z,N),z},X.createCircle=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(L/2).toString()),z.setAttribute("cy",(L/2).toString()),z.setAttribute("r",L.toString()),N&&X.setAttributes(z,N),z},X.createEllipse=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(N/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(N/2).toString()),z&&X.setAttributes(ne,z),ne},X.createGroup=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&X.setAttributes(N,L),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(L,N,z,ne,J,je,$t){var In=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(In,[["id",L],["orient",N],["markerWidth",z.toString()],["markerHeight",ne.toString()],["refX",J.toString()],["refY",je.toString()]]),In.appendChild($t),In},X.createText=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),L&&X.setAttributes(N,L),N},X.createTSpan=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=L,N&&X.setAttributes(z,N),z},X.createImage=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&X.setAttributes(N,L),N},X.createPoint=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=L,z.y=N,z},X.createPath=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",L),N&&X.setAttributes(z,N),z},X}(),lt=function(){function X(){}return X.addKey=function(L){X.key=L},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),qt=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(L,N,z){var ne=this;return new Promise(function(J){var je=z!==void 0?z:document.createElement("canvas");L===null&&(ne.markersOnly=!0,ne.naturalSize=!1);var $t=document.createElementNS("http://www.w3.org/2000/svg","svg");$t.setAttribute("xmlns","http://www.w3.org/2000/svg"),$t.setAttribute("width",N.width.baseVal.valueAsString),$t.setAttribute("height",N.height.baseVal.valueAsString),$t.setAttribute("viewBox","0 0 "+N.viewBox.baseVal.width.toString()+" "+N.viewBox.baseVal.height.toString()),$t.innerHTML=N.innerHTML,ne.naturalSize===!0?($t.width.baseVal.value=L.naturalWidth,$t.height.baseVal.value=L.naturalHeight):ne.width!==void 0&&ne.height!==void 0&&($t.width.baseVal.value=ne.width,$t.height.baseVal.value=ne.height),je.width=$t.width.baseVal.value,je.height=$t.height.baseVal.value;var In=$t.outerHTML,Jn=je.getContext("2d");ne.markersOnly!==!0&&Jn.drawImage(L,0,0,je.width,je.height);var ln=window.URL,tr=new Image(je.width,je.height);tr.setAttribute("crossOrigin","anonymous");var qn=new Blob([In],{type:"image/svg+xml"}),kr=ln.createObjectURL(qn);tr.onload=function(){Jn.drawImage(tr,0,0),ln.revokeObjectURL(kr);var li=je.toDataURL(ne.imageType,ne.imageQuality);J(li)},tr.src=kr})},X}(),Ft=function(){},Ot=function(){function X(L){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},X.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new Ve("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new vt("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new vt("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},X.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),Ve=function(X,L){this.selector=X,this.style=L},vt=function(X,L){this.localName=X,this.style=L},ht=function(){function X(L,N,z,ne,J){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=L,this.displayMode=N,this.markerItems=z,this.uiStyleSettings=ne,this.styles=J,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return X.prototype.show=function(L){var N=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var z=document.createElement("div");z.className=this.toolbarBlockStyleClass.name,z.style.whiteSpace="nowrap",this.uiContainer.appendChild(z),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(J){var je=document.createElement("div");je.className=""+N.toolbarButtonStyleClass.name,je.setAttribute("data-type-name",J.typeName),je.innerHTML=J.icon,je.addEventListener("click",function(){N.markerToolbarButtonClicked(je,J)}),N.buttons.push(je),N.markerButtons.push(je)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var ne=document.createElement("div");ne.className=this.toolbarBlockStyleClass.name,ne.style.whiteSpace="nowrap",ne.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ne),this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(ne,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(L){this.buttonClickListeners.push(L)},X.prototype.removeButtonClickListener=function(L){this.buttonClickListeners.indexOf(L)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(L),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var L=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var N=0;N<this.markerButtons.length;N++)N<L||N===L&&this.markerButtons.length-1===L?this.markerButtonBlock.appendChild(this.markerButtons[N]):(N===L&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[N]))}},X.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},X.prototype.resetButtonStyles=function(){var L=this;this.buttons.forEach(function(N){N.className=N.className.replace(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name,"").trim(),N.className=N.className.replace(L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:L.toolbarActiveButtonStyleColorsClass.name,"").trim(),N.className+=" "+(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(L,N,z){var ne=this,J=document.createElement("div");switch(J.className=""+this.toolbarButtonStyleClass.name,J.innerHTML=N,J.setAttribute("data-action",z),J.addEventListener("click",function(){ne.actionToolbarButtonClicked(J,z)}),z){case"select":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":J.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":J.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":J.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":J.style.fill=this.uiStyleSettings.closeButtonColor}L.appendChild(J),this.buttons.push(J)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new vt("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new vt("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new vt("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new vt("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new vt("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new vt("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new vt("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new vt("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},X.prototype.markerToolbarButtonClicked=function(L,N){this.setActiveButton(L),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("marker",N)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(L,N){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",N)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(L){this.resetButtonStyles(),L.className=L.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),L.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(L){var N=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===L});N&&this.setActiveButton(N)},X.prototype.setCurrentMarker=function(L){var N=this;this.currentMarker=L,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){N.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},X}(),Bt=function(){function X(L,N,z,ne){this.panels=[],this.panelButtons=[],this.markerjsContainer=L,this.displayMode=N,this.uiStyleSettings=z,this.styles=ne,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var L;this.toolboxStyleClass=this.styles.addClass(new vt("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new vt("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var N=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new vt("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new vt("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new vt("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new vt("toolbox-panel-row_colors",`
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new vt("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*N)+`px;
padding: `+N+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new vt("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new vt("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(L){var N;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolboxStyleClass.name+" "+((N=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(L){var N,z,ne=this;this.panels=L,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((N=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&N!==void 0?N:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(J){var je;J.uiStyleSettings=ne.uiStyleSettings;var $t=document.createElement("div");$t.className=ne.toolboxButtonStyleClass.name+" "+((je=ne.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:ne.toolboxButtonStyleColorsClass.name),$t.innerHTML=J.icon,$t.title=J.title,$t.addEventListener("click",function(){ne.panelButtonClick(J)}),ne.panelButtons.push($t),ne.buttonRow.appendChild($t)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(L){var N=this,z=-1;if(L!==this.activePanel){z=this.panels.indexOf(L),this.panelRow.innerHTML="";var ne=L.getUi();ne.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ne),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=L}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){N.displayMode==="inline"?N.panelRow.style.display="none":N.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(J,je){var $t,In;J.className=N.toolboxButtonStyleClass.name+" "+(je===z?""+(($t=N.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&$t!==void 0?$t:N.toolboxActiveButtonStyleColorsClass.name):""+((In=N.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&In!==void 0?In:N.toolboxButtonStyleColorsClass.name))})},X}(),se=function(X,L){this.title=X,this.icon=L},Ue=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return je.colors=[],je.addTransparent=!1,je.colorBoxes=[],je.colors=z,je.currentColor=ne,je.setCurrentColor=je.setCurrentColor.bind(je),je.getColorBox=je.getColorBox.bind(je),je}return Ie(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(ne){var J=N.getColorBox(ne);z.appendChild(J),N.colorBoxes.push(J)}),z},L.prototype.getColorBox=function(N){var z=this,ne=this.uiStyleSettings.toolbarHeight/4,J=this.uiStyleSettings.toolbarHeight-ne,je=document.createElement("div");je.style.display="inline-block",je.style.boxSizing="content-box",je.style.width=J-2+"px",je.style.height=J-2+"px",je.style.padding="1px",je.style.marginRight="2px",je.style.marginBottom="2px",je.style.borderWidth="2px",je.style.borderStyle="solid",je.style.borderRadius=(J+2)/2+"px",je.style.borderColor=N===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",je.addEventListener("click",function(){z.setCurrentColor(N,je)});var $t=document.createElement("div");return $t.style.display="inline-block",$t.style.width=J-2+"px",$t.style.height=J-2+"px",$t.style.backgroundColor=N,$t.style.borderRadius=J/2+"px",N==="transparent"&&($t.style.fill=this.uiStyleSettings.toolboxAccentColor,$t.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),je.appendChild($t),je},L.prototype.setCurrentColor=function(N,z){var ne=this;this.currentColor=N,this.colorBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(N)},L}(se),Ge=function(){function X(L,N,z){this._state="new",this._isSelected=!1,this._container=L,this._overlayContainer=N,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(L){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(L,N){},X.prototype.dblClick=function(L,N){},X.prototype.manipulate=function(L){},X.prototype.pointerUp=function(L){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(L){this.container.childNodes.length>0?this.container.insertBefore(L,this.container.childNodes[0]):this.container.appendChild(L)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(L){this._state=L.state,this.notes=L.notes},X.prototype.scale=function(L,N){},X.prototype.colorChanged=function(L){this.onColorChanged&&this.onColorChanged(L),this.stateChanged()},X.prototype.fillColorChanged=function(L){this.onFillColorChanged&&this.onFillColorChanged(L),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var L=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),L.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(L)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),et=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(L){return this.topLeft.ownsTarget(L)?this.topLeft:this.topCenter.ownsTarget(L)?this.topCenter:this.topRight.ownsTarget(L)?this.topRight:this.centerLeft.ownsTarget(L)?this.centerLeft:this.centerRight.ownsTarget(L)?this.centerRight:this.bottomLeft.ownsTarget(L)?this.bottomLeft:this.bottomCenter.ownsTarget(L)?this.bottomCenter:this.bottomRight.ownsTarget(L)?this.bottomRight:void 0},X}(),Wt=function(){function X(){this.GRIP_SIZE=10,this.visual=fe.createGroup(),this.visual.appendChild(fe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(fe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},X}(),Yt=function(){function X(){}return X.toITransformMatrix=function(L){return{a:L.a,b:L.b,c:L.c,d:L.d,e:L.e,f:L.f}},X.toSVGMatrix=function(L,N){return L.a=N.a,L.b=N.b,L.c=N.c,L.d=N.d,L.e=N.e,L.f=N.f,L},X}(),on=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.left=0,J.top=0,J.width=0,J.height=0,J.defaultSize={x:50,y:20},J.offsetX=0,J.offsetY=0,J.rotationAngle=0,J.CB_DISTANCE=10,J._suppressMarkerCreateEvent=!1,J.container.transform.baseVal.appendItem(fe.createTransform()),J.setupControlBox(),J}return Ie(L,X),Object.defineProperty(L.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"visual",{get:function(){return this._visual},set:function(N){this._visual=N;var z=fe.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!!(this.controlGrips.findGripByVisual(N)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(N))},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.left=N.x,this.top=N.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ne=this.unrotatePoint(N);if(this.manipulationStartX=ne.x,this.manipulationStartY=ne.y,this.offsetX=ne.x-this.left,this.offsetY=ne.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var J=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=J.x-this.width/2,this.top=J.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var je=this.container.transform.baseVal.getItem(0);je.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(je,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},L.prototype.pointerUp=function(N){var z=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(N),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},L.prototype.moveVisual=function(N){this.visual.style.transform="translate("+N.x+"px, "+N.y+"px)"},L.prototype.manipulate=function(N){var z=this.unrotatePoint(N);this.state==="creating"?this.resize(N):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(N)},L.prototype.resize=function(N){var z=this.manipulationStartLeft,ne=this.manipulationStartWidth,J=this.manipulationStartTop,je=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+N.x-this.manipulationStartX,ne=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ne=this.manipulationStartWidth+N.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:J=this.manipulationStartTop+N.y-this.manipulationStartY,je=this.manipulationStartHeight+this.manipulationStartTop-J;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:je=this.manipulationStartHeight+N.y-this.manipulationStartY}ne>=0?(this.left=z,this.width=ne):(this.left=z+ne,this.width=-ne),je>=0?(this.top=J,this.height=je):(this.top=J+je,this.height=-je),this.setSize()},L.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},L.prototype.rotate=function(N){if(Math.abs(N.x-this.centerX)>.1){var z=Math.sign(N.x-this.centerX);this.rotationAngle=180*Math.atan((N.y-this.centerY)/(N.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},L.prototype.applyRotation=function(){var N=this.container.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(N,0)},L.prototype.rotatePoint=function(N){if(this.rotationAngle===0)return N;var z=this.container.getCTM(),ne=fe.createPoint(N.x,N.y);return{x:(ne=ne.matrixTransform(z)).x,y:ne.y}},L.prototype.unrotatePoint=function(N){if(this.rotationAngle===0)return N;var z=this.container.getCTM();z=z.inverse();var ne=fe.createPoint(N.x,N.y);return{x:(ne=ne.matrixTransform(z)).x,y:ne.y}},L.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=fe.createGroup();var N=fe.createTransform();N.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(N),this.container.appendChild(this.controlBox),this.controlRect=fe.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=fe.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new et,this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){var N=this.controlBox.transform.baseVal.getItem(0);N.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(N,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},L.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},L.prototype.createGrip=function(){var N=new Wt;return N.visual.transform.baseVal.appendItem(fe.createTransform()),this.controlBox.appendChild(N.visual),N},L.prototype.positionGrips=function(){var N=this.controlGrips.topLeft.GRIP_SIZE,z=-N/2,ne=z,J=(this.width+this.CB_DISTANCE)/2-N/2,je=(this.height+this.CB_DISTANCE)/2-N/2,$t=this.height+this.CB_DISTANCE-N/2,In=this.width+this.CB_DISTANCE-N/2;this.positionGrip(this.controlGrips.topLeft.visual,z,ne),this.positionGrip(this.controlGrips.topCenter.visual,J,ne),this.positionGrip(this.controlGrips.topRight.visual,In,ne),this.positionGrip(this.controlGrips.centerLeft.visual,z,je),this.positionGrip(this.controlGrips.centerRight.visual,In,je),this.positionGrip(this.controlGrips.bottomLeft.visual,z,$t),this.positionGrip(this.controlGrips.bottomCenter.visual,J,$t),this.positionGrip(this.controlGrips.bottomRight.visual,In,$t),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,J,ne-3*this.CB_DISTANCE)},L.prototype.positionGrip=function(N,z,ne){var J=N.transform.baseVal.getItem(0);J.setTranslate(z,ne),N.transform.baseVal.replaceItem(J,0)},L.prototype.hideControlBox=function(){this.controlBox.style.display="none"},L.prototype.showControlBox=function(){this.controlBox.style.display=""},L.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Yt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Yt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Yt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Yt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z);var ne=this.rotatePoint({x:this.left,y:this.top}),J=this.unrotatePoint({x:ne.x*N,y:ne.y*z});this.left=J.x,this.top=J.y,this.width=this.width*N,this.height=this.height*z,this.adjustControlBox()},L}(Ge),nt=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.createVisual=J.createVisual.bind(J),J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},L.prototype.createVisual=function(){this.visual=fe.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},L.prototype.setSize=function(){X.prototype.setSize.call(this),fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&fe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},L.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&fe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&fe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&fe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){var z=N;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setSize()},L.title="Rectangle marker",L}(on),tn=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return je.widths=[],je.widthBoxes=[],je.widths=z,je.currentWidth=ne,je.setCurrentWidth=je.setCurrentWidth.bind(je),je}return Ie(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ne===N.currentWidth?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentWidth(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.innerText=ne.toString(),je.style.marginRight="5px",J.appendChild(je);var $t=document.createElement("div");$t.style.minHeight="20px",$t.style.flexGrow="2",$t.style.display="flex",$t.style.alignItems="center";var In=document.createElement("hr");In.style.minWidth="20px",In.style.border="0px",In.style.borderTop=ne+"px solid "+N.uiStyleSettings.toolboxColor,In.style.flexGrow="2",$t.appendChild(In),J.appendChild($t),N.widthBoxes.push(J)}),z},L.prototype.setCurrentWidth=function(N,z){var ne=this;this.currentWidth=N,this.widthBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},L}(se),Ln=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return je.styles=[],je.styleBoxes=[],je.styles=z,je.currentStyle=ne,je.setCurrentStyle=je.setCurrentStyle.bind(je),je}return Ie(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/N.styles.length-5+"%",J.style.borderColor=ne===N.currentStyle?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentStyle(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.overflow="hidden";var $t=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+N.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ne!==""?'stroke-dasharray="'+ne+'"':"")+` />
</svg>`;je.innerHTML=$t,J.appendChild(je),N.styleBoxes.push(J)}),z},L.prototype.setCurrentStyle=function(N,z){var ne=this;this.currentStyle=N,this.styleBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},L}(se),We=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ue("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new Ln("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Ie(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="FrameMarker",L.title="Frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',L}(nt),Fe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},yt=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.x1=0,J.y1=0,J.x2=0,J.y2=0,J.defaultLength=50,J.manipulationStartX=0,J.manipulationStartY=0,J.manipulationStartX1=0,J.manipulationStartY1=0,J.manipulationStartX2=0,J.manipulationStartY2=0,J.setupControlBox(),J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!!X.prototype.ownsTarget.call(this,N)||!(!this.grip1.ownsTarget(N)&&!this.grip2.ownsTarget(N))},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.manipulationStartX=N.x,this.manipulationStartY=N.y,this.state==="new"&&(this.x1=N.x,this.y1=N.y,this.x2=N.x,this.y2=N.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},L.prototype.pointerUp=function(N){var z=this.state;X.prototype.pointerUp.call(this,N),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(N),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},L.prototype.adjustVisual=function(){},L.prototype.manipulate=function(N){this.state==="creating"?this.resize(N):this.state==="move"?(this.x1=this.manipulationStartX1+N.x-this.manipulationStartX,this.y1=this.manipulationStartY1+N.y-this.manipulationStartY,this.x2=this.manipulationStartX2+N.x-this.manipulationStartX,this.y2=this.manipulationStartY2+N.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(N)},L.prototype.resize=function(N){switch(this.activeGrip){case this.grip1:this.x1=N.x,this.y1=N.y;break;case this.grip2:case void 0:this.x2=N.x,this.y2=N.y}this.adjustVisual(),this.adjustControlBox()},L.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=fe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){this.positionGrips()},L.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},L.prototype.createGrip=function(){var N=new Wt;return N.visual.transform.baseVal.appendItem(fe.createTransform()),this.controlBox.appendChild(N.visual),N},L.prototype.positionGrips=function(){var N=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-N/2,this.y1-N/2),this.positionGrip(this.grip2.visual,this.x2-N/2,this.y2-N/2)},L.prototype.positionGrip=function(N,z,ne){var J=N.transform.baseVal.getItem(0);J.setTranslate(z,ne),N.transform.baseVal.replaceItem(J,0)},L.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.x1=this.x1*N,this.y1=this.y1*z,this.x2=this.x2*N,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},L}(Ge),At=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ue("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new Ln("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorLine&&N!==this.visibleLine)},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.selectorLine=fe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=fe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},L.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),fe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),fe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},L.typeName="LineMarker",L.title="Line marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',L}(yt),tt=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return je.fonts=[],je.fontBoxes=[],je.fonts=z,je.currentFont=ne,je.setCurrentFont=je.setCurrentFont.bind(je),je}return Ie(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(ne){var J=document.createElement("div");J.style.display="inline-block",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.overflow="hidden",J.style.maxWidth=100/N.fonts.length-5+"%",J.style.borderColor=ne===N.currentFont?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentFont(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.style.display="flex",je.style.minHeight="20px",je.style.flexGrow="2",je.style.fontFamily=ne,je.style.overflow="hidden";var $t=document.createElement("div");$t.style.whiteSpace="nowrap",$t.style.overflow="hidden",$t.style.textOverflow="ellipsis",$t.innerHTML="The quick brown fox jumps over the lazy dog",je.appendChild($t),J.appendChild(je),N.fontBoxes.push(J)}),z},L.prototype.setCurrentFont=function(N,z){var ne=this;this.currentFont=N,this.fontBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},L}(se),ot=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.color="transparent",J.padding=5,J.DEFAULT_TEXT="your text here",J.text=J.DEFAULT_TEXT,J.isMoved=!1,J.color=ne.defaultColor,J.fontFamily=ne.defaultFontFamily,J.defaultSize={x:100,y:30},J.setColor=J.setColor.bind(J),J.setFont=J.setFont.bind(J),J.renderText=J.renderText.bind(J),J.sizeText=J.sizeText.bind(J),J.textEditDivClicked=J.textEditDivClicked.bind(J),J.showTextEditor=J.showTextEditor.bind(J),J.setSize=J.setSize.bind(J),J.positionTextEditor=J.positionTextEditor.bind(J),J.colorPanel=new Ue("Color",ne.defaultColorSet,ne.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.fontFamilyPanel=new tt("Font",ne.defaultFontFamilies,ne.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J}return Ie(L,X),L.prototype.ownsTarget=function(N){if(X.prototype.ownsTarget.call(this,N)||N===this.visual||N===this.textElement||N===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(ne){ne===N&&(z=!0)}),z},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.bgRectangle=fe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=fe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(fe.createTransform()),this.textElement.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.isMoved=!1,this.pointerDownPoint=N,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.renderText=function(){var N=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(z){N.textElement.appendChild(fe.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},L.prototype.getTextScale=function(){var N=this.textElement.getBBox(),z=1;if(N.width>0&&N.height>0){var ne=(1*this.width-this.width*this.padding*2/100)/N.width,J=(1*this.height-this.height*this.padding*2/100)/N.height;z=Math.min(ne,J)}return z},L.prototype.getTextPosition=function(N){var z=this.textElement.getBBox(),ne=0,J=0;return z.width>0&&z.height>0&&(ne=(this.width-z.width*N)/2,J=this.height/2-z.height*N/2),{x:ne,y:J}},L.prototype.sizeText=function(){var N=this.textElement.getBBox(),z=this.getTextScale(),ne=this.getTextPosition(z);ne.y-=N.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ne.x+"px, "+ne.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ne.x,ne.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(N.x-this.pointerDownPoint.x)>5||Math.abs(N.y-this.pointerDownPoint.y)>5)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.isMoved=!0,this.setSize(),this.sizeText()},L.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},L.prototype.pointerUp=function(N){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,N),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},L.prototype.showTextEditor=function(){var N=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(N.textEditor.style.fontSize);N.textEditor.clientWidth>=Number.parseInt(N.textEditor.style.maxWidth)&&z>.9;)z-=.1,N.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var ne=z.clipboardData.getData("text"),J=window.getSelection();if(!J.rangeCount)return!1;J.deleteFromDocument(),J.getRangeAt(0).insertNode(document.createTextNode(ne)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){N.textEditDivClicked(N.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},L.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var N=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ne=this.textElement.getBBox(),J={x:ne.width*N,y:ne.height*N};z.x-=J.x/2,z.y-=J.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*N,12)+"px",this.textElement.style.display="none"}},L.prototype.textEditDivClicked=function(N){this.text=N.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},L.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},L.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},L.prototype.dblClick=function(N,z){X.prototype.dblClick.call(this,N,z),this.showTextEditor()},L.prototype.setColor=function(N){this.textElement&&fe.setAttributes(this.textElement,[["fill",N]]),this.color=N,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(N)},L.prototype.setFont=function(N){this.textElement&&fe.setAttributes(this.textElement,[["font-family",N]]),this.fontFamily=N,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},L.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},L.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var z=N;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setSize(),this.sizeText(),this.positionTextEditor()},L.typeName="TextMarker",L.title="Text marker",L.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',L}(on),De=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.color="transparent",J.lineWidth=3,J.drawing=!1,J.pixelRatio=1,J.color=ne.defaultColor,J.lineWidth=ne.defaultStrokeWidth,J.pixelRatio=ne.freehandPixelRatio,J.setColor=J.setColor.bind(J),J.addCanvas=J.addCanvas.bind(J),J.finishCreation=J.finishCreation.bind(J),J.setLineWidth=J.setLineWidth.bind(J),J.colorPanel=new Ue("Color",ne.defaultColorSet,ne.defaultColor),J.colorPanel.onColorChanged=J.setColor,J.lineWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.lineWidthPanel.onWidthChanged=J.setLineWidth,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.drawingImage)},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.drawingImage=fe.createImage(),this.visual.appendChild(this.drawingImage);var N=fe.createTransform();this.visual.transform.baseVal.appendItem(N),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(N.x,N.y),this.drawing=!0):X.prototype.pointerDown.call(this,N,z)},L.prototype.manipulate=function(N){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(N.x,N.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),fe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(N){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,N)},L.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},L.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},L.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},L.prototype.finishCreation=function(){for(var N=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ne=z[0],J=z[1],je=z[2],$t=z[3],In=!1,Jn=0;Jn<this.canvasElement.height;Jn++)for(var ln=0;ln<this.canvasElement.width;ln++)N.data[Jn*this.canvasElement.width*4+4*ln+3]>0&&(In=!0,Jn<J&&(J=Jn),ln<ne&&(ne=ln),Jn>$t&&($t=Jn),ln>je&&(je=ln));if(In){this.left=ne/this.pixelRatio,this.top=J/this.pixelRatio,this.width=(je-ne)/this.pixelRatio,this.height=($t-J)/this.pixelRatio;var tr=document.createElement("canvas");tr.width=je-ne,tr.height=$t-J,tr.getContext("2d").putImageData(this.canvasContext.getImageData(ne,J,je-ne,$t-J),0,0),this.drawingImgUrl=tr.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},L.prototype.setDrawingImage=function(){fe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),fe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},L.prototype.setColor=function(N){this.color=N,this.colorChanged(N)},L.prototype.setLineWidth=function(N){this.lineWidth=N},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){this.createVisual(),X.prototype.restoreState.call(this,N),this.drawingImgUrl=N.drawingImgUrl,this.setDrawingImage()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setDrawingImage()},L.typeName="FreehandMarker",L.title="Freehand marker",L.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',L}(on),ye=function(X){function L(N,z,ne){var J=X.call(this,N,ne||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return J.typeBoxes=[],J.currentType=z,J.setCurrentType=J.setCurrentType.bind(J),J}return Ie(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var ne=function($t){var In="both";switch($t){case 0:In="both";break;case 1:In="start";break;case 2:In="end";break;case 3:In="none"}var Jn=document.createElement("div");if(Jn.style.display="flex",Jn.style.flexGrow="2",Jn.style.alignItems="center",Jn.style.justifyContent="space-between",Jn.style.padding="5px",Jn.style.borderWidth="2px",Jn.style.borderStyle="solid",Jn.style.borderColor=In===J.currentType?J.uiStyleSettings.toolboxAccentColor:"transparent",Jn.addEventListener("click",function(){N.setCurrentType(In,Jn)}),z.appendChild(Jn),In==="both"||In==="start"){var ln=document.createElement("div");ln.style.display="flex",ln.style.alignItems="center",ln.style.minHeight="20px",ln.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ln.style.marginLeft="5px",Jn.appendChild(ln)}var tr=document.createElement("div");tr.style.display="flex",tr.style.alignItems="center",tr.style.minHeight="20px",tr.style.flexGrow="2";var qn=document.createElement("hr");if(qn.style.minWidth="20px",qn.style.border="0px",qn.style.borderTop="3px solid "+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee"),qn.style.flexGrow="2",tr.appendChild(qn),Jn.appendChild(tr),In==="both"||In==="end"){var kr=document.createElement("div");kr.style.display="flex",kr.style.alignItems="center",kr.style.minHeight="20px",kr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,kr.style.marginRight="5px",Jn.appendChild(kr)}J.typeBoxes.push(Jn)},J=this,je=0;je<4;je++)ne(je);return z},L.prototype.setCurrentType=function(N,z){var ne=this;this.currentType=N,this.typeBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},L}(se),we=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.arrowType="end",J.arrowBaseHeight=10,J.arrowBaseWidth=10,J.getArrowPoints=J.getArrowPoints.bind(J),J.setArrowType=J.setArrowType.bind(J),J.arrowTypePanel=new ye("Arrow type","end"),J.arrowTypePanel.onArrowTypeChanged=J.setArrowType,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.arrow1&&N!==this.arrow2)},L.prototype.getArrowPoints=function(N,z){var ne=this.arrowBaseWidth+2*this.strokeWidth,J=this.arrowBaseHeight+2*this.strokeWidth;return N-ne/2+","+(z+J/2)+" "+N+","+(z-J/2)+" "+(N+ne/2)+","+(z+J/2)},L.prototype.createTips=function(){this.arrow1=fe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=fe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.arrow2)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",fe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),fe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(N,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var ne=this.arrow2.transform.baseVal.getItem(0);ne.setRotate(N+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ne,0)}},L.prototype.setArrowType=function(N){this.arrowType=N,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},L.typeName="ArrowMarker",L.title="Arrow marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',L}(At),ae=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.fillColor=ne.defaultFillColor,J.strokeWidth=0,J.fillPanel=new Ue("Color",ne.defaultColorSet,ne.defaultFillColor),J.fillPanel.onColorChanged=J.setFillColor,J}return Ie(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="CoverMarker",L.title="Cover marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',L}(nt),oe=function(X){function L(N,z,ne,J){var je=X.call(this,N,J||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return je.opacities=[],je.opacityBoxes=[],je.opacities=z,je.currentOpacity=ne,je.setCurrentOpacity=je.setCurrentOpacity.bind(je),je}return Ie(L,X),L.prototype.getUi=function(){var N=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(ne){var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.justifyContent="center",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ne===N.currentOpacity?N.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){N.setCurrentOpacity(ne,J)}),z.appendChild(J);var je=document.createElement("div");je.innerText=100*ne+"%",J.appendChild(je),N.opacityBoxes.push(J)}),z},L.prototype.setCurrentOpacity=function(N,z){var ne=this;this.currentOpacity=N,this.opacityBoxes.forEach(function(J){J.style.borderColor=J===z?ne.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},L}(se),pe=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.setOpacity=J.setOpacity.bind(J),J.fillColor=ne.defaultHighlightColor,J.strokeWidth=0,J.opacity=ne.defaultHighlightOpacity,J.fillPanel=new Ue("Color",ne.defaultColorSet,J.fillColor),J.fillPanel.onColorChanged=J.setFillColor,J.opacityPanel=new oe("Opacity",ne.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Ie(L,X),L.prototype.setOpacity=function(N){this.opacity=N,this.visual&&fe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="HighlightMarker",L.title="Highlight marker",L.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',L}(ae),_e='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',be=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.bgColor="transparent",J.tipPosition={x:0,y:0},J.tipBase1Position={x:0,y:0},J.tipBase2Position={x:0,y:0},J.tipMoving=!1,J.color=ne.defaultStrokeColor,J.bgColor=ne.defaultFillColor,J.fontFamily=ne.defaultFontFamily,J.defaultSize={x:100,y:30},J.setBgColor=J.setBgColor.bind(J),J.getTipPoints=J.getTipPoints.bind(J),J.positionTip=J.positionTip.bind(J),J.setTipPoints=J.setTipPoints.bind(J),J.colorPanel=new Ue("Text color",ne.defaultColorSet,J.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),J.colorPanel.onColorChanged=J.setColor,J.bgColorPanel=new Ue("Fill color",ne.defaultColorSet,J.bgColor,_e),J.bgColorPanel.onColorChanged=J.setBgColor,J.fontFamilyPanel=new tt("Font",ne.defaultFontFamilies,ne.defaultFontFamily),J.fontFamilyPanel.onFontChanged=J.setFont,J.tipGrip=new Wt,J.tipGrip.visual.transform.baseVal.appendItem(fe.createTransform()),J.controlBox.appendChild(J.tipGrip.visual),J}return Ie(L,X),L.prototype.ownsTarget=function(N){return X.prototype.ownsTarget.call(this,N)||this.tipGrip.ownsTarget(N)||this.tip===N},L.prototype.createTip=function(){fe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=fe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},L.prototype.pointerDown=function(N,z){this.state==="new"&&X.prototype.pointerDown.call(this,N,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,N,z)},L.prototype.pointerUp=function(N){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,N);else{var z=this.state==="creating";X.prototype.pointerUp.call(this,N),this.setTipPoints(z),this.positionTip()}},L.prototype.manipulate=function(N){if(this.tipMoving){var z=this.unrotatePoint(N);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,N)},L.prototype.setBgColor=function(N){this.bgRectangle&&this.tip&&(fe.setAttributes(this.bgRectangle,[["fill",N]]),fe.setAttributes(this.tip,[["fill",N]])),this.bgColor=N,this.fillColorChanged(N)},L.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},L.prototype.setTipPoints=function(N){N===void 0&&(N=!1);var z=Math.min(this.height/2,15),ne=this.height/5;N&&(this.tipPosition={x:z+ne/2,y:this.height+20});var J=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:0},this.tipBase2Position={x:z+ne,y:0}):(this.tipBase1Position={x:0,y:z},this.tipBase2Position={x:0,y:z+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?J<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ne,y:0},this.tipBase2Position={x:this.width-z,y:0}):(this.tipBase1Position={x:this.width,y:z},this.tipBase2Position={x:this.width,y:z+ne}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?J<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-z-ne,y:this.height},this.tipBase2Position={x:this.width-z,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-z-ne},this.tipBase2Position={x:this.width,y:this.height-z}):J<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ne=this.width/5,z=Math.min(this.width/2,15),this.tipBase1Position={x:z,y:this.height},this.tipBase2Position={x:z+ne,y:this.height}):(this.tipBase1Position={x:0,y:this.height-z},this.tipBase2Position={x:0,y:this.height-z-ne})},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.positionTip()},L.prototype.positionTip=function(){fe.setAttributes(this.tip,[["points",this.getTipPoints()]]);var N=this.tipGrip.visual.transform.baseVal.getItem(0);N.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(N,0)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},L.prototype.getState=function(){var N=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var z=N;this.bgColor=z.bgColor,this.tipPosition=z.tipPosition,X.prototype.restoreState.call(this,N),this.createTip(),this.setTipPoints()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.tipPosition={x:this.tipPosition.x*N,y:this.tipPosition.y*z},this.positionTip()},L.typeName="CalloutMarker",L.title="Callout marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',L}(ot),Ke=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.fillColor="transparent",J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.opacity=1,J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.fillColor=ne.defaultFillColor,J.setStrokeColor=J.setStrokeColor.bind(J),J.setFillColor=J.setFillColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.setOpacity=J.setOpacity.bind(J),J.createVisual=J.createVisual.bind(J),J.strokePanel=new Ue("Line color",ve(ne.defaultColorSet,["transparent"]),ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.fillPanel=new Ue("Fill color",ve(ne.defaultColorSet,["transparent"]),J.fillColor,_e),J.fillPanel.onColorChanged=J.setFillColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new Ln("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J.opacityPanel=new oe("Opacity",ne.defaultOpacitySteps,J.opacity),J.opacityPanel.onOpacityChanged=J.setOpacity,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual)},L.prototype.createVisual=function(){this.visual=fe.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="new"&&(this.createVisual(),this.moveVisual(N),this._state="creating")},L.prototype.manipulate=function(N){X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){X.prototype.resize.call(this,N),this.setSize()},L.prototype.setSize=function(){X.prototype.setSize.call(this),fe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},L.prototype.pointerUp=function(N){X.prototype.pointerUp.call(this,N),this.setSize()},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.visual&&fe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(N),this.stateChanged()},L.prototype.setFillColor=function(N){this.fillColor=N,this.visual&&fe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(N),this.stateChanged()},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.visual&&fe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.visual&&fe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.setOpacity=function(N){this.opacity=N,this.visual&&fe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){var z=N;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),X.prototype.restoreState.call(this,N),this.setSize()},L.prototype.scale=function(N,z){X.prototype.scale.call(this,N,z),this.setSize()},L.typeName="EllipseMarker",L.title="Ellipse marker",L.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',L}(on),St=function(X){function L(N,z,ne){return X.call(this,N,z,ne)||this}return Ie(L,X),Object.defineProperty(L.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.tip1&&N!==this.tip2)},L.prototype.createTips=function(){this.tip1=fe.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=fe.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(fe.createTransform()),this.visual.appendChild(this.tip2)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(fe.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var N=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(N,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var ne=this.tip2.transform.baseVal.getItem(0);ne.setRotate(N+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ne,0)}},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N),this.createTips(),this.adjustVisual()},L.typeName="MeasurementMarker",L.title="Measurement marker",L.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',L}(At),nn=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokePanel.colors=ne.defaultColorSet,J.fillColor="transparent",J}return Ie(L,X),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=X.prototype.getState.call(this);return N.typeName=L.typeName,N},L.typeName="EllipseFrameMarker",L.title="Ellipse frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',L}(Ke),An=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(L){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(L)||(this.undoStack.push(L),JSON.stringify(this.lastRedoStep)!==JSON.stringify(L)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(L){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=L)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var L=this.undoStack.pop();return L!==void 0&&this.redoStack.push(L),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),bt=function(X){function L(N,z,ne){var J=X.call(this,N,z,ne)||this;return J.strokeColor="transparent",J.strokeWidth=0,J.strokeDasharray="",J.curveX=0,J.curveY=0,J.manipulationStartCurveX=0,J.manipulationStartCurveY=0,J.setStrokeColor=J.setStrokeColor.bind(J),J.setStrokeWidth=J.setStrokeWidth.bind(J),J.setStrokeDasharray=J.setStrokeDasharray.bind(J),J.positionGrips=J.positionGrips.bind(J),J.addControlGrips=J.addControlGrips.bind(J),J.adjustVisual=J.adjustVisual.bind(J),J.setupControlBox=J.setupControlBox.bind(J),J.resize=J.resize.bind(J),J.strokeColor=ne.defaultColor,J.strokeWidth=ne.defaultStrokeWidth,J.strokeDasharray=ne.defaultStrokeDasharray,J.strokePanel=new Ue("Line color",ne.defaultColorSet,ne.defaultColor),J.strokePanel.onColorChanged=J.setStrokeColor,J.strokeWidthPanel=new tn("Line width",ne.defaultStrokeWidths,ne.defaultStrokeWidth),J.strokeWidthPanel.onWidthChanged=J.setStrokeWidth,J.strokeStylePanel=new Ln("Line style",ne.defaultStrokeDasharrays,ne.defaultStrokeDasharray),J.strokeStylePanel.onStyleChanged=J.setStrokeDasharray,J}return Ie(L,X),L.prototype.ownsTarget=function(N){return!(!X.prototype.ownsTarget.call(this,N)&&N!==this.visual&&N!==this.selectorCurve&&N!==this.visibleCurve&&!this.curveGrip.ownsTarget(N))},L.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},L.prototype.createVisual=function(){this.visual=fe.createGroup(),this.selectorCurve=fe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=fe.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(N,z){X.prototype.pointerDown.call(this,N,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=N.x,this.curveY=N.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},L.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),fe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),fe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),fe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=fe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=fe.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},L.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},L.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var N=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-N/2,this.curveY-N/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},L.prototype.manipulate=function(N){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+N.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+N.y-this.manipulationStartY),X.prototype.manipulate.call(this,N)},L.prototype.resize=function(N){this.activeGrip===this.curveGrip&&(this.curveX=N.x,this.curveY=N.y),X.prototype.resize.call(this,N),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},L.prototype.setStrokeColor=function(N){this.strokeColor=N,this.adjustVisual(),this.colorChanged(N)},L.prototype.setStrokeWidth=function(N){this.strokeWidth=N,this.adjustVisual()},L.prototype.setStrokeDasharray=function(N){this.strokeDasharray=N,this.adjustVisual()},L.prototype.scale=function(N,z){this.curveX=this.curveX*N,this.curveY=this.curveY*z,X.prototype.scale.call(this,N,z)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var N=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return N.typeName=L.typeName,N},L.prototype.restoreState=function(N){X.prototype.restoreState.call(this,N);var z=N;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},L.typeName="CurveMarker",L.title="Curve marker",L.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',L}(yt),Jt=function(){function X(L,N){N===void 0&&(N=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=L,this.cancelable=N}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),Et=function(X){function L(N,z,ne){var J=X.call(this,N,!1)||this;return J.dataUrl=z,J.state=ne,J}return Ie(L,X),L}(Jt),Ct=function(X){function L(N,z,ne){ne===void 0&&(ne=!1);var J=X.call(this,N,ne)||this;return J.marker=z,J}return Ie(L,X),L}(Jt),st=function(){function X(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return X.prototype.addEventListener=function(L,N){this[L].push(N)},X.prototype.removeEventListener=function(L,N){var z=this[L].indexOf(N);z>-1&&this[L].splice(z,1)},X}(),de=function(){function X(L){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Fe,this._isOpen=!1,this.undoRedoManager=new An,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new st,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new Ot(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=L,this.targetRoot=document.body,this.width=L.clientWidth,this.height=L.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[We,De,we,ot,nn,Ke,pe,be,St,ae,At,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[We,De,we,ot,Ke,pe,be]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[We,De,we,ot,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(L){var N=this;this._availableMarkerTypes.splice(0),L.forEach(function(z){if(typeof z=="string"){var ne=N.ALL_MARKER_TYPES.find(function(J){return J.typeName===z});ne!==void 0&&N._availableMarkerTypes.push(ne)}else N._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(L){this._zoomLevel=L,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),lt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var L=this;this.styles.styleSheetRoot===void 0&&Ft.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ft.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(N){return N(new Jt(L))})},X.prototype.render=function(){return Je(this,void 0,void 0,function(){var L;return Ye(this,function(N){switch(N.label){case 0:return this.setCurrentMarker(),(L=new qt).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.markersOnly=this.renderMarkersOnly,L.width=this.renderWidth,L.height=this.renderHeight,[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return N.sent(),[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,N.sent()]}})})},X.prototype.close=function(L){var N=this;if(L===void 0&&(L=!1),this.isOpen){var z=!1;L||this.eventListeners.beforeclose.forEach(function(ne){var J=new Jt(N,!0);ne(J),J.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ne){return ne(new Jt(N))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var L,N=[],z=0;z<arguments.length;z++)N[z]=arguments[z];(L=this._availableMarkerTypes).push.apply(L,N)},X.prototype.addRenderEventListener=function(L){this.addEventListener("render",function(N){L(N.dataUrl,N.state)})},X.prototype.removeRenderEventListener=function(L){},X.prototype.addCloseEventListener=function(L){this.addEventListener("close",function(){L()})},X.prototype.removeCloseEventListener=function(L){},X.prototype.setupResizeObserver=function(){var L=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return L.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var L=1*this.target.clientWidth/this.target.clientHeight,N=this.editorCanvas.clientWidth/L>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*L:this.editorCanvas.clientWidth,z=N<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/L;this.resize(N,z)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(L,N){this._isResizing=!0;var z=L/this.imageWidth,ne=N/this.imageHeight;this.imageWidth=Math.round(L),this.imageHeight=Math.round(N),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(z,ne),this._isResizing=!1},X.prototype.scaleMarkers=function(L,N){var z,ne=this;this._currentMarker&&this._currentMarker instanceof ot?this._currentMarker.scale(L,N):(z=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(J){J!==ne._currentMarker&&J.scale(L,N)}),z!==void 0&&this.setCurrentMarker(z)},X.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},X.prototype.setTopLeft=function(){var L=this.editingTarget.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=L.left-N.left,this.top=L.top-N.top},X.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},X.prototype.addDefs=function(){for(var L,N=[],z=0;z<arguments.length;z++)N[z]=arguments[z];this.defs=fe.createDefs(),this.addDefsToImage(),(L=this.defs).append.apply(L,N)},X.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},X.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},X.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},X.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},X.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},X.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},X.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},X.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var L=document.createElement("a");L.href="https://markerjs.com/",L.target="_blank",L.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',L.title="Powered by marker.js",L.style.display="grid",L.style.alignItems="center",L.style.justifyItems="center",L.style.padding="3px",L.style.width="20px",L.style.height="20px",this.logoUI.appendChild(L),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ht(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Bt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},X.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.removeMarker=function(L){this.markerImage.removeChild(L.container),this.markers.indexOf(L)>-1&&this.markers.splice(this.markers.indexOf(L),1),L.dispose()},X.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},X.prototype.toolbarButtonClicked=function(L,N){if(L==="marker"&&N!==void 0)this.createNewMarker(N);else if(L==="action")switch(N){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var L=this;if(this._currentMarker!==void 0){var N=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ne){var J=new Ct(L,L._currentMarker,!0);ne(J),J.defaultPrevented&&(N=!0)}),!N){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ne){return ne(new Ct(L,z))})}}},X.prototype.clear=function(){var L=this,N=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(je){var $t=new Ct(L,void 0,!0);je($t),$t.defaultPrevented&&(N=!0)}),!N)){this.setCurrentMarker();for(var z=function(je){var $t=ne.markers[je];ne.setCurrentMarker(ne.markers[je]),ne._currentMarker.dispose(),ne.markerImage.removeChild(ne._currentMarker.container),ne.markers.splice(ne.markers.indexOf(ne._currentMarker),1),ne.eventListeners.markerdelete.forEach(function(In){return In(new Ct(L,$t))})},ne=this,J=this.markers.length-1;J>=0;J--)z(J);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var L;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(L=this._currentMarker.notes)!==null&&L!==void 0?L:"",this.overlayContainer.appendChild(this.notesArea))},X.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var L=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var N=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===N.width&&z.height===N.height){var ne=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(N),ne<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(J){return J(new Jt(L))})}else this.undoRedoManager.replaceLastUndoStep(N),this.eventListeners.statechange.forEach(function(J){return J(new Jt(L))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var L=this,N=this.undoRedoManager.undo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Jt(L))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var L=this,N=this.undoRedoManager.redo();N!==void 0&&(this.restoreState(N),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(z){return z(new Jt(L))}))},X.prototype.stepZoom=function(){var L=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=L<this.zoomSteps.length-1?this.zoomSteps[L+1]:this.zoomSteps[0]},X.prototype.panTo=function(L){this.contentDiv.scrollBy({left:this.prevPanPoint.x-L.x,top:this.prevPanPoint.y-L.y}),this.prevPanPoint=L},X.prototype.startRenderAndClose=function(){return Je(this,void 0,void 0,function(){var L,N,z=this;return Ye(this,function(ne){switch(ne.label){case 0:return[4,this.render()];case 1:return L=ne.sent(),N=this.getState(),this.eventListeners.render.forEach(function(J){return J(new Et(z,L,N))}),this.close(!0),[2]}})})},X.prototype.getState=function(L){L===!0&&this.setCurrentMarker();var N={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(z){return N.markers.push(z.getState())}),N},X.prototype.restoreState=function(L){var N=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);L.markers.forEach(function(z){var ne=N._availableMarkerTypes.find(function(je){return je.typeName===z.typeName});if(ne!==void 0){var J=N.addNewMarker(ne);J.restoreState(z),N.markers.push(J)}}),L.width&&L.height&&(L.width!==this.imageWidth||L.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/L.width,this.imageHeight/L.height),this.eventListeners.restorestate.forEach(function(z){return z(new Jt(N))})},X.prototype.addNewMarker=function(L){var N=fe.createGroup();return this.markerImage.appendChild(N),new L(N,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(L){var N,z=this;(N=typeof L=="string"?this._availableMarkerTypes.find(function(ne){return ne.typeName===L}):L)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(N),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(N.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ne){return ne(new Ct(z,z._currentMarker))}))},X.prototype.markerCreated=function(L){var N=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(L),this.setCurrentMarker(L),L instanceof De&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(De):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(z){return z(new Ct(N,N._currentMarker))})},X.prototype.colorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=L,this.settings.defaultStrokeColor=L)},X.prototype.fillColorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=L)},X.prototype.markerStateChanged=function(L){var N=this;this.eventListeners.markerchange.forEach(function(z){return z(new Ct(N,L))})},X.prototype.setCurrentMarker=function(L){var N=this;this._currentMarker!==L&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(z){return z(new Ct(N,N._currentMarker))})),this._currentMarker=L,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(z){return z(new Ct(N,N._currentMarker))}))},X.prototype.onPointerDown=function(L){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||L.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var N=this.markers.find(function(z){return z.ownsTarget(L.target)});N!==void 0?(this.setCurrentMarker(N),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:L.clientX,y:L.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY))},X.prototype.onDblClick=function(L){if(this._isFocused||this.focus(),this.mode==="select"){var N=this.markers.find(function(z){return z.ownsTarget(L.target)});N!==void 0&&N!==this._currentMarker&&this.setCurrentMarker(N),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(L){this.touchPoints!==1&&L.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||L.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(L.clientX,L.clientY)):this.zoomLevel>1&&this.panTo({x:L.clientX,y:L.clientY}))},X.prototype.onPointerUp=function(L){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(L.clientX,L.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(L){this._currentMarker===void 0||this.notesArea!==void 0||L.key!=="Delete"&&L.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(L,N){var z=this.markerImage.getBoundingClientRect();return{x:(L-z.left)/this.zoomLevel,y:(N-z.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},X.prototype.addLicenseKey=function(L){lt.addKey(L)},X.prototype.addEventListener=function(L,N){this.eventListeners.addEventListener(L,N)},X.prototype.removeEventListener=function(L,N){this.eventListeners.removeEventListener(L,N)},X.prototype.renderState=function(L){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(L),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var L=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(N){return N(new Jt(L))}))},X.prototype.blur=function(){var L=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(N){return N(new Jt(L))}))},X.instanceCounter=0,X}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Ae=function(X,L){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,z){N.__proto__=z}||function(N,z){for(var ne in z)Object.prototype.hasOwnProperty.call(z,ne)&&(N[ne]=z[ne])})(X,L)};function kt(X,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function N(){this.constructor=X}Ae(X,L),X.prototype=L===null?Object.create(L):(N.prototype=L.prototype,new N)}function ct(X,L,N,z){return new(N||(N=Promise))(function(ne,J){function je(Jn){try{In(z.next(Jn))}catch(ln){J(ln)}}function $t(Jn){try{In(z.throw(Jn))}catch(ln){J(ln)}}function In(Jn){var ln;Jn.done?ne(Jn.value):(ln=Jn.value,ln instanceof N?ln:new N(function(tr){tr(ln)})).then(je,$t)}In((z=z.apply(X,L||[])).next())})}function Qt(X,L){var N,z,ne,J,je={label:0,sent:function(){if(1&ne[0])throw ne[1];return ne[1]},trys:[],ops:[]};return J={next:$t(0),throw:$t(1),return:$t(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function $t(In){return function(Jn){return function(ln){if(N)throw new TypeError("Generator is already executing.");for(;je;)try{if(N=1,z&&(ne=2&ln[0]?z.return:ln[0]?z.throw||((ne=z.return)&&ne.call(z),0):z.next)&&!(ne=ne.call(z,ln[1])).done)return ne;switch(z=0,ne&&(ln=[2&ln[0],ne.value]),ln[0]){case 0:case 1:ne=ln;break;case 4:return je.label++,{value:ln[1],done:!1};case 5:je.label++,z=ln[1],ln=[0];continue;case 7:ln=je.ops.pop(),je.trys.pop();continue;default:if(!(ne=je.trys,(ne=ne.length>0&&ne[ne.length-1])||ln[0]!==6&&ln[0]!==2)){je=0;continue}if(ln[0]===3&&(!ne||ln[1]>ne[0]&&ln[1]<ne[3])){je.label=ln[1];break}if(ln[0]===6&&je.label<ne[1]){je.label=ne[1],ne=ln;break}if(ne&&je.label<ne[2]){je.label=ne[2],je.ops.push(ln);break}ne[2]&&je.ops.pop(),je.trys.pop();continue}ln=L.call(X,je)}catch(tr){ln=[6,tr],z=0}finally{N=ne=0}if(5&ln[0])throw ln[1];return{value:ln[0]?ln[1]:void 0,done:!0}}([In,Jn])}}}var un=function(){function X(){}return X.addKey=function(L){X.key=L},Object.defineProperty(X,"isLicensed",{get:function(){return!!X.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(X.key)},enumerable:!1,configurable:!0}),X}(),Le=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(L,N){for(var z=0,ne=N;z<ne.length;z++){var J=ne[z],je=J[0],$t=J[1];L.setAttribute(je,$t)}},X.createRect=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","rect");return ne.setAttribute("width",L.toString()),ne.setAttribute("height",N.toString()),z&&X.setAttributes(ne,z),ne},X.createLine=function(L,N,z,ne,J){var je=document.createElementNS("http://www.w3.org/2000/svg","line");return je.setAttribute("x1",L.toString()),je.setAttribute("y1",N.toString()),je.setAttribute("x2",z.toString()),je.setAttribute("y2",ne.toString()),J&&X.setAttributes(je,J),je},X.createPolygon=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","polygon");return z.setAttribute("points",L),N&&X.setAttributes(z,N),z},X.createCircle=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","circle");return z.setAttribute("cx",(L/2).toString()),z.setAttribute("cy",(L/2).toString()),z.setAttribute("r",L.toString()),N&&X.setAttributes(z,N),z},X.createEllipse=function(L,N,z){var ne=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ne.setAttribute("cx",(L/2).toString()),ne.setAttribute("cy",(N/2).toString()),ne.setAttribute("rx",(L/2).toString()),ne.setAttribute("ry",(N/2).toString()),z&&X.setAttributes(ne,z),ne},X.createGroup=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&X.setAttributes(N,L),N},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(L,N,z,ne,J,je,$t){var In=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(In,[["id",L],["orient",N],["markerWidth",z.toString()],["markerHeight",ne.toString()],["refX",J.toString()],["refY",je.toString()]]),In.appendChild($t),In},X.createText=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","text");return N.setAttribute("x","0"),N.setAttribute("y","0"),L&&X.setAttributes(N,L),N},X.createTSpan=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","tspan");return z.textContent=L,N&&X.setAttributes(z,N),z},X.createImage=function(L){var N=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&X.setAttributes(N,L),N},X.createPoint=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return z.x=L,z.y=N,z},X.createPath=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg","path");return z.setAttribute("d",L),N&&X.setAttributes(z,N),z},X.createElement=function(L,N){var z=document.createElementNS("http://www.w3.org/2000/svg",L);return N&&X.setAttributes(z,N),z},X.getHollowRectanglePath=function(L,N,z,ne,J,je,$t,In){return"M"+L+","+N+"V"+(N+ne)+"H"+(L+z)+"V"+N+"H"+J+"V"+je+"H"+(J+$t)+"V"+(je+In)+"H"+J+"V"+N+"Z"},X}(),qe=function(){function X(L){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(X.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),X.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},X.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new mt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new mt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new mt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new jt("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new jt("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},X.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),mt=function(X,L){this.selector=X,this.style=L},jt=function(X,L){this.localName=X,this.style=L},sn=function(){function X(){this.blocks=[],this.display=""}return X.prototype.addButtonBlock=function(L){L.className=this.blockClassName,L.buttonClassName=this.buttonClassName,L.buttonColorsClassName=this.buttonColorsClassName,L.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(L)},X.prototype.addElementBlock=function(L){L.className===void 0&&(L.className=this.blockClassName),this.blocks.push(L)},X.prototype.getUI=function(){var L=document.createElement("div");return L.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,L.style.display=this.display,this.blocks.forEach(function(N){return L.appendChild(N.getUI())}),L},X}(),yn=function(){function X(){}return X.prototype.getUI=function(){var L=document.createElement("div");if(L.className=this.className,this.minWidth!==void 0&&(L.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":L.style.justifyContent="flex-start";break;case"center":L.style.justifyContent="center";break;case"end":L.style.justifyContent="flex-end"}return L.style.whiteSpace="nowrap",L},X}(),nr=function(X){function L(){var N=X!==null&&X.apply(this,arguments)||this;return N.buttons=[],N}return kt(L,X),L.prototype.addButton=function(N){N.className=this.buttonClassName,N.colorsClassName=this.buttonColorsClassName,N.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(N)},L.prototype.getUI=function(){var N=X.prototype.getUI.call(this);return this.buttons.forEach(function(z){return N.appendChild(z.getUI())}),N},L}(yn),Kn=function(){function X(L,N){this._isActive=!1,this._isHidden=!1,this._icon=L,this.title=N,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(X.prototype,"icon",{get:function(){return this._icon},set:function(L){this._icon=L,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isActive",{get:function(){return this._isActive},set:function(L){this._isActive=L,this.adjustClassName()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){var L=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return L.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},X.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},X.prototype.hide=function(){this._isHidden=!0},X}(),wn=function(X){function L(){var N=X!==null&&X.apply(this,arguments)||this;return N.elements=[],N}return kt(L,X),L.prototype.addElement=function(N){this.elements.push(N)},L.prototype.getUI=function(){var N=X.prototype.getUI.call(this);return this.elements.forEach(function(z){return N.appendChild(z)}),N},L}(yn),br=function(){function X(L,N){this.horizontal=L,this.vertical=N}return Object.defineProperty(X.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),X.prototype.getVerticalLength=function(L){return L/this.ratio},X.prototype.getHorizontalLength=function(L){return L*this.ratio},X}(),Er=function(){function X(){}return X.getIcon=function(L,N){if(L>0&&N>0){var z=new br(L,N),ne=z.ratio>=1?20:z.getHorizontalLength(20),J=z.ratio<1?20:z.getVerticalLength(20),je=document.createElementNS("http://www.w3.org/2000/svg","svg");je.setAttribute("xmlns","http://www.w3.org/2000/svg"),je.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(je);var $t=Le.createDefs();je.appendChild($t);var In=Le.createElement("clipPath",[["id","text-bg-clip"]]);$t.appendChild(In);var Jn=Le.createPath(Le.getHollowRectanglePath((24-ne)/2,(24-J)/2,ne,J,(24-ne)/2+2,(24-J)/2+2,ne-4,J-4));je.appendChild(Jn);var ln=Le.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ln.appendChild(Le.createTSpan(L+":"+N)),je.appendChild(ln);var tr=ln.getBBox();Le.setAttributes(ln,[["x",((24-tr.width)/2).toString()],["y",((24-tr.height)/2-tr.y).toString()]]);var qn=Le.createPath(Le.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(tr.width))/2,(24-Math.ceil(tr.height))/2,Math.ceil(tr.width),Math.ceil(tr.height)));return In.appendChild(qn),Le.setAttributes(Jn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(je),je.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},X}(),rr=function(X){function L(N,z,ne){var J=X.call(this,N,z)||this;return J.isDropdownOpen=!1,J.onClick=J.dropdownButtonClicked,J.dropdownButtons=ne,J}return kt(L,X),L.prototype.setupDropdown=function(){var N=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(z){z.className=N.className,z.colorsClassName=N.colorsClassName,N.dropdownBlock.appendChild(z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},L.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},L.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},L.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},L.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},L.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},L}(Kn),cr=function(){function X(L,N){this.GRIP_SIZE=10,this.color=L,this.fillColor=N,this.visual=Le.createGroup(),this.visual.appendChild(Le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Le.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},X.prototype.setCenter=function(L,N){this.visual.childNodes.forEach(function(z){return Le.setAttributes(z,[["cx",L.toString()],["cy",N.toString()]])})},X}(),Pr=function(){function X(L,N,z,ne){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=L,this.canvasHeight=N,this.margin=z,this.container=ne,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(L){this._aspectRatio=L,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.gridContainer&&Le.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(L){this._zoomFactor=L,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var L=this;this.cropShadeElement=Le.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Le.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var N=0;N<this.numberOfGridLines;N++)this.horizontalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Le.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(z){return L.gridContainer.appendChild(z)}),this.verticalGridLines.forEach(function(z){return L.gridContainer.appendChild(z)}),this.cropRectElement=Le.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new cr(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},X.prototype.setCropRectangle=function(L){this.cropRect=L;var N=Object.assign({},this.cropRect);this.zoomFactor!==1&&(N.width=this.cropRect.width*this.zoomFactor,N.height=this.cropRect.height*this.zoomFactor,N.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-N.width/2,N.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-N.height/2),Le.setAttributes(this.cropRectElement,[["x",N.x.toString()],["y",N.y.toString()],["width",N.width.toString()],["height",N.height.toString()]]);var z=N.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(J,je){var $t=N.y+z*(je+1);Le.setAttributes(J,[["x1",""+N.x],["y1",""+$t],["x2",""+(N.x+N.width)],["y2",""+$t]])});var ne=N.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(J,je){var $t=N.x+ne*(je+1);Le.setAttributes(J,[["x1",""+$t],["y1",""+N.y],["x2",""+$t],["y2",""+(N.y+N.height)]])}),Le.setAttributes(this.cropShadeElement,[["d",Le.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,N.x,N.y,N.width,N.height)]]),this.topLeftGrip.setCenter(N.x,N.y),this.topRightGrip.setCenter(N.x+N.width,N.y),this.bottomLeftGrip.setCenter(N.x,N.y+N.height),this.bottomRightGrip.setCenter(N.x+N.width,N.y+N.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},X.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},X.prototype.clientToLocalCoordinates=function(L,N){var z=this.container.getBoundingClientRect();return{x:L-z.left+this.margin,y:N-z.top+this.margin}},X.prototype.onPointerDown=function(L){this.container.setPointerCapture(L.pointerId),this.previousPoint=this.clientToLocalCoordinates(L.clientX,L.clientY),this.cropRectElement===L.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(L.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(L.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(L.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(L.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(L){if(this.isMoving)this.move(this.clientToLocalCoordinates(L.clientX,L.clientY));else if(this.activeGrip){var N=this.clientToLocalCoordinates(L.clientX,L.clientY);this.resize(N)}L.preventDefault()},X.prototype.onPointerUp=function(L){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(L.pointerId)},X.prototype.move=function(L){var N=L.x-this.previousPoint.x,z=L.y-this.previousPoint.y;this.zoomFactor!==1&&(N=-N/this.zoomFactor,z=-z/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+N),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=L},X.prototype.resize=function(L){var N=Object.assign({},this.cropRect),z=L.x-this.previousPoint.x,ne=L.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:N.x+z<this.margin&&(z=this.margin-N.x),N.x+=z,N.width=this.cropRect.x+this.cropRect.width-N.x;break;case this.bottomRightGrip:case this.topRightGrip:N.width+z>this.canvasWidth*this.zoomFactor&&(z=this.canvasWidth*this.zoomFactor-N.width),N.width+=z}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(N.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(z),N.height=this.aspectRatio.getVerticalLength(N.width)):(N.y+=ne,N.height=this.cropRect.y+this.cropRect.height-N.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?N.height=this.aspectRatio.getVerticalLength(N.width):N.height+=ne}N.width<10&&(N.x=this.cropRect.x,N.width=10),N.height<10&&(N.y=this.cropRect.y,N.height=10),this.previousPoint=L,N.x>=this.margin&&N.y>=this.margin&&N.x-this.margin+N.width<=this.canvasWidth&&N.y-this.margin+N.height<=this.canvasHeight&&(this.cropRect=N,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var L=this.cropRect.x+this.cropRect.width/2,N=this.cropRect.y+this.cropRect.height/2,z=this.aspectRatio.getHorizontalLength(this.cropRect.height),ne=this.aspectRatio.getVerticalLength(this.cropRect.width);z/this.canvasWidth<ne/this.canvasHeight?this.cropRect.width=z:this.cropRect.height=ne,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=L-this.cropRect.width/2,this.cropRect.y=N-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},X.prototype.getRescaledRect=function(L,N,z,ne,J,je){var $t=z/L,In=ne/N;return{x:(J.x-je)*$t+je,y:(J.y-je)*In+je,width:J.width*$t,height:J.height*In}},X.prototype.scaleCanvas=function(L,N){var z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,L,N,this.cropRect,this.margin);this.canvasWidth=L,this.canvasHeight=N,this.onCropChange&&this.onCropChange(z),this.setCropRectangle(z)},X}(),Kr=function(){function X(L){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=L,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(X.prototype,"angle",{get:function(){return this._angle},set:function(L){this._angle=L,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},X.prototype.onPointerDown=function(L){this.controlContainer.setPointerCapture(L.pointerId),this.isDragging=!0,this.previousPoint={x:L.clientX,y:L.clientY}},X.prototype.onPointerMove=function(L){this.isDragging&&(this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.previousPoint.x=L.clientX)},X.prototype.onPointerUp=function(L){this.isDragging&&this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(L.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var L=this.angleLabelText.getBBox();Le.setAttributes(this.angleLabelElement,[["x",((this.width-L.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var L=this.scaleShape.transform.baseVal.getItem(0);L.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(L,0)}},X.prototype.getVisual=function(){var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("width",this.width+"px"),L.setAttribute("height",this.height+"px"),L.setAttribute("viewBox","0 0 "+this.width+" "+this.height),L.style.flexShrink="0",document.body.appendChild(L);for(var N="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,z=1;z<=this.width/5+10;z++){var ne=z%5==0?this.height/3:this.height/6;N+="h4v"+-ne+"h1v"+ne}N+="v1H0Z",this.scaleShape=Le.createPath(N);var J=Le.createTransform();this.scaleShape.transform.baseVal.appendItem(J),L.appendChild(this.scaleShape),this.angleLabelElement=Le.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Le.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var je=Le.createTSpan("");return je.innerHTML="&deg;",this.angleLabelElement.appendChild(je),L.appendChild(this.angleLabelElement),document.body.removeChild(L),L},X}(),hi=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(L,N,z,ne,J,je,$t){var In=this;return new Promise(function(Jn){var ln=document.createElement("canvas");ln.width=L.width.baseVal.value-2*ne,ln.height=L.height.baseVal.value-2*ne;var tr=1,qn=1;In.naturalSize===!0?(tr=N.naturalWidth/(L.width.baseVal.value-2*ne)/je,qn=N.naturalHeight/(L.height.baseVal.value-2*ne)/$t,ln.width=N.naturalWidth/je,ln.height=N.naturalHeight/$t):In.width!==void 0&&In.height!==void 0&&(tr=In.width/z.width,qn=In.height/z.height,ln.width*=tr,ln.height*=qn);var kr=ln.getContext("2d");kr.translate(ln.width/2,ln.height/2),kr.rotate(J*Math.PI/180),kr.scale(je,$t),kr.translate(-ln.width/2,-ln.height/2),kr.drawImage(N,0,0,ln.width,ln.height);var li=document.createElement("canvas");li.width=z.width*tr,li.height=z.height*qn,li.getContext("2d").putImageData(kr.getImageData((z.x-ne)*tr,(z.y-ne)*qn,z.width*tr,z.height*qn),0,0),Jn(li.toDataURL(In.imageType,In.imageQuality))})},X}(),pn=function(){function X(L){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=X.instanceCounter++,this.styles=new qe(this.instanceNo),this.target=L,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(L){this._zoomToCropEnabled=L,L?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(L){this._gridLines=L,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(L){this._rotationAngle=L,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var L;return(L=this._aspectRatio)!==null&&L!==void 0?L:this.aspectRatios[0]},set:function(L){this._aspectRatio=L},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(L){L===void 0&&(L=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),L||this.closeEventListeners.forEach(function(N){return N()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(L){this.renderEventListeners.push(L)},X.prototype.removeRenderEventListener=function(L){this.renderEventListeners.indexOf(L)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(L),1)},X.prototype.addCloseEventListener=function(L){this.closeEventListeners.push(L)},X.prototype.removeCloseEventListener=function(L){this.closeEventListeners.indexOf(L)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(L),1)},X.prototype.setupResizeObserver=function(){var L=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var L=1*this.target.clientWidth/this.target.clientHeight,N=this.contentDiv.clientWidth/L>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*L:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,z=N+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/L;this.resize(N,z)}},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Le.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},X.prototype.resize=function(L,N){this.imageWidth=Math.round(L),this.imageHeight=Math.round(N),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},X.prototype.setEditingTarget=function(){var L=document.createElement("canvas");L.width=this.target.naturalWidth,L.height=this.target.naturalHeight,L.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var N=L.toDataURL();Le.setAttributes(this.editingTarget,[["href",N]]),this.setEditingTargetSize()},X.prototype.setTopLeft=function(){var L=this.target.getBoundingClientRect(),N=this.editorCanvas.getBoundingClientRect();this.left=L.left-N.left-this.CANVAS_MARGIN,this.top=L.top-N.top-this.CANVAS_MARGIN},X.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Le.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Le.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Le.createGroup(),this.editingTargetRotationScaleContainer=Le.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var L=Le.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(L);var N=Le.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(N),this.editingTargetContainer=Le.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},X.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},X.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Le.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Pr(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},X.prototype.zoomToCrop=function(){if(this.cropRect){var L=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,N=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=L+"px "+N+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-L+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-N+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},X.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},X.prototype.cropRectChanged=function(L){this.cropRect=L,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},X.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},X.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,N=this.target.offsetTop>L+this.CANVAS_MARGIN?this.target.offsetTop-(L+this.CANVAS_MARGIN):0;this.coverDiv.style.top=N+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var L=this;this.topToolbar=new sn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var N=new nr;N.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(N);var z=[];this.aspectRatios.forEach(function(qn){var kr=new Kn(Er.getIcon(qn.horizontal,qn.vertical),qn.horizontal===0&&qn.vertical===0?"FREE":qn.horizontal+":"+qn.vertical);kr.onClick=function(){return L.ratioButtonClicked(qn)},z.push(kr)}),this.aspectRatioButton=new rr(Er.getIcon(0,0),"Aspect ratio",z),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,N.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ne=new Kn('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ne.isActive=this.isGridVisible,ne.onClick=function(){L.isGridVisible=!L.isGridVisible,ne.isActive=L.isGridVisible},N.addButton(ne);var J=new Kn('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(J.isActive=this.zoomToCropEnabled,J.onClick=function(){L.zoomToCropEnabled=!L.zoomToCropEnabled,J.isActive=L.zoomToCropEnabled},N.addButton(J),!un.isLicensed){var je=new wn;this.topToolbar.addElementBlock(je);var $t=document.createElement("div");$t.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var In=document.createElement("a");In.style.color="currentColor",In.href="https://markerjs.com/products/cropro",In.target="_blank",In.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',$t.appendChild(In),je.addElement($t)}var Jn=new nr;Jn.minWidth=3*this.toolbarHeight+"px",Jn.contentAlign="end",this.topToolbar.addButtonBlock(Jn);var ln=new Kn('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ln.onClick=this.startRenderAndClose,Jn.addButton(ln),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ln.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var tr=new Kn('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");tr.onClick=this.close,Jn.addButton(tr),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(tr.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var L=this;this.bottomToolbar=new sn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var N=new nr;N.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(N);var z=new Kn('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");z.onClick=this.rotateLeftButtonClicked,N.addButton(z);var ne=new Kn('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ne.onClick=this.rotateRightButtonClicked,N.addButton(ne);var J=new wn;J.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(J),this.straightener=new Kr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Jn){L.rotateBy(Jn),L.straightener.angle=L.rotationAngle},J.addElement(this.straightener.getUI());var je=new nr;je.minWidth=2*this.toolbarHeight+"px",je.contentAlign="end",this.bottomToolbar.addButtonBlock(je);var $t=new Kn('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");$t.onClick=this.flipHorizontallyButtonClicked,je.addButton($t);var In=new Kn('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");In.onClick=this.flipVerticallyButtonClicked,je.addButton(In)},X.prototype.ratioButtonClicked=function(L){this.aspectRatio=L,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Er.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new br(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(L){if(L){var N=this.cropLayer.getRescaledRect(L.width,L.height,this.imageWidth,this.imageHeight,L.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(N),this.cropRectChanged(N),this.flippedHorizontally=L.flippedHorizontally,this.flippedVertically=L.flippedVertically,this.applyFlip(),this.rotationAngle=L.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(L,N){var z=this.cropImage.getBoundingClientRect();return{x:L-z.left,y:N-z.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var L=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},X.prototype.rotateLeftButtonClicked=function(){var L=this.rotationAngle-90;this.rotationAngle%90!=0&&(L+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(L)},X.prototype.rotateRightButtonClicked=function(){var L=this.rotationAngle+90;this.rotationAngle%90!=0&&(L-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(L)},X.prototype.rotateTo=function(L){L=(L=L>180?L-360:L)<=-180?L+360:L,this.rotationAngle=L,this.applyRotation()},X.prototype.rotateBy=function(L){this.rotateTo((this.rotationAngle+L)%360)},X.prototype.applyRotation=function(){var L=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var N=this.editingTargetRotationContainer.transform.baseVal.getItem(0);N.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(N,0);var z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/z.width,this.imageHeight/z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=L},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return ct(this,void 0,void 0,function(){var L,N;return Qt(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return L=z.sent(),N=this.getState(),this.renderEventListeners.forEach(function(ne){return ne(L,N)}),this.close(!0),[2]}})})},X.prototype.render=function(){return ct(this,void 0,void 0,function(){var L;return Qt(this,function(N){switch(N.label){case 0:return(L=new hi).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.width=this.renderWidth,L.height=this.renderHeight,this.unzoomFromCrop(),Le.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,L.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return N.sent(),[4,L.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,N.sent()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new jt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new jt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new jt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var L=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new jt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*L)+`px;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new jt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new jt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new mt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new mt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new jt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new jt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new jt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new jt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new jt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},X.instanceCounter=0,X}(),or=D("8hTe"),mi=D.n(or),wi=/<pre[^>]*>/g;function ti(X){var L=document.createElement("div");return L.innerHTML=X,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var ni=he.a=function(X){var L=X.value,N=L===void 0?"":L,z=X.edit,ne=z===void 0?!1:z,J=X.className,je=X.showTextOnly,$t=X.showLines,In=X.replaces,Jn=X.zoomImg,ln=X.hasMask,tr=X.style,qn=tr===void 0?{}:tr,kr=X.stylesPrev,li=kr===void 0?{}:kr,ai=String(N),Gr=Object(M.useRef)(),Li=Object(M.useRef)(),Vi=Object(M.useState)(""),Dr=Object(K.a)(Vi,2),Sr=Dr[0],ri=Dr[1],Br=Object(M.useState)("office"),Bn=Object(K.a)(Br,2),_n=Bn[0],Tn=Bn[1],bn=function(){var Re=new pn(Li.current);Re.displayMode="popup",Re.addRenderEventListener(function(){var Xe=Object(I.a)(r.a.mark(function it(Dt){var Tt;return r.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return Gr.current.style.display="none",_t.next=3,Object($e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dt}});case 3:Tt=_t.sent,Tt!=null&&Tt.id&&In(Li.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Tt==null?void 0:Tt.id,"?type=").concat(Tt.content_type));case 5:case"end":return _t.stop()}},it)}));return function(it){return Xe.apply(this,arguments)}}()),Re.show()},ur=function(){var Re=new de(Li.current);Re.settings.displayMode="popup",Re.addEventListener("render",function(){var Xe=Object(I.a)(r.a.mark(function it(Dt){var Tt;return r.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:if(Gr.current.style.display="none",!Li.current){_t.next=6;break}return _t.next=4,Object($e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Dt.dataUrl}});case 4:Tt=_t.sent,Tt!=null&&Tt.id&&In(Li.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(Tt==null?void 0:Tt.id,"?type=").concat(Tt.content_type));case 6:case"end":return _t.stop()}},it)}));return function(it){return Xe.apply(this,arguments)}}()),Re.show(),window.markerArea=Re},sr=Object(M.useMemo)(function(){Gr.current&&(Gr.current.style.zIndex=-1);try{var rt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Re=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Xe=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ai=ai.replace(rt,"("+q.a.API_SERVER+"/api/attachments/").replace(Re,'"'+q.a.API_SERVER+"/api/attachments/").replace(Xe,'"'+q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Be){}var it=H(ai),Dt=_();if(ai.match(/\[TOC\]/)&&(it=it.replace("<p>[TOC]</p>",R()),O()),it=it.replace(/(__special_katext_id_\d+__)/g,function(Be,_t){var at=Dt[_t],dt=at.type,wt=at.expression;return Object(ie.renderToString)(ti(wt)||"",{displayMode:dt==="block",throwOnError:!1,output:"html"})}),it=it.replace(/▁/g,"\u2581\u2581\u2581"),g(),je){var Tt=document.createElement("div");return Tt.innerHTML=it,Tt.innerText}return setTimeout(function(){return Ce()},500),it},[ai]),Q=Object(M.useRef)();T.WebkitLineClamp=$t,$t&&(qn=Object(P.a)(Object(P.a)({},qn),T));function ce(rt){var Re=rt.target;if(Re.tagName.toUpperCase()==="IMG"){if(Jn){var Xe=Re.getAttribute("src");ri(Xe),Tn("image")}}else if(Re.tagName.toUpperCase()==="A"){var it=Re.getAttribute("href");if(it.indexOf("office")>-1)rt.preventDefault(),ri(it),Tn("office");else if(it.indexOf("application/pdf")>-1)rt.preventDefault(),ri(it),Tn("pdf");else if(it.indexOf("text/html")>-1)rt.preventDefault(),ri(it),Tn("html");else if(it.startsWith("#")){rt.preventDefault();var Dt=document.getElementById(it.replace("#",""));Dt&&Dt.scrollIntoView(!0)}}}var Ce=function(){var Re,Xe=(Re=Q.current)===null||Re===void 0?void 0:Re.querySelectorAll("video");Xe==null||Xe.forEach(function(it){if(it.oncontextmenu=function(){return!1},it.src.indexOf(".m3u8")>-1&&!it.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var Dt=new Y.a;Dt.loadSource(it.src),Dt.attachMedia(it)}}})};Object(M.useEffect)(function(){if(Q.current&&sr&&(sr.match(wi)&&window.PR.prettyPrint()),Q.current)return Q.current.addEventListener("click",ce),function(){Q.current.removeEventListener("click",ce),g(),O()}},[sr,Q.current,ce]);var Te=function(Re){if(!ne)return;Re.target.nodeName==="IMG"?(Gr.current.style.zIndex=1,Gr.current.style.display="flex",Gr.current.style.width=Re.target.clientWidth+"px",Gr.current.style.height=Re.target.clientHeight+"px",Gr.current.style.top=Re.target.offsetTop+"px",Gr.current.style.left=Re.target.offsetLeft+"px",Li.current.src=Re.target.getAttribute("src")):Gr.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:Q,style:Object(P.a)({},qn),className:"".concat(J||""," markdown-body ").concat(mi.a.mdBody),onMouseOver:Te,dangerouslySetInnerHTML:{__html:sr}}),b.a.createElement("div",{ref:Gr,className:mi.a.button},b.a.createElement(V.a,null,b.a.createElement(G.a,{onClick:function(){return bn()}},"\u88C1\u526A"),b.a.createElement(G.a,{onClick:function(){return ur()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Li,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(me.a,{close:!0,data:Sr,type:Sr!=null&&Sr.length?_n:"",style:Object(P.a)({},li),onClose:function(){return ri("")}}))}},"9VGf":function(Kt,he,D){"use strict";D.d(he,"a",function(){return U});var Z=D("q1tI"),V=D.n(Z);function U(G,P){var I=Object(Z.useRef)();Object(Z.useEffect)(function(){I.current=G}),Object(Z.useEffect)(function(){function K(){I.current()}if(P!==null){var k=setInterval(K,P);return function(){return clearInterval(k)}}},[P])}},AHFd:function(Kt,he,D){"use strict";D.d(he,"a",function(){return k});var Z=D("giR+"),V=D("fyUT"),U=D("OaEy"),G=D("2fM7"),P=D("tJVT"),I=D("q1tI"),K=D.n(I),k;(function(M){M[M.Number=1]="Number",M[M.Percent=2]="Percent"})(k||(k={}));var r=function(b){var f=b.value,m=b.onChange,l=b.disabled,o=b.hidePercentOption,a=o===void 0?!1:o,c=Object(I.useMemo)(function(){return a?k.Number:k.Percent},[a]),s=Object(I.useState)(c),i=Object(P.a)(s,2),n=i[0],O=i[1],T=Object(I.useCallback)(function(R){return n===k.Number?"".concat(R,"\u5206"):"".concat(R,"%")},[n]),C=Object(I.useCallback)(function(R){if(n===k.Number){var S=R.replace("\u5206","");return isNaN(parseInt(S,10))?0:S}else{var v=R.replace("%","");return v}},[n]);return Object(I.useEffect)(function(){O(f.type)},[f]),K.a.createElement("div",{style:{display:"inline-block"}},K.a.createElement(G.a,{onChange:function(S){O(S),m({type:S,inputValue:S===k.Number?5:20})},value:n||c,style:{width:100},options:a?[{label:"\u5206\u503C",value:k.Number}]:[{label:"\u767E\u5206\u6BD4",value:k.Percent},{label:"\u5206\u503C",value:k.Number}],disabled:l}),K.a.createElement(V.a,{disabled:l,value:f.inputValue,formatter:T,parser:C,max:n===k.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(S){m({type:n,inputValue:S})}}))};he.b=r},BU3w:function(Kt,he,D){"use strict";D.d(he,"a",function(){return I});var Z=D("MNnm"),V="rc-util-key";function U(K){if(K.attachTo)return K.attachTo;var k=document.querySelector("head");return k||document.body}function G(K){var k,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(Z.a)())return null;var M=document.createElement("style");if((k=r.csp)===null||k===void 0?void 0:k.nonce){var b;M.nonce=(b=r.csp)===null||b===void 0?void 0:b.nonce}M.innerHTML=K;var f=U(r),m=f.firstChild;return r.prepend&&f.prepend?f.prepend(M):r.prepend&&m?f.insertBefore(M,m):f.appendChild(M),M}var P=new Map;function I(K,k){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},M=U(r);if(!P.has(M)){var b=G("",r),f=b.parentNode;P.set(M,f),f.removeChild(b)}var m=Array.from(P.get(M).children).find(function(s){return s.tagName==="STYLE"&&s[V]===k});if(m){var l,o;if(((l=r.csp)===null||l===void 0?void 0:l.nonce)&&m.nonce!==((o=r.csp)===null||o===void 0?void 0:o.nonce)){var a;m.nonce=(a=r.csp)===null||a===void 0?void 0:a.nonce}return m.innerHTML!==K&&(m.innerHTML=K),m}var c=G(K,r);return c[V]=k,c}},Bd2K:function(Kt,he,D){(function(Z){Z(D("VrN/"),D("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(r,M,b){if(b!=Z.Init&&b&&r.removeKeyMap("autoCloseTags"),!M)return;var f={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(f["'/'"]=function(m){return I(m)}),(typeof M!="object"||M.whenOpening!==!1)&&(f["'>'"]=function(m){return G(m)}),r.addKeyMap(f)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],U=["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 G(r){if(r.getOption("disableInput"))return Z.Pass;for(var M=r.listSelections(),b=[],f=r.getOption("autoCloseTags"),m=0;m<M.length;m++){if(!M[m].empty())return Z.Pass;var l=M[m].head,o=r.getTokenAt(l),a=Z.innerMode(r.getMode(),o.state),c=a.state,s=a.mode.xmlCurrentTag&&a.mode.xmlCurrentTag(c),i=s&&s.name;if(!i)return Z.Pass;var n=a.mode.configuration=="html",O=typeof f=="object"&&f.dontCloseTags||n&&V,T=typeof f=="object"&&f.indentTags||n&&U;o.end>l.ch&&(i=i.slice(0,i.length-o.end+l.ch));var C=i.toLowerCase();if(!i||o.type=="string"&&(o.end!=l.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&s.close||o.string.indexOf("/")==l.ch-o.start-1||O&&K(O,C)>-1||k(r,a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(c)||[],i,l,!0))return Z.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&K(R,i)>-1){b[m]={text:"/>",newPos:Z.Pos(l.line,l.ch+2)};continue}var S=T&&K(T,C)>-1;b[m]={indent:S,text:">"+(S?`
`:"")+"</"+i+">",newPos:S?Z.Pos(l.line+1,0):Z.Pos(l.line,l.ch+1)}}for(var v=typeof f=="object"&&f.dontIndentOnAutoClose,m=M.length-1;m>=0;m--){var E=b[m];r.replaceRange(E.text,M[m].head,M[m].anchor,"+insert");var h=r.listSelections().slice(0);h[m]={head:E.newPos,anchor:E.newPos},r.setSelections(h),!v&&E.indent&&(r.indentLine(E.newPos.line,null,!0),r.indentLine(E.newPos.line+1,null,!0))}}function P(r,M){for(var b=r.listSelections(),f=[],m=M?"/":"</",l=r.getOption("autoCloseTags"),o=typeof l=="object"&&l.dontIndentOnSlash,a=0;a<b.length;a++){if(!b[a].empty())return Z.Pass;var c=b[a].head,s=r.getTokenAt(c),i=Z.innerMode(r.getMode(),s.state),n=i.state;if(M&&(s.type=="string"||s.string.charAt(0)!="<"||s.start!=c.ch-1))return Z.Pass;var O,T=i.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&i.mode.name=="javascript")O=m+"script";else if(T&&i.mode.name=="css")O=m+"style";else{var C=i.mode.xmlCurrentContext&&i.mode.xmlCurrentContext(n);if(!C||C.length&&k(r,C,C[C.length-1],c))return Z.Pass;O=m+C[C.length-1]}r.getLine(c.line).charAt(s.end)!=">"&&(O+=">"),f[a]=O}if(r.replaceSelections(f),b=r.listSelections(),!o)for(var a=0;a<b.length;a++)(a==b.length-1||b[a].head.line<b[a+1].head.line)&&r.indentLine(b[a].head.line)}function I(r){return r.getOption("disableInput")?Z.Pass:P(r,!0)}Z.commands.closeTag=function(r){return P(r)};function K(r,M){if(r.indexOf)return r.indexOf(M);for(var b=0,f=r.length;b<f;++b)if(r[b]==M)return b;return-1}function k(r,M,b,f,m){if(!Z.scanForClosingTag)return!1;var l=Math.min(r.lastLine()+1,f.line+500),o=Z.scanForClosingTag(r,f,null,l);if(!o||o.tag!=b)return!1;for(var a=m?1:0,c=M.length-1;c>=0&&M[c]==b;c--)++a;f=o.to;for(var c=1;c<a;c++){var s=Z.scanForClosingTag(r,f,null,l);if(!s||s.tag!=b)return!1;f=s.to}return!0}})},BdwD:function(Kt,he,D){"use strict";var Z=D("+L6B"),V=D("2/Rp"),U=D("0Owb"),G=D("k1fw"),P=D("q1tI"),I=D.n(P),K=D("FOrL"),k=D.n(K),r=function(b){var f=b.buttonProps,m=f===void 0?{}:f,l=b.styles,o=l===void 0?{}:l,a=b.customText,c=b.ButtonText,s=b.ButtonClick,i=b.Buttonclass,n=b.ButtonTwo;return I.a.createElement("section",{className:"tc animated fadeIn",style:Object(G.a)(Object(G.a)({},{color:"#999",margin:"200px auto"}),o)},I.a.createElement("img",{src:k.a}),I.a.createElement("p",{className:"mt20 font14"},a||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),c&&I.a.createElement(V.a,Object(U.a)({className:i,onClick:s},m),c),n&&n)};he.a=r},BjJ7:function(Kt,he,D){"use strict";D.d(he,"d",function(){return V}),D.d(he,"c",function(){return U}),D.d(he,"e",function(){return G}),D.d(he,"b",function(){return P}),D.d(he,"a",function(){return K});var Z=D("m3rI");function V(k){var r=!0;if(k.length>0){for(var M=0;M<k.length;M++)if(k[M].compile_success==0||!k[M].compile_success){r=!1;break}}else r=!1;return r}function U(k){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],b=0;b<k.length;b++){var f=k[b],m=r?"".concat(r,"/").concat(f.name):"".concat(f.name);M.push({title:f.name,isLeaf:!(f.type==="tree"),key:m})}return M}function G(k,r,M){for(var b=0;b<k.length;b++){var f=k[b];if(f.key===r){f.children=M;break}f.children&&G(f.children,r,M)}return k}function P(k,r,M){var b;return function(){var f=this,m=arguments,l=function(){b=null,M||k.apply(f,m)},o=M&&!b;clearTimeout(b),b=setTimeout(l,r),o&&k.apply(f,m)}}var I=!0,K=Z.a.API_SERVER},"C+DQ":function(Kt,he,D){},"C/vA":function(Kt,he,D){"use strict";D.d(he,"a",function(){return Z});function Z(V){const U=this;let G=!1,P;return function(){return G||(G=!0,P=V.apply(U,arguments)),P}}},"Cg/j":function(Kt,he,D){"use strict";D.d(he,"b",function(){return Z}),D.d(he,"a",function(){return V}),D.d(he,"c",function(){return G}),D.d(he,"d",function(){return P});var Z;(function(I){I.serviceIds=new Map,I.DI_TARGET="$di$target",I.DI_DEPENDENCIES="$di$dependencies";function K(k){return k[I.DI_DEPENDENCIES]||[]}I.getServiceDependencies=K})(Z||(Z={}));const V=G("instantiationService");function U(I,K,k,r){K[Z.DI_TARGET]===K?K[Z.DI_DEPENDENCIES].push({id:I,index:k,optional:r}):(K[Z.DI_DEPENDENCIES]=[{id:I,index:k,optional:r}],K[Z.DI_TARGET]=K)}function G(I){if(Z.serviceIds.has(I))return Z.serviceIds.get(I);const K=function(k,r,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");U(K,k,M,!1)};return K.toString=()=>I,Z.serviceIds.set(I,K),K}function P(I){return function(K,k,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");U(I,K,r,!0)}}},DlQD:function(Kt,he,D){(function(Z,V){Kt.exports=V()})(this,function(){"use strict";function Z(De,ye){for(var we=0;we<ye.length;we++){var ae=ye[we];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(De,ae.key,ae)}}function V(De,ye,we){return ye&&Z(De.prototype,ye),we&&Z(De,we),De}function U(De,ye){if(!De)return;if(typeof De=="string")return G(De,ye);var we=Object.prototype.toString.call(De).slice(8,-1);if(we==="Object"&&De.constructor&&(we=De.constructor.name),we==="Map"||we==="Set")return Array.from(De);if(we==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(we))return G(De,ye)}function G(De,ye){(ye==null||ye>De.length)&&(ye=De.length);for(var we=0,ae=new Array(ye);we<ye;we++)ae[we]=De[we];return ae}function P(De,ye){var we;if(typeof Symbol=="undefined"||De[Symbol.iterator]==null){if(Array.isArray(De)||(we=U(De))||ye&&De&&typeof De.length=="number"){we&&(De=we);var ae=0;return function(){return ae>=De.length?{done:!0}:{done:!1,value:De[ae++]}}}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 we=De[Symbol.iterator](),we.next.bind(we)}function I(De,ye){return ye={exports:{}},De(ye,ye.exports),ye.exports}var K=I(function(De){function ye(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function we(ae){De.exports.defaults=ae}De.exports={defaults:ye(),getDefaults:ye,changeDefaults:we}}),k=K.defaults,r=K.getDefaults,M=K.changeDefaults,b=/[&<>"']/,f=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=function(ye){return o[ye]};function c(De,ye){if(ye){if(b.test(De))return De.replace(f,a)}else if(m.test(De))return De.replace(l,a);return De}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(De){return De.replace(s,function(ye,we){return we=we.toLowerCase(),we==="colon"?":":we.charAt(0)==="#"?we.charAt(1)==="x"?String.fromCharCode(parseInt(we.substring(2),16)):String.fromCharCode(+we.substring(1)):""})}var n=/(^|[^\[])\^/g;function O(De,ye){De=De.source||De,ye=ye||"";var we={replace:function(oe,pe){return pe=pe.source||pe,pe=pe.replace(n,"$1"),De=De.replace(oe,pe),we},getRegex:function(){return new RegExp(De,ye)}};return we}var T=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(De,ye,we){if(De){var ae;try{ae=decodeURIComponent(i(we)).replace(T,"").toLowerCase()}catch(oe){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}ye&&!C.test(we)&&(we=p(ye,we));try{we=encodeURI(we).replace(/%25/g,"%")}catch(oe){return null}return we}var S={},v=/^[^:]+:\/*[^/]*$/,E=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function p(De,ye){S[" "+De]||(v.test(De)?S[" "+De]=De+"/":S[" "+De]=j(De,"/",!0)),De=S[" "+De];var we=De.indexOf(":")===-1;return ye.substring(0,2)==="//"?we?ye:De.replace(E,"$1")+ye:ye.charAt(0)==="/"?we?ye:De.replace(h,"$1")+ye:De+ye}var _={exec:function(){}};function g(De){for(var ye=1,we,ae;ye<arguments.length;ye++){we=arguments[ye];for(ae in we)Object.prototype.hasOwnProperty.call(we,ae)&&(De[ae]=we[ae])}return De}function w(De,ye){var we=De.replace(/\|/g,function(pe,_e,be){for(var Ke=!1,St=_e;--St>=0&&be[St]==="\\";)Ke=!Ke;return Ke?"|":" |"}),ae=we.split(/ \|/),oe=0;if(ae.length>ye)ae.splice(ye);else for(;ae.length<ye;)ae.push("");for(;oe<ae.length;oe++)ae[oe]=ae[oe].trim().replace(/\\\|/g,"|");return ae}function j(De,ye,we){var ae=De.length;if(ae===0)return"";for(var oe=0;oe<ae;){var pe=De.charAt(ae-oe-1);if(pe===ye&&!we)oe++;else if(pe!==ye&&we)oe++;else break}return De.substr(0,ae-oe)}function B(De,ye){if(De.indexOf(ye[1])===-1)return-1;for(var we=De.length,ae=0,oe=0;oe<we;oe++)if(De[oe]==="\\")oe++;else if(De[oe]===ye[0])ae++;else if(De[oe]===ye[1]&&(ae--,ae<0))return oe;return-1}function A(De){De&&De.sanitize&&!De.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:c,unescape:i,edit:O,cleanUrl:R,resolveUrl:p,noopTest:_,merge:g,splitCells:w,rtrim:j,findClosingBracket:B,checkSanitizeDeprecation:A},F=K.defaults,x=H.rtrim,Y=H.splitCells,q=H.escape,ie=H.findClosingBracket;function me(De,ye,we){var ae=ye.href,oe=ye.title?q(ye.title):null,pe=De[1].replace(/\\([\[\]])/g,"$1");return De[0].charAt(0)!=="!"?{type:"link",raw:we,href:ae,title:oe,text:pe}:{type:"image",raw:we,href:ae,title:oe,text:q(pe)}}function $e(De,ye){var we=De.match(/^(\s+)(?:```)/);if(we===null)return ye;var ae=we[1];return ye.split(`
`).map(function(oe){var pe=oe.match(/^\s+/);if(pe===null)return oe;var _e=pe[0];return _e.length>=ae.length?oe.slice(ae.length):oe}).join(`
`)}var xe=function(){function De(we){this.options=we||F}var ye=De.prototype;return ye.space=function(ae){var oe=this.rules.block.newline.exec(ae);if(oe)return oe[0].length>1?{type:"space",raw:oe[0]}:{raw:`
`}},ye.code=function(ae,oe){var pe=this.rules.block.code.exec(ae);if(pe){var _e=oe[oe.length-1];if(_e&&_e.type==="paragraph")return{raw:pe[0],text:pe[0].trimRight()};var be=pe[0].replace(/^ {4}/gm,"");return{type:"code",raw:pe[0],codeBlockStyle:"indented",text:this.options.pedantic?be:x(be,`
`)}}},ye.fences=function(ae){var oe=this.rules.block.fences.exec(ae);if(oe){var pe=oe[0],_e=$e(pe,oe[3]||"");return{type:"code",raw:pe,lang:oe[2]?oe[2].trim():oe[2],text:_e}}},ye.heading=function(ae){var oe=this.rules.block.heading.exec(ae);if(oe)return{type:"heading",raw:oe[0],depth:oe[1].length,text:oe[2]}},ye.nptable=function(ae){var oe=this.rules.block.nptable.exec(ae);if(oe){var pe={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[],raw:oe[0]};if(pe.header.length===pe.align.length){var _e=pe.align.length,be;for(be=0;be<_e;be++)/^ *-+: *$/.test(pe.align[be])?pe.align[be]="right":/^ *:-+: *$/.test(pe.align[be])?pe.align[be]="center":/^ *:-+ *$/.test(pe.align[be])?pe.align[be]="left":pe.align[be]=null;for(_e=pe.cells.length,be=0;be<_e;be++)pe.cells[be]=Y(pe.cells[be],pe.header.length);return pe}}},ye.hr=function(ae){var oe=this.rules.block.hr.exec(ae);if(oe)return{type:"hr",raw:oe[0]}},ye.blockquote=function(ae){var oe=this.rules.block.blockquote.exec(ae);if(oe){var pe=oe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:oe[0],text:pe}}},ye.list=function(ae){var oe=this.rules.block.list.exec(ae);if(oe){for(var pe=oe[0],_e=oe[2],be=_e.length>1,Ke=_e[_e.length-1]===")",St={type:"list",raw:pe,ordered:be,start:be?+_e.slice(0,-1):"",loose:!1,items:[]},nn=oe[0].match(this.rules.block.item),An=!1,bt,Jt,Et,Ct,st,de,Ae,kt=nn.length,ct=0;ct<kt;ct++)bt=nn[ct],pe=bt,Jt=bt.length,bt=bt.replace(/^ *([*+-]|\d+[.)]) */,""),~bt.indexOf(`
`)&&(Jt-=bt.length,bt=this.options.pedantic?bt.replace(/^ {1,4}/gm,""):bt.replace(new RegExp("^ {1,"+Jt+"}","gm"),"")),ct!==kt-1&&(Et=this.rules.block.bullet.exec(nn[ct+1])[0],(be?Et.length===1||!Ke&&Et[Et.length-1]===")":Et.length>1||this.options.smartLists&&Et!==_e)&&(Ct=nn.slice(ct+1).join(`
`),St.raw=St.raw.substring(0,St.raw.length-Ct.length),ct=kt-1)),st=An||/\n\n(?!\s*$)/.test(bt),ct!==kt-1&&(An=bt.charAt(bt.length-1)===`
`,st||(st=An)),st&&(St.loose=!0),de=/^\[[ xX]\] /.test(bt),Ae=void 0,de&&(Ae=bt[1]!==" ",bt=bt.replace(/^\[[ xX]\] +/,"")),St.items.push({type:"list_item",raw:pe,task:de,checked:Ae,loose:st,text:bt});return St}},ye.html=function(ae){var oe=this.rules.block.html.exec(ae);if(oe)return{type:this.options.sanitize?"paragraph":"html",raw:oe[0],pre:!this.options.sanitizer&&(oe[1]==="pre"||oe[1]==="script"||oe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):q(oe[0]):oe[0]}},ye.def=function(ae){var oe=this.rules.block.def.exec(ae);if(oe){oe[3]&&(oe[3]=oe[3].substring(1,oe[3].length-1));var pe=oe[1].toLowerCase().replace(/\s+/g," ");return{tag:pe,raw:oe[0],href:oe[2],title:oe[3]}}},ye.table=function(ae){var oe=this.rules.block.table.exec(ae);if(oe){var pe={type:"table",header:Y(oe[1].replace(/^ *| *\| *$/g,"")),align:oe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:oe[3]?oe[3].replace(/\n$/,"").split(`
`):[]};if(pe.header.length===pe.align.length){pe.raw=oe[0];var _e=pe.align.length,be;for(be=0;be<_e;be++)/^ *-+: *$/.test(pe.align[be])?pe.align[be]="right":/^ *:-+: *$/.test(pe.align[be])?pe.align[be]="center":/^ *:-+ *$/.test(pe.align[be])?pe.align[be]="left":pe.align[be]=null;for(_e=pe.cells.length,be=0;be<_e;be++)pe.cells[be]=Y(pe.cells[be].replace(/^ *\| *| *\| *$/g,""),pe.header.length);return pe}}},ye.lheading=function(ae){var oe=this.rules.block.lheading.exec(ae);if(oe)return{type:"heading",raw:oe[0],depth:oe[2].charAt(0)==="="?1:2,text:oe[1]}},ye.paragraph=function(ae){var oe=this.rules.block.paragraph.exec(ae);if(oe)return{type:"paragraph",raw:oe[0],text:oe[1].charAt(oe[1].length-1)===`
`?oe[1].slice(0,-1):oe[1]}},ye.text=function(ae,oe){var pe=this.rules.block.text.exec(ae);if(pe){var _e=oe[oe.length-1];return _e&&_e.type==="text"?{raw:pe[0],text:pe[0]}:{type:"text",raw:pe[0],text:pe[0]}}},ye.escape=function(ae){var oe=this.rules.inline.escape.exec(ae);if(oe)return{type:"escape",raw:oe[0],text:q(oe[1])}},ye.tag=function(ae,oe,pe){var _e=this.rules.inline.tag.exec(ae);if(_e)return!oe&&/^<a /i.test(_e[0])?oe=!0:oe&&/^<\/a>/i.test(_e[0])&&(oe=!1),!pe&&/^<(pre|code|kbd|script)(\s|>)/i.test(_e[0])?pe=!0:pe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_e[0])&&(pe=!1),{type:this.options.sanitize?"text":"html",raw:_e[0],inLink:oe,inRawBlock:pe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):q(_e[0]):_e[0]}},ye.link=function(ae){var oe=this.rules.inline.link.exec(ae);if(oe){var pe=ie(oe[2],"()");if(pe>-1){var _e=oe[0].indexOf("!")===0?5:4,be=_e+oe[1].length+pe;oe[2]=oe[2].substring(0,pe),oe[0]=oe[0].substring(0,be).trim(),oe[3]=""}var Ke=oe[2],St="";if(this.options.pedantic){var nn=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ke);nn?(Ke=nn[1],St=nn[3]):St=""}else St=oe[3]?oe[3].slice(1,-1):"";Ke=Ke.trim().replace(/^<([\s\S]*)>$/,"$1");var An=me(oe,{href:Ke&&Ke.replace(this.rules.inline._escapes,"$1"),title:St&&St.replace(this.rules.inline._escapes,"$1")},oe[0]);return An}},ye.reflink=function(ae,oe){var pe;if((pe=this.rules.inline.reflink.exec(ae))||(pe=this.rules.inline.nolink.exec(ae))){var _e=(pe[2]||pe[1]).replace(/\s+/g," ");if(_e=oe[_e.toLowerCase()],!_e||!_e.href){var be=pe[0].charAt(0);return{type:"text",raw:be,text:be}}var Ke=me(pe,_e,pe[0]);return Ke}},ye.strong=function(ae,oe,pe){pe===void 0&&(pe="");var _e=this.rules.inline.strong.start.exec(ae);if(_e&&(!_e[1]||_e[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){oe=oe.slice(-1*ae.length);var be=_e[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Ke;(_e=be.exec(oe))!=null;)if(Ke=this.rules.inline.strong.middle.exec(oe.slice(0,_e.index+3)),Ke)return{type:"strong",raw:ae.slice(0,Ke[0].length),text:ae.slice(2,Ke[0].length-2)}}},ye.em=function(ae,oe,pe){pe===void 0&&(pe="");var _e=this.rules.inline.em.start.exec(ae);if(_e&&(!_e[1]||_e[1]&&(pe===""||this.rules.inline.punctuation.exec(pe)))){oe=oe.slice(-1*ae.length);var be=_e[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Ke;(_e=be.exec(oe))!=null;)if(Ke=this.rules.inline.em.middle.exec(oe.slice(0,_e.index+2)),Ke)return{type:"em",raw:ae.slice(0,Ke[0].length),text:ae.slice(1,Ke[0].length-1)}}},ye.codespan=function(ae){var oe=this.rules.inline.code.exec(ae);if(oe){var pe=oe[2].replace(/\n/g," "),_e=/[^ ]/.test(pe),be=pe.startsWith(" ")&&pe.endsWith(" ");return _e&&be&&(pe=pe.substring(1,pe.length-1)),pe=q(pe,!0),{type:"codespan",raw:oe[0],text:pe}}},ye.br=function(ae){var oe=this.rules.inline.br.exec(ae);if(oe)return{type:"br",raw:oe[0]}},ye.del=function(ae){var oe=this.rules.inline.del.exec(ae);if(oe)return{type:"del",raw:oe[0],text:oe[1]}},ye.autolink=function(ae,oe){var pe=this.rules.inline.autolink.exec(ae);if(pe){var _e,be;return pe[2]==="@"?(_e=q(this.options.mangle?oe(pe[1]):pe[1]),be="mailto:"+_e):(_e=q(pe[1]),be=_e),{type:"link",raw:pe[0],text:_e,href:be,tokens:[{type:"text",raw:_e,text:_e}]}}},ye.url=function(ae,oe){var pe;if(pe=this.rules.inline.url.exec(ae)){var _e,be;if(pe[2]==="@")_e=q(this.options.mangle?oe(pe[0]):pe[0]),be="mailto:"+_e;else{var Ke;do Ke=pe[0],pe[0]=this.rules.inline._backpedal.exec(pe[0])[0];while(Ke!==pe[0]);_e=q(pe[0]),pe[1]==="www."?be="http://"+_e:be=_e}return{type:"link",raw:pe[0],text:_e,href:be,tokens:[{type:"text",raw:_e,text:_e}]}}},ye.inlineText=function(ae,oe,pe){var _e=this.rules.inline.text.exec(ae);if(_e){var be;return oe?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_e[0]):q(_e[0]):_e[0]:be=q(this.options.smartypants?pe(_e[0]):_e[0]),{type:"text",raw:_e[0],text:be}}},De}(),Ie=H.noopTest,Je=H.edit,Ye=H.merge,ve={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ie,table:Ie,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ve._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ve._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ve.def=Je(ve.def).replace("label",ve._label).replace("title",ve._title).getRegex(),ve.bullet=/(?:[*+-]|\d{1,9}[.)])/,ve.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ve.item=Je(ve.item,"gm").replace(/bull/g,ve.bullet).getRegex(),ve.list=Je(ve.list).replace(/bull/g,ve.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ve.def.source+")").getRegex(),ve._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",ve._comment=/<!--(?!-?>)[\s\S]*?-->/,ve.html=Je(ve.html,"i").replace("comment",ve._comment).replace("tag",ve._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ve.paragraph=Je(ve._paragraph).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.blockquote=Je(ve.blockquote).replace("paragraph",ve.paragraph).getRegex(),ve.normal=Ye({},ve),ve.gfm=Ye({},ve.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*|$)"}),ve.gfm.nptable=Je(ve.gfm.nptable).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.gfm.table=Je(ve.gfm.table).replace("hr",ve.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",ve._tag).getRegex(),ve.pedantic=Ye({},ve.normal,{html:Je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ve._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ie,paragraph:Je(ve.normal._paragraph).replace("hr",ve.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var fe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ie,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ie,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};fe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",fe.punctuation=Je(fe.punctuation).replace(/punctuation/g,fe._punctuation).getRegex(),fe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",fe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",fe.em.start=Je(fe.em.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.middle=Je(fe.em.middle).replace(/punctuation/g,fe._punctuation).replace(/overlapSkip/g,fe._overlapSkip).getRegex(),fe.em.endAst=Je(fe.em.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.em.endUnd=Je(fe.em.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.start=Je(fe.strong.start).replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.middle=Je(fe.strong.middle).replace(/punctuation/g,fe._punctuation).replace(/blockSkip/g,fe._blockSkip).getRegex(),fe.strong.endAst=Je(fe.strong.endAst,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.strong.endUnd=Je(fe.strong.endUnd,"g").replace(/punctuation/g,fe._punctuation).getRegex(),fe.blockSkip=Je(fe._blockSkip,"g").getRegex(),fe.overlapSkip=Je(fe._overlapSkip,"g").getRegex(),fe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,fe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,fe._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])?)+(?![-_])/,fe.autolink=Je(fe.autolink).replace("scheme",fe._scheme).replace("email",fe._email).getRegex(),fe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,fe.tag=Je(fe.tag).replace("comment",ve._comment).replace("attribute",fe._attribute).getRegex(),fe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,fe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,fe.link=Je(fe.link).replace("label",fe._label).replace("href",fe._href).replace("title",fe._title).getRegex(),fe.reflink=Je(fe.reflink).replace("label",fe._label).getRegex(),fe.reflinkSearch=Je(fe.reflinkSearch,"g").replace("reflink",fe.reflink).replace("nolink",fe.nolink).getRegex(),fe.normal=Ye({},fe),fe.pedantic=Ye({},fe.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:Je(/^!?\[(label)\]\((.*?)\)/).replace("label",fe._label).getRegex(),reflink:Je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe._label).getRegex()}),fe.gfm=Ye({},fe.normal,{escape:Je(fe.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),fe.gfm.url=Je(fe.gfm.url,"i").replace("email",fe.gfm._extended_email).getRegex(),fe.breaks=Ye({},fe.gfm,{br:Je(fe.br).replace("{2,}","*").getRegex(),text:Je(fe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var lt={block:ve,inline:fe},qt=K.defaults,Ft=lt.block,Ot=lt.inline;function Ve(De){return De.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function vt(De){var ye="",we,ae,oe=De.length;for(we=0;we<oe;we++)ae=De.charCodeAt(we),Math.random()>.5&&(ae="x"+ae.toString(16)),ye+="&#"+ae+";";return ye}var ht=function(){function De(we){this.tokens=[],this.tokens.links=Object.create(null),this.options=we||qt,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:Ft.normal,inline:Ot.normal};this.options.pedantic?(ae.block=Ft.pedantic,ae.inline=Ot.pedantic):this.options.gfm&&(ae.block=Ft.gfm,this.options.breaks?ae.inline=Ot.breaks:ae.inline=Ot.gfm),this.tokenizer.rules=ae}De.lex=function(ae,oe){var pe=new De(oe);return pe.lex(ae)};var ye=De.prototype;return ye.lex=function(ae){return ae=ae.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ae,this.tokens,!0),this.inline(this.tokens),this.tokens},ye.blockTokens=function(ae,oe,pe){oe===void 0&&(oe=[]),pe===void 0&&(pe=!0),ae=ae.replace(/^ +$/gm,"");for(var _e,be,Ke,St;ae;){if(_e=this.tokenizer.space(ae)){ae=ae.substring(_e.raw.length),_e.type&&oe.push(_e);continue}if(_e=this.tokenizer.code(ae,oe)){ae=ae.substring(_e.raw.length),_e.type?oe.push(_e):(St=oe[oe.length-1],St.raw+=`
`+_e.raw,St.text+=`
`+_e.text);continue}if(_e=this.tokenizer.fences(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.heading(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.nptable(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.hr(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.blockquote(ae)){ae=ae.substring(_e.raw.length),_e.tokens=this.blockTokens(_e.text,[],pe),oe.push(_e);continue}if(_e=this.tokenizer.list(ae)){for(ae=ae.substring(_e.raw.length),Ke=_e.items.length,be=0;be<Ke;be++)_e.items[be].tokens=this.blockTokens(_e.items[be].text,[],!1);oe.push(_e);continue}if(_e=this.tokenizer.html(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(pe&&(_e=this.tokenizer.def(ae))){ae=ae.substring(_e.raw.length),this.tokens.links[_e.tag]||(this.tokens.links[_e.tag]={href:_e.href,title:_e.title});continue}if(_e=this.tokenizer.table(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.lheading(ae)){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(pe&&(_e=this.tokenizer.paragraph(ae))){ae=ae.substring(_e.raw.length),oe.push(_e);continue}if(_e=this.tokenizer.text(ae,oe)){ae=ae.substring(_e.raw.length),_e.type?oe.push(_e):(St=oe[oe.length-1],St.raw+=`
`+_e.raw,St.text+=`
`+_e.text);continue}if(ae){var nn="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(nn);break}else throw new Error(nn)}}return oe},ye.inline=function(ae){var oe,pe,_e,be,Ke,St,nn=ae.length;for(oe=0;oe<nn;oe++){St=ae[oe];switch(St.type){case"paragraph":case"text":case"heading":{St.tokens=[],this.inlineTokens(St.text,St.tokens);break}case"table":{for(St.tokens={header:[],cells:[]},be=St.header.length,pe=0;pe<be;pe++)St.tokens.header[pe]=[],this.inlineTokens(St.header[pe],St.tokens.header[pe]);for(be=St.cells.length,pe=0;pe<be;pe++)for(Ke=St.cells[pe],St.tokens.cells[pe]=[],_e=0;_e<Ke.length;_e++)St.tokens.cells[pe][_e]=[],this.inlineTokens(Ke[_e],St.tokens.cells[pe][_e]);break}case"blockquote":{this.inline(St.tokens);break}case"list":{for(be=St.items.length,pe=0;pe<be;pe++)this.inline(St.items[pe].tokens);break}}}return ae},ye.inlineTokens=function(ae,oe,pe,_e,be){oe===void 0&&(oe=[]),pe===void 0&&(pe=!1),_e===void 0&&(_e=!1),be===void 0&&(be="");var Ke,St=ae,nn;if(this.tokens.links){var An=Object.keys(this.tokens.links);if(An.length>0)for(;(nn=this.tokenizer.rules.inline.reflinkSearch.exec(St))!=null;)An.includes(nn[0].slice(nn[0].lastIndexOf("[")+1,-1))&&(St=St.slice(0,nn.index)+"["+"a".repeat(nn[0].length-2)+"]"+St.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(nn=this.tokenizer.rules.inline.blockSkip.exec(St))!=null;)St=St.slice(0,nn.index)+"["+"a".repeat(nn[0].length-2)+"]"+St.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(Ke=this.tokenizer.escape(ae)){ae=ae.substring(Ke.raw.length),oe.push(Ke);continue}if(Ke=this.tokenizer.tag(ae,pe,_e)){ae=ae.substring(Ke.raw.length),pe=Ke.inLink,_e=Ke.inRawBlock,oe.push(Ke);continue}if(Ke=this.tokenizer.link(ae)){ae=ae.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,_e)),oe.push(Ke);continue}if(Ke=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(Ke.raw.length),Ke.type==="link"&&(Ke.tokens=this.inlineTokens(Ke.text,[],!0,_e)),oe.push(Ke);continue}if(Ke=this.tokenizer.strong(ae,St,be)){ae=ae.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],pe,_e),oe.push(Ke);continue}if(Ke=this.tokenizer.em(ae,St,be)){ae=ae.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],pe,_e),oe.push(Ke);continue}if(Ke=this.tokenizer.codespan(ae)){ae=ae.substring(Ke.raw.length),oe.push(Ke);continue}if(Ke=this.tokenizer.br(ae)){ae=ae.substring(Ke.raw.length),oe.push(Ke);continue}if(Ke=this.tokenizer.del(ae)){ae=ae.substring(Ke.raw.length),Ke.tokens=this.inlineTokens(Ke.text,[],pe,_e),oe.push(Ke);continue}if(Ke=this.tokenizer.autolink(ae,vt)){ae=ae.substring(Ke.raw.length),oe.push(Ke);continue}if(!pe&&(Ke=this.tokenizer.url(ae,vt))){ae=ae.substring(Ke.raw.length),oe.push(Ke);continue}if(Ke=this.tokenizer.inlineText(ae,_e,Ve)){ae=ae.substring(Ke.raw.length),be=Ke.raw.slice(-1),oe.push(Ke);continue}if(ae){var bt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return oe},V(De,null,[{key:"rules",get:function(){return{block:Ft,inline:Ot}}}]),De}(),Bt=K.defaults,se=H.cleanUrl,Ue=H.escape,Ge=function(){function De(we){this.options=we||Bt}var ye=De.prototype;return ye.code=function(ae,oe,pe){var _e=(oe||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(ae,_e);be!=null&&be!==ae&&(pe=!0,ae=be)}return _e?'<pre><code class="'+this.options.langPrefix+Ue(_e,!0)+'">'+(pe?ae:Ue(ae,!0))+`</code></pre>
`:"<pre><code>"+(pe?ae:Ue(ae,!0))+`</code></pre>
`},ye.blockquote=function(ae){return`<blockquote>
`+ae+`</blockquote>
`},ye.html=function(ae){return ae},ye.heading=function(ae,oe,pe,_e){return this.options.headerIds?"<h"+oe+' id="'+this.options.headerPrefix+_e.slug(pe)+'">'+ae+"</h"+oe+`>
`:"<h"+oe+">"+ae+"</h"+oe+`>
`},ye.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ye.list=function(ae,oe,pe){var _e=oe?"ol":"ul",be=oe&&pe!==1?' start="'+pe+'"':"";return"<"+_e+be+`>
`+ae+"</"+_e+`>
`},ye.listitem=function(ae){return"<li>"+ae+`</li>
`},ye.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ye.paragraph=function(ae){return"<p>"+ae+`</p>
`},ye.table=function(ae,oe){return oe&&(oe="<tbody>"+oe+"</tbody>"),`<table>
<thead>
`+ae+`</thead>
`+oe+`</table>
`},ye.tablerow=function(ae){return`<tr>
`+ae+`</tr>
`},ye.tablecell=function(ae,oe){var pe=oe.header?"th":"td",_e=oe.align?"<"+pe+' align="'+oe.align+'">':"<"+pe+">";return _e+ae+"</"+pe+`>
`},ye.strong=function(ae){return"<strong>"+ae+"</strong>"},ye.em=function(ae){return"<em>"+ae+"</em>"},ye.codespan=function(ae){return"<code>"+ae+"</code>"},ye.br=function(){return this.options.xhtml?"<br/>":"<br>"},ye.del=function(ae){return"<del>"+ae+"</del>"},ye.link=function(ae,oe,pe){if(ae=se(this.options.sanitize,this.options.baseUrl,ae),ae===null)return pe;var _e='<a href="'+Ue(ae)+'"';return oe&&(_e+=' title="'+oe+'"'),_e+=">"+pe+"</a>",_e},ye.image=function(ae,oe,pe){if(ae=se(this.options.sanitize,this.options.baseUrl,ae),ae===null)return pe;var _e='<img src="'+ae+'" alt="'+pe+'"';return oe&&(_e+=' title="'+oe+'"'),_e+=this.options.xhtml?"/>":">",_e},ye.text=function(ae){return ae},De}(),et=function(){function De(){}var ye=De.prototype;return ye.strong=function(ae){return ae},ye.em=function(ae){return ae},ye.codespan=function(ae){return ae},ye.del=function(ae){return ae},ye.html=function(ae){return ae},ye.text=function(ae){return ae},ye.link=function(ae,oe,pe){return""+pe},ye.image=function(ae,oe,pe){return""+pe},ye.br=function(){return""},De}(),Wt=function(){function De(){this.seen={}}var ye=De.prototype;return ye.slug=function(ae){var oe=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(oe)){var pe=oe;do this.seen[pe]++,oe=pe+"-"+this.seen[pe];while(this.seen.hasOwnProperty(oe))}return this.seen[oe]=0,oe},De}(),Yt=K.defaults,on=H.unescape,nt=function(){function De(we){this.options=we||Yt,this.options.renderer=this.options.renderer||new Ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new et,this.slugger=new Wt}De.parse=function(ae,oe){var pe=new De(oe);return pe.parse(ae)};var ye=De.prototype;return ye.parse=function(ae,oe){oe===void 0&&(oe=!0);var pe="",_e,be,Ke,St,nn,An,bt,Jt,Et,Ct,st,de,Ae,kt,ct,Qt,un,Le,qe=ae.length;for(_e=0;_e<qe;_e++){Ct=ae[_e];switch(Ct.type){case"space":continue;case"hr":{pe+=this.renderer.hr();continue}case"heading":{pe+=this.renderer.heading(this.parseInline(Ct.tokens),Ct.depth,on(this.parseInline(Ct.tokens,this.textRenderer)),this.slugger);continue}case"code":{pe+=this.renderer.code(Ct.text,Ct.lang,Ct.escaped);continue}case"table":{for(Jt="",bt="",St=Ct.header.length,be=0;be<St;be++)bt+=this.renderer.tablecell(this.parseInline(Ct.tokens.header[be]),{header:!0,align:Ct.align[be]});for(Jt+=this.renderer.tablerow(bt),Et="",St=Ct.cells.length,be=0;be<St;be++){for(An=Ct.tokens.cells[be],bt="",nn=An.length,Ke=0;Ke<nn;Ke++)bt+=this.renderer.tablecell(this.parseInline(An[Ke]),{header:!1,align:Ct.align[Ke]});Et+=this.renderer.tablerow(bt)}pe+=this.renderer.table(Jt,Et);continue}case"blockquote":{Et=this.parse(Ct.tokens),pe+=this.renderer.blockquote(Et);continue}case"list":{for(st=Ct.ordered,de=Ct.start,Ae=Ct.loose,St=Ct.items.length,Et="",be=0;be<St;be++)ct=Ct.items[be],Qt=ct.checked,un=ct.task,kt="",ct.task&&(Le=this.renderer.checkbox(Qt),Ae?ct.tokens.length>0&&ct.tokens[0].type==="text"?(ct.tokens[0].text=Le+" "+ct.tokens[0].text,ct.tokens[0].tokens&&ct.tokens[0].tokens.length>0&&ct.tokens[0].tokens[0].type==="text"&&(ct.tokens[0].tokens[0].text=Le+" "+ct.tokens[0].tokens[0].text)):ct.tokens.unshift({type:"text",text:Le}):kt+=Le),kt+=this.parse(ct.tokens,Ae),Et+=this.renderer.listitem(kt,un,Qt);pe+=this.renderer.list(Et,st,de);continue}case"html":{pe+=this.renderer.html(Ct.text);continue}case"paragraph":{pe+=this.renderer.paragraph(this.parseInline(Ct.tokens));continue}case"text":{for(Et=Ct.tokens?this.parseInline(Ct.tokens):Ct.text;_e+1<qe&&ae[_e+1].type==="text";)Ct=ae[++_e],Et+=`
`+(Ct.tokens?this.parseInline(Ct.tokens):Ct.text);pe+=oe?this.renderer.paragraph(Et):Et;continue}default:{var mt='Token with "'+Ct.type+'" type was not found.';if(this.options.silent){console.error(mt);return}else throw new Error(mt)}}}return pe},ye.parseInline=function(ae,oe){oe=oe||this.renderer;var pe="",_e,be,Ke=ae.length;for(_e=0;_e<Ke;_e++){be=ae[_e];switch(be.type){case"escape":{pe+=oe.text(be.text);break}case"html":{pe+=oe.html(be.text);break}case"link":{pe+=oe.link(be.href,be.title,this.parseInline(be.tokens,oe));break}case"image":{pe+=oe.image(be.href,be.title,be.text);break}case"strong":{pe+=oe.strong(this.parseInline(be.tokens,oe));break}case"em":{pe+=oe.em(this.parseInline(be.tokens,oe));break}case"codespan":{pe+=oe.codespan(be.text);break}case"br":{pe+=oe.br();break}case"del":{pe+=oe.del(this.parseInline(be.tokens,oe));break}case"text":{pe+=oe.text(be.text);break}default:{var St='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error(St);return}else throw new Error(St)}}}return pe},De}(),tn=H.merge,Ln=H.checkSanitizeDeprecation,We=H.escape,Fe=K.getDefaults,yt=K.changeDefaults,At=K.defaults;function tt(De,ye,we){if(typeof De=="undefined"||De===null)throw new Error("marked(): input parameter is undefined or null");if(typeof De!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(De)+", string expected");if(typeof ye=="function"&&(we=ye,ye=null),ye=tn({},tt.defaults,ye||{}),Ln(ye),we){var ae=ye.highlight,oe;try{oe=ht.lex(De,ye)}catch(Ke){return we(Ke)}var pe=function(St){var nn;if(!St)try{nn=nt.parse(oe,ye)}catch(An){St=An}return ye.highlight=ae,St?we(St):we(null,nn)};if(!ae||ae.length<3)return pe();if(delete ye.highlight,!oe.length)return pe();var _e=0;tt.walkTokens(oe,function(Ke){Ke.type==="code"&&(_e++,setTimeout(function(){ae(Ke.text,Ke.lang,function(St,nn){if(St)return pe(St);nn!=null&&nn!==Ke.text&&(Ke.text=nn,Ke.escaped=!0),_e--,_e===0&&pe()})},0))}),_e===0&&pe();return}try{var be=ht.lex(De,ye);return ye.walkTokens&&tt.walkTokens(be,ye.walkTokens),nt.parse(be,ye)}catch(Ke){if(Ke.message+=`
Please report this to https://github.com/markedjs/marked.`,ye.silent)return"<p>An error occurred:</p><pre>"+We(Ke.message+"",!0)+"</pre>";throw Ke}}tt.options=tt.setOptions=function(De){return tn(tt.defaults,De),yt(tt.defaults),tt},tt.getDefaults=Fe,tt.defaults=At,tt.use=function(De){var ye=tn({},De);if(De.renderer&&function(){var ae=tt.defaults.renderer||new Ge,oe=function(be){var Ke=ae[be];ae[be]=function(){for(var St=arguments.length,nn=new Array(St),An=0;An<St;An++)nn[An]=arguments[An];var bt=De.renderer[be].apply(ae,nn);return bt===!1&&(bt=Ke.apply(ae,nn)),bt}};for(var pe in De.renderer)oe(pe);ye.renderer=ae}(),De.tokenizer&&function(){var ae=tt.defaults.tokenizer||new xe,oe=function(be){var Ke=ae[be];ae[be]=function(){for(var St=arguments.length,nn=new Array(St),An=0;An<St;An++)nn[An]=arguments[An];var bt=De.tokenizer[be].apply(ae,nn);return bt===!1&&(bt=Ke.apply(ae,nn)),bt}};for(var pe in De.tokenizer)oe(pe);ye.tokenizer=ae}(),De.walkTokens){var we=tt.defaults.walkTokens;ye.walkTokens=function(ae){De.walkTokens(ae),we&&we(ae)}}tt.setOptions(ye)},tt.walkTokens=function(De,ye){for(var we=P(De),ae;!(ae=we()).done;){var oe=ae.value;ye(oe);switch(oe.type){case"table":{for(var pe=P(oe.tokens.header),_e;!(_e=pe()).done;){var be=_e.value;tt.walkTokens(be,ye)}for(var Ke=P(oe.tokens.cells),St;!(St=Ke()).done;)for(var nn=St.value,An=P(nn),bt;!(bt=An()).done;){var Jt=bt.value;tt.walkTokens(Jt,ye)}break}case"list":{tt.walkTokens(oe.items,ye);break}default:oe.tokens&&tt.walkTokens(oe.tokens,ye)}}},tt.Parser=nt,tt.parser=nt.parse,tt.Renderer=Ge,tt.TextRenderer=et,tt.Lexer=ht,tt.lexer=ht.lex,tt.Tokenizer=xe,tt.Slugger=Wt,tt.parse=tt;var ot=tt;return ot})},ELLl:function(Kt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},U=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(o,a,c){c&&c!=Z.Init&&(o.removeKeyMap(P),o.state.closeBrackets=null),a&&(I(G(a,"pairs")),o.state.closeBrackets=a,o.addKeyMap(P))});function G(o,a){return a=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[a]!=null?o[a]:V[a]}var P={Backspace:r,Enter:M};function I(o){for(var a=0;a<o.length;a++){var c=o.charAt(a),s="'"+c+"'";P[s]||(P[s]=K(c))}}I(V.pairs+"`");function K(o){return function(a){return f(a,o)}}function k(o){var a=o.state.closeBrackets;if(!a||a.override)return a;var c=o.getModeAt(o.getCursor());return c.closeBrackets||a}function r(o){var a=k(o);if(!a||o.getOption("disableInput"))return Z.Pass;for(var c=G(a,"pairs"),s=o.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Z.Pass;var n=m(o,s[i].head);if(!n||c.indexOf(n)%2!=0)return Z.Pass}for(var i=s.length-1;i>=0;i--){var O=s[i].head;o.replaceRange("",U(O.line,O.ch-1),U(O.line,O.ch+1),"+delete")}}function M(o){var a=k(o),c=a&&G(a,"explode");if(!c||o.getOption("disableInput"))return Z.Pass;for(var s=o.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Z.Pass;var n=m(o,s[i].head);if(!n||c.indexOf(n)%2!=0)return Z.Pass}o.operation(function(){var O=o.lineSeparator()||`
`;o.replaceSelection(O+O,null),o.execCommand("goCharLeft"),s=o.listSelections();for(var T=0;T<s.length;T++){var C=s[T].head.line;o.indentLine(C,null,!0),o.indentLine(C+1,null,!0)}})}function b(o){var a=Z.cmpPos(o.anchor,o.head)>0;return{anchor:new U(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new U(o.head.line,o.head.ch+(a?1:-1))}}function f(o,a){var c=k(o);if(!c||o.getOption("disableInput"))return Z.Pass;var s=G(c,"pairs"),i=s.indexOf(a);if(i==-1)return Z.Pass;for(var n=G(c,"closeBefore"),O=G(c,"triples"),T=s.charAt(i+1)==a,C=o.listSelections(),R=i%2==0,S,v=0;v<C.length;v++){var E=C[v],h=E.head,p,_=o.getRange(h,U(h.line,h.ch+1));if(R&&!E.empty())p="surround";else if((T||!R)&&_==a)T&&l(o,h)?p="both":O.indexOf(a)>=0&&o.getRange(h,U(h.line,h.ch+3))==a+a+a?p="skipThree":p="skip";else if(T&&h.ch>1&&O.indexOf(a)>=0&&o.getRange(U(h.line,h.ch-2),h)==a+a){if(h.ch>2&&/\bstring/.test(o.getTokenTypeAt(U(h.line,h.ch-2))))return Z.Pass;p="addFour"}else if(T){var g=h.ch==0?" ":o.getRange(U(h.line,h.ch-1),h);if(!Z.isWordChar(_)&&g!=a&&!Z.isWordChar(g))p="both";else return Z.Pass}else if(R&&(_.length===0||/\s/.test(_)||n.indexOf(_)>-1))p="both";else return Z.Pass;if(!S)S=p;else if(S!=p)return Z.Pass}var w=i%2?s.charAt(i-1):a,j=i%2?a:s.charAt(i+1);o.operation(function(){if(S=="skip")o.execCommand("goCharRight");else if(S=="skipThree")for(var B=0;B<3;B++)o.execCommand("goCharRight");else if(S=="surround"){for(var A=o.getSelections(),B=0;B<A.length;B++)A[B]=w+A[B]+j;o.replaceSelections(A,"around"),A=o.listSelections().slice();for(var B=0;B<A.length;B++)A[B]=b(A[B]);o.setSelections(A)}else S=="both"?(o.replaceSelection(w+j,null),o.triggerElectric(w+j),o.execCommand("goCharLeft")):S=="addFour"&&(o.replaceSelection(w+w+w+w,"before"),o.execCommand("goCharRight"))})}function m(o,a){var c=o.getRange(U(a.line,a.ch-1),U(a.line,a.ch+1));return c.length==2?c:null}function l(o,a){var c=o.getTokenAt(U(a.line,a.ch+1));return/\bstring/.test(c.type)&&c.start==a.ch&&(a.ch==0||!/\bstring/.test(o.getTokenTypeAt(a)))}})},F0VM:function(Kt,he,D){Kt.exports={flex_box_center:"flex_box_center___2fDN3",flex_space_between:"flex_space_between___BHBBv",flex_box_vertical_center:"flex_box_vertical_center___tpxsE",flex_box_center_end:"flex_box_center_end___rP7bQ",flex_box_column:"flex_box_column___1_rF-",md:"md___3SObb",title:"title___HfZ1b"}},FOrL:function(Kt,he,D){Kt.exports=D.p+"static/nodata.a6b3f948.png"},FWmy:function(Kt,he,D){"use strict";D.d(he,"a",function(){return Z});function Z(V,U){if(!V)throw new Error(U?`Assertion failed (${U})`:"Assertion Failed")}},Gytx:function(Kt,he){Kt.exports=function(Z,V,U,G){var P=U?U.call(G,Z,V):void 0;if(P!==void 0)return!!P;if(Z===V)return!0;if(typeof Z!="object"||!Z||typeof V!="object"||!V)return!1;var I=Object.keys(Z),K=Object.keys(V);if(I.length!==K.length)return!1;for(var k=Object.prototype.hasOwnProperty.bind(V),r=0;r<I.length;r++){var M=I[r];if(!k(M))return!1;var b=Z[M],f=V[M];if(P=U?U.call(G,b,f,M):void 0,P===!1||P===void 0&&b!==f)return!1}return!0}},HmJG:function(Kt,he,D){},I8Z2:function(Kt,he,D){"use strict";D.d(he,"a",function(){return G}),D.d(he,"b",function(){return m}),D.d(he,"c",function(){return o});var Z=D("q1tI"),V=function(){var a=function(c,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var O in n)n.hasOwnProperty(O)&&(i[O]=n[O])},a(c,s)};return function(c,s){a(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),U=Z.createContext(null),G=function(a){V(c,a);function c(){return a!==null&&a.apply(this,arguments)||this}return c.prototype.render=function(){return Z.createElement(U.Provider,{value:this.props.store},this.props.children)},c}(Z.Component),P=D("Gytx"),I=D.n(P),K=D("2mql"),k=D.n(K),r=function(){var a=function(c,s){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var O in n)n.hasOwnProperty(O)&&(i[O]=n[O])},a(c,s)};return function(c,s){a(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),M=function(){return M=Object.assign||function(a){for(var c,s=1,i=arguments.length;s<i;s++){c=arguments[s];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(a[n]=c[n])}return a},M.apply(this,arguments)};function b(a){return a.displayName||a.name||"Component"}var f=function(){return{}};function m(a,c){c===void 0&&(c={});var s=!!a,i=a||f;return function(O){var T=function(R){r(S,R);function S(v,E){var h=R.call(this,v,E)||this;return h.unsubscribe=null,h.handleChange=function(){if(!h.unsubscribe)return;var p=i(h.store.getState(),h.props);h.setState({subscribed:p})},h.store=h.context,h.state={subscribed:i(h.store.getState(),v),store:h.store,props:v},h}return S.getDerivedStateFromProps=function(v,E){return a&&a.length===2&&v!==E.props?{subscribed:i(E.store.getState(),v),props:v}:{props:v}},S.prototype.componentDidMount=function(){this.trySubscribe()},S.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},S.prototype.shouldComponentUpdate=function(v,E){return!I()(this.props,v)||!I()(this.state.subscribed,E.subscribed)},S.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},S.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},S.prototype.render=function(){var v=M(M(M({},this.props),this.state.subscribed),{store:this.store});return Z.createElement(O,M({},v,{ref:this.props.miniStoreForwardedRef}))},S.displayName="Connect("+b(O)+")",S.contextType=U,S}(Z.Component);if(c.forwardRef){var C=Z.forwardRef(function(R,S){return Z.createElement(T,M({},R,{miniStoreForwardedRef:S}))});return k()(C,O)}return k()(T,O)}}var l=function(){return l=Object.assign||function(a){for(var c,s=1,i=arguments.length;s<i;s++){c=arguments[s];for(var n in c)Object.prototype.hasOwnProperty.call(c,n)&&(a[n]=c[n])}return a},l.apply(this,arguments)};function o(a){var c=a,s=[];function i(T){c=l(l({},c),T);for(var C=0;C<s.length;C++)s[C]()}function n(){return c}function O(T){return s.push(T),function(){var R=s.indexOf(T);s.splice(R,1)}}return{setState:i,getState:n,subscribe:O}}},IBYe:function(Kt,he,D){"use strict";function Z(V){return null}he.a=Z},J66h:function(Kt,he,D){(function(Z){var V,U;(function(G,P){Kt.exports=P(G)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Z!="undefined"?Z:this,function(G){"use strict";G=G||{};var P=G.Base64,I="2.6.4",K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=function(w){for(var j={},B=0,A=w.length;B<A;B++)j[w.charAt(B)]=B;return j}(K),r=String.fromCharCode,M=function(w){if(w.length<2){var j=w.charCodeAt(0);return j<128?w:j<2048?r(192|j>>>6)+r(128|j&63):r(224|j>>>12&15)+r(128|j>>>6&63)+r(128|j&63)}else{var j=65536+(w.charCodeAt(0)-55296)*1024+(w.charCodeAt(1)-56320);return r(240|j>>>18&7)+r(128|j>>>12&63)+r(128|j>>>6&63)+r(128|j&63)}},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(w){return w.replace(b,M)},m=function(w){var j=[0,2,1][w.length%3],B=w.charCodeAt(0)<<16|(w.length>1?w.charCodeAt(1):0)<<8|(w.length>2?w.charCodeAt(2):0),A=[K.charAt(B>>>18),K.charAt(B>>>12&63),j>=2?"=":K.charAt(B>>>6&63),j>=1?"=":K.charAt(B&63)];return A.join("")},l=G.btoa&&typeof G.btoa=="function"?function(w){return G.btoa(w)}:function(w){if(w.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return w.replace(/[\s\S]{1,3}/g,m)},o=function(w){return l(f(String(w)))},a=function(w){return w.replace(/[+\/]/g,function(j){return j=="+"?"-":"_"}).replace(/=/g,"")},c=function(w,j){return j?a(o(w)):o(w)},s=function(w){return c(w,!0)},i;G.Uint8Array&&(i=function(w,j){for(var B="",A=0,H=w.length;A<H;A+=3){var F=w[A],x=w[A+1],Y=w[A+2],q=F<<16|x<<8|Y;B+=K.charAt(q>>>18)+K.charAt(q>>>12&63)+(typeof x!="undefined"?K.charAt(q>>>6&63):"=")+(typeof Y!="undefined"?K.charAt(q&63):"=")}return j?a(B):B});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(w){switch(w.length){case 4:var j=(7&w.charCodeAt(0))<<18|(63&w.charCodeAt(1))<<12|(63&w.charCodeAt(2))<<6|63&w.charCodeAt(3),B=j-65536;return r((B>>>10)+55296)+r((B&1023)+56320);case 3:return r((15&w.charCodeAt(0))<<12|(63&w.charCodeAt(1))<<6|63&w.charCodeAt(2));default:return r((31&w.charCodeAt(0))<<6|63&w.charCodeAt(1))}},T=function(w){return w.replace(n,O)},C=function(w){var j=w.length,B=j%4,A=(j>0?k[w.charAt(0)]<<18:0)|(j>1?k[w.charAt(1)]<<12:0)|(j>2?k[w.charAt(2)]<<6:0)|(j>3?k[w.charAt(3)]:0),H=[r(A>>>16),r(A>>>8&255),r(A&255)];return H.length-=[0,0,2,1][B],H.join("")},R=G.atob&&typeof G.atob=="function"?function(w){return G.atob(w)}:function(w){return w.replace(/\S{1,4}/g,C)},S=function(w){return R(String(w).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(w){return T(R(w))},E=function(w){return String(w).replace(/[-_]/g,function(j){return j=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(w){return v(E(w))},p;G.Uint8Array&&(p=function(w){return Uint8Array.from(S(E(w)),function(j){return j.charCodeAt(0)})});var _=function(){var w=G.Base64;return G.Base64=P,w};if(G.Base64={VERSION:I,atob:S,btoa:l,fromBase64:h,toBase64:c,utob:f,encode:c,encodeURI:s,btou:T,decode:h,noConflict:_,fromUint8Array:i,toUint8Array:p},typeof Object.defineProperty=="function"){var g=function(w){return{value:w,enumerable:!1,writable:!0,configurable:!0}};G.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return h(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(w){return c(this,w)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return c(this,!0)}))}}return G.Meteor&&(Base64=G.Base64),Kt.exports?Kt.exports.Base64=G.Base64:!(V=[],U=function(){return G.Base64}.apply(he,V),U!==void 0&&(Kt.exports=U)),{Base64:G.Base64}})}).call(this,D("IyRk"))},JYp7:function(Kt,he,D){"use strict";D.d(he,"a",function(){return Z});var Z;(function(V){function U(n){return n&&typeof n=="object"&&typeof n[Symbol.iterator]=="function"}V.is=U;const G=Object.freeze([]);function P(){return G}V.empty=P;function*I(n){yield n}V.single=I;function K(n){return n||G}V.from=K;function k(n){return!n||n[Symbol.iterator]().next().done===!0}V.isEmpty=k;function r(n){return n[Symbol.iterator]().next().value}V.first=r;function M(n,O){for(const T of n)if(O(T))return!0;return!1}V.some=M;function b(n,O){for(const T of n)if(O(T))return T;return}V.find=b;function*f(n,O){for(const T of n)O(T)&&(yield T)}V.filter=f;function*m(n,O){let T=0;for(const C of n)yield O(C,T++)}V.map=m;function*l(...n){for(const O of n)for(const T of O)yield T}V.concat=l;function*o(n){for(const O of n)for(const T of O)yield T}V.concatNested=o;function a(n,O,T){let C=T;for(const R of n)C=O(C,R);return C}V.reduce=a;function*c(n,O,T=n.length){for(O<0&&(O+=n.length),T<0?T+=n.length:T>n.length&&(T=n.length);O<T;O++)yield n[O]}V.slice=c;function s(n,O=Number.POSITIVE_INFINITY){const T=[];if(O===0)return[T,n];const C=n[Symbol.iterator]();for(let R=0;R<O;R++){const S=C.next();if(S.done)return[T,V.empty()];T.push(S.value)}return[T,{[Symbol.iterator](){return C}}]}V.consume=s;function i(n,O,T=(C,R)=>C===R){const C=n[Symbol.iterator](),R=O[Symbol.iterator]();for(;;){const S=C.next(),v=R.next();if(S.done!==v.done)return!1;if(S.done)return!0;if(!T(S.value,v.value))return!1}}V.equals=i})(Z||(Z={}))},LSTS:function(Kt,he,D){"use strict";Object.defineProperty(he,"__esModule",{value:!0});var Z=function(){function f(m,l){for(var o=0;o<l.length;o++){var a=l[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(m,a.key,a)}}return function(m,l,o){return l&&f(m.prototype,l),o&&f(m,o),m}}(),V=D("q1tI"),U=I(V),G=D("17x9"),P=I(G);function I(f){return f&&f.__esModule?f:{default:f}}function K(f,m){var l={};for(var o in f){if(m.indexOf(o)>=0)continue;if(!Object.prototype.hasOwnProperty.call(f,o))continue;l[o]=f[o]}return l}function k(f,m){if(!(f instanceof m))throw new TypeError("Cannot call a class as a function")}function r(f,m){if(!f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:f}function M(f,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);f.prototype=Object.create(m&&m.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(f,m):f.__proto__=m)}var b=function(f){M(m,f);function m(l){k(this,m);var o=r(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,l));return o.scrollListener=o.scrollListener.bind(o),o.eventListenerOptions=o.eventListenerOptions.bind(o),o.mousewheelListener=o.mousewheelListener.bind(o),o}return Z(m,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var o=this.getParentElement(this.scrollComponent);o.scrollTop=o.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var o=!1,a={get passive(){o=!0}};try{document.addEventListener("test",null,a),document.removeEventListener("test",null,a)}catch(c){}return o}},{key:"eventListenerOptions",value:function(){var o=this.props.useCapture;return this.isPassiveSupported()&&(o={useCapture:this.props.useCapture,passive:!0}),o}},{key:"setDefaultLoader",value:function(o){this.defaultLoader=o}},{key:"detachMousewheelListener",value:function(){var o=window;this.props.useWindow===!1&&(o=this.scrollComponent.parentNode),o.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var o=window;this.props.useWindow===!1&&(o=this.getParentElement(this.scrollComponent)),o.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(o){var a=this.props.getScrollParent&&this.props.getScrollParent();return a!=null?a:o&&o.parentNode}},{key:"filterProps",value:function(o){return o}},{key:"attachScrollListener",value:function(){var o=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!o)return;var a=window;this.props.useWindow===!1&&(a=o),a.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),a.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(o){o.deltaY===1&&!this.isPassiveSupported()&&o.preventDefault()}},{key:"scrollListener",value:function(){var o=this.scrollComponent,a=window,c=this.getParentElement(o),s=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,n=a.pageYOffset!==void 0?a.pageYOffset:i.scrollTop;this.props.isReverse?s=n:s=this.calculateOffset(o,n)}else this.props.isReverse?s=c.scrollTop:s=o.scrollHeight-c.scrollTop-c.clientHeight;s<Number(this.props.threshold)&&o&&o.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=c.scrollHeight,this.beforeScrollTop=c.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(o,a){return o?this.calculateTopPosition(o)+(o.offsetHeight-a-window.innerHeight):0}},{key:"calculateTopPosition",value:function(o){return o?o.offsetTop+this.calculateTopPosition(o.offsetParent):0}},{key:"render",value:function(){var o=this,a=this.filterProps(this.props),c=a.children,s=a.element,i=a.hasMore,n=a.initialLoad,O=a.isReverse,T=a.loader,C=a.loadMore,R=a.pageStart,S=a.ref,v=a.threshold,E=a.useCapture,h=a.useWindow,p=a.getScrollParent,_=K(a,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);_.ref=function(w){o.scrollComponent=w,S&&S(w)};var g=[c];return i&&(T?O?g.unshift(T):g.push(T):this.defaultLoader&&(O?g.unshift(this.defaultLoader):g.push(this.defaultLoader))),U.default.createElement(s,_,g)}}]),m}(V.Component);b.propTypes={children:P.default.node.isRequired,element:P.default.node,hasMore:P.default.bool,initialLoad:P.default.bool,isReverse:P.default.bool,loader:P.default.node,loadMore:P.default.func.isRequired,pageStart:P.default.number,ref:P.default.func,getScrollParent:P.default.func,threshold:P.default.number,useCapture:P.default.bool,useWindow:P.default.bool},b.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},he.default=b,Kt.exports=he.default},LdHM:function(Kt,he,D){"use strict";D.d(he,"b",function(){return n}),D.d(he,"a",function(){return T});var Z=D("1OyB"),V=D("vuIU"),U=D("Ji7U"),G=D("LK+K"),P=D("q1tI"),I=D("rePB"),K=D("Ff2n"),k=D("ODXe"),r=D("4IlW"),M=D("bX4T"),b=D("YrtM"),f=D("TSYQ"),m=D.n(f),l=D("+nKL"),o=D("8OUc"),a=function(Y,q){var ie=Y.prefixCls,me=Y.id,$e=Y.flattenOptions,xe=Y.childrenAsData,Ie=Y.values,Je=Y.searchValue,Ye=Y.multiple,ve=Y.defaultActiveFirstOption,fe=Y.height,lt=Y.itemHeight,qt=Y.notFoundContent,Ft=Y.open,Ot=Y.menuItemSelectedIcon,Ve=Y.virtual,vt=Y.onSelect,ht=Y.onToggleOpen,Bt=Y.onActiveValue,se=Y.onScroll,Ue=Y.onMouseEnter,Ge="".concat(ie,"-item"),et=Object(b.a)(function(){return $e},[Ft,$e],function(ot,De){return De[0]&&ot[1]!==De[1]}),Wt=P.useRef(null),Yt=function(De){De.preventDefault()},on=function(De){Wt.current&&Wt.current.scrollTo({index:De})},nt=function(De){for(var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,we=et.length,ae=0;ae<we;ae+=1){var oe=(De+ae*ye+we)%we,pe=et[oe],_e=pe.group,be=pe.data;if(!_e&&!be.disabled)return oe}return-1},tn=P.useState(function(){return nt(0)}),Ln=Object(k.a)(tn,2),We=Ln[0],Fe=Ln[1],yt=function(De){Fe(De);var ye=et[De];if(!ye){Bt(null,-1);return}Bt(ye.data.value,De)};P.useEffect(function(){yt(ve!==!1?nt(0):-1)},[et.length,Je]),P.useEffect(function(){var ot=setTimeout(function(){if(!Ye&&Ft&&Ie.size===1){var De=Array.from(Ie)[0],ye=et.findIndex(function(we){var ae=we.data;return ae.value===De});yt(ye),on(ye)}});return function(){return clearTimeout(ot)}},[Ft]);var At=function(De){De!==void 0&&vt(De,{selected:!Ie.has(De)}),Ye||ht(!1)};if(P.useImperativeHandle(q,function(){return{onKeyDown:function(De){var ye=De.which;switch(ye){case r.a.UP:case r.a.DOWN:{var we=0;if(ye===r.a.UP?we=-1:ye===r.a.DOWN&&(we=1),we!==0){var ae=nt(We+we,we);on(ae),yt(ae)}break}case r.a.ENTER:{var oe=et[We];oe&&!oe.data.disabled?At(oe.data.value):At(void 0),Ft&&De.preventDefault();break}case r.a.ESC:ht(!1)}},onKeyUp:function(){},scrollTo:function(De){on(De)}}}),et.length===0)return P.createElement("div",{role:"listbox",id:"".concat(me,"_list"),className:"".concat(Ge,"-empty"),onMouseDown:Yt},qt);function tt(ot){var De=et[ot];if(!De)return null;var ye=De.data||{},we=ye.value,ae=ye.label,oe=ye.children,pe=Object(M.a)(ye,!0),_e=xe?oe:ae;return De?P.createElement("div",Object.assign({"aria-label":typeof _e=="string"?_e:null},pe,{key:ot,role:"option",id:"".concat(me,"_list_").concat(ot),"aria-selected":Ie.has(we)}),we):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(me,"_list"),style:{height:0,width:0,overflow:"hidden"}},tt(We-1),tt(We),tt(We+1)),P.createElement(l.a,{itemKey:"key",ref:Wt,data:et,height:fe,itemHeight:lt,fullHeight:!1,onMouseDown:Yt,onScroll:se,virtual:Ve,onMouseEnter:Ue},function(ot,De){var ye,we=ot.group,ae=ot.groupOption,oe=ot.data,pe=oe.label,_e=oe.key;if(we)return P.createElement("div",{className:m()(Ge,"".concat(Ge,"-group"))},pe!==void 0?pe:_e);var be=oe.disabled,Ke=oe.value,St=oe.title,nn=oe.children,An=oe.style,bt=oe.className,Jt=Object(K.a)(oe,["disabled","value","title","children","style","className"]),Et=Ie.has(Ke),Ct="".concat(Ge,"-option"),st=m()(Ge,Ct,bt,(ye={},Object(I.a)(ye,"".concat(Ct,"-grouped"),ae),Object(I.a)(ye,"".concat(Ct,"-active"),We===De&&!be),Object(I.a)(ye,"".concat(Ct,"-disabled"),be),Object(I.a)(ye,"".concat(Ct,"-selected"),Et),ye)),de=xe?nn:pe,Ae=!Ot||typeof Ot=="function"||Et;return P.createElement("div",Object.assign({},Jt,{"aria-selected":Et,className:st,title:St,onMouseMove:function(){if(We===De||be)return;yt(De)},onClick:function(){be||At(Ke)},style:An}),P.createElement("div",{className:"".concat(Ct,"-content")},de||Ke),P.isValidElement(Ot)||Et,Ae&&P.createElement(o.a,{className:"".concat(Ge,"-option-state"),customizeIcon:Ot,customizeIconProps:{isSelected:Et}},Et?"\u2713":null))}))},c=P.forwardRef(a);c.displayName="OptionList";var s=c,i=function(){return null};i.isSelectOption=!0;var n=i,O=function(){return null};O.isSelectOptGroup=!0;var T=O,C=D("VTBJ"),R=D("Zm9Q");function S(x){var Y=x.key,q=x.props,ie=q.children,me=q.value,$e=Object(K.a)(q,["children","value"]);return Object(C.a)({key:Y,value:me!==void 0?me:Y,children:ie},$e)}function v(x){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(x).map(function(q,ie){if(!P.isValidElement(q)||!q.type)return null;var me=q.type.isSelectOptGroup,$e=q.key,xe=q.props,Ie=xe.children,Je=Object(K.a)(xe,["children"]);return Y||!me?S(q):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat($e===null?ie:$e,"__"),label:$e},Je),{},{options:v(Ie)})}).filter(function(q){return q})}var E=D("2Qr1"),h=D("qNPg"),p=D("U8pU"),_=D("Kwbf"),g=D("WKfj");function w(x){var Y=x.mode,q=x.options,ie=x.children,me=x.backfill,$e=x.allowClear,xe=x.placeholder,Ie=x.getInputElement,Je=x.showSearch,Ye=x.onSearch,ve=x.defaultOpen,fe=x.autoFocus,lt=x.labelInValue,qt=x.value,Ft=x.inputValue,Ot=x.optionLabelProp,Ve=Y==="multiple"||Y==="tags",vt=Je!==void 0?Je:Ve||Y==="combobox",ht=q||v(ie);if(Object(_.a)(Y!=="tags"||ht.every(function(Ge){return!Ge.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var Bt=ht.some(function(Ge){return Ge.options?Ge.options.some(function(et){return typeof("value"in et?et.value:et.key)=="number"}):typeof("value"in Ge?Ge.value:Ge.key)=="number"});Object(_.a)(!Bt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(Y!=="combobox"||!Ot,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(Y==="combobox"||!me,"`backfill` only works with `combobox` mode."),Object(_.a)(Y==="combobox"||!Ie,"`getInputElement` only work with `combobox` mode."),Object(_.b)(Y!=="combobox"||!Ie||!$e||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ye&&!vt&&Y!=="combobox"&&Y!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!ve||fe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),qt!=null){var se=Object(g.d)(qt);Object(_.a)(!lt||se.every(function(Ge){return Object(p.a)(Ge)==="object"&&("key"in Ge||"value"in Ge)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!Ve||Array.isArray(qt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Ue=null;Object(R.a)(ie).some(function(Ge){if(!P.isValidElement(Ge)||!Ge.type)return!1;var et=Ge.type;if(et.isSelectOption)return!1;if(et.isSelectOptGroup){var Wt=Object(R.a)(Ge.props.children).every(function(Yt){return!P.isValidElement(Yt)||!Ge.type||Yt.type.isSelectOption?!0:(Ue=Yt.type,!1)});return!Wt}return Ue=et,!0}),Ue&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ue.displayName||Ue.name||Ue,"`.")),Object(_.a)(Ft===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=w,B=Object(h.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:v,flattenOptions:E.d,getLabeledValue:E.e,filterOptions:E.b,isValueDisabled:E.g,findValueOption:E.c,warningProps:j,fillOptionsWithMissingValue:E.a}),A=function(x){Object(U.a)(q,x);var Y=Object(G.a)(q);function q(){var ie;return Object(Z.a)(this,q),ie=Y.apply(this,arguments),ie.selectRef=P.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(V.a)(q,[{key:"render",value:function(){return P.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),q}(P.Component);A.Option=n,A.OptGroup=T;var H=A,F=he.c=H},M8RZ:function(Kt,he,D){"use strict";D.d(he,"a",function(){return r});var Z=D("fWQN"),V=D("mtLc"),U=D("yKVA"),G=D("879j"),P=D("q1tI"),I=D.n(P),K=D("i8i4"),k=D.n(K),r=function(M){Object(U.a)(f,M);var b=Object(G.a)(f);function f(m){var l;Object(Z.a)(this,f),l=b.call(this,m);var o=window.document;return l.node=o.createElement("div"),o.body.appendChild(l.node),l}return Object(V.a)(f,[{key:"render",value:function(){var l=this.props.children;return Object(K.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(I.a.Component)},MI8n:function(Kt,he,D){"use strict";D.d(he,"c",function(){return P}),D.d(he,"b",function(){return r}),D.d(he,"e",function(){return M}),D.d(he,"a",function(){return b}),D.d(he,"d",function(){return f}),D.d(he,"f",function(){return m});var Z=D("/cxE"),V=D("pmY6"),U=D("24hK"),G=D("5Y4S"),P;(function(l){l.None=()=>V.a.None;function o(w){return(j,B=null,A)=>{let H=!1,F;return F=w(x=>H?void 0:(F?F.dispose():H=!0,j.call(B,x)),null,A),H&&F.dispose(),F}}l.once=o;function a(w,j){return T((B,A=null,H)=>w(F=>B.call(A,j(F)),null,H))}l.map=a;function c(w,j){return T((B,A=null,H)=>w(F=>{j(F),B.call(A,F)},null,H))}l.forEach=c;function s(w,j){return T((B,A=null,H)=>w(F=>j(F)&&B.call(A,F),null,H))}l.filter=s;function i(w){return w}l.signal=i;function n(...w){return(j,B=null,A)=>Object(V.e)(...w.map(H=>H(F=>j.call(B,F),null,A)))}l.any=n;function O(w,j,B){let A=B;return a(w,H=>(A=j(A,H),A))}l.reduce=O;function T(w){let j;const B=new r({onFirstListenerAdd(){j=w(B.fire,B)},onLastListenerRemove(){j.dispose()}});return B.event}function C(w,j,B=100,A=!1,H){let F,x,Y,q=0;const ie=new r({leakWarningThreshold:H,onFirstListenerAdd(){F=w(me=>{q++,x=j(x,me),A&&!Y&&(ie.fire(x),x=void 0),clearTimeout(Y),Y=setTimeout(()=>{const $e=x;x=void 0,Y=void 0,(!A||q>1)&&ie.fire($e),q=0},B)})},onLastListenerRemove(){F.dispose()}});return ie.event}l.debounce=C;function R(w,j=(B,A)=>B===A){let B=!0,A;return s(w,H=>{const F=B||!j(H,A);return B=!1,A=H,F})}l.latch=R;function S(w,j){return[l.filter(w,j),l.filter(w,B=>!j(B))]}l.split=S;function v(w,j=!1,B=[]){let A=B.slice(),H=w(Y=>{A?A.push(Y):x.fire(Y)});const F=()=>{A&&A.forEach(Y=>x.fire(Y)),A=null},x=new r({onFirstListenerAdd(){H||(H=w(Y=>x.fire(Y)))},onFirstListenerDidAdd(){A&&(j?setTimeout(F):F())},onLastListenerRemove(){H&&H.dispose(),H=null}});return x.event}l.buffer=v;class E{constructor(w){this.event=w}map(w){return new E(a(this.event,w))}forEach(w){return new E(c(this.event,w))}filter(w){return new E(s(this.event,w))}reduce(w,j){return new E(O(this.event,w,j))}latch(){return new E(R(this.event))}debounce(w,j=100,B=!1,A){return new E(C(this.event,w,j,B,A))}on(w,j,B){return this.event(w,j,B)}once(w,j,B){return o(this.event)(w,j,B)}}function h(w){return new E(w)}l.chain=h;function p(w,j,B=A=>A){const A=(...Y)=>x.fire(B(...Y)),H=()=>w.on(j,A),F=()=>w.removeListener(j,A),x=new r({onFirstListenerAdd:H,onLastListenerRemove:F});return x.event}l.fromNodeEventEmitter=p;function _(w,j,B=A=>A){const A=(...Y)=>x.fire(B(...Y)),H=()=>w.addEventListener(j,A),F=()=>w.removeEventListener(j,A),x=new r({onFirstListenerAdd:H,onLastListenerRemove:F});return x.event}l.fromDOMEventEmitter=_;function g(w){return new Promise(j=>o(w)(j))}l.toPromise=g})(P||(P={}));class I{constructor(l){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${l}_${I._idPool++}`}start(l){this._stopWatch=new G.a(!0),this._listenerCount=l}stop(){if(this._stopWatch){const l=this._stopWatch.elapsed();this._elapsedOverall+=l,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${l.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}I._idPool=0;let K=-1;class k{constructor(l,o=Math.random().toString(18).slice(2,5)){this.customThreshold=l,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(l){let o=K;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||l<o)return;this._stacks||(this._stacks=new Map);const a=new Error().stack.split(`
`).slice(3).join(`
`),c=this._stacks.get(a)||0;if(this._stacks.set(a,c+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let s,i=0;for(const[n,O]of this._stacks)(!s||i<O)&&(s=n,i=O);console.warn(`[${this.name}] potential listener LEAK detected, having ${l} listeners already. MOST frequent listener (${i}):`),console.warn(s)}return()=>{const s=this._stacks.get(a)||0;this._stacks.set(a,s-1)}}}class r{constructor(l){var o;this._disposed=!1,this._options=l,this._leakageMon=K>0?new k(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new I(this._options._profName):void 0}get event(){return this._event||(this._event=(l,o,a)=>{var c;this._listeners||(this._listeners=new U.a);const s=this._listeners.isEmpty();s&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(o?[l,o]:l);s&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,l,o);const n=(c=this._leakageMon)===null||c===void 0?void 0:c.check(this._listeners.size),O=Object(V.i)(()=>{if(n&&n(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return a instanceof V.b?a.add(O):Array.isArray(a)&&a.push(O),O}),this._event}fire(l){var o,a;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new U.a);for(let c of this._listeners)this._deliveryQueue.push([c,l]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[c,s]=this._deliveryQueue.shift();try{typeof c=="function"?c.call(void 0,s):c[0].call(c[1],s)}catch(i){Object(Z.f)(i)}}(a=this._perfMon)===null||a===void 0||a.stop()}}dispose(){var l,o,a,c,s;this._disposed||(this._disposed=!0,(l=this._listeners)===null||l===void 0||l.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(c=(a=this._options)===null||a===void 0?void 0:a.onLastListenerRemove)===null||c===void 0||c.call(a),(s=this._leakageMon)===null||s===void 0||s.dispose())}}class M extends r{constructor(l){super(l);this._isPaused=0,this._eventQueue=new U.a,this._mergeFn=l==null?void 0:l.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const l=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(l))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(l){this._listeners&&(this._isPaused!==0?this._eventQueue.push(l):super.fire(l))}}class b extends M{constructor(l){var o;super(l);this._delay=(o=l.delay)!==null&&o!==void 0?o:100}fire(l){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(l)}}class f{constructor(){this.buffers=[]}wrapEvent(l){return(o,a,c)=>l(s=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>o.call(a,s)):o.call(a,s)},void 0,c)}bufferEvents(l){const o=[];this.buffers.push(o);const a=l();return this.buffers.pop(),o.forEach(c=>c()),a}}class m{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=V.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(l){this.inputEvent=l,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=l(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Kt,he,D){"use strict";(function(Z,V){D.d(he,"b",function(){return a}),D.d(he,"i",function(){return n}),D.d(he,"f",function(){return O}),D.d(he,"d",function(){return T}),D.d(he,"g",function(){return C}),D.d(he,"h",function(){return R}),D.d(he,"c",function(){return S}),D.d(he,"k",function(){return v}),D.d(he,"j",function(){return E}),D.d(he,"a",function(){return h}),D.d(he,"e",function(){return g});var U;const G="en";let P=!1,I=!1,K=!1,k=!1,r=!1,M=!1,b=!1,f,m=G,l,o;const a=typeof self=="object"?self:typeof Z=="object"?Z:{};let c;typeof a.vscode!="undefined"&&typeof a.vscode.process!="undefined"?c=a.vscode.process:typeof V!="undefined"&&(c=V);const s=typeof((U=c==null?void 0:c.versions)===null||U===void 0?void 0:U.electron)=="string"&&c.type==="renderer";if(typeof navigator=="object"&&!s)o=navigator.userAgent,P=o.indexOf("Windows")>=0,I=o.indexOf("Macintosh")>=0,b=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,K=o.indexOf("Linux")>=0,M=!0,f=navigator.language,m=f;else if(typeof c=="object"){P=c.platform==="win32",I=c.platform==="darwin",K=c.platform==="linux",k=K&&!!c.env.SNAP&&!!c.env.SNAP_REVISION,f=G,m=G;const w=c.env.VSCODE_NLS_CONFIG;if(w)try{const j=JSON.parse(w),B=j.availableLanguages["*"];f=j.locale,m=B||G,l=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let i=0;I?i=1:P?i=3:K&&(i=2);const n=P,O=I,T=K,C=r,R=M,S=b,v=o,E=function(){if(a.setImmediate)return a.setImmediate.bind(a);if(typeof a.postMessage=="function"&&!a.importScripts){let B=[];a.addEventListener("message",H=>{if(H.data&&H.data.vscodeSetImmediateId)for(let F=0,x=B.length;F<x;F++){const Y=B[F];if(Y.id===H.data.vscodeSetImmediateId){B.splice(F,1),Y.callback();return}}});let A=0;return H=>{const F=++A;B.push({id:F,callback:H}),a.postMessage({vscodeSetImmediateId:F},"*")}}if(typeof(c==null?void 0:c.nextTick)=="function")return c.nextTick.bind(c);const j=Promise.resolve();return B=>j.then(B)}(),h=I||b?2:P?1:3;let p=!0,_=!1;function g(){if(!_){_=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const j=new Uint16Array(w.buffer);p=j[0]===(2<<8)+1}return p}}).call(this,D("IyRk"),D("Q2Ig"))},N0LK:function(Kt,he,D){"use strict";D.d(he,"C",function(){return Z}),D.d(he,"v",function(){return U}),D.d(he,"s",function(){return G}),D.d(he,"t",function(){return P}),D.d(he,"U",function(){return I}),D.d(he,"J",function(){return K}),D.d(he,"O",function(){return k}),D.d(he,"p",function(){return r}),D.d(he,"T",function(){return M}),D.d(he,"q",function(){return b}),D.d(he,"N",function(){return f}),D.d(he,"M",function(){return m}),D.d(he,"Q",function(){return l}),D.d(he,"u",function(){return o}),D.d(he,"x",function(){return a}),D.d(he,"I",function(){return c}),D.d(he,"f",function(){return s}),D.d(he,"h",function(){return i}),D.d(he,"g",function(){return n}),D.d(he,"i",function(){return O}),D.d(he,"G",function(){return T}),D.d(he,"H",function(){return C}),D.d(he,"r",function(){return R}),D.d(he,"R",function(){return S}),D.d(he,"d",function(){return v}),D.d(he,"e",function(){return E}),D.d(he,"E",function(){return h}),D.d(he,"F",function(){return p}),D.d(he,"j",function(){return _}),D.d(he,"z",function(){return g}),D.d(he,"K",function(){return j}),D.d(he,"L",function(){return B}),D.d(he,"m",function(){return H}),D.d(he,"k",function(){return x}),D.d(he,"A",function(){return q}),D.d(he,"a",function(){return ie}),D.d(he,"n",function(){return me}),D.d(he,"l",function(){return $e}),D.d(he,"D",function(){return xe}),D.d(he,"B",function(){return Ie}),D.d(he,"b",function(){return Je}),D.d(he,"S",function(){return Ye}),D.d(he,"o",function(){return ve}),D.d(he,"P",function(){return fe}),D.d(he,"w",function(){return lt}),D.d(he,"c",function(){return qt}),D.d(he,"y",function(){return Ve});function Z(se){return!se||typeof se!="string"?!0:se.trim().length===0}const V=/{(\d+)}/g;function U(se,...Ue){return Ue.length===0?se:se.replace(V,function(Ge,et){const Wt=parseInt(et,10);return isNaN(Wt)||Wt<0||Wt>=Ue.length?Ge:Ue[Wt]})}function G(se){return se.replace(/[<>&]/g,function(Ue){switch(Ue){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Ue}})}function P(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function I(se,Ue=" "){const Ge=K(se,Ue);return k(Ge,Ue)}function K(se,Ue){if(!se||!Ue)return se;const Ge=Ue.length;if(Ge===0||se.length===0)return se;let et=0;for(;se.indexOf(Ue,et)===et;)et=et+Ge;return se.substring(et)}function k(se,Ue){if(!se||!Ue)return se;const Ge=Ue.length,et=se.length;if(Ge===0||et===0)return se;let Wt=et,Yt=-1;for(;!(Yt=se.lastIndexOf(Ue,Wt-1),Yt===-1||Yt+Ge!==Wt);){if(Yt===0)return"";Wt=Yt}return se.substring(0,Wt)}function r(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function M(se){return se.replace(/\*/g,"")}function b(se,Ue,Ge={}){if(!se)throw new Error("Cannot create regex from empty string");Ue||(se=P(se)),Ge.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let et="";return Ge.global&&(et+="g"),Ge.matchCase||(et+="i"),Ge.multiline&&(et+="m"),Ge.unicode&&(et+="u"),new RegExp(se,et)}function f(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const Ue=se.exec("");return!!(Ue&&se.lastIndex===0)}function m(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function l(se){return se.split(/\r\n|\r|\n/)}function o(se){for(let Ue=0,Ge=se.length;Ue<Ge;Ue++){const et=se.charCodeAt(Ue);if(et!==32&&et!==9)return Ue}return-1}function a(se,Ue=0,Ge=se.length){for(let et=Ue;et<Ge;et++){const Wt=se.charCodeAt(et);if(Wt!==32&&Wt!==9)return se.substring(Ue,et)}return se.substring(Ue,Ge)}function c(se,Ue=se.length-1){for(let Ge=Ue;Ge>=0;Ge--){const et=se.charCodeAt(Ge);if(et!==32&&et!==9)return Ge}return-1}function s(se,Ue){return se<Ue?-1:se>Ue?1:0}function i(se,Ue,Ge=0,et=se.length,Wt=0,Yt=Ue.length){for(;Ge<et&&Wt<Yt;Ge++,Wt++){let tn=se.charCodeAt(Ge),Ln=Ue.charCodeAt(Wt);if(tn<Ln)return-1;if(tn>Ln)return 1}const on=et-Ge,nt=Yt-Wt;return on<nt?-1:on>nt?1:0}function n(se,Ue){return O(se,Ue,0,se.length,0,Ue.length)}function O(se,Ue,Ge=0,et=se.length,Wt=0,Yt=Ue.length){for(;Ge<et&&Wt<Yt;Ge++,Wt++){let tn=se.charCodeAt(Ge),Ln=Ue.charCodeAt(Wt);if(tn===Ln)continue;if(tn>=128||Ln>=128)return i(se.toLowerCase(),Ue.toLowerCase(),Ge,et,Wt,Yt);T(tn)&&(tn-=32),T(Ln)&&(Ln-=32);const We=tn-Ln;if(We===0)continue;return We}const on=et-Ge,nt=Yt-Wt;return on<nt?-1:on>nt?1:0}function T(se){return se>=97&&se<=122}function C(se){return se>=65&&se<=90}function R(se,Ue){return se.length===Ue.length&&O(se,Ue)===0}function S(se,Ue){const Ge=Ue.length;return Ue.length>se.length?!1:O(se,Ue,0,Ge)===0}function v(se,Ue){let Ge,et=Math.min(se.length,Ue.length);for(Ge=0;Ge<et;Ge++)if(se.charCodeAt(Ge)!==Ue.charCodeAt(Ge))return Ge;return et}function E(se,Ue){let Ge,et=Math.min(se.length,Ue.length);const Wt=se.length-1,Yt=Ue.length-1;for(Ge=0;Ge<et;Ge++)if(se.charCodeAt(Wt-Ge)!==Ue.charCodeAt(Yt-Ge))return Ge;return et}function h(se){return 55296<=se&&se<=56319}function p(se){return 56320<=se&&se<=57343}function _(se,Ue){return(se-55296<<10)+(Ue-56320)+65536}function g(se,Ue,Ge){const et=se.charCodeAt(Ge);if(h(et)&&Ge+1<Ue){const Wt=se.charCodeAt(Ge+1);if(p(Wt))return _(et,Wt)}return et}function w(se,Ue){const Ge=se.charCodeAt(Ue-1);if(p(Ge)&&Ue>1){const et=se.charCodeAt(Ue-2);if(h(et))return _(et,Ge)}return Ge}function j(se,Ue){const Ge=Ft.getInstance(),et=Ue,Wt=se.length,Yt=g(se,Wt,Ue);Ue+=Yt>=65536?2:1;let on=Ge.getGraphemeBreakType(Yt);for(;Ue<Wt;){const nt=g(se,Wt,Ue),tn=Ge.getGraphemeBreakType(nt);if(qt(on,tn))break;Ue+=nt>=65536?2:1,on=tn}return Ue-et}function B(se,Ue){const Ge=Ft.getInstance(),et=Ue,Wt=w(se,Ue);Ue-=Wt>=65536?2:1;let Yt=Ge.getGraphemeBreakType(Wt);for(;Ue>0;){const on=w(se,Ue),nt=Ge.getGraphemeBreakType(on);if(qt(nt,Yt))break;Ue-=on>=65536?2:1,Yt=nt}return et-Ue}const A=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function H(se){return A.test(se)}const F=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function x(se){return F.test(se)}const Y=/^[\t\n\r\x20-\x7E]*$/;function q(se){return Y.test(se)}const ie=/[\u2028\u2029]/;function me(se){return ie.test(se)}function $e(se){for(let Ue=0,Ge=se.length;Ue<Ge;Ue++)if(xe(se.charCodeAt(Ue)))return!0;return!1}function xe(se){return se=+se,se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function Ie(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const Je=String.fromCharCode(65279);function Ye(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function ve(se,Ue=!1){return se?(Ue&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function fe(se){const Ue=90-65+1;return se=se%(2*Ue),se<Ue?String.fromCharCode(97+se):String.fromCharCode(65+se-Ue)}function lt(se){const Ue=Ft.getInstance();return Ue.getGraphemeBreakType(se)}function qt(se,Ue){return se===0?Ue!==5&&Ue!==7:se===2&&Ue===3?!1:se===4||se===2||se===3||(Ue===4||Ue===2||Ue===3)?!0:se===8&&(Ue===8||Ue===9||Ue===11||Ue===12)||((se===11||se===9)&&(Ue===9||Ue===10)||((se===12||se===10)&&Ue===10||(Ue===5||Ue===13||(Ue===7||(se===1||se===13&&Ue===14)))))?!1:!(se===6&&Ue===6)}class Ft{constructor(){this._data=Ot()}static getInstance(){return Ft._INSTANCE||(Ft._INSTANCE=new Ft),Ft._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const Ue=this._data,Ge=Ue.length/3;let et=1;for(;et<=Ge;)if(se<Ue[3*et])et=2*et;else if(se>Ue[3*et+1])et=2*et+1;else return Ue[3*et+2];return 0}}Ft._INSTANCE=null;function Ot(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ve(se,Ue){if(se===0)return 0;const Ge=vt(se,Ue);if(Ge!==void 0)return Ge;const et=w(Ue,se);return se-=ht(et),se}function vt(se,Ue){let Ge=w(Ue,se);for(se-=ht(Ge);Bt(Ge)||Ge===65039||Ge===8419;){if(se===0)return;Ge=w(Ue,se),se-=ht(Ge)}if(!Ie(Ge))return;if(se>=0){const et=w(Ue,se);et===8205&&(se-=ht(et))}return se}function ht(se){return se>=65536?2:1}function Bt(se){return 127995<=se&&se<=127999}},NLgs:function(Kt,he,D){"use strict";D.d(he,"e",function(){return c}),D.d(he,"f",function(){return s}),D.d(he,"d",function(){return n}),D.d(he,"c",function(){return O}),D.d(he,"a",function(){return T}),D.d(he,"b",function(){return C});var Z=D("miYZ"),V=D("tsqr"),U=D("9og8"),G=D("2qtc"),P=D("kLXV"),I=D("WmNS"),K=D.n(I),k=D("q1tI"),r=D.n(k),M=D("9kvl"),b=D("xKgJ"),f=D("1vsH"),m=D("RCxd"),l=D("yTi+"),o=D.n(l),a=D("m3rI"),c=function(S){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(s(S)&&i(v))},s=function(S){return Object(b.p)()?!0:(S({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},i=function(){var S,v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(M.c)()._store.getState(),h=E.user;return(S=h.userInfo)!==null&&S!==void 0&&S.profile_completed?!0:(P.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:v?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){M.d.push("/account/profile/edit")}}),!1)},n=function(){var S,v=Object(M.c)()._store.getState(),E=v.user;return(S=E.userInfo)!==null&&S!==void 0&&S.professional_certification?!0:(P.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(f.S)("/account/certification")}}),!1)},O=function(){var S;if(Object(b.a)())return!0;var v=Object(M.c)()._store.getState(),E=v.user,h=v.globalSetting;return P.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:a.a.IMG_SERVER+(h==null||((S=h.setting)===null||S===void 0)?void 0:S.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},T=function(S,v){var E;if(S)return!0;var h=Object(M.c)()._store.getState(),p=h.user,_=h.globalSetting;return P.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,v||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:a.a.IMG_SERVER+(_==null||((E=_.setting)===null||E===void 0)?void 0:E.authority_qrcode_url),width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(f.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},C=function(S){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(M.c)()._store.getState(),h=E.shixunsDetail.detail;return(h==null?void 0:h.public)===2||(h==null?void 0:h.public)===1||(h==null?void 0:h.shixun_status)===3?(P.a.info({centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(h==null?void 0:h.public)===2?"\u5DF2\u516C\u5F00":(h==null?void 0:h.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",v,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:o.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(h==null?void 0:h.shixun_status)===2?(P.a.confirm({centered:!0,icon:r.a.createElement(m.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",v,"\u3002"),r.a.createElement("br",null),r.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){P.a.confirm({width:440,centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var _=Object(U.a)(K.a.mark(function w(){var j;return K.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,S({type:"shixunsDetail/cancelRelease",payload:{id:h==null?void 0:h.identifier}});case 2:j=A.sent,j.status!==401&&(V.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),S({type:"shixunsDetail/getShixunsDetail",payload:{id:h==null?void 0:h.identifier}}),S({type:"practiceSetting/getCommonData",payload:{id:h==null?void 0:h.identifier}}));case 4:case"end":return A.stop()}},w)}));function g(){return _.apply(this,arguments)}return g}()})}}),!0):!1}},Nd3P:function(Kt,he,D){Kt.exports={wrap:"wrap___h8kK3",maxWidth70:"maxWidth70___31ilo",maxWidth80:"maxWidth80___QYyBn",maxWidth100:"maxWidth100___1Caz0",maxWidth110:"maxWidth110___2Ikef",maxWidth120:"maxWidth120___1TY6-",reviewStatusTooltip:"reviewStatusTooltip___btvLr",color32C:"color32C___3168D",MdEditor:"MdEditor___1md-c",tr1:"tr1___33AUl"}},NvD2:function(Kt,he,D){"use strict";D.d(he,"a",function(){return I});var Z=D("Kwbf");function V(K,k){var r=new Set;return K.forEach(function(M){k.has(M)||r.add(M)}),r}function U(K){var k=K||{},r=k.disabled,M=k.disableCheckbox,b=k.checkable;return!!(r||M)||b===!1}function G(K,k,r,M){for(var b=new Set(K),f=new Set,m=0;m<=r;m+=1){var l=k.get(m)||new Set;l.forEach(function(s){var i=s.key,n=s.node,O=s.children,T=O===void 0?[]:O;b.has(i)&&!M(n)&&T.filter(function(C){return!M(C.node)}).forEach(function(C){b.add(C.key)})})}for(var o=new Set,a=r;a>=0;a-=1){var c=k.get(a)||new Set;c.forEach(function(s){var i=s.parent,n=s.node;if(M(n)||!s.parent||o.has(s.parent.key))return;if(M(s.parent.node)){o.add(i.key);return}var O=!0,T=!1;(i.children||[]).filter(function(C){return!M(C.node)}).forEach(function(C){var R=C.key,S=b.has(R);O&&!S&&(O=!1),!T&&(S||f.has(R))&&(T=!0)}),O&&b.add(i.key),T&&f.add(i.key),o.add(i.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(V(f,b))}}function P(K,k,r,M,b){for(var f=new Set(K),m=new Set(k),l=0;l<=M;l+=1){var o=r.get(l)||new Set;o.forEach(function(i){var n=i.key,O=i.node,T=i.children,C=T===void 0?[]:T;!f.has(n)&&!m.has(n)&&!b(O)&&C.filter(function(R){return!b(R.node)}).forEach(function(R){f.delete(R.key)})})}m=new Set;for(var a=new Set,c=M;c>=0;c-=1){var s=r.get(c)||new Set;s.forEach(function(i){var n=i.parent,O=i.node;if(b(O)||!i.parent||a.has(i.parent.key))return;if(b(i.parent.node)){a.add(n.key);return}var T=!0,C=!1;(n.children||[]).filter(function(R){return!b(R.node)}).forEach(function(R){var S=R.key,v=f.has(S);T&&!v&&(T=!1),!C&&(v||m.has(S))&&(C=!0)}),T||f.delete(n.key),C&&m.add(n.key),a.add(n.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(V(m,f))}}function I(K,k,r,M){var b=[],f;M?f=M:f=U;var m=new Set(K.filter(function(c){var s=!!r[c];return s||b.push(c),s})),l=new Map,o=0;Object.keys(r).forEach(function(c){var s=r[c],i=s.level,n=l.get(i);n||(n=new Set,l.set(i,n)),n.add(s),o=Math.max(o,i)}),Object(Z.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var a;return k===!0?a=G(m,l,o,f):a=P(m,k.halfCheckedKeys,l,o,f),a}},OH33:function(Kt,he,D){"use strict";D.r(he);var Z=D("g9YV"),V=D("wCAj"),U=D("Znn+"),G=D("ZTPi"),P=D("5Dmo"),I=D("3S7+"),K=D("sPJy"),k=D("bE4q"),r=D("+L6B"),M=D("2/Rp"),b=D("miYZ"),f=D("tsqr"),m=D("9og8"),l=D("2qtc"),o=D("kLXV"),a=D("tJVT"),c=D("WmNS"),s=D.n(c),i=D("q1tI"),n=D.n(i),O=D("ErOA"),T=D("Ty5D"),C=D("55Ip"),R=D("9kvl"),S=D("jhfD"),v=D("1vsH"),E=D("T2oS"),h=D("W9HT"),p=D("DjyN"),_=D("NUBc"),g=D("k1fw"),w=D("9Bee"),j=function(_n){var Tn=_n.shixunHomeworks,bn=_n.dispatch,ur=Object(T.i)();return n.a.createElement(o.a,{centered:!0,title:"\u63D0\u793A",visible:Tn.actionTabs.key==="\u5220\u9664",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function sr(){var Q;return s.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,bn({type:"shixunHomeworks/deleteReply",payload:{object_id:Tn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:Q=Ce.sent,Q.status===0&&(f.b.success("\u5220\u9664\u6210\u529F"),bn({type:"shixunHomeworks/setActionTabs",payload:{}}),bn({type:"shixunHomeworks/getReplyList",payload:Object(g.a)({},Tn.actionTabs.params)}));case 4:case"end":return Ce.stop()}},sr)})),onCancel:function(){bn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},B=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(j),A=D("wd/R"),H=D.n(A),F=D("iF7n"),x=D.n(F),Y=D("xKgJ"),q=D("BdwD");H.a.lang("ZH-cn");var ie=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],me=function(_n){var Tn,bn,ur=_n.shixunHomeworks,sr=_n.classroomList,Q=_n.globalSetting,ce=_n.user,Ce=_n.loading,Te=_n.dispatch,rt=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(T.i)()),{},{per_page:10})),Re=Object(a.a)(rt,2),Xe=Re[0],it=Re[1],Dt=Object(i.useState)([]),Tt=Object(a.a)(Dt,2),Be=Tt[0],_t=Tt[1],at=Object(i.useState)(-1),dt=Object(a.a)(at,2),wt=dt[0],It=dt[1],gt=Object(i.useState)(""),Xt=Object(a.a)(gt,2),dn=Xt[0],Pn=Xt[1],Gn=Object(i.useState)(""),Sn=Object(a.a)(Gn,2),Nn=Sn[0],Mn=Sn[1],Pt=sr.detailLeftMenus,hn=Object(T.h)(),Ht=Object(i.useState)({}),Rt=Object(a.a)(Ht,2),Un=Rt[0],On=Rt[1],Vt=ur.workDetail,ft=ur.workList,jn=Object(i.useState)("1"),fn=Object(a.a)(jn,2),Qn=fn[0],Zt=fn[1],Rn=Object(i.useState)(!1),Fn=Object(a.a)(Rn,2),vn=Fn[0],yr=Fn[1];Object(i.useEffect)(function(){ft.homework_status&&Dn()},[ft]);function Dn(){return xn.apply(this,arguments)}function xn(){return xn=Object(m.a)(s.a.mark(function Lt(){var Qe,Nt,Mt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:return yr(!0),zn.next=3,Object(O.a)("/api/courses/".concat(Xe.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(g.a)(Object(g.a)({},Xe),{},{id:Xe.categoryId})});case 3:Mt=zn.sent,_t(Mt),yr(!1),Xe.defaultExpandedRowKeys=["".concat(Mt==null||((Qe=Mt.data)===null||Qe===void 0||((Nt=Qe[0])===null||Nt===void 0))?void 0:Nt.identifier)],Qn!="2"&&Zt(Mt!=null&&Mt.description?"1":"2"),it(Object(g.a)({},Xe));case 9:case"end":return zn.stop()}},Lt)})),xn.apply(this,arguments)}return n.a.createElement("section",{className:x.a.bg},n.a.createElement(h.a,{spinning:vn},n.a.createElement(G.a,{onChange:function(Qe){Zt(Qe)},activeKey:Qn},n.a.createElement(G.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(Be!=null&&Be.description)&&n.a.createElement(q.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(w.a,{value:(Be==null?void 0:Be.description)||""}))),n.a.createElement(G.a.TabPane,{key:2,tab:"\u9898\u76EE\u5217\u8868"},n.a.createElement("div",null,n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},Xe.defaultExpandedRowKeys&&n.a.createElement(V.a,{dataSource:Be==null?void 0:Be.data,rowKey:function(Qe){return Qe==null?void 0:Qe.identifier},pagination:!1,expandable:{expandedRowRender:function(Qe){var Nt,Mt;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Qe==null?void 0:Qe.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Qe==null?void 0:Qe.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(Y.c)()&&(Be==null||((Nt=Be.homework_status)===null||Nt===void 0)?void 0:Nt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(M.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Qe==null?void 0:Qe.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[Xe.coursesId,Xe.categoryId])}},"\u7F16\u8F91"),Object(Y.c)()&&(Be==null||((Mt=Be.homework_status)===null||Mt===void 0)?void 0:Mt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(M.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){o.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var zn=Object(m.a)(s.a.mark(function lr(){var er;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return mr.next=2,Object(O.a)("/api/problems/".concat(Qe==null?void 0:Qe.identifier,".json"),{method:"delete"});case 2:er=mr.sent,(er==null?void 0:er.status)===0&&(f.b.info("\u5220\u9664\u6210\u529F"),Xe.page=1,Dn());case 4:case"end":return mr.stop()}},lr)}));function kn(){return zn.apply(this,arguments)}return kn}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:Xe.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Qe,Nt,Mt){return n.a.createElement("div",null,ie[Qe])}},{title:"\u901A\u8FC7\u7387",dataIndex:"pass_rate",key:"pass_rate"},{title:"\u901A\u8FC7\u4EBA\u6570",dataIndex:"submit_info",key:"submit_info"},{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline",ellipsis:!0,width:"10%",key:"tag_discipline"},{title:"\u64CD\u4F5C",dataIndex:"identifier",key:"identifier",render:function(Qe,Nt,Mt){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(Xe.coursesId,"/program_homework/").concat(Xe.categoryId,"/").concat(Qe,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function cn(){var zn;return s.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(O.a)("/api/problems/".concat(Nt==null?void 0:Nt.identifier,"/start.json"),{method:"get"});case 2:zn=lr.sent,zn&&(window.open("/myproblems/".concat(zn==null?void 0:zn.identifier,"?type=1")),localStorage.setItem("program_homework",[Xe.coursesId,Xe.categoryId]));case 4:case"end":return lr.stop()}},cn)})),style:{margin:"0px 20px"}},Object(Y.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(Be==null||((Tn=Be.data)===null||Tn===void 0||((bn=Tn[0])===null||bn===void 0))?void 0:bn.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(_.a,{defaultCurrent:1,total:Be==null?void 0:Be.count,hideOnSinglePage:!0,showTotal:function(Qe){return n.a.createElement("span",null,"\u5171",Qe,"\u6761")},current:Xe.page||1,pageSize:Xe.per_page||10,onChange:function(Qe,Nt){Xe.page=Qe,Xe.per_page=Nt,it(Object(g.a)({},Xe)),Dn()}})))))),n.a.createElement(B,null))},$e=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.classroomList,bn=Bn.loading,ur=Bn.user,sr=Bn.globalSetting;return{shixunHomeworks:_n,globalSetting:sr,classroomList:Tn,user:ur,loading:bn.effects}})(me),xe=D("oBTY"),Ie=D("giR+"),Je=D("fyUT"),Ye=D("7Kak"),ve=D("9yH6"),fe=D("qVdP"),lt=D("jsC+"),qt=D("5NDa"),Ft=D("5rEg"),Ot=D("14J3"),Ve=D("BMrR"),vt=D("sRBo"),ht=D("kaz8"),Bt=D("jCWc"),se=D("kPKH"),Ue=D("lUTK"),Ge=D("BvKs"),et=D("jrin"),Wt=D("y8nQ"),Yt=D("Vl3Y"),on=D("8Skl"),nt=D("y3Kf"),tn=D("Llu2"),Ln=D("0NbB"),We=D("T7RX"),Fe=D("PpiC"),yt=D("IMoZ"),At=function(_n){var Tn=_n.shixunHomeworks,bn=_n.dispatch,ur=Object(Fe.a)(_n,["shixunHomeworks","dispatch"]),sr=Object(T.i)(),Q=Object(i.useState)(!0),ce=Object(a.a)(Q,2),Ce=ce[0],Te=ce[1],rt=Object(i.useState)(!1),Re=Object(a.a)(rt,2),Xe=Re[0],it=Re[1],Dt=Yt.a.useForm(),Tt=Object(a.a)(Dt,1),Be=Tt[0],_t=function(){var at=Object(m.a)(s.a.mark(function dt(){var wt,It;return s.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return wt=Be.getFieldValue(),Xt.next=3,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(xe.a)(Tn.actionTabs.selectArrs),cover_all:Ce,hidden_comment:wt.hidden_comment,comment:wt.comment}});case 3:It=Xt.sent,It.status===0&&(f.b.success("\u8BC4\u9605\u6210\u529F"),Be.resetFields(),bn({type:"shixunHomeworks/setActionTabs",payload:{}}),bn({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Tn.actionTabs.params)}));case 5:case"end":return Xt.stop()}},dt)}));return function(){return at.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(o.a,{centered:!0,title:"\u4E00\u952E\u70B9\u8BC4",visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function at(){var dt;return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:dt=Be.getFieldValue(),JSON.stringify(dt)==="{}"||dt.hidden_comment===""&&dt.comment===""?it(!0):Tn.workList.partial_comment?bn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Tn.actionTabs.selectArrs,params:Tn.actionTabs.params}}):_t();case 2:case"end":return It.stop()}},at)})),onCancel:function(){bn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Yt.a,{form:Be,onChange:function(){Xe&&it(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Yt.a.Item,{name:"comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Yt.a.Item,{name:"hidden_comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Xe&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(o.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(yt.a,{className:"c-orange mr20"}),"\u63D0\u793A"),visible:Tn.actionTabs.key==="\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",okText:"\u786E\u5B9A\u70B9\u8BC4",cancelText:"\u653E\u5F03\u70B9\u8BC4",onOk:function(){_t()},onCancel:function(){bn({type:"shixunHomeworks/setActionTabs",payload:{}})},width:400},n.a.createElement("div",{className:"tc"},n.a.createElement("p",null,"\u90E8\u5206\u5B66\u751F\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF0C\u662F\u5426\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4\u5185\u5BB9\uFF1F"),n.a.createElement("p",null,n.a.createElement(ve.a.Group,{onChange:function(dt){Te(dt.target.value)},value:Ce},n.a.createElement(ve.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(ve.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},tt=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(At),ot=D("XYT7"),De=D("Nd3P"),ye=D.n(De),we=function(_n){var Tn,bn,ur,sr,Q=_n.shixunHomeworks,ce=_n.dispatch,Ce=Object(Fe.a)(_n,["shixunHomeworks","dispatch"]),Te=Object(T.i)(),rt=Object(i.useState)(!1),Re=Object(a.a)(rt,2),Xe=Re[0],it=Re[1],Dt=Object(i.useState)((Tn=Q.actionTabs.selectArrs)===null||Tn===void 0||((bn=Tn.data)===null||bn===void 0)?void 0:bn.name),Tt=Object(a.a)(Dt,2),Be=Tt[0],_t=Tt[1],at=Yt.a.useForm(),dt=Object(a.a)(at,1),wt=dt[0];Object(i.useEffect)(function(){var gt,Xt,dn,Pn,Gn,Sn;Q.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&wt.setFieldsValue({comment:(gt=Q.actionTabs.selectArrs)===null||gt===void 0||((Xt=gt.data)===null||Xt===void 0)?void 0:Xt.work_comment,hidden_comment:(dn=Q.actionTabs.selectArrs)===null||dn===void 0||((Pn=dn.data)===null||Pn===void 0)?void 0:Pn.work_comment_hidden}),_t((Gn=Q.actionTabs.selectArrs)===null||Gn===void 0||((Sn=Gn.data)===null||Sn===void 0)?void 0:Sn.name)},[Q.actionTabs.key]);var It=function(){var gt=Object(m.a)(s.a.mark(function Xt(){var dn,Pn,Gn,Sn;return s.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Gn=wt.getFieldValue(),Mn.next=3,Object(O.a)("/api/student_works/".concat((dn=Q.actionTabs.selectArrs)===null||dn===void 0||((Pn=dn.data)===null||Pn===void 0)?void 0:Pn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:Gn.hidden_comment,comment:Gn.comment}});case 3:if(Sn=Mn.sent,!(Sn.status===0)){Mn.next=9;break}return f.b.success("\u8BC4\u9605\u6210\u529F"),wt.resetFields(),ce({type:"shixunHomeworks/setActionTabs",payload:{}}),Mn.abrupt("return",ce({type:"shixunHomeworks/getWorkList",payload:Te}));case 9:case"end":return Mn.stop()}},Xt)}));return function(){return gt.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(o.a,{centered:!0,title:(ur=Q.actionTabs.selectArrs)!==null&&ur!==void 0&&(sr=ur.data)!==null&&sr!==void 0&&sr.work_comment_hidden?"\u66F4\u6539"+Be+"\u70B9\u8BC4":Be+"\u70B9\u8BC4",visible:Q.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function gt(){var Xt;return s.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:Xt=wt.getFieldValue(),JSON.stringify(Xt)==="{}"||Xt.hidden_comment===""&&Xt.comment===""?it(!0):It();case 2:case"end":return Pn.stop()}},gt)})),onCancel:function(){ce({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Yt.a,{form:wt,onChange:function(){Xe&&it(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Yt.a.Item,{name:"comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8})),n.a.createElement("p",null,"\u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Yt.a.Item,{name:"hidden_comment"},n.a.createElement(Ft.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),Xe&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ae=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(we),oe=function(_n){var Tn=_n.shixunHomeworks,bn=_n.dispatch,ur=Object(Fe.a)(_n,["shixunHomeworks","dispatch"]),sr=Object(T.i)(),Q=Object(i.useState)([]),ce=Object(a.a)(Q,2),Ce=ce[0],Te=ce[1],rt=Object(i.useState)([]),Re=Object(a.a)(rt,2),Xe=Re[0],it=Re[1];Object(i.useEffect)(function(){Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&Dt()},[Tn.actionTabs.key]);function Dt(){return Tt.apply(this,arguments)}function Tt(){return Tt=Object(m.a)(s.a.mark(function _t(){var at;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:at=wt.sent,Te(at);case 4:case"end":return wt.stop()}},_t)})),Tt.apply(this,arguments)}var Be=[{title:"\u5206\u73ED\u60C5\u51B5",dataIndex:"name"},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u68C0\u6D4B\u8FDB\u5EA6",dataIndex:"status"},{title:"\u4E0A\u6B21\u8BC4\u5206\u65F6\u95F4",dataIndex:"last_analysis_time"}];return n.a.createElement(n.a.Fragment,null,n.a.createElement(o.a,{centered:!0,title:"\u4EE3\u7801\u8D28\u91CF\u8BC4\u5206",visible:Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B",width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function _t(){var at;return s.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(O.a)("/api/homework_commons/".concat(sr.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:Xe}});case 2:at=wt.sent,(at==null?void 0:at.status)===0&&(R.d.replace("/classrooms/".concat(sr.coursesId,"/shixun_homework/").concat(sr.categoryId,"/detail?tabs=4")),window.location.reload(),bn({type:"shixunHomeworks/setActionTabs",payload:{}}),it([]));case 4:case"end":return wt.stop()}},_t)})),onCancel:function(){it([]),bn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(V.a,{rowSelection:{type:"checkbox",onChange:function(at,dt){it(Object(xe.a)(at))},selectedRowKeys:Xe,getCheckboxProps:function(at){return{disabled:at.status==="\u8FDB\u884C\u4E2D"||at.works_count===0}}},rowKey:function(at){return at.key||at.id},scroll:{y:300},pagination:!1,columns:Be,dataSource:Ce==null?void 0:Ce.group_list})))},pe=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks;return{shixunHomeworks:_n}})(oe),_e=D("Ot1p"),be=D("mgmH"),Ke=function(_n){var Tn,bn,ur,sr,Q,ce,Ce,Te,rt,Re=_n.shixunHomeworks,Xe=_n.loading,it=_n.dispatch,Dt=_n.setExportParams,Tt=_n.user,Be=Object(T.i)(),_t=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),Be)),at=Object(a.a)(_t,2),dt=at[0],wt=at[1],It=Yt.a.useForm(),gt=Object(a.a)(It,1),Xt=gt[0],dn=Object(i.useState)(),Pn=Object(a.a)(dn,2),Gn=Pn[0],Sn=Pn[1],Nn=Object(i.useState)({}),Mn=Object(a.a)(Nn,2),Pt=Mn[0],hn=Mn[1],Ht=Object(i.useState)([]),Rt=Object(a.a)(Ht,2),Un=Rt[0],On=Rt[1],Vt=Object(i.useState)(!1),ft=Object(a.a)(Vt,2),jn=ft[0],fn=ft[1],Qn=Object(i.useState)([]),Zt=Object(a.a)(Qn,2),Rn=Zt[0],Fn=Zt[1],vn=Object(i.useState)(!1),yr=Object(a.a)(vn,2),Dn=yr[0],xn=yr[1],Lt=Object(i.useState)(),Qe=Object(a.a)(Lt,2),Nt=Qe[0],Mt=Qe[1],cn=Object(i.useState)(1),zn=Object(a.a)(cn,2),kn=zn[0],lr=zn[1],er=Object(i.useState)(),Rr=Object(a.a)(er,2),mr=Rr[0],xr=Rr[1],Zr=Object(i.useState)(),Yr=Object(a.a)(Zr,2),Jr=Yr[0],vi=Yr[1],_i=Object(i.useState)(),Ee=Object(a.a)(_i,2),Ne=Ee[0],ze=Ee[1],Se=Object(i.useState)(),re=Object(a.a)(Se,2),ge=re[0],ue=re[1],Oe=Object(i.useState)(),Pe=Object(a.a)(Oe,2),Ze=Pe[0],ke=Pe[1],ut=Object(i.useState)(!1),Ut=Object(a.a)(ut,2),rn=Ut[0],mn=Ut[1],Hn=Object(T.h)();Object(i.useEffect)(function(){return Vn(!0),function(){hn([]),On([])}},[dt.coursesId]),Object(i.useEffect)(function(){var gn,en=JSON.parse(JSON.stringify(Re.workList));!(en!=null&&(gn=en.student_works)!==null&&gn!==void 0&&gn.length)&&en!==null&&en!==void 0&&en.id?(en.student_works=[Object(g.a)({},en)],hn(en)):(en!=null&&en.id&&On([Object(g.a)(Object(g.a)({},en),{number:"\u6211"})]),hn(Object(g.a)({},en)))},[Re.workList]);var Vn=function(en){Dt(Object(g.a)({},dt));var En=it({type:"shixunHomeworks/getWorkList",payload:dt});return en&&En.then(function(Gt){var zt,pr,Mr;(Gt!=null&&(zt=Gt.homework_status)!==null&&zt!==void 0&&zt.includes("\u8FDB\u884C\u4E2D")||Gt!=null&&(pr=Gt.homework_status)!==null&&pr!==void 0&&pr.includes("\u8865\u4EA4\u4E2D")||Gt!=null&&(Mr=Gt.homework_status)!==null&&Mr!==void 0&&Mr.includes("\u63D0\u4EA4\u4E2D"))&&!Object(Y.s)()&&dr()}),En};Object(i.useEffect)(function(){fr()},[]);var fr=function(){var gn=Object(m.a)(s.a.mark(function en(){var En;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(ot.I)({categoryId:Be.categoryId});case 2:En=zt.sent,Sn(En==null?void 0:En.update_score);case 4:case"end":return zt.stop()}},en)}));return function(){return gn.apply(this,arguments)}}(),dr=function(){var gn=Object(m.a)(s.a.mark(function en(){var En;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return it({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),zt.next=3,Object(ot.Z)({categoryId:Be.categoryId});case 3:En=zt.sent,it({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(En==null?void 0:En.status)===0&&(f.b.success(En==null?void 0:En.message),Vn());case 6:case"end":return zt.stop()}},en)}));return function(){return gn.apply(this,arguments)}}(),wr=function(){dt.page=1;var en=Object.assign({},Xt.getFieldValue());delete dt.course_group,delete dt.teacher_comment,Object.keys(en).map(function(En){switch(En){case"task_status":en[En].includes("all")||!en[En].length?(delete dt.work_status,Xt.setFieldsValue(Object(et.a)({},"task_status","all"))):(dt.work_status=en[En],Xt.setFieldsValue(Object(et.a)({},"task_status",dt.work_status)));break;case"course_group_info":en[En].includes("all")||!en[En].length?(delete dt.course_group,Xt.setFieldsValue(Object(et.a)({},"course_group_info","all"))):(dt.course_group=en[En],Xt.setFieldsValue(Object(et.a)({},"course_group_info",dt.course_group)));break;case"teacher_comment":if(en[En].includes("all")||!en[En].length)delete dt.teacher_comment,Xt.setFieldsValue(Object(et.a)({},"teacher_comment","all"));else{var Gt;dt.teacher_comment=((Gt=en[En])===null||Gt===void 0?void 0:Gt.length)===1?Number(en[En][0]):"",Xt.setFieldsValue(Object(et.a)({},"teacher_comment",en[En]))}break}}),Vn()};Object(i.useEffect)(function(){if(document.getElementById("divhe")){var gn=document.getElementById("divhe").scrollHeight;gn>47&&(ke(47),mn(!0))}},[document.getElementById("divhe")]);var Ar=function(en,En){dt.page=en,dt.limit=20,Vn()};function gr(){lr(1),xr(""),vi(""),ze(""),ue(""),Fn([])}var Cr=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(en,En,Gt){return dt.limit*(dt.page-1)+Gt+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(en){return n.a.createElement(I.a,{placement:"bottomLeft",title:en},n.a.createElement("span",{className:"current"},en))}},!(Pt!=null&&Pt.is_excellent)&&!Object(Y.r)()&&{title:"\u5B66\u53F7",dataIndex:"student_id",align:"center",sorter:!0,fixed:"left",width:110,showSorterTooltip:!1,ellipsis:{showTitle:!1},sortOrder:dt.order==="student_id"?dt.b_order==="desc"?"descend":"ascend":null,render:function(en){return n.a.createElement(I.a,{placement:"bottomLeft",title:en||"--"},n.a.createElement("span",{className:"current"},en||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(en,En){return en?n.a.createElement(I.a,{placement:"bottom",title:en},n.a.createElement("span",{className:"current"},en)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:dt.order==="work_status"?dt.b_order==="desc"?"descend":"ascend":null,render:function(en){return n.a.createElement(v.f,{status:en})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(en,En){return n.a.createElement(I.a,{placement:"bottomLeft",title:en},n.a.createElement("span",{className:"current"},en))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(en,En){return n.a.createElement("span",null,en||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(en,En){return n.a.createElement("span",null,en||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(en,En){return en&&en!="--"?n.a.createElement(I.a,{placement:"bottom",title:en},n.a.createElement("span",{className:"current"},en)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(en){return en?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(en,En){return Object(Y.s)()?n.a.createElement("div",null,Object(v.B)(En==null?void 0:En.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(C.a,{target:"_blank",onClick:function(zt){zt.stopPropagation()},to:"/classrooms/".concat(dt.coursesId,"/program_homework/").concat(dt.categoryId,"/").concat(En.id,"/").concat(En.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(zt){var pr;if(zt.stopPropagation(),(pr=Tt.userInfo)!==null&&pr!==void 0&&pr.professional_certification)window.open("/classrooms/".concat(dt.coursesId,"/program_homework/").concat(dt.categoryId,"/").concat(En.id,"/").concat(En.user_id,"/comment"),"_blank");else return o.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(v.S)("/account/certification")}}),!1}},"\u67E5\u770B\u4F5C\u4E1A")}}].filter(function(gn){return!!gn}),Lr=function(){return n.a.createElement(Ge.a,null,n.a.createElement(Ge.a.Item,{onClick:function(){Object(be.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(Ge.a.Item,{key:"2"},n.a.createElement(C.a,{to:"/classrooms/".concat(dt.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(ye.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Tn=Pt.homework_status)===null||Tn===void 0?void 0:Tn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(q.a,null),!((bn=Pt.homework_status)!==null&&bn!==void 0&&bn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement("aside",null,!Object(Y.c)()&&n.a.createElement("div",{className:"c-light-black font12"},n.a.createElement("span",null,"\u53D1\u5E03\u65F6\u95F4 ",Pt==null?void 0:Pt.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Pt==null?void 0:Pt.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Pt==null?void 0:Pt.late_time)||"- -")),Object(Y.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Yt.a,{form:Xt,onChange:wr,initialValues:(ur={},Object(et.a)(ur,"task_status","all"),Object(et.a)(ur,"course_group_info","all"),Object(et.a)(ur,"teacher_comment","all"),ur)},((sr=Pt.task_status)===null||sr===void 0?void 0:sr.length)>0&&n.a.createElement(Yt.a.Item,{name:"task_status"},n.a.createElement(ht.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(Ve.a,null,n.a.createElement(se.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(se.a,{flex:"80px"},n.a.createElement(ht.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(se.a,{flex:"1"},Pt.task_status&&Pt.task_status.map(function(gn,en){return n.a.createElement(ht.a,{name:"task_status",value:gn.id},gn.name,"(",gn.count,")")}))))),((Q=Pt.course_group_info)===null||Q===void 0?void 0:Q.length)>0&&n.a.createElement(Yt.a.Item,{name:"course_group_info"},n.a.createElement(ht.a.Group,{style:{width:"100%"}},n.a.createElement(Ve.a,null,n.a.createElement(se.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(se.a,{flex:"80px"},n.a.createElement(ht.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(se.a,{flex:"1",id:"divhe",style:{height:Ze+"px",overflow:"hidden"}},(ce=Pt.course_group_info)===null||ce===void 0?void 0:ce.map(function(gn,en){return n.a.createElement(ht.a,{value:gn.course_group_id},gn.group_group_name,"(",gn.count,")")})),rn&&n.a.createElement("span",{onClick:function(){var en=document.getElementById("divhe").scrollHeight;Ze>47?ke(47):ke(en)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},Ze===47?"\u5C55\u5F00":"\u6536\u8D77",Ze===47?n.a.createElement(on.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(nt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Ce=Pt.teacher_comment)===null||Ce===void 0?void 0:Ce.length)>0&&n.a.createElement(Yt.a.Item,{name:"teacher_comment"},n.a.createElement(ht.a.Group,{style:{width:"100%"}},n.a.createElement(Ve.a,null,n.a.createElement(se.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(se.a,{flex:"80px"},n.a.createElement(ht.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(se.a,{flex:"1"},Pt.teacher_comment&&Pt.teacher_comment.map(function(gn,en){return n.a.createElement(ht.a,{value:String(gn.id)},gn.name,"(",gn.count,")")})))))),n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(se.a,{flex:"1"},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(se.a,null,n.a.createElement(Ft.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(en){dt.search=en,dt.page=1,Vn()},style:{width:240}})),n.a.createElement(se.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Pt.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Pt.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(se.a,null,Object(Y.c)()&&n.a.createElement(M.a,{className:"ml10",onClick:function(){it({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Pt.student_works.map(function(en){return en.id}),params:dt}})}},n.a.createElement("span",{className:"".concat(ye.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(Y.c)()&&n.a.createElement(M.a,{className:"ml10",onClick:dr},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(Y.c)()&&n.a.createElement(lt.a,{overlay:Lr,className:"ml10"},n.a.createElement(M.a,null,n.a.createElement(tn.a,null),"\u5BFC\u51FA",n.a.createElement(Ln.a,null)))))),n.a.createElement(Ve.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(Y.c)()&&Gn&&n.a.createElement("span",null,n.a.createElement("span",{style:{color:"red"}},"*"),"\u5217\u8868\u4E2D\u4F5C\u4E1A\u8BB0\u5F55\u5B58\u5728\u5DEE\u5F02\uFF0C\u8BF7\u70B9\u51FB\u201C\u66F4\u65B0\u6210\u7EE9\u201D\u6309\u94AE")),n.a.createElement(V.a,{className:"mt30",loading:Xe["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(en){return{onClick:function(Gt){window.open("/classrooms/".concat(dt.coursesId,"/program_homework/").concat(dt.categoryId,"/").concat(en.id,"/").concat(en.user_id,"/comment"),"_blank")}}},dataSource:Pt.student_works,columns:Cr,onChange:function(en,En,Gt){Gt.field&&(dt.order=Gt.field),Gt.order||(dt.b_order="asc"),Gt.order==="ascend"&&(dt.b_order="asc"),Gt.order==="descend"&&(dt.b_order="desc"),Gt.order||(dt.b_order="asc"),Vn()}}),n.a.createElement(tt,null),n.a.createElement(ae,null),n.a.createElement(We.a,null)),n.a.createElement(o.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:jn,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(m.a)(s.a.mark(function gn(){var en,En;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(!(kn===2)){zt.next=13;break}if(!(Rn.length<=0)){zt.next=4;break}return f.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),zt.abrupt("return");case 4:if(ge){zt.next=7;break}return f.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),zt.abrupt("return");case 7:return zt.next=9,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,status:Rn}});case 9:en=zt.sent,en.status===0&&(Mt(en),fn(!1),xn(!0)),zt.next=32;break;case 13:if(!(Ne===0||Jr===0)){zt.next=16;break}zt.next=22;break;case 16:if(Ne){zt.next=19;break}return f.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),zt.abrupt("return");case 19:if(Jr){zt.next=22;break}return f.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),zt.abrupt("return");case 22:if(!(Ne>Jr)){zt.next=25;break}return f.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),zt.abrupt("return");case 25:if(ge){zt.next=28;break}return f.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),zt.abrupt("return");case 28:return zt.next=30,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,min_score:Ne,max_score:Jr}});case 30:En=zt.sent,En.status===0&&(Mt(En),fn(!1),xn(!0));case 32:case"end":return zt.stop()}},gn)})),onCancel:function(){fn(!1),gr()}},n.a.createElement("div",{style:{padding:"32px"}},n.a.createElement("div",null,n.a.createElement("div",null,n.a.createElement("span",{style:{width:"80px"}},"\u6253\u56DE\u65B9\u5F0F\uFF1A"),n.a.createElement(ve.a.Group,{value:kn,onChange:function(en){lr(en.target.value)}},n.a.createElement(ve.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(ve.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),kn===1&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u4F4E\u5206\uFF1A"),n.a.createElement(Je.a,{min:0,max:100,value:Ne,onChange:function(en){return ze(en)},style:{width:"100px"}}),n.a.createElement("span",{style:{width:"80px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*"),"\u6700\u9AD8\u5206\uFF1A"),n.a.createElement(Je.a,{min:0,max:100,value:Jr,onChange:function(en){return vi(en)},style:{width:"100px"}})),kn===2&&n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"80px"}},"\u4F5C\u4E1A\u72B6\u6001\uFF1A"),n.a.createElement(ht.a.Group,{onChange:function(en){Fn(Object(xe.a)(en))},style:{width:"100%"}},(Te=Pt.task_status)===null||Te===void 0?void 0:Te.map(function(gn,en){return n.a.createElement(ht.a,{name:"task_status",value:gn.id},gn.name,"(",gn.count,")")}))),n.a.createElement("div",{style:{display:"flex",marginTop:"20px"}},n.a.createElement("span",{style:{width:"70px",textAlign:"end"}},n.a.createElement("span",{style:{color:"red"}},"*")," \u8BC4\u8BED\uFF1A"),n.a.createElement(_e.a,{className:ye.a.MdEditor,onChange:function(en){return ue(en)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(o.a,{visible:Dn,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(m.a)(s.a.mark(function gn(){var en,En;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(!(kn===2)){zt.next=7;break}return zt.next=3,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,status:Rn}});case 3:en=zt.sent,en.status===0&&(f.b.info("\u6253\u56DE\u6210\u529F"),gr(),Vn(),xn(!1)),zt.next=11;break;case 7:return zt.next=9,Object(O.a)("/api/homework_commons/".concat(dt.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:dt.categoryId,comment:ge,min_score:Ne,max_score:Jr}});case 9:En=zt.sent,En.status===0&&(f.b.info("\u6253\u56DE\u6210\u529F"),gr(),Vn(),xn(!1));case 11:case"end":return zt.stop()}},gn)})),onCancel:function(){gr(),xn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},kn===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",Ne,"-",Jr,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),kn===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((rt=Pt.task_status)===null||rt===void 0?void 0:rt.filter(function(gn){return Rn==null?void 0:Rn.includes(gn.id)}).map(function(gn){return gn.name}).toString())+",","\u7684\u5B66\u751F\u8FDB\u884C\u4F5C\u4E1A\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),n.a.createElement("br",null),n.a.createElement("span",null,"\u8BE5\u6761\u4EF6\u4E0B\u5171\u6709",Nt==null?void 0:Nt.count,"\u540D\u5B66\u751F")))),n.a.createElement(pe,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(_.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:Ar,current:dt.page||1,defaultPageSize:20,total:Pt.work_count})))},St=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading,bn=Bn.user;return{shixunHomeworks:_n,loading:Tn.effects,user:bn}})(Ke),nn=D("fOrg"),An=D("+KLJ"),bt=function(_n){var Tn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,group_ids:[]}),Q)),Ce=Object(a.a)(ce,2),Te=Ce[0],rt=Ce[1],Re=Object(T.h)(),Xe=bn.codeReview,it=Object(i.useState)({}),Dt=Object(a.a)(it,2),Tt=Dt[0],Be=Dt[1],_t=Yt.a.useForm(),at=Object(a.a)(_t,1),dt=at[0];Te.order="code_rate",Te.sort="desc",Te.category=Te.categoryId,Object(i.useEffect)(function(){wt(),console.log("params",Te)},[Te]),Object(i.useEffect)(function(){bn.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&wt()},[bn.actionTabs.key]);var wt=function(){var dn=Object(m.a)(s.a.mark(function Pn(){var Gn;return s.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Te)});case 2:Gn=Nn.sent,Gn.status===-2&&setTimeout(function(){return wt()},1500);case 4:case"end":return Nn.stop()}},Pn)}));return function(){return dn.apply(this,arguments)}}(),It=function(){},gt=function(Pn,Gn){Te.page=Pn,Te.limit=20,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Te)})},Xt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(Pn,Gn,Sn){return Te.limit*(Te.page-1)+Sn+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(Pn){return n.a.createElement("span",{className:"c-orange"},Pn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(Pn,Gn){return n.a.createElement("div",null,n.a.createElement(C.a,{target:"_blank",to:"/classrooms/".concat(Te.coursesId,"/program_homework/").concat(Te.categoryId,"/review_detail/").concat(Gn.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(Xe==null?void 0:Xe.status)===-2&&n.a.createElement(An.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(Ve.a,null,n.a.createElement(se.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",Xe.last_review_time,n.a.createElement(M.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){sr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Te}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(se.a,null,n.a.createElement(Ft.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Pn){Te.search=Pn,sr({type:"shixunHomeworks/getCodeReview",payload:Te})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Tn=Xe.group_info)===null||Tn===void 0?void 0:Tn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Ve.a,null,n.a.createElement(se.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(se.a,{flex:"80px"},n.a.createElement(ht.a,{checked:Te.group_ids=="",value:"all",onChange:function(Pn){delete Te.group_ids,Te.group_ids=[],Te.page=1,rt(Object(g.a)({},Te))}},"\u5168\u90E8")),n.a.createElement(se.a,{flex:"1"},Xe.group_info&&Xe.group_info.map(function(dn,Pn){return n.a.createElement(ht.a,{style:{marginLeft:0},value:dn.id,checked:Te.group_ids.includes(dn.id),onChange:function(Sn){Sn.target.checked?Te.group_ids.push(dn.id):Te.group_ids.splice(Te.group_ids.indexOf(dn.id),1),Te.page=1,rt(Object(g.a)({},Te))}},dn.name,"(",dn.members_count,")")}))),n.a.createElement(Ve.a,{className:"font14 c-red mt5"},n.a.createElement(se.a,null,"\u672C\u9875\u4EC5\u663E\u793A\u5168\u90E8\u5DF2\u67E5\u91CD\u5206\u73ED"))),n.a.createElement("p",{className:"mt10"},n.a.createElement("span",{className:"c-red"},Xe.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",Xe.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(V.a,{className:"mt30",loading:ur["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:Xe.users_reviews,columns:Xt,onChange:function(Pn,Gn,Sn){Sn.order==="ascend"&&(Te.b_order="asc"),Sn.order==="descend"&&(Te.b_order="desc"),Sn.order||delete Te.b_order,sr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Te)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(_.a,{showSizeChanger:!1,onChange:gt,defaultCurrent:Te.page||1,current:Te.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:Xe.copy_reviews_count})))},Jt=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn.effects}})(bt),Et=D("OaEy"),Ct=D("2fM7"),st=D("iQDF"),de=D("+eQT"),Ae=D("/MfK"),kt=D("w5pM"),ct=D("Lyp1"),Qt=D("LvDl"),un=D("xb3X"),Le=D.n(un),qe=D("AHFd"),mt=D("eozf"),jt=de.a.RangePicker,sn=Ct.a.Option,yn=function(_n){var Tn,bn,ur,sr,Q,ce,Ce,Te,rt,Re,Xe=_n.shixunHomeworks,it=_n.loading,Dt=_n.dispatch,Tt=Object(T.i)(),Be=Xe.workSetting,_t=Xe.workList,at=Xe.changeData,dt=Object(i.useState)(!0),wt=Object(a.a)(dt,2),It=wt[0],gt=wt[1],Xt=Object(i.useState)(!1),dn=Object(a.a)(Xt,2),Pn=dn[0],Gn=dn[1],Sn=Object(i.useState)([]),Nn=Object(a.a)(Sn,2),Mn=Nn[0],Pt=Nn[1],hn=Object(i.useState)([]),Ht=Object(a.a)(hn,2),Rt=Ht[0],Un=Ht[1],On=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:qe.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,send_type:void 0,difficult_count:[],difficult_settings:[],late_penalty:0}),Vt=Object(a.a)(On,2),ft=Vt[0],jn=Vt[1];Object(i.useEffect)(function(){return fn(),function(){Pt([].concat())}},[]);var fn=function(){Dt({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Tt)})};Object(i.useEffect)(function(){var Lt;if(!(Be!=null&&Be.course_id))return;Object.keys(ft).map(function(Qe){ft[Qe]=Be[Qe]}),(!ft.allow_late||!ft.unified_late)&&(ft.late_minus_score=20,ft.penalty_type=qe.a.Percent),ft.unified_setting||(ft.unified_late=!1,ft.unified_anonymous_comment=!1,ft.unified_anonymous_appeal=!1),Mn=JSON.parse(JSON.stringify(Be.group_settings.map(function(Qe){return Object(g.a)(Object(g.a)({},Qe),{},{group_name:[Qe.group_name]})}).filter(function(Qe){return Qe.publish_time!==null}))),Rt=JSON.parse(JSON.stringify(Be.allow_late_settings.map(function(Qe){return Object(g.a)(Object(g.a)({},Qe),{},{group_name:[Qe.group_name]})}).filter(function(Qe){return Qe.late_time!==null}))),ft.difficult_settings.length===0&&(ft.difficult_settings=[0,0,0]),jn(Object(g.a)({},ft)),Pt(Object(xe.a)(Mn)),((Lt=Rt)===null||Lt===void 0?void 0:Lt.length)<=0?Un([{late_minus_score:20}]):Un(Object(xe.a)(Rt))},[Be]);var Qn=function(){var Qe,Nt=JSON.parse(JSON.stringify(ft));if(Nt.categoryId=Tt.categoryId,ft.unified_setting||(Mn=(Qe=Mn)===null||Qe===void 0?void 0:Qe.map(function(cn){var zn;if(!cn.publish_time||!cn.end_time)throw f.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!cn.group_name)throw f.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return cn.group_name=typeof(cn==null?void 0:cn.group_name)=="string"?[cn==null?void 0:cn.group_name]:cn==null?void 0:cn.group_name,cn.group_id=(zn=Be.group_settings)===null||zn===void 0?void 0:zn.filter(function(kn){var lr;return cn==null||((lr=cn.group_name)===null||lr===void 0)?void 0:lr.includes(kn.group_name)}).map(function(kn){return kn.group_id||kn.id}).toString().split(","),cn})),Nt.group_settings=Mn,ft.allow_late)if(ft.unified_late){if(ft.late_minus_score===null||ft.late_minus_score===void 0||ft.late_minus_score<0||ft.late_minus_score>100)throw f.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!ft.late_time)throw f.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var Mt;Rt=(Mt=Rt)===null||Mt===void 0?void 0:Mt.map(function(cn){var zn,kn;if(cn.late_minus_score===null||cn.late_minus_score===void 0||cn.late_minus_score<0||cn.late_minus_score>100)throw f.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!cn.late_time)throw f.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!cn.group_name)throw f.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return cn.group_name=typeof(cn==null?void 0:cn.group_name)=="string"?[cn==null?void 0:cn.group_name]:cn==null?void 0:cn.group_name,cn.group_id=cn==null||((zn=cn.group_name)===null||zn===void 0||((kn=zn.map(function(lr){var er,Rr,mr=(er=Be.group_settings)===null||er===void 0||((Rr=er.filter(function(xr){return(xr==null?void 0:xr.group_name)===lr}))===null||Rr===void 0)?void 0:Rr[0];return mr==null?void 0:mr.group_id}))===null||kn===void 0))?void 0:kn.toString().split(","),cn}),Nt.allow_late_settings=Rt}Nt.send_type===1&&(Nt.difficult_settings=Nt.difficult_settings.map(function(cn){return cn||0})),Zt(Nt)},Zt=function(Qe){var Nt;if(Qe.total_score===null){f.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Qe!=null&&Qe.work_efficiency&&Qe.eff_score===null){f.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Mt={shixun_evaluation:Qe.shixun_evaluation,challenge_settings:Qe.challenge_settings},cn=function(){var zn=Object(m.a)(s.a.mark(function kn(){var lr;return s.a.wrap(function(Rr){for(;;)switch(Rr.prev=Rr.next){case 0:return Gn(!0),Rr.next=3,Object(O.a)("/api/homework_commons/".concat(Tt.categoryId,"/publish_setting.json"),{method:"post",body:Object(g.a)({},Qe)});case 3:lr=Rr.sent,lr.status===0&&(f.b.success("\u66F4\u65B0\u6210\u529F"),gt(!0),fn(),Dt({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Tt)})),Gn(!1);case 6:case"end":return Rr.stop()}},kn)}));return function(){return zn.apply(this,arguments)}}();!Object(Qt.isEqual)(at,Mt)&&!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))?o.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:cn}):cn()},Rn=function(Qe,Nt){var Mt,cn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Nt?Nt.find(function(zn){return zn[cn]===Qe}):Be==null||((Mt=Be.group_settings)===null||Mt===void 0)?void 0:Mt.find(function(zn){return zn.group_id[0]===Qe})},Fn=(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.anonymous_comment),vn=function(Qe){var Nt=Rn(Qe,Be==null?void 0:Be.allow_late_settings,"id"),Mt=Rn(Qe,Be==null?void 0:Be.anonymous_comment_settings);return(Be==null?void 0:Be.allow_late)&&Nt&&(Nt==null?void 0:Nt.late_time)!==null||(Be==null?void 0:Be.anonymous_comment)&&Mt&&(Mt==null?void 0:Mt.evaluation_start)!==null},yr=Object(i.useMemo)(function(){var Lt;if(Be!=null&&Be.unified_setting){var Qe;return!(_t!=null&&(Qe=_t.homework_status)!==null&&Qe!==void 0&&Qe.includes("\u5DF2\u622A\u6B62"))||(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.anonymous_comment)}var Nt=Be==null||((Lt=Be.group_settings)===null||Lt===void 0)?void 0:Lt.some(function(Mt){return H()(Mt.end_time)<=H()()});return!Nt||(Be==null?void 0:Be.allow_late)||(Be==null?void 0:Be.all_group_late)},[Be,_t]),Dn=Be==null?void 0:Be.anonymous_comment,xn=function(Qe){if(!Qe)return!1;var Nt=Rn(Qe,Be==null?void 0:Be.anonymous_comment_settings);return(Be==null?void 0:Be.anonymous_comment)&&Nt&&(Nt==null?void 0:Nt.evaluation_start)!==null};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(se.a,{flex:"1"},n.a.createElement("div",{className:Le.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(se.a,null,Object(Y.c)()&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return gt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(ve.a.Group,{disabled:It||!(_t!=null&&(Tn=_t.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),value:ft.send_type,onChange:function(Qe){ft.send_type=Qe.target.value,jn(Object.assign({},ft))}},n.a.createElement(ve.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(ve.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),ft.send_type===1&&n.a.createElement(Ve.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(se.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:It||!(_t!=null&&(bn=_t.homework_status)!==null&&bn!==void 0&&bn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ft.difficult_count[0]||0),min:0,max:ft.difficult_count[0]||0,value:ft.difficult_settings[0],onChange:function(Qe){ft.difficult_settings[0]=Qe,jn(Object.assign({},ft))},className:"ml10 mr20"})),n.a.createElement(se.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:It||!(_t!=null&&(ur=_t.homework_status)!==null&&ur!==void 0&&ur.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ft.difficult_count[1]||0),min:0,max:ft.difficult_count[1]||0,value:ft.difficult_settings[1],onChange:function(Qe){ft.difficult_settings[1]=Qe,jn(Object.assign({},ft))},className:"ml10 mr20"})),n.a.createElement(se.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement(Je.a,{precision:0,disabled:It||!(_t!=null&&(sr=_t.homework_status)!==null&&sr!==void 0&&sr.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(ft.difficult_count[2]||0),min:0,max:ft.difficult_count[2]||0,value:ft.difficult_settings[2],onChange:function(Qe){ft.difficult_settings[2]=Qe,jn(Object.assign({},ft))},className:"ml10 mr20"})))),n.a.createElement("div",{className:"mt30"},n.a.createElement("h1",{className:"mb10"},"\u53D1\u5E03\u8BBE\u7F6E"),n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(ve.a.Group,{disabled:It||!(_t!=null&&(Q=_t.homework_status)!==null&&Q!==void 0&&Q.includes("\u672A\u53D1\u5E03")),value:ft.unified_setting,onChange:function(Qe){var Nt;if(!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))){f.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(ft.unified_setting=!ft.unified_setting,ft.unified_setting||(ft.unified_late=!1),jn(Object.assign({},ft)),ft.unified_setting===!1&&Mn==""){Pt(Mn.concat({}));return}ft.unified_setting&&(Pt([]),Un([{late_minus_score:5}]))}},n.a.createElement(ve.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(ve.a,{className:"ml20",disabled:(Be==null||((ce=Be.group_settings)===null||ce===void 0)?void 0:ce.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Be==null||((Ce=Be.group_settings)===null||Ce===void 0)?void 0:Ce.length)===0&&n.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09")),ft.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(se.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(se.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(Qe){return Object(mt.b)(Qe,Be==null?void 0:Be.course_end_date)},disabledTime:function(Qe){return Object(mt.c)(Qe)},disabled:It||!(_t!=null&&(Te=_t.homework_status)!==null&&Te!==void 0&&Te.includes("\u672A\u53D1\u5E03")),value:ft.publish_time?H()(ft.publish_time):"",onChange:function(Qe,Nt){ft.publish_time=Nt,(ft.end_time==""||!ft.end_time)&&ft.unified_setting&&(ft.end_time=H()(Qe).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),jn(Object.assign({},ft))}})),n.a.createElement(se.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(se.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(se.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:It||Fn,disabledDate:function(Qe){return Object(mt.b)(Qe,Be==null?void 0:Be.course_end_date,ft.publish_time)},disabledTime:function(Qe){return Object(mt.c)(Qe,ft.publish_time)},value:ft.end_time?H()(ft.end_time):"",onChange:function(Qe,Nt){ft.end_time=Nt,jn(Object.assign({},ft))}})),n.a.createElement(se.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!ft.unified_setting&&((rt=Mn)===null||rt===void 0?void 0:rt.length)>0&&n.a.createElement(Ve.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(se.a,{span:24},n.a.createElement(Ve.a,null,n.a.createElement(se.a,{span:10}),n.a.createElement(se.a,{span:10},n.a.createElement(Ve.a,{className:"c-grey-c ml30"},n.a.createElement(se.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(se.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(se.a,{span:4}))),Mn&&Mn.map(function(Lt,Qe){var Nt,Mt,cn,zn,kn;return n.a.createElement(se.a,{span:24,key:Qe},n.a.createElement(Ve.a,{gutter:[8,16]},n.a.createElement(se.a,{span:10},n.a.createElement(Ve.a,{gutter:[8,16]},n.a.createElement(se.a,null,"\u53D1\u5E03\u89C4\u5219 ",Qe+1),n.a.createElement(se.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(Ct.a,{disabled:It||!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))&&Lt.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Lt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(er){Mn[Qe].group_name=er,Mn[Qe].group_id=Lt.group_id;var Rr=Object(Qt.flattenDeep)(Mn.map(function(xr){return xr.group_name})),mr=Rt.map(function(xr){var Zr=(xr==null?void 0:xr.group_name)||[];return Object(g.a)(Object(g.a)({},xr),{},{group_name:Object(Qt.remove)(Zr,function(Yr){return Rr.includes(Yr)})})});Un(mr),Pt(Mn.slice())}},Be.group_settings&&Be.group_settings.map(function(lr){if(!Mn.map(function(er){return er.group_name}).toString().split(",").includes(String(lr.group_name)))return n.a.createElement(sn,{value:lr.group_name,key:lr.id},lr.group_name)}))))),n.a.createElement(se.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(jt,{allowClear:!1,ranges:{\u6B64\u523B:[Lt.publish_time?H()(Lt.publish_time):H()(),H()()]},disabled:It||(H()()<=H()((Mt=Rn((cn=Lt.group_id)===null||cn===void 0?void 0:cn[0]))===null||Mt===void 0?void 0:Mt.publish_time)?!1:[!0,vn((zn=Lt.group_id)===null||zn===void 0?void 0:zn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(er){return Object(mt.b)(er,Be==null?void 0:Be.course_end_date)},disabledTime:function(er){return Object(mt.c)(er)},showTime:{format:"HH:mm",defaultValue:[H()(Object(v.d)(),"HH:mm"),H()(Object(v.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Lt.publish_time&&[H()(Lt.publish_time),Lt.end_time?H()(Lt.end_time):void 0],onChange:function(er,Rr){Mn[Qe].publish_time=Rr[0],Mn[Qe].end_time=Rr[1],Pt(Object(xe.a)(Mn))}}))),!It&&n.a.createElement(se.a,{span:4},Qe>0&&!Lt.id&&n.a.createElement(Ae.a,{onClick:function(){Mn=Mn.filter(function(er,Rr){return Qe!==Rr}),Pt(Mn.slice()),setTimeout(function(){return Pt(Mn.slice())},10)}}),Mn.length<(Be==null||((kn=Be.group_settings)===null||kn===void 0)?void 0:kn.length)&&n.a.createElement(kt.a,{className:"c-green ml20",onClick:function(){Pt(Mn.concat({}))}}))))})),n.a.createElement(Ve.a,{className:"mt30"},n.a.createElement(se.a,null,n.a.createElement(Ve.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(I.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},n.a.createElement(ct.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(se.a,{span:24,className:"mt10"},n.a.createElement(ht.a,{checked:ft.allow_late,disabled:It||yr,onChange:function(){ft.allow_late=!ft.allow_late,Rt==""&&Un([{late_minus_score:5}]),jn(Object.assign({},ft))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(I.a,{overlayStyle:{width:380,maxWidth:380},title:n.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),n.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},n.a.createElement(ct.a,null)))),(ft==null?void 0:ft.allow_late)&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement("div",{className:"ml30 mt20",style:{marginLeft:50}},n.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),n.a.createElement(ve.a.Group,{disabled:It||(Be==null?void 0:Be.anonymous_comment)||(Be==null?void 0:Be.allow_late),value:ft.unified_late,onChange:function(Qe){ft.unified_late=Qe.target.value,Rt==""&&!Qe.target.value&&Un([{late_minus_score:5}]),jn(Object(g.a)({},ft))}},(ft==null?void 0:ft.unified_setting)&&n.a.createElement(ve.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Be==null||((Re=Be.group_settings)===null||Re===void 0)?void 0:Re.length)&&n.a.createElement(ve.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),ft!=null&&ft.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(se.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(se.a,{className:"ml5"},n.a.createElement(qe.b,{disabled:It||Dn,value:{type:ft.penalty_type,inputValue:ft.late_minus_score},onChange:function(Qe){jn(Object(g.a)(Object(g.a)({},ft),{},{late_minus_score:Qe.inputValue,penalty_type:Qe.type}))}})),n.a.createElement(se.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},ft.penalty_type===qe.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),n.a.createElement(Ve.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(se.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(se.a,{className:"ml5"},n.a.createElement(de.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:It||Dn,value:ft.late_time?H()(ft.late_time):"",disabledDate:function(Qe){return Object(mt.b)(Qe,Be==null?void 0:Be.course_end_date)},disabledTime:function(Qe){return Object(mt.c)(Qe)},onChange:function(Qe,Nt){ft.late_time=Nt,jn(Object.assign({},ft))}})),n.a.createElement(se.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Rt.map(function(Lt,Qe){var Nt;return n.a.createElement(se.a,{span:24,key:Qe},n.a.createElement(Ve.a,{className:"mt25"},n.a.createElement(se.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Qe+1,"\uFF1A"),n.a.createElement(Ct.a,{disabled:It||!(_t!=null&&(Nt=_t.homework_status)!==null&&Nt!==void 0&&Nt.includes("\u672A\u53D1\u5E03"))&&Lt.id||(Be==null?void 0:Be.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Lt.group_name=="string"?[Lt.group_name]:Lt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(cn){Rt[Qe].group_name=cn,Rt[Qe].group_id=Lt.group_id,Un(Rt.slice())}},Be.group_settings&&Be.group_settings.map(function(Mt){if(ft!=null&&ft.unified_setting&&!Rt.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name)))return n.a.createElement(sn,{value:Mt.group_name,key:Mt.id},Mt.group_name);if(Mn.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name))&&(!Rt.map(function(cn){return cn.group_name}).toString().split(",").includes(String(Mt.group_name))&&H()(Mt.end_time)<=H()()))return n.a.createElement(sn,{value:Mt.group_name,key:Mt.id},Mt.group_name)}))),n.a.createElement(se.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(qe.b,{disabled:It||xn(Lt.id),value:{type:Lt.penalty_type,inputValue:Lt.late_minus_score},onChange:function(cn){Rt[Qe].late_minus_score=cn.inputValue,Rt[Qe].penalty_type=cn.type,Un(Object(xe.a)(Rt))}})),n.a.createElement(se.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(de.a,{disabled:It||xn(Lt.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(cn){return Object(mt.b)(cn,Be==null?void 0:Be.course_end_date)},disabledTime:function(cn){return Object(mt.c)(cn)},format:"YYYY-MM-DD HH:mm",value:Lt!=null&&Lt.late_time?H()(Lt.late_time):void 0,onChange:function(cn,zn){Rt[Qe].late_time=zn,Un(Object(xe.a)(Rt))}})),!It&&n.a.createElement(se.a,{className:"ml20"},Qe>0&&!Lt.id&&n.a.createElement(Ae.a,{onClick:function(){Rt=Rt.filter(function(cn,zn){return Qe!==zn}),Un(Rt.slice()),setTimeout(function(){return Un(Rt.slice())},10)}}),n.a.createElement(kt.a,{className:"c-green ml20",onClick:function(){Un(Rt.concat({penalty_type:qe.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!It&&n.a.createElement("div",{className:Le.a.btns},n.a.createElement(M.a,{type:"primary",loading:Pn,onClick:function(){return Qn()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){gt(!0),fn()}},"\u53D6\u6D88")))},nr=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn.effects}})(yn);function Kn(Bn,_n){for(var Tn=[],bn=Bn;bn<_n;bn++)Tn.push(bn);return Tn}var wn=function(_n){var Tn=new Date,bn=H()(_n).format("HH");if(H()(_n).isSame(H()(Tn),"day")){var ur=H()(Tn).format("HH"),sr=H()(Tn).format("mm");return{disabledHours:function(){return Kn(0,24).splice(1,ur*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",bn,ur),H()(_n).isSame(H()(Tn),"hour")&&bn<=ur?Kn(0,60).splice(0,sr):Kn(60,60)}}}else if(H()(_n).isSame(H()(),"day")){var Q=H()().format("HH"),ce=H()().format("mm");return{disabledHours:function(){return Kn(0,24).splice(0,Q)},disabledMinutes:function(){return bn<=Q?Kn(0,ce):Kn(60,60)}}}else return},br=de.a.RangePicker,Er=Ct.a.Option,rr=function(_n){var Tn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=Object(T.h)(),Ce=bn.workSetting,Te=bn.workList,rt=bn.changeData,Re=Object(i.useState)(!0),Xe=Object(a.a)(Re,2),it=Xe[0],Dt=Xe[1],Tt=Object(i.useState)({}),Be=Object(a.a)(Tt,2),_t=Be[0],at=Be[1],dt=Object(i.useState)(!1),wt=Object(a.a)(dt,2),It=wt[0],gt=wt[1],Xt=Yt.a.useForm(),dn=Object(a.a)(Xt,1),Pn=dn[0],Gn=Object(i.useState)([]),Sn=Object(a.a)(Gn,2),Nn=Sn[0],Mn=Sn[1],Pt=Object(i.useState)([]),hn=Object(a.a)(Pt,2),Ht=hn[0],Rt=hn[1],Un=Object(i.useState)(!1),On=Object(a.a)(Un,2),Vt=On[0],ft=On[1],jn=Object(i.useState)([]),fn=Object(a.a)(jn,2),Qn=fn[0],Zt=fn[1],Rn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,open_code:!1,rank_forbidden:!1,open_code_type:void 0,comment_public:!0,total_score:"",eff_score:0,rank_forbidden_start:"",rank_forbidden_end:""}),Fn=Object(a.a)(Rn,2),vn=Fn[0],yr=Fn[1];Object(i.useEffect)(function(){return Dn(),function(){Mn([].concat())}},[]);var Dn=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Q)})},xn=function(Mt){return Mt&&Mt<H()().startOf("day")};Object(i.useEffect)(function(){var Nt;if(!(Ce!=null&&Ce.course_id))return;Object.keys(vn).map(function(Mt){vn[Mt]=Ce[Mt]}),(!vn.allow_late||!vn.unified_late)&&(vn.late_penalty=5),Nn=JSON.parse(JSON.stringify(Ce.group_settings.map(function(Mt){return Object(g.a)(Object(g.a)({},Mt),{},{group_name:[Mt.group_name]})}).filter(function(Mt){return Mt.publish_time!==null}))),Ht=JSON.parse(JSON.stringify(Ce.allow_late_settings.map(function(Mt){return Object(g.a)(Object(g.a)({},Mt),{},{group_name:[Mt.group_name]})}).filter(function(Mt){return Mt.rank_forbidden_start!==null}))),yr(Object(g.a)({},vn)),Mn(Object(xe.a)(Nn)),((Nt=Ht)===null||Nt===void 0?void 0:Nt.length)<=0?Rt([{}]):Rt(Object(xe.a)(Ht))},[Ce]),console.log(vn,"data");var Lt=function(){var Mt,cn=JSON.parse(JSON.stringify(vn));if(cn.categoryId=Q.categoryId,vn.unified_setting||(Nn=(Mt=Nn)===null||Mt===void 0?void 0:Mt.map(function(kn){var lr;if(!kn.publish_time||!kn.end_time)throw f.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.group_name)throw f.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return kn.group_name=typeof(kn==null?void 0:kn.group_name)=="string"?[kn==null?void 0:kn.group_name]:kn==null?void 0:kn.group_name,kn.group_id=(lr=Ce.group_settings)===null||lr===void 0?void 0:lr.filter(function(er){var Rr;return kn==null||((Rr=kn.group_name)===null||Rr===void 0)?void 0:Rr.includes(er.group_name)}).map(function(er){return er.group_id||er.id}).toString().split(","),kn})),cn.group_settings=Nn,vn.rank_forbidden)if(vn.unified_setting){if(!vn.rank_forbidden_start)throw f.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!vn.rank_forbidden_end)throw f.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(H()(vn.rank_forbidden_end)<H()(vn.rank_forbidden_start))throw f.b.error("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4"),new String("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u65E9\u4E8E\u5F00\u59CB\u65F6\u95F4")}else{var zn;Ht=(zn=Ht)===null||zn===void 0?void 0:zn.map(function(kn){var lr,er;if(!kn.rank_forbidden_start)throw f.b.error("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u5F00\u59CB\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.rank_forbidden_end)throw f.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!kn.group_name)throw f.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return kn.group_name=typeof(kn==null?void 0:kn.group_name)=="string"?[kn==null?void 0:kn.group_name]:kn==null?void 0:kn.group_name,kn.group_id=kn==null||((lr=kn.group_name)===null||lr===void 0||((er=lr.map(function(Rr){var mr,xr,Zr=(mr=Ce.group_settings)===null||mr===void 0||((xr=mr.filter(function(Yr){return(Yr==null?void 0:Yr.group_name)===Rr}))===null||xr===void 0)?void 0:xr[0];return Zr==null?void 0:Zr.group_id}))===null||er===void 0))?void 0:er.toString().split(","),kn}),cn.group_settingss=Ht}Qe(cn)},Qe=function(Mt){if(console.log(Mt.total_score,Mt.eff_score),Mt.total_score===null){f.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Mt!=null&&Mt.work_efficiency&&Mt.eff_score===null){f.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var cn={shixun_evaluation:Mt.shixun_evaluation},zn=function(){var kn=Object(m.a)(s.a.mark(function lr(){var er;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:return gt(!0),mr.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/public_setting.json"),{method:"post",body:Object(g.a)({},Mt)});case 3:er=mr.sent,er.status===0&&(f.b.success("\u66F4\u65B0\u6210\u529F"),Dt(!0),Dn(),sr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Q)})),gt(!1);case 6:case"end":return mr.stop()}},lr)}));return function(){return kn.apply(this,arguments)}}();zn()};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(se.a,{flex:"1"},n.a.createElement("div",{className:Le.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(se.a,null,(Ce==null?void 0:Ce.can_edit)&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Dt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(Ve.a,null,n.a.createElement(se.a,{span:24,className:"mt15 mt20"},n.a.createElement(ht.a,{checked:vn.score_open,disabled:it,onChange:function(Mt){vn.score_open=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u6210\u7EE9")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5219\u5728\u4F5C\u4E1A\u622A\u6B62/\u8865\u4EA4\u7ED3\u675F\u65F6\u95F4\u4E4B\u540E\uFF0C\u5DF2\u63D0\u4EA4\u4F5C\u54C1\u7684\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u5B83\u5B66\u751F\u7684\u6210\u7EE9\uFF0C\u5426\u5219\u53EA\u80FD\u67E5\u770B\u81EA\u5DF1\u7684\u6210\u7EE9)")),n.a.createElement(se.a,{span:24,className:"mt15"},n.a.createElement(ht.a,{checked:vn.open_code,disabled:it,onChange:function(Mt){vn.open_code=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u516C\u5F00\u4EE3\u7801")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\uFF0C\u5B66\u751F\u53EF\u4EE5\u67E5\u770B\u5176\u4ED6\u5B66\u751F\u7684\u4EE3\u7801\u8BE6\u60C5)")),!!vn.open_code&&n.a.createElement(se.a,{span:24,className:"mt10 ml25"},n.a.createElement(ve.a.Group,{disabled:it,value:vn.open_code_type,onChange:function(Mt){vn.open_code_type=Mt.target.value,yr(Object.assign({},vn))}},n.a.createElement(ve.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(ve.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(se.a,{span:24,className:"mt15 mt20"},n.a.createElement(ht.a,{checked:vn.rank_forbidden,disabled:it,onChange:function(Mt){vn.rank_forbidden=Mt.target.checked,yr(Object.assign({},vn))}},n.a.createElement("span",{className:"font14"},"\u5F00\u542F\u5C01\u699C")),n.a.createElement("span",{className:"c-grey-c font12"},"(\u9009\u4E2D\u5219\u5728\u8BBE\u7F6E\u7684\u8FD9\u6BB5\u65F6\u95F4\u5185\uFF0C\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u4FE1\u606F\uFF0C\u5176\u4ED6\u65F6\u95F4\u53EF\u4EE5\u67E5\u770B)")),!!vn.rank_forbidden&&vn.unified_setting&&n.a.createElement(se.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(Ve.a,{align:"middle",className:"mt25 "},n.a.createElement(se.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(se.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:xn,disabledTime:wn,disabled:it||H()()>H()(Ce.rank_forbidden_start),value:vn.rank_forbidden_start?H()(vn.rank_forbidden_start):"",onChange:function(Mt,cn){vn.rank_forbidden_start=cn,(vn.end_time==""||!vn.end_time)&&vn.unified_setting&&(vn.end_time=H()(Mt).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),yr(Object.assign({},vn))}})),n.a.createElement(se.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"))),n.a.createElement(Ve.a,{align:"middle",className:"mt25"},n.a.createElement(se.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(se.a,{className:"ml10"},n.a.createElement(de.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:H()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:it,disabledDate:xn,value:vn.rank_forbidden_end?H()(vn.rank_forbidden_end):"",onChange:function(Mt,cn){vn.rank_forbidden_end=cn,yr(Object.assign({},vn))}})),n.a.createElement(se.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))))),console.log("----",Nn),!vn.unified_setting&&((Tn=Nn)===null||Tn===void 0?void 0:Tn.length)>0&&!!vn.rank_forbidden&&n.a.createElement(Ve.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(se.a,{span:24},n.a.createElement(Ve.a,null,n.a.createElement(se.a,{span:10}),n.a.createElement(se.a,{span:10},n.a.createElement(Ve.a,{className:"c-grey-c ml30"},n.a.createElement(se.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(se.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(se.a,{span:4}))),Ht.map(function(Nt,Mt){var cn,zn,kn,lr,er,Rr,mr;return n.a.createElement(se.a,{span:24,key:Mt},n.a.createElement(Ve.a,{className:"mt25"},n.a.createElement(se.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",Mt+1,"\uFF1A"),n.a.createElement(Ct.a,{disabled:it||!(Te!=null&&(cn=Te.homework_status)!==null&&cn!==void 0&&cn.includes("\u672A\u53D1\u5E03"))&&Nt.id,mode:"multiple",style:{width:306},value:typeof Nt.group_name=="string"?[Nt.group_name]:Nt.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Zr){Ht[Mt].group_name=Zr,Ht[Mt].group_id=Nt.group_id,Rt(Ht.slice())}},Ce.group_settings&&Ce.group_settings.map(function(xr){if(vn!=null&&vn.unified_setting&&!Ht.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(xr.group_name)))return n.a.createElement(Er,{value:xr.group_name,key:xr.id},xr.group_name);if(Nn.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(xr.group_name))&&!Ht.map(function(Zr){return Zr.group_name}).toString().split(",").includes(String(xr.group_name)))return n.a.createElement(Er,{value:xr.group_name,key:xr.id},xr.group_name)}))),n.a.createElement(se.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(br,{allowClear:!1,disabled:it||(Ce!=null&&(zn=Ce.group_settings)!==null&&zn!==void 0&&(kn=zn.filter(function(xr){return xr.id===Nt.id}))!==null&&kn!==void 0&&(lr=kn[0])!==null&&lr!==void 0&&lr.rank_forbidden_start?H()()<H()(Ce==null||((er=Ce.group_settings)===null||er===void 0||((Rr=er.filter(function(xr){return xr.id===Nt.id}))===null||Rr===void 0||((mr=Rr[0])===null||mr===void 0)))?void 0:mr.rank_forbidden_start)?!1:[!0,!1]:!1),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4","\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4"],disabledDate:xn,disabledTime:wn,showTime:{format:"HH:mm",defaultValue:[H()(Object(v.d)(),"HH:mm"),H()(Object(v.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Nt.rank_forbidden_start&&[H()(Nt.rank_forbidden_start),Nt.rank_forbidden_end?H()(Nt.rank_forbidden_end):void 0],onChange:function(Zr,Yr){Ht[Mt].rank_forbidden_start=Yr[0],Ht[Mt].rank_forbidden_end=Yr[1],Rt(Object(xe.a)(Ht))}}))),!it&&n.a.createElement(se.a,{className:"ml20"},Mt>0&&!Nt.id&&n.a.createElement(Ae.a,{onClick:function(){Ht=Ht.filter(function(Zr,Yr){return Mt!==Yr}),Rt(Ht.slice()),setTimeout(function(){return Rt(Ht.slice())},10)}}),n.a.createElement(kt.a,{className:"c-green ml20",onClick:function(){Rt(Ht.concat({}))}}))))})),!it&&n.a.createElement("div",{className:Le.a.btns},n.a.createElement(M.a,{type:"primary",loading:It,onClick:function(){return Lt()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){Dt(!0),Dn()}},"\u53D6\u6D88"))),n.a.createElement(o.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Vt,onCancel:function(){return ft(!1)}},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Ft.a.Search,{onChange:function(Mt){}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(Mt,cn){Zt(Mt)}},pagination:!1,dataSource:[{name:"1"}],columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]}))))},cr=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn.effects}})(rr),Pr=function(_n){var Tn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=bn.workSetting,Ce=bn.workList,Te=bn.changeData,rt=Object(i.useState)(!0),Re=Object(a.a)(rt,2),Xe=Re[0],it=Re[1],Dt=Object(i.useState)(!1),Tt=Object(a.a)(Dt,2),Be=Tt[0],_t=Tt[1],at=Object(i.useState)(!1),dt=Object(a.a)(at,2),wt=dt[0],It=dt[1],gt=Yt.a.useForm(),Xt=Object(a.a)(gt,1),dn=Xt[0],Pn=Object(i.useState)([]),Gn=Object(a.a)(Pn,2),Sn=Gn[0],Nn=Gn[1],Mn=Object(i.useState)([]),Pt=Object(a.a)(Mn,2),hn=Pt[0],Ht=Pt[1],Rt=!(Ce!=null&&(Tn=Ce.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),Un=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0,is_onpage_time:!0,training_time_rules:1,hack_settings:[],punish_time:void 0,hack_score_settings:void 0}),On=Object(a.a)(Un,2),Vt=On[0],ft=On[1];Object(i.useEffect)(function(){return jn(),function(){Nn([].concat())}},[]);var jn=function(){sr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},Q)})};Object(i.useEffect)(function(){if(!(ce!=null&&ce.course_id))return;Object.keys(Vt).map(function(Rn){Vt[Rn]=ce[Rn]}),(!Vt.allow_late||!Vt.unified_late)&&(Vt.late_penalty=5),Sn=JSON.parse(JSON.stringify(ce.group_settings.map(function(Rn){return Object(g.a)(Object(g.a)({},Rn),{},{group_name:[Rn.group_name]})}).filter(function(Rn){return Rn.publish_time!==null}))),hn=JSON.parse(JSON.stringify(ce.allow_late_settings.map(function(Rn){return Object(g.a)(Object(g.a)({},Rn),{},{group_name:[Rn.group_name]})}).filter(function(Rn){return Rn.late_time!==null}))),Zt(),ft(Object(g.a)({},Vt)),Nn(Object(xe.a)(Sn)),Ht(Object(xe.a)(hn))},[ce]);var fn=function(){var Fn=JSON.parse(JSON.stringify(Vt));Qn(Fn)},Qn=function(Fn){if(console.log(Fn.total_score,Fn.eff_score),Fn.total_score===null){f.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var vn=function(){var yr=Object(m.a)(s.a.mark(function Dn(){var xn;return s.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return _t(!0),Qe.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(g.a)({},Fn)});case 3:xn=Qe.sent,xn.status===0&&(f.b.success("\u66F4\u65B0\u6210\u529F"),it(!0),jn(),sr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Q)})),_t(!1);case 6:case"end":return Qe.stop()}},Dn)}));return function(){return yr.apply(this,arguments)}}();(Vt==null?void 0:Vt.hack_score_settings)!==(ce==null?void 0:ce.hack_score_settings)&&Rt?o.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:vn}):vn()},Zt=function(){var Fn,vn=Vt.total_score,yr=(Fn=Vt.hack_settings)===null||Fn===void 0?void 0:Fn.length,Dn=0,xn;switch(Vt.hack_score_settings){case 0:var Lt=(vn/yr).toFixed(2);Vt.hack_settings.map(function(er,Rr){Dn=Rr,er.hack_score=Lt>0?Lt:0}),xn=(vn-Lt*(yr-1)).toFixed(2),Vt.hack_settings[Dn].hack_score=xn>0?xn:0;break;case 1:var Qe=[0,1,3,6],Nt=0,Mt=Vt.hack_settings.filter(function(er){return er.difficult===1}).length*Qe[1],cn=Vt.hack_settings.filter(function(er){return er.difficult===2}).length*Qe[2],zn=Vt.hack_settings.filter(function(er){return er.difficult===3}).length*Qe[3],kn=vn/(Mt+cn+zn);console.log(kn,2222),Vt.hack_settings.map(function(er,Rr){Dn=Rr,er.hack_score=(Qe[er.difficult]*kn).toFixed(2),Nt=Nt+Number(er.hack_score)});var lr=Vt.hack_settings[Dn].hack_score;xn=(vn-Nt+Number(lr)).toFixed(2),Vt.hack_settings[Dn].hack_score=xn>0?xn:0;break}};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(se.a,{flex:"1"}),n.a.createElement(se.a,null,(ce==null?void 0:ce.can_edit)&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return it(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(Ve.a,{align:"middle"},n.a.createElement(se.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement(Je.a,{min:0,className:"ml10 mr10",style:{width:160},value:Vt.total_score,disabled:Xe||Rt,onChange:function(Fn){Vt.total_score=Fn,ft(Object.assign({},Vt)),Zt()}}),"\xA0\u5206"),n.a.createElement(se.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement(Je.a,{className:"ml10 mr10",style:{width:160},min:0,value:Vt.punish_time,precision:0,disabled:Xe,onChange:function(Fn){Vt.punish_time=Fn,ft(Object.assign({},Vt)),Zt()}}),"\xA0\u5206\u949F")),n.a.createElement(Ve.a,{align:"middle",style:{marginTop:20}},n.a.createElement(se.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(se.a,{flex:"1"},n.a.createElement(Yt.a.Item,{className:"ml20"},n.a.createElement(ve.a.Group,{disabled:Xe||Rt,value:Vt.hack_score_settings,onChange:function(Fn){Vt.hack_score_settings=Fn.target.value,ft(Object.assign({},Vt)),Zt()}},n.a.createElement(ve.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(ve.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(ve.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:Le.a.hackList},Vt.hack_settings&&Vt.hack_settings.map(function(Rn,Fn){return n.a.createElement(Ve.a,{key:Fn,align:"middle",style:{marginTop:20}},n.a.createElement(se.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,Rn.hack_name)),n.a.createElement(se.a,{flex:"150px"},n.a.createElement(Je.a,{min:0,step:.1,value:Rn.hack_score,disabled:Xe||Vt.hack_score_settings!==2||Rt,onChange:function(yr){Vt.hack_settings[Fn].hack_score=yr;var Dn=Vt.hack_settings.reduce(function(xn,Lt){return xn+Number(Lt.hack_score)},0);Vt.total_score=Dn.toFixed(2),ft(Object(g.a)({},Vt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(se.a,{style:{lineHeight:"20px"}},Rn.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),Rn.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),Rn.difficult===3&&n.a.createElement("span",{className:"tag-style-border-small bg-orange c-white mr10"},"\u56F0\u96BE")))})),n.a.createElement("div",{style:{height:100}}),!Xe&&n.a.createElement("div",{className:Le.a.btns},n.a.createElement(M.a,{type:"primary",loading:Be,onClick:function(){return fn()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){it(!0),jn()}},"\u53D6\u6D88")))},Kr=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn.effects}})(Pr),hi=function(_n){var Tn,bn,ur=_n.shixunHomeworks,sr=_n.loading,Q=_n.dispatch,ce=Object(i.useState)(!0),Ce=Object(a.a)(ce,2),Te=Ce[0],rt=Ce[1],Re=Object(i.useState)(!1),Xe=Object(a.a)(Re,2),it=Xe[0],Dt=Xe[1],Tt=Object(i.useState)([]),Be=Object(a.a)(Tt,2),_t=Be[0],at=Be[1],dt=Object(i.useState)([]),wt=Object(a.a)(dt,2),It=wt[0],gt=wt[1],Xt=Object(i.useState)([]),dn=Object(a.a)(Xt,2),Pn=dn[0],Gn=dn[1],Sn=Object(i.useState)([]),Nn=Object(a.a)(Sn,2),Mn=Nn[0],Pt=Nn[1],hn=Object(T.i)();function Ht(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(m.a)(s.a.mark(function ft(){var jn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(O.a)("/api/homework_commons/".concat(hn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:jn=Qn.sent,gt(jn);case 4:case"end":return Qn.stop()}},ft)})),Rt.apply(this,arguments)}function Un(){return On.apply(this,arguments)}function On(){return On=Object(m.a)(s.a.mark(function ft(){var jn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(O.a)("/api/courses/".concat(hn==null?void 0:hn.coursesId,"/teachers"),{method:"get",params:{homework_id:hn.categoryId}});case 2:jn=Qn.sent,jn==null||jn.teacher_list.map(function(Zt){Zt.key=Zt.user_id}),Gn(jn==null?void 0:jn.teacher_list),Pt(jn==null?void 0:jn.teacher_list);case 6:case"end":return Qn.stop()}},ft)})),On.apply(this,arguments)}Object(i.useEffect)(function(){Ht(),Un()},[hn]);var Vt=function(){};return n.a.createElement("section",{className:Le.a.form},n.a.createElement(Ve.a,null,n.a.createElement(se.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(It==null?void 0:It.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){Dt(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(Ve.a,{style:{marginTop:"20px",marginBottom:"20px"}},(It==null||((Tn=It.data)===null||Tn===void 0)?void 0:Tn.length)<=0&&n.a.createElement(q.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),It==null||((bn=It.data)===null||bn===void 0)?void 0:bn.map(function(ft){return n.a.createElement("span",{style:{display:"inline-flex",height:"40px",borderRadius:"4px",border:"1px solid #44D7B6",padding:"7px 20px",color:"#44D7B6",marginRight:"40px"}},n.a.createElement("span",{style:{flex:"1"}},ft==null?void 0:ft.real_name),(It==null?void 0:It.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(m.a)(s.a.mark(function jn(){var fn;return s.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(O.a)("/api/homework_commons/".concat(hn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:ft.id}});case 2:fn=Zt.sent,fn.status===0&&(f.b.info("\u5220\u9664\u6210\u529F"),Ht(),Un());case 4:case"end":return Zt.stop()}},jn)}))},"X"))})),n.a.createElement(Ve.a,null,!Te&&n.a.createElement(se.a,{className:"mb50"},n.a.createElement(M.a,{type:"primary",size:"large",onClick:function(){return Vt()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){rt(!0)}},"\u53D6\u6D88"))),n.a.createElement(o.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:it,onCancel:function(){return Dt(!1)},onOk:Object(m.a)(s.a.mark(function ft(){var jn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:if(!(_t.length===0)){Qn.next=3;break}return f.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Qn.abrupt("return");case 3:return Qn.next=5,Object(O.a)("/api/homework_commons/".concat(hn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:_t}});case 5:jn=Qn.sent,jn.status===0&&(f.b.info("\u6DFB\u52A0\u6210\u529F"),at([]),Ht(),Un(),Dt(!1));case 7:case"end":return Qn.stop()}},ft)}))},n.a.createElement("div",null,n.a.createElement("div",{style:{display:"flex"}},n.a.createElement("label",{style:{width:"50px"}},"\u59D3\u540D\uFF1A")," ",n.a.createElement(Ft.a.Search,{onChange:function(jn){Gn(Mn.filter(function(fn){return fn.name.indexOf(jn.target.value)>-1}))}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(jn,fn){at(jn)},selectedRowKeys:_t,getCheckboxProps:function(jn){return{disabled:jn.is_collaborator}}},pagination:!1,dataSource:Pn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},pn=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn.effects}})(hi),or=de.a.RangePicker,mi=Ct.a.Option,wi=function(_n){var Tn=_n.shixunHomeworks,bn=_n.loading,ur=_n.dispatch;return n.a.createElement("section",{className:"bg-white pl30 pr30 pt10 mb10"},n.a.createElement(G.a,null,n.a.createElement(G.a.TabPane,{tab:"\u53D1\u5E03\u8BBE\u7F6E",key:1},n.a.createElement(nr,null)),n.a.createElement(G.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(Kr,null)),n.a.createElement(G.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(cr,null)),n.a.createElement(G.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(pn,null))))},ti=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn.effects}})(wi),ni=D("RotF"),X=D.n(ni),L=function(_n){var Tn,bn=_n.shixunHomeworks,ur=_n.loading,sr=_n.dispatch,Q=Object(T.i)(),ce=Object(T.h)(),Ce=Object(i.useState)([]),Te=Object(a.a)(Ce,2),rt=Te[0],Re=Te[1],Xe=Object(i.useState)([]),it=Object(a.a)(Xe,2),Dt=it[0],Tt=it[1],Be=Object(i.useState)(!0),_t=Object(a.a)(Be,2),at=_t[0],dt=_t[1],wt=Object(i.useState)(!1),It=Object(a.a)(wt,2),gt=It[0],Xt=It[1],dn=Object(i.useState)(1),Pn=Object(a.a)(dn,2),Gn=Pn[0],Sn=Pn[1],Nn=Object(i.useState)([]),Mn=Object(a.a)(Nn,2),Pt=Mn[0],hn=Mn[1],Ht=Object(i.useState)(!1),Rt=Object(a.a)(Ht,2),Un=Rt[0],On=Rt[1],Vt=Object(i.useState)(!1),ft=Object(a.a)(Vt,2),jn=ft[0],fn=ft[1];Object(i.useEffect)(function(){bn.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(Rn.resetFields(),Re([]),On(!0),vn()):On(!1)},[bn.actionTabs.key]);var Qn=Yt.a.useForm(),Zt=Object(a.a)(Qn,1),Rn=Zt[0],Fn=[],vn=function(){var xn=Object(m.a)(s.a.mark(function Lt(){var Qe,Nt,Mt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(!(at&&!gt)){zn.next=11;break}return Xt(!0),Sn(Gn+1),zn.next=5,Object(ot.x)(Object(g.a)(Object(g.a)({},Q),{},{page:Gn}));case 5:Nt=zn.sent,Mt=Object(xe.a)(Nt.group_list),Nt!=null&&Nt.ungroup_list&&Mt.push({id:Nt==null?void 0:Nt.ungroup_list.id,name:Nt==null?void 0:Nt.ungroup_list.name,works_count:Nt==null?void 0:Nt.ungroup_list.work_count,last_review_time:Nt==null?void 0:Nt.ungroup_list.last_review_time}),Re([].concat(Object(xe.a)(rt),Object(xe.a)(Mt))),Xt(!1),((Qe=Nt.group_list)===null||Qe===void 0?void 0:Qe.length)<10&&dt(!1);case 11:case"end":return zn.stop()}},Lt)}));return function(){return xn.apply(this,arguments)}}(),yr=function(){sr({type:"shixunHomeworks/setActionTabs",payload:{}}),fn(!1),dt(!0),Xt(!1),Sn(1),Re([]),Rn.resetFields()},Dn=[{title:"",dataIndex:"id",width:280,render:function(Lt,Qe){return n.a.createElement(ht.a,{disabled:!(Qe.works_count>1),value:String(Qe.id)},Qe.name)}},{title:"\u6709\u6548\u4F5C\u54C1\u6570",dataIndex:"works_count"},{title:"\u4E0A\u6B21\u67E5\u91CD\u65F6\u95F4",dataIndex:"last_review_time",width:130}];return n.a.createElement(o.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Un,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(m.a)(s.a.mark(function xn(){var Lt,Qe;return s.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Lt=Rn.getFieldValue(),Mt.next=3,Object(O.a)("/api/homework_commons/".concat(Q.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(xe.a)(Lt.group_ids)}});case 3:if(Qe=Mt.sent,!(Qe.status===0)){Mt.next=11;break}return yr(),f.b.success("\u64CD\u4F5C\u6210\u529F"),Mt.next=9,sr({type:"shixunHomeworks/getWorkList",payload:bn.actionTabs.params});case 9:R.d.push("/classrooms/".concat(Q.coursesId,"/program_homework/").concat(Q.categoryId,"/detail?tabs=2")),sr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return Mt.stop()}},xn)})),onCancel:yr},bn.codeReviewCourse&&n.a.createElement(Yt.a,{form:Rn,onChange:function(Lt){hn(Object(g.a)({},Rn.getFieldValue()))},initialValues:(Tn={},Object(et.a)(Tn,"group_ids",Fn),Object(et.a)(Tn,"end_time",H()(H()().add(7,"days").format("YYYY-MM-DD HH:mm"))),Tn)},n.a.createElement("div",{className:"flexd-table-header mt20"},n.a.createElement(V.a,{pagination:!1,dataSource:[],columns:Dn})),n.a.createElement(Yt.a.Item,{name:"group_ids"},n.a.createElement(ht.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(X.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(Lt){vn()},hasMore:at,useWindow:!1},n.a.createElement(V.a,{loading:ur.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:Dn,dataSource:rt,pagination:!1})))))),n.a.createElement(Ve.a,null,n.a.createElement(se.a,{className:"ml10"},n.a.createElement(ht.a,{checked:jn,onChange:function(Lt){fn(Lt.target.checked);var Qe=[];Lt.target.checked&&(Qe=rt.filter(function(Nt){return Nt.works_count>1}).map(function(Nt){return Nt.id+""})),Rn.setFieldsValue(Object(et.a)({},"group_ids",Qe))}},"\u5168\u9009"))))},N=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading;return{shixunHomeworks:_n,loading:Tn}})(L),z=D("nPLb"),ne=D("XpUO"),J=D("bTeP"),je=D.n(J),$t=D("HBuW"),In=D("NLgs"),Jn=D("m3rI"),ln=D("+92d"),tr=D.n(ln),qn=D("wwSX"),kr=D.n(qn),li=D("zlzj"),ai=D.n(li),Gr=D("deN7"),Li=[tr.a,kr.a,ai.a],Vi=function(_n){var Tn,bn,ur=_n.user,sr=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(T.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(Y.s)()?[ur.userInfo.course.course_group_id]:[]},Object(T.i)())),Q=Object(a.a)(sr,2),ce=Q[0],Ce=Q[1],Te=Object(i.useState)([]),rt=Object(a.a)(Te,2),Re=rt[0],Xe=rt[1],it=Object(i.useState)([]),Dt=Object(a.a)(it,2),Tt=Dt[0],Be=Dt[1],_t=Object(i.useState)([]),at=Object(a.a)(_t,2),dt=at[0],wt=at[1],It=Object(i.useState)(!1),gt=Object(a.a)(It,2),Xt=gt[0],dn=gt[1],Pn=Object(i.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Ht,Rt,Un){return Ht<4?n.a.createElement("img",{src:Li[Ht-1]}):Ht}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Ht,Rt,Un){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Jn.a.IMG_SERVER+"/images/"+(Rt==null?void 0:Rt.image_url)}),Ht)}},{title:"\u5206\u73ED",dataIndex:"course_group",key:"course_group",ellipsis:!0,width:150,fixed:"left"},{title:"\u5B66\u53F7",dataIndex:"student_id",key:"student_id",width:150,ellipsis:!0,fixed:"left",render:function(Ht){return Ht||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),Gn=Object(a.a)(Pn,2),Sn=Gn[0],Nn=Gn[1];Object(i.useEffect)(function(){Sn.splice(7);for(var hn=function(On){var Vt,ft,jn,fn,Qn={};Qn.title=Re!=null&&Re.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(On+1)+"\uFF08".concat(Re==null||((Vt=Re.question_data)===null||Vt===void 0||((ft=Vt[On])===null||ft===void 0))?void 0:ft.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function Zt(){var Rn,Fn,vn;return s.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return Dn.next=2,Object(O.a)("/api/problems/".concat(Re==null||((Rn=Re.question_data)===null||Rn===void 0||((Fn=Rn[On])===null||Fn===void 0))?void 0:Fn.identifier,"/start.json"),{method:"get"});case 2:vn=Dn.sent,vn&&(window.open("/myproblems/".concat(vn==null?void 0:vn.identifier,"?type=1")),localStorage.setItem("program_homework",[ce.coursesId,ce.categoryId]));case 4:case"end":return Dn.stop()}},Zt)}))},"\u9898\u76EE"+(On+1)+"\uFF08".concat(Re==null||((jn=Re.question_data)===null||jn===void 0||((fn=jn[On])===null||fn===void 0))?void 0:fn.question_score,"\uFF09")),Qn.dataIndex="question_data",Qn.width=250,Qn.render=function(Zt,Rn){var Fn,vn,yr,Dn,xn;return n.a.createElement("div",null,(Zt==null||((Fn=Zt[On])===null||Fn===void 0)?void 0:Fn.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(s.a.mark(function Lt(){var Qe,Nt,Mt,cn,zn,kn,lr,er;return s.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(Zt!=null&&(Qe=Zt[On])!==null&&Qe!==void 0&&Qe.open_code){mr.next=3;break}return f.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),mr.abrupt("return");case 3:return mr.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,homework_common_id:ce.categoryId,hack_user_code_id:Zt==null||((Nt=Zt[On])===null||Nt===void 0)?void 0:Nt.hack_user_code_id})});case 5:er=mr.sent,o.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Zt==null||((Mt=Zt[On])===null||Mt===void 0)?void 0:Mt.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Zt==null||((cn=Zt[On])===null||cn===void 0)?void 0:cn.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Zt==null||((zn=Zt[On])===null||zn===void 0)?void 0:zn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Zt==null||((kn=Zt[On])===null||kn===void 0)?void 0:kn.score)),content:n.a.createElement(Gr.a,{languages:[{language:Zt==null||((lr=Zt[On])===null||lr===void 0)?void 0:lr.language,code:er==null?void 0:er.code}],v:Zt,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Zt.language,game_id:Zt.id,diff_code_count:Zt.diff_code_count})});case 7:case"end":return mr.stop()}},Lt)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Zt==null||((vn=Zt[On])===null||vn===void 0)?void 0:vn.answer_question_time)||"- -"),Zt!=null&&(yr=Zt[On])!==null&&yr!==void 0&&yr.submit_count?n.a.createElement(I.a,{title:"".concat((Zt==null||((Dn=Zt[On])===null||Dn===void 0)?void 0:Dn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Zt==null||((xn=Zt[On])===null||xn===void 0)?void 0:xn.submit_count)||0):null))},Sn.push(Qn)},Ht=0;Ht<(Re==null||((Rt=Re.question_data)===null||Rt===void 0)?void 0:Rt.length);Ht++){var Rt;hn(Ht)}Nn(Object(xe.a)(Sn))},[Re==null?void 0:Re.question_data]),Object(i.useEffect)(function(){var hn;ur!=null&&(hn=ur.userInfo)!==null&&hn!==void 0&&hn.course&&(Object(Y.s)()&&(ce.course_group=Object(Y.s)()?[ur.userInfo.course.course_group_id]:[],Ce(Object(g.a)({},ce))),Mn(1))},[ur==null?void 0:ur.userInfo]);function Mn(hn){return Pt.apply(this,arguments)}function Pt(){return Pt=Object(m.a)(s.a.mark(function hn(Ht){var Rt,Un,On,Vt,ft,jn,fn;return s.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return dn(!0),Zt.next=3,Object(O.a)("/api/courses/rank_list.json",{method:"get",params:Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,rank_type:2,homework_common_id:ce.categoryId})});case 3:if(Rt=Zt.sent,Xe(Rt),dn(!1),Object(Y.s)()?(Ht===1&&Be([Rt==null||((Un=Rt.course_group)===null||Un===void 0||((On=Un[0])===null||On===void 0))?void 0:On.id]),Rt!=null&&Rt.my_rank?wt([Rt==null?void 0:Rt.my_rank].concat(Object(xe.a)(Rt==null?void 0:Rt.rank_list))):wt(Object(xe.a)(Rt==null?void 0:Rt.rank_list))):wt(Object(xe.a)(Rt==null?void 0:Rt.rank_list)),Ht===1){for(Vt={title:n.a.createElement(I.a,{title:`\u603B\u8017\u65F6\u65F6\u4E3A\u505A\u9898\u901A\u8FC7\u65F6\u957F\u548C\u7F5A\u65F6\u65F6\u957F\u7684\u603B\u548C\uFF0C
\u7F5A\u65F6\u65F6\u957F=\u8BC4\u6D4B\u51FA\u9519\u6B21\u6570X\u8BBE\u7F6E\u7684\u7F5A\u65F6\uFF08\u5F53\u524D\u4E3A`.concat(Rt==null?void 0:Rt.punish_time,"\u5206\uFF09")},n.a.createElement("span",{style:{marginRight:3}},"\u603B\u8017\u65F6")," ",n.a.createElement("span",{style:{fontSize:"14px"},className:"iconfont icon-tishixiaowenhao c-blue"})),dataIndex:"finish_time",width:150,ellipsis:!0,fixed:"left",key:"finish_time"},Sn.push(Vt),ft=function(Fn){var vn,yr,Dn,xn,Lt={};Lt.title=Rt!=null&&Rt.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(Rt==null||((vn=Rt.question_data)===null||vn===void 0||((yr=vn[Fn])===null||yr===void 0))?void 0:yr.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function Qe(){var Nt,Mt,cn;return s.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(O.a)("/api/problems/".concat(Rt==null||((Nt=Rt.question_data)===null||Nt===void 0||((Mt=Nt[Fn])===null||Mt===void 0))?void 0:Mt.identifier,"/start.json"),{method:"get"});case 2:cn=kn.sent,cn&&(window.open("/myproblems/".concat(cn==null?void 0:cn.identifier,"?type=1")),localStorage.setItem("program_homework",[ce.coursesId,ce.categoryId]));case 4:case"end":return kn.stop()}},Qe)}))},"\u9898\u76EE"+(Fn+1)+"\uFF08".concat(Rt==null||((Dn=Rt.question_data)===null||Dn===void 0||((xn=Dn[Fn])===null||xn===void 0))?void 0:xn.question_score,"\uFF09")),Lt.dataIndex="question_data",Lt.width=250,Lt.render=function(Qe,Nt){var Mt,cn,zn,kn,lr;return n.a.createElement("div",null,(Qe==null||((Mt=Qe[Fn])===null||Mt===void 0)?void 0:Mt.answer_question_time)&&n.a.createElement("div",null,n.a.createElement("span",{style:{cursor:"pointer"},className:"iconfont icon-shixun4 c-blue",onClick:Object(m.a)(s.a.mark(function er(){var Rr,mr,xr,Zr,Yr,Jr,vi,_i;return s.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:if(Qe!=null&&(Rr=Qe[Fn])!==null&&Rr!==void 0&&Rr.open_code){Ne.next=3;break}return f.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),Ne.abrupt("return");case 3:return Ne.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,homework_common_id:ce.categoryId,hack_user_code_id:Qe==null||((mr=Qe[Fn])===null||mr===void 0)?void 0:mr.hack_user_code_id})});case 5:_i=Ne.sent,o.a.warning({icon:null,width:800,title:n.a.createElement("div",null,n.a.createElement("span",null,"\u4EE3\u7801"),n.a.createElement("span",null,"\u4F7F\u7528\u8BED\u8A00\uFF1A",Qe==null||((xr=Qe[Fn])===null||xr===void 0)?void 0:xr.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Qe==null||((Zr=Qe[Fn])===null||Zr===void 0)?void 0:Zr.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Qe==null||((Yr=Qe[Fn])===null||Yr===void 0)?void 0:Yr.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Qe==null||((Jr=Qe[Fn])===null||Jr===void 0)?void 0:Jr.score)),content:n.a.createElement(Gr.a,{languages:[{language:Qe==null||((vi=Qe[Fn])===null||vi===void 0)?void 0:vi.language,code:_i==null?void 0:_i.code}],v:Qe,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Qe.language,game_id:Qe.id,diff_code_count:Qe.diff_code_count})});case 7:case"end":return Ne.stop()}},er)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Qe==null||((cn=Qe[Fn])===null||cn===void 0)?void 0:cn.answer_question_time)||"- -"),Qe!=null&&(zn=Qe[Fn])!==null&&zn!==void 0&&zn.submit_count?n.a.createElement(I.a,{title:"".concat((Qe==null||((kn=Qe[Fn])===null||kn===void 0)?void 0:kn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Qe==null||((lr=Qe[Fn])===null||lr===void 0)?void 0:lr.submit_count)||0):null))},Sn.push(Lt)},jn=0;jn<(Rt==null||((fn=Rt.question_data)===null||fn===void 0)?void 0:fn.length);jn++)ft(jn);Nn(Object(xe.a)(Sn))}case 8:case"end":return Zt.stop()}},hn)})),Pt.apply(this,arguments)}return console.log("----",Sn),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Re==null?void 0:Re.message)==="\u5C01\u699C\u4E2D"?n.a.createElement(q.a,{customText:"\u7B54\u9898\u65F6\u95F4\u8FDB\u5165\u5012\u8BA1\u65F6\uFF0C\u6682\u65F6\u5C01\u699C\uFF0C\u8BF7\u52A0\u901F\u7ADE\u6280\u901A\u5173\u7B54\u9898"}):n.a.createElement("div",{style:{background:"#fff",padding:20}},n.a.createElement("div",{style:{display:"inline-flex"}},n.a.createElement("label",null,"\u5206\u73ED\u60C5\u51B5\uFF1A"),Object(Y.c)()&&n.a.createElement("div",{style:{flex:1}},n.a.createElement(ht.a.Group,{className:je.a.checkboxgroup,value:Tt,onChange:function(Ht){if(ce.type===1)Be([]),ce.course_group=[],ce.page=1,Ce(Object(g.a)({},ce)),Mn();else if(ce.type===2){var Rt;Be(["\u5168\u90E8"].concat()),ce.course_group=Re==null||((Rt=Re.course_group)===null||Rt===void 0)?void 0:Rt.map(function(Un){return Un.id}),ce.page=1,Ce(Object(g.a)({},ce)),Mn()}else Be(Object(xe.a)(Ht.filter(function(Un){return Un!="\u5168\u90E8"}))),ce.course_group=Ht.filter(function(Un){return Un!="\u5168\u90E8"}),ce.page=1,Ce(Object(g.a)({},ce)),Mn()}},n.a.createElement(ht.a,{value:"\u5168\u90E8",onChange:function(Ht){Ht.target.checked?ce.type=2:ce.type=1}},"\u5168\u90E8\u5206\u73ED"),Re==null||((Tn=Re.course_group)===null||Tn===void 0)?void 0:Tn.map(function(hn,Ht){return n.a.createElement(ht.a,{onChange:function(Un){ce.type=3},value:hn.id},hn==null?void 0:hn.name)}))),Object(Y.s)()&&n.a.createElement(ve.a.Group,{onChange:function(Ht){Ht.target.value==="\u5168\u90E8"?(ce.course_group=[],ce.page=1,Ce(Object(g.a)({},ce)),Mn()):(ce.course_group=[Ht.target.value],ce.page=1,Ce(Object(g.a)({},ce)),Mn())},defaultValue:ur.userInfo.course.course_group_id},n.a.createElement(ve.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Re==null||((bn=Re.course_group)===null||bn===void 0)?void 0:bn.map(function(hn,Ht){return n.a.createElement(ve.a,{value:hn.id},hn.name)}))),Object(Y.c)()&&n.a.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:10}},n.a.createElement("span",{style:{fontSize:14,color:"#B1BACD"}},"\u6392\u884C\u89C4\u5219\uFF1A\u65F6\u95F4\u7ED3\u675F\u540E\u6B63\u5F0F\u5C01\u699C\uFF0C\u65F6\u95F4\u6BB5\u4E4B\u5916\u7684\u63D0\u4EA4\u4E0D\u8BA1\u5165\u6392\u884C\u3002"," ",n.a.createElement("a",{onClick:function(){o.a.warning({title:"\u8BA1\u5206\u89C4\u5219",width:500,content:n.a.createElement("div",null,n.a.createElement("p",null,"\u6392\u540D\u89C4\u5219\uFF1A\u7ECF\u5178ACM\u89C4\u5219"),n.a.createElement("p",null,"AC\uFF08\u901A\u8FC7\u9898\u76EE\uFF09\u8D8A\u591A\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"AC\u76F8\u540C\uFF0C\u603B\u7528\u65F6\u8D8A\u5C11\uFF0C\u6392\u540D\u8D8A\u9760\u524D\u3002"),n.a.createElement("p",null,"\u603B\u7528\u65F6=\u2211\uFF08\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6\uFF09"),n.a.createElement("p",null,"\u6BCF\u4E00\u4E2A\u9898\u76EE\u7684\u7528\u65F6=\u6BD4\u8D5B\u5F00\u59CB\u5230\u63D0\u4EA4\u88AB\u901A\u8FC7\u7684\u65F6\u95F4+\u7F5A\u65F6"),n.a.createElement("p",null,"\u7F5A\u65F6=\uFF08\u901A\u8FC7\u524D\uFF09\u9519\u8BEF\u4EE3\u7801\u63D0\u4EA4\u6B21\u6570*\u6BCF\u6B21\u7F5A\u65F6"),n.a.createElement("p",null,"\u4E0D\u7B97\u7F5A\u65F6\u7684\u60C5\u51B5\uFF1A\u6CA1\u6709\u901A\u8FC7\u7684\u9898\u76EE\u3001\uFF08\u7CFB\u7EDF\uFF09\u5185\u90E8\u9519\u8BEF\u3001\u7F16\u8BD1\u9519\u8BEF"))})}},"\u70B9\u51FB\u67E5\u770B\u8BA1\u5206\u89C4\u5219")),n.a.createElement(M.a,{onClick:function(){Object(be.v)(Object(g.a)(Object(g.a)({},ce),{},{id:ce.coursesId,rank_type:2,homework_common_id:ce.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(h.a,{spinning:Xt},n.a.createElement(V.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Ht,Rt){return Rt===0&&Object(Y.s)()&&je.a.tables},dataSource:dt,columns:Sn})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(_.a,{current:ce.page,pageSize:ce.per_page,total:Re==null?void 0:Re.count,hideOnSinglePage:!0,onChange:function(Ht,Rt){ce.page=Ht,ce.per_page=Rt,Ce(Object(g.a)({},ce)),Mn()}}))))},Dr=Object(R.a)(function(Bn){var _n=Bn.user;return{user:_n}})(Vi),Sr=[{live:"A",gz:"0\u4E2A\u9519\u8BEF",ld:"0\u4E2A\u6F0F\u6D1E",gf:"0 - 5%"},{live:"B",gz:"\u81F3\u5C111\u4E2A\u6B21\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u6B21\u8981\u6F0F\u6D1E",gf:"6% - 10%"},{live:"C",gz:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E3B\u8981\u6F0F\u6D1E",gf:"11% - 20%"},{live:"D",gz:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u4E25\u91CD\u6F0F\u6D1E",gf:"21% - 50%"},{live:"E",gz:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u9519\u8BEF",ld:"\u81F3\u5C111\u4E2A\u5D29\u6E83\u6F0F\u6D1E",gf:"\u8D85\u8FC750%"}],ri=function(_n){var Tn,bn=_n.shixunHomeworks,ur=_n.globalSetting,sr=_n.loading,Q=_n.dispatch,ce=Object(T.i)(),Ce=Object(T.h)(),Te=Object(T.g)(),rt=Object(i.useState)([]),Re=Object(a.a)(rt,2),Xe=Re[0],it=Re[1],Dt=Object(i.useState)(Ce.query.tabs||"0"),Tt=Object(a.a)(Dt,2),Be=Tt[0],_t=Tt[1],at=Object(i.useState)({}),dt=Object(a.a)(at,2),wt=dt[0],It=dt[1],gt=bn.workList,Xt=Object(i.useState)(!1),dn=Object(a.a)(Xt,2),Pn=dn[0],Gn=dn[1],Sn;ce.category=Ce.query.category_id,ce.order="work_score",ce.b_order="desc";var Nn=function(Vt){_t(Vt),Vt==="0"&&Q({type:"shixunHomeworks/getWorkList",payload:ce})},Mn=function(){o.a.confirm({centered:!0,width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u4F60\u5728\u8BE5\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A\uFF0C\u65E0\u6CD5\u6062\u590D",n.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u91CD\u505A\uFF1F"),onOk:function(){var Vt=Object(m.a)(s.a.mark(function jn(){var fn,Qn,Zt;return s.a.wrap(function(Fn){for(;;)switch(Fn.prev=Fn.next){case 0:return Qn=(fn=bn.workList)===null||fn===void 0?void 0:fn.myshixun_identifier,Fn.next=3,Object(ot.X)({id:Qn});case 3:Zt=Fn.sent,Zt&&(f.b.info(`\u5DF2\u6E05\u7A7A\u672C\u5B9E\u8BAD\u7684\u5B66\u4E60\u8BB0\u5F55
\u8BF7\u70B9\u51FB\u201C\u5F00\u542F\u6311\u6218\u201D\u91CD\u505A\u8BFE\u7A0B\u5B9E\u9A8C`),Q({type:"shixunHomeworks/getWorkList",payload:wt}));case 5:case"end":return Fn.stop()}},jn)}));function ft(){return Vt.apply(this,arguments)}return ft}()})},Pt=function On(Vt){var ft;Vt=(ft=Vt)!==null&&ft!==void 0&&ft.includes(".json")?Vt:"".concat(Vt,".json"),o.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var jn=Object(m.a)(s.a.mark(function Qn(){var Zt,Rn;return s.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Object($t.Bb)({url:Vt});case 2:if(Zt=vn.sent,Zt){vn.next=5;break}return vn.abrupt("return");case 5:return f.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),vn.next=8,Object($t.E)({id:Zt.shixun_identifier});case 8:if(Rn=vn.sent,!(Rn!=null&&Rn.game_identifier)){vn.next=12;break}return Object(v.S)("/tasks/".concat(Rn.game_identifier,"?coursesId=").concat(ce.coursesId)),vn.abrupt("return");case 12:(Rn==null?void 0:Rn.status)===2?On(Rn==null?void 0:Rn.message):(Rn==null?void 0:Rn.status)===3&&hn(Rn==null?void 0:Rn.message);case 13:case"end":return vn.stop()}},Qn)}));function fn(){return jn.apply(this,arguments)}return fn}()})},hn=function(Vt){o.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:n.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",Vt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Ht=function(){var On=Object(m.a)(s.a.mark(function Vt(ft){var jn,fn;return s.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return ft=(jn=ft)!==null&&jn!==void 0&&jn.includes(".json")?ft:"".concat(ft,".json"),Zt.next=3,Object($t.Bb)({url:ft});case 3:if(fn=Zt.sent,console.log(fn,"execRes"),!(fn!=null&&fn.game_identifier)){Zt.next=8;break}return Object(v.S)("/tasks/".concat(fn.game_identifier,"?coursesId=").concat(ce.coursesId)),Zt.abrupt("return");case 8:(fn==null?void 0:fn.status)===-3?Object(v.q)():(fn==null?void 0:fn.status)===2?Pt(fn==null?void 0:fn.message):(fn==null?void 0:fn.status)===3&&hn(fn==null?void 0:fn.message);case 9:case"end":return Zt.stop()}},Vt)}));return function(ft){return On.apply(this,arguments)}}(),Rt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(St,{setExportParams:It}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement($e,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(Dr,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(Jt,null)},{name:Object(Y.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(ti,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ce.coursesId,"/program_homework/").concat(ce.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(On){var Vt;if(Object(Y.s)())return On.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(Y.s)()||(gt==null||((Vt=gt.homework_status)===null||Vt===void 0)?void 0:Vt[0])!=="\u5DF2\u622A\u6B62")return On.name!=="\u8D28\u91CF\u68C0\u6D4B";var ft;return!gt.code_review&&(gt==null||((ft=gt.homework_status)===null||ft===void 0)?void 0:ft[0])!=="\u672A\u53D1\u5E03"?!0:On.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(On){return gt.open_code_quality_analysis?!0:On.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Un=function(){var Vt,ft,jn,fn,Qn,Zt,Rn,Fn;return n.a.createElement("aside",{className:je.a.workListTabButton},Object(Y.s)()&&((Vt=bn.workList)===null||Vt===void 0?void 0:Vt.redo_work)&&n.a.createElement(M.a,{onClick:Mn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((ft=bn.workList)===null||ft===void 0?void 0:ft.shixun_status)>1&&((jn=bn.workList)===null||jn===void 0?void 0:jn.time_status)<5&&Object(Y.s)()&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var yr,Dn,xn,Lt,Qe,Nt,Mt;if(!Object(In.e)(Q,!0))return;(yr=bn.workList)!==null&&yr!==void 0&&(Dn=yr.task_operation)!==null&&Dn!==void 0&&(xn=Dn[1])!==null&&xn!==void 0&&xn.includes("/")?Ht((Lt=bn.workList)===null||Lt===void 0||((Qe=Lt.task_operation)===null||Qe===void 0)?void 0:Qe[1]):Object(v.S)("/tasks/".concat((Nt=bn.workList)===null||Nt===void 0||((Mt=Nt.task_operation)===null||Mt===void 0)?void 0:Mt[1]))}},(fn=bn.workList)===null||fn===void 0||((Qn=fn.task_operation)===null||Qn===void 0)?void 0:Qn[0]),((Zt=bn.workList)===null||Zt===void 0?void 0:Zt.commit_des)&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-tijiaozongjie"}),onClick:function(){var yr;Object(v.S)("/classrooms/".concat(ce.coursesId,"/shixun_homework/").concat(ce.categoryId,"/").concat((yr=bn.workList)===null||yr===void 0?void 0:yr.id,"/commitsummary"))}},(Rn=bn.workList)===null||Rn===void 0?void 0:Rn.commit_des),Object(Y.c)()&&(gt==null||((Fn=gt.homework_status)===null||Fn===void 0)?void 0:Fn[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Te.push("/classrooms/".concat(ce.coursesId,"/program_homework/").concat(ce.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(Y.c)()&&gt.publish_immediately&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){Q({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ce.categoryId],selectArrsAll:[gt],params:ce,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(Y.c)()&&gt.end_immediately&&n.a.createElement(M.a,{style:{background:"#0152d9",color:"#fff"},type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-jiezhishiyan"}),onClick:function(){Q({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ce,type:2,detail:!0,selectArrs:[ce.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},gt.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},gt.category&&n.a.createElement(k.a,{separator:">"},n.a.createElement(k.a.Item,null,n.a.createElement(C.a,{to:"/classrooms/".concat(gt.course_id,"/program_homework")},gt.course_name)),n.a.createElement(k.a.Item,null,n.a.createElement(C.a,{to:"/classrooms/".concat(gt.course_id,"/program_homework/").concat(gt.category.main?"":gt.category.category_id)},gt.category.category_name)),n.a.createElement(k.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[je.a.title,"mt20"].join(" ")},n.a.createElement(C.a,{to:"/classrooms/".concat(gt.course_id,"/program_homework/").concat(gt.category.main?"":gt.category.category_id)},n.a.createElement(S.a,{className:"font16 c-black"})),n.a.createElement(I.a,{title:gt.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},gt.homework_name)),n.a.createElement(v.m,{temporary:!0,status:gt.homework_status}),Object(Y.s)()&&n.a.createElement("span",{style:{fontWeight:800,color:"#0152d9",textAlign:"end",flex:1,cursor:"pointer"}},n.a.createElement(M.a,{onClick:Object(m.a)(s.a.mark(function On(){var Vt,ft;return s.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(O.a)("/api/problems/".concat((Vt=bn.workList)===null||Vt===void 0?void 0:Vt.start_identifier,"/start.json"),{method:"get"});case 2:ft=fn.sent,ft&&(window.open("/myproblems/".concat(ft==null?void 0:ft.identifier,"?type=1")),localStorage.setItem("program_homework",[ce.coursesId,ce.categoryId]));case 4:case"end":return fn.stop()}},On)})),type:"primary"},(Tn=gt.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u5DF2\u622A\u6B62")?"\u67E5\u770B\u4F5C\u4E1A":"\u8FDB\u5165\u7EC3\u4E60"," ")))),n.a.createElement("aside",{className:"mt30 relative ".concat(je.a.workListTabWrap)},n.a.createElement(G.a,{type:"card",defaultActiveKey:Be,activeKey:Be,tabBarExtraContent:Un(),onChange:Nn},Rt.map(function(On,Vt){return n.a.createElement(G.a.TabPane,{tab:On.name,key:On.id,forceRender:On.forceRender},On.compontent)})))),n.a.createElement(N,null),n.a.createElement(z.a,{courseEndTime:gt==null?void 0:gt.course_end_date}),n.a.createElement(ne.a,{courseEndTime:gt==null?void 0:gt.course_end_date}),n.a.createElement(o.a,{visible:Pn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){Gn(!1)}},n.a.createElement("p",null,"\u4E00\u3001\u7B49\u7EA7\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"1. \u7F3A\u9677\u7B49\u7EA7"),n.a.createElement("p",{style:{marginLeft:"10px"}},n.a.createElement(V.a,{dataSource:Sr,columns:[{title:"\u7B49\u7EA7",dataIndex:"live"},{title:"\u7F3A\u9677\u8BC4\u4F30\u89C4\u5219",dataIndex:"gz"},{title:"\u6F0F\u6D1E\u8BC4\u4F30\u89C4\u5219",dataIndex:"ld"},{title:"\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219",dataIndex:"gf"}],pagination:!1})),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u4EE3\u7801\u89C4\u8303\u8BC4\u4F30\u89C4\u5219\u4E2D\u6570\u503C\u6765\u6E90\u4E3A\u8BA1\u7B97\u6280\u672F\u503A\u52A1\u65F6\u95F4\u5360\u5F00\u53D1\u6240\u6709\u4EE3\u7801\u6240\u9700\u8981\u7684\u65F6\u95F4\u7684\u6BD4\u4F8B\uFF08Technical Debt Ratio\uFF09"),n.a.createElement("p",{style:{marginLeft:"20px"}},"Technical Debt Ratio = \u6280\u672F\u503A\u52A1\u65F6\u95F4 / \u5F00\u53D1\u65F6\u95F4"),n.a.createElement("p",{style:{marginLeft:"20px"}},"\u6280\u672F\u503A\u52A1\u65F6\u95F4\u4E3A\u4FEE\u590D\u6240\u6709\u95EE\u9898\u6240\u9700\u8981\u7684\u65F6\u95F4\u3002"),n.a.createElement("p",null,"\u4E8C\u3001\u590D\u6742\u5EA6\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6839\u636E\u4EE3\u7801\u8DEF\u5F84\u6570\u8BA1\u7B97\u7684\u6570\u503C\uFF0C\u6BCF\u5F53\u4E00\u4E2A\u51FD\u6570\u7684\u63A7\u5236\u6D41\u5206\u53C9\u65F6\uFF0C\u590D\u6742\u5EA6\u8BA1\u6570\u5668\u5C31\u4F1A\u81EA\u589E\u4E00\u3002"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6BCF\u4E2A\u7A0B\u5E8F\u8BED\u8A00\u7684\u5173\u952E\u5B57\u5BF9\u5E94\u7684\u590D\u6742\u5EA6\u6570\u636E\u4E0D\u540C\uFF0C\u4F46\u6BCF\u4E2A\u51FD\u6570\u7684\u6700\u5C0F\u590D\u6742\u5EA6\u4E3A1\u3002\uFF08\u7279\u5B9A\u8BED\u8A00\u7684\u8BE6\u7EC6\u6570\u636E\u7565\uFF09"),n.a.createElement("p",null,"\u4E09\u3001\u4EE3\u7801\u8D28\u91CF\u5206\u89C4\u5219"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u4EE3\u7801\u8D28\u91CF\u5206 = 0.5*\u7F3A\u9677\u5206\u6570 + 0.3*\u6F0F\u6D1E\u5206\u6570 + 0.2*\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u5176\u4E2D\uFF1A"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u7F3A\u9677/\u6F0F\u6D1E/\u4EE3\u7801\u89C4\u8303\u6027\u5206\u6570\u8BA1\u7B97\u89C4\u5219\u4E3A\uFF1A100 - 100 *((100*\u5D29\u6E83\u6570 + 5*\u4E25\u91CD\u6570 + 3*\u4E3B\u8981\u6570 + 1*\u6B21\u6570\uFF09/ \u4EE3\u7801\u884C\u6570\uFF09"),n.a.createElement("p",{style:{marginLeft:"10px"}},"\u6CE8\uFF1A\u5206\u6570\u4E3A\u7A7A\u7684\u4EE3\u8868\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u683C\u5F0F\u3002")))},Br=he.default=Object(R.a)(function(Bn){var _n=Bn.shixunHomeworks,Tn=Bn.loading,bn=Bn.globalSetting;return{shixunHomeworks:_n,globalSetting:bn,loading:Tn.effects}})(ri)},OLES:function(Kt,he,D){"use strict";var Z=D("U8pU"),V=D("VTBJ"),U=D("Ff2n"),G=D("q1tI"),P=D("uciX"),I=D("7ixt"),K=function(m){var l=m.overlay,o=m.prefixCls,a=m.id,c=m.overlayInnerStyle;return G.createElement("div",{className:"".concat(o,"-inner"),id:a,role:"tooltip",style:c},typeof l=="function"?l():l)},k=K,r=function(m,l){var o=m.overlayClassName,a=m.trigger,c=a===void 0?["hover"]:a,s=m.mouseEnterDelay,i=s===void 0?0:s,n=m.mouseLeaveDelay,O=n===void 0?.1:n,T=m.overlayStyle,C=m.prefixCls,R=C===void 0?"rc-tooltip":C,S=m.children,v=m.onVisibleChange,E=m.afterVisibleChange,h=m.transitionName,p=m.animation,_=m.placement,g=_===void 0?"right":_,w=m.align,j=w===void 0?{}:w,B=m.destroyTooltipOnHide,A=B===void 0?!1:B,H=m.defaultVisible,F=m.getTooltipContainer,x=m.overlayInnerStyle,Y=Object(U.a)(m,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),q=Object(G.useRef)(null);Object(G.useImperativeHandle)(l,function(){return q.current});var ie=Object(V.a)({},Y);"visible"in m&&(ie.popupVisible=m.visible);var me=function(){var Ye=m.arrowContent,ve=Ye===void 0?null:Ye,fe=m.overlay,lt=m.id;return[G.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},ve),G.createElement(k,{key:"content",prefixCls:R,id:lt,overlay:fe,overlayInnerStyle:x})]},$e=!1,xe=!1;if(typeof A=="boolean")$e=A;else if(A&&Object(Z.a)(A)==="object"){var Ie=A.keepParent;$e=Ie===!0,xe=Ie===!1}return G.createElement(P.a,Object.assign({popupClassName:o,prefixCls:R,popup:me,action:c,builtinPlacements:I.a,popupPlacement:g,ref:q,popupAlign:j,getPopupContainer:F,onPopupVisibleChange:v,afterPopupVisibleChange:E,popupTransitionName:h,popupAnimation:p,defaultPopupVisible:H,destroyPopupOnHide:$e,autoDestroy:xe,mouseLeaveDelay:O,popupStyle:T,mouseEnterDelay:i},ie),S)},M=Object(G.forwardRef)(r),b=he.a=M},OZM5:function(Kt,he,D){"use strict";D.d(he,"b",function(){return M}),D.d(he,"a",function(){return b}),D.d(he,"k",function(){return f}),D.d(he,"h",function(){return m}),D.d(he,"i",function(){return l}),D.d(he,"g",function(){return o}),D.d(he,"c",function(){return a}),D.d(he,"d",function(){return c}),D.d(he,"j",function(){return n}),D.d(he,"e",function(){return O}),D.d(he,"f",function(){return T});var Z=D("KQm4"),V=D("U8pU"),U=D("Ff2n"),G=D("q1tI"),P=D.n(G),I=D("Kwbf"),K=D("WaYH"),k=.25,r=2;function M(C,R){var S=C.slice(),v=S.indexOf(R);return v>=0&&S.splice(v,1),S}function b(C,R){var S=C.slice();return S.indexOf(R)===-1&&S.push(R),S}function f(C){return C.split("-")}function m(C,R){return"".concat(C,"-").concat(R)}function l(C){return C&&C.type&&C.type.isTreeNode}function o(C,R){var S=[C],v=R[C];function E(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(p){var _=p.key,g=p.children;S.push(_),E(g)})}return E(v.children),S}function a(C,R){var S=C.clientY,v=R.selectHandle.getBoundingClientRect(),E=v.top,h=v.bottom,p=v.height,_=Math.max(p*k,r);return S<=E+_?-1:S>=h-_?1:0}function c(C,R){if(!C)return;var S=R.multiple;return S?C.slice():C.length?[C[0]]:C}var s=function(R){return R};function i(C,R){if(!C)return[];var S=R||{},v=S.processProps,E=v===void 0?s:v,h=Array.isArray(C)?C:[C];return h.map(function(p){var _=p.children,g=Object(U.a)(p,["children"]),w=i(_,R);return P.a.createElement(K.a,Object.assign({},E(g)),w)})}function n(C){if(!C)return null;var R;if(Array.isArray(C))R={checkedKeys:C,halfCheckedKeys:void 0};else if(Object(V.a)(C)==="object")R={checkedKeys:C.checked||void 0,halfCheckedKeys:C.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function O(C,R){var S=new Set;function v(E){if(S.has(E))return;var h=R[E];if(!h)return;S.add(E);var p=h.parent,_=h.node;if(_.disabled)return;p&&v(p.key)}return(C||[]).forEach(function(E){v(E)}),Object(Z.a)(S)}function T(C){var R={};return Object.keys(C).forEach(function(S){(S.startsWith("data-")||S.startsWith("aria-"))&&(R[S]=C[S])}),R}},Ot1p:function(Kt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("rAM+"),G=D("miYZ"),P=D("tsqr"),I=D("9og8"),K=D("tJVT"),k=D("jrin"),r=D("WmNS"),M=D.n(r),b=D("q1tI"),f=D.n(b),m=D("VrN/"),l=D.n(m),o=D("bdgK"),a=D("p77/"),c=D("Bd2K"),s=D("ELLl"),i=D("19Vz"),n=D("lZu9"),O=D("+NIl"),T=D("kSUc"),C=D("9Bee"),R=function(be){var Ke=be.value,St=Ke===void 0?"":Ke,nn=be.className,An=be.showTextOnly,bt=be.showLines,Jt=be.style,Et=Jt===void 0?{}:Jt,Ct=Object(b.useMemo)(function(){return""},[St]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ct}}))},S=D("0Owb"),v=D("dejd"),E=D("C+DQ"),h=D("1vsH"),p=D("m3rI"),_=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function g(be){var Ke=be.onActionCallback,St=be.title,nn=be.icon,An=be.actionName,bt=be.className,Jt=bt===void 0?"":bt,Et=be.children;function Ct(){Ke(An)}return f.a.createElement("a",{title:St,className:Jt,onClick:Ct},f.a.createElement("i",{className:"md-iconfont ".concat(nn)}),Et)}var w=function(be){var Ke=be.watch,St=be.showNullButton,nn=be.onActionCallback,An=be.fullScreen,bt=be.insertTemp,Jt=be.hidetoolBar,Et=be.uuid,Ct=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(Et,"&api=").concat(encodeURIComponent(p.a.PROXY_SERVER)));var st=[].concat(_,[{title:"".concat(Ke?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ke?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!Jt&&st.map(function(de,Ae){return f.a.createElement("li",{key:Ae},de.actionName?f.a.createElement(g,Object(S.a)({},de,{onActionCallback:nn})):f.a.createElement("span",{className:"v-line"}))}),St?f.a.createElement("li",null,f.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:nn},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,bt&&f.a.createElement("li",null,f.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(bt),onActionCallback:nn},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(g,{icon:"".concat(An?"icon-shrink":"icon-enlarge"),title:An?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:nn})))},j=D("M8RZ"),B=D("+L6B"),A=D("2/Rp"),H=D("y8nQ"),F=D("Vl3Y"),x=D("5NDa"),Y=D("5rEg"),q={labelCol:{span:4},wrapperCol:{span:20}},ie=function(be){var Ke=be.callback,St=be.onCancel;function nn(An){Ke(An)}return f.a.createElement(F.a,Object(S.a)({},q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:nn}),f.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(Y.a,null)),f.a.createElement(F.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(Y.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))},me=D("7ahc"),$e=D("HmJG"),xe=D("BjJ7"),Ie=F.a.useForm,Je={width:280,marginRight:10},Ye={labelCol:{span:5},wrapperCol:{span:19}},ve=function(be){var Ke=be.callback,St=be.onCancel,nn=Ie(),An=Object(K.a)(nn,1),bt=An[0];function Jt(st){Ke(st)}function Et(st,de){if(st.status===-1){P.b.error(st.message);return}bt.setFieldsValue({src:"/api/attachments/".concat(st.id),type:de.type})}function Ct(st){var de=st.target.files[0];lt(de,Et)}return f.a.createElement(F.a,Object(S.a)({form:bt},Ye,{className:"upload-image-panel",onFinish:Jt}),f.a.createElement(F.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(F.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(Y.a,{style:Je})),f.a.createElement(fe,{onFileChange:Ct}))),f.a.createElement(F.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(Y.a,{style:{width:264}})),f.a.createElement(F.a.Item,{style:{textAlign:"right"}},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))};function fe(be){var Ke=be.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Ke}))}function lt(be,Ke){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var St=new FormData;St.append("editormd-image-file",be),St.append("file_param_name","editormd-image-file"),St.append("byxhr","true");var nn=new window.XMLHttpRequest;nn.withCredentials=!0,nn.addEventListener("load",function(An){Ke(JSON.parse(An.target.responseText),be)},!1),nn.addEventListener("error",function(An){console.error(An)},!1),nn.open("POST","".concat(xe.a,"/api/attachments.json")),nn.send(St)}var qt=D("giR+"),Ft=D("fyUT"),Ot=D("7Kak"),Ve=D("9yH6"),vt=Ve.a.Group,ht={margin:"0 8px"},Bt=function(be){var Ke=be.callback,St=be.onCancel;function nn(An){Ke(An)}return f.a.createElement(F.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:nn},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:ht},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:ht},"\u884C\u6570"),f.a.createElement(F.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Ft.a,null)),f.a.createElement("span",{style:ht},"\u5217\u6570"),f.a.createElement(F.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Ft.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:ht},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(F.a.Item,{name:"align"},f.a.createElement(vt,null,f.a.createElement(Ve.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(Ve.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(Ve.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(Ve.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(A.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))},se=D("ErOA"),Ue=D("7Cbv"),Ge="link",et="upload-image",Wt="code-block",Yt="add-table",on="------------",nt={default:on,left:":".concat(on),center:":".concat(on,":"),right:"".concat(on,":")},tn=D("9VGf"),Ln,We;function Fe(){}var yt=0,At=1e4,tt="\u2581",ot=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function De(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var ye=navigator.platform.toUpperCase().indexOf("MAC")>=0,we=ye?"Cmd":"Ctrl",ae=["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"],oe=(Ln={},Object(k.a)(Ln,we+"-B","bold"),Object(k.a)(Ln,we+"-I","italic"),Ln),pe=(We={},Object(k.a)(We,Ge,"\u6DFB\u52A0\u94FE\u63A5"),Object(k.a)(We,Wt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(k.a)(We,et,"\u6DFB\u52A0\u6587\u4EF6"),Object(k.a)(We,Yt,"\u6DFB\u52A0\u8868\u683C"),We),_e=he.a=function(be){var Ke=be.defaultValue,St=Ke===void 0?"":Ke,nn=be.onChange,An=be.width,bt=An===void 0?"100%":An,Jt=be.height,Et=Jt===void 0?400:Jt,Ct=be.miniToolbar,st=Ct===void 0?!1:Ct,de=be.isFocus,Ae=de===void 0?!1:de,kt=be.watch,ct=be.insertTemp,Qt=be.mode,un=Qt===void 0?"markdown":Qt,Le=be.id,qe=Le===void 0?"markdown-editor-id":Le,mt=be.showResizeBar,jt=mt===void 0?!1:mt,sn=be.noStorage,yn=sn===void 0?!1:sn,nr=be.showNullButton,Kn=nr===void 0?!1:nr,wn=be.hidetoolBar,br=wn===void 0?!1:wn,Er=be.fullScreen,rr=Er===void 0?!1:Er,cr=be.onBlur,Pr=be.onCMBeforeChange,Kr=be.onFullScreen,hi=be.className,pn=hi===void 0?"":hi,or=be.disablePaste,mi=or===void 0?!1:or,wi=be.placeholder,ti=wi===void 0?"":wi,ni=be.values,X=ni===void 0?"":ni,L=Object(b.useState)(null),N=Object(K.a)(L,2),z=N[0],ne=N[1],J=Object(b.useState)(St),je=Object(K.a)(J,2),$t=je[0],In=je[1],Jn=Object(b.useState)(kt),ln=Object(K.a)(Jn,2),tr=ln[0],qn=ln[1],kr=Object(b.useState)(rr),li=Object(K.a)(kr,2),ai=li[0],Gr=li[1],Li=Object(b.useState)(""),Vi=Object(K.a)(Li,2),Dr=Vi[0],Sr=Vi[1],ri=Object(b.useState)(0),Br=Object(K.a)(ri,2),Bn=Br[0],_n=Br[1],Tn=Object(b.useState)(Et),bn=Object(K.a)(Tn,2),ur=bn[0],sr=bn[1],Q=Object(b.useState)(!1),ce=Object(K.a)(Q,2),Ce=ce[0],Te=ce[1],rt=Object(b.useRef)(Object(Ue.a)()),Re=Object(b.useRef)(!1),Xe=Object(b.useRef)(),it=Object(b.useRef)(),Dt=Object(b.useRef)(),Tt=Object(b.useRef)(),Be=Object(b.useRef)(),_t=function(){var Pt=Object(I.a)(M.a.mark(function hn(){var Ht,Rt;return M.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:rt.current}});case 2:Rt=On.sent,Rt!=null&&(Ht=Rt.attachments)!==null&&Ht!==void 0&&Ht.length&&(console.log("cm:",z,it),Rt.attachments.map(function(Vt){Vt.content_type.indexOf("image")>-1?z.replaceSelection("![,](/api/attachments/".concat(Vt.id,"?type=").concat(Vt.content_type,")")):Vt.content_type.indexOf("video")>-1?z.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Vt.content_type.indexOf("pdf")>-1?z.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,'&disposition=inline" target="_blank">').concat(Vt.name,"</a>")):z.replaceSelection("[".concat(Vt.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}));case 4:case"end":return On.stop()}},hn)}));return function(){return Pt.apply(this,arguments)}}();Object(b.useEffect)(function(){In(X),z==null||z.setValue(X)},[X]),Object(b.useEffect)(function(){Kr==null||Kr(ai)},[ai]),Object(b.useEffect)(function(){if(it.current){var Pt=l.a.fromTextArea(it.current,{mode:un,lineNumbers:!st,lineWrapping:!0,value:St,autoCloseTags:!0,autoCloseBrackets:!0});Ae&&Pt.focus();function hn(Ht,Rt){if(mi){Rt.preventDefault();return}var Un=Rt.clipboardData;if(Un){var On=Un.types.toString(),Vt=Un.items;if(On==="Files"||Un.types.indexOf("Files")>-1){if(Rt.preventDefault(),un=="stex")return;try{var ft,jn=Vt[1];((ft=Vt[0])===null||ft===void 0?void 0:ft.kind)==="file"&&(jn=Vt[0]);var fn=jn.getAsFile(),Qn=fn.name.split(".").pop();lt(fn,function(Zt){if(Zt.id){var Rn,Fn,vn;(fn==null||((Rn=fn.type)===null||Rn===void 0)?void 0:Rn.indexOf("image"))>-1?Pt.replaceSelection("![,](/api/attachments/".concat(Zt.id,"?type=").concat(Zt.content_type,")")):(fn==null||((Fn=fn.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Pt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,'"></video>')):(fn==null||((vn=fn.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Pt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):ae.includes(Qn)?Pt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Pt.replaceSelection("[".concat(fn.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(Zt.content_type,")"))}else(Zt==null?void 0:Zt.status)===401&&(document.location.href="/user/login")})}catch(Zt){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Pt.on("paste",hn),Pt.on("dragleave",function(Ht,Rt){Dt.current.classList.remove("mouse-hover-md")}),Pt.on("dragover",function(Ht,Rt){Dt.current.classList.add("mouse-hover-md")}),Pt.on("drop",function(Ht,Rt){Dt.current.classList.add("mouse-hover-md");var Un;if(Un=Rt.dataTransfer.files,Un.length>0){Rt.preventDefault(),Rt.stopPropagation();for(var On=function(jn){var fn=Un[jn],Qn=fn.name.split(".").pop();lt(fn,function(Zt){if(Zt.id){var Rn,Fn,vn;(fn==null||((Rn=fn.type)===null||Rn===void 0)?void 0:Rn.indexOf("image"))>-1?Pt.replaceSelection("![,](/api/attachments/".concat(Zt.id,"?type=").concat(Zt.content_type,")")):(fn==null||((Fn=fn.type)===null||Fn===void 0)?void 0:Fn.indexOf("video"))>-1?Pt.replaceSelection('<video width="100%" controls src="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,'"></video>')):(fn==null||((vn=fn.type)===null||vn===void 0)?void 0:vn.indexOf("pdf"))>-1?Pt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):ae.includes(Qn)?Pt.replaceSelection('<a href="'.concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Pt.replaceSelection("[".concat(fn.name,"](").concat(p.a.API_SERVER,"/api/attachments/").concat(Zt.id,"?type=").concat(Zt.content_type,")"))}else(Zt==null?void 0:Zt.status)===401&&(document.location.href="/user/login")})},Vt=0;Vt<Un.length;Vt++)On(Vt)}}),ne(Pt),function(){Pt.off("paste",hn)}}},[]);var at=Object(b.useCallback)(function(){if(Dt.current)try{}catch(Pt){console.log(Pt,"---- to set md editor body height")}},[ur,Dt,ai]);Object(b.useEffect)(function(){function Pt(){var Ht=new o.default(function(Rt){var Un=Object(U.a)(Rt),On;try{for(Un.s();!(On=Un.n()).done;){var Vt=On.value;(Vt.target.offsetHeight>0||Vt.target.offsetWidth>0)&&(at(),z.setSize("100%","100%"),z.refresh())}}catch(ft){Un.e(ft)}finally{Un.f()}});return Ht.observe(it.current.parentElement),Ht}if(z){var hn=Pt();return function(){hn.unobserve(it.current.parentElement)}}},[z,at]),Object(b.useEffect)(function(){if(z){for(var Pt=[],hn=function(){var Vt=Rt[Ht];Un=Object(K.a)(Vt,2);var ft=Un[0],jn=Un[1],fn=Object(k.a)({},ft,function(){dt(jn)});Pt.push(fn),z.addKeyMap(fn)},Ht=0,Rt=Object.entries(oe);Ht<Rt.length;Ht++){var Un;hn()}return Xe.current=setInterval(function(){Re.current&&_t()},4e3),function(){clearInterval(Xe.current);var On=Object(U.a)(Pt),Vt;try{for(On.s();!(Vt=On.n()).done;){var ft=Vt.value;z.removeKeyMap(ft)}}catch(jn){On.e(jn)}finally{On.f()}}}},[z]),Object(b.useEffect)(function(){rr!==ai&&Gr(rr)},[rr]),Object(tn.a)(function(){if(!yn&&Bn>0){var Pt=new Date().getTime(),hn=window.sessionStorage.getItem(qe);Pt>=Bn+At&&(!hn||hn!==$t)&&(window.sessionStorage.setItem(qe,$t),Te(!0))}},At),Object(b.useEffect)(function(){qn(kt)},[z,kt]),Object(b.useEffect)(function(){z&&(Ae&&z.focus())},[z,Ae]),Object(b.useEffect)(function(){if(tr&&z){var Pt=z.getScrollerElement();function hn(Ht){var Rt=Ht.target;if(Be.current){var Un=Rt.scrollTop/Rt.scrollHeight;Be.current.scrollTop=Be.current.scrollHeight*Un}}return Pt.addEventListener("scroll",hn),function(){Pt.removeEventListener("scroll",hn)}}},[z,tr]),Object(b.useEffect)(function(){if(z&&Pr){function Pt(hn,Ht){Pr(hn,Ht)}return z.on("beforeChange",Pt),function(){z.off("beforeChange",Pt)}}},[z,Pr]),Object(b.useEffect)(function(){if(z&&cr){function Pt(){cr(z.getValue())}return z.on("blur",Pt),function(){z.off("blur",Pt)}}},[z,cr]),Object(b.useEffect)(function(){if(z){function Pt(hn){var Ht=hn.getValue();In(Ht),_n(new Date().getTime()),hn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),nn&&nn(Ht)}return z.on("change",Pt),function(){z.off("change",Pt)}}},[z,nn]),Object(b.useEffect)(function(){z&&(St==null?(z.setValue(""),In("")):St!==z.getValue()&&(z.setValue(St),In(St),z.setCursor(z.lineCount(),0)))},[z,St]);var dt=Object(b.useCallback)(function(Pt){var hn=z.getCursor(),Ht=z.getSelection(),Rt=Ht.split(`
`);switch(Pt){case"bold":return z.replaceSelection("**"+Ht+"**"),Ht===""&&z.setCursor(hn.line,hn.ch+2),z.focus();case"italic":return z.replaceSelection("*"+Ht+"*"),Ht===""&&z.setCursor(hn.line,hn.ch+1),z.focus();case"code":return z.replaceSelection("`"+Ht+"`"),Ht===""&&z.setCursor(hn.line,hn.ch+1),z.focus();case"inline-latex":return z.replaceSelection("`$$"+Ht+"$$`"),Ht===""&&z.setCursor(hn.line,hn.ch+3),z.focus();case"latex":return z.replaceSelection("```latex\n"+Ht+"\n```"),z.setCursor(hn.line+1,Ht.length+1),z.focus();case"line-break":return z.replaceSelection(`<br/>
`),z.focus();case"list-ul":return Ht===""?z.replaceSelection("- "+Ht):z.replaceSelection(Rt.map(function(Un){return Un===""?"":"- ".concat(Un)}).join(`
`)),z.focus();case"list-ol":return Ht===""?z.replaceSelection("1. "+Ht):z.replaceSelection(Rt.map(function(Un,On){return Un===""?"":"".concat(On+1,". ").concat(Un)}).join(`
`)),z.focus();case"add-null-ch":return Ht===""&&z.setCursor(hn.line,hn.ch+1),z.replaceSelection(tt),z.focus();case"inster-template-1":return Ht===""&&z.setCursor(hn.line,hn.ch),z.replaceSelection(ot),z.focus();case"eraser":return z.setValue(""),z.focus();case"trigger-watch":return qn(!tr),z.focus();case"trigger-full-screen":return Gr(!ai),z.focus();case Ge:Sr(Ge);return;case Wt:Sr(Wt);return;case et:Sr(et);return;case Yt:Sr(Yt);return;default:throw new Error}},[z,tr,ai]),wt=Object(b.useCallback)(function(Pt){Sr("");switch(Dr){case Ge:var hn=Pt.title,Ht=Pt.link;return z.replaceSelection("[".concat(hn,"](").concat(Ht,")")),z.focus();case Wt:var Rt=Pt.language,Un=Pt.content;return z.replaceSelection(["```"+Rt,Un,"```"].join(`
`)),z.focus();case et:var On=Pt.src,Vt=Pt.alt;return Vt?z.replaceSelection("![ ".concat(Vt," ]( ").concat(On,' "').concat(Vt,'" )')):z.replaceSelection("![,](".concat(On,")")),z.focus();case Yt:for(var ft=Pt.row,jn=Pt.col,fn=Pt.align,Qn=`
`,Zt=0;Zt<ft;Zt++){for(var Rn=[],Fn=[],vn=0;vn<jn;vn++)Zt===1&&Fn.push(nt[fn]),Rn.push(" ");Zt===1&&(Qn+="| ".concat(Fn.join(" | "),` |
`)),Qn+="| ".concat(Rn.join(jn===1?"":" | "),` |
`)}return z.replaceSelection(Qn+`
`),z.focus();default:throw new Error}},[z,Dr]),It=Object(b.useMemo)(function(){switch(Dr){case Ge:return f.a.createElement(ie,{callback:wt,onCancel:gt});case Wt:return f.a.createElement(me.b,{callback:wt,onCancel:gt});case et:return f.a.createElement(ve,{callback:wt,onCancel:gt});case Yt:return f.a.createElement(Bt,{callback:wt,onCancel:gt});default:return null}},[Dr]);function gt(){Sr("")}Object(b.useEffect)(function(){if(Tt.current){var Pt=Tt.current,hn=!1,Ht=0;function Rt(Vt){hn=!0,Ht=Vt.pageY}function Un(){hn=!1}function On(Vt){if(hn){var ft=Vt.pageY-Ht;ft<0&&(ft=0),ft>300&&(ft=300);var jn=Et+ft+"px";sr(jn)}}return Pt.addEventListener("mousedown",Rt),document.addEventListener("mousemove",On),document.addEventListener("mouseup",Un),function(){Pt.removeEventListener("mousedown",Rt),document.removeEventListener("mousemove",On),document.removeEventListener("mouseup",Un)}}},[z,Tt]),Object(b.useEffect)(function(){sr(Et)},[Et]);var Xt=De(bt),dn=De(ur),Pn={width:Xt,height:dn},Gn=Object(b.useMemo)(function(){if(Bn){var Pt=new Date(Bn),hn=Pt.getHours(),Ht=Pt.getMinutes(),Rt=Pt.getSeconds();return hn=hn<10?"0"+hn:hn,Ht=Ht<10?"0"+Ht:Ht,Rt=Rt<10?"0"+Rt:Rt,"".concat(hn,":").concat(Ht,":").concat(Rt)}return 0},[Bn]);function Sn(){window.sessionStorage.removeItem(qe),Te(!1),_n(0)}function Nn(){Te(!1),_n(0),z.setValue(window.sessionStorage.getItem(qe))}function Mn(Pt,hn){var Ht=z.getValue();Ht=Ht.replace(Pt,hn),In(Ht),z==null||z.setValue(Ht)}return f.a.createElement(b.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Dt},f.a.createElement("div",{className:"markdown-editor-container ".concat(pn," ").concat(tr?"on-preview":""," ").concat(st?"mini":""," ").concat(ai?"full-screen":""),style:Pn},f.a.createElement(w,{insertTemp:ct,watch:tr,fullScreen:ai,showNullButton:Kn,onActionCallback:dt,hidetoolBar:br,uuid:rt.current,setOpenPhones:function(){Re.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:it,placeholder:ti})),tr?f.a.createElement("div",{ref:Be,className:"preview-container"},un==="stex"&&f.a.createElement(R,{value:$t}),un!=="stex"&&f.a.createElement(C.a,{edit:!0,value:$t,replaces:Mn})):null))),jt?f.a.createElement("a",{ref:Tt,className:"editor-resize"}):null,f.a.createElement(j.a,null,pe[Dr]?f.a.createElement(V.a,{centered:!0,title:pe[Dr],visible:!0,onCancel:gt,footer:null,className:"markdown-popup-form"},It):null))}},RotF:function(Kt,he,D){Kt.exports=D("LSTS")},"SA+Z":function(Kt,he,D){var Z=D("wTVA"),V=D("EbDI"),U=D("ZhPi"),G=D("wkBT");function P(I){return Z(I)||V(I)||U(I)||G()}Kt.exports=P,Kt.exports.__esModule=!0,Kt.exports.default=Kt.exports},SJMd:function(Kt,he){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var D,Z,V,U=!1,G,P;window.PR_SHOULD_USE_CONTINUATION=!0;var I,K;(function(){var k=window,r=["break,continue,do,else,for,if,return,while"],M=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],b=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[b,"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"],m=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",a=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],c="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=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],i=[r,"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"],n=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[f,l,m,a,c,s,i,n],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,C="str",R="kwd",S="com",v="typ",E="lit",h="pun",p="pln",_="tag",g="dec",w="src",j="atn",B="atv",A="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function F(vt){for(var ht=0,Bt=!1,se=!1,Ue=0,Ge=vt.length;Ue<Ge;++Ue){var et=vt[Ue];if(et.ignoreCase)se=!0;else if(/[a-z]/i.test(et.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Bt=!0,se=!1;break}}var Wt={b:8,t:9,n:10,v:11,f:12,r:13};function Yt(We){var Fe=We.charCodeAt(0);if(Fe!==92)return Fe;var yt=We.charAt(1);return Fe=Wt[yt],Fe||("0"<=yt&&yt<="7"?parseInt(We.substring(1),8):yt==="u"||yt==="x"?parseInt(We.substring(2),16):We.charCodeAt(1))}function on(We){if(We<32)return(We<16?"\\x0":"\\x")+We.toString(16);var Fe=String.fromCharCode(We);return Fe==="\\"||Fe==="-"||Fe==="]"||Fe==="^"?"\\"+Fe:Fe}function nt(We){var Fe=We.substring(1,We.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),yt=[],At=Fe[0]==="^",tt=["["];At&&tt.push("^");for(var ot=At?1:0,De=Fe.length;ot<De;++ot){var ye=Fe[ot];if(/\\[bdsw]/i.test(ye))tt.push(ye);else{var we=Yt(ye),ae;ot+2<De&&Fe[ot+1]==="-"?(ae=Yt(Fe[ot+2]),ot+=2):ae=we,yt.push([we,ae]),ae<65||we>122||(ae<65||we>90||yt.push([Math.max(65,we)|32,Math.min(ae,90)|32]),ae<97||we>122||yt.push([Math.max(97,we)&~32,Math.min(ae,122)&~32]))}}yt.sort(function(be,Ke){return be[0]-Ke[0]||Ke[1]-be[1]});for(var oe=[],pe=[],ot=0;ot<yt.length;++ot){var _e=yt[ot];_e[0]<=pe[1]+1?pe[1]=Math.max(pe[1],_e[1]):oe.push(pe=_e)}for(var ot=0;ot<oe.length;++ot){var _e=oe[ot];tt.push(on(_e[0])),_e[1]>_e[0]&&(_e[1]+1>_e[0]&&tt.push("-"),tt.push(on(_e[1])))}return tt.push("]"),tt.join("")}function tn(We){for(var Fe=We.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")),yt=Fe.length,At=[],tt=0,ot=0;tt<yt;++tt){var De=Fe[tt];if(De==="(")++ot;else if(De.charAt(0)==="\\"){var ye=+De.substring(1);ye&&(ye<=ot?At[ye]=-1:Fe[tt]=on(ye))}}for(var tt=1;tt<At.length;++tt)At[tt]===-1&&(At[tt]=++ht);for(var tt=0,ot=0;tt<yt;++tt){var De=Fe[tt];if(De==="(")++ot,At[ot]||(Fe[tt]="(?:");else if(De.charAt(0)==="\\"){var ye=+De.substring(1);ye&&ye<=ot&&(Fe[tt]="\\"+At[ye])}}for(var tt=0;tt<yt;++tt)Fe[tt]==="^"&&Fe[tt+1]!=="^"&&(Fe[tt]="");if(We.ignoreCase&&Bt)for(var tt=0;tt<yt;++tt){var De=Fe[tt],we=De.charAt(0);De.length>=2&&we==="["?Fe[tt]=nt(De):we!=="\\"&&(Fe[tt]=De.replace(/[a-zA-Z]/g,function(pe){var _e=pe.charCodeAt(0);return"["+String.fromCharCode(_e&~32,_e|32)+"]"}))}return Fe.join("")}for(var Ln=[],Ue=0,Ge=vt.length;Ue<Ge;++Ue){var et=vt[Ue];if(et.global||et.multiline)throw new Error(""+et);Ln.push("(?:"+tn(et)+")")}return new RegExp(Ln.join("|"),se?"gi":"g")}function x(vt,ht){var Bt=/(?:^|\s)nocode(?:\s|$)/,se=[],Ue=0,Ge=[],et=0;function Wt(Yt){var on=Yt.nodeType;if(on==1){if(Bt.test(Yt.className))return;for(var nt=Yt.firstChild;nt;nt=nt.nextSibling)Wt(nt);var tn=Yt.nodeName.toLowerCase();(tn==="br"||tn==="li")&&(se[et]=`
`,Ge[et<<1]=Ue++,Ge[et++<<1|1]=Yt)}else if(on==3||on==4){var Ln=Yt.nodeValue;Ln.length&&(ht?Ln=Ln.replace(/\r\n?/g,`
`):Ln=Ln.replace(/[ \t\r\n]+/g," "),se[et]=Ln,Ge[et<<1]=Ue,Ue+=Ln.length,Ge[et++<<1|1]=Yt)}}return Wt(vt),{sourceCode:se.join("").replace(/\n$/,""),spans:Ge}}function Y(vt,ht,Bt,se,Ue){if(!Bt)return;var Ge={sourceNode:vt,pre:1,langExtension:null,numberLines:null,sourceCode:Bt,spans:null,basePos:ht,decorations:null};se(Ge),Ue.push.apply(Ue,Ge.decorations)}var q=/\S/;function ie(vt){for(var ht=void 0,Bt=vt.firstChild;Bt;Bt=Bt.nextSibling){var se=Bt.nodeType;ht=se===1?ht?vt:Bt:se===3&&q.test(Bt.nodeValue)?vt:ht}return ht===vt?void 0:ht}function me(vt,ht){var Bt={},se;(function(){for(var et=vt.concat(ht),Wt=[],Yt={},on=0,nt=et.length;on<nt;++on){var tn=et[on],Ln=tn[3];if(Ln)for(var We=Ln.length;--We>=0;)Bt[Ln.charAt(We)]=tn;var Fe=tn[1],yt=""+Fe;Yt.hasOwnProperty(yt)||(Wt.push(Fe),Yt[yt]=null)}Wt.push(/[\0-\uffff]/),se=F(Wt)})();var Ue=ht.length,Ge=function(et){for(var Wt=et.sourceCode,Yt=et.basePos,on=et.sourceNode,nt=[Yt,p],tn=0,Ln=Wt.match(se)||[],We={},Fe=0,yt=Ln.length;Fe<yt;++Fe){var At=Ln[Fe],tt=We[At],ot=void 0,De;if(typeof tt=="string")De=!1;else{var ye=Bt[At.charAt(0)];if(ye)ot=At.match(ye[1]),tt=ye[0];else{for(var we=0;we<Ue;++we)if(ye=ht[we],ot=At.match(ye[1]),ot){tt=ye[0];break}ot||(tt=p)}De=tt.length>=5&&tt.substring(0,5)==="lang-",De&&!(ot&&typeof ot[1]=="string")&&(De=!1,tt=w),De||(We[At]=tt)}var ae=tn;if(tn+=At.length,!De)nt.push(Yt+ae,tt);else{var oe=ot[1],pe=At.indexOf(oe),_e=pe+oe.length;ot[2]&&(_e=At.length-ot[2].length,pe=_e-oe.length);var be=tt.substring(5);Y(on,Yt+ae,At.substring(0,pe),Ge,nt),Y(on,Yt+ae+pe,oe,fe(be,oe),nt),Y(on,Yt+ae+_e,At.substring(_e),Ge,nt)}}et.decorations=nt};return Ge}function $e(vt){var ht=[],Bt=[];vt.tripleQuotedStrings?ht.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):vt.multiLineStrings?ht.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ht.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),vt.verbatimStrings&&Bt.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=vt.hashComments;se&&(vt.cStyleComments?(se>1?ht.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ht.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Bt.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ht.push([S,/^#[^\r\n]*/,null,"#"])),vt.cStyleComments&&(Bt.push([S,/^\/\/[^\r\n]*/,null]),Bt.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ue=vt.regexLiterals;if(Ue){var Ge=Ue>1?"":`
\r`,et=Ge?".":"[\\S\\s]",Wt="/(?=[^/*"+Ge+"])(?:[^/\\x5B\\x5C"+Ge+"]|\\x5C"+et+"|\\x5B(?:[^\\x5C\\x5D"+Ge+"]|\\x5C"+et+")*(?:\\x5D|$))+/";Bt.push(["lang-regex",RegExp("^"+H+"("+Wt+")")])}var Yt=vt.types;Yt&&Bt.push([v,Yt]);var on=(""+vt.keywords).replace(/^ | $/g,"");on.length&&Bt.push([R,new RegExp("^(?:"+on.replace(/[\s,]+/g,"|")+")\\b"),null]),ht.push([p,/^\s+/,null,` \r
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return vt.regexLiterals&&(nt+="(?!s*/)"),Bt.push([E,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[p,/^[a-z_$][a-z_$@0-9]*/i,null],[E,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[p,/^\\[\s\S]?/,null],[h,new RegExp(nt),null]),me(ht,Bt)}var xe=$e({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ie(vt,ht,Bt){for(var se=/(?:^|\s)nocode(?:\s|$)/,Ue=/\r\n?|\n/,Ge=vt.ownerDocument,et=Ge.createElement("li");vt.firstChild;)et.appendChild(vt.firstChild);var Wt=[et];function Yt(Fe){var yt=Fe.nodeType;if(yt==1&&!se.test(Fe.className))if(Fe.nodeName==="br")on(Fe),Fe.parentNode&&Fe.parentNode.removeChild(Fe);else for(var At=Fe.firstChild;At;At=At.nextSibling)Yt(At);else if((yt==3||yt==4)&&Bt){var tt=Fe.nodeValue,ot=tt.match(Ue);if(ot){var De=tt.substring(0,ot.index);Fe.nodeValue=De;var ye=tt.substring(ot.index+ot[0].length);if(ye){var we=Fe.parentNode;we.insertBefore(Ge.createTextNode(ye),Fe.nextSibling)}on(Fe),De||Fe.parentNode.removeChild(Fe)}}}function on(Fe){for(;!Fe.nextSibling;)if(Fe=Fe.parentNode,!Fe)return;function yt(ot,De){var ye=De?ot.cloneNode(!1):ot,we=ot.parentNode;if(we){var ae=yt(we,1),oe=ot.nextSibling;ae.appendChild(ye);for(var pe=oe;pe;pe=oe)oe=pe.nextSibling,ae.appendChild(pe)}return ye}for(var At=yt(Fe.nextSibling,0),tt;(tt=At.parentNode)&&tt.nodeType===1;)At=tt;Wt.push(At)}for(var nt=0;nt<Wt.length;++nt)Yt(Wt[nt]);ht===(ht|0)&&Wt[0].setAttribute("value",ht);var tn=Ge.createElement("ol");tn.className="linenums";for(var Ln=Math.max(0,ht-1|0)||0,nt=0,We=Wt.length;nt<We;++nt)et=Wt[nt],et.className="L"+(nt+Ln)%10,et.firstChild||et.appendChild(Ge.createTextNode("\xA0")),tn.appendChild(et);vt.appendChild(tn)}function Je(vt){var ht=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ht=ht&&+ht[1]<=8;var Bt=/\n/g,se=vt.sourceCode,Ue=se.length,Ge=0,et=vt.spans,Wt=et.length,Yt=0,on=vt.decorations,nt=on.length,tn=0;on[nt]=Ue;var Ln,We;for(We=Ln=0;We<nt;)on[We]!==on[We+2]?(on[Ln++]=on[We++],on[Ln++]=on[We++]):We+=2;for(nt=Ln,We=Ln=0;We<nt;){for(var Fe=on[We],yt=on[We+1],At=We+2;At+2<=nt&&on[At+1]===yt;)At+=2;on[Ln++]=Fe,on[Ln++]=yt,We=At}nt=on.length=Ln;var tt=vt.sourceNode,ot="";tt&&(ot=tt.style.display,tt.style.display="none");try{for(var De=null;Yt<Wt;){var ye=et[Yt],we=et[Yt+2]||Ue,ae=on[tn+2]||Ue,At=Math.min(we,ae),oe=et[Yt+1],pe;if(oe.nodeType!==1&&(pe=se.substring(Ge,At))){ht&&(pe=pe.replace(Bt,"\r")),oe.nodeValue=pe;var _e=oe.ownerDocument,be=_e.createElement("span");be.className=on[tn+1];var Ke=oe.parentNode;Ke.replaceChild(be,oe),be.appendChild(oe),Ge<we&&(et[Yt+1]=oe=_e.createTextNode(se.substring(At,we)),Ke.insertBefore(oe,be.nextSibling))}Ge=At,Ge>=we&&(Yt+=2),Ge>=ae&&(tn+=2)}}finally{tt&&(tt.style.display=ot)}}var Ye={};function ve(vt,ht){for(var Bt=ht.length;--Bt>=0;){var se=ht[Bt];Ye.hasOwnProperty(se)?k.console&&console.warn("cannot override language handler %s",se):Ye[se]=vt}}function fe(vt,ht){return vt&&Ye.hasOwnProperty(vt)||(vt=/^\s*</.test(ht)?"default-markup":"default-code"),Ye[vt]}ve(xe,["default-code"]),ve(me([],[[p,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ve(me([[p,/^[\s]+/,null,` \r
`],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["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"]),ve(me([],[[B,/^[\s\S]+/]]),["uq.val"]),ve($e({keywords:f,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),ve($e({keywords:"null,true,false"}),["json"]),ve($e({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),ve($e({keywords:m,cStyleComments:!0}),["java"]),ve($e({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ve($e({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ve($e({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ve($e({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ve($e({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ve($e({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ve(me([],[[C,/^[\s\S]+/]]),["regex"]);function lt(vt){var ht=vt.langExtension;try{var Bt=x(vt.sourceNode,vt.pre),se=Bt.sourceCode;vt.sourceCode=se,vt.spans=Bt.spans,vt.basePos=0,fe(ht,se)(vt),Je(vt)}catch(Ue){k.console&&console.log(Ue&&Ue.stack||Ue)}}function qt(vt,ht,Bt){var se=Bt||!1,Ue=ht||null,Ge=document.createElement("div");Ge.innerHTML="<pre>"+vt+"</pre>",Ge=Ge.firstChild,se&&Ie(Ge,se,!0);var et={langExtension:Ue,numberLines:se,sourceNode:Ge,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return lt(et),Ge.innerHTML}function Ft(vt,ht){var Bt=ht||document.body,se=Bt.ownerDocument||document;function Ue(ye){return Bt.getElementsByTagName(ye)}for(var Ge=[Ue("pre"),Ue("code"),Ue("xmp")],et=[],Wt=0;Wt<Ge.length;++Wt)for(var Yt=0,on=Ge[Wt].length;Yt<on;++Yt)et.push(Ge[Wt][Yt]);Ge=null;var nt=Date;nt.now||(nt={now:function(){return+new Date}});var tn=0,Ln=/\blang(?:uage)?-([\w.]+)(?!\S)/,We=/\bprettyprint\b/,Fe=/\bprettyprinted\b/,yt=/pre|xmp/i,At=/^code$/i,tt=/^(?:pre|code|xmp)$/i,ot={};function De(){for(var ye=k.PR_SHOULD_USE_CONTINUATION?nt.now()+250:Infinity;tn<et.length&&nt.now()<ye;tn++){for(var we=et[tn],ae=ot,oe=we;oe=oe.previousSibling;){var pe=oe.nodeType,_e=(pe===7||pe===8)&&oe.nodeValue;if(_e?!/^\??prettify\b/.test(_e):pe!==3||/\S/.test(oe.nodeValue))break;if(_e){ae={},_e.replace(/\b(\w+)=([\w:.%+-]+)/g,function(kt,ct,Qt){ae[ct]=Qt});break}}var be=we.className;if((ae!==ot||We.test(be))&&!Fe.test(be)){for(var Ke=!1,St=we.parentNode;St;St=St.parentNode){var nn=St.tagName;if(tt.test(nn)&&St.className&&We.test(St.className)){Ke=!0;break}}if(!Ke){we.className+=" prettyprinted";var An=ae.lang;if(!An){An=be.match(Ln);var bt;!An&&(bt=ie(we))&&At.test(bt.tagName)&&(An=bt.className.match(Ln)),An&&(An=An[1])}var Jt;if(yt.test(we.tagName))Jt=1;else{var Et=we.currentStyle,Ct=se.defaultView,st=Et?Et.whiteSpace:Ct&&Ct.getComputedStyle?Ct.getComputedStyle(we,null).getPropertyValue("white-space"):0;Jt=st&&st.substring(0,3)==="pre"}var de=ae.linenums;(de=de==="true"||+de)||(de=be.match(/\blinenums\b(?::(\d+))?/),de=de?de[1]&&de[1].length?+de[1]:!0:!1),de&&Ie(we,de,Jt);var Ae={langExtension:An,sourceNode:we,numberLines:de,pre:Jt,sourceCode:null,basePos:null,spans:null,decorations:null};lt(Ae)}}}tn<et.length?k.setTimeout(De,250):typeof vt=="function"&&vt()}De()}var Ot=k.PR={createSimpleLexer:me,registerLangHandler:ve,sourceDecorator:$e,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:B,PR_COMMENT:S,PR_DECLARATION:g,PR_KEYWORD:R,PR_LITERAL:E,PR_NOCODE:A,PR_PLAIN:p,PR_PUNCTUATION:h,PR_SOURCE:w,PR_STRING:C,PR_TAG:_,PR_TYPE:v,prettyPrintOne:U?k.prettyPrintOne=qt:I=qt,prettyPrint:K=U?k.prettyPrint=Ft:K=Ft},Ve=k.define;typeof Ve=="function"&&Ve.amd&&Ve("google-code-prettify",[],function(){return Ot})})()},T7RX:function(Kt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("k1fw"),G=D("miYZ"),P=D("tsqr"),I=D("9og8"),K=D("PpiC"),k=D("WmNS"),r=D.n(k),M=D("q1tI"),b=D.n(M),f=D("ErOA"),m=D("Ty5D"),l=D("9kvl"),o=function(c){var s=c.shixunHomeworks,i=c.dispatch,n=Object(K.a)(c,["shixunHomeworks","dispatch"]),O=Object(m.i)();return b.a.createElement(V.a,{centered:!0,title:"\u63D0\u793A",visible:s.actionTabs.key==="\u6253\u56DE\u91CD\u505A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(I.a)(r.a.mark(function T(){var C;return r.a.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,Object(f.a)("/api/myshixuns/".concat(s.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:O.coursesId}});case 2:C=S.sent,C.shixun_identifier&&(P.b.success("\u64CD\u4F5C\u6210\u529F"),i({type:"shixunHomeworks/setActionTabs",payload:{}}),i({type:"shixunHomeworks/getWorkList",payload:Object(U.a)({},s.actionTabs.params)}));case 4:case"end":return S.stop()}},T)})),onCancel:function(){i({type:"shixunHomeworks/setActionTabs",payload:{}})}},b.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),b.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};he.a=Object(l.a)(function(a){var c=a.shixunHomeworks;return{shixunHomeworks:c}})(o)},T8No:function(Kt,he,D){"use strict";D.d(he,"a",function(){return K}),D.d(he,"e",function(){return k}),D.d(he,"c",function(){return h}),D.d(he,"b",function(){return p}),D.d(he,"d",function(){return _}),D.d(he,"f",function(){return j});var Z=D("MNsG"),V=D("N0LK"),U=D("Cg/j");let G=Z.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",Z.f),P.set("isLinux",Z.d),P.set("isWindows",Z.i),P.set("isWeb",Z.h),P.set("isMacNative",Z.f&&!Z.h),P.set("isEdge",G.indexOf("Edg/")>=0),P.set("isFirefox",G.indexOf("Firefox")>=0),P.set("isChrome",G.indexOf("Chrome")>=0),P.set("isSafari",G.indexOf("Safari")>=0);const I=Object.prototype.hasOwnProperty;class K{static has(A){return f.create(A)}static equals(A,H){return m.create(A,H)}static regex(A,H){return C.create(A,H)}static not(A){return c.create(A)}static and(...A){return v.create(A,null)}static or(...A){return E.create(A,null,!0)}static deserialize(A,H=!1){return A?this._deserializeOrExpression(A,H):void 0}static _deserializeOrExpression(A,H){let F=A.split("||");return E.create(F.map(x=>this._deserializeAndExpression(x,H)),null,!0)}static _deserializeAndExpression(A,H){let F=A.split("&&");return v.create(F.map(x=>this._deserializeOne(x,H)),null)}static _deserializeOne(A,H){if(A=A.trim(),A.indexOf("!=")>=0){let F=A.split("!=");return a.create(F[0].trim(),this._deserializeValue(F[1],H))}if(A.indexOf("==")>=0){let F=A.split("==");return m.create(F[0].trim(),this._deserializeValue(F[1],H))}if(A.indexOf("=~")>=0){let F=A.split("=~");return C.create(F[0].trim(),this._deserializeRegexValue(F[1],H))}if(A.indexOf(" in ")>=0){let F=A.split(" in ");return l.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const F=A.split(">=");return n.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const F=A.split(">");return i.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const F=A.split("<=");return T.create(F[0].trim(),F[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const F=A.split("<");return O.create(F[0].trim(),F[1].trim())}return/^\!\s*/.test(A)?c.create(A.substr(1).trim()):f.create(A)}static _deserializeValue(A,H){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let F=/^'([^']*)'$/.exec(A);return F?F[1].trim():A}static _deserializeRegexValue(A,H){if(Object(V.C)(A)){if(H)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let F=A.indexOf("/"),x=A.lastIndexOf("/");if(F===x||F<0){if(H)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let Y=A.slice(F+1,x),q=A[x+1]==="i"?"i":"";try{return new RegExp(Y,q)}catch(ie){if(H)throw new Error(`bad regexp-value '${A}', parse error: ${ie}`);return console.warn(`bad regexp-value '${A}', parse error: ${ie}`),null}}}function k(A,H){const F=A?A.substituteConstants():void 0,x=H?H.substituteConstants():void 0;return!F&&!x?!0:!F||!x?!1:F.equals(x)}function r(A,H){return A.cmp(H)}class M{constructor(){this.type=0}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!1}serialize(){return"false"}keys(){return[]}negate(){return b.INSTANCE}}M.INSTANCE=new M;class b{constructor(){this.type=1}cmp(A){return this.type-A.type}equals(A){return A.type===this.type}substituteConstants(){return this}evaluate(A){return!0}serialize(){return"true"}keys(){return[]}negate(){return M.INSTANCE}}b.INSTANCE=new b;class f{constructor(A,H){this.key=A,this.negated=H,this.type=2}static create(A,H=null){const F=P.get(A);return typeof F=="boolean"?F?b.INSTANCE:M.INSTANCE:new f(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=P.get(this.key);return typeof A=="boolean"?A?b.INSTANCE:M.INSTANCE:this}evaluate(A){return!!A.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this)),this.negated}}class m{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=4}static create(A,H,F=null){if(typeof H=="boolean")return H?f.create(A,F):c.create(A,F);const x=P.get(A);if(typeof x=="boolean"){const Y=x?"true":"false";return H===Y?b.INSTANCE:M.INSTANCE}return new m(A,H,F)}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=P.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?b.INSTANCE:M.INSTANCE}return this}evaluate(A){return A.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class l{constructor(A,H){this.key=A,this.valueKey=H,this.type=10,this.negated=null}static create(A,H){return new l(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.valueKey,A.key,A.valueKey)}equals(A){return A.type===this.type?this.key===A.key&&this.valueKey===A.valueKey:!1}substituteConstants(){return this}evaluate(A){const H=A.getValue(this.valueKey),F=A.getValue(this.key);return Array.isArray(H)?H.indexOf(F)>=0:typeof F=="string"&&typeof H=="object"&&H!==null?I.call(H,F):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(A){this._actual=A,this.type=11}static create(A){return new o(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class a{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=5}static create(A,H,F=null){if(typeof H=="boolean")return H?c.create(A,F):f.create(A,F);const x=P.get(A);if(typeof x=="boolean"){const Y=x?"true":"false";return H===Y?M.INSTANCE:b.INSTANCE}return new a(A,H,F)}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){const A=P.get(this.key);if(typeof A=="boolean"){const H=A?"true":"false";return this.value===H?M.INSTANCE:b.INSTANCE}return this}evaluate(A){return A.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class c{constructor(A,H){this.key=A,this.negated=H,this.type=3}static create(A,H=null){const F=P.get(A);return typeof F=="boolean"?F?M.INSTANCE:b.INSTANCE:new c(A,H)}cmp(A){return A.type!==this.type?this.type-A.type:g(this.key,A.key)}equals(A){return A.type===this.type?this.key===A.key:!1}substituteConstants(){const A=P.get(this.key);return typeof A=="boolean"?A?M.INSTANCE:b.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function s(A,H){if(typeof A=="string"){const F=parseFloat(A);isNaN(F)||(A=F)}return typeof A=="string"||typeof A=="number"?H(A):M.INSTANCE}class i{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=12}static create(A,H,F=null){return s(H,x=>new i(A,x,F))}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class n{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=13}static create(A,H,F=null){return s(H,x=>new n(A,x,F))}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=O.create(this.key,this.value,this)),this.negated}}class O{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=14}static create(A,H,F=null){return s(H,x=>new O(A,x,F))}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this.value,this)),this.negated}}class T{constructor(A,H,F){this.key=A,this.value=H,this.negated=F,this.type=15}static create(A,H,F=null){return s(H,x=>new T(A,x,F))}cmp(A){return A.type!==this.type?this.type-A.type:w(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class C{constructor(A,H){this.key=A,this.regexp=H,this.type=7,this.negated=null}static create(A,H){return new C(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.key<A.key)return-1;if(this.key>A.key)return 1;const H=this.regexp?this.regexp.source:"",F=A.regexp?A.regexp.source:"";return H<F?-1:H>F?1:0}equals(A){if(A.type===this.type){const H=this.regexp?this.regexp.source:"",F=A.regexp?A.regexp.source:"";return this.key===A.key&&H===F}return!1}substituteConstants(){return this}evaluate(A){let H=A.getValue(this.key);return this.regexp?this.regexp.test(H):!1}serialize(){const A=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${A}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(A){this._actual=A,this.type=8}static create(A){return new R(A)}cmp(A){return A.type!==this.type?this.type-A.type:this._actual.cmp(A._actual)}equals(A){return A.type===this.type?this._actual.equals(A._actual):!1}substituteConstants(){return this}evaluate(A){return!this._actual.evaluate(A)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function S(A){let H=null;for(let F=0,x=A.length;F<x;F++){const Y=A[F].substituteConstants();if(A[F]!==Y&&H===null){H=[];for(let q=0;q<F;q++)H[q]=A[q]}H!==null&&(H[F]=Y)}return H===null?A:H}class v{constructor(A,H){this.expr=A,this.negated=H,this.type=6}static create(A,H){return v._normalizeArr(A,H)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,F=this.expr.length;H<F;H++){const x=r(this.expr[H],A.expr[H]);if(x!==0)return x}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:v.create(A,this.negated)}evaluate(A){for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].evaluate(A))return!1;return!0}static _normalizeArr(A,H){const F=[];let x=!1;for(const Y of A){if(!Y)continue;if(Y.type===1){x=!0;continue}if(Y.type===0)return M.INSTANCE;if(Y.type===6){F.push(...Y.expr);continue}F.push(Y)}if(F.length===0&&x)return b.INSTANCE;if(F.length===0)return;if(F.length===1)return F[0];F.sort(r);for(let Y=1;Y<F.length;Y++)F[Y-1].equals(F[Y])&&(F.splice(Y,1),Y--);if(F.length===1)return F[0];for(;F.length>1;){const Y=F[F.length-1];if(Y.type!==9)break;F.pop();const q=F.pop(),ie=F.length===0,me=E.create(Y.expr.map($e=>v.create([$e,q],null)),null,ie);me&&(F.push(me),F.sort(r))}return F.length===1?F[0]:new v(F,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){const A=[];for(let H of this.expr)A.push(H.negate());this.negated=E.create(A,this,!0)}return this.negated}}class E{constructor(A,H){this.expr=A,this.negated=H,this.type=9}static create(A,H,F){return E._normalizeArr(A,H,F)}cmp(A){if(A.type!==this.type)return this.type-A.type;if(this.expr.length<A.expr.length)return-1;if(this.expr.length>A.expr.length)return 1;for(let H=0,F=this.expr.length;H<F;H++){const x=r(this.expr[H],A.expr[H]);if(x!==0)return x}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let H=0,F=this.expr.length;H<F;H++)if(!this.expr[H].equals(A.expr[H]))return!1;return!0}return!1}substituteConstants(){const A=S(this.expr);return A===this.expr?this:E.create(A,this.negated,!1)}evaluate(A){for(let H=0,F=this.expr.length;H<F;H++)if(this.expr[H].evaluate(A))return!0;return!1}static _normalizeArr(A,H,F){let x=[],Y=!1;if(A){for(let q=0,ie=A.length;q<ie;q++){const me=A[q];if(!me)continue;if(me.type===0){Y=!0;continue}if(me.type===1)return b.INSTANCE;if(me.type===9){x=x.concat(me.expr);continue}x.push(me)}if(x.length===0&&Y)return M.INSTANCE;x.sort(r)}if(x.length===0)return;if(x.length===1)return x[0];for(let q=1;q<x.length;q++)x[q-1].equals(x[q])&&(x.splice(q,1),q--);if(x.length===1)return x[0];if(F){for(let q=0;q<x.length;q++)for(let ie=q+1;ie<x.length;ie++)j(x[q],x[ie])&&(x.splice(ie,1),ie--);if(x.length===1)return x[0]}return new E(x,H)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let H of this.expr)A.push(...H.keys());return A}negate(){if(!this.negated){let A=[];for(let H of this.expr)A.push(H.negate());for(;A.length>1;){const H=A.shift(),F=A.shift(),x=[];for(const q of B(H))for(const ie of B(F))x.push(v.create([q,ie],null));const Y=A.length===0;A.unshift(E.create(x,null,Y))}this.negated=A[0]}return this.negated}}class h extends f{constructor(A,H,F){super(A,null);this._defaultValue=H,typeof F=="object"?h._info.push(Object.assign(Object.assign({},F),{key:A})):F!==!0&&h._info.push({key:A,description:F,type:H!=null?typeof H:void 0})}static all(){return h._info.values()}bindTo(A){return A.createKey(this.key,this._defaultValue)}getValue(A){return A.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(A){return m.create(this.key,A)}}h._info=[];const p=Object(U.c)("contextKeyService"),_="setContext";function g(A,H){return A<H?-1:A>H?1:0}function w(A,H,F,x){return A<F?-1:A>F?1:H<x?-1:H>x?1:0}function j(A,H){if(H.type===6&&A.type!==9&&A.type!==6){for(const Y of H.expr)if(A.equals(Y))return!0}const F=A.negate(),x=B(F).concat(B(H));x.sort(r);for(let Y=0;Y<x.length;Y++){const q=x[Y],ie=q.negate();for(let me=Y+1;me<x.length;me++){const $e=x[me];if(ie.equals($e))return!0}}return!1}function B(A){return A.type===9?A.expr:[A]}},TXwP:function(Kt,he,D){var Z,V;(function(){var U;(function(){"use strict";var P=[,,function(r){function M(m){this.__parent=m,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}M.prototype.clone_empty=function(){var m=new M(this.__parent);return m.set_indent(this.__indent_count,this.__alignment_count),m},M.prototype.item=function(m){return m<0?this.__items[this.__items.length+m]:this.__items[m]},M.prototype.has_match=function(m){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(m))return!0;return!1},M.prototype.set_indent=function(m,l){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},M.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},M.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},M.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},M.prototype.is_empty=function(){return this.__items.length===0},M.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},M.prototype.push=function(m){this.__items.push(m);var l=m.lastIndexOf(`
`);l!==-1?this.__character_count=m.length-l:this.__character_count+=m.length},M.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},M.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},M.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},M.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},M.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function b(m,l){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),l=l||"",m.indent_level>0&&(l=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}b.prototype.get_indent_size=function(m,l){var o=this.__base_string_length;return l=l||0,m<0&&(o=0),o+=m*this.__indent_size,o+=l,o},b.prototype.get_indent_string=function(m,l){var o=this.__base_string;return l=l||0,m<0&&(m=0,o=""),l+=m*this.__indent_size,this.__ensure_cache(l),o+=this.__cache[l],o},b.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var m=this.__cache.length,l=0,o="";this.__indent_size&&m>=this.__indent_size&&(l=Math.floor(m/this.__indent_size),m-=l*this.__indent_size,o=new Array(l+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function f(m,l){this.__indent_cache=new b(m,l),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new M(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(m,l){return this.__indent_cache.get_indent_string(m,l)},f.prototype.get_indent_size=function(m,l){return this.__indent_cache.get_indent_size(m,l)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(m){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return m!==`
`&&(o=o.replace(/[\n]/g,m)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(m,l){return m=m||0,l=l||0,this.next_line.set_indent(m,l),this.__lines.length>1?(this.current_line.set_indent(m,l),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(m){for(var l=0;l<m.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(m.whitespace_before),this.current_line.push(m.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(m){this.__add_space_before_token(),this.current_line.push(m),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(m){for(var l=this.__lines.length;m<l;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(m){for(m=m===void 0?!1:m,this.current_line.trim();m&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(m,l){for(var o=this.__lines.length-2;o>=0;){var a=this.__lines[o];if(a.is_empty())break;if(a.item(0).indexOf(m)!==0&&a.item(-1)!==l){this.__lines.splice(o+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},r.exports.Output=f},,,,function(r){function M(m,l){this.raw_options=b(m,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}M.prototype._get_array=function(m,l){var o=this.raw_options[m],a=l||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(a=o.concat()):typeof o=="string"&&(a=o.split(/[^a-zA-Z0-9_\/\-]+/)),a},M.prototype._get_boolean=function(m,l){var o=this.raw_options[m],a=o===void 0?!!l:!!o;return a},M.prototype._get_characters=function(m,l){var o=this.raw_options[m],a=l||"";return typeof o=="string"&&(a=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},M.prototype._get_number=function(m,l){var o=this.raw_options[m];l=parseInt(l,10),isNaN(l)&&(l=0);var a=parseInt(o,10);return isNaN(a)&&(a=l),a},M.prototype._get_selection=function(m,l,o){var a=this._get_selection_list(m,l,o);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[m]+"'");return a[0]},M.prototype._get_selection_list=function(m,l,o){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[l[0]],!this._is_valid_selection(o,l))throw new Error("Invalid Default Value!");var a=this._get_array(m,o);if(!this._is_valid_selection(a,l))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[m]+"'");return a},M.prototype._is_valid_selection=function(m,l){return m.length&&l.length&&!m.some(function(o){return l.indexOf(o)===-1})};function b(m,l){var o={};m=f(m);var a;for(a in m)a!==l&&(o[a]=m[a]);if(l&&m[l])for(a in m[l])o[a]=m[l][a];return o}function f(m){var l={},o;for(o in m){var a=o.replace(/-/g,"_");l[a]=m[o]}return l}r.exports.Options=M,r.exports.normalizeOpts=f,r.exports.mergeOpts=b},,function(r){var M=RegExp.prototype.hasOwnProperty("sticky");function b(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},b.prototype.peek=function(f){var m=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(m=this.__input.charAt(f)),m},b.prototype.__match=function(f,m){f.lastIndex=m;var l=f.exec(this.__input);return l&&!(M&&f.sticky)&&(l.index!==m&&(l=null)),l},b.prototype.test=function(f,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(f,m):!1},b.prototype.testChar=function(f,m){var l=this.peek(m);return f.lastIndex=0,l!==null&&f.test(l)},b.prototype.match=function(f){var m=this.__match(f,this.__position);return m?this.__position+=m[0].length:m=null,m},b.prototype.read=function(f,m,l){var o="",a;return f&&(a=this.match(f),a&&(o+=a[0])),m&&(a||!f)&&(o+=this.readUntil(m,l)),o},b.prototype.readUntil=function(f,m){var l="",o=this.__position;f.lastIndex=this.__position;var a=f.exec(this.__input);return a?(o=a.index,m&&(o+=a[0].length)):o=this.__input_length,l=this.__input.substring(this.__position,o),this.__position=o,l},b.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},b.prototype.get_regexp=function(f,m){var l=null,o="g";return m&&M&&(o="y"),typeof f=="string"&&f!==""?l=new RegExp(f,o):f&&(l=new RegExp(f.source,o)),l},b.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(f){var m=this.__position,l=this.readUntilAfter(f);return this.__position=m,l},b.prototype.lookBack=function(f){var m=this.__position-1;return m>=f.length&&this.__input.substring(m-f.length,m).toLowerCase()===f},r.exports.InputScanner=b},,,,,function(r){function M(b,f){b=typeof b=="string"?b:b.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+f,"g")}M.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(b);m;)f[m[1]]=m[2],m=this.__directive_pattern.exec(b);return f},M.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=M},,function(r,M,b){var f=b(16).Beautifier,m=b(17).Options;function l(o,a){var c=new f(o,a);return c.beautify()}r.exports=l,r.exports.defaultOptions=function(){return new m}},function(r,M,b){var f=b(17).Options,m=b(2).Output,l=b(8).InputScanner,o=b(13).Directives,a=new o(/\/\*/,/\*\//),c=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=/\s/,n=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(R,S){this._source_text=R||"",this._options=new f(S),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}C.prototype.eatString=function(R){var S="";for(this._ch=this._input.next();this._ch;){if(S+=this._ch,this._ch==="\\")S+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return S},C.prototype.eatWhitespace=function(R){for(var S=i.test(this._input.peek()),v=0;i.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
`&&((v===0||v<this._options.max_preserve_newlines)&&(v++,this._output.add_new_line(!0)));return S},C.prototype.foundNestedPseudoClass=function(){for(var R=0,S=1,v=this._input.peek(S);v;){if(v==="{")return!0;if(v==="(")R+=1;else if(v===")"){if(R===0)return!1;R-=1}else if(v===";"||v==="}")return!1;S++,v=this._input.peek(S)}return!1},C.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},C.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},C.prototype.indent=function(){this._indentLevel++},C.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,S=this._options.eol;S==="auto"&&(S=`
`,R&&c.test(R||"")&&(S=R.match(c)[0])),R=R.replace(s,`
`);var v=R.match(/^[\t ]*/)[0];this._output=new m(this._options,v),this._input=new l(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var E=0,h=!1,p=!1,_=!1,g=!1,w=!1,j=!1,B=this._ch,A=!1,H,F,x;H=this._input.read(n),F=H!=="",x=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(O),q=a.get_directives(Y);q&&q.ignore==="start"&&(Y+=a.readIgnored(this._input)),this.print_string(Y),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(F),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?g=!0:ie==="import"&&(w=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!h&&E===0&&ie.indexOf(":")!==-1&&(p=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(F),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")p&&(p=!1,this.outdent()),_?(_=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),w=!1,g=!1,p&&(this.outdent(),p=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var me=0;me<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;me++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[me])){A=!0;break}(h||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&E===0?(this.print_string(":"),p||(p=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var $e=x==='"'||x==="'";this.preserveSingleSpace($e||F),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,E===0?(p&&(this.outdent(),p=!1),g=!1,w=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),E++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),E&&(E--,this.outdent()));else{var xe=!1;this._input.lookBack("with")&&(xe=!0),this.preserveSingleSpace(F||xe),this.print_string(this._ch),p&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),E++,this.indent())}else if(this._ch===")")E&&(E--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!p||j)&&E===0&&!w&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!p&&E===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(F),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),i.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var Ie=x==='"'||x==="'";this.preserveSingleSpace(Ie||F),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var Je=this._output.get_code(S);return Je},r.exports.Beautifier=C},function(r,M,b){var f=b(6).Options;function m(l){f.call(this,l,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var c=0;c<a.length;c++)a[c]!=="expand"?this.brace_style="collapse":this.brace_style=a[c]}m.prototype=new f,r.exports.Options=m}],I={};function K(r){var M=I[r];if(M!==void 0)return M.exports;var b=I[r]={exports:{}};return P[r](b,b.exports,K),b.exports}var k=K(15);U=k})();var G=U;!(Z=[],V=function(){return{css_beautify:G}}.apply(he,Z),V!==void 0&&(Kt.exports=V))})()},Vhoy:function(Kt,he,D){"use strict";D.d(he,"d",function(){return G}),D.d(he,"e",function(){return P}),D.d(he,"c",function(){return I}),D.d(he,"b",function(){return K}),D.d(he,"a",function(){return k});var Z=D("MI8n");class V{constructor(){this._icons=new Map,this._onDidRegister=new Z.b}add(r){const M=this._icons.get(r.id);M?r.description?M.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const U=new V,G=U;function P(r,M){return new K(r,M)}function I(r){return r?r.replace(/\$\((.*?)\)/g,(M,b)=>` ${b} `).trim():""}class K{constructor(r,M,b){this.id=r,this.definition=M,this.description=b,U.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var k;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const M=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function b(l){if(l instanceof K)return["codicon","codicon-"+l.id];const o=M.exec(l.id);if(!o)return b(K.error);let[,a,c]=o;const s=["codicon","codicon-"+a];return c&&s.push("codicon-modifier-"+c.substr(1)),s}r.asClassNameArray=b;function f(l){return b(l).join(" ")}r.asClassName=f;function m(l){return"."+b(l).join(".")}r.asCSSSelector=m})(k||(k={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}(K||(K={}))},"VrN/":function(Kt,he,D){(function(Z,V){Kt.exports=V()})(this,function(){"use strict";var Z=navigator.userAgent,V=navigator.platform,U=/gecko\/\d/i.test(Z),G=/MSIE \d/.test(Z),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),I=/Edge\/(\d+)/.exec(Z),K=G||P||I,k=K&&(G?document.documentMode||6:+(I||P)[1]),r=!I&&/WebKit\//.test(Z),M=r&&/Qt\/\d+\.\d+/.test(Z),b=!I&&/Chrome\//.test(Z),f=/Opera\//.test(Z),m=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),o=/PhantomJS/.test(Z),a=!I&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),c=/Android/.test(Z),s=a||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),i=a||/Mac/.test(V),n=/\bCrOS\b/.test(Z),O=/win/i.test(V),T=f&&Z.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(f=!1,r=!0);var C=i&&(M||f&&(T==null||T<12.11)),R=U||K&&k>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var d=e.className,u=S(t).exec(d);if(u){var y=d.slice(u.index+u[0].length);e.className=d.slice(0,u.index)+(y?u[1]+y:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return E(e).appendChild(t)}function p(e,t,d,u){var y=document.createElement(e);if(d&&(y.className=d),u&&(y.style.cssText=u),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var W=0;W<t.length;++W)y.appendChild(t[W]);return y}function _(e,t,d,u){var y=p(e,t,d,u);return y.setAttribute("role","presentation"),y}var g;document.createRange?g=function(e,t,d,u){var y=document.createRange();return y.setEnd(u||e,d),y.setStart(e,t),y}:g=function(e,t,d){var u=document.body.createTextRange();try{u.moveToElementText(e.parentNode)}catch(y){return u}return u.collapse(!0),u.moveEnd("character",d),u.moveStart("character",t),u};function w(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function B(e,t){var d=e.className;S(t).test(d)||(e.className+=(d?" ":"")+t)}function A(e,t){for(var d=e.split(" "),u=0;u<d.length;u++)d[u]&&!S(d[u]).test(t)&&(t+=" "+d[u]);return t}var H=function(e){e.select()};a?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:K&&(H=function(e){try{e.select()}catch(t){}});function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function x(e,t,d){t||(t={});for(var u in e)e.hasOwnProperty(u)&&(d!==!1||!t.hasOwnProperty(u))&&(t[u]=e[u]);return t}function Y(e,t,d,u,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var W=u||0,$=y||0;;){var ee=e.indexOf(" ",W);if(ee<0||ee>=t)return $+(t-W);$+=ee-W,$+=d-$%d,W=ee+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},q.prototype.set=function(e,t){this.f=t;var d=+new Date+e;(!this.id||d<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=d)};function ie(e,t){for(var d=0;d<e.length;++d)if(e[d]==t)return d;return-1}var me=50,$e={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ie={origin:"*mouse"},Je={origin:"+move"};function Ye(e,t,d){for(var u=0,y=0;;){var W=e.indexOf(" ",u);W==-1&&(W=e.length);var $=W-u;if(W==e.length||y+$>=t)return u+Math.min($,t-y);if(y+=W-u,y+=d-y%d,u=W+1,y>=t)return u}}var ve=[""];function fe(e){for(;ve.length<=e;)ve.push(lt(ve)+" ");return ve[e]}function lt(e){return e[e.length-1]}function qt(e,t){for(var d=[],u=0;u<e.length;u++)d[u]=t(e[u],u);return d}function Ft(e,t,d){for(var u=0,y=d(t);u<e.length&&d(e[u])<=y;)u++;e.splice(u,0,t)}function Ot(){}function Ve(e,t){var d;return Object.create?d=Object.create(e):(Ot.prototype=e,d=new Ot),t&&x(t,d),d}var vt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ht(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||vt.test(e))}function Bt(e,t){return t?t.source.indexOf("\\w")>-1&&ht(e)?!0:t.test(e):ht(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ue=/[\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 Ge(e){return e.charCodeAt(0)>=768&&Ue.test(e)}function et(e,t,d){for(;(d<0?t>0:t<e.length)&&Ge(e.charAt(t));)t+=d;return t}function Wt(e,t,d){for(var u=t>d?-1:1;;){if(t==d)return t;var y=(t+d)/2,W=u<0?Math.ceil(y):Math.floor(y);if(W==t)return e(W)?t:d;e(W)?d=W:t=W+u}}function Yt(e,t,d,u){if(!e)return u(t,d,"ltr",0);for(var y=!1,W=0;W<e.length;++W){var $=e[W];($.from<d&&$.to>t||t==d&&$.to==t)&&(u(Math.max($.from,t),Math.min($.to,d),$.level==1?"rtl":"ltr",W),y=!0)}y||u(t,d,"ltr")}var on=null;function nt(e,t,d){var u;on=null;for(var y=0;y<e.length;++y){var W=e[y];if(W.from<t&&W.to>t)return y;W.to==t&&(W.from!=W.to&&d=="before"?u=y:on=y),W.from==t&&(W.from!=W.to&&d!="before"?u=y:on=y)}return u!=null?u:on}var tn=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(le){return le<=247?e.charAt(le):1424<=le&&le<=1524?"R":1536<=le&&le<=1785?t.charAt(le-1536):1774<=le&&le<=2220?"r":8192<=le&&le<=8203?"w":le==8204?"b":"L"}var u=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,W=/[LRr]/,$=/[Lb1n]/,ee=/[1n]/;function te(le,Me,He){this.level=le,this.from=Me,this.to=He}return function(le,Me){var He=Me=="ltr"?"L":"R";if(le.length==0||Me=="ltr"&&!u.test(le))return!1;for(var xt=le.length,pt=[],an=0;an<xt;++an)pt.push(d(le.charCodeAt(an)));for(var Cn=0,Wn=He;Cn<xt;++Cn){var Yn=pt[Cn];Yn=="m"?pt[Cn]=Wn:Wn=Yn}for(var Zn=0,Xn=He;Zn<xt;++Zn){var ar=pt[Zn];ar=="1"&&Xn=="r"?pt[Zn]="n":W.test(ar)&&(Xn=ar,ar=="r"&&(pt[Zn]="R"))}for(var Tr=1,_r=pt[0];Tr<xt-1;++Tr){var Fr=pt[Tr];Fr=="+"&&_r=="1"&&pt[Tr+1]=="1"?pt[Tr]="1":Fr==","&&_r==pt[Tr+1]&&(_r=="1"||_r=="n")&&(pt[Tr]=_r),_r=Fr}for(var pi=0;pi<xt;++pi){var Hi=pt[pi];if(Hi==",")pt[pi]="N";else if(Hi=="%"){var Ci=void 0;for(Ci=pi+1;Ci<xt&&pt[Ci]=="%";++Ci);for(var oa=pi&&pt[pi-1]=="!"||Ci<xt&&pt[Ci]=="1"?"1":"N",na=pi;na<Ci;++na)pt[na]=oa;pi=Ci-1}}for(var ki=0,ra=He;ki<xt;++ki){var zi=pt[ki];ra=="L"&&zi=="1"?pt[ki]="L":W.test(zi)&&(ra=zi)}for(var Ui=0;Ui<xt;++Ui)if(y.test(pt[Ui])){var Ii=void 0;for(Ii=Ui+1;Ii<xt&&y.test(pt[Ii]);++Ii);for(var Oi=(Ui?pt[Ui-1]:He)=="L",ia=(Ii<xt?pt[Ii]:He)=="L",So=Oi==ia?Oi?"L":"R":He,to=Ui;to<Ii;++to)pt[to]=So;Ui=Ii-1}for(var Xi=[],Pa,Wi=0;Wi<xt;)if($.test(pt[Wi])){var ms=Wi;for(++Wi;Wi<xt&&$.test(pt[Wi]);++Wi);Xi.push(new te(0,ms,Wi))}else{var Ga=Wi,lo=Xi.length,uo=Me=="rtl"?1:0;for(++Wi;Wi<xt&&pt[Wi]!="L";++Wi);for(var Ji=Ga;Ji<Wi;)if(ee.test(pt[Ji])){Ga<Ji&&(Xi.splice(lo,0,new te(1,Ga,Ji)),lo+=uo);var Oo=Ji;for(++Ji;Ji<Wi&&ee.test(pt[Ji]);++Ji);Xi.splice(lo,0,new te(2,Oo,Ji)),lo+=uo,Ga=Ji}else++Ji;Ga<Wi&&Xi.splice(lo,0,new te(1,Ga,Wi))}return Me=="ltr"&&(Xi[0].level==1&&(Pa=le.match(/^\s+/))&&(Xi[0].from=Pa[0].length,Xi.unshift(new te(0,0,Pa[0].length))),lt(Xi).level==1&&(Pa=le.match(/\s+$/))&&(lt(Xi).to-=Pa[0].length,Xi.push(new te(0,xt-Pa[0].length,xt)))),Me=="rtl"?Xi.reverse():Xi}}();function Ln(e,t){var d=e.order;return d==null&&(d=e.order=tn(e.text,t)),d}var We=[],Fe=function(e,t,d){if(e.addEventListener)e.addEventListener(t,d,!1);else if(e.attachEvent)e.attachEvent("on"+t,d);else{var u=e._handlers||(e._handlers={});u[t]=(u[t]||We).concat(d)}};function yt(e,t){return e._handlers&&e._handlers[t]||We}function At(e,t,d){if(e.removeEventListener)e.removeEventListener(t,d,!1);else if(e.detachEvent)e.detachEvent("on"+t,d);else{var u=e._handlers,y=u&&u[t];if(y){var W=ie(y,d);W>-1&&(u[t]=y.slice(0,W).concat(y.slice(W+1)))}}}function tt(e,t){var d=yt(e,t);if(!d.length)return;for(var u=Array.prototype.slice.call(arguments,2),y=0;y<d.length;++y)d[y].apply(null,u)}function ot(e,t,d){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),tt(e,d||t.type,e,t),pe(t)||t.codemirrorIgnore}function De(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var d=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),u=0;u<t.length;++u)ie(d,t[u])==-1&&d.push(t[u])}function ye(e,t){return yt(e,t).length>0}function we(e){e.prototype.on=function(t,d){Fe(this,t,d)},e.prototype.off=function(t,d){At(this,t,d)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function oe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function pe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _e(e){ae(e),oe(e)}function be(e){return e.target||e.srcElement}function Ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),i&&e.ctrlKey&&t==1&&(t=3),t}var St=function(){if(K&&k<9)return!1;var e=p("div");return"draggable"in e||"dragDrop"in e}(),nn;function An(e){if(nn==null){var t=p("span","\u200B");h(e,p("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(nn=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&k<8))}var d=nn?p("span","\u200B"):p("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var bt;function Jt(e){if(bt!=null)return bt;var t=h(e,document.createTextNode("A\u062EA")),d=g(t,0,1).getBoundingClientRect(),u=g(t,1,2).getBoundingClientRect();return E(e),!d||d.left==d.right?!1:bt=u.right-d.right<3}var Et=`
b`.split(/\n/).length!=3?function(e){for(var t=0,d=[],u=e.length;t<=u;){var y=e.indexOf(`
`,t);y==-1&&(y=e.length);var W=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),$=W.indexOf("\r");$!=-1?(d.push(W.slice(0,$)),t+=$+1):(d.push(W),t=y+1)}return d}:function(e){return e.split(/\r\n?|\n/)},Ct=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(d){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},st=function(){var e=p("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),de=null;function Ae(e){if(de!=null)return de;var t=h(e,p("span","x")),d=t.getBoundingClientRect(),u=g(t,0,1).getBoundingClientRect();return de=Math.abs(d.left-u.left)>1}var kt={},ct={};function Qt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kt[e]=t}function un(e,t){ct[e]=t}function Le(e){if(typeof e=="string"&&ct.hasOwnProperty(e))e=ct[e];else if(e&&typeof e.name=="string"&&ct.hasOwnProperty(e.name)){var t=ct[e.name];typeof t=="string"&&(t={name:t}),e=Ve(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Le("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Le("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function qe(e,t){t=Le(t);var d=kt[t.name];if(!d)return qe(e,"text/plain");var u=d(e,t);if(mt.hasOwnProperty(t.name)){var y=mt[t.name];for(var W in y){if(!y.hasOwnProperty(W))continue;u.hasOwnProperty(W)&&(u["_"+W]=u[W]),u[W]=y[W]}}if(u.name=t.name,t.helperType&&(u.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)u[$]=t.modeProps[$];return u}var mt={};function jt(e,t){var d=mt.hasOwnProperty(e)?mt[e]:mt[e]={};x(t,d)}function sn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var d={};for(var u in t){var y=t[u];y instanceof Array&&(y=y.concat([])),d[u]=y}return d}function yn(e,t){for(var d;e.innerMode&&!(d=e.innerMode(t),!d||d.mode==e);)t=d.state,e=d.mode;return d||{mode:e,state:t}}function nr(e,t,d){return e.startState?e.startState(t,d):!0}var Kn=function(e,t,d){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=d};Kn.prototype.eol=function(){return this.pos>=this.string.length},Kn.prototype.sol=function(){return this.pos==this.lineStart},Kn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Kn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Kn.prototype.eat=function(e){var t=this.string.charAt(this.pos),d;if(typeof e=="string"?d=t==e:d=t&&(e.test?e.test(t):e(t)),d)return++this.pos,t},Kn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Kn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Kn.prototype.skipToEnd=function(){this.pos=this.string.length},Kn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Kn.prototype.backUp=function(e){this.pos-=e},Kn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Kn.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Kn.prototype.match=function(e,t,d){if(typeof e=="string"){var u=function($){return d?$.toLowerCase():$},y=this.string.substr(this.pos,e.length);if(u(y)==u(e))return t!==!1&&(this.pos+=e.length),!0}else{var W=this.string.slice(this.pos).match(e);return W&&W.index>0?null:(W&&t!==!1&&(this.pos+=W[0].length),W)}},Kn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Kn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Kn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Kn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function wn(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 d=e;!d.lines;)for(var u=0;;++u){var y=d.children[u],W=y.chunkSize();if(t<W){d=y;break}t-=W}return d.lines[t]}function br(e,t,d){var u=[],y=t.line;return e.iter(t.line,d.line+1,function(W){var $=W.text;y==d.line&&($=$.slice(0,d.ch)),y==t.line&&($=$.slice(t.ch)),u.push($),++y}),u}function Er(e,t,d){var u=[];return e.iter(t,d,function(y){u.push(y.text)}),u}function rr(e,t){var d=t-e.height;if(d)for(var u=e;u;u=u.parent)u.height+=d}function cr(e){if(e.parent==null)return null;for(var t=e.parent,d=ie(t.lines,e),u=t.parent;u;t=u,u=u.parent)for(var y=0;!(u.children[y]==t);++y)d+=u.children[y].chunkSize();return d+t.first}function Pr(e,t){var d=e.first;e:do{for(var u=0;u<e.children.length;++u){var y=e.children[u],W=y.height;if(t<W){e=y;continue e}t-=W,d+=y.chunkSize()}return d}while(!e.lines);for(var $=0;$<e.lines.length;++$){var ee=e.lines[$],te=ee.height;if(t<te)break;t-=te}return d+$}function Kr(e,t){return t>=e.first&&t<e.first+e.size}function hi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function pn(e,t,d){if(d===void 0&&(d=null),!(this instanceof pn))return new pn(e,t,d);this.line=e,this.ch=t,this.sticky=d}function or(e,t){return e.line-t.line||e.ch-t.ch}function mi(e,t){return e.sticky==t.sticky&&or(e,t)==0}function wi(e){return pn(e.line,e.ch)}function ti(e,t){return or(e,t)<0?t:e}function ni(e,t){return or(e,t)<0?e:t}function X(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function L(e,t){if(t.line<e.first)return pn(e.first,0);var d=e.first+e.size-1;return t.line>d?pn(d,wn(e,d).text.length):N(t,wn(e,t.line).text.length)}function N(e,t){var d=e.ch;return d==null||d>t?pn(e.line,t):d<0?pn(e.line,0):e}function z(e,t){for(var d=[],u=0;u<t.length;u++)d[u]=L(e,t[u]);return d}var ne=function(e,t){this.state=e,this.lookAhead=t},J=function(e,t,d,u){this.state=t,this.doc=e,this.line=d,this.maxLookAhead=u||0,this.baseTokens=null,this.baseTokenPos=1};J.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},J.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},J.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},J.fromSaved=function(e,t,d){return t instanceof ne?new J(e,sn(e.mode,t.state),d,t.lookAhead):new J(e,sn(e.mode,t),d)},J.prototype.save=function(e){var t=e!==!1?sn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ne(t,this.maxLookAhead):t};function je(e,t,d,u){var y=[e.state.modeGen],W={};ai(e,t.text,e.doc.mode,d,function(le,Me){return y.push(le,Me)},W,u);for(var $=d.state,ee=function(le){d.baseTokens=y;var Me=e.state.overlays[le],He=1,xt=0;d.state=!0,ai(e,t.text,Me.mode,d,function(pt,an){for(var Cn=He;xt<pt;){var Wn=y[He];Wn>pt&&y.splice(He,1,pt,y[He+1],Wn),He+=2,xt=Math.min(pt,Wn)}if(!an)return;if(Me.opaque)y.splice(Cn,He-Cn,pt,"overlay "+an),He=Cn+2;else for(;Cn<He;Cn+=2){var Yn=y[Cn+1];y[Cn+1]=(Yn?Yn+" ":"")+"overlay "+an}},W),d.state=$,d.baseTokens=null,d.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)ee(te);return{styles:y,classes:W.bgClass||W.textClass?W:null}}function $t(e,t,d){if(!t.styles||t.styles[0]!=e.state.modeGen){var u=In(e,cr(t)),y=t.text.length>e.options.maxHighlightLength&&sn(e.doc.mode,u.state),W=je(e,t,u);y&&(u.state=y),t.stateAfter=u.save(!y),t.styles=W.styles,W.classes?t.styleClasses=W.classes:t.styleClasses&&(t.styleClasses=null),d===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function In(e,t,d){var u=e.doc,y=e.display;if(!u.mode.startState)return new J(u,!0,t);var W=Gr(e,t,d),$=W>u.first&&wn(u,W-1).stateAfter,ee=$?J.fromSaved(u,$,W):new J(u,nr(u.mode),W);return u.iter(W,t,function(te){Jn(e,te.text,ee);var le=ee.line;te.stateAfter=le==t-1||le%5==0||le>=y.viewFrom&&le<y.viewTo?ee.save():null,ee.nextLine()}),d&&(u.modeFrontier=ee.line),ee}function Jn(e,t,d,u){var y=e.doc.mode,W=new Kn(t,e.options.tabSize,d);for(W.start=W.pos=u||0,t==""&&ln(y,d.state);!W.eol();)tr(y,W,d.state),W.start=W.pos}function ln(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var d=yn(e,t);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function tr(e,t,d,u){for(var y=0;y<10;y++){u&&(u[0]=yn(e,d).mode);var W=e.token(t,d);if(t.pos>t.start)return W}throw new Error("Mode "+e.name+" failed to advance stream.")}var qn=function(e,t,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=d};function kr(e,t,d,u){var y=e.doc,W=y.mode,$;t=L(y,t);var ee=wn(y,t.line),te=In(e,t.line,d),le=new Kn(ee.text,e.options.tabSize,te),Me;for(u&&(Me=[]);(u||le.pos<t.ch)&&!le.eol();)le.start=le.pos,$=tr(W,le,te.state),u&&Me.push(new qn(le,$,sn(y.mode,te.state)));return u?Me:new qn(le,$,te.state)}function li(e,t){if(e)for(;;){var d=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!d)break;e=e.slice(0,d.index)+e.slice(d.index+d[0].length);var u=d[1]?"bgClass":"textClass";t[u]==null?t[u]=d[2]:new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)").test(t[u])||(t[u]+=" "+d[2])}return e}function ai(e,t,d,u,y,W,$){var ee=d.flattenSpans;ee==null&&(ee=e.options.flattenSpans);var te=0,le=null,Me=new Kn(t,e.options.tabSize,u),He,xt=e.options.addModeClass&&[null];for(t==""&&li(ln(d,u.state),W);!Me.eol();){if(Me.pos>e.options.maxHighlightLength?(ee=!1,$&&Jn(e,t,u,Me.pos),Me.pos=t.length,He=null):He=li(tr(d,Me,u.state,xt),W),xt){var pt=xt[0].name;pt&&(He="m-"+(He?pt+" "+He:pt))}if(!ee||le!=He){for(;te<Me.start;)te=Math.min(Me.start,te+5e3),y(te,le);le=He}Me.start=Me.pos}for(;te<Me.pos;){var an=Math.min(Me.pos,te+5e3);y(an,le),te=an}}function Gr(e,t,d){for(var u,y,W=e.doc,$=d?-1:t-(e.doc.mode.innerMode?1e3:100),ee=t;ee>$;--ee){if(ee<=W.first)return W.first;var te=wn(W,ee-1),le=te.stateAfter;if(le&&(!d||ee+(le instanceof ne?le.lookAhead:0)<=W.modeFrontier))return ee;var Me=Y(te.text,null,e.options.tabSize);(y==null||u>Me)&&(y=ee-1,u=Me)}return y}function Li(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var d=e.first,u=t-1;u>d;u--){var y=wn(e,u).stateAfter;if(y&&(!(y instanceof ne)||u+y.lookAhead<t)){d=u+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var Vi=!1,Dr=!1;function Sr(){Vi=!0}function ri(){Dr=!0}function Br(e,t,d){this.marker=e,this.from=t,this.to=d}function Bn(e,t){if(e)for(var d=0;d<e.length;++d){var u=e[d];if(u.marker==t)return u}}function _n(e,t){for(var d,u=0;u<e.length;++u)e[u]!=t&&(d||(d=[])).push(e[u]);return d}function Tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function bn(e,t,d){var u;if(e)for(var y=0;y<e.length;++y){var W=e[y],$=W.marker,ee=W.from==null||($.inclusiveLeft?W.from<=t:W.from<t);if(ee||W.from==t&&$.type=="bookmark"&&(!d||!W.marker.insertLeft)){var te=W.to==null||($.inclusiveRight?W.to>=t:W.to>t);(u||(u=[])).push(new Br($,W.from,te?null:W.to))}}return u}function ur(e,t,d){var u;if(e)for(var y=0;y<e.length;++y){var W=e[y],$=W.marker,ee=W.to==null||($.inclusiveRight?W.to>=t:W.to>t);if(ee||W.from==t&&$.type=="bookmark"&&(!d||W.marker.insertLeft)){var te=W.from==null||($.inclusiveLeft?W.from<=t:W.from<t);(u||(u=[])).push(new Br($,te?null:W.from-t,W.to==null?null:W.to-t))}}return u}function sr(e,t){if(t.full)return null;var d=Kr(e,t.from.line)&&wn(e,t.from.line).markedSpans,u=Kr(e,t.to.line)&&wn(e,t.to.line).markedSpans;if(!d&&!u)return null;var y=t.from.ch,W=t.to.ch,$=or(t.from,t.to)==0,ee=bn(d,y,$),te=ur(u,W,$),le=t.text.length==1,Me=lt(t.text).length+(le?y:0);if(ee)for(var He=0;He<ee.length;++He){var xt=ee[He];if(xt.to==null){var pt=Bn(te,xt.marker);pt?le&&(xt.to=pt.to==null?null:pt.to+Me):xt.to=y}}if(te)for(var an=0;an<te.length;++an){var Cn=te[an];if(Cn.to!=null&&(Cn.to+=Me),Cn.from==null){var Wn=Bn(ee,Cn.marker);Wn||(Cn.from=Me,le&&(ee||(ee=[])).push(Cn))}else Cn.from+=Me,le&&(ee||(ee=[])).push(Cn)}ee&&(ee=Q(ee)),te&&te!=ee&&(te=Q(te));var Yn=[ee];if(!le){var Zn=t.text.length-2,Xn;if(Zn>0&&ee)for(var ar=0;ar<ee.length;++ar)ee[ar].to==null&&(Xn||(Xn=[])).push(new Br(ee[ar].marker,null,null));for(var Tr=0;Tr<Zn;++Tr)Yn.push(Xn);Yn.push(te)}return Yn}function Q(e){for(var t=0;t<e.length;++t){var d=e[t];d.from!=null&&d.from==d.to&&d.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ce(e,t,d){var u=null;if(e.iter(t.line,d.line+1,function(pt){if(pt.markedSpans)for(var an=0;an<pt.markedSpans.length;++an){var Cn=pt.markedSpans[an].marker;Cn.readOnly&&(!u||ie(u,Cn)==-1)&&(u||(u=[])).push(Cn)}}),!u)return null;for(var y=[{from:t,to:d}],W=0;W<u.length;++W)for(var $=u[W],ee=$.find(0),te=0;te<y.length;++te){var le=y[te];if(or(le.to,ee.from)<0||or(le.from,ee.to)>0)continue;var Me=[te,1],He=or(le.from,ee.from),xt=or(le.to,ee.to);(He<0||!$.inclusiveLeft&&!He)&&Me.push({from:le.from,to:ee.from}),(xt>0||!$.inclusiveRight&&!xt)&&Me.push({from:ee.to,to:le.to}),y.splice.apply(y,Me),te+=Me.length-3}return y}function Ce(e){var t=e.markedSpans;if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.detachLine(e);e.markedSpans=null}function Te(e,t){if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.attachLine(e);e.markedSpans=t}function rt(e){return e.inclusiveLeft?-1:0}function Re(e){return e.inclusiveRight?1:0}function Xe(e,t){var d=e.lines.length-t.lines.length;if(d!=0)return d;var u=e.find(),y=t.find(),W=or(u.from,y.from)||rt(e)-rt(t);if(W)return-W;var $=or(u.to,y.to)||Re(e)-Re(t);return $||t.id-e.id}function it(e,t){var d=Dr&&e.markedSpans,u;if(d)for(var y=void 0,W=0;W<d.length;++W)y=d[W],y.marker.collapsed&&(t?y.from:y.to)==null&&(!u||Xe(u,y.marker)<0)&&(u=y.marker);return u}function Dt(e){return it(e,!0)}function Tt(e){return it(e,!1)}function Be(e,t){var d=Dr&&e.markedSpans,u;if(d)for(var y=0;y<d.length;++y){var W=d[y];W.marker.collapsed&&(W.from==null||W.from<t)&&(W.to==null||W.to>t)&&(!u||Xe(u,W.marker)<0)&&(u=W.marker)}return u}function _t(e,t,d,u,y){var W=wn(e,t),$=Dr&&W.markedSpans;if($)for(var ee=0;ee<$.length;++ee){var te=$[ee];if(!te.marker.collapsed)continue;var le=te.marker.find(0),Me=or(le.from,d)||rt(te.marker)-rt(y),He=or(le.to,u)||Re(te.marker)-Re(y);if(Me>=0&&He<=0||Me<=0&&He>=0)continue;if(Me<=0&&(te.marker.inclusiveRight&&y.inclusiveLeft?or(le.to,d)>=0:or(le.to,d)>0)||Me>=0&&(te.marker.inclusiveRight&&y.inclusiveLeft?or(le.from,u)<=0:or(le.from,u)<0))return!0}}function at(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function dt(e){for(var t;t=Tt(e);)e=t.find(1,!0).line;return e}function wt(e){for(var t,d;t=Tt(e);)e=t.find(1,!0).line,(d||(d=[])).push(e);return d}function It(e,t){var d=wn(e,t),u=at(d);return d==u?t:cr(u)}function gt(e,t){if(t>e.lastLine())return t;var d=wn(e,t),u;if(!Xt(e,d))return t;for(;u=Tt(d);)d=u.find(1,!0).line;return cr(d)+1}function Xt(e,t){var d=Dr&&t.markedSpans;if(d)for(var u=void 0,y=0;y<d.length;++y){if(u=d[y],!u.marker.collapsed)continue;if(u.from==null)return!0;if(u.marker.widgetNode)continue;if(u.from==0&&u.marker.inclusiveLeft&&dn(e,t,u))return!0}}function dn(e,t,d){if(d.to==null){var u=d.marker.find(1,!0);return dn(e,u.line,Bn(u.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==t.text.length)return!0;for(var y=void 0,W=0;W<t.markedSpans.length;++W)if(y=t.markedSpans[W],y.marker.collapsed&&!y.marker.widgetNode&&y.from==d.to&&(y.to==null||y.to!=d.from)&&(y.marker.inclusiveLeft||d.marker.inclusiveRight)&&dn(e,t,y))return!0}function Pn(e){e=at(e);for(var t=0,d=e.parent,u=0;u<d.lines.length;++u){var y=d.lines[u];if(y==e)break;t+=y.height}for(var W=d.parent;W;d=W,W=d.parent)for(var $=0;$<W.children.length;++$){var ee=W.children[$];if(ee==d)break;t+=ee.height}return t}function Gn(e){if(e.height==0)return 0;for(var t=e.text.length,d,u=e;d=Dt(u);){var y=d.find(0,!0);u=y.from.line,t+=y.from.ch-y.to.ch}for(u=e;d=Tt(u);){var W=d.find(0,!0);t-=u.text.length-W.from.ch,u=W.to.line,t+=u.text.length-W.to.ch}return t}function Sn(e){var t=e.display,d=e.doc;t.maxLine=wn(d,d.first),t.maxLineLength=Gn(t.maxLine),t.maxLineChanged=!0,d.iter(function(u){var y=Gn(u);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=u)})}var Nn=function(e,t,d){this.text=e,Te(this,t),this.height=d?d(this):1};Nn.prototype.lineNo=function(){return cr(this)},we(Nn);function Mn(e,t,d,u){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ce(e),Te(e,d);var y=u?u(e):1;y!=e.height&&rr(e,y)}function Pt(e){e.parent=null,Ce(e)}var hn={},Ht={};function Rt(e,t){if(!e||/^\s*$/.test(e))return null;var d=t.addModeClass?Ht:hn;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,t){var d=_("span",null,null,r?"padding-right: .1px":null),u={pre:_("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var y=0;y<=(t.rest?t.rest.length:0);y++){var W=y?t.rest[y-1]:t.line,$=void 0;u.pos=0,u.addToken=Vt,Jt(e.display.measure)&&($=Ln(W,e.doc.direction))&&(u.addToken=jn(u.addToken,$)),u.map=[];var ee=t!=e.display.externalMeasured&&cr(W);Qn(W,u,$t(e,W,ee)),W.styleClasses&&(W.styleClasses.bgClass&&(u.bgClass=A(W.styleClasses.bgClass,u.bgClass||"")),W.styleClasses.textClass&&(u.textClass=A(W.styleClasses.textClass,u.textClass||""))),u.map.length==0&&u.map.push(0,0,u.content.appendChild(An(e.display.measure))),y==0?(t.measure.map=u.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(u.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var te=u.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(u.content.className="cm-tab-wrap-hack")}return tt(e,"renderLine",e,t.line,u.pre),u.pre.className&&(u.textClass=A(u.pre.className,u.textClass||"")),u}function On(e){var t=p("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Vt(e,t,d,u,y,W,$){if(!t)return;var ee=e.splitSpaces?ft(t,e.trailingSpace):t,te=e.cm.state.specialChars,le=!1,Me;if(!te.test(t))e.col+=t.length,Me=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,Me),K&&k<9&&(le=!0),e.pos+=t.length;else{Me=document.createDocumentFragment();for(var He=0;;){te.lastIndex=He;var xt=te.exec(t),pt=xt?xt.index-He:t.length-He;if(pt){var an=document.createTextNode(ee.slice(He,He+pt));K&&k<9?Me.appendChild(p("span",[an])):Me.appendChild(an),e.map.push(e.pos,e.pos+pt,an),e.col+=pt,e.pos+=pt}if(!xt)break;He+=pt+1;var Cn=void 0;if(xt[0]==" "){var Wn=e.cm.options.tabSize,Yn=Wn-e.col%Wn;Cn=Me.appendChild(p("span",fe(Yn),"cm-tab")),Cn.setAttribute("role","presentation"),Cn.setAttribute("cm-text"," "),e.col+=Yn}else xt[0]=="\r"||xt[0]==`
`?(Cn=Me.appendChild(p("span",xt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Cn.setAttribute("cm-text",xt[0]),e.col+=1):(Cn=e.cm.options.specialCharPlaceholder(xt[0]),Cn.setAttribute("cm-text",xt[0]),K&&k<9?Me.appendChild(p("span",[Cn])):Me.appendChild(Cn),e.col+=1);e.map.push(e.pos,e.pos+1,Cn),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,d||u||y||le||W||$){var Zn=d||"";u&&(Zn+=u),y&&(Zn+=y);var Xn=p("span",[Me],Zn,W);if($)for(var ar in $)$.hasOwnProperty(ar)&&ar!="style"&&ar!="class"&&Xn.setAttribute(ar,$[ar]);return e.content.appendChild(Xn)}e.content.appendChild(Me)}function ft(e,t){if(e.length>1&&!/ /.test(e))return e;for(var d=t,u="",y=0;y<e.length;y++){var W=e.charAt(y);W==" "&&d&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(W="\xA0"),u+=W,d=W==" "}return u}function jn(e,t){return function(d,u,y,W,$,ee,te){y=y?y+" cm-force-border":"cm-force-border";for(var le=d.pos,Me=le+u.length;;){for(var He=void 0,xt=0;xt<t.length&&!(He=t[xt],He.to>le&&He.from<=le);xt++);if(He.to>=Me)return e(d,u,y,W,$,ee,te);e(d,u.slice(0,He.to-le),y,W,null,ee,te),W=null,u=u.slice(He.to-le),le=He.to}}}function fn(e,t,d,u){var y=!u&&d.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!u&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",d.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=t,e.trailingSpace=!1}function Qn(e,t,d){var u=e.markedSpans,y=e.text,W=0;if(!u){for(var $=1;$<d.length;$+=2)t.addToken(t,y.slice(W,W=d[$]),Rt(d[$+1],t.cm.options));return}for(var ee=y.length,te=0,le=1,Me="",He,xt,pt=0,an,Cn,Wn,Yn,Zn;;){if(pt==te){an=Cn=Wn=xt="",Zn=null,Yn=null,pt=Infinity;for(var Xn=[],ar=void 0,Tr=0;Tr<u.length;++Tr){var _r=u[Tr],Fr=_r.marker;if(Fr.type=="bookmark"&&_r.from==te&&Fr.widgetNode)Xn.push(Fr);else if(_r.from<=te&&(_r.to==null||_r.to>te||Fr.collapsed&&_r.to==te&&_r.from==te)){if(_r.to!=null&&_r.to!=te&&pt>_r.to&&(pt=_r.to,Cn=""),Fr.className&&(an+=" "+Fr.className),Fr.css&&(xt=(xt?xt+";":"")+Fr.css),Fr.startStyle&&_r.from==te&&(Wn+=" "+Fr.startStyle),Fr.endStyle&&_r.to==pt&&(ar||(ar=[])).push(Fr.endStyle,_r.to),Fr.title&&((Zn||(Zn={})).title=Fr.title),Fr.attributes)for(var pi in Fr.attributes)(Zn||(Zn={}))[pi]=Fr.attributes[pi];Fr.collapsed&&(!Yn||Xe(Yn.marker,Fr)<0)&&(Yn=_r)}else _r.from>te&&pt>_r.from&&(pt=_r.from)}if(ar)for(var Hi=0;Hi<ar.length;Hi+=2)ar[Hi+1]==pt&&(Cn+=" "+ar[Hi]);if(!Yn||Yn.from==te)for(var Ci=0;Ci<Xn.length;++Ci)fn(t,0,Xn[Ci]);if(Yn&&(Yn.from||0)==te){if(fn(t,(Yn.to==null?ee+1:Yn.to)-te,Yn.marker,Yn.from==null),Yn.to==null)return;Yn.to==te&&(Yn=!1)}}if(te>=ee)break;for(var oa=Math.min(ee,pt);;){if(Me){var na=te+Me.length;if(!Yn){var ki=na>oa?Me.slice(0,oa-te):Me;t.addToken(t,ki,He?He+an:an,Wn,te+ki.length==pt?Cn:"",xt,Zn)}if(na>=oa){Me=Me.slice(oa-te),te=oa;break}te=na,Wn=""}Me=y.slice(W,W=d[le++]),He=Rt(d[le++],t.cm.options)}}}function Zt(e,t,d){this.line=t,this.rest=wt(t),this.size=this.rest?cr(lt(this.rest))-d+1:1,this.node=this.text=null,this.hidden=Xt(e,t)}function Rn(e,t,d){for(var u=[],y,W=t;W<d;W=y){var $=new Zt(e.doc,wn(e.doc,W),W);y=W+$.size,u.push($)}return u}var Fn=null;function vn(e){Fn?Fn.ops.push(e):e.ownsGroup=Fn={ops:[e],delayedCallbacks:[]}}function yr(e){var t=e.delayedCallbacks,d=0;do{for(;d<t.length;d++)t[d].call(null);for(var u=0;u<e.ops.length;u++){var y=e.ops[u];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(d<t.length)}function Dn(e,t){var d=e.ownsGroup;if(!d)return;try{yr(d)}finally{Fn=null,t(d)}}var xn=null;function Lt(e,t){var d=yt(e,t);if(!d.length)return;var u=Array.prototype.slice.call(arguments,2),y;Fn?y=Fn.delayedCallbacks:xn?y=xn:(y=xn=[],setTimeout(Qe,0));for(var W=function(ee){y.push(function(){return d[ee].apply(null,u)})},$=0;$<d.length;++$)W($)}function Qe(){var e=xn;xn=null;for(var t=0;t<e.length;++t)e[t]()}function Nt(e,t,d,u){for(var y=0;y<t.changes.length;y++){var W=t.changes[y];W=="text"?kn(e,t):W=="gutter"?er(e,t,d,u):W=="class"?lr(e,t):W=="widget"&&Rr(e,t,u)}t.changes=null}function Mt(e){return e.node==e.text&&(e.node=p("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),K&&k<8&&(e.node.style.zIndex=2)),e.node}function cn(e,t){var d=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(d&&(d+=" CodeMirror-linebackground"),t.background)d?t.background.className=d:(t.background.parentNode.removeChild(t.background),t.background=null);else if(d){var u=Mt(t);t.background=u.insertBefore(p("div",null,d),u.firstChild),e.display.input.setUneditable(t.background)}}function zn(e,t){var d=e.display.externalMeasured;return d&&d.line==t.line?(e.display.externalMeasured=null,t.measure=d.measure,d.built):Un(e,t)}function kn(e,t){var d=t.text.className,u=zn(e,t);t.text==t.node&&(t.node=u.pre),t.text.parentNode.replaceChild(u.pre,t.text),t.text=u.pre,u.bgClass!=t.bgClass||u.textClass!=t.textClass?(t.bgClass=u.bgClass,t.textClass=u.textClass,lr(e,t)):d&&(t.text.className=d)}function lr(e,t){cn(e,t),t.line.wrapClass?Mt(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var d=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=d||""}function er(e,t,d,u){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var y=Mt(t);t.gutterBackground=p("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px; width: "+u.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),y.insertBefore(t.gutterBackground,t.text)}var W=t.line.gutterMarkers;if(e.options.lineNumbers||W){var $=Mt(t),ee=t.gutter=p("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ee),$.insertBefore(ee,t.text),t.line.gutterClass&&(ee.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!W||!W["CodeMirror-linenumbers"])&&(t.lineNumber=ee.appendChild(p("div",hi(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),W)for(var te=0;te<e.display.gutterSpecs.length;++te){var le=e.display.gutterSpecs[te].className,Me=W.hasOwnProperty(le)&&W[le];Me&&ee.appendChild(p("div",[Me],"CodeMirror-gutter-elt","left: "+u.gutterLeft[le]+"px; width: "+u.gutterWidth[le]+"px"))}}}function Rr(e,t,d){t.alignable&&(t.alignable=null);for(var u=S("CodeMirror-linewidget"),y=t.node.firstChild,W=void 0;y;y=W)W=y.nextSibling,u.test(y.className)&&t.node.removeChild(y);xr(e,t,d)}function mr(e,t,d,u){var y=zn(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),lr(e,t),er(e,t,d,u),xr(e,t,u),t.node}function xr(e,t,d){if(Zr(e,t.line,t,d,!0),t.rest)for(var u=0;u<t.rest.length;u++)Zr(e,t.rest[u],t,d,!1)}function Zr(e,t,d,u,y){if(!t.widgets)return;for(var W=Mt(d),$=0,ee=t.widgets;$<ee.length;++$){var te=ee[$],le=p("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||le.setAttribute("cm-ignore-events","true"),Yr(te,le,d,u),e.display.input.setUneditable(le),y&&te.above?W.insertBefore(le,d.gutter||d.text):W.appendChild(le),Lt(te,"redraw")}}function Yr(e,t,d,u){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(t);var y=u.wrapperWidth;t.style.left=u.fixedPos+"px",e.coverGutter||(y-=u.gutterTotalWidth,t.style.paddingLeft=u.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-u.gutterTotalWidth+"px"))}function Jr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(document.body,e.node)){var d="position: relative;";e.coverGutter&&(d+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(d+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,p("div",[e.node],null,d))}return e.height=e.node.parentNode.offsetHeight}function vi(e,t){for(var d=be(t);d!=e.wrapper;d=d.parentNode)if(!d||d.nodeType==1&&d.getAttribute("cm-ignore-events")=="true"||d.parentNode==e.sizer&&d!=e.mover)return!0}function _i(e){return e.lineSpace.offsetTop}function Ee(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ne(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,p("pre","x","CodeMirror-line-like")),d=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,u={left:parseInt(d.paddingLeft),right:parseInt(d.paddingRight)};return!isNaN(u.left)&&!isNaN(u.right)&&(e.cachedPaddingH=u),u}function ze(e){return me-e.display.nativeBarWidth}function Se(e){return e.display.scroller.clientWidth-ze(e)-e.display.barWidth}function re(e){return e.display.scroller.clientHeight-ze(e)-e.display.barHeight}function ge(e,t,d){var u=e.options.lineWrapping,y=u&&Se(e);if(!t.measure.heights||u&&t.measure.width!=y){var W=t.measure.heights=[];if(u){t.measure.width=y;for(var $=t.text.firstChild.getClientRects(),ee=0;ee<$.length-1;ee++){var te=$[ee],le=$[ee+1];Math.abs(te.bottom-le.bottom)>2&&W.push((te.bottom+le.top)/2-d.top)}}W.push(d.bottom-d.top)}}function ue(e,t,d){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var u=0;u<e.rest.length;u++)if(e.rest[u]==t)return{map:e.measure.maps[u],cache:e.measure.caches[u]};for(var y=0;y<e.rest.length;y++)if(cr(e.rest[y])>d)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function Oe(e,t){t=at(t);var d=cr(t),u=e.display.externalMeasured=new Zt(e.doc,t,d);u.lineN=d;var y=u.built=Un(e,u);return u.text=y.pre,h(e.display.lineMeasure,y.pre),u}function Pe(e,t,d,u){return ut(e,ke(e,t),d,u)}function Ze(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ui(e,t)];var d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size)return d}function ke(e,t){var d=cr(t),u=Ze(e,d);u&&!u.text?u=null:u&&u.changes&&(Nt(e,u,d,vr(e)),e.curOp.forceUpdate=!0),u||(u=Oe(e,t));var y=ue(u,t,d);return{line:t,view:u,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function ut(e,t,d,u,y){t.before&&(d=-1);var W=d+(u||""),$;return t.cache.hasOwnProperty(W)?$=t.cache[W]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ge(e,t.view,t.rect),t.hasHeights=!0),$=Hn(e,t,d,u),$.bogus||(t.cache[W]=$)),{left:$.left,right:$.right,top:y?$.rtop:$.top,bottom:y?$.rbottom:$.bottom}}var Ut={left:0,right:0,top:0,bottom:0};function rn(e,t,d){for(var u,y,W,$,ee,te,le=0;le<e.length;le+=3)if(ee=e[le],te=e[le+1],t<ee?(y=0,W=1,$="left"):t<te?(y=t-ee,W=y+1):(le==e.length-3||t==te&&e[le+3]>t)&&(W=te-ee,y=W-1,t>=te&&($="right")),y!=null){if(u=e[le+2],ee==te&&d==(u.insertLeft?"left":"right")&&($=d),d=="left"&&y==0)for(;le&&e[le-2]==e[le-3]&&e[le-1].insertLeft;)u=e[(le-=3)+2],$="left";if(d=="right"&&y==te-ee)for(;le<e.length-3&&e[le+3]==e[le+4]&&!e[le+5].insertLeft;)u=e[(le+=3)+2],$="right";break}return{node:u,start:y,end:W,collapse:$,coverStart:ee,coverEnd:te}}function mn(e,t){var d=Ut;if(t=="left")for(var u=0;u<e.length&&!((d=e[u]).left!=d.right);u++);else for(var y=e.length-1;y>=0&&!((d=e[y]).left!=d.right);y--);return d}function Hn(e,t,d,u){var y=rn(t.map,d,u),W=y.node,$=y.start,ee=y.end,te=y.collapse,le;if(W.nodeType==3){for(var Me=0;Me<4;Me++){for(;$&&Ge(t.line.text.charAt(y.coverStart+$));)--$;for(;y.coverStart+ee<y.coverEnd&&Ge(t.line.text.charAt(y.coverStart+ee));)++ee;if(K&&k<9&&$==0&&ee==y.coverEnd-y.coverStart?le=W.parentNode.getBoundingClientRect():le=mn(g(W,$,ee).getClientRects(),u),le.left||le.right||$==0)break;ee=$,$=$-1,te="right"}K&&k<11&&(le=Vn(e.display.measure,le))}else{$>0&&(te=u="right");var He;e.options.lineWrapping&&(He=W.getClientRects()).length>1?le=He[u=="right"?He.length-1:0]:le=W.getBoundingClientRect()}if(K&&k<9&&!$&&(!le||!le.left&&!le.right)){var xt=W.parentNode.getClientRects()[0];xt?le={left:xt.left,right:xt.left+Hr(e.display),top:xt.top,bottom:xt.bottom}:le=Ut}for(var pt=le.top-t.rect.top,an=le.bottom-t.rect.top,Cn=(pt+an)/2,Wn=t.view.measure.heights,Yn=0;Yn<Wn.length-1&&!(Cn<Wn[Yn]);Yn++);var Zn=Yn?Wn[Yn-1]:0,Xn=Wn[Yn],ar={left:(te=="right"?le.right:le.left)-t.rect.left,right:(te=="left"?le.left:le.right)-t.rect.left,top:Zn,bottom:Xn};return!le.left&&!le.right&&(ar.bogus=!0),e.options.singleCursorHeightPerLine||(ar.rtop=pt,ar.rbottom=an),ar}function Vn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ae(e))return t;var d=screen.logicalXDPI/screen.deviceXDPI,u=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*d,right:t.right*d,top:t.top*u,bottom:t.bottom*u}}function fr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function dr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)fr(e.display.view[t])}function wr(e){dr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ar(){return b&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gr(){return b&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Cr(e){var t=0;if(e.widgets)for(var d=0;d<e.widgets.length;++d)e.widgets[d].above&&(t+=Jr(e.widgets[d]));return t}function Lr(e,t,d,u,y){if(!y){var W=Cr(t);d.top+=W,d.bottom+=W}if(u=="line")return d;u||(u="local");var $=Pn(t);if(u=="local"?$+=_i(e.display):$-=e.display.viewOffset,u=="page"||u=="window"){var ee=e.display.lineSpace.getBoundingClientRect();$+=ee.top+(u=="window"?0:gr());var te=ee.left+(u=="window"?0:Ar());d.left+=te,d.right+=te}return d.top+=$,d.bottom+=$,d}function gn(e,t,d){if(d=="div")return t;var u=t.left,y=t.top;if(d=="page")u-=Ar(),y-=gr();else if(d=="local"||!d){var W=e.display.sizer.getBoundingClientRect();u+=W.left,y+=W.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:u-$.left,top:y-$.top}}function en(e,t,d,u,y){return u||(u=wn(e.doc,t.line)),Lr(e,u,Pe(e,u,t.ch,y),d)}function En(e,t,d,u,y,W){u=u||wn(e.doc,t.line),y||(y=ke(e,u));function $(an,Cn){var Wn=ut(e,y,an,Cn?"right":"left",W);return Cn?Wn.left=Wn.right:Wn.right=Wn.left,Lr(e,u,Wn,d)}var ee=Ln(u,e.doc.direction),te=t.ch,le=t.sticky;if(te>=u.text.length?(te=u.text.length,le="before"):te<=0&&(te=0,le="after"),!ee)return $(le=="before"?te-1:te,le=="before");function Me(an,Cn,Wn){var Yn=ee[Cn],Zn=Yn.level==1;return $(Wn?an-1:an,Zn!=Wn)}var He=nt(ee,te,le),xt=on,pt=Me(te,He,le=="before");return xt!=null&&(pt.other=Me(te,xt,le!="before")),pt}function Gt(e,t){var d=0;t=L(e.doc,t),e.options.lineWrapping||(d=Hr(e.display)*t.ch);var u=wn(e.doc,t.line),y=Pn(u)+_i(e.display);return{left:d,right:d,top:y,bottom:y+u.height}}function zt(e,t,d,u,y){var W=pn(e,t,d);return W.xRel=y,u&&(W.outside=u),W}function pr(e,t,d){var u=e.doc;if(d+=e.display.viewOffset,d<0)return zt(u.first,0,null,-1,-1);var y=Pr(u,d),W=u.first+u.size-1;if(y>W)return zt(u.first+u.size-1,wn(u,W).text.length,null,1,1);t<0&&(t=0);for(var $=wn(u,y);;){var ee=oi(e,$,y,t,d),te=Be($,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!te)return ee;var le=te.find(1);if(le.line==y)return le;$=wn(u,y=le.line)}}function Mr(e,t,d,u){u-=Cr(t);var y=t.text.length,W=Wt(function($){return ut(e,d,$-1).bottom<=u},y,0);return y=Wt(function($){return ut(e,d,$).top>u},W,y),{begin:W,end:y}}function ir(e,t,d,u){d||(d=ke(e,t));var y=Lr(e,t,ut(e,d,u),"line").top;return Mr(e,t,d,y)}function Ur(e,t,d,u){return e.bottom<=d?!1:e.top>d?!0:(u?e.left:e.right)>t}function oi(e,t,d,u,y){y-=Pn(t);var W=ke(e,t),$=Cr(t),ee=0,te=t.text.length,le=!0,Me=Ln(t,e.doc.direction);if(Me){var He=(e.options.lineWrapping?Xr:jr)(e,t,d,W,Me,u,y);le=He.level!=1,ee=le?He.from:He.to-1,te=le?He.to:He.from-1}var xt=null,pt=null,an=Wt(function(Tr){var _r=ut(e,W,Tr);return _r.top+=$,_r.bottom+=$,Ur(_r,u,y,!1)?(_r.top<=y&&_r.left<=u&&(xt=Tr,pt=_r),!0):!1},ee,te),Cn,Wn,Yn=!1;if(pt){var Zn=u-pt.left<pt.right-u,Xn=Zn==le;an=xt+(Xn?0:1),Wn=Xn?"after":"before",Cn=Zn?pt.left:pt.right}else{!le&&(an==te||an==ee)&&an++,Wn=an==0?"after":an==t.text.length?"before":ut(e,W,an-(le?1:0)).bottom+$<=y==le?"after":"before";var ar=En(e,pn(d,an,Wn),"line",t,W);Cn=ar.left,Yn=y<ar.top?-1:y>=ar.bottom?1:0}return an=et(t.text,an,1),zt(d,an,Wn,Yn,u-Cn)}function jr(e,t,d,u,y,W,$){var ee=Wt(function(He){var xt=y[He],pt=xt.level!=1;return Ur(En(e,pn(d,pt?xt.to:xt.from,pt?"before":"after"),"line",t,u),W,$,!0)},0,y.length-1),te=y[ee];if(ee>0){var le=te.level!=1,Me=En(e,pn(d,le?te.from:te.to,le?"after":"before"),"line",t,u);Ur(Me,W,$,!0)&&Me.top>$&&(te=y[ee-1])}return te}function Xr(e,t,d,u,y,W,$){var ee=Mr(e,t,u,$),te=ee.begin,le=ee.end;/\s/.test(t.text.charAt(le-1))&&le--;for(var Me=null,He=null,xt=0;xt<y.length;xt++){var pt=y[xt];if(pt.from>=le||pt.to<=te)continue;var an=pt.level!=1,Cn=ut(e,u,an?Math.min(le,pt.to)-1:Math.max(te,pt.from)).right,Wn=Cn<W?W-Cn+1e9:Cn-W;(!Me||He>Wn)&&(Me=pt,He=Wn)}return Me||(Me=y[y.length-1]),Me.from<te&&(Me={from:te,to:Me.to,level:Me.level}),Me.to>le&&(Me={from:Me.from,to:le,level:Me.level}),Me}var zr;function Wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(zr==null){zr=p("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)zr.appendChild(document.createTextNode("x")),zr.appendChild(p("br"));zr.appendChild(document.createTextNode("x"))}h(e.measure,zr);var d=zr.offsetHeight/50;return d>3&&(e.cachedTextHeight=d),E(e.measure),d||1}function Hr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=p("span","xxxxxxxxxx"),d=p("pre",[t],"CodeMirror-line-like");h(e.measure,d);var u=t.getBoundingClientRect(),y=(u.right-u.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function vr(e){for(var t=e.display,d={},u={},y=t.gutters.clientLeft,W=t.gutters.firstChild,$=0;W;W=W.nextSibling,++$){var ee=e.display.gutterSpecs[$].className;d[ee]=W.offsetLeft+W.clientLeft+y,u[ee]=W.clientWidth}return{fixedPos:yi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:d,gutterWidth:u,wrapperWidth:t.wrapper.clientWidth}}function yi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Qi(e){var t=Wr(e.display),d=e.options.lineWrapping,u=d&&Math.max(5,e.display.scroller.clientWidth/Hr(e.display)-3);return function(y){if(Xt(e.doc,y))return 0;var W=0;if(y.widgets)for(var $=0;$<y.widgets.length;$++)y.widgets[$].height&&(W+=y.widgets[$].height);return d?W+(Math.ceil(y.text.length/u)||1)*t:W+t}}function ji(e){var t=e.doc,d=Qi(e);t.iter(function(u){var y=d(u);y!=u.height&&rr(u,y)})}function Ri(e,t,d,u){var y=e.display;if(!d&&be(t).getAttribute("cm-not-content")=="true")return null;var W,$,ee=y.lineSpace.getBoundingClientRect();try{W=t.clientX-ee.left,$=t.clientY-ee.top}catch(He){return null}var te=pr(e,W,$),le;if(u&&te.xRel>0&&(le=wn(e.doc,te.line).text).length==te.ch){var Me=Y(le,le.length,e.options.tabSize)-le.length;te=pn(te.line,Math.max(0,Math.round((W-Ne(e.display).left)/Hr(e.display))-Me))}return te}function ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var d=e.display.view,u=0;u<d.length;u++)if(t-=d[u].size,t<0)return u}function qr(e,t,d,u){t==null&&(t=e.doc.first),d==null&&(d=e.doc.first+e.doc.size),u||(u=0);var y=e.display;if(u&&d<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)Dr&&It(e.doc,t)<y.viewTo&&ci(e);else if(d<=y.viewFrom)Dr&&gt(e.doc,d+u)>y.viewFrom?ci(e):(y.viewFrom+=u,y.viewTo+=u);else if(t<=y.viewFrom&&d>=y.viewTo)ci(e);else if(t<=y.viewFrom){var W=Fi(e,d,d+u,1);W?(y.view=y.view.slice(W.index),y.viewFrom=W.lineN,y.viewTo+=u):ci(e)}else if(d>=y.viewTo){var $=Fi(e,t,t,-1);$?(y.view=y.view.slice(0,$.index),y.viewTo=$.lineN):ci(e)}else{var ee=Fi(e,t,t,-1),te=Fi(e,d,d+u,1);ee&&te?(y.view=y.view.slice(0,ee.index).concat(Rn(e,ee.lineN,te.lineN)).concat(y.view.slice(te.index)),y.viewTo+=u):ci(e)}var le=y.externalMeasured;le&&(d<le.lineN?le.lineN+=u:t<le.lineN+le.size&&(y.externalMeasured=null))}function ii(e,t,d){e.curOp.viewChanged=!0;var u=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(u.externalMeasured=null),t<u.viewFrom||t>=u.viewTo)return;var W=u.view[ui(e,t)];if(W.node==null)return;var $=W.changes||(W.changes=[]);ie($,d)==-1&&$.push(d)}function ci(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fi(e,t,d,u){var y=ui(e,t),W,$=e.display.view;if(!Dr||d==e.doc.first+e.doc.size)return{index:y,lineN:d};for(var ee=e.display.viewFrom,te=0;te<y;te++)ee+=$[te].size;if(ee!=t){if(u>0){if(y==$.length-1)return null;W=ee+$[y].size-t,y++}else W=ee-t;t+=W,d+=W}for(;It(e.doc,d)!=d;){if(y==(u<0?0:$.length-1))return null;d+=u*$[y-(u<0?1:0)].size,y+=u}return{index:y,lineN:d}}function ha(e,t,d){var u=e.display,y=u.view;y.length==0||t>=u.viewTo||d<=u.viewFrom?(u.view=Rn(e,t,d),u.viewFrom=t):(u.viewFrom>t?u.view=Rn(e,t,u.viewFrom).concat(u.view):u.viewFrom<t&&(u.view=u.view.slice(ui(e,t))),u.viewFrom=t,u.viewTo<d?u.view=u.view.concat(Rn(e,u.viewTo,d)):u.viewTo>d&&(u.view=u.view.slice(0,ui(e,d)))),u.viewTo=d}function sa(e){for(var t=e.display.view,d=0,u=0;u<t.length;u++){var y=t[u];!y.hidden&&(!y.node||y.changes)&&++d}return d}function ei(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Zi(e,t){t===void 0&&(t=!0);for(var d=e.doc,u={},y=u.cursors=document.createDocumentFragment(),W=u.selection=document.createDocumentFragment(),$=0;$<d.sel.ranges.length;$++){if(!t&&$==d.sel.primIndex)continue;var ee=d.sel.ranges[$];if(ee.from().line>=e.display.viewTo||ee.to().line<e.display.viewFrom)continue;var te=ee.empty();(te||e.options.showCursorWhenSelecting)&&qi(e,ee.head,y),te||Qr(e,ee,W)}return u}function qi(e,t,d){var u=En(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=d.appendChild(p("div","\xA0","CodeMirror-cursor"));if(y.style.left=u.left+"px",y.style.top=u.top+"px",y.style.height=Math.max(0,u.bottom-u.top)*e.options.cursorHeight+"px",u.other){var W=d.appendChild(p("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));W.style.display="",W.style.left=u.other.left+"px",W.style.top=u.other.top+"px",W.style.height=(u.other.bottom-u.other.top)*.85+"px"}}function si(e,t){return e.top-t.top||e.left-t.left}function Qr(e,t,d){var u=e.display,y=e.doc,W=document.createDocumentFragment(),$=Ne(e.display),ee=$.left,te=Math.max(u.sizerWidth,Se(e)-u.sizer.offsetLeft)-$.right,le=y.direction=="ltr";function Me(Xn,ar,Tr,_r){ar<0&&(ar=0),ar=Math.round(ar),_r=Math.round(_r),W.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+Xn+`px;
top: `+ar+"px; width: "+(Tr==null?te-Xn:Tr)+`px;
height: `+(_r-ar)+"px"))}function He(Xn,ar,Tr){var _r=wn(y,Xn),Fr=_r.text.length,pi,Hi;function Ci(ki,ra){return en(e,pn(Xn,ki),"div",_r,ra)}function oa(ki,ra,zi){var Ui=ir(e,_r,null,ki),Ii=ra=="ltr"==(zi=="after")?"left":"right",Oi=zi=="after"?Ui.begin:Ui.end-(/\s/.test(_r.text.charAt(Ui.end-1))?2:1);return Ci(Oi,Ii)[Ii]}var na=Ln(_r,y.direction);return Yt(na,ar||0,Tr==null?Fr:Tr,function(ki,ra,zi,Ui){var Ii=zi=="ltr",Oi=Ci(ki,Ii?"left":"right"),ia=Ci(ra-1,Ii?"right":"left"),So=ar==null&&ki==0,to=Tr==null&&ra==Fr,Xi=Ui==0,Pa=!na||Ui==na.length-1;if(ia.top-Oi.top<=3){var Wi=(le?So:to)&&Xi,ms=(le?to:So)&&Pa,Ga=Wi?ee:(Ii?Oi:ia).left,lo=ms?te:(Ii?ia:Oi).right;Me(Ga,Oi.top,lo-Ga,Oi.bottom)}else{var uo,Ji,Oo,gs;Ii?(uo=le&&So&&Xi?ee:Oi.left,Ji=le?te:oa(ki,zi,"before"),Oo=le?ee:oa(ra,zi,"after"),gs=le&&to&&Pa?te:ia.right):(uo=le?oa(ki,zi,"before"):ee,Ji=!le&&So&&Xi?te:Oi.right,Oo=!le&&to&&Pa?ee:ia.left,gs=le?oa(ra,zi,"after"):te),Me(uo,Oi.top,Ji-uo,Oi.bottom),Oi.bottom<ia.top&&Me(ee,Oi.bottom,null,ia.top),Me(Oo,ia.top,gs-Oo,ia.bottom)}(!pi||si(Oi,pi)<0)&&(pi=Oi),si(ia,pi)<0&&(pi=ia),(!Hi||si(Oi,Hi)<0)&&(Hi=Oi),si(ia,Hi)<0&&(Hi=ia)}),{start:pi,end:Hi}}var xt=t.from(),pt=t.to();if(xt.line==pt.line)He(xt.line,xt.ch,pt.ch);else{var an=wn(y,xt.line),Cn=wn(y,pt.line),Wn=at(an)==at(Cn),Yn=He(xt.line,xt.ch,Wn?an.text.length+1:null).end,Zn=He(pt.line,Wn?0:null,pt.ch).start;Wn&&(Yn.top<Zn.top-2?(Me(Yn.right,Yn.top,null,Yn.bottom),Me(ee,Zn.top,Zn.left,Zn.bottom)):Me(Yn.right,Yn.top,Zn.left-Yn.right,Yn.bottom)),Yn.bottom<Zn.top&&Me(ee,Yn.bottom,null,Zn.top)}d.appendChild(W)}function Ti(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var d=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ca(e),t.cursorDiv.style.visibility=(d=!d)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ma(e){e.state.focused||(e.display.input.focus(),la(e))}function no(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ca(e))},100)}function la(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(tt(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ti(e)}function Ca(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(tt(e,"blur",e,t),e.state.focused=!1,v(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ta(e){for(var t=e.display,d=t.lineDiv.offsetTop,u=0;u<t.view.length;u++){var y=t.view[u],W=e.options.lineWrapping,$=void 0,ee=0;if(y.hidden)continue;if(K&&k<8){var te=y.node.offsetTop+y.node.offsetHeight;$=te-d,d=te}else{var le=y.node.getBoundingClientRect();$=le.bottom-le.top,!W&&y.text.firstChild&&(ee=y.text.firstChild.getBoundingClientRect().right-le.left-1)}var Me=y.line.height-$;if((Me>.005||Me<-.005)&&(rr(y.line,$),Sa(y.line),y.rest))for(var He=0;He<y.rest.length;He++)Sa(y.rest[He]);if(ee>e.display.sizerWidth){var xt=Math.ceil(ee/Hr(e.display));xt>e.display.maxLineLength&&(e.display.maxLineLength=xt,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Sa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var d=e.widgets[t],u=d.node.parentNode;u&&(d.height=u.offsetHeight)}}function ka(e,t,d){var u=d&&d.top!=null?Math.max(0,d.top):e.scroller.scrollTop;u=Math.floor(u-_i(e));var y=d&&d.bottom!=null?d.bottom:u+e.wrapper.clientHeight,W=Pr(t,u),$=Pr(t,y);if(d&&d.ensure){var ee=d.ensure.from.line,te=d.ensure.to.line;ee<W?(W=ee,$=Pr(t,Pn(wn(t,ee))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=$&&(W=Pr(t,Pn(wn(t,te))-e.wrapper.clientHeight),$=te)}return{from:W,to:Math.max($,W+1)}}function co(e,t){if(ot(e,"scrollCursorIntoView"))return;var d=e.display,u=d.sizer.getBoundingClientRect(),y=null;if(t.top+u.top<0?y=!0:t.bottom+u.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!o){var W=p("div","\u200B",null,`position: absolute;
top: `+(t.top-d.viewOffset-_i(e.display))+`px;
height: `+(t.bottom-t.top+ze(e)+d.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(W),W.scrollIntoView(y),e.display.lineSpace.removeChild(W)}}function Ro(e,t,d,u){u==null&&(u=0);var y;!e.options.lineWrapping&&t==d&&(t=t.ch?pn(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,d=t.sticky=="before"?pn(t.line,t.ch+1,"before"):t);for(var W=0;W<5;W++){var $=!1,ee=En(e,t),te=!d||d==t?ee:En(e,d);y={left:Math.min(ee.left,te.left),top:Math.min(ee.top,te.top)-u,right:Math.max(ee.left,te.left),bottom:Math.max(ee.bottom,te.bottom)+u};var le=Oa(e,y),Me=e.doc.scrollTop,He=e.doc.scrollLeft;if(le.scrollTop!=null&&(Da(e,le.scrollTop),Math.abs(e.doc.scrollTop-Me)>1&&($=!0)),le.scrollLeft!=null&&(Ni(e,le.scrollLeft),Math.abs(e.doc.scrollLeft-He)>1&&($=!0)),!$)break}return y}function za(e,t){var d=Oa(e,t);d.scrollTop!=null&&Da(e,d.scrollTop),d.scrollLeft!=null&&Ni(e,d.scrollLeft)}function Oa(e,t){var d=e.display,u=Wr(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,W=re(e),$={};t.bottom-t.top>W&&(t.bottom=t.top+W);var ee=e.doc.height+Ee(d),te=t.top<u,le=t.bottom>ee-u;if(t.top<y)$.scrollTop=te?0:t.top;else if(t.bottom>y+W){var Me=Math.min(t.top,(le?ee:t.bottom)-W);Me!=y&&($.scrollTop=Me)}var He=e.options.fixedGutter?0:d.gutters.offsetWidth,xt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-He,pt=Se(e)-d.gutters.offsetWidth,an=t.right-t.left>pt;return an&&(t.right=t.left+pt),t.left<10?$.scrollLeft=0:t.left<xt?$.scrollLeft=Math.max(0,t.left+He-(an?0:10)):t.right>pt+xt-3&&($.scrollLeft=t.right+(an?0:10)-pt),$}function Va(e,t){if(t==null)return;Ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function _a(e){Ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ra(e,t,d){(t!=null||d!=null)&&Ya(e),t!=null&&(e.curOp.scrollLeft=t),d!=null&&(e.curOp.scrollTop=d)}function ho(e,t){Ya(e),e.curOp.scrollToPos=t}function Ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var d=Gt(e,t.from),u=Gt(e,t.to);Aa(e,d,u,t.margin)}}function Aa(e,t,d,u){var y=Oa(e,{left:Math.min(t.left,d.left),top:Math.min(t.top,d.top)-u,right:Math.max(t.right,d.right),bottom:Math.max(t.bottom,d.bottom)+u});Ra(e,y.scrollLeft,y.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;U||Ua(e,{top:t}),ya(e,t,!0),U&&Ua(e),Na(e,100)}function ya(e,t,d){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!d)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Ni(e,t,d,u){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(d?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!u)return;e.doc.scrollLeft=t,Nr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,d=t.gutters.offsetWidth,u=Math.round(e.doc.height+Ee(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?d:0,docHeight:u,scrollHeight:u+ze(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:d}}var pa=function(e,t,d){this.cm=d;var u=this.vert=p("div",[p("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=p("div",[p("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");u.tabIndex=y.tabIndex=-1,e(u),e(y),Fe(u,"scroll",function(){u.clientHeight&&t(u.scrollTop,"vertical")}),Fe(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&k<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};pa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,d=e.scrollHeight>e.clientHeight+1,u=e.nativeBarWidth;if(d){this.vert.style.display="block",this.vert.style.bottom=t?u+"px":"0";var y=e.viewHeight-(t?u:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=d?u+"px":"0",this.horiz.style.left=e.barLeft+"px";var W=e.viewWidth-e.barLeft-(d?u:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+W)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(u==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:d?u:0,bottom:t?u:0}},pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},pa.prototype.zeroWidthHack=function(){var e=i&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new q,this.disableVert=new q},pa.prototype.enableZeroWidthBar=function(e,t,d){e.style.pointerEvents="auto";function u(){var y=e.getBoundingClientRect(),W=d=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);W!=e?e.style.pointerEvents="none":t.set(1e3,u)}t.set(1e3,u)},pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ba=function(){};ba.prototype.update=function(){return{bottom:0,right:0}},ba.prototype.setScrollLeft=function(){},ba.prototype.setScrollTop=function(){},ba.prototype.clear=function(){};function ma(e,t){t||(t=fa(e));var d=e.display.barWidth,u=e.display.barHeight;Xa(e,t);for(var y=0;y<4&&d!=e.display.barWidth||u!=e.display.barHeight;y++)d!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Xa(e,fa(e)),d=e.display.barWidth,u=e.display.barHeight}function Xa(e,t){var d=e.display,u=d.scrollbars.update(t);d.sizer.style.paddingRight=(d.barWidth=u.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=u.bottom)+"px",d.heightForcer.style.borderBottom=u.bottom+"px solid transparent",u.right&&u.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=u.bottom+"px",d.scrollbarFiller.style.width=u.right+"px"):d.scrollbarFiller.style.display="",u.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=u.bottom+"px",d.gutterFiller.style.width=t.gutterWidth+"px"):d.gutterFiller.style.display=""}var $a={native:pa,null:ba};function Ja(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&v(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new $a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Fe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,d){d=="horizontal"?Ni(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Ia=0;function ua(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:++Ia},vn(e.curOp)}function Ea(e){var t=e.curOp;t&&Dn(t,function(d){for(var u=0;u<d.ops.length;u++)d.ops[u].cm.curOp=null;ro(d)})}function ro(e){for(var t=e.ops,d=0;d<t.length;d++)Ao(t[d]);for(var u=0;u<t.length;u++)Do(t[u]);for(var y=0;y<t.length;y++)fo(t[y]);for(var W=0;W<t.length;W++)io(t[W]);for(var $=0;$<t.length;$++)po(t[$])}function Ao(e){var t=e.cm,d=t.display;ao(t),e.updateMaxLine&&Sn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ea(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Do(e){e.updatedDisplay=e.mustUpdate&&xa(e.cm,e.update)}function fo(e){var t=e.cm,d=t.display;e.updatedDisplay&&Ta(t),e.barMeasure=fa(t),d.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Pe(t,d.maxLine,d.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+ze(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-Se(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=d.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ni(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var d=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,d),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&$r(t,e.barMeasure),e.selectionChanged&&Ti(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),d&&Ma(e.cm)}function po(e){var t=e.cm,d=t.display,u=t.doc;if(e.updatedDisplay&&Qa(t,e.update),d.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(d.wheelStartX=d.wheelStartY=null),e.scrollTop!=null&&ya(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ni(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=Ro(t,L(u,e.scrollToPos.from),L(u,e.scrollToPos.to),e.scrollToPos.margin);co(t,y)}var W=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(W)for(var ee=0;ee<W.length;++ee)W[ee].lines.length||tt(W[ee],"hide");if($)for(var te=0;te<$.length;++te)$[te].lines.length&&tt($[te],"unhide");d.wrapper.offsetHeight&&(u.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&tt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ki(e,t){if(e.curOp)return t();ua(e);try{return t()}finally{Ea(e)}}function bi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ua(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Pi(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function Ei(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ua(t);try{return e.apply(this,arguments)}finally{Ea(t)}}}function Na(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,u=In(e,t.highlightFrontier),y=[];t.iter(u.line,Math.min(t.first+t.size,e.display.viewTo+500),function(W){if(u.line>=e.display.viewFrom){var $=W.styles,ee=W.text.length>e.options.maxHighlightLength?sn(t.mode,u.state):null,te=je(e,W,u,!0);ee&&(u.state=ee),W.styles=te.styles;var le=W.styleClasses,Me=te.classes;Me?W.styleClasses=Me:le&&(W.styleClasses=null);for(var He=!$||$.length!=W.styles.length||le!=Me&&(!le||!Me||le.bgClass!=Me.bgClass||le.textClass!=Me.textClass),xt=0;!He&&xt<$.length;++xt)He=$[xt]!=W.styles[xt];He&&y.push(u.line),W.stateAfter=u.save(),u.nextLine()}else W.text.length<=e.options.maxHighlightLength&&Jn(e,W.text,u),W.stateAfter=u.line%5==0?u.save():null,u.nextLine();if(+new Date>d)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=u.line,t.modeFrontier=Math.max(t.modeFrontier,u.line),y.length&&Ki(e,function(){for(var W=0;W<y.length;W++)ii(e,y[W],"text")})}var ea=function(e,t,d){var u=e.display;this.viewport=t,this.visible=ka(u,e.doc,t),this.editorIsHidden=!u.wrapper.offsetWidth,this.wrapperHeight=u.wrapper.clientHeight,this.wrapperWidth=u.wrapper.clientWidth,this.oldDisplayWidth=Se(e),this.force=d,this.dims=vr(e),this.events=[]};ea.prototype.signal=function(e,t){ye(e,t)&&this.events.push(arguments)},ea.prototype.finish=function(){for(var e=0;e<this.events.length;e++)tt.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ze(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ze(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=j();if(!t||!w(e.display.lineDiv,t))return null;var d={activeElt:t};if(window.getSelection){var u=window.getSelection();u.anchorNode&&u.extend&&w(e.display.lineDiv,u.anchorNode)&&(d.anchorNode=u.anchorNode,d.anchorOffset=u.anchorOffset,d.focusNode=u.focusNode,d.focusOffset=u.focusOffset)}return d}function so(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),d=document.createRange();d.setEnd(e.anchorNode,e.anchorOffset),d.collapse(!1),t.removeAllRanges(),t.addRange(d),t.extend(e.focusNode,e.focusOffset)}}function xa(e,t){var d=e.display,u=e.doc;if(t.editorIsHidden)return ci(e),!1;if(!t.force&&t.visible.from>=d.viewFrom&&t.visible.to<=d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&sa(e)==0)return!1;gi(e)&&(ci(e),t.dims=vr(e));var y=u.first+u.size,W=Math.max(t.visible.from-e.options.viewportMargin,u.first),$=Math.min(y,t.visible.to+e.options.viewportMargin);d.viewFrom<W&&W-d.viewFrom<20&&(W=Math.max(u.first,d.viewFrom)),d.viewTo>$&&d.viewTo-$<20&&($=Math.min(y,d.viewTo)),Dr&&(W=It(e.doc,W),$=gt(e.doc,$));var ee=W!=d.viewFrom||$!=d.viewTo||d.lastWrapHeight!=t.wrapperHeight||d.lastWrapWidth!=t.wrapperWidth;ha(e,W,$),d.viewOffset=Pn(wn(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var te=sa(e);if(!ee&&te==0&&!t.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var le=oo(e);return te>4&&(d.lineDiv.style.display="none"),go(e,d.updateLineNumbers,t.dims),te>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,so(le),E(d.cursorDiv),E(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,ee&&(d.lastWrapHeight=t.wrapperHeight,d.lastWrapWidth=t.wrapperWidth,Na(e,400)),d.updateLineNumbers=null,!0}function Qa(e,t){for(var d=t.viewport,u=!0;;u=!1){if(!u||!e.options.lineWrapping||t.oldDisplayWidth==Se(e)){if(d&&d.top!=null&&(d={top:Math.min(e.doc.height+Ee(e.display)-re(e),d.top)}),t.visible=ka(e.display,e.doc,d),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else u&&(t.visible=ka(e.display,e.doc,d));if(!xa(e,t))break;Ta(e);var y=fa(e);ei(e),ma(e,y),$r(e,y),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 Ua(e,t){var d=new ea(e,t);if(xa(e,d)){Ta(e),Qa(e,d);var u=fa(e);ei(e),ma(e,u),$r(e,u),d.finish()}}function go(e,t,d){var u=e.display,y=e.options.lineNumbers,W=u.lineDiv,$=W.firstChild;function ee(an){var Cn=an.nextSibling;return r&&i&&e.display.currentWheelTarget==an?an.style.display="none":an.parentNode.removeChild(an),Cn}for(var te=u.view,le=u.viewFrom,Me=0;Me<te.length;Me++){var He=te[Me];if(!He.hidden)if(!He.node||He.node.parentNode!=W){var xt=mr(e,He,le,d);W.insertBefore(xt,$)}else{for(;$!=He.node;)$=ee($);var pt=y&&t!=null&&t<=le&&He.lineNumber;He.changes&&(ie(He.changes,"gutter")>-1&&(pt=!1),Nt(e,He,le,d)),pt&&(E(He.lineNumber),He.lineNumber.appendChild(document.createTextNode(hi(e.options,le)))),$=He.node.nextSibling}le+=He.size}for(;$;)$=ee($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function $r(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+ze(e)+"px"}function Nr(e){var t=e.display,d=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var u=yi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,W=u+"px",$=0;$<d.length;$++)if(!d[$].hidden){e.options.fixedGutter&&(d[$].gutter&&(d[$].gutter.style.left=W),d[$].gutterBackground&&(d[$].gutterBackground.style.left=W));var ee=d[$].alignable;if(ee)for(var te=0;te<ee.length;te++)ee[te].style.left=W}e.options.fixedGutter&&(t.gutters.style.left=u+y+"px")}function gi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,d=hi(e.options,t.first+t.size-1),u=e.display;if(d.length!=u.lineNumChars){var y=u.measure.appendChild(p("div",[p("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),W=y.firstChild.offsetWidth,$=y.offsetWidth-W;return u.lineGutter.style.width="",u.lineNumInnerWidth=Math.max(W,u.lineGutter.offsetWidth-$)+1,u.lineNumWidth=u.lineNumInnerWidth+$,u.lineNumChars=u.lineNumInnerWidth?d.length:-1,u.lineGutter.style.width=u.lineNumWidth+"px",Za(e.display),!0}return!1}function Bi(e,t){for(var d=[],u=!1,y=0;y<e.length;y++){var W=e[y],$=null;if(typeof W!="string"&&($=W.style,W=W.className),W=="CodeMirror-linenumbers")if(t)u=!0;else continue;d.push({className:W,style:$})}return t&&!u&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function La(e){var t=e.gutters,d=e.gutterSpecs;E(t),e.lineGutter=null;for(var u=0;u<d.length;++u){var y=d[u],W=y.className,$=y.style,ee=t.appendChild(p("div",null,"CodeMirror-gutter "+W));$&&(ee.style.cssText=$),W=="CodeMirror-linenumbers"&&(e.lineGutter=ee,ee.style.width=(e.lineNumWidth||1)+"px")}t.style.display=d.length?"":"none",Za(e)}function ca(e){La(e.display),qr(e),Nr(e)}function ja(e,t,d,u){var y=this;this.input=d,y.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=p("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=_("div",null,"CodeMirror-code"),y.selectionDiv=p("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=p("div",null,"CodeMirror-cursors"),y.measure=p("div",null,"CodeMirror-measure"),y.lineMeasure=p("div",null,"CodeMirror-measure"),y.lineSpace=_("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var W=_("div",[y.lineSpace],"CodeMirror-lines");y.mover=p("div",[W],null,"position: relative"),y.sizer=p("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=p("div",null,null,"position: absolute; height: "+me+"px; width: 1px;"),y.gutters=p("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=p("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=p("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),K&&k<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!r&&!(U&&s)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=t.first,y.reportedViewFrom=y.reportedViewTo=t.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=Bi(u.gutters,u.lineNumbers),La(y),d.init(y)}var da=0,Si=null;K?Si=-.53:U?Si=15:b?Si=-.7:m&&(Si=-1/3);function Fa(e){var t=e.wheelDeltaX,d=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),d==null&&e.detail&&e.axis==e.VERTICAL_AXIS?d=e.detail:d==null&&(d=e.wheelDelta),{x:t,y:d}}function Ba(e){var t=Fa(e);return t.x*=Si,t.y*=Si,t}function Ha(e,t){var d=Fa(t),u=d.x,y=d.y,W=e.display,$=W.scroller,ee=$.scrollWidth>$.clientWidth,te=$.scrollHeight>$.clientHeight;if(!(u&&ee||y&&te))return;if(y&&i&&r){e:for(var le=t.target,Me=W.view;le!=$;le=le.parentNode)for(var He=0;He<Me.length;He++)if(Me[He].node==le){e.display.currentWheelTarget=le;break e}}if(u&&!U&&!f&&Si!=null){y&&te&&Da(e,Math.max(0,$.scrollTop+y*Si)),Ni(e,Math.max(0,$.scrollLeft+u*Si)),(!y||y&&te)&&ae(t),W.wheelStartX=null;return}if(y&&Si!=null){var xt=y*Si,pt=e.doc.scrollTop,an=pt+W.wrapper.clientHeight;xt<0?pt=Math.max(0,pt+xt-50):an=Math.min(e.doc.height,an+xt+50),Ua(e,{top:pt,bottom:an})}da<20&&(W.wheelStartX==null?(W.wheelStartX=$.scrollLeft,W.wheelStartY=$.scrollTop,W.wheelDX=u,W.wheelDY=y,setTimeout(function(){if(W.wheelStartX==null)return;var Cn=$.scrollLeft-W.wheelStartX,Wn=$.scrollTop-W.wheelStartY,Yn=Wn&&W.wheelDY&&Wn/W.wheelDY||Cn&&W.wheelDX&&Cn/W.wheelDX;if(W.wheelStartX=W.wheelStartY=null,!Yn)return;Si=(Si*da+Yn)/(da+1),++da},200)):(W.wheelDX+=u,W.wheelDY+=y))}var Gi=function(e,t){this.ranges=e,this.primIndex=t};Gi.prototype.primary=function(){return this.ranges[this.primIndex]},Gi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var d=this.ranges[t],u=e.ranges[t];if(!mi(d.anchor,u.anchor)||!mi(d.head,u.head))return!1}return!0},Gi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Vr(wi(this.ranges[t].anchor),wi(this.ranges[t].head));return new Gi(e,this.primIndex)},Gi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Gi.prototype.contains=function(e,t){t||(t=e);for(var d=0;d<this.ranges.length;d++){var u=this.ranges[d];if(or(t,u.from())>=0&&or(e,u.to())<=0)return d}return-1};var Vr=function(e,t){this.anchor=e,this.head=t};Vr.prototype.from=function(){return ni(this.anchor,this.head)},Vr.prototype.to=function(){return ti(this.anchor,this.head)},Vr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Or(e,t,d){var u=e&&e.options.selectionsMayTouch,y=t[d];t.sort(function(xt,pt){return or(xt.from(),pt.from())}),d=ie(t,y);for(var W=1;W<t.length;W++){var $=t[W],ee=t[W-1],te=or(ee.to(),$.from());if(u&&!$.empty()?te>0:te>=0){var le=ni(ee.from(),$.from()),Me=ti(ee.to(),$.to()),He=ee.empty()?$.from()==$.head:ee.from()==ee.head;W<=d&&--d,t.splice(--W,2,new Vr(He?Me:le,He?le:Me))}}return new Gi(t,d)}function $n(e,t){return new Gi([new Vr(e,t||e)],0)}function hr(e){return e.text?pn(e.from.line+e.text.length-1,lt(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ir(e,t){if(or(e,t.from)<0)return e;if(or(e,t.to)<=0)return hr(t);var d=e.line+t.text.length-(t.to.line-t.from.line)-1,u=e.ch;return e.line==t.to.line&&(u+=hr(t).ch-t.to.ch),pn(d,u)}function fi(e,t){for(var d=[],u=0;u<e.sel.ranges.length;u++){var y=e.sel.ranges[u];d.push(new Vr(Ir(y.anchor,t),Ir(y.head,t)))}return Or(e.cm,d,e.sel.primIndex)}function ga(e,t,d){return e.line==t.line?pn(d.line,e.ch-t.ch+d.ch):pn(d.line+(e.line-t.line),e.ch)}function aa(e,t,d){for(var u=[],y=pn(e.first,0),W=y,$=0;$<t.length;$++){var ee=t[$],te=ga(ee.from,y,W),le=ga(hr(ee),y,W);if(y=ee.to,W=le,d=="around"){var Me=e.sel.ranges[$],He=or(Me.head,Me.anchor)<0;u[$]=new Vr(He?le:te,He?te:le)}else u[$]=new Vr(te,te)}return new Gi(u,e.sel.primIndex)}function Mi(e){e.doc.mode=qe(e.options,e.doc.modeOption),$i(e)}function $i(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Na(e,100),e.state.modeGen++,e.curOp&&qr(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&lt(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,d,u){function y(Zn){return d?d[Zn]:null}function W(Zn,Xn,ar){Mn(Zn,Xn,ar,u),Lt(Zn,"change",Zn,t)}function $(Zn,Xn){for(var ar=[],Tr=Zn;Tr<Xn;++Tr)ar.push(new Nn(le[Tr],y(Tr),u));return ar}var ee=t.from,te=t.to,le=t.text,Me=wn(e,ee.line),He=wn(e,te.line),xt=lt(le),pt=y(le.length-1),an=te.line-ee.line;if(t.full)e.insert(0,$(0,le.length)),e.remove(le.length,e.size-le.length);else if(va(e,t)){var Cn=$(0,le.length-1);W(He,He.text,pt),an&&e.remove(ee.line,an),Cn.length&&e.insert(ee.line,Cn)}else if(Me==He)if(le.length==1)W(Me,Me.text.slice(0,ee.ch)+xt+Me.text.slice(te.ch),pt);else{var Wn=$(1,le.length-1);Wn.push(new Nn(xt+Me.text.slice(te.ch),pt,u)),W(Me,Me.text.slice(0,ee.ch)+le[0],y(0)),e.insert(ee.line+1,Wn)}else if(le.length==1)W(Me,Me.text.slice(0,ee.ch)+le[0]+He.text.slice(te.ch),y(0)),e.remove(ee.line+1,an);else{W(Me,Me.text.slice(0,ee.ch)+le[0],y(0)),W(He,xt+He.text.slice(te.ch),pt);var Yn=$(1,le.length-1);an>1&&e.remove(ee.line+1,an-1),e.insert(ee.line+1,Yn)}Lt(e,"change",e,t)}function Ai(e,t,d){function u(y,W,$){if(y.linked)for(var ee=0;ee<y.linked.length;++ee){var te=y.linked[ee];if(te.doc==W)continue;var le=$&&te.sharedHist;if(d&&!le)continue;t(te.doc,le),u(te.doc,y,le)}}u(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ji(e),Mi(e),_s(e),e.options.lineWrapping||Sn(e),e.options.mode=t.modeOption,qr(e)}function _s(e){(e.doc.direction=="rtl"?B:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ki(e,function(){_s(e),qr(e)})}function Go(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function rs(e,t){var d={from:wi(t.from),to:hr(t),text:br(e,t.from,t.to)};return Es(e,d,t.from.line,t.to.line+1),Ai(e,function(u){return Es(u,d,t.from.line,t.to.line+1)},!0),d}function ys(e){for(;e.length;){var t=lt(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),lt(e.done);if(e.done.length&&!lt(e.done).ranges)return lt(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),lt(e.done)}function bs(e,t,d,u){var y=e.history;y.undone.length=0;var W=+new Date,$,ee;if((y.lastOp==u||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>W-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(y,y.lastOp==u)))ee=lt($.changes),or(t.from,t.to)==0&&or(t.from,ee.to)==0?ee.to=hr(t):$.changes.push(rs(e,t));else{var te=lt(y.done);for((!te||!te.ranges)&&zo(e.sel,y.done),$={changes:[rs(e,t)],generation:y.generation},y.done.push($);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(d),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=W,y.lastOp=y.lastSelOp=u,y.lastOrigin=y.lastSelOrigin=t.origin,ee||tt(e,"historyAdded")}function ml(e,t,d,u){var y=t.charAt(0);return y=="*"||y=="+"&&d.ranges.length==u.ranges.length&&d.somethingSelected()==u.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,d,u){var y=e.history,W=u&&u.origin;d==y.lastSelOp||W&&y.lastSelOrigin==W&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==W||ml(e,W,lt(y.done),t))?y.done[y.done.length-1]=t:zo(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=W,y.lastSelOp=d,u&&u.clearRedo!==!1&&ys(y.undone)}function zo(e,t){var d=lt(t);d&&d.ranges&&d.equals(e)||t.push(e)}function Es(e,t,d,u){var y=t["spans_"+e.id],W=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,u),function($){$.markedSpans&&((y||(y=t["spans_"+e.id]={}))[W]=$.markedSpans),++W})}function vl(e){if(!e)return null;for(var t,d=0;d<e.length;++d)e[d].marker.explicitlyCleared?t||(t=e.slice(0,d)):t&&t.push(e[d]);return t?t.length?t:null:e}function _l(e,t){var d=t["spans_"+e.id];if(!d)return null;for(var u=[],y=0;y<t.text.length;++y)u.push(vl(d[y]));return u}function xs(e,t){var d=_l(e,t),u=sr(e,t);if(!d)return u;if(!u)return d;for(var y=0;y<d.length;++y){var W=d[y],$=u[y];if(W&&$){e:for(var ee=0;ee<$.length;++ee){for(var te=$[ee],le=0;le<W.length;++le)if(W[le].marker==te.marker)continue e;W.push(te)}}else $&&(d[y]=$)}return d}function vo(e,t,d){for(var u=[],y=0;y<e.length;++y){var W=e[y];if(W.ranges){u.push(d?Gi.prototype.deepCopy.call(W):W);continue}var $=W.changes,ee=[];u.push({changes:ee});for(var te=0;te<$.length;++te){var le=$[te],Me=void 0;if(ee.push({from:le.from,to:le.to,text:le.text}),t)for(var He in le)(Me=He.match(/^spans_(\d+)$/))&&(ie(t,Number(Me[1]))>-1&&(lt(ee)[He]=le[He],delete le[He]))}}return u}function is(e,t,d,u){if(u){var y=e.anchor;if(d){var W=or(t,y)<0;W!=or(d,y)<0?(y=t,t=d):W!=or(t,d)<0&&(t=d)}return new Vr(y,t)}else return new Vr(d||t,t)}function Vo(e,t,d,u,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),Yi(e,new Gi([is(e.sel.primary(),t,d,y)],0),u)}function ws(e,t,d){for(var u=[],y=e.cm&&(e.cm.display.shift||e.extend),W=0;W<e.sel.ranges.length;W++)u[W]=is(e.sel.ranges[W],t[W],null,y);var $=Or(e.cm,u,e.sel.primIndex);Yi(e,$,d)}function as(e,t,d,u){var y=e.sel.ranges.slice(0);y[t]=d,Yi(e,Or(e.cm,y,e.sel.primIndex),u)}function Cs(e,t,d,u){Yi(e,$n(t,d),u)}function yl(e,t,d){var u={ranges:t.ranges,update:function(y){this.ranges=[];for(var W=0;W<y.length;W++)this.ranges[W]=new Vr(L(e,y[W].anchor),L(e,y[W].head))},origin:d&&d.origin};return tt(e,"beforeSelectionChange",e,u),e.cm&&tt(e.cm,"beforeSelectionChange",e.cm,u),u.ranges!=t.ranges?Or(e.cm,u.ranges,u.ranges.length-1):t}function Ts(e,t,d){var u=e.history.done,y=lt(u);y&&y.ranges?(u[u.length-1]=t,Yo(e,t,d)):Yi(e,t,d)}function Yi(e,t,d){Yo(e,t,d),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,d)}function Yo(e,t,d){(ye(e,"beforeSelectionChange")||e.cm&&ye(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,d));var u=d&&d.bias||(or(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,t,u,!0)),!(d&&d.scroll===!1)&&e.cm&&_a(e.cm)}function Ss(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,De(e.cm)),Lt(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,t,d,u){for(var y,W=0;W<t.ranges.length;W++){var $=t.ranges[W],ee=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[W],te=Xo(e,$.anchor,ee&&ee.anchor,d,u),le=Xo(e,$.head,ee&&ee.head,d,u);(y||te!=$.anchor||le!=$.head)&&(y||(y=t.ranges.slice(0,W)),y[W]=new Vr(te,le))}return y?Or(e.cm,y,t.primIndex):t}function _o(e,t,d,u,y){var W=wn(e,t.line);if(W.markedSpans)for(var $=0;$<W.markedSpans.length;++$){var ee=W.markedSpans[$],te=ee.marker,le="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,Me="selectRight"in te?!te.selectRight:te.inclusiveRight;if((ee.from==null||(le?ee.from<=t.ch:ee.from<t.ch))&&(ee.to==null||(Me?ee.to>=t.ch:ee.to>t.ch))){if(y&&(tt(te,"beforeCursorEnter"),te.explicitlyCleared))if(W.markedSpans){--$;continue}else break;if(!te.atomic)continue;if(d){var He=te.find(u<0?1:-1),xt=void 0;if((u<0?Me:le)&&(He=As(e,He,-u,He&&He.line==t.line?W:null)),He&&He.line==t.line&&(xt=or(He,d))&&(u<0?xt<0:xt>0))return _o(e,He,t,u,y)}var pt=te.find(u<0?-1:1);return(u<0?le:Me)&&(pt=As(e,pt,u,pt.line==t.line?W:null)),pt?_o(e,pt,t,u,y):null}}return t}function Xo(e,t,d,u,y){var W=u||1,$=_o(e,t,d,W,y)||!y&&_o(e,t,d,W,!0)||_o(e,t,d,-W,y)||!y&&_o(e,t,d,-W,!0);return $||(e.cantEdit=!0,pn(e.first,0))}function As(e,t,d,u){return d<0&&t.ch==0?t.line>e.first?L(e,pn(t.line-1)):null:d>0&&t.ch==(u||wn(e,t.line)).text.length?t.line<e.first+e.size-1?pn(t.line+1,0):null:new pn(t.line,t.ch+d)}function Ds(e){e.setSelection(pn(e.firstLine(),0),pn(e.lastLine()),xe)}function Ls(e,t,d){var u={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return u.canceled=!0}};return d&&(u.update=function(y,W,$,ee){y&&(u.from=L(e,y)),W&&(u.to=L(e,W)),$&&(u.text=$),ee!==void 0&&(u.origin=ee)}),tt(e,"beforeChange",e,u),e.cm&&tt(e.cm,"beforeChange",e.cm,u),u.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:u.from,to:u.to,text:u.text,origin:u.origin}}function yo(e,t,d){if(e.cm){if(!e.cm.curOp)return bi(e.cm,yo)(e,t,d);if(e.cm.state.suppressEdits)return}if((ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"))&&(t=Ls(e,t,!0),!t))return;var u=Vi&&!d&&ce(e,t.from,t.to);if(u)for(var y=u.length-1;y>=0;--y)Ps(e,{from:u[y].from,to:u[y].to,text:y?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&or(t.from,t.to)==0)return;var d=fi(e,t);bs(e,t,d,e.cm?e.cm.curOp.id:NaN),Lo(e,t,d,sr(e,t));var u=[];Ai(e,function(y,W){!W&&ie(u,y.history)==-1&&(Ns(y.history,t),u.push(y.history)),Lo(y,t,null,sr(y,t))})}function $o(e,t,d){var u=e.cm&&e.cm.state.suppressEdits;if(u&&!d)return;for(var y=e.history,W,$=e.sel,ee=t=="undo"?y.done:y.undone,te=t=="undo"?y.undone:y.done,le=0;le<ee.length&&!(W=ee[le],d?W.ranges&&!W.equals(e.sel):!W.ranges);le++);if(le==ee.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(W=ee.pop(),W.ranges){if(zo(W,te),d&&!W.equals(e.sel)){Yi(e,W,{clearRedo:!1});return}$=W}else if(u){ee.push(W);return}else break;var Me=[];zo($,te),te.push({changes:Me,generation:y.generation}),y.generation=W.generation||++y.maxGeneration;for(var He=ye(e,"beforeChange")||e.cm&&ye(e.cm,"beforeChange"),xt=function(Cn){var Wn=W.changes[Cn];if(Wn.origin=t,He&&!Ls(e,Wn,!1))return ee.length=0,{};Me.push(rs(e,Wn));var Yn=Cn?fi(e,Wn):lt(ee);Lo(e,Wn,Yn,xs(e,Wn)),!Cn&&e.cm&&e.cm.scrollIntoView({from:Wn.from,to:hr(Wn)});var Zn=[];Ai(e,function(Xn,ar){!ar&&ie(Zn,Xn.history)==-1&&(Ns(Xn.history,Wn),Zn.push(Xn.history)),Lo(Xn,Wn,null,xs(Xn,Wn))})},pt=W.changes.length-1;pt>=0;--pt){var an=xt(pt);if(an)return an.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gi(qt(e.sel.ranges,function(y){return new Vr(pn(y.anchor.line+t,y.anchor.ch),pn(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){qr(e.cm,e.first,e.first-t,t);for(var d=e.cm.display,u=d.viewFrom;u<d.viewTo;u++)ii(e.cm,u,"gutter")}}function Lo(e,t,d,u){if(e.cm&&!e.cm.curOp)return bi(e.cm,Lo)(e,t,d,u);if(t.to.line<e.first){Ms(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var y=t.text.length-1-(e.first-t.from.line);Ms(e,y),t={from:pn(e.first,0),to:pn(t.to.line+y,t.to.ch),text:[lt(t.text)],origin:t.origin}}var W=e.lastLine();t.to.line>W&&(t={from:t.from,to:pn(W,wn(e,W).text.length),text:[t.text[0]],origin:t.origin}),t.removed=br(e,t.from,t.to),d||(d=fi(e,t)),e.cm?bl(e.cm,t,u):Wa(e,t,u),Yo(e,d,xe),e.cantEdit&&Xo(e,pn(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,d){var u=e.doc,y=e.display,W=t.from,$=t.to,ee=!1,te=W.line;e.options.lineWrapping||(te=cr(at(wn(u,W.line))),u.iter(te,$.line+1,function(pt){if(pt==y.maxLine)return ee=!0,!0})),u.sel.contains(t.from,t.to)>-1&&De(e),Wa(u,t,d,Qi(e)),e.options.lineWrapping||(u.iter(te,W.line+t.text.length,function(pt){var an=Gn(pt);an>y.maxLineLength&&(y.maxLine=pt,y.maxLineLength=an,y.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),Li(u,W.line),Na(e,400);var le=t.text.length-($.line-W.line)-1;t.full?qr(e):W.line==$.line&&t.text.length==1&&!va(e.doc,t)?ii(e,W.line,"text"):qr(e,W.line,$.line+1,le);var Me=ye(e,"changes"),He=ye(e,"change");if(He||Me){var xt={from:W,to:$,text:t.text,removed:t.removed,origin:t.origin};He&&Lt(e,"change",e,xt),Me&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(xt)}e.display.selForContextMenu=null}function bo(e,t,d,u,y){var W;u||(u=d),or(u,d)<0&&(W=[u,d],d=W[0],u=W[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:d,to:u,text:t,origin:y})}function ks(e,t,d,u){d<e.line?e.line+=u:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,d,u){for(var y=0;y<e.length;++y){var W=e[y],$=!0;if(W.ranges){W.copied||(W=e[y]=W.deepCopy(),W.copied=!0);for(var ee=0;ee<W.ranges.length;ee++)ks(W.ranges[ee].anchor,t,d,u),ks(W.ranges[ee].head,t,d,u);continue}for(var te=0;te<W.changes.length;++te){var le=W.changes[te];if(d<le.from.line)le.from=pn(le.from.line+u,le.from.ch),le.to=pn(le.to.line+u,le.to.ch);else if(t<=le.to.line){$=!1;break}}$||(e.splice(0,y+1),y=0)}}function Ns(e,t){var d=t.from.line,u=t.to.line,y=t.text.length-(u-d)-1;Is(e.done,d,u,y),Is(e.undone,d,u,y)}function Po(e,t,d,u){var y=t,W=t;return typeof t=="number"?W=wn(e,X(e,t)):y=cr(t),y==null?null:(u(W,y)&&e.cm&&ii(e.cm,y,d),W)}function Mo(e){this.lines=e,this.parent=null;for(var t=0,d=0;d<e.length;++d)e[d].parent=this,t+=e[d].height;this.height=t}Mo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var d=e,u=e+t;d<u;++d){var y=this.lines[d];this.height-=y.height,Pt(y),Lt(y,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,d){this.height+=d,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var u=0;u<t.length;++u)t[u].parent=this},iterN:function(e,t,d){for(var u=e+t;e<u;++e)if(d(this.lines[e]))return!0}};function ko(e){this.children=e;for(var t=0,d=0,u=0;u<e.length;++u){var y=e[u];t+=y.chunkSize(),d+=y.height,y.parent=this}this.size=t,this.height=d,this.parent=null}ko.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var d=0;d<this.children.length;++d){var u=this.children[d],y=u.chunkSize();if(e<y){var W=Math.min(t,y-e),$=u.height;if(u.removeInner(e,W),this.height-=$-u.height,y==W&&(this.children.splice(d--,1),u.parent=null),(t-=W)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var ee=[];this.collapse(ee),this.children=[new Mo(ee)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,d){this.size+=t.length,this.height+=d;for(var u=0;u<this.children.length;++u){var y=this.children[u],W=y.chunkSize();if(e<=W){if(y.insertInner(e,t,d),y.lines&&y.lines.length>50){for(var $=y.lines.length%25+25,ee=$;ee<y.lines.length;){var te=new Mo(y.lines.slice(ee,ee+=25));y.height-=te.height,this.children.splice(++u,0,te),te.parent=this}y.lines=y.lines.slice(0,$),this.maybeSpill()}break}e-=W}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),d=new ko(t);if(e.parent){e.size-=d.size,e.height-=d.height;var y=ie(e.parent.children,e);e.parent.children.splice(y+1,0,d)}else{var u=new ko(e.children);u.parent=e,e.children=[u,d],e=u}d.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,d){for(var u=0;u<this.children.length;++u){var y=this.children[u],W=y.chunkSize();if(e<W){var $=Math.min(t,W-e);if(y.iterN(e,$,d))return!0;if((t-=$)==0)break;e=0}else e-=W}}};var Io=function(e,t,d){if(d)for(var u in d)d.hasOwnProperty(u)&&(this[u]=d[u]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,d=this.line,u=cr(d);if(u==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(d.widgets=null);var W=Jr(this);rr(d,Math.max(0,d.height-W)),e&&(Ki(e,function(){Us(e,d,-W),ii(e,u,"widget")}),Lt(e,"lineWidgetCleared",e,this,u))},Io.prototype.changed=function(){var e=this,t=this.height,d=this.doc.cm,u=this.line;this.height=null;var y=Jr(this)-t;if(!y)return;Xt(this.doc,u)||rr(u,u.height+y),d&&Ki(d,function(){d.curOp.forceUpdate=!0,Us(d,u,y),Lt(d,"lineWidgetChanged",d,e,cr(u))})},we(Io);function Us(e,t,d){Pn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,d)}function El(e,t,d,u){var y=new Io(e,d,u),W=e.cm;return W&&y.noHScroll&&(W.display.alignWidgets=!0),Po(e,t,"widget",function($){var ee=$.widgets||($.widgets=[]);if(y.insertAt==null?ee.push(y):ee.splice(Math.min(ee.length-1,Math.max(0,y.insertAt)),0,y),y.line=$,W&&!Xt(e,$)){var te=Pn($)<e.scrollTop;rr($,$.height+Jr(y)),te&&Va(W,y.height),W.curOp.forceUpdate=!0}return!0}),W&&Lt(W,"lineWidgetAdded",W,y,typeof t=="number"?t:cr(t)),y}var js=0,qa=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++js};qa.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ua(e),ye(this,"clear")){var d=this.find();d&&Lt(this,"clear",d.from,d.to)}for(var u=null,y=null,W=0;W<this.lines.length;++W){var $=this.lines[W],ee=Bn($.markedSpans,this);e&&!this.collapsed?ii(e,cr($),"text"):e&&(ee.to!=null&&(y=cr($)),ee.from!=null&&(u=cr($))),$.markedSpans=_n($.markedSpans,ee),ee.from==null&&this.collapsed&&!Xt(this.doc,$)&&e&&rr($,Wr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var le=at(this.lines[te]),Me=Gn(le);Me>e.display.maxLineLength&&(e.display.maxLine=le,e.display.maxLineLength=Me,e.display.maxLineChanged=!0)}u!=null&&e&&this.collapsed&&qr(e,u,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Lt(e,"markerCleared",e,this,u,y),t&&Ea(e),this.parent&&this.parent.clear()},qa.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var d,u,y=0;y<this.lines.length;++y){var W=this.lines[y],$=Bn(W.markedSpans,this);if($.from!=null&&(d=pn(t?W:cr(W),$.from),e==-1))return d;if($.to!=null&&(u=pn(t?W:cr(W),$.to),e==1))return u}return d&&{from:d,to:u}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),d=this,u=this.doc.cm;if(!t||!u)return;Ki(u,function(){var y=t.line,W=cr(t.line),$=Ze(u,W);if($&&(fr($),u.curOp.selectionChanged=u.curOp.forceUpdate=!0),u.curOp.updateMaxLine=!0,!Xt(d.doc,y)&&d.height!=null){var ee=d.height;d.height=null;var te=Jr(d)-ee;te&&rr(y,y.height+te)}Lt(u,"markerChanged",u,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ie(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},we(qa);function Eo(e,t,d,u,y){if(u&&u.shared)return xl(e,t,d,u,y);if(e.cm&&!e.cm.curOp)return bi(e.cm,Eo)(e,t,d,u,y);var W=new qa(e,y),$=or(t,d);if(u&&x(u,W,!1),$>0||$==0&&W.clearWhenEmpty!==!1)return W;if(W.replacedWith&&(W.collapsed=!0,W.widgetNode=_("span",[W.replacedWith],"CodeMirror-widget"),u.handleMouseEvents||W.widgetNode.setAttribute("cm-ignore-events","true"),u.insertLeft&&(W.widgetNode.insertLeft=!0)),W.collapsed){if(_t(e,t.line,t,d,W)||t.line!=d.line&&_t(e,d.line,t,d,W))throw new Error("Inserting collapsed marker partially overlapping an existing one");ri()}W.addToHistory&&bs(e,{from:t,to:d,origin:"markText"},e.sel,NaN);var ee=t.line,te=e.cm,le;if(e.iter(ee,d.line+1,function(He){te&&W.collapsed&&!te.options.lineWrapping&&at(He)==te.display.maxLine&&(le=!0),W.collapsed&&ee!=t.line&&rr(He,0),Tn(He,new Br(W,ee==t.line?t.ch:null,ee==d.line?d.ch:null)),++ee}),W.collapsed&&e.iter(t.line,d.line+1,function(He){Xt(e,He)&&rr(He,0)}),W.clearOnEnter&&Fe(W,"beforeCursorEnter",function(){return W.clear()}),W.readOnly&&(Sr(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),W.collapsed&&(W.id=++js,W.atomic=!0),te){if(le&&(te.curOp.updateMaxLine=!0),W.collapsed)qr(te,t.line,d.line+1);else if(W.className||W.startStyle||W.endStyle||W.css||W.attributes||W.title)for(var Me=t.line;Me<=d.line;Me++)ii(te,Me,"text");W.atomic&&Os(te.doc),Lt(te,"markerAdded",te,W)}return W}var No=function(e,t){this.markers=e,this.primary=t;for(var d=0;d<e.length;++d)e[d].parent=this};No.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Lt(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},we(No);function xl(e,t,d,u,y){u=x(u),u.shared=!1;var W=[Eo(e,t,d,u,y)],$=W[0],ee=u.widgetNode;return Ai(e,function(te){ee&&(u.widgetNode=ee.cloneNode(!0)),W.push(Eo(te,L(te,t),L(te,d),u,y));for(var le=0;le<te.linked.length;++le)if(te.linked[le].isParent)return;$=lt(W)}),new No(W,$)}function Fs(e){return e.findMarks(pn(e.first,0),e.clipPos(pn(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var d=0;d<t.length;d++){var u=t[d],y=u.find(),W=e.clipPos(y.from),$=e.clipPos(y.to);if(or(W,$)){var ee=Eo(e,W,$,u.primary,u.primary.type);u.markers.push(ee),ee.parent=u}}}function Cl(e){for(var t=function(u){var y=e[u],W=[y.primary.doc];Ai(y.primary.doc,function(te){return W.push(te)});for(var $=0;$<y.markers.length;$++){var ee=y.markers[$];ie(W,ee.doc)==-1&&(ee.parent=null,y.markers.splice($--,1))}},d=0;d<e.length;d++)t(d)}var Tl=0,ta=function(e,t,d,u,y){if(!(this instanceof ta))return new ta(e,t,d,u,y);d==null&&(d=0),ko.call(this,[new Mo([new Nn("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var W=pn(d,0);this.sel=$n(W),this.history=new Go(null),this.id=++Tl,this.modeOption=t,this.lineSep=u,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:W,to:W,text:e}),Yi(this,$n(W),xe)};ta.prototype=Ve(ko.prototype,{constructor:ta,iter:function(e,t,d){d?this.iterN(e-this.first,t-e,d):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var d=0,u=0;u<t.length;++u)d+=t[u].height;this.insertInner(e-this.first,t,d)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Er(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ei(function(e){var t=pn(this.first,0),d=this.first+this.size-1;yo(this,{from:t,to:pn(d,wn(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),Yi(this,$n(t),xe)}),replaceRange:function(e,t,d,u){t=L(this,t),d=d?L(this,d):t,bo(this,e,t,d,u)},getRange:function(e,t,d){var u=br(this,L(this,e),L(this,t));return d===!1?u:u.join(d||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Kr(this,e))return wn(this,e)},getLineNumber:function(e){return cr(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=wn(this,e)),at(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return L(this,e)},getCursor:function(e){var t=this.sel.primary(),d;return e==null||e=="head"?d=t.head:e=="anchor"?d=t.anchor:e=="end"||e=="to"||e===!1?d=t.to():d=t.from(),d},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ei(function(e,t,d){Cs(this,L(this,typeof e=="number"?pn(e,t||0):e),null,d)}),setSelection:Ei(function(e,t,d){Cs(this,L(this,e),L(this,t||e),d)}),extendSelection:Ei(function(e,t,d){Vo(this,L(this,e),t&&L(this,t),d)}),extendSelections:Ei(function(e,t){ws(this,z(this,e),t)}),extendSelectionsBy:Ei(function(e,t){var d=qt(this.sel.ranges,e);ws(this,z(this,d),t)}),setSelections:Ei(function(e,t,d){if(!e.length)return;for(var u=[],y=0;y<e.length;y++)u[y]=new Vr(L(this,e[y].anchor),L(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Yi(this,Or(this.cm,u,t),d)}),addSelection:Ei(function(e,t,d){var u=this.sel.ranges.slice(0);u.push(new Vr(L(this,e),L(this,t||e))),Yi(this,Or(this.cm,u,u.length-1),d)}),getSelection:function(e){for(var t=this.sel.ranges,d,u=0;u<t.length;u++){var y=br(this,t[u].from(),t[u].to());d=d?d.concat(y):y}return e===!1?d:d.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],d=this.sel.ranges,u=0;u<d.length;u++){var y=br(this,d[u].from(),d[u].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[u]=y}return t},replaceSelection:function(e,t,d){for(var u=[],y=0;y<this.sel.ranges.length;y++)u[y]=e;this.replaceSelections(u,t,d||"+input")},replaceSelections:Ei(function(e,t,d){for(var u=[],y=this.sel,W=0;W<y.ranges.length;W++){var $=y.ranges[W];u[W]={from:$.from(),to:$.to(),text:this.splitLines(e[W]),origin:d}}for(var ee=t&&t!="end"&&aa(this,u,t),te=u.length-1;te>=0;te--)yo(this,u[te]);ee?Ts(this,ee):this.cm&&_a(this.cm)}),undo:Ei(function(){$o(this,"undo")}),redo:Ei(function(){$o(this,"redo")}),undoSelection:Ei(function(){$o(this,"undo",!0)}),redoSelection:Ei(function(){$o(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,d=0,u=0;u<e.done.length;u++)e.done[u].ranges||++t;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++d;return{undo:t,redo:d}},clearHistory:function(){var e=this;this.history=new Go(this.history.maxGeneration),Ai(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:vo(this.history.done),undone:vo(this.history.undone)}},setHistory:function(e){var t=this.history=new Go(this.history.maxGeneration);t.done=vo(e.done.slice(0),null,!0),t.undone=vo(e.undone.slice(0),null,!0)},setGutterMarker:Ei(function(e,t,d){return Po(this,e,"gutter",function(u){var y=u.gutterMarkers||(u.gutterMarkers={});return y[t]=d,!d&&se(y)&&(u.gutterMarkers=null),!0})}),clearGutter:Ei(function(e){var t=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[e]&&Po(t,d,"gutter",function(){return d.gutterMarkers[e]=null,se(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Kr(this,e))return null;if(t=e,e=wn(this,e),!e)return null}else if(t=cr(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ei(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(u){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!u[y])u[y]=d;else{if(S(d).test(u[y]))return!1;u[y]+=" "+d}return!0})}),removeLineClass:Ei(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(u){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",W=u[y];if(W)if(d==null)u[y]=null;else{var $=W.match(S(d));if(!$)return!1;var ee=$.index+$[0].length;u[y]=W.slice(0,$.index)+(!$.index||ee==W.length?"":" ")+W.slice(ee)||null}else return!1;return!0})}),addLineWidget:Ei(function(e,t,d){return El(this,e,t,d)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,d){return Eo(this,L(this,e),L(this,t),d,d&&d.type||"range")},setBookmark:function(e,t){var d={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=L(this,e),Eo(this,e,e,d,"bookmark")},findMarksAt:function(e){e=L(this,e);var t=[],d=wn(this,e.line).markedSpans;if(d)for(var u=0;u<d.length;++u){var y=d[u];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&t.push(y.marker.parent||y.marker)}return t},findMarks:function(e,t,d){e=L(this,e),t=L(this,t);var u=[],y=e.line;return this.iter(e.line,t.line+1,function(W){var $=W.markedSpans;if($)for(var ee=0;ee<$.length;ee++){var te=$[ee];!(te.to!=null&&y==e.line&&e.ch>=te.to||te.from==null&&y!=e.line||te.from!=null&&y==t.line&&te.from>=t.ch)&&(!d||d(te.marker))&&u.push(te.marker.parent||te.marker)}++y}),u},getAllMarks:function(){var e=[];return this.iter(function(t){var d=t.markedSpans;if(d)for(var u=0;u<d.length;++u)d[u].from!=null&&e.push(d[u].marker)}),e},posFromIndex:function(e){var t,d=this.first,u=this.lineSeparator().length;return this.iter(function(y){var W=y.text.length+u;if(W>e)return t=e,!0;e-=W,++d}),L(this,pn(d,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var d=this.lineSeparator().length;return this.iter(this.first,e.line,function(u){t+=u.text.length+d}),t},copy:function(e){var t=new ta(Er(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,d=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<d&&(d=e.to);var u=new ta(Er(this,t,d),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(u.history=this.history),(this.linked||(this.linked=[])).push({doc:u,sharedHist:e.sharedHist}),u.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(u,Fs(this)),u},unlinkDoc:function(e){if(e instanceof xi&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var d=this.linked[t];if(d.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(Fs(this));break}if(e.history==this.history){var u=[e.id];Ai(e,function(y){return u.push(y.id)},!0),e.history=new Go(null),e.history.done=vo(this.history.done,u),e.history.undone=vo(this.history.undone,u)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Et(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ei(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),ta.prototype.eachLine=ta.prototype.iter;var Bs=0;function Sl(e){var t=this;if(Hs(t),ot(t,e)||vi(t.display,e))return;ae(e),K&&(Bs=+new Date);var d=Ri(t,e,!0),u=e.dataTransfer.files;if(!d||t.isReadOnly())return;if(u&&u.length&&window.FileReader&&window.File)for(var y=u.length,W=Array(y),$=0,ee=function(){++$==y&&bi(t,function(){d=L(t.doc,d);var pt={from:d,to:d,text:t.doc.splitLines(W.filter(function(an){return an!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,pt),Ts(t.doc,$n(L(t.doc,d),L(t.doc,hr(pt))))})()},te=function(pt,an){if(t.options.allowDropFileTypes&&ie(t.options.allowDropFileTypes,pt.type)==-1){ee();return}var Cn=new FileReader;Cn.onerror=function(){return ee()},Cn.onload=function(){var Wn=Cn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Wn)){ee();return}W[an]=Wn,ee()},Cn.readAsText(pt)},le=0;le<u.length;le++)te(u[le],le);else{if(t.state.draggingText&&t.doc.sel.contains(d)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Me=e.dataTransfer.getData("Text");if(Me){var He;if(t.state.draggingText&&!t.state.draggingText.copy&&(He=t.listSelections()),Yo(t.doc,$n(d,d)),He)for(var xt=0;xt<He.length;++xt)bo(t.doc,"",He[xt].anchor,He[xt].head,"drag");t.replaceSelection(Me,"around","paste"),t.display.input.focus()}}catch(pt){}}}function Ol(e,t){if(K&&(!e.state.draggingText||+new Date-Bs<100)){_e(t);return}if(ot(e,t)||vi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var d=p("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),t.dataTransfer.setDragImage(d,0,0),f&&d.parentNode.removeChild(d)}}function Rl(e,t){var d=Ri(e,t);if(!d)return;var u=document.createDocumentFragment();qi(e,d,u),e.display.dragCursor||(e.display.dragCursor=p("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,u)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),d=[],u=0;u<t.length;u++){var y=t[u].CodeMirror;y&&d.push(y)}d.length&&d[0].operation(function(){for(var W=0;W<d.length;W++)e(d[W])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;Fe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),Fe(window,"blur",function(){return Ws(Ca)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var eo={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Uo=0;Uo<10;Uo++)eo[Uo+48]=eo[Uo+96]=String(Uo);for(var Jo=65;Jo<=90;Jo++)eo[Jo]=String.fromCharCode(Jo);for(var jo=1;jo<=12;jo++)eo[jo+111]=eo[jo+63235]="F"+jo;var Ka={};Ka.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ka.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ka.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ka.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ka.default=i?Ka.macDefault:Ka.pcDefault;function Pl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var d,u,y,W,$=0;$<t.length-1;$++){var ee=t[$];if(/^(cmd|meta|m)$/i.test(ee))W=!0;else if(/^a(lt)?$/i.test(ee))d=!0;else if(/^(c|ctrl|control)$/i.test(ee))u=!0;else if(/^s(hift)?$/i.test(ee))y=!0;else throw new Error("Unrecognized modifier name: "+ee)}return d&&(e="Alt-"+e),u&&(e="Ctrl-"+e),W&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Ml(e){var t={};for(var d in e)if(e.hasOwnProperty(d)){var u=e[d];if(/^(name|fallthrough|(de|at)tach)$/.test(d))continue;if(u=="..."){delete e[d];continue}for(var y=qt(d.split(" "),Pl),W=0;W<y.length;W++){var $=void 0,ee=void 0;W==y.length-1?(ee=y.join(" "),$=u):(ee=y.slice(0,W+1).join(" "),$="...");var te=t[ee];if(!te)t[ee]=$;else if(te!=$)throw new Error("Inconsistent bindings for "+ee)}delete e[d]}for(var le in t)e[le]=t[le];return e}function xo(e,t,d,u){t=Qo(t);var y=t.call?t.call(e,u):t[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&d(y))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return xo(e,t.fallthrough,d,u);for(var W=0;W<t.fallthrough.length;W++){var $=xo(e,t.fallthrough[W],d,u);if($)return $}}}function Gs(e){var t=typeof e=="string"?e:eo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function zs(e,t,d){var u=e;return t.altKey&&u!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&u!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&u!="Mod"&&(e="Cmd-"+e),!d&&t.shiftKey&&u!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(f&&e.keyCode==34&&e.char)return!1;var d=eo[e.keyCode];return d==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(d=e.code),zs(d,e,t))}function Qo(e){return typeof e=="string"?Ka[e]:e}function wo(e,t){for(var d=e.doc.sel.ranges,u=[],y=0;y<d.length;y++){for(var W=t(d[y]);u.length&&or(W.from,lt(u).to)<=0;){var $=u.pop();if(or($.from,W.from)<0){W.from=$.from;break}}u.push(W)}Ki(e,function(){for(var ee=u.length-1;ee>=0;ee--)bo(e.doc,"",u[ee].from,u[ee].to,"+delete");_a(e)})}function os(e,t,d){var u=et(e.text,t+d,d);return u<0||u>e.text.length?null:u}function ss(e,t,d){var u=os(e,t.ch,d);return u==null?null:new pn(t.line,u,d<0?"after":"before")}function ls(e,t,d,u,y){if(e){t.doc.direction=="rtl"&&(y=-y);var W=Ln(d,t.doc.direction);if(W){var $=y<0?lt(W):W[0],ee=y<0==($.level==1),te=ee?"after":"before",le;if($.level>0||t.doc.direction=="rtl"){var Me=ke(t,d);le=y<0?d.text.length-1:0;var He=ut(t,Me,le).top;le=Wt(function(xt){return ut(t,Me,xt).top==He},y<0==($.level==1)?$.from:$.to-1,le),te=="before"&&(le=os(d,le,1))}else le=y<0?$.to:$.from;return new pn(u,le,te)}}return new pn(u,y<0?d.text.length:0,y<0?"before":"after")}function kl(e,t,d,u){var y=Ln(t,e.doc.direction);if(!y)return ss(t,d,u);d.ch>=t.text.length?(d.ch=t.text.length,d.sticky="before"):d.ch<=0&&(d.ch=0,d.sticky="after");var W=nt(y,d.ch,d.sticky),$=y[W];if(e.doc.direction=="ltr"&&$.level%2==0&&(u>0?$.to>d.ch:$.from<d.ch))return ss(t,d,u);var ee=function(Yn,Zn){return os(t,Yn instanceof pn?Yn.ch:Yn,Zn)},te,le=function(Yn){return e.options.lineWrapping?(te=te||ke(e,t),ir(e,t,te,Yn)):{begin:0,end:t.text.length}},Me=le(d.sticky=="before"?ee(d,-1):d.ch);if(e.doc.direction=="rtl"||$.level==1){var He=$.level==1==u<0,xt=ee(d,He?1:-1);if(xt!=null&&(He?xt<=$.to&&xt<=Me.end:xt>=$.from&&xt>=Me.begin)){var pt=He?"before":"after";return new pn(d.line,xt,pt)}}var an=function(Yn,Zn,Xn){for(var ar=function(pi,Hi){return Hi?new pn(d.line,ee(pi,1),"before"):new pn(d.line,pi,"after")};Yn>=0&&Yn<y.length;Yn+=Zn){var Tr=y[Yn],_r=Zn>0==(Tr.level!=1),Fr=_r?Xn.begin:ee(Xn.end,-1);if(Tr.from<=Fr&&Fr<Tr.to)return ar(Fr,_r);if(Fr=_r?Tr.from:ee(Tr.to,-1),Xn.begin<=Fr&&Fr<Xn.end)return ar(Fr,_r)}},Cn=an(W+u,u,Me);if(Cn)return Cn;var Wn=u>0?Me.end:ee(Me.begin,-1);return Wn!=null&&!(u>0&&Wn==t.text.length)&&(Cn=an(u>0?0:y.length-1,u,le(Wn)),Cn)?Cn:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return wo(e,function(t){if(t.empty()){var d=wn(e.doc,t.head.line).text.length;return t.head.ch==d&&t.head.line<e.lastLine()?{from:t.head,to:pn(t.head.line+1,0)}:{from:t.head,to:pn(t.head.line,d)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return wo(e,function(t){return{from:pn(t.from().line,0),to:L(e.doc,pn(t.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(t){return{from:pn(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,u=e.coordsChar({left:0,top:d},"div");return{from:u,to:t.from()}})},delWrappedLineRight:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,u=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div");return{from:t.from(),to:u}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(pn(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(pn(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Il(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div")},Je)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:d},"div")},Je)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5,u=e.coordsChar({left:0,top:d},"div");return u.ch<e.getLine(u.line).search(/\S/)?Xs(e,t.head):u},Je)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],d=e.listSelections(),u=e.options.tabSize,y=0;y<d.length;y++){var W=d[y].from(),$=Y(e.getLine(W.line),W.ch,u);t.push(fe(u-$%u))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ki(e,function(){for(var t=e.listSelections(),d=[],u=0;u<t.length;u++){if(!t[u].empty())continue;var y=t[u].head,W=wn(e.doc,y.line).text;if(W){if(y.ch==W.length&&(y=new pn(y.line,y.ch-1)),y.ch>0)y=new pn(y.line,y.ch+1),e.replaceRange(W.charAt(y.ch-1)+W.charAt(y.ch-2),pn(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var $=wn(e.doc,y.line-1).text;$&&(y=new pn(y.line,1),e.replaceRange(W.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),pn(y.line-1,$.length-1),y,"+transpose"))}}d.push(new Vr(y,y))}e.setSelections(d)})},newlineAndIndent:function(e){return Ki(e,function(){for(var t=e.listSelections(),d=t.length-1;d>=0;d--)e.replaceRange(e.doc.lineSeparator(),t[d].anchor,t[d].head,"+input");t=e.listSelections();for(var u=0;u<t.length;u++)e.indentLine(t[u].from().line,null,!0);_a(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var d=wn(e.doc,t),u=at(d);return u!=d&&(t=cr(u)),ls(!0,e,u,t,1)}function Il(e,t){var d=wn(e.doc,t),u=dt(d);return u!=d&&(t=cr(u)),ls(!0,e,d,t,-1)}function Xs(e,t){var d=Ys(e,t.line),u=wn(e.doc,d.line),y=Ln(u,e.doc.direction);if(!y||y[0].level==0){var W=Math.max(d.ch,u.text.search(/\S/)),$=t.line==d.line&&t.ch<=W&&t.ch;return pn(d.line,$?0:W,d.sticky)}return d}function Zo(e,t,d){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var u=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),y=t(e)!=$e}finally{e.display.shift=u,e.state.suppressEdits=!1}return y}function Nl(e,t,d){for(var u=0;u<e.state.keyMaps.length;u++){var y=xo(t,e.state.keyMaps[u],d,e);if(y)return y}return e.options.extraKeys&&xo(t,e.options.extraKeys,d,e)||xo(t,e.options.keyMap,d,e)}var Ul=new q;function Bo(e,t,d,u){var y=e.state.keySeq;if(y){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),$s(e,y+" "+t,d,u))return!0}return $s(e,t,d,u)}function $s(e,t,d,u){var y=Nl(e,t,u);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&Lt(e,"keyHandled",e,t,d),(y=="handled"||y=="multi")&&(ae(d),Ti(e)),!!y}function Js(e,t){var d=Vs(t,!0);return d?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+d,t,function(u){return Zo(e,u,!0)})||Bo(e,d,t,function(u){if(typeof u=="string"?/^go[A-Z]/.test(u):u.motion)return Zo(e,u)}):Bo(e,d,t,function(u){return Zo(e,u)}):!1}function jl(e,t,d){return Bo(e,"'"+d+"'",t,function(u){return Zo(e,u,!0)})}var us=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),ot(t,e))return;K&&k<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;t.display.shift=d==16||e.shiftKey;var u=Js(t,e);f&&(us=u?d:null,!u&&d==88&&!st&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),U&&!i&&!u&&d==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),d==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;B(t,"CodeMirror-crosshair");function d(u){(u.keyCode==18||!u.altKey)&&(v(t,"CodeMirror-crosshair"),At(document,"keyup",d),At(document,"mouseover",d))}Fe(document,"keyup",d),Fe(document,"mouseover",d)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ot(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(vi(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var d=e.keyCode,u=e.charCode;if(f&&d==us){us=null,ae(e);return}if(f&&(!e.which||e.which<10)&&Js(t,e))return;var y=String.fromCharCode(u==null?d:u);if(y=="\b")return;if(jl(t,e,y))return;t.display.input.onKeyPress(e)}var Bl=400,cs=function(e,t,d){this.time=e,this.pos=t,this.button=d};cs.prototype.compare=function(e,t,d){return this.time+Bl>e&&or(t,this.pos)==0&&d==this.button};var Ho,Wo;function Hl(e,t){var d=+new Date;return Wo&&Wo.compare(d,e,t)?(Ho=Wo=null,"triple"):Ho&&Ho.compare(d,e,t)?(Wo=new cs(d,e,t),Ho=null,"double"):(Ho=new cs(d,e,t),Wo=null,"single")}function el(e){var t=this,d=t.display;if(ot(t,e)||d.activeTouch&&d.input.supportsTouch())return;if(d.input.ensurePolled(),d.shift=e.shiftKey,vi(d,e)){r||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100));return}if(ds(t,e))return;var u=Ri(t,e),y=Ke(e),W=u?Hl(u,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),u&&Wl(t,y,u,W,e))return;y==1?u?Gl(t,u,W,e):be(e)==d.scroller&&ae(e):y==2?(u&&Vo(t.doc,u),setTimeout(function(){return d.input.focus()},20)):y==3&&(R?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,d,u,y){var W="Click";return u=="double"?W="Double"+W:u=="triple"&&(W="Triple"+W),W=(t==1?"Left":t==2?"Middle":"Right")+W,Bo(e,zs(W,y),y,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=$(e,d)!=$e}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,d){var u=e.getOption("configureMouse"),y=u?u(e,t,d):{};if(y.unit==null){var W=n?d.shiftKey&&d.metaKey:d.altKey;y.unit=W?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||d.shiftKey),y.addNew==null&&(y.addNew=i?d.metaKey:d.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(i?d.altKey:d.ctrlKey)),y}function Gl(e,t,d,u){K?setTimeout(F(Ma,e),0):e.curOp.focus=j();var y=Kl(e,d,u),W=e.doc.sel,$;e.options.dragDrop&&St&&!e.isReadOnly()&&d=="single"&&($=W.contains(t))>-1&&(or(($=W.ranges[$]).from(),t)<0||t.xRel>0)&&(or($.to(),t)>0||t.xRel<0)?zl(e,u,t,y):Vl(e,u,t,y)}function zl(e,t,d,u){var y=e.display,W=!1,$=bi(e,function(le){r&&(y.scroller.draggable=!1),e.state.draggingText=!1,At(y.wrapper.ownerDocument,"mouseup",$),At(y.wrapper.ownerDocument,"mousemove",ee),At(y.scroller,"dragstart",te),At(y.scroller,"drop",$),W||(ae(le),u.addNew||Vo(e.doc,d,null,null,u.extend),r&&!m||K&&k==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),ee=function(le){W=W||Math.abs(t.clientX-le.clientX)+Math.abs(t.clientY-le.clientY)>=10},te=function(){return W=!0};r&&(y.scroller.draggable=!0),e.state.draggingText=$,$.copy=!u.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Fe(y.wrapper.ownerDocument,"mouseup",$),Fe(y.wrapper.ownerDocument,"mousemove",ee),Fe(y.scroller,"dragstart",te),Fe(y.scroller,"drop",$),no(e),setTimeout(function(){return y.input.focus()},20)}function tl(e,t,d){if(d=="char")return new Vr(t,t);if(d=="word")return e.findWordAt(t);if(d=="line")return new Vr(pn(t.line,0),L(e.doc,pn(t.line+1,0)));var u=d(e,t);return new Vr(u.from,u.to)}function Vl(e,t,d,u){var y=e.display,W=e.doc;ae(t);var $,ee,te=W.sel,le=te.ranges;if(u.addNew&&!u.extend?(ee=W.sel.contains(d),ee>-1?$=le[ee]:$=new Vr(d,d)):($=W.sel.primary(),ee=W.sel.primIndex),u.unit=="rectangle")u.addNew||($=new Vr(d,d)),d=Ri(e,t,!0,!0),ee=-1;else{var Me=tl(e,d,u.unit);u.extend?$=is($,Me.anchor,Me.head,u.extend):$=Me}u.addNew?ee==-1?(ee=le.length,Yi(W,Or(e,le.concat([$]),ee),{scroll:!1,origin:"*mouse"})):le.length>1&&le[ee].empty()&&u.unit=="char"&&!u.extend?(Yi(W,Or(e,le.slice(0,ee).concat(le.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),te=W.sel):as(W,ee,$,Ie):(ee=0,Yi(W,new Gi([$],0),Ie),te=W.sel);var He=d;function xt(Xn){if(or(He,Xn)==0)return;if(He=Xn,u.unit=="rectangle"){for(var ar=[],Tr=e.options.tabSize,_r=Y(wn(W,d.line).text,d.ch,Tr),Fr=Y(wn(W,Xn.line).text,Xn.ch,Tr),pi=Math.min(_r,Fr),Hi=Math.max(_r,Fr),Ci=Math.min(d.line,Xn.line),oa=Math.min(e.lastLine(),Math.max(d.line,Xn.line));Ci<=oa;Ci++){var na=wn(W,Ci).text,ki=Ye(na,pi,Tr);pi==Hi?ar.push(new Vr(pn(Ci,ki),pn(Ci,ki))):na.length>ki&&ar.push(new Vr(pn(Ci,ki),pn(Ci,Ye(na,Hi,Tr))))}ar.length||ar.push(new Vr(d,d)),Yi(W,Or(e,te.ranges.slice(0,ee).concat(ar),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Xn)}else{var ra=$,zi=tl(e,Xn,u.unit),Ui=ra.anchor,Ii;or(zi.anchor,Ui)>0?(Ii=zi.head,Ui=ni(ra.from(),zi.anchor)):(Ii=zi.anchor,Ui=ti(ra.to(),zi.head));var Oi=te.ranges.slice(0);Oi[ee]=Yl(e,new Vr(L(W,Ui),Ii)),Yi(W,Or(e,Oi,ee),Ie)}}var pt=y.wrapper.getBoundingClientRect(),an=0;function Cn(Xn){var ar=++an,Tr=Ri(e,Xn,!0,u.unit=="rectangle");if(!Tr)return;if(or(Tr,He)!=0){e.curOp.focus=j(),xt(Tr);var _r=ka(y,W);(Tr.line>=_r.to||Tr.line<_r.from)&&setTimeout(bi(e,function(){an==ar&&Cn(Xn)}),150)}else{var Fr=Xn.clientY<pt.top?-20:Xn.clientY>pt.bottom?20:0;Fr&&setTimeout(bi(e,function(){if(an!=ar)return;y.scroller.scrollTop+=Fr,Cn(Xn)}),50)}}function Wn(Xn){e.state.selectingText=!1,an=Infinity,Xn&&(ae(Xn),y.input.focus()),At(y.wrapper.ownerDocument,"mousemove",Yn),At(y.wrapper.ownerDocument,"mouseup",Zn),W.history.lastSelOrigin=null}var Yn=bi(e,function(Xn){Xn.buttons===0||!Ke(Xn)?Wn(Xn):Cn(Xn)}),Zn=bi(e,Wn);e.state.selectingText=Zn,Fe(y.wrapper.ownerDocument,"mousemove",Yn),Fe(y.wrapper.ownerDocument,"mouseup",Zn)}function Yl(e,t){var d=t.anchor,u=t.head,y=wn(e.doc,d.line);if(or(d,u)==0&&d.sticky==u.sticky)return t;var W=Ln(y);if(!W)return t;var $=nt(W,d.ch,d.sticky),ee=W[$];if(ee.from!=d.ch&&ee.to!=d.ch)return t;var te=$+(ee.from==d.ch==(ee.level!=1)?0:1);if(te==0||te==W.length)return t;var le;if(u.line!=d.line)le=(u.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Me=nt(W,u.ch,u.sticky),He=Me-$||(u.ch-d.ch)*(ee.level==1?-1:1);Me==te-1||Me==te?le=He<0:le=He>0}var xt=W[te+(le?-1:0)],pt=le==(xt.level==1),an=pt?xt.from:xt.to,Cn=pt?"after":"before";return d.ch==an&&d.sticky==Cn?t:new Vr(new pn(d.line,an,Cn),u)}function nl(e,t,d,u){var y,W;if(t.touches)y=t.touches[0].clientX,W=t.touches[0].clientY;else try{y=t.clientX,W=t.clientY}catch(xt){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;u&&ae(t);var $=e.display,ee=$.lineDiv.getBoundingClientRect();if(W>ee.bottom||!ye(e,d))return pe(t);W-=ee.top-$.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var le=$.gutters.childNodes[te];if(le&&le.getBoundingClientRect().right>=y){var Me=Pr(e.doc,W),He=e.display.gutterSpecs[te];return tt(e,d,e,Me,He.className,t),pe(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(vi(e.display,t)||Xl(e,t))return;if(ot(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return ye(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wr(e)}var Co={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function d(u,y,W,$){e.defaults[u]=y,W&&(t[u]=$?function(ee,te,le){le!=Co&&W(ee,te,le)}:W)}e.defineOption=d,e.Init=Co,d("value","",function(u,y){return u.setValue(y)},!0),d("mode",null,function(u,y){u.doc.modeOption=y,Mi(u)},!0),d("indentUnit",2,Mi,!0),d("indentWithTabs",!1),d("smartIndent",!0),d("tabSize",4,function(u){$i(u),wr(u),qr(u)},!0),d("lineSeparator",null,function(u,y){if(u.doc.lineSep=y,!y)return;var W=[],$=u.doc.first;u.doc.iter(function(te){for(var le=0;;){var Me=te.text.indexOf(y,le);if(Me==-1)break;le=Me+y.length,W.push(pn($,Me))}$++});for(var ee=W.length-1;ee>=0;ee--)bo(u.doc,y,W[ee],pn(W[ee].line,W[ee].ch+y.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(u,y,W){u.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),W!=Co&&u.refresh()}),d("specialCharPlaceholder",On,function(u){return u.refresh()},!0),d("electricChars",!0),d("inputStyle",s?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),d("spellcheck",!1,function(u,y){return u.getInputField().spellcheck=y},!0),d("autocorrect",!1,function(u,y){return u.getInputField().autocorrect=y},!0),d("autocapitalize",!1,function(u,y){return u.getInputField().autocapitalize=y},!0),d("rtlMoveVisually",!O),d("wholeLineUpdateBefore",!0),d("theme","default",function(u){il(u),ca(u)},!0),d("keyMap","default",function(u,y,W){var $=Qo(y),ee=W!=Co&&Qo(W);ee&&ee.detach&&ee.detach(u,$),$.attach&&$.attach(u,ee||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,Ql,!0),d("gutters",[],function(u,y){u.display.gutterSpecs=Bi(y,u.options.lineNumbers),ca(u)},!0),d("fixedGutter",!0,function(u,y){u.display.gutters.style.left=y?yi(u.display)+"px":"0",u.refresh()},!0),d("coverGutterNextToScrollbar",!1,function(u){return ma(u)},!0),d("scrollbarStyle","native",function(u){Ja(u),ma(u),u.display.scrollbars.setScrollTop(u.doc.scrollTop),u.display.scrollbars.setScrollLeft(u.doc.scrollLeft)},!0),d("lineNumbers",!1,function(u,y){u.display.gutterSpecs=Bi(u.options.gutters,y),ca(u)},!0),d("firstLineNumber",1,ca,!0),d("lineNumberFormatter",function(u){return u},ca,!0),d("showCursorWhenSelecting",!1,ei,!0),d("resetSelectionOnContextMenu",!0),d("lineWiseCopyCut",!0),d("pasteLinesPerSelection",!0),d("selectionsMayTouch",!1),d("readOnly",!1,function(u,y){y=="nocursor"&&(Ca(u),u.display.input.blur()),u.display.input.readOnlyChanged(y)}),d("screenReaderLabel",null,function(u,y){y=y===""?null:y,u.display.input.screenReaderLabelChanged(y)}),d("disableInput",!1,function(u,y){y||u.display.input.reset()},!0),d("dragDrop",!0,Jl),d("allowDropFileTypes",null),d("cursorBlinkRate",530),d("cursorScrollMargin",0),d("cursorHeight",1,ei,!0),d("singleCursorHeightPerLine",!0,ei,!0),d("workTime",100),d("workDelay",100),d("flattenSpans",!0,$i,!0),d("addModeClass",!1,$i,!0),d("pollInterval",100),d("undoDepth",200,function(u,y){return u.doc.history.undoDepth=y}),d("historyEventDelay",1250),d("viewportMargin",10,function(u){return u.refresh()},!0),d("maxHighlightLength",1e4,$i,!0),d("moveInputWithCursor",!0,function(u,y){y||u.display.input.resetPosition()}),d("tabindex",null,function(u,y){return u.display.input.getField().tabIndex=y||""}),d("autofocus",null),d("direction","ltr",function(u,y){return u.doc.setDirection(y)},!0),d("phrases",null)}function Jl(e,t,d){var u=d&&d!=Co;if(!t!=!u){var y=e.display.dragFunctions,W=t?Fe:At;W(e.display.scroller,"dragstart",y.start),W(e.display.scroller,"dragenter",y.enter),W(e.display.scroller,"dragover",y.over),W(e.display.scroller,"dragleave",y.leave),W(e.display.scroller,"drop",y.drop)}}function Ql(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),Sn(e)),ji(e),qr(e),wr(e),setTimeout(function(){return ma(e)},100)}function xi(e,t){var d=this;if(!(this instanceof xi))return new xi(e,t);this.options=t=t?x(t):{},x(al,t,!1);var u=t.value;typeof u=="string"?u=new ta(u,t.mode,null,t.lineSeparator,t.direction):t.mode&&(u.modeOption=t.mode),this.doc=u;var y=new xi.inputStyles[t.inputStyle](this),W=this.display=new ja(e,u,y,t);W.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ja(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 q,keySeq:null,specialChars:null},t.autofocus&&!s&&W.input.focus(),K&&k<11&&setTimeout(function(){return d.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,u),t.autofocus&&!s||this.hasFocus()?setTimeout(function(){d.hasFocus()&&!d.state.focused&&la(d)},20):Ca(this);for(var $ in qo)qo.hasOwnProperty($)&&qo[$](this,t[$],Co);gi(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee<hs.length;++ee)hs[ee](this);Ea(this),r&&t.lineWrapping&&getComputedStyle(W.lineDiv).textRendering=="optimizelegibility"&&(W.lineDiv.style.textRendering="auto")}xi.defaults=al,xi.optionHandlers=qo;function Zl(e){var t=e.display;Fe(t.scroller,"mousedown",bi(e,el)),K&&k<11?Fe(t.scroller,"dblclick",bi(e,function(te){if(ot(e,te))return;var le=Ri(e,te);if(!le||ds(e,te)||vi(e.display,te))return;ae(te);var Me=e.findWordAt(le);Vo(e.doc,Me.anchor,Me.head)})):Fe(t.scroller,"dblclick",function(te){return ot(e,te)||ae(te)}),Fe(t.scroller,"contextmenu",function(te){return rl(e,te)}),Fe(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||rl(e,te)});var d,u={end:0};function y(){t.activeTouch&&(d=setTimeout(function(){return t.activeTouch=null},1e3),u=t.activeTouch,u.end=+new Date)}function W(te){if(te.touches.length!=1)return!1;var le=te.touches[0];return le.radiusX<=1&&le.radiusY<=1}function $(te,le){if(le.left==null)return!0;var Me=le.left-te.left,He=le.top-te.top;return Me*Me+He*He>20*20}Fe(t.scroller,"touchstart",function(te){if(!ot(e,te)&&!W(te)&&!ds(e,te)){t.input.ensurePolled(),clearTimeout(d);var le=+new Date;t.activeTouch={start:le,moved:!1,prev:le-u.end<=300?u:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Fe(t.scroller,"touchend",function(te){var le=t.activeTouch;if(le&&!vi(t,te)&&le.left!=null&&!le.moved&&new Date-le.start<300){var Me=e.coordsChar(t.activeTouch,"page"),He;!le.prev||$(le,le.prev)?He=new Vr(Me,Me):!le.prev.prev||$(le,le.prev.prev)?He=e.findWordAt(Me):He=new Vr(pn(Me.line,0),L(e.doc,pn(Me.line+1,0))),e.setSelection(He.anchor,He.head),e.focus(),ae(te)}y()}),Fe(t.scroller,"touchcancel",y),Fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),Ni(e,t.scroller.scrollLeft,!0),tt(e,"scroll",e))}),Fe(t.scroller,"mousewheel",function(te){return Ha(e,te)}),Fe(t.scroller,"DOMMouseScroll",function(te){return Ha(e,te)}),Fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){ot(e,te)||_e(te)},over:function(te){ot(e,te)||(Rl(e,te),_e(te))},start:function(te){return Ol(e,te)},drop:bi(e,Sl),leave:function(te){ot(e,te)||Hs(e)}};var ee=t.input.getField();Fe(ee,"keyup",function(te){return Zs.call(e,te)}),Fe(ee,"keydown",bi(e,Qs)),Fe(ee,"keypress",bi(e,qs)),Fe(ee,"focus",function(te){return la(e,te)}),Fe(ee,"blur",function(te){return Ca(e,te)})}var hs=[];xi.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,d,u){var y=e.doc,W;d==null&&(d="add"),d=="smart"&&(y.mode.indent?W=In(e,t).state:d="prev");var $=e.options.tabSize,ee=wn(y,t),te=Y(ee.text,null,$);ee.stateAfter&&(ee.stateAfter=null);var le=ee.text.match(/^\s*/)[0],Me;if(!u&&!/\S/.test(ee.text))Me=0,d="not";else if(d=="smart"&&(Me=y.mode.indent(W,ee.text.slice(le.length),ee.text),Me==$e||Me>150)){if(!u)return;d="prev"}d=="prev"?t>y.first?Me=Y(wn(y,t-1).text,null,$):Me=0:d=="add"?Me=te+e.options.indentUnit:d=="subtract"?Me=te-e.options.indentUnit:typeof d=="number"&&(Me=te+d),Me=Math.max(0,Me);var He="",xt=0;if(e.options.indentWithTabs)for(var pt=Math.floor(Me/$);pt;--pt)xt+=$,He+=" ";if(xt<Me&&(He+=fe(Me-xt)),He!=le)return bo(y,He,pn(t,0),pn(t,le.length),"+input"),ee.stateAfter=null,!0;for(var an=0;an<y.sel.ranges.length;an++){var Cn=y.sel.ranges[an];if(Cn.head.line==t&&Cn.head.ch<le.length){var Wn=pn(t,le.length);as(y,an,new Vr(Wn,Wn));break}}}var wa=null;function es(e){wa=e}function fs(e,t,d,u,y){var W=e.doc;e.display.shift=!1,u||(u=W.sel);var $=+new Date-200,ee=y=="paste"||e.state.pasteIncoming>$,te=Et(t),le=null;if(ee&&u.ranges.length>1)if(wa&&wa.text.join(`
`)==t){if(u.ranges.length%wa.text.length==0){le=[];for(var Me=0;Me<wa.text.length;Me++)le.push(W.splitLines(wa.text[Me]))}}else te.length==u.ranges.length&&e.options.pasteLinesPerSelection&&(le=qt(te,function(Yn){return[Yn]}));for(var He=e.curOp.updateInput,xt=u.ranges.length-1;xt>=0;xt--){var pt=u.ranges[xt],an=pt.from(),Cn=pt.to();pt.empty()&&(d&&d>0?an=pn(an.line,an.ch-d):e.state.overwrite&&!ee?Cn=pn(Cn.line,Math.min(wn(W,Cn.line).text.length,Cn.ch+lt(te).length)):ee&&wa&&wa.lineWise&&wa.text.join(`
`)==te.join(`
`)&&(an=Cn=pn(an.line,0)));var Wn={from:an,to:Cn,text:le?le[xt%le.length]:te,origin:y||(ee?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,Wn),Lt(e,"inputRead",e,Wn)}t&&!ee&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=He),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var d=e.clipboardData&&e.clipboardData.getData("Text");if(d)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ki(t,function(){return fs(t,d,0,null,"paste")}),!0}function sl(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var d=e.doc.sel,u=d.ranges.length-1;u>=0;u--){var y=d.ranges[u];if(y.head.ch>100||u&&d.ranges[u-1].head.line==y.head.line)continue;var W=e.getModeAt(y.head),$=!1;if(W.electricChars){for(var ee=0;ee<W.electricChars.length;ee++)if(t.indexOf(W.electricChars.charAt(ee))>-1){$=Ko(e,y.head.line,"smart");break}}else W.electricInput&&(W.electricInput.test(wn(e.doc,y.head.line).text.slice(0,y.head.ch))&&($=Ko(e,y.head.line,"smart")));$&&Lt(e,"electricInput",e,y.head.line)}}function ll(e){for(var t=[],d=[],u=0;u<e.doc.sel.ranges.length;u++){var y=e.doc.sel.ranges[u].head.line,W={anchor:pn(y,0),head:pn(y+1,0)};d.push(W),t.push(e.getRange(W.anchor,W.head))}return{text:t,ranges:d}}function ul(e,t,d,u){e.setAttribute("autocorrect",d?"":"off"),e.setAttribute("autocapitalize",u?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=p("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=p("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),a&&(e.style.border="1px solid black"),ul(e),t}function ql(e){var t=e.optionHandlers,d=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(u,y){var W=this.options,$=W[u];if(W[u]==y&&u!="mode")return;W[u]=y,t.hasOwnProperty(u)&&bi(this,t[u])(this,y,$),tt(this,"optionChange",this,u)},getOption:function(u){return this.options[u]},getDoc:function(){return this.doc},addKeyMap:function(u,y){this.state.keyMaps[y?"push":"unshift"](Qo(u))},removeKeyMap:function(u){for(var y=this.state.keyMaps,W=0;W<y.length;++W)if(y[W]==u||y[W].name==u)return y.splice(W,1),!0},addOverlay:Pi(function(u,y){var W=u.token?u:e.getMode(this.options,u);if(W.startState)throw new Error("Overlays may not be stateful.");Ft(this.state.overlays,{mode:W,modeSpec:u,opaque:y&&y.opaque,priority:y&&y.priority||0},function($){return $.priority}),this.state.modeGen++,qr(this)}),removeOverlay:Pi(function(u){for(var y=this.state.overlays,W=0;W<y.length;++W){var $=y[W].modeSpec;if($==u||typeof u=="string"&&$.name==u){y.splice(W,1),this.state.modeGen++,qr(this);return}}}),indentLine:Pi(function(u,y,W){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),Kr(this.doc,u)&&Ko(this,u,y,W)}),indentSelection:Pi(function(u){for(var y=this.doc.sel.ranges,W=-1,$=0;$<y.length;$++){var ee=y[$];if(ee.empty())ee.head.line>W&&(Ko(this,ee.head.line,u,!0),W=ee.head.line,$==this.doc.sel.primIndex&&_a(this));else{var te=ee.from(),le=ee.to(),Me=Math.max(W,te.line);W=Math.min(this.lastLine(),le.line-(le.ch?0:1))+1;for(var He=Me;He<W;++He)Ko(this,He,u);var xt=this.doc.sel.ranges;te.ch==0&&y.length==xt.length&&xt[$].from().ch>0&&as(this.doc,$,new Vr(te,xt[$].to()),xe)}}}),getTokenAt:function(u,y){return kr(this,u,y)},getLineTokens:function(u,y){return kr(this,pn(u),y,!0)},getTokenTypeAt:function(u){u=L(this.doc,u);var y=$t(this,wn(this.doc,u.line)),W=0,$=(y.length-1)/2,ee=u.ch,te;if(ee==0)te=y[2];else for(;;){var le=W+$>>1;if((le?y[le*2-1]:0)>=ee)$=le;else if(y[le*2+1]<ee)W=le+1;else{te=y[le*2+2];break}}var Me=te?te.indexOf("overlay "):-1;return Me<0?te:Me==0?null:te.slice(0,Me-1)},getModeAt:function(u){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(u).state).mode:y},getHelper:function(u,y){return this.getHelpers(u,y)[0]},getHelpers:function(u,y){var W=[];if(!d.hasOwnProperty(y))return W;var $=d[y],ee=this.getModeAt(u);if(typeof ee[y]=="string")$[ee[y]]&&W.push($[ee[y]]);else if(ee[y])for(var te=0;te<ee[y].length;te++){var le=$[ee[y][te]];le&&W.push(le)}else ee.helperType&&$[ee.helperType]?W.push($[ee.helperType]):$[ee.name]&&W.push($[ee.name]);for(var Me=0;Me<$._global.length;Me++){var He=$._global[Me];He.pred(ee,this)&&ie(W,He.val)==-1&&W.push(He.val)}return W},getStateAfter:function(u,y){var W=this.doc;return u=X(W,u==null?W.first+W.size-1:u),In(this,u+1,y).state},cursorCoords:function(u,y){var W,$=this.doc.sel.primary();return u==null?W=$.head:typeof u=="object"?W=L(this.doc,u):W=u?$.from():$.to(),En(this,W,y||"page")},charCoords:function(u,y){return en(this,L(this.doc,u),y||"page")},coordsChar:function(u,y){return u=gn(this,u,y||"page"),pr(this,u.left,u.top)},lineAtHeight:function(u,y){return u=gn(this,{top:u,left:0},y||"page").top,Pr(this.doc,u+this.display.viewOffset)},heightAtLine:function(u,y,W){var $=!1,ee;if(typeof u=="number"){var te=this.doc.first+this.doc.size-1;u<this.doc.first?u=this.doc.first:u>te&&(u=te,$=!0),ee=wn(this.doc,u)}else ee=u;return Lr(this,ee,{top:0,left:0},y||"page",W||$).top+($?this.doc.height-Pn(ee):0)},defaultTextHeight:function(){return Wr(this.display)},defaultCharWidth:function(){return Hr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(u,y,W,$,ee){var te=this.display;u=En(this,L(this.doc,u));var le=u.bottom,Me=u.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),te.sizer.appendChild(y),$=="over")le=u.top;else if($=="above"||$=="near"){var He=Math.max(te.wrapper.clientHeight,this.doc.height),xt=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);($=="above"||u.bottom+y.offsetHeight>He)&&u.top>y.offsetHeight?le=u.top-y.offsetHeight:u.bottom+y.offsetHeight<=He&&(le=u.bottom),Me+y.offsetWidth>xt&&(Me=xt-y.offsetWidth)}y.style.top=le+"px",y.style.left=y.style.right="",ee=="right"?(Me=te.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(ee=="left"?Me=0:ee=="middle"&&(Me=(te.sizer.clientWidth-y.offsetWidth)/2),y.style.left=Me+"px"),W&&za(this,{left:Me,top:le,right:Me+y.offsetWidth,bottom:le+y.offsetHeight})},triggerOnKeyDown:Pi(Qs),triggerOnKeyPress:Pi(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Pi(el),execCommand:function(u){if(Fo.hasOwnProperty(u))return Fo[u].call(null,this)},triggerElectric:Pi(function(u){sl(this,u)}),findPosH:function(u,y,W,$){var ee=1;y<0&&(ee=-1,y=-y);for(var te=L(this.doc,u),le=0;le<y&&!(te=ps(this.doc,te,ee,W,$),te.hitSide);++le);return te},moveH:Pi(function(u,y){var W=this;this.extendSelectionsBy(function($){return W.display.shift||W.doc.extend||$.empty()?ps(W.doc,$.head,u,y,W.options.rtlMoveVisually):u<0?$.from():$.to()},Je)}),deleteH:Pi(function(u,y){var W=this.doc.sel,$=this.doc;W.somethingSelected()?$.replaceSelection("",null,"+delete"):wo(this,function(ee){var te=ps($,ee.head,u,y,!1);return u<0?{from:te,to:ee.head}:{from:ee.head,to:te}})}),findPosV:function(u,y,W,$){var ee=1,te=$;y<0&&(ee=-1,y=-y);for(var le=L(this.doc,u),Me=0;Me<y;++Me){var He=En(this,le,"div");if(te==null?te=He.left:He.left=te,le=dl(this,He,ee,W),le.hitSide)break}return le},moveV:Pi(function(u,y){var W=this,$=this.doc,ee=[],te=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Me){if(te)return u<0?Me.from():Me.to();var He=En(W,Me.head,"div");Me.goalColumn!=null&&(He.left=Me.goalColumn),ee.push(He.left);var xt=dl(W,He,u,y);return y=="page"&&Me==$.sel.primary()&&Va(W,en(W,xt,"div").top-He.top),xt},Je),ee.length)for(var le=0;le<$.sel.ranges.length;le++)$.sel.ranges[le].goalColumn=ee[le]}),findWordAt:function(u){var y=this.doc,W=wn(y,u.line).text,$=u.ch,ee=u.ch;if(W){var te=this.getHelper(u,"wordChars");(u.sticky=="before"||ee==W.length)&&$?--$:++ee;for(var le=W.charAt($),Me=Bt(le,te)?function(He){return Bt(He,te)}:/\s/.test(le)?function(He){return/\s/.test(He)}:function(He){return!/\s/.test(He)&&!Bt(He)};$>0&&Me(W.charAt($-1));)--$;for(;ee<W.length&&Me(W.charAt(ee));)++ee}return new Vr(pn(u.line,$),pn(u.line,ee))},toggleOverwrite:function(u){if(u!=null&&u==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?B(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),tt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Pi(function(u,y){Ra(this,u,y)}),getScrollInfo:function(){var u=this.display.scroller;return{left:u.scrollLeft,top:u.scrollTop,height:u.scrollHeight-ze(this)-this.display.barHeight,width:u.scrollWidth-ze(this)-this.display.barWidth,clientHeight:re(this),clientWidth:Se(this)}},scrollIntoView:Pi(function(u,y){u==null?(u={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof u=="number"?u={from:pn(u,0),to:null}:u.from==null&&(u={from:u,to:null}),u.to||(u.to=u.from),u.margin=y||0,u.from.line!=null?ho(this,u):Aa(this,u.from,u.to,u.margin)}),setSize:Pi(function(u,y){var W=this,$=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};u!=null&&(this.display.wrapper.style.width=$(u)),y!=null&&(this.display.wrapper.style.height=$(y)),this.options.lineWrapping&&dr(this);var ee=this.display.viewFrom;this.doc.iter(ee,this.display.viewTo,function(te){if(te.widgets){for(var le=0;le<te.widgets.length;le++)if(te.widgets[le].noHScroll){ii(W,ee,"widget");break}}++ee}),this.curOp.forceUpdate=!0,tt(this,"refresh",this)}),operation:function(u){return Ki(this,u)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Pi(function(){var u=this.display.cachedTextHeight;qr(this),this.curOp.forceUpdate=!0,wr(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(u==null||Math.abs(u-Wr(this.display))>.5||this.options.lineWrapping)&&ji(this),tt(this,"refresh",this)}),swapDoc:Pi(function(u){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,u),wr(this),this.display.input.reset(),Ra(this,u.scrollLeft,u.scrollTop),this.curOp.forceScroll=!0,Lt(this,"swapDoc",this,y),y}),phrase:function(u){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,u)?y[u]:u},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}},we(e),e.registerHelper=function(u,y,W){d.hasOwnProperty(u)||(d[u]=e[u]={_global:[]}),d[u][y]=W},e.registerGlobalHelper=function(u,y,W,$){e.registerHelper(u,y,$),d[u]._global.push({pred:W,val:$})}}function ps(e,t,d,u,y){var W=t,$=d,ee=wn(e,t.line),te=y&&e.direction=="rtl"?-d:d;function le(){var Zn=t.line+te;return Zn<e.first||Zn>=e.first+e.size?!1:(t=new pn(Zn,t.ch,t.sticky),ee=wn(e,Zn))}function Me(Zn){var Xn;if(u=="codepoint"){var ar=ee.text.charCodeAt(t.ch+(u>0?0:-1));isNaN(ar)?Xn=null:Xn=new pn(t.line,Math.max(0,Math.min(ee.text.length,t.ch+d*(ar>=55296&&ar<56320?2:1))),-d)}else y?Xn=kl(e.cm,ee,t,d):Xn=ss(ee,t,d);if(Xn==null)if(!Zn&&le())t=ls(y,e.cm,ee,t.line,te);else return!1;else t=Xn;return!0}if(u=="char"||u=="codepoint")Me();else if(u=="column")Me(!0);else if(u=="word"||u=="group")for(var He=null,xt=u=="group",pt=e.cm&&e.cm.getHelper(t,"wordChars"),an=!0;!(d<0&&!Me(!an));an=!1){var Cn=ee.text.charAt(t.ch)||`
`,Wn=Bt(Cn,pt)?"w":xt&&Cn==`
`?"n":!xt||/\s/.test(Cn)?null:"p";if(xt&&!an&&!Wn&&(Wn="s"),He&&He!=Wn){d<0&&(d=1,Me(),t.sticky="after");break}if(Wn&&(He=Wn),d>0&&!Me(!an))break}var Yn=Xo(e,t,W,$,!0);return mi(W,Yn)&&(Yn.hitSide=!0),Yn}function dl(e,t,d,u){var y=e.doc,W=t.left,$;if(u=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(ee-.5*Wr(e.display),3);$=(d>0?t.bottom:t.top)+d*te}else u=="line"&&($=d>0?t.bottom+3:t.top-3);for(var le;!(le=pr(e,W,$),!le.outside);){if(d<0?$<=0:$>=y.height){le.hitSide=!0;break}$+=d*5}return le}var di=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};di.prototype.init=function(e){var t=this,d=this,u=d.cm,y=d.div=e.lineDiv;ul(y,u.options.spellcheck,u.options.autocorrect,u.options.autocapitalize);function W(ee){for(var te=ee.target;te;te=te.parentNode){if(te==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Fe(y,"paste",function(ee){if(!W(ee)||ot(u,ee)||ol(ee,u))return;k<=11&&setTimeout(bi(u,function(){return t.updateFromDOM()}),20)}),Fe(y,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),Fe(y,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),Fe(y,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Fe(y,"touchstart",function(){return d.forceCompositionEnd()}),Fe(y,"input",function(){t.composing||t.readFromDOMSoon()});function $(ee){if(!W(ee)||ot(u,ee))return;if(u.somethingSelected())es({lineWise:!1,text:u.getSelections()}),ee.type=="cut"&&u.replaceSelection("",null,"cut");else if(u.options.lineWiseCopyCut){var te=ll(u);es({lineWise:!0,text:te.text}),ee.type=="cut"&&u.operation(function(){u.setSelections(te.ranges,0,xe),u.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var le=wa.text.join(`
`);if(ee.clipboardData.setData("Text",le),ee.clipboardData.getData("Text")==le){ee.preventDefault();return}}var Me=cl(),He=Me.firstChild;u.display.lineSpace.insertBefore(Me,u.display.lineSpace.firstChild),He.value=wa.text.join(`
`);var xt=document.activeElement;H(He),setTimeout(function(){u.display.lineSpace.removeChild(Me),xt.focus(),xt==y&&d.showPrimarySelection()},50)}Fe(y,"copy",$),Fe(y,"cut",$)},di.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},di.prototype.prepareSelection=function(){var e=Zi(this.cm,!1);return e.focus=document.activeElement==this.div,e},di.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},di.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},di.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,d=t.doc.sel.primary(),u=d.from(),y=d.to();if(t.display.viewTo==t.display.viewFrom||u.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var W=ts(t,e.anchorNode,e.anchorOffset),$=ts(t,e.focusNode,e.focusOffset);if(W&&!W.bad&&$&&!$.bad&&or(ni(W,$),u)==0&&or(ti(W,$),y)==0)return;var ee=t.display.view,te=u.line>=t.display.viewFrom&&hl(t,u)||{node:ee[0].measure.map[2],offset:0},le=y.line<t.display.viewTo&&hl(t,y);if(!le){var Me=ee[ee.length-1].measure,He=Me.maps?Me.maps[Me.maps.length-1]:Me.map;le={node:He[He.length-1],offset:He[He.length-2]-He[He.length-3]}}if(!te||!le){e.removeAllRanges();return}var xt=e.rangeCount&&e.getRangeAt(0),pt;try{pt=g(te.node,te.offset,le.offset,le.node)}catch(an){}pt&&(!U&&t.state.focused?(e.collapse(te.node,te.offset),pt.collapsed||(e.removeAllRanges(),e.addRange(pt))):(e.removeAllRanges(),e.addRange(pt)),xt&&e.anchorNode==null?e.addRange(xt):U&&this.startGracePeriod()),this.rememberSelection()},di.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},di.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},di.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},di.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},di.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},di.prototype.blur=function(){this.div.blur()},di.prototype.getField=function(){return this.div},di.prototype.supportsTouch=function(){return!0},di.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ki(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},di.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},di.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var d=ts(t,e.anchorNode,e.anchorOffset),u=ts(t,e.focusNode,e.focusOffset);d&&u&&Ki(t,function(){Yi(t.doc,$n(d,u),xe),(d.bad||u.bad)&&(t.curOp.selectionChanged=!0)})},di.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,d=e.doc.sel.primary(),u=d.from(),y=d.to();if(u.ch==0&&u.line>e.firstLine()&&(u=pn(u.line-1,wn(e.doc,u.line-1).length)),y.ch==wn(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=pn(y.line+1,0)),u.line<t.viewFrom||y.line>t.viewTo-1)return!1;var W,$,ee;u.line==t.viewFrom||(W=ui(e,u.line))==0?($=cr(t.view[0].line),ee=t.view[0].node):($=cr(t.view[W].line),ee=t.view[W-1].node.nextSibling);var te=ui(e,y.line),le,Me;if(te==t.view.length-1?(le=t.viewTo-1,Me=t.lineDiv.lastChild):(le=cr(t.view[te+1].line)-1,Me=t.view[te+1].node.previousSibling),!ee)return!1;for(var He=e.doc.splitLines(tu(e,ee,Me,$,le)),xt=br(e.doc,pn($,0),pn(le,wn(e.doc,le).text.length));He.length>1&&xt.length>1;)if(lt(He)==lt(xt))He.pop(),xt.pop(),le--;else if(He[0]==xt[0])He.shift(),xt.shift(),$++;else break;for(var pt=0,an=0,Cn=He[0],Wn=xt[0],Yn=Math.min(Cn.length,Wn.length);pt<Yn&&Cn.charCodeAt(pt)==Wn.charCodeAt(pt);)++pt;for(var Zn=lt(He),Xn=lt(xt),ar=Math.min(Zn.length-(He.length==1?pt:0),Xn.length-(xt.length==1?pt:0));an<ar&&Zn.charCodeAt(Zn.length-an-1)==Xn.charCodeAt(Xn.length-an-1);)++an;if(He.length==1&&xt.length==1&&$==u.line)for(;pt&&pt>u.ch&&Zn.charCodeAt(Zn.length-an-1)==Xn.charCodeAt(Xn.length-an-1);)pt--,an++;He[He.length-1]=Zn.slice(0,Zn.length-an).replace(/^\u200b+/,""),He[0]=He[0].slice(pt).replace(/\u200b+$/,"");var Tr=pn($,pt),_r=pn(le,xt.length?lt(xt).length-an:0);if(He.length>1||He[0]||or(Tr,_r))return bo(e.doc,He,Tr,_r,"+input"),!0},di.prototype.ensurePolled=function(){this.forceCompositionEnd()},di.prototype.reset=function(){this.forceCompositionEnd()},di.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},di.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)},di.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ki(this.cm,function(){return qr(e.cm)})},di.prototype.setUneditable=function(e){e.contentEditable="false"},di.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bi(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},di.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},di.prototype.onContextMenu=function(){},di.prototype.resetPosition=function(){},di.prototype.needsContentAttribute=!0;function hl(e,t){var d=Ze(e,t.line);if(!d||d.hidden)return null;var u=wn(e.doc,t.line),y=ue(d,u,t.line),W=Ln(u,e.doc.direction),$="left";if(W){var ee=nt(W,t.ch);$=ee%2?"right":"left"}var te=rn(y.map,t.ch,$);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function To(e,t){return t&&(e.bad=!0),e}function tu(e,t,d,u,y){var W="",$=!1,ee=e.doc.lineSeparator(),te=!1;function le(pt){return function(an){return an.id==pt}}function Me(){$&&(W+=ee,te&&(W+=ee),$=te=!1)}function He(pt){pt&&(Me(),W+=pt)}function xt(pt){if(pt.nodeType==1){var an=pt.getAttribute("cm-text");if(an){He(an);return}var Cn=pt.getAttribute("cm-marker"),Wn;if(Cn){var Yn=e.findMarks(pn(u,0),pn(y+1,0),le(+Cn));Yn.length&&(Wn=Yn[0].find(0))&&He(br(e.doc,Wn.from,Wn.to).join(ee));return}if(pt.getAttribute("contenteditable")=="false")return;var Zn=/^(pre|div|p|li|table|br)$/i.test(pt.nodeName);if(!/^br$/i.test(pt.nodeName)&&pt.textContent.length==0)return;Zn&&Me();for(var Xn=0;Xn<pt.childNodes.length;Xn++)xt(pt.childNodes[Xn]);/^(pre|p)$/i.test(pt.nodeName)&&(te=!0),Zn&&($=!0)}else pt.nodeType==3&&He(pt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(xt(t),t==d);)t=t.nextSibling,te=!1;return W}function ts(e,t,d){var u;if(t==e.display.lineDiv){if(u=e.display.lineDiv.childNodes[d],!u)return To(e.clipPos(pn(e.display.viewTo-1)),!0);t=null,d=0}else for(u=t;;u=u.parentNode){if(!u||u==e.display.lineDiv)return null;if(u.parentNode&&u.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var W=e.display.view[y];if(W.node==u)return nu(W,t,d)}}function nu(e,t,d){var u=e.text.firstChild,y=!1;if(!t||!w(u,t))return To(pn(cr(e.line),0),!0);if(t==u&&(y=!0,t=u.childNodes[d],d=0,!t)){var W=e.rest?lt(e.rest):e.line;return To(pn(cr(W),W.text.length),y)}var $=t.nodeType==3?t:null,ee=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,d&&(d=$.nodeValue.length));ee.parentNode!=u;)ee=ee.parentNode;var te=e.measure,le=te.maps;function Me(Wn,Yn,Zn){for(var Xn=-1;Xn<(le?le.length:0);Xn++)for(var ar=Xn<0?te.map:le[Xn],Tr=0;Tr<ar.length;Tr+=3){var _r=ar[Tr+2];if(_r==Wn||_r==Yn){var Fr=cr(Xn<0?e.line:e.rest[Xn]),pi=ar[Tr]+Zn;return(Zn<0||_r!=Wn)&&(pi=ar[Tr+(Zn?1:0)]),pn(Fr,pi)}}}var He=Me($,ee,d);if(He)return To(He,y);for(var xt=ee.nextSibling,pt=$?$.nodeValue.length-d:0;xt;xt=xt.nextSibling){if(He=Me(xt,xt.firstChild,0),He)return To(pn(He.line,He.ch-pt),y);pt+=xt.textContent.length}for(var an=ee.previousSibling,Cn=d;an;an=an.previousSibling){if(He=Me(an,an.firstChild,-1),He)return To(pn(He.line,He.ch+Cn),y);Cn+=an.textContent.length}}var Di=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Di.prototype.init=function(e){var t=this,d=this,u=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),a&&(y.style.width="0px"),Fe(y,"input",function(){K&&k>=9&&t.hasSelection&&(t.hasSelection=null),d.poll()}),Fe(y,"paste",function($){if(ot(u,$)||ol($,u))return;u.state.pasteIncoming=+new Date,d.fastPoll()});function W($){if(ot(u,$))return;if(u.somethingSelected())es({lineWise:!1,text:u.getSelections()});else if(u.options.lineWiseCopyCut){var ee=ll(u);es({lineWise:!0,text:ee.text}),$.type=="cut"?u.setSelections(ee.ranges,null,xe):(d.prevInput="",y.value=ee.text.join(`
`),H(y))}else return;$.type=="cut"&&(u.state.cutIncoming=+new Date)}Fe(y,"cut",W),Fe(y,"copy",W),Fe(e.scroller,"paste",function($){if(vi(e,$)||ot(u,$))return;if(!y.dispatchEvent){u.state.pasteIncoming=+new Date,d.focus();return}var ee=new Event("paste");ee.clipboardData=$.clipboardData,y.dispatchEvent(ee)}),Fe(e.lineSpace,"selectstart",function($){vi(e,$)||ae($)}),Fe(y,"compositionstart",function(){var $=u.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:$,range:u.markText($,u.getCursor("to"),{className:"CodeMirror-composing"})}}),Fe(y,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},Di.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Di.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Di.prototype.prepareSelection=function(){var e=this.cm,t=e.display,d=e.doc,u=Zi(e);if(e.options.moveInputWithCursor){var y=En(e,d.sel.primary().head,"div"),W=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();u.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+$.top-W.top)),u.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+$.left-W.left))}return u},Di.prototype.showSelection=function(e){var t=this.cm,d=t.display;h(d.cursorDiv,e.cursors),h(d.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Di.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var d=t.getSelection();this.textarea.value=d,t.state.focused&&H(this.textarea),K&&k>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",K&&k>=9&&(this.hasSelection=null))},Di.prototype.getField=function(){return this.textarea},Di.prototype.supportsTouch=function(){return!1},Di.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},Di.prototype.blur=function(){this.textarea.blur()},Di.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Di.prototype.receivedFocus=function(){this.slowPoll()},Di.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()})},Di.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function d(){var u=t.poll();!u&&!e?(e=!0,t.polling.set(60,d)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,d)},Di.prototype.poll=function(){var e=this,t=this.cm,d=this.textarea,u=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ct(d)&&!u&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=d.value;if(y==u&&!t.somethingSelected())return!1;if(K&&k>=9&&this.hasSelection===y||i&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var W=y.charCodeAt(0);if(W==8203&&!u&&(u="\u200B"),W==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,ee=Math.min(u.length,y.length);$<ee&&u.charCodeAt($)==y.charCodeAt($);)++$;return Ki(t,function(){fs(t,y.slice($),u.length-$,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
`)>-1?d.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Di.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Di.prototype.onKeyPress=function(){K&&k>=9&&(this.hasSelection=null),this.fastPoll()},Di.prototype.onContextMenu=function(e){var t=this,d=t.cm,u=d.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var W=Ri(d,e),$=u.scroller.scrollTop;if(!W||f)return;var ee=d.options.resetSelectionOnContextMenu;ee&&d.doc.sel.contains(W)==-1&&bi(d,Yi)(d.doc,$n(W),xe);var te=y.style.cssText,le=t.wrapper.style.cssText,Me=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Me.top-5)+"px; left: "+(e.clientX-Me.left-5)+`px;
z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var He;r&&(He=window.scrollY),u.input.focus(),r&&window.scrollTo(null,He),u.input.reset(),d.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=pt,u.selForContextMenu=d.doc.sel,clearTimeout(u.detectingSelectAll);function xt(){if(y.selectionStart!=null){var Cn=d.somethingSelected(),Wn="\u200B"+(Cn?y.value:"");y.value="\u21DA",y.value=Wn,t.prevInput=Cn?"":"\u200B",y.selectionStart=1,y.selectionEnd=Wn.length,u.selForContextMenu=d.doc.sel}}function pt(){if(t.contextMenuPending!=pt)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=le,y.style.cssText=te,K&&k<9&&u.scrollbars.setScrollTop(u.scroller.scrollTop=$),y.selectionStart!=null){(!K||K&&k<9)&&xt();var Cn=0,Wn=function(){u.selForContextMenu==d.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?bi(d,Ds)(d):Cn++<10?u.detectingSelectAll=setTimeout(Wn,500):(u.selForContextMenu=null,u.input.reset())};u.detectingSelectAll=setTimeout(Wn,200)}}if(K&&k>=9&&xt(),R){_e(e);var an=function(){At(window,"mouseup",an),setTimeout(pt,20)};Fe(window,"mouseup",an)}else setTimeout(pt,50)},Di.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Di.prototype.setUneditable=function(){},Di.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?x(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 d=j();t.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function u(){e.value=ee.getValue()}var y;if(e.form&&(Fe(e.form,"submit",u),!t.leaveSubmitMethodAlone)){var W=e.form;y=W.submit;try{var $=W.submit=function(){u(),W.submit=y,W.submit(),W.submit=$}}catch(te){}}t.finishInit=function(te){te.save=u,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,u(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(At(e.form,"submit",u),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var ee=xi(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return ee}function iu(e){e.off=At,e.on=Fe,e.wheelEventPixels=Ba,e.Doc=ta,e.splitLines=Et,e.countColumn=Y,e.findColumn=Ye,e.isWordChar=ht,e.Pass=$e,e.signal=tt,e.Line=Nn,e.changeEnd=hr,e.scrollbarModel=$a,e.Pos=pn,e.cmpPos=or,e.modes=kt,e.mimeModes=ct,e.resolveMode=Le,e.getMode=qe,e.modeExtensions=mt,e.extendMode=jt,e.copyState=sn,e.startState=nr,e.innerMode=yn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=Kn,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ae,e.e_stopPropagation=oe,e.e_stop=_e,e.addClass=B,e.contains=w,e.rmClass=v,e.keyNames=eo}$l(xi),ql(xi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ta.prototype)ta.prototype.hasOwnProperty(ns)&&ie(au,ns)<0&&(xi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ta.prototype[ns]));return we(ta),xi.inputStyles={textarea:Di,contenteditable:di},xi.defineMode=function(e){!xi.defaults.mode&&e!="null"&&(xi.defaults.mode=e),Qt.apply(this,arguments)},xi.defineMIME=un,xi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),xi.defineMIME("text/plain","null"),xi.defineExtension=function(e,t){xi.prototype[e]=t},xi.defineDocExtension=function(e,t){ta.prototype[e]=t},xi.fromTextArea=ru,iu(xi),xi.version="5.58.2",xi})},WaYH:function(Kt,he,D){"use strict";var Z=D("rePB"),V=D("Ff2n"),U=D("VTBJ"),G=D("1OyB"),P=D("vuIU"),I=D("JX7q"),K=D("Ji7U"),k=D("LK+K"),r=D("q1tI"),M=D("TSYQ"),b=D.n(M),f=D("sboe"),m=D("OZM5"),l=function(R){var S=R.prefixCls,v=R.level,E=R.isStart,h=R.isEnd;if(!v)return null;for(var p="".concat(S,"-indent-unit"),_=[],g=0;g<v;g+=1){var w;_.push(r.createElement("span",{key:g,className:b()(p,(w={},Object(Z.a)(w,"".concat(p,"-start"),E[g+1]),Object(Z.a)(w,"".concat(p,"-end"),h[g+1]),Object(Z.a)(w,"".concat(p,"-end-first-level"),!g&&h[0]),w))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(S,"-indent")},_)},o=l,a=D("815F"),c="open",s="close",i="---",n=function(C){Object(K.a)(S,C);var R=Object(k.a)(S);function S(){var v;return Object(G.a)(this,S),v=R.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(E){var h=v.props.context.onNodeClick;h(E,Object(a.b)(v.props)),v.isSelectable()?v.onSelect(E):v.onCheck(E)},v.onSelectorDoubleClick=function(E){var h=v.props.context.onNodeDoubleClick;h(E,Object(a.b)(v.props))},v.onSelect=function(E){if(v.isDisabled())return;var h=v.props.context.onNodeSelect;E.preventDefault(),h(E,Object(a.b)(v.props))},v.onCheck=function(E){if(v.isDisabled())return;var h=v.props,p=h.disableCheckbox,_=h.checked,g=v.props.context.onNodeCheck;if(!v.isCheckable()||p)return;E.preventDefault();var w=!_;g(E,Object(a.b)(v.props),w)},v.onMouseEnter=function(E){var h=v.props.context.onNodeMouseEnter;h(E,Object(a.b)(v.props))},v.onMouseLeave=function(E){var h=v.props.context.onNodeMouseLeave;h(E,Object(a.b)(v.props))},v.onContextMenu=function(E){var h=v.props.context.onNodeContextMenu;h(E,Object(a.b)(v.props))},v.onDragStart=function(E){var h=v.props.context.onNodeDragStart;E.stopPropagation(),v.setState({dragNodeHighlight:!0}),h(E,Object(I.a)(v));try{E.dataTransfer.setData("text/plain","")}catch(p){}},v.onDragEnter=function(E){var h=v.props.context.onNodeDragEnter;E.preventDefault(),E.stopPropagation(),h(E,Object(I.a)(v))},v.onDragOver=function(E){var h=v.props.context.onNodeDragOver;E.preventDefault(),E.stopPropagation(),h(E,Object(I.a)(v))},v.onDragLeave=function(E){var h=v.props.context.onNodeDragLeave;E.stopPropagation(),h(E,Object(I.a)(v))},v.onDragEnd=function(E){var h=v.props.context.onNodeDragEnd;E.stopPropagation(),v.setState({dragNodeHighlight:!1}),h(E,Object(I.a)(v))},v.onDrop=function(E){var h=v.props.context.onNodeDrop;E.preventDefault(),E.stopPropagation(),v.setState({dragNodeHighlight:!1}),h(E,Object(I.a)(v))},v.onExpand=function(E){var h=v.props.context.onNodeExpand;h(E,Object(a.b)(v.props))},v.setSelectHandle=function(E){v.selectHandle=E},v.getNodeState=function(){var E=v.props.expanded;return v.isLeaf()?null:E?c:s},v.hasChildren=function(){var E=v.props.eventKey,h=v.props.context.keyEntities,p=h[E]||{},_=p.children;return!!(_||[]).length},v.isLeaf=function(){var E=v.props,h=E.isLeaf,p=E.loaded,_=v.props.context.loadData,g=v.hasChildren();return h===!1?!1:h||!_&&!g||_&&p&&!g},v.isDisabled=function(){var E=v.props.disabled,h=v.props.context.disabled;return!!(h||E)},v.isCheckable=function(){var E=v.props.checkable,h=v.props.context.checkable;return!h||E===!1?!1:h},v.syncLoadData=function(E){var h=E.expanded,p=E.loading,_=E.loaded,g=v.props.context,w=g.loadData,j=g.onNodeLoad;if(p)return;w&&h&&!v.isLeaf()&&(!v.hasChildren()&&!_&&j(Object(a.b)(v.props)))},v.renderSwitcher=function(){var E=v.props,h=E.expanded,p=E.switcherIcon,_=v.props.context,g=_.prefixCls,w=_.switcherIcon,j=p||w;if(v.isLeaf())return r.createElement("span",{className:b()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof j=="function"?j(Object(U.a)(Object(U.a)({},v.props),{},{isLeaf:!0})):j);var B=b()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(h?c:s));return r.createElement("span",{onClick:v.onExpand,className:B},typeof j=="function"?j(Object(U.a)(Object(U.a)({},v.props),{},{isLeaf:!1})):j)},v.renderCheckbox=function(){var E=v.props,h=E.checked,p=E.halfChecked,_=E.disableCheckbox,g=v.props.context.prefixCls,w=v.isDisabled(),j=v.isCheckable();if(!j)return null;var B=typeof j!="boolean"?j:null;return r.createElement("span",{className:b()("".concat(g,"-checkbox"),h&&"".concat(g,"-checkbox-checked"),!h&&p&&"".concat(g,"-checkbox-indeterminate"),(w||_)&&"".concat(g,"-checkbox-disabled")),onClick:v.onCheck},B)},v.renderIcon=function(){var E=v.props.loading,h=v.props.context.prefixCls;return r.createElement("span",{className:b()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(v.getNodeState()||"docu"),E&&"".concat(h,"-icon_loading"))})},v.renderSelector=function(){var E=v.state.dragNodeHighlight,h=v.props,p=h.title,_=h.selected,g=h.icon,w=h.loading,j=h.data,B=v.props.context,A=B.prefixCls,H=B.showIcon,F=B.icon,x=B.draggable,Y=B.loadData,q=B.titleRender,ie=v.isDisabled(),me="".concat(A,"-node-content-wrapper"),$e;if(H){var xe=g||F;$e=xe?r.createElement("span",{className:b()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof xe=="function"?xe(v.props):xe):v.renderIcon()}else Y&&w&&($e=v.renderIcon());var Ie;typeof p=="function"?Ie=p(j):q?Ie=q(j):Ie=p;var Je=r.createElement("span",{className:"".concat(A,"-title")},Ie);return r.createElement("span",{ref:v.setSelectHandle,title:typeof p=="string"?p:"",className:b()("".concat(me),"".concat(me,"-").concat(v.getNodeState()||"normal"),!ie&&(_||E)&&"".concat(A,"-node-selected"),!ie&&x&&"draggable"),draggable:!ie&&x||void 0,"aria-grabbed":!ie&&x||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:x?v.onDragStart:void 0},$e,Je)},v}return Object(P.a)(S,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var E=this.props.selectable,h=this.props.context.selectable;return typeof E=="boolean"?E:h}},{key:"render",value:function(){var E,h=this.props,p=h.eventKey,_=h.className,g=h.style,w=h.dragOver,j=h.dragOverGapTop,B=h.dragOverGapBottom,A=h.isLeaf,H=h.isStart,F=h.isEnd,x=h.expanded,Y=h.selected,q=h.checked,ie=h.halfChecked,me=h.loading,$e=h.domRef,xe=h.active,Ie=h.onMouseMove,Je=Object(V.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ye=this.props.context,ve=Ye.prefixCls,fe=Ye.filterTreeNode,lt=Ye.draggable,qt=Ye.keyEntities,Ft=this.isDisabled(),Ot=Object(m.f)(Je),Ve=qt[p]||{},vt=Ve.level,ht=F[F.length-1];return r.createElement("div",Object.assign({ref:$e,className:b()(_,"".concat(ve,"-treenode"),(E={},Object(Z.a)(E,"".concat(ve,"-treenode-disabled"),Ft),Object(Z.a)(E,"".concat(ve,"-treenode-switcher-").concat(x?"open":"close"),!A),Object(Z.a)(E,"".concat(ve,"-treenode-checkbox-checked"),q),Object(Z.a)(E,"".concat(ve,"-treenode-checkbox-indeterminate"),ie),Object(Z.a)(E,"".concat(ve,"-treenode-selected"),Y),Object(Z.a)(E,"".concat(ve,"-treenode-loading"),me),Object(Z.a)(E,"".concat(ve,"-treenode-active"),xe),Object(Z.a)(E,"".concat(ve,"-treenode-leaf-last"),ht),Object(Z.a)(E,"drag-over",!Ft&&w),Object(Z.a)(E,"drag-over-gap-top",!Ft&&j),Object(Z.a)(E,"drag-over-gap-bottom",!Ft&&B),Object(Z.a)(E,"filter-node",fe&&fe(Object(a.b)(this.props))),E)),style:g,onDragEnter:lt?this.onDragEnter:void 0,onDragOver:lt?this.onDragOver:void 0,onDragLeave:lt?this.onDragLeave:void 0,onDrop:lt?this.onDrop:void 0,onDragEnd:lt?this.onDragEnd:void 0,onMouseMove:Ie},Ot),r.createElement(o,{prefixCls:ve,level:vt,isStart:H,isEnd:F}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),S}(r.Component),O=function(R){return r.createElement(f.a.Consumer,null,function(S){return r.createElement(n,Object.assign({},R,{context:S}))})};O.displayName="TreeNode",O.defaultProps={title:i},O.isTreeNode=1;var T=he.a=O},XpUO:function(Kt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("sRBo"),G=D("kaz8"),P=D("jCWc"),I=D("kPKH"),K=D("iQDF"),k=D("+eQT"),r=D("giR+"),M=D("fyUT"),b=D("14J3"),f=D("BMrR"),m=D("7Kak"),l=D("9yH6"),o=D("miYZ"),a=D("tsqr"),c=D("jrin"),s=D("9og8"),i=D("k1fw"),n=D("oBTY"),O=D("y8nQ"),T=D("Vl3Y"),C=D("tJVT"),R=D("PpiC"),S=D("WmNS"),v=D.n(S),E=D("q1tI"),h=D.n(E),p=D("wd/R"),_=D.n(p),g=D("ErOA"),w=D("xKgJ"),j=D("1vsH"),B=D("Ty5D"),A=D("9kvl"),H=D("4wi7"),F=D("oUNq"),x=D("eozf"),Y=function(ie){var me,$e,xe,Ie,Je,Ye,ve,fe,lt,qt,Ft,Ot,Ve,vt,ht,Bt,se,Ue,Ge,et,Wt,Yt,on,nt,tn,Ln,We,Fe,yt,At,tt,ot,De,ye,we,ae,oe,pe,_e,be=ie.classroomList,Ke=ie.dispatch,St=ie.courseEndTime,nn=Object(R.a)(ie,["classroomList","dispatch","courseEndTime"]),An=Object(B.i)(),bt=T.a.useForm(),Jt=Object(C.a)(bt,1),Et=Jt[0],Ct=Object(E.useState)(1),st=Object(C.a)(Ct,2),de=st[0],Ae=st[1],kt=Object(E.useState)([]),ct=Object(C.a)(kt,2),Qt=ct[0],un=ct[1],Le=Object(E.useState)(0),qe=Object(C.a)(Le,2),mt=qe[0],jt=qe[1],sn=Object(E.useState)(2e3),yn=Object(C.a)(sn,2),nr=yn[0],Kn=yn[1],wn=Object(E.useState)(!0),br=Object(C.a)(wn,2),Er=br[0],rr=br[1],cr=Object(E.useState)(!1),Pr=Object(C.a)(cr,2),Kr=Pr[0],hi=Pr[1],pn=Object(E.useState)(!1),or=Object(C.a)(pn,2),mi=or[0],wi=or[1],ti=Object(E.useState)([]),ni=Object(C.a)(ti,2),X=ni[0],L=ni[1],N=Object(E.useState)(!0),z=Object(C.a)(N,2),ne=z[0],J=z[1],je=Object(E.useState)(!((me=be.actionTabs)!==null&&me!==void 0&&($e=me.selectArrsAll)!==null&&$e!==void 0&&(xe=$e[0])!==null&&xe!==void 0&&xe.send_type)),$t=Object(C.a)(je,2),In=$t[0],Jn=$t[1],ln=Object(E.useState)([0,0,0]),tr=Object(C.a)(ln,2),qn=tr[0],kr=tr[1];Object(E.useEffect)(function(){if(be.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var Dr,Sr,ri,Br,Bn,_n;if((Dr=be.actionTabs)!==null&&Dr!==void 0&&(Sr=Dr.selectArrsAll)!==null&&Sr!==void 0&&(ri=Sr[0])!==null&&ri!==void 0&&ri.can_publish){var sr,Q,ce;kr(Object(n.a)((sr=be.actionTabs)===null||sr===void 0||((Q=sr.selectArrsAll)===null||Q===void 0||((ce=Q[0])===null||ce===void 0))?void 0:ce.difficult_count))}else{var Tn,bn,ur;kr(Object(n.a)((Tn=be.actionTabs)===null||Tn===void 0||((bn=Tn.selectArrsAll)===null||bn===void 0||((ur=bn[0])===null||ur===void 0))?void 0:ur.difficult_settings))}if(Jn(!((Br=be.actionTabs)!==null&&Br!==void 0&&(Bn=Br.selectArrsAll)!==null&&Bn!==void 0&&(_n=Bn[0])!==null&&_n!==void 0&&_n.send_type)),li(),be.actionTabs.type===2){var Ce,Te=(Ce=be.actionTabs.selectArrsAll)===null||Ce===void 0?void 0:Ce[0];J(Te.unified_setting)}}},[be.actionTabs]),Object(E.useEffect)(function(){if(Kr){if(mi)return;Ke({type:"classroomList/setActionTabs",payload:{}}),Object(w.c)()?(Ke({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},be.actionTabs.params),{},{type:1})}),Ke({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},An)})):Ke({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},be.actionTabs.params)})}},[Kr]);var li=function(){var Dr=Object(s.a)(v.a.mark(function Sr(ri){var Br,Bn;return v.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return rr(!0),Tn.next=3,Object(F.D)(Object(i.a)(Object(i.a)({},An),{},{page:ri||de,limit:2e4,homework_id:be.actionTabs.type===1?"":be.actionTabs.selectArrs[0]}));case 3:Br=Tn.sent,Br==null||Br.course_groups.map(function(bn,ur){bn.key=bn.id,bn.title=bn.name,bn.disabled=bn.is_published}),Br&&(un(Object(n.a)(Br==null?void 0:Br.course_groups)),jt(Br==null?void 0:Br.course_groups_count),rr(!1),ri||Et.setFieldsValue((Bn={},Object(c.a)(Bn,"publish_time",_()(_()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(c.a)(Bn,"end_time",_()(_()(new Date(Object(j.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),Bn)));case 6:case"end":return Tn.stop()}},Sr)}));return function(ri){return Dr.apply(this,arguments)}}(),ai=function(){Object(w.c)()?be.actionTabs.detail?(Ke({type:"shixunHomeworks/setActionTabs",payload:{}}),Ke({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},An)}),Ke({type:"shixunHomeworks/getWorkSetting",payload:Object(i.a)({},An)})):Ke({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},be.actionTabs.params),{},{type:5})}):Ke({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},be.actionTabs.params)})},Gr=function(){var Dr=Object(s.a)(v.a.mark(function Sr(){var ri,Br,Bn,_n;return v.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:if(Br=Object(i.a)({},Et.getFieldsValue()),!(Br.end_time<=Br.publish_time)){bn.next=4;break}return a.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),bn.abrupt("return");case 4:if(!((X==null?void 0:X.length)<=0&&!ne&&Qt.length>0)){bn.next=7;break}return a.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),bn.abrupt("return");case 7:if(!(qn.reduce(function(ur,sr){return ur+sr})===0&&!In)){bn.next=10;break}return a.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),bn.abrupt("return");case 10:return Bn={homework_ids:Object(n.a)(be.actionTabs.selectArrs),group_ids:X.length>0?X.map(function(ur){return ur.id}):(ri=be.detailCommonHomeworksList)===null||ri===void 0?void 0:ri.course_groups,end_time:_()(Br.end_time).format("YYYY-MM-DD HH:mm"),publish_time:_()(Br.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:qn==null?void 0:qn.map(function(ur){return ur}),send_type:In?"0":"1",unified_setting:!X.length},bn.next=13,Object(g.a)("/api/courses/".concat(An.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(i.a)({},Bn)});case 13:_n=bn.sent,_n.status===0&&(Object(j.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),a.b.success("\u53D1\u5E03\u6210\u529F"),Ke({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),nn.onCallback&&nn.onCallback(),ai(),localStorage.getItem("Noviceguide")==="0"||Ke({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:h.a.createElement("div",null,"\u6700\u540E\uFF0C\u54B1\u4EEC\u7ED9\u6559\u5B66\u8BFE\u5802\u6DFB\u52A0\u4E00\u540D\u5B66\u751F~\u70B9\u51FB\u201C\u6DFB\u52A0\u5B66\u751F\u201D\uFF0C\u5728\u5F39\u7A97\u9875\u9762\u4E2D\u8F93\u5165\u5E76\u641C\u7D22\u5B66\u751F\u59D3\u540D\uFF0C\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u5C31\u53EF\u4EE5\u4E3A\u60A8\u7684\u8BFE\u5802\u6DFB\u52A0\u7B2C\u4E00\u4F4D\u5B66\u751F\u5566~")}}));case 15:case"end":return bn.stop()}},Sr)}));return function(){return Dr.apply(this,arguments)}}(),Li=function(){Ae(1),un([]),L([])},Vi=mt>de*nr;return h.a.createElement(V.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:be.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:Gr,onCancel:function(){Li(),ai(),Ke({type:"classroomList/setActionTabs",payload:{}})}},h.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",h.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Qt&&h.a.createElement(T.a,{form:Et},h.a.createElement("div",{style:{paddingLeft:0}},be.actionTabs.type===2&&h.a.createElement(f.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),h.a.createElement(l.a.Group,{value:In,disabled:!((Ie=be.actionTabs)!==null&&Ie!==void 0&&(Je=Ie.selectArrsAll)!==null&&Je!==void 0&&(Ye=Je[0])!==null&&Ye!==void 0&&Ye.can_publish),onChange:function(Sr){Jn(Sr.target.value)}},h.a.createElement(l.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),h.a.createElement(l.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!In&&h.a.createElement(f.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{style:{marginRight:65}}),h.a.createElement("span",null,"\u7B80\u5355\u9898\u6570"," ",h.a.createElement(M.a,{value:qn[0],onChange:function(Sr){qn[0]=Sr,kr(Object(n.a)(qn))},min:0,disabled:!((ve=be.actionTabs)!==null&&ve!==void 0&&(fe=ve.selectArrsAll)!==null&&fe!==void 0&&(lt=fe[0])!==null&&lt!==void 0&&lt.can_publish),placeholder:"\u6700\u5927".concat((qt=be.actionTabs)===null||qt===void 0||((Ft=qt.selectArrsAll)===null||Ft===void 0||((Ot=Ft[0])===null||Ot===void 0||((Ve=Ot.difficult_count)===null||Ve===void 0)))?void 0:Ve[0]),max:(vt=be.actionTabs)===null||vt===void 0||((ht=vt.selectArrsAll)===null||ht===void 0||((Bt=ht[0])===null||Bt===void 0||((se=Bt.difficult_count)===null||se===void 0)))?void 0:se[0],style:{width:60}})),h.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570"," ",h.a.createElement(M.a,{value:qn[1],onChange:function(Sr){qn[1]=Sr,kr(Object(n.a)(qn))},min:0,disabled:!((Ue=be.actionTabs)!==null&&Ue!==void 0&&(Ge=Ue.selectArrsAll)!==null&&Ge!==void 0&&(et=Ge[0])!==null&&et!==void 0&&et.can_publish),max:(Wt=be.actionTabs)===null||Wt===void 0||((Yt=Wt.selectArrsAll)===null||Yt===void 0||((on=Yt[0])===null||on===void 0||((nt=on.difficult_count)===null||nt===void 0)))?void 0:nt[1],placeholder:"\u6700\u5927".concat((tn=be.actionTabs)===null||tn===void 0||((Ln=tn.selectArrsAll)===null||Ln===void 0||((We=Ln[0])===null||We===void 0||((Fe=We.difficult_count)===null||Fe===void 0)))?void 0:Fe[1]),style:{width:60}})),h.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570"," ",h.a.createElement(M.a,{value:qn[2],onChange:function(Sr){qn[2]=Sr,kr(Object(n.a)(qn))},min:0,disabled:!((yt=be.actionTabs)!==null&&yt!==void 0&&(At=yt.selectArrsAll)!==null&&At!==void 0&&(tt=At[0])!==null&&tt!==void 0&&tt.can_publish),placeholder:"\u6700\u5927".concat((ot=be.actionTabs)===null||ot===void 0||((De=ot.selectArrsAll)===null||De===void 0||((ye=De[0])===null||ye===void 0||((we=ye.difficult_count)===null||we===void 0)))?void 0:we[2]),max:(ae=be.actionTabs)===null||ae===void 0||((oe=ae.selectArrsAll)===null||oe===void 0||((pe=oe[0])===null||pe===void 0||((_e=pe.difficult_count)===null||_e===void 0)))?void 0:_e[2],style:{width:60}}))),h.a.createElement(f.a,{className:"mt30",align:"middle"},h.a.createElement(I.a,null,h.a.createElement(T.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},h.a.createElement(k.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(Sr){return Sr.parentNode},disabledDate:function(Sr){return Object(x.b)(Sr,St)},disabledTime:function(Sr){return Object(x.c)(Sr)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(j.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),h.a.createElement(I.a,{className:"ml20"},h.a.createElement(T.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},h.a.createElement(k.a,{style:{width:170},getPopupContainer:function(Sr){return Sr.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(j.d)(),"HH:mm")},disabledDate:function(Sr){return Object(x.b)(Sr,St,Et.getFieldValue("publish_time"))},disabledTime:function(Sr){return Object(x.c)(Sr,Et.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),be.actionTabs.type===2&&h.a.createElement(f.a,{style:{marginBottom:"10px"}},h.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),h.a.createElement(l.a.Group,{value:ne,onChange:function(Sr){J(Sr.target.value),L([])}},h.a.createElement(l.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),h.a.createElement(l.a,{className:"ml20",disabled:Qt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Qt.length<=0&&be.actionTabs.type===2&&h.a.createElement("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},'\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03"')),(be.actionTabs.type===1||!ne)&&Qt.length>0&&h.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},h.a.createElement("span",{style:{flex:1}},h.a.createElement(G.a,{checked:X.length===Qt.length,onChange:function(Sr){X.length===Qt.length?L([]):L(Qt.filter(function(ri){return!ri.is_published}))}},"\u5168\u9009")," "),h.a.createElement("span",{style:{width:16}}),h.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",X.length||0,"\u4E2A\u5206\u73ED")),(be.actionTabs.type===1||!ne)&&Qt.length>0&&h.a.createElement(H.a,{data:Qt,selectedRowKeys:X,setSelectedRowKeys:L})))};he.a=Object(A.a)(function(q){var ie=q.classroomList;return{classroomList:ie}})(Y)},Y1PL:function(Kt,he,D){"use strict";D.r(he),D.d(he,"ResizableTextArea",function(){return ie});var Z=D("wx14"),V=D("1OyB"),U=D("vuIU"),G=D("Ji7U"),P=D("LK+K"),I=D("q1tI"),K=D("VTBJ"),k=D("rePB"),r=D("Zm9Q"),M=D("Kwbf"),b=D("c+Xe"),f=D("m+aA"),m=D("bdgK"),l=new Map;function o(xe){xe.forEach(function(Ie){var Je,Ye=Ie.target;(Je=l.get(Ye))===null||Je===void 0||Je.forEach(function(ve){return ve(Ye)})})}var a=new m.default(o),c=null,s=null;function i(xe,Ie){l.has(xe)||(l.set(xe,new Set),a.observe(xe)),l.get(xe).add(Ie)}function n(xe,Ie){l.has(xe)&&(l.get(xe).delete(Ie),l.get(xe).size||(a.unobserve(xe),l.delete(xe)))}var O=function(xe){Object(G.a)(Je,xe);var Ie=Object(P.a)(Je);function Je(){return Object(V.a)(this,Je),Ie.apply(this,arguments)}return Object(U.a)(Je,[{key:"render",value:function(){return this.props.children}}]),Je}(I.Component),T=I.createContext(null);function C(xe){var Ie=xe.children,Je=xe.onBatchResize,Ye=I.useRef(0),ve=I.useRef([]),fe=I.useContext(T),lt=I.useCallback(function(qt,Ft,Ot){Ye.current+=1;var Ve=Ye.current;ve.current.push({size:qt,element:Ft,data:Ot}),Promise.resolve().then(function(){Ve===Ye.current&&(Je==null||Je(ve.current),ve.current=[])}),fe==null||fe(qt,Ft,Ot)},[Je,fe]);return I.createElement(T.Provider,{value:lt},Ie)}function R(xe){var Ie=xe.children,Je=xe.disabled,Ye=I.useRef(null),ve=I.useRef(null),fe=I.useContext(T),lt=I.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),qt=I.isValidElement(Ie)&&Object(b.c)(Ie),Ft=qt?Ie.ref:null,Ot=I.useMemo(function(){return Object(b.a)(Ft,Ye)},[Ft,Ye]),Ve=I.useRef(xe);Ve.current=xe;var vt=I.useCallback(function(ht){var Bt=Ve.current,se=Bt.onResize,Ue=Bt.data,Ge=ht.getBoundingClientRect(),et=Ge.width,Wt=Ge.height,Yt=ht.offsetWidth,on=ht.offsetHeight,nt=Math.floor(et),tn=Math.floor(Wt);if(lt.current.width!==nt||lt.current.height!==tn||lt.current.offsetWidth!==Yt||lt.current.offsetHeight!==on){var Ln={width:nt,height:tn,offsetWidth:Yt,offsetHeight:on};lt.current=Ln;var We=Yt===Math.round(et)?et:Yt,Fe=on===Math.round(Wt)?Wt:on,yt=Object(K.a)(Object(K.a)({},Ln),{},{offsetWidth:We,offsetHeight:Fe});fe==null||fe(yt,ht,Ue),se&&Promise.resolve().then(function(){se(yt,ht)})}},[]);return I.useEffect(function(){var ht=Object(f.a)(Ye.current)||Object(f.a)(ve.current);return ht&&!Je&&i(ht,vt),function(){return n(ht,vt)}},[Ye.current,Je]),I.createElement(O,{ref:ve},qt?I.cloneElement(Ie,{ref:Ot}):Ie)}var S="rc-observer-key";function v(xe){var Ie=xe.children,Je=Object(r.a)(Ie);return Je.map(function(Ye,ve){var fe=(Ye==null?void 0:Ye.key)||"".concat(S,"-").concat(ve);return I.createElement(R,Object(Z.a)({},xe,{key:fe}),Ye)})}v.Collection=C;var E=v,h=D("bT9E"),p=D("TSYQ"),_=D.n(p),g=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],j={},B;function A(xe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Ie&&j[Je])return j[Je];var Ye=window.getComputedStyle(xe),ve=Ye.getPropertyValue("box-sizing")||Ye.getPropertyValue("-moz-box-sizing")||Ye.getPropertyValue("-webkit-box-sizing"),fe=parseFloat(Ye.getPropertyValue("padding-bottom"))+parseFloat(Ye.getPropertyValue("padding-top")),lt=parseFloat(Ye.getPropertyValue("border-bottom-width"))+parseFloat(Ye.getPropertyValue("border-top-width")),qt=w.map(function(Ot){return"".concat(Ot,":").concat(Ye.getPropertyValue(Ot))}).join(";"),Ft={sizingStyle:qt,paddingSize:fe,borderSize:lt,boxSizing:ve};return Ie&&Je&&(j[Je]=Ft),Ft}function H(xe){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),xe.getAttribute("wrap")?B.setAttribute("wrap",xe.getAttribute("wrap")):B.removeAttribute("wrap");var ve=A(xe,Ie),fe=ve.paddingSize,lt=ve.borderSize,qt=ve.boxSizing,Ft=ve.sizingStyle;B.setAttribute("style","".concat(Ft,";").concat(g)),B.value=xe.value||xe.placeholder||"";var Ot=Number.MIN_SAFE_INTEGER,Ve=Number.MAX_SAFE_INTEGER,vt=B.scrollHeight,ht;if(qt==="border-box"?vt+=lt:qt==="content-box"&&(vt-=fe),Je!==null||Ye!==null){B.value=" ";var Bt=B.scrollHeight-fe;Je!==null&&(Ot=Bt*Je,qt==="border-box"&&(Ot=Ot+fe+lt),vt=Math.max(Ot,vt)),Ye!==null&&(Ve=Bt*Ye,qt==="border-box"&&(Ve=Ve+fe+lt),ht=vt>Ve?"":"hidden",vt=Math.min(Ve,vt))}return{height:vt,minHeight:Ot,maxHeight:Ve,overflowY:ht,resize:"none"}}var F=D("Gytx"),x=D.n(F),Y;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(Y||(Y={}));var q=function(xe){Object(G.a)(Je,xe);var Ie=Object(P.a)(Je);function Je(Ye){var ve;return Object(V.a)(this,Je),ve=Ie.call(this,Ye),ve.nextFrameActionId=void 0,ve.resizeFrameId=void 0,ve.textArea=void 0,ve.saveTextArea=function(fe){ve.textArea=fe},ve.handleResize=function(fe){var lt=ve.state.resizeStatus,qt=ve.props,Ft=qt.autoSize,Ot=qt.onResize;if(lt!==Y.NONE)return;typeof Ot=="function"&&Ot(fe),Ft&&ve.resizeOnNextFrame()},ve.resizeOnNextFrame=function(){cancelAnimationFrame(ve.nextFrameActionId),ve.nextFrameActionId=requestAnimationFrame(ve.resizeTextarea)},ve.resizeTextarea=function(){var fe=ve.props.autoSize;if(!fe||!ve.textArea)return;var lt=fe.minRows,qt=fe.maxRows,Ft=H(ve.textArea,!1,lt,qt);ve.setState({textareaStyles:Ft,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(ve.resizeFrameId),ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:Y.RESIZED},function(){ve.resizeFrameId=requestAnimationFrame(function(){ve.setState({resizeStatus:Y.NONE}),ve.fixFirefoxAutoScroll()})})})})},ve.renderTextArea=function(){var fe=ve.props,lt=fe.prefixCls,qt=lt===void 0?"rc-textarea":lt,Ft=fe.autoSize,Ot=fe.onResize,Ve=fe.className,vt=fe.disabled,ht=ve.state,Bt=ht.textareaStyles,se=ht.resizeStatus,Ue=Object(h.a)(ve.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ge=_()(qt,Ve,Object(k.a)({},"".concat(qt,"-disabled"),vt));"value"in Ue&&(Ue.value=Ue.value||"");var et=Object(K.a)(Object(K.a)(Object(K.a)({},ve.props.style),Bt),se===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return I.createElement(E,{onResize:ve.handleResize,disabled:!(Ft||Ot)},I.createElement("textarea",Object(Z.a)({},Ue,{className:Ge,style:et,ref:ve.saveTextArea})))},ve.state={textareaStyles:{},resizeStatus:Y.NONE},ve}return Object(U.a)(Je,[{key:"componentDidUpdate",value:function(ve){(ve.value!==this.props.value||!x()(ve.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 ve=this.textArea.selectionStart,fe=this.textArea.selectionEnd;this.textArea.setSelectionRange(ve,fe)}}catch(lt){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Je}(I.Component),ie=q,me=function(xe){Object(G.a)(Je,xe);var Ie=Object(P.a)(Je);function Je(Ye){var ve;Object(V.a)(this,Je),ve=Ie.call(this,Ye),ve.resizableTextArea=void 0,ve.focus=function(){ve.resizableTextArea.textArea.focus()},ve.saveTextArea=function(lt){ve.resizableTextArea=lt},ve.handleChange=function(lt){var qt=ve.props.onChange;ve.setValue(lt.target.value,function(){ve.resizableTextArea.resizeTextarea()}),qt&&qt(lt)},ve.handleKeyDown=function(lt){var qt=ve.props,Ft=qt.onPressEnter,Ot=qt.onKeyDown;lt.keyCode===13&&Ft&&Ft(lt),Ot&&Ot(lt)};var fe=typeof Ye.value=="undefined"||Ye.value===null?Ye.defaultValue:Ye.value;return ve.state={value:fe},ve}return Object(U.a)(Je,[{key:"setValue",value:function(ve,fe){"value"in this.props||this.setState({value:ve},fe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I.createElement(ie,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ve){return"value"in ve?{value:ve.value}:null}}]),Je}(I.Component),$e=he.default=me},ZW9T:function(Kt,he,D){"use strict";D.d(he,"a",function(){return F});var Z=D("k1fw"),V=D("oBTY"),U=D("miYZ"),G=D("tsqr"),P=D("rAM+"),I=D("tJVT"),K=D("PpiC"),k=D("q1tI"),r=D.n(k),M=D("bdgK"),b=D("9og8"),f=D("WmNS"),m=D.n(f),l={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},a={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},c={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},s=D("5VLF"),i=D.n(s),n={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},O=function(Y,q){return q.map(function(ie){return{label:ie,kind:Y.languages.CompletionItemKind.Keyword,insertText:ie}})},T=function(Y){return Object.keys(n.tables).map(function(q){return{label:q,kind:Y.languages.CompletionItemKind.Variable,insertText:q}})},C=function(Y,q){var ie=n.tables[Y];return ie?ie.map(function(me){return{label:me,kind:q.languages.CompletionItemKind.Field,insertText:me}}):[]};function R(x,Y,q,ie,me){var $e=Y.getWordUntilPosition(q),xe={startLineNumber:q.lineNumber,endLineNumber:q.lineNumber,startColumn:$e.startColumn,endColumn:$e.endColumn},Ie=ie.map(function(Je){return{label:Je,kind:x.languages.CompletionItemKind.Keyword,insertText:Je,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return me.map(function(Je){Ie.push(Object(Z.a)(Object(Z.a)({},Je),{},{range:xe}))}),Ie}var S=function(x){n.languages.map(function(me){return x.languages.registerDocumentFormattingEditProvider(me,{provideDocumentFormattingEdits:function(xe,Ie,Je){return Object(b.a)(m.a.mark(function Ye(){var ve;return m.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return ve=i()(xe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),lt.abrupt("return",[{range:xe.getFullModelRange(),text:ve}]);case 2:case"end":return lt.stop()}},Ye)}))()}}),me});var Y=a.quickKey.map(function(me){return{label:me.label,kind:x.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),q=c.quickKey.map(function(me){return{label:me.label,kind:x.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=o.quickKey.map(function(me){return{label:me.label,kind:x.languages.CompletionItemKind.Method,insertText:me.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}});x.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function($e,xe){var Ie=$e.getWordUntilPosition(xe),Je={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn},Ye=$e.getLineContent(xe.lineNumber).substring(Ie.startColumn-2,Ie.endColumn);return{suggestions:[].concat(Object(V.a)(a.keywords.map(function(ve){return{label:ve,kind:x.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}})),Object(V.a)(a.quickKey.map(function(ve){return{label:ve.label,kind:x.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Ye.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}})))}}}),x.languages.registerCompletionItemProvider("c",{provideCompletionItems:function($e,xe){var Ie=$e.getWordUntilPosition(xe),Je={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn};return{suggestions:Object(V.a)(l.keywords.map(function(Ye){return{label:Ye,kind:x.languages.CompletionItemKind.Function,documentation:Ye,insertText:Ye,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}}))}}}),x.languages.registerCompletionItemProvider("java",{provideCompletionItems:function($e,xe){var Ie=$e.getWordUntilPosition(xe),Je={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn},Ye=$e.getLineContent(xe.lineNumber).substring(Ie.startColumn-2,Ie.endColumn);return{suggestions:[].concat(Object(V.a)(o.keywords.map(function(ve){return{label:ve,kind:x.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}})),Object(V.a)(o.quickKey.map(function(ve){return{label:ve.label,kind:x.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Ye.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}})))}}}),x.languages.registerCompletionItemProvider("python",{provideCompletionItems:function($e,xe){var Ie=$e.getWordUntilPosition(xe),Je={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Ie.startColumn,endColumn:Ie.endColumn},Ye=$e.getLineContent(xe.lineNumber).substring(Ie.startColumn-2,Ie.endColumn);return{suggestions:[].concat(Object(V.a)(c.keywords.map(function(ve){return{label:ve,kind:x.languages.CompletionItemKind.Function,documentation:ve,insertText:ve,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}})),Object(V.a)(c.quickKey.map(function(ve){return{label:ve.label,kind:x.languages.CompletionItemKind.Function,documentation:ve.content,insertText:Ye.startsWith("#")?ve.content.replace(/#/,""):ve.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Je}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",E=D("fjLI"),h=D("LvDl"),p=D("+ua5");function _(x){return/^\d+$/.test(x)?"".concat(x,"px"):x}function g(){}var w=!1,j={"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 B(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=x;if(Array.isArray(x)){for(var q=0;q<x.length;q++){var ie=j[x[q]];if(ie)return ie}return Y[0]}return j[Y]||Y}var A=null,H=he.b=function(x){var Y=x.width,q=Y===void 0?"100%":Y,ie=x.height,me=ie===void 0?"100%":ie,$e=x.value,xe=x.language,Ie=xe===void 0?"javascript":xe,Je=x.style,Ye=Je===void 0?{}:Je,ve=x.options,fe=ve===void 0?{}:ve,lt=x.overrideServices,qt=lt===void 0?{}:lt,Ft=x.theme,Ot=Ft===void 0?"vs-dark":Ft,Ve=x.onEditBlur,vt=x.onSave,ht=x.autoHeight,Bt=ht===void 0?!1:ht,se=x.forbidCopy,Ue=se===void 0?!1:se,Ge=x.onChange,et=Ge===void 0?g:Ge,Wt=x.editorDidMount,Yt=Wt===void 0?g:Wt,on=x.onFocus,nt=on===void 0?g:on,tn=x.filename,Ln=tn===void 0?"educoder.txt":tn,We=x.errorLine,Fe=x.errorContent,yt=Fe===void 0?"":Fe,At=Object(K.a)(x,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),tt=Object(k.useRef)(),ot=Object(k.useRef)({}),De=Object(k.useRef)(),ye=Object(k.useRef)(),we=Object(k.useRef)(!1),ae=Object(k.useRef)(),oe=Object(k.useState)(!1),pe=Object(I.a)(oe,2),_e=pe[0],be=pe[1];function Ke(){var mt;return tt.current&&(mt=new M.default(function(jt){var sn=Object(P.a)(jt),yn;try{for(sn.s();!(yn=sn.n()).done;){var nr=yn.value;(nr.target.offsetHeight>0||nr.target.offsetWidth>0)&&ot.current.instance.layout()}}catch(Kn){sn.e(Kn)}finally{sn.f()}}),mt.observe(tt.current)),mt}function St(){G.b.warn(decodeURIComponent(v))}var nn=function(){var jt=ot.current.instance;if($e!=null&&jt&&_e){var sn=jt.getModel();sn&&$e!==sn.getValue()&&(w=!0,sn.setValue($e),jt.layout(),w=!1)}};Object(k.useEffect)(function(){ye.current&&clearTimeout(ye.current),ye.current=setTimeout(function(){nn()},500)},[$e,_e,ot.current]),Object(k.useEffect)(function(){if(We&&ot.current&&ot.current.instance){var mt=ot.current.instance;mt.changeViewZones(function(sn){var yn=document.createElement("div");yn.style.padding="10px 20px",yn.style.width="calc(100% - 20px)",yn.className="my-error-line-wrp",yn.innerHTML=yt,sn.addZone({afterLineNumber:We||11,heightInLines:3,domNode:yn})});var jt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};mt.addOverlayWidget(jt),mt.revealPositionInCenter({lineNumber:20,column:1})}},[We,ot.current,_e]);function An(){var mt=ot.current.instance;if(mt){var jt=mt.getSelection(),sn=ot.current.pastePos||{},yn=new A.Range(sn.startLineNumber||jt.endLineNumber,sn.startColumn||jt.endColumn,sn.endLineNumber||jt.endLineNumber,sn.endColumn||jt.endColumn);setTimeout(function(){mt.executeEdits("",[{range:yn,text:""}])},300)}}function bt(mt){(window.navigator.platform.match("Mac")?mt.metaKey:mt.ctrlKey)&&mt.keyCode==83&&(mt.preventDefault(),vt())}var Jt=function(){if(Bt&&ot.current.instance){var jt=ot.current.instance.getContentHeight();Le(jt<me?me:jt)}else Le(me)};function Et(mt){var jt=document.createEvent("MouseEvents");jt.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),mt.dispatchEvent(jt)}function Ct(mt,jt){var sn=window.URL||window.webkitURL||window,yn=new Blob([jt]),nr=document.createElementNS("http://www.w3.org/1999/xhtml","a");nr.href=sn.createObjectURL(yn),nr.download=mt,Et(nr)}Object(k.useEffect)(function(){Jt()},[Jt]),Object(k.useEffect)(function(){tt.current&&!_e&&Promise.all([D.e(16),D.e(28)]).then(D.t.bind(null,"M/lh",7)).then(function(mt){try{A=mt,ot.current.instance=A.editor.create(tt.current,{value:$e,language:B(Ie),theme:Ot,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},qt);var jt=ot.current.instance,sn=E.d._menuItems,yn=Object(V.a)(sn).find(function(Er){return Er[0]._debugName=="EditorContext"}),nr=yn[1],Kn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],wn=function(rr,cr){var Pr=rr._first;do{var Kr,hi,pn=cr.includes((Kr=Pr.element)===null||Kr===void 0||((hi=Kr.command)===null||hi===void 0)?void 0:hi.id);pn&&rr._remove(Pr)}while(Pr=Pr.next)};if(Yt(jt,A),setTimeout(function(){Jt(),ot.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ct(Ln||"educoder.txt",jt.getValue())}}),jt.getDomNode().addEventListener("input",function(){De.current.autoFormat&&jt.getAction("editor.action.formatDocument").run()})},500),ot.current.subscription=jt.onDidChangeModelContent(function(Er){we.current?clearTimeout(ae.current):(Jt(),et(jt.getValue(),Er)),ae.current=setTimeout(function(){we.current=!1},500)}),window.Monaco||S(A,B(Ie)),Ue&&(wn(nr,Kn),tt.current.classList.add("noCopyPaste"),jt.onKeyDown(function(Er){var rr=Er.keyCode,cr=Er.ctrlKey,Pr=Er.metaKey;(rr===33||rr===52)&&(Pr||cr)&&(St(),Er.preventDefault())})),window.Monaco=A,Ve&&jt.onDidBlurEditorWidget(function(){Ve(jt.getValue())}),nt&&jt.onDidFocusEditorText(function(){nt(jt.getValue())}),Ue){jt.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return St(),null}),jt.onDidPaste(function(Er){ot.current.pastePos=Er});try{window.addEventListener("paste",An)}catch(Er){}}var br=Ke();return be(!0),function(){var Er=ot.current.instance;Er.dispose();var rr=Er.getModel();rr&&rr.dispose(),ot.current.subscription&&ot.current.subscription.dispose(),Ue&&window.removeEventListener("paste",An),br.unobserve(tt.current)}}catch(Er){}})},[]),Object(k.useEffect)(function(){var mt=ot.current.instance;if(mt&&_e)return document.addEventListener("keydown",bt,!1),function(){document.removeEventListener("keydown",bt)}},[vt,_e]),Object(k.useEffect)(function(){var mt=ot.current.instance;if(mt&&_e){var jt=B(Ie);A.editor.setModelLanguage(mt.getModel(),jt),console.log("language:",Ie,mt.getModel(),jt)}},[Ie,_e]),Object(k.useEffect)(function(){var mt=ot.current.instance;mt&&_e&&A.editor.setTheme(Ot)},[Ot,_e]),Object(k.useEffect)(function(){var mt=ot.current.instance;De.current=fe,mt&&_e&&(mt.updateOptions(Object(Z.a)({},fe)),setTimeout(function(){mt.getModel().updateOptions(Object(Z.a)({},fe))},200))},[JSON.stringify(fe),_e]),Object(k.useEffect)(function(){var mt=ot.current.instance;mt&&_e&&mt.layout()},[q,me,_e]);var st=Object(k.useState)(_(q)),de=Object(I.a)(st,2),Ae=de[0],kt=de[1],ct=Object(k.useState)(_(me)),Qt=Object(I.a)(ct,2),un=Qt[0],Le=Qt[1],qe=Object(Z.a)(Object(Z.a)({},Ye),{},{width:Ae,height:un});return r.a.createElement("div",{className:"my-monaco-editor",ref:tt,style:qe})};function F(x){var Y=x.width,q=Y===void 0?"100%":Y,ie=x.height,me=ie===void 0?"100%":ie,$e=x.original,xe=x.modified,Ie=x.language,Je=x.options,Ye=Je===void 0?{}:Je,ve=Object(k.useRef)(),fe=Object(k.useState)(null),lt=Object(I.a)(fe,2),qt=lt[0],Ft=lt[1];function Ot(Bt){var se;return ve.current&&(se=new M.default(function(Ue){var Ge=Object(P.a)(Ue),et;try{for(Ge.s();!(et=Ge.n()).done;){var Wt=et.value;(Wt.target.offsetHeight>0||Wt.target.offsetWidth>0)&&Bt.layout()}}catch(Yt){Ge.e(Yt)}finally{Ge.f()}}),se.observe(ve.current)),se}Object(k.useEffect)(function(){ve.current&&Promise.all([D.e(16),D.e(28)]).then(D.t.bind(null,"M/lh",7)).then(function(Bt){A=Bt;var se=A.editor.createDiffEditor(ve.current,Object(Z.a)(Object(Z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ye),{},{wordWrap:!0}));Ft(se);var Ue=Ot(se);return function(){se.dispose();var Ge=se.getModel();Ge&&Ge.dispose(),Ue.unobserve(ve.current)}})},[]),Object(k.useEffect)(function(){qt&&qt.setModel({original:A.editor.createModel($e,Ie),modified:A.editor.createModel(xe,Ie)})},[$e,xe,Ie,qt]);var Ve=_(q),vt=_(me),ht={width:Ve,height:vt};return r.a.createElement("div",{className:"my-diff-editor",ref:ve,style:ht})}},ZpRC:function(Kt,he,D){"use strict";function Z(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function V(b,f){return(!f||b!=="hidden")&&b!=="visible"&&b!=="clip"}function U(b,f){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var m=getComputedStyle(b,null);return V(m.overflowY,f)||V(m.overflowX,f)||function(l){var o=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch(c){return null}}(l);return!!o&&(o.clientHeight<l.scrollHeight||o.clientWidth<l.scrollWidth)}(b)}return!1}function G(b,f,m,l,o,a,c,s){return a<b&&c>f||a>b&&c<f?0:a<=b&&s<=m||c>=f&&s>=m?a-b-l:c>f&&s<m||a<b&&s>m?c-f+o:0}var P=function(b,f){var m=window,l=f.scrollMode,o=f.block,a=f.inline,c=f.boundary,s=f.skipOverflowHiddenElements,i=typeof c=="function"?c:function(Bt){return Bt!==c};if(!Z(b))throw new TypeError("Invalid target");for(var n=document.scrollingElement||document.documentElement,O=[],T=b;Z(T)&&i(T);){if((T=T.parentElement)===n){O.push(T);break}T!=null&&T===document.body&&U(T)&&!U(document.documentElement)||T!=null&&U(T,s)&&O.push(T)}for(var C=m.visualViewport?m.visualViewport.width:innerWidth,R=m.visualViewport?m.visualViewport.height:innerHeight,S=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,E=b.getBoundingClientRect(),h=E.height,p=E.width,_=E.top,g=E.right,w=E.bottom,j=E.left,B=o==="start"||o==="nearest"?_:o==="end"?w:_+h/2,A=a==="center"?j+p/2:a==="end"?g:j,H=[],F=0;F<O.length;F++){var x=O[F],Y=x.getBoundingClientRect(),q=Y.height,ie=Y.width,me=Y.top,$e=Y.right,xe=Y.bottom,Ie=Y.left;if(l==="if-needed"&&_>=0&&j>=0&&w<=R&&g<=C&&_>=me&&w<=xe&&j>=Ie&&g<=$e)return H;var Je=getComputedStyle(x),Ye=parseInt(Je.borderLeftWidth,10),ve=parseInt(Je.borderTopWidth,10),fe=parseInt(Je.borderRightWidth,10),lt=parseInt(Je.borderBottomWidth,10),qt=0,Ft=0,Ot="offsetWidth"in x?x.offsetWidth-x.clientWidth-Ye-fe:0,Ve="offsetHeight"in x?x.offsetHeight-x.clientHeight-ve-lt:0;if(n===x)qt=o==="start"?B:o==="end"?B-R:o==="nearest"?G(v,v+R,R,ve,lt,v+B,v+B+h,h):B-R/2,Ft=a==="start"?A:a==="center"?A-C/2:a==="end"?A-C:G(S,S+C,C,Ye,fe,S+A,S+A+p,p),qt=Math.max(0,qt+v),Ft=Math.max(0,Ft+S);else{qt=o==="start"?B-me-ve:o==="end"?B-xe+lt+Ve:o==="nearest"?G(me,xe,q,ve,lt+Ve,B,B+h,h):B-(me+q/2)+Ve/2,Ft=a==="start"?A-Ie-Ye:a==="center"?A-(Ie+ie/2)+Ot/2:a==="end"?A-$e+fe+Ot:G(Ie,$e,ie,Ye,fe+Ot,A,A+p,p);var vt=x.scrollLeft,ht=x.scrollTop;B+=ht-(qt=Math.max(0,Math.min(ht+qt,x.scrollHeight-q+Ve))),A+=vt-(Ft=Math.max(0,Math.min(vt+Ft,x.scrollWidth-ie+Ot)))}H.push({el:x,top:qt,left:Ft})}return H};function I(b){return b===Object(b)&&Object.keys(b).length!==0}function K(b,f){f===void 0&&(f="auto");var m="scrollBehavior"in document.body.style;b.forEach(function(l){var o=l.el,a=l.top,c=l.left;o.scroll&&m?o.scroll({top:a,left:c,behavior:f}):(o.scrollTop=a,o.scrollLeft=c)})}function k(b){return b===!1?{block:"end",inline:"nearest"}:I(b)?b:{block:"start",inline:"nearest"}}function r(b,f){var m=!b.ownerDocument.documentElement.contains(b);if(I(f)&&typeof f.behavior=="function")return f.behavior(m?[]:P(b,f));if(m)return;var l=k(f);return K(P(b,l),l.behavior)}var M=he.a=r},bT9E:function(Kt,he,D){"use strict";D.d(he,"a",function(){return V});var Z=D("VTBJ");function V(U,G){var P=Object(Z.a)({},U);return Array.isArray(G)&&G.forEach(function(I){delete P[I]}),P}},bTeP:function(Kt,he,D){Kt.exports={flex_box_center:"flex_box_center___14Ki3",flex_space_between:"flex_space_between___3TSad",flex_box_vertical_center:"flex_box_vertical_center___3pQXk",flex_box_center_end:"flex_box_center_end___29_cn",flex_box_column:"flex_box_column___16am0",title:"title___2mVJs",workListTabWrap:"workListTabWrap___1JlOB",workListTabButton:"workListTabButton___3umfp",tables:"tables___hLy6a",checkboxgroup:"checkboxgroup___2xMgu"}},biw7:function(Kt,he,D){"use strict";var Z=D("q1tI"),V=D.n(Z),U=Z.createContext(null);he.a=U},c5Ni:function(Kt,he,D){},deN7:function(Kt,he,D){"use strict";var Z=D("/zsF"),V=D("PArb"),U=D("14J3"),G=D("BMrR"),P=D("jCWc"),I=D("kPKH"),K=D("+L6B"),k=D("2/Rp"),r=D("miYZ"),M=D("tsqr"),b=D("9og8"),f=D("giR+"),m=D("fyUT"),l=D("2qtc"),o=D("kLXV"),a=D("7Kak"),c=D("9yH6"),s=D("tJVT"),i=D("k1fw"),n=D("OaEy"),O=D("2fM7"),T=D("WmNS"),C=D.n(T),R=D("q1tI"),S=D.n(R),v=D("ZW9T"),E=D("F0VM"),h=D.n(E),p=D("xKgJ"),_=D("J66h"),g=D.n(_),w=D("ErOA"),j=D("Ty5D"),B=D("9Bee"),A=D("XYT7"),H=D("RCxd"),F=D("/MfK"),x=O.a.Option,Y={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},q;(function(me){me[me.SET_PATH=0]="SET_PATH",me[me.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(q||(q={}));function ie(me,$e){switch($e.type){case q.SET_PATH:return Object(i.a)(Object(i.a)({},me),{},{selectedPath:$e.payload});case q.GET_PASSED_CONTENT:return Object(i.a)(Object(i.a)({},me),{},{passedContent:$e.payload});default:throw new Error}}he.a=function(me){var $e=me.language,xe=me.dispatch,Ie=me.shixunWorkReport,Je=me.v,Ye=me.languages,ve=me.onPathChange,fe=me.autoHeight,lt=me.diff_code_count,qt=me.data,Ft=Object(R.useState)(Ye==null?void 0:Ye[0]),Ot=Object(s.a)(Ft,2),Ve=Ot[0],vt=Ot[1],ht=Ie!="shixunWorkReport"&&Object(j.i)();return Object(R.useEffect)(function(){vt(Ye==null?void 0:Ye[0])},[]),Object(R.useEffect)(function(){var Bt;vt(Ye==null||((Bt=Ye.filter(function(se){return se.language===(Ve==null?void 0:Ve.language)}))===null||Bt===void 0)?void 0:Bt[0])},[Ye]),S.a.createElement(S.a.Fragment,null,S.a.createElement("h2",null," ",S.a.createElement("span",null,S.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Ye==null?void 0:Ye.length)>1&&S.a.createElement(c.a.Group,{defaultValue:$e,style:{marginLeft:10},onChange:function(se){var Ue;vt(Ye==null||((Ue=Ye.filter(function(Ge){return Ge.language===se.target.value}))===null||Ue===void 0)?void 0:Ue[0])}},Ye==null?void 0:Ye.map(function(Bt){return S.a.createElement(c.a,{value:Bt==null?void 0:Bt.language},Bt==null?void 0:Bt.language)}))),Object(p.c)()&&Ie!="shixunWorkReport"&&S.a.createElement("span",null,S.a.createElement("span",null,"\u5F97\u5206 ",Ve==null?void 0:Ve.score,"/",Ve==null?void 0:Ve.total_score),S.a.createElement(k.a,{style:{margin:"0px 10px"},onClick:function(){var se=Ve==null?void 0:Ve.score;o.a.confirm({title:"\u8C03\u5206",content:S.a.createElement("div",null,S.a.createElement("p",null,"\u5F97\u5206\uFF1A",Ve==null?void 0:Ve.score,"/",Ve==null?void 0:Ve.total_score),S.a.createElement("p",null,"\u8C03\u5206\uFF1A",S.a.createElement(m.a,{min:0,max:Ve==null?void 0:Ve.total_score,defaultValue:Ve==null?void 0:Ve.score,onChange:function(Ge){se=Ge}}))),okText:"\u786E\u8BA4",onOk:function(){var Ue=Object(b.a)(C.a.mark(function et(){var Wt;return C.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(w.a)("/api/courses/".concat(ht==null?void 0:ht.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:ht==null?void 0:ht.coursesId,hack_user_code_id:Ve==null?void 0:Ve.hack_user_id,score:se}});case 2:Wt=on.sent,Wt.status===0&&(M.b.success("\u8C03\u5206\u6210\u529F"),xe({type:"shixunHomeworks/setActionTabs",payload:{}}),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},ht)}));case 4:case"end":return on.stop()}},et)}));function Ge(){return Ue.apply(this,arguments)}return Ge}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(p.c)()&&Ie!="shixunWorkReport"&&S.a.createElement(k.a,{onClick:function(){xe({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:Ie.user_id,type:"1",language:Ve==null?void 0:Ve.language,v:Je,data:Object(i.a)({},Ie)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),S.a.createElement(v.b,{height:300,language:Ve==null?void 0:Ve.language,value:_.Base64.decode(Ve==null?void 0:Ve.code),autoHeight:fe,theme:"default",options:Y}),((Ve==null?void 0:Ve.comment)||(Ve==null?void 0:Ve.hidden_comment))&&S.a.createElement("div",null,S.a.createElement(G.a,{align:"middle",style:{borderTop:"1px solid #eee"}},S.a.createElement(I.a,{flex:1},S.a.createElement("h1",{className:h.a.title},"\u70B9\u8BC4\u5185\u5BB9")),S.a.createElement(I.a,{className:"pr30"},Object(p.c)()&&S.a.createElement(k.a,{onClick:Object(b.a)(C.a.mark(function Bt(){return C.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:o.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:S.a.createElement(H.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(b.a)(C.a.mark(function et(){var Wt;return C.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return on.next=2,Object(A.m)({comment_id:Ve==null?void 0:Ve.comment_id,homeworkId:ht.homeworkId,type:"hack"});case 2:Wt=on.sent,Wt.status===0&&(M.b.success("\u5220\u9664\u6210\u529F"),xe({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},ht)}));case 4:case"end":return on.stop()}},et)}))()}});case 1:case"end":return Ue.stop()}},Bt)}))},S.a.createElement(F.a,null),"\u5220\u9664"))),S.a.createElement(V.a,{style:{margin:0}}),(Ve==null?void 0:Ve.comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(B.a,{value:Ve==null?void 0:Ve.comment})),(Ve==null?void 0:Ve.hidden_comment)&&S.a.createElement("aside",{className:"pl30 pr30 mt20"},S.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),S.a.createElement("br",null),S.a.createElement(B.a,{value:Ve==null?void 0:Ve.hidden_comment}))))}},dejd:function(Kt,he,D){},dmUQ:function(Kt,he,D){"use strict";var Z=D("Ff2n"),V=D("rePB"),U=D("1OyB"),G=D("vuIU"),P=D("Ji7U"),I=D("md7G"),K=D("foSv"),k=D("q1tI"),r=D.n(k),M=D("TSYQ"),b=D.n(M),f=D("4IlW");function m(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);p&&(g=g.filter(function(w){return Object.getOwnPropertyDescriptor(h,w).enumerable})),_.push.apply(_,g)}return _}function l(h){for(var p=1;p<arguments.length;p++){var _=arguments[p]!=null?arguments[p]:{};p%2?m(Object(_),!0).forEach(function(g){Object(V.a)(h,g,_[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(_)):m(Object(_)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(_,g))})}return h}function o(h){var p=a();return function(){var g=Object(K.a)(h),w;if(p){var j=Object(K.a)(this).constructor;w=Reflect.construct(g,arguments,j)}else w=g.apply(this,arguments);return Object(I.a)(this,w)}}function a(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function c(){}function s(h){h.preventDefault()}var i=function(p){return p.replace(/[^\w.-]+/g,"")},n=200,O=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(p){return p!=null},R=function(p,_){return _===p||typeof _=="number"&&typeof p=="number"&&isNaN(_)&&isNaN(p)},S=function(h){Object(P.a)(_,h);var p=o(_);function _(g){var w;Object(U.a)(this,_),w=p.call(this,g),w.onKeyDown=function(A){var H=w.props,F=H.onKeyDown,x=H.onPressEnter;if(A.keyCode===f.a.UP){var Y=w.getRatio(A);w.up(A,Y,null),w.stop()}else if(A.keyCode===f.a.DOWN){var q=w.getRatio(A);w.down(A,q,null),w.stop()}else A.keyCode===f.a.ENTER&&x&&x(A);if(w.recordCursorPosition(),w.lastKeyCode=A.keyCode,F){for(var ie=arguments.length,me=new Array(ie>1?ie-1:0),$e=1;$e<ie;$e++)me[$e-1]=arguments[$e];F.apply(void 0,[A].concat(me))}},w.onKeyUp=function(A){var H=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),H){for(var F=arguments.length,x=new Array(F>1?F-1:0),Y=1;Y<F;Y++)x[Y-1]=arguments[Y];H.apply(void 0,[A].concat(x))}},w.onChange=function(A){var H=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(A)),w.setState({inputValue:w.rawInput}),H(w.toNumber(w.rawInput))},w.onMouseUp=function(){var A=w.props.onMouseUp;w.recordCursorPosition(),A&&A.apply(void 0,arguments)},w.onFocus=function(){var A;w.setState({focused:!0}),(A=w.props).onFocus.apply(A,arguments)},w.onBlur=function(){var A=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var H=w.getCurrentValidValue(w.state.inputValue),F=w.setValue(H,c);if(A){var x=w.input.value,Y=w.getInputDisplayValue({focus:!1,value:F});w.input.value=Y&&Number(Y),A.apply(void 0,arguments),w.input.value=x}},w.getRatio=function(A){var H=1;return A.metaKey||A.ctrlKey?H=.1:A.shiftKey&&(H=10),H},w.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},w.getPrecision=function(A){if(C(w.props.precision))return w.props.precision;var H=String(A);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var F=0;return H.indexOf(".")>=0&&(F=H.length-H.indexOf(".")-1),F},w.getInputDisplayValue=function(A){var H=A||w.state,F=H.focused,x=H.inputValue,Y=H.value,q;F?q=x:q=w.toPrecisionAsStep(Y),q==null&&(q="");var ie=w.formatWrapper(q);return C(w.props.decimalSeparator)&&(ie=ie.toString().replace(".",w.props.decimalSeparator)),ie},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(A){}},w.restoreByAfter=function(A){if(A===void 0)return!1;var H=w.input.value,F=H.lastIndexOf(A);if(F===-1)return!1;var x=w.cursorBefore.length;return w.lastKeyCode===f.a.DELETE&&w.cursorBefore.charAt(x-1)===A[0]?(w.fixCaret(x,x),!0):F+A.length===H.length?(w.fixCaret(F,F),!0):!1},w.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(H,F){var x=A.substring(F);return w.restoreByAfter(x)})},w.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(A,H,F){w.pressingUpOrDown=!0,w.step("down",A,H,F)},w.up=function(A,H,F){w.pressingUpOrDown=!0,w.step("up",A,H,F)},w.saveInput=function(A){w.input=A};var j=g.value;j===void 0&&(j=g.defaultValue),w.state={focused:g.autoFocus};var B=w.getValidValue(w.toNumber(j));return w.state=l(l({},w.state),{},{inputValue:w.toPrecisionAsStep(B),value:B}),w}return Object(G.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var j=this.props,B=j.value,A=j.onChange,H=j.max,F=j.min,x=this.state.focused;if(w){if(!R(w.value,B)||!R(w.max,H)||!R(w.min,F)){var Y=x?B:this.getValidValue(B),q;this.pressingUpOrDown?q=Y:this.inputting?q=this.rawInput:q=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:q})}var ie="value"in this.props?B:this.state.value;"max"in this.props&&w.max!==H&&typeof ie=="number"&&ie>H&&A&&A(H),"min"in this.props&&w.min!==F&&typeof ie=="number"&&ie<F&&A&&A(F)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var me=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?me=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(me=this.cursorStart):me=this.input.value.length,this.fixCaret(me,me)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch($e){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(w){var j=w;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(w){var j=w.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(w);return isNaN(A)?w:(A<j&&(A=j),A>B&&(A=B),A)}},{key:"setValue",value:function(w,j){var B=this.props.precision,A=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),H=this.state.value,F=H===void 0?null:H,x=this.state.inputValue,Y=x===void 0?null:x,q=typeof A=="number"?A.toFixed(B):"".concat(A),ie=A!==F||q!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},j)):this.setState({value:A,inputValue:this.toPrecisionAsStep(w)},j),ie&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,A=B.precision,H=B.step;if(C(A))return A;var F=this.getPrecision(j),x=this.getPrecision(H),Y=this.getPrecision(w);return w?Math.max(Y,F+x):F+x}},{key:"getPrecisionFactor",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(w,j);return Math.pow(10,B)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var j=Math.abs(this.getMaxPrecision(w));return isNaN(j)?w.toString():Number(w).toFixed(j)}},{key:"toNumber",value:function(w){var j=this.props.precision,B=this.state.focused,A=w&&w.length>16&&B;return this.isNotCompleteNumber(w)||A?w:C(j)?Math.round(w*Math.pow(10,j))/Math.pow(10,j):Number(w)}},{key:"upStep",value:function(w,j){var B=this.props.step,A=this.getPrecisionFactor(w,j),H=Math.abs(this.getMaxPrecision(w,j)),F=((A*w+A*B*j)/A).toFixed(H);return this.toNumber(F)}},{key:"downStep",value:function(w,j){var B=this.props.step,A=this.getPrecisionFactor(w,j),H=Math.abs(this.getMaxPrecision(w,j)),F=((A*w-A*B*j)/A).toFixed(H);return this.toNumber(F)}},{key:"step",value:function(w,j){var B=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var F=this.props;if(F.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var Y=this["".concat(w,"Step")](x,A),q=Y>F.max||Y<F.min;if(Y>F.max?Y=F.max:Y<F.min&&(Y=F.min),this.setValue(Y,null),this.setState({focused:!0},function(){B.pressingUpOrDown=!1}),q)return;this.autoStepTimer=setTimeout(function(){B[w](j,A,!0)},H?n:O)}},{key:"fixCaret",value:function(w,j){if(w===void 0||j===void 0||!this.input||!this.input.value)return;try{var B=this.input.selectionStart,A=this.input.selectionEnd;(w!==B||j!==A)&&this.input.setSelectionRange(w,j)}catch(H){}}},{key:"render",value:function(){var w,j=this.props,B=j.prefixCls,A=j.disabled,H=j.readOnly,F=j.useTouch,x=j.autoComplete,Y=j.upHandler,q=j.downHandler,ie=j.className,me=j.max,$e=j.min,xe=j.style,Ie=j.title,Je=j.onMouseEnter,Ye=j.onMouseLeave,ve=j.onMouseOver,fe=j.onMouseOut,lt=j.required,qt=j.onClick,Ft=j.tabIndex,Ot=j.type,Ve=j.placeholder,vt=j.id,ht=j.inputMode,Bt=j.pattern,se=j.step,Ue=j.maxLength,Ge=j.autoFocus,et=j.name,Wt=j.onPaste,Yt=j.onInput,on=Object(Z.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),nt=this.state,tn=nt.value,Ln=nt.focused,We=b()(B,(w={},Object(V.a)(w,ie,!!ie),Object(V.a)(w,"".concat(B,"-disabled"),A),Object(V.a)(w,"".concat(B,"-focused"),Ln),w)),Fe={};Object.keys(on).forEach(function(_e){(_e.substr(0,5)==="data-"||_e.substr(0,5)==="aria-"||_e==="role")&&(Fe[_e]=on[_e])});var yt=!H&&!A,At=this.getInputDisplayValue(null),tt=(tn||tn===0)&&(isNaN(tn)||Number(tn)>=me),ot=(tn||tn===0)&&(isNaN(tn)||Number(tn)<=$e),De=tt||A||H,ye=ot||A||H,we=b()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object(V.a)({},"".concat(B,"-handler-up-disabled"),De)),ae=b()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object(V.a)({},"".concat(B,"-handler-down-disabled"),ye)),oe=F?{onTouchStart:De?c:this.up,onTouchEnd:this.stop}:{onMouseDown:De?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},pe=F?{onTouchStart:ye?c:this.down,onTouchEnd:this.stop}:{onMouseDown:ye?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:We,style:xe,title:Ie,onMouseEnter:Je,onMouseLeave:Ye,onMouseOver:ve,onMouseOut:fe,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(B,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Increase Value","aria-disabled":De,className:we}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:s})),r.a.createElement("span",Object.assign({unselectable:"on"},pe,{role:"button","aria-label":"Decrease Value","aria-disabled":ye,className:ae}),q||r.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:s}))),r.a.createElement("div",{className:"".concat(B,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":$e,"aria-valuemax":me,"aria-valuenow":tn,required:lt,type:Ot,placeholder:Ve,onPaste:Wt,onClick:qt,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:Ft,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:yt?this.onKeyDown:c,onKeyUp:yt?this.onKeyUp:c,autoFocus:Ge,maxLength:Ue,readOnly:H,disabled:A,max:me,min:$e,step:se,name:et,title:Ie,id:vt,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(At),pattern:Bt,inputMode:ht,onInput:Yt},Fe))))}}]),_}(r.a.Component);S.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:i,required:!1,autoComplete:"off"};var v=S,E=he.a=v},eozf:function(Kt,he,D){"use strict";D.d(he,"b",function(){return Ye}),D.d(he,"c",function(){return ve});var Z=D("sRBo"),V=D("kaz8"),U=D("5Dmo"),G=D("3S7+"),P=D("/zsF"),I=D("PArb"),K=D("7Kak"),k=D("9yH6"),r=D("14J3"),M=D("BMrR"),b=D("+L6B"),f=D("2/Rp"),m=D("jCWc"),l=D("kPKH"),o=D("2qtc"),a=D("kLXV"),c=D("9og8"),s=D("miYZ"),i=D("tsqr"),n=D("oBTY"),O=D("k1fw"),T=D("tJVT"),C=D("OaEy"),R=D("2fM7"),S=D("iQDF"),v=D("+eQT"),E=D("WmNS"),h=D.n(E),p=D("q1tI"),_=D.n(p),g=D("/MfK"),w=D("w5pM"),j=D("Lyp1"),B=D("wd/R"),A=D.n(B),H=D("xKgJ"),F=D("ErOA"),x=D("LvDl"),Y=D.n(x),q=D("1vsH"),ie=D("zetH"),me=D.n(ie),$e=D("Ty5D"),xe=D("9kvl"),Ie=D("AHFd");function Je(Ft,Ot){for(var Ve=[],vt=Ft;vt<Ot;vt++)Ve.push(vt);return Ve}var Ye=function(Ot,Ve,vt){var ht=Ot<A()().startOf("day"),Bt=Ot>A()(Ve).endOf("day"),se=Ot<A()(vt).startOf("day");return Ve?vt?A()()<=A()(vt)?se||Bt:ht||Bt:Ot&&ht||Bt:vt&&A()()<=A()(vt)?se:ht},ve=function(Ot,Ve){var vt=parseInt(A()(Ot).format("HH")),ht=parseInt(A()().format("HH")),Bt=parseInt(A()().format("mm"));if(!Ot)return{disabledHours:function(){return Je(0,ht)},disabledMinutes:function(){return Je(0,Bt)}};if(Ve){var se=parseInt(A()(Ve).format("HH")),Ue=parseInt(A()(Ve).format("mm"));return A()(Ot).isSame(A()(Ve),"day")?{disabledHours:function(){return Je(0,se)},disabledMinutes:function(){return vt<=se?Je(0,Ue):[]}}:void 0}return A()(Ot).isSame(A()(),"day")?{disabledHours:function(){return Je(0,ht)},disabledMinutes:function(){return A()(Ot).isSame(A()(),"hour")&&vt<=ht?Je(0,Bt):[]}}:void 0},fe=v.a.RangePicker,lt=R.a.Option,qt=function(Ot){var Ve,vt,ht,Bt,se,Ue,Ge,et=Ot.shixunHomeworks,Wt=Ot.loading,Yt=Ot.dispatch,on=Object($e.i)(),nt=et.workSetting,tn=et.workList,Ln=et.changeData,We=Object(p.useState)(!0),Fe=Object(T.a)(We,2),yt=Fe[0],At=Fe[1],tt=Object(p.useState)(!1),ot=Object(T.a)(tt,2),De=ot[0],ye=ot[1],we=Object(p.useState)([]),ae=Object(T.a)(we,2),oe=ae[0],pe=ae[1],_e=Object(p.useState)([]),be=Object(T.a)(_e,2),Ke=be[0],St=be[1],nn=Object(p.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:Ie.a.Percent,challenge_settings:[],work_efficiency:!1,shixun_evaluation:"",answer_open_evaluation:!1,answer_public:!1,score_open:!1,comment_public:!0,total_score:"",eff_score:0}),An=Object(T.a)(nn,2),bt=An[0],Jt=An[1];Object(p.useEffect)(function(){return Et(),function(){pe([].concat())}},[]);var Et=function(){Yt({type:"shixunHomeworks/getWorkSetting",payload:Object(O.a)({},on)})};Object(p.useEffect)(function(){var Le;if(!(nt!=null&&nt.course_id))return;Object.keys(bt).map(function(qe){bt[qe]=nt[qe]}),(!bt.allow_late||!bt.unified_late)&&(bt.late_penalty=20,bt.penalty_type=Ie.a.Percent),bt.unified_setting||(bt.unified_late=!1,bt.unified_anonymous_comment=!1,bt.unified_anonymous_appeal=!1),oe=JSON.parse(JSON.stringify(nt.group_settings.map(function(qe){return Object(O.a)(Object(O.a)({},qe),{},{group_name:[qe.group_name]})}).filter(function(qe){return qe.publish_time!==null}))),Ke=JSON.parse(JSON.stringify(nt.allow_late_settings.map(function(qe){return Object(O.a)(Object(O.a)({},qe),{},{group_name:[qe.group_name]})}).filter(function(qe){return qe.late_time!==null}))),Jt(Object(O.a)({},bt)),pe(Object(n.a)(oe)),((Le=Ke)===null||Le===void 0?void 0:Le.length)<=0?St([{penalty_type:Ie.a.Percent,late_penalty:20}]):St(Object(n.a)(Ke))},[nt]);var Ct=function(){var qe,mt,jt=JSON.parse(JSON.stringify(bt));if(jt.challenge_settings.filter(function(yn){return!yn.hide}),jt.categoryId=on.categoryId,(qe=jt.challenge_settings)!==null&&qe!==void 0&&qe.every(function(yn){return!yn.checked})){i.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(bt.unified_setting||(oe=(mt=oe)===null||mt===void 0?void 0:mt.map(function(yn){var nr;if(!yn.publish_time||!yn.end_time)throw i.b.error("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u53D1\u5E03\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!yn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return yn.group_name=typeof(yn==null?void 0:yn.group_name)=="string"?[yn==null?void 0:yn.group_name]:yn==null?void 0:yn.group_name,yn.group_id=(nr=nt.group_settings)===null||nr===void 0?void 0:nr.filter(function(Kn){var wn;return yn==null||((wn=yn.group_name)===null||wn===void 0)?void 0:wn.includes(Kn.group_name)}).map(function(Kn){return Kn.group_id||Kn.id}).toString().split(","),yn})),jt.group_settings=oe,bt.allow_late)if(bt.unified_late){if(bt.late_penalty===null||bt.late_penalty===void 0||bt.late_penalty<0||bt.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!bt.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574")}else{var sn;Ke=(sn=Ke)===null||sn===void 0?void 0:sn.map(function(yn){var nr,Kn;if(yn.late_penalty===null||yn.late_penalty===void 0||yn.late_penalty<0||yn.late_penalty>100)throw i.b.error("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100"),new String("\u8FDF\u4EA4\u6263\u5206\u586B\u5199\u533A\u95F4\u4E3A0~100");if(!yn.late_time)throw i.b.error("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574"),new String("\u8BF7\u628A\u622A\u6B62\u65F6\u95F4\u586B\u5199\u5B8C\u6574");if(!yn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return yn.group_name=typeof(yn==null?void 0:yn.group_name)=="string"?[yn==null?void 0:yn.group_name]:yn==null?void 0:yn.group_name,yn.group_id=yn==null||((nr=yn.group_name)===null||nr===void 0||((Kn=nr.map(function(wn){var br,Er,rr=(br=nt.group_settings)===null||br===void 0||((Er=br.filter(function(cr){return(cr==null?void 0:cr.group_name)===wn}))===null||Er===void 0)?void 0:Er[0];return rr==null?void 0:rr.group_id}))===null||Kn===void 0))?void 0:Kn.toString().split(","),yn}),jt.allow_late_settings=Ke}st(jt)},st=function(qe){var mt,jt;if(qe.total_score===null){i.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(qe!=null&&qe.work_efficiency&&qe.eff_score===null){i.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var sn=qe.challenge_settings.reduce(function(Kn,wn){return Kn+Number(wn.challenge_score)},0);if((sn==null?void 0:sn.toFixed(10))!==((mt=qe.total_score-qe.eff_score)===null||mt===void 0?void 0:mt.toFixed(10))){i.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(qe.total_score,"\u5206"));return}var yn={shixun_evaluation:qe.shixun_evaluation,challenge_settings:qe.challenge_settings},nr=function(){var Kn=Object(c.a)(h.a.mark(function wn(){var br;return h.a.wrap(function(rr){for(;;)switch(rr.prev=rr.next){case 0:return ye(!0),rr.next=3,Object(F.a)("/api/homework_commons/".concat(on.categoryId,"/publish_setting.json"),{method:"post",body:Object(O.a)({},qe)});case 3:br=rr.sent,br.status===0&&(i.b.success("\u66F4\u65B0\u6210\u529F"),At(!0),Et(),Yt({type:"shixunHomeworks/getWorkList",payload:Object(O.a)({},on)})),ye(!1);case 6:case"end":return rr.stop()}},wn)}));return function(){return Kn.apply(this,arguments)}}();!Object(x.isEqual)(Ln,yn)&&!(tn!=null&&(jt=tn.homework_status)!==null&&jt!==void 0&&jt.includes("\u672A\u53D1\u5E03"))?a.a.confirm({title:"\u66F4\u65B0\u6210\u7EE9",content:"\u60A8\u6539\u52A8\u4E86\u672C\u6B21\u4F5C\u4E1A\u7684\u5173\u5361\u5F97\u5206\u8BBE\u7F6E\uFF0C\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5DF2\u5B8C\u6210\u4F5C\u4E1A\u7684\u5B66\u751F\u7684\u6210\u7EE9\u4EA7\u751F\u9519\u8BEF\u3002\u70B9\u51FB\u201C\u786E\u5B9A\u201D\u6309\u94AE\u5C06\u4FDD\u5B58\u6700\u65B0\u8BBE\u7F6E\u5E76\u6309\u6700\u65B0\u8BBE\u7F6E\u66F4\u65B0\u5168\u73ED\u6210\u7EE9\u3002",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:nr}):nr()},de=function(qe,mt){var jt,sn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return mt?mt.find(function(yn){return yn[sn]===qe}):nt==null||((jt=nt.group_settings)===null||jt===void 0)?void 0:jt.find(function(yn){return yn.group_id[0]===qe})},Ae=(nt==null?void 0:nt.allow_late)||(nt==null?void 0:nt.anonymous_comment),kt=function(qe){var mt=de(qe,nt==null?void 0:nt.allow_late_settings,"id"),jt=de(qe,nt==null?void 0:nt.anonymous_comment_settings);return(nt==null?void 0:nt.allow_late)&&mt&&(mt==null?void 0:mt.late_time)!==null||(nt==null?void 0:nt.anonymous_comment)&&jt&&(jt==null?void 0:jt.evaluation_start)!==null},ct=Object(p.useMemo)(function(){var Le;if(nt!=null&&nt.unified_setting){var qe;return!(tn!=null&&(qe=tn.homework_status)!==null&&qe!==void 0&&qe.includes("\u5DF2\u622A\u6B62"))||(nt==null?void 0:nt.allow_late)||(nt==null?void 0:nt.anonymous_comment)}var mt=nt==null||((Le=nt.group_settings)===null||Le===void 0)?void 0:Le.some(function(jt){return A()(jt.end_time)<=A()()});return!mt||(nt==null?void 0:nt.allow_late)||(nt==null?void 0:nt.all_group_late)},[nt,tn]),Qt=nt==null?void 0:nt.anonymous_comment,un=function(qe){if(!qe)return!1;var mt=de(qe,nt==null?void 0:nt.anonymous_comment_settings);return(nt==null?void 0:nt.anonymous_comment)&&mt&&(mt==null?void 0:mt.evaluation_start)!==null};return _.a.createElement("section",{className:[me.a.form," bg-white pl30 pr30 pt10"].join(" ")},_.a.createElement(M.a,null,_.a.createElement(l.a,{span:24},_.a.createElement(M.a,{align:"middle"},_.a.createElement(l.a,{flex:"1"}),_.a.createElement(l.a,null,Object(H.c)()&&yt&&_.a.createElement(f.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return At(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),_.a.createElement("div",null,_.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",_.a.createElement(k.a.Group,{disabled:yt||!(tn!=null&&(Ve=tn.homework_status)!==null&&Ve!==void 0&&Ve.includes("\u672A\u53D1\u5E03")),value:bt.unified_setting,onChange:function(qe){var mt;if(!(tn!=null&&(mt=tn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))){i.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(bt.unified_setting=!bt.unified_setting,bt.unified_setting||(bt.unified_late=!1),Jt(Object.assign({},bt)),bt.unified_setting===!1&&oe==""){pe(oe.concat({}));return}bt.unified_setting&&(pe([]),St([{late_penalty:5}]))}},_.a.createElement(k.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),_.a.createElement(k.a,{disabled:(nt==null||((vt=nt.group_settings)===null||vt===void 0)?void 0:vt.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(nt==null||((ht=nt.group_settings)===null||ht===void 0)?void 0:ht.length)===0&&_.a.createElement("p",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"}},"\uFF08\u672C\u8BFE\u5802\u65E0\u5206\u73ED\uFF0C\u4EC5\u652F\u6301\u9009\u62E9\u201C\u7EDF\u4E00\u53D1\u5E03\u201C\uFF09"))),bt.unified_setting&&_.a.createElement("div",null,_.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(l.a,null,"\u53D1\u5E03\u65F6\u95F4:"),_.a.createElement(l.a,{className:"ml5"},_.a.createElement(v.a,{disabled:yt||!(tn!=null&&(Bt=tn.homework_status)!==null&&Bt!==void 0&&Bt.includes("\u672A\u53D1\u5E03")||tn!=null&&(se=tn.homework_status)!==null&&se!==void 0&&se.includes("\u672A\u5F00\u59CB")),style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm"},allowClear:!1,format:"YYYY-MM-DD HH:mm",disabledDate:function(qe){return Ye(qe,nt==null?void 0:nt.course_end_date)},disabledTime:function(qe){return ve(qe)},value:bt.publish_time?A()(bt.publish_time):"",onChange:function(qe,mt){bt.publish_time=mt,(bt.end_time==""||!bt.end_time)&&bt.unified_setting&&(bt.end_time=A()(qe).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Jt(Object.assign({},bt))}})),_.a.createElement(l.a,null,_.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),_.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(l.a,null,"\u622A\u6B62\u65F6\u95F4:"),_.a.createElement(l.a,{className:"ml5"},_.a.createElement(v.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(q.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:yt||Ae,disabledDate:function(qe){return Ye(qe,nt==null?void 0:nt.course_end_date,bt.publish_time)},disabledTime:function(qe){return ve(qe,bt.publish_time)},value:bt.end_time?A()(bt.end_time):"",onChange:function(qe,mt){bt.end_time=mt,Jt(Object.assign({},bt))}})),_.a.createElement(l.a,null,_.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))),!bt.unified_setting&&((Ue=oe)===null||Ue===void 0?void 0:Ue.length)>0&&_.a.createElement(M.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},_.a.createElement(l.a,{span:24},_.a.createElement(M.a,null,_.a.createElement(l.a,{span:10}),_.a.createElement(l.a,{span:10},_.a.createElement(M.a,{className:"c-grey-c ml30"},_.a.createElement(l.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),_.a.createElement(l.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),_.a.createElement(l.a,{span:4}))),oe&&oe.map(function(Le,qe){var mt,jt,sn,yn,nr;return _.a.createElement(l.a,{span:24,key:qe},_.a.createElement(M.a,{gutter:[8,16]},_.a.createElement(l.a,{span:10},_.a.createElement(M.a,{gutter:[8,16]},_.a.createElement(l.a,null,"\u53D1\u5E03\u89C4\u5219 ",qe+1),_.a.createElement(l.a,{flex:"1",style:{maxWidth:300}},_.a.createElement(R.a,{disabled:yt||!(tn!=null&&(mt=tn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))&&Le.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Le.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(wn){oe[qe].group_name=wn,oe[qe].group_id=Le.group_id;var br=Object(x.flattenDeep)(oe.map(function(rr){return rr.group_name})),Er=Ke.map(function(rr){var cr=(rr==null?void 0:rr.group_name)||[];return Object(O.a)(Object(O.a)({},rr),{},{group_name:Object(x.remove)(cr,function(Pr){return br.includes(Pr)})})});St(Er),pe(oe.slice())}},nt.group_settings&&nt.group_settings.map(function(Kn){var wn=oe.map(function(br){return br.group_name}).flat();if(!wn.includes(Kn.group_name))return _.a.createElement(lt,{value:Kn.group_name,key:Kn.id},Kn.group_name)}))))),_.a.createElement(l.a,{span:10},_.a.createElement("div",{className:"ml30"},_.a.createElement(fe,{ranges:{\u6B64\u523B:[Le.publish_time?A()(Le.publish_time):A()(),A()()]},allowClear:!1,disabled:yt||(A()()<=A()((jt=de((sn=Le.group_id)===null||sn===void 0?void 0:sn[0]))===null||jt===void 0?void 0:jt.publish_time)?!1:[!0,kt((yn=Le.group_id)===null||yn===void 0?void 0:yn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(wn){return Ye(wn,nt==null?void 0:nt.course_end_date)},disabledTime:function(wn){return ve(wn)},showTime:{showNow:!0,format:"HH:mm",defaultValue:[A()(Object(q.d)(),"HH:mm"),A()(Object(q.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Le.publish_time&&[A()(Le.publish_time),Le.end_time?A()(Le.end_time):void 0],onChange:function(wn,br){oe[qe].publish_time=br[0],oe[qe].end_time=br[1],pe(Object(n.a)(oe))}}))),!yt&&_.a.createElement(l.a,{span:4},qe>0&&!Le.id&&_.a.createElement(g.a,{onClick:function(){oe=oe.filter(function(wn,br){return qe!==br}),pe(oe.slice()),setTimeout(function(){return pe(oe.slice())},10)}}),oe.length<(nt==null||((nr=nt.group_settings)===null||nr===void 0)?void 0:nr.length)&&_.a.createElement(w.a,{className:"c-green ml20",onClick:function(){pe(oe.concat({}))}}))))})),_.a.createElement(I.a,null),_.a.createElement(M.a,null,_.a.createElement(l.a,null,_.a.createElement("strong",null,"\u8865\u4EA4\u8BBE\u7F6E"),_.a.createElement(G.a,{placement:"right",title:"\u4F5C\u4E1A\u622A\u6B62\u540E\u624D\u53EF\u5F00\u542F\u8865\u4EA4\uFF0C\u5F00\u542F\u8865\u4EA4\u540E\u4E0D\u53EF\u53D8\u66F4\u4F5C\u4E1A\u622A\u6B62\u65F6\u95F4\u3002"},_.a.createElement(j.a,{style:{marginLeft:4,cursor:"pointer"}}))),_.a.createElement(l.a,{span:24,className:"mt15 pl30"},_.a.createElement(V.a,{checked:bt.allow_late,disabled:yt||ct,onChange:function(){bt.allow_late=!bt.allow_late,Ke==""&&St([{late_penalty:5}]),Jt(Object.assign({},bt))}},_.a.createElement("strong",null,"\u5F00\u542F\u8865\u4EA4")),_.a.createElement(G.a,{overlayStyle:{width:380,maxWidth:380},title:_.a.createElement("div",{style:{display:"flex",flexFlow:"column"}},_.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219\u8BF4\u660E"),_.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4\uFF0C\u5B66\u751F\u53EA\u5728\u8865\u4EA4\u65F6\u95F4\u5185\u624D\u901A\u5173\u5219\u6263\u9664\u5206\u503C\uFF0C\u672A\u901A\u5173\u4E0D\u6263\u5206\uFF1B"),_.a.createElement("span",null,"\u5B66\u751F\u5728\u6B63\u5E38\u4F5C\u4E1A\u89C4\u5B9A\u65F6\u95F4\u5185\u901A\u5173\uFF0C\u5728\u8865\u4EA4\u9636\u6BB5\u518D\u6B21\u901A\u5173\u4E0D\u6263\u5206\u3002"))},_.a.createElement(j.a,null)))),(bt==null?void 0:bt.allow_late)&&_.a.createElement("div",{style:{marginLeft:22}},_.a.createElement("div",{className:"ml30 mt20"},_.a.createElement("span",null,"\u8865\u4EA4\u65B9\u5F0F\uFF1A"),_.a.createElement(k.a.Group,{disabled:yt||(nt==null?void 0:nt.anonymous_comment)||(nt==null?void 0:nt.allow_late),value:bt.unified_late,onChange:function(qe){bt.unified_late=qe.target.value,Ke==""&&!qe.target.value&&St([{penalty_type:Ie.a.Percent,late_penalty:20}]),Jt(Object(O.a)({},bt))}},(bt==null?void 0:bt.unified_setting)&&_.a.createElement(k.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(nt==null||((Ge=nt.group_settings)===null||Ge===void 0)?void 0:Ge.length)>0&&_.a.createElement(k.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),bt!=null&&bt.unified_late?_.a.createElement(_.a.Fragment,null,_.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(l.a,null,"\u8865\u4EA4\u6263\u5206:"),_.a.createElement(l.a,{className:"ml5"},_.a.createElement(Ie.b,{disabled:yt||Qt,value:{type:bt.penalty_type,inputValue:bt.late_penalty},onChange:function(qe){Jt(Object(O.a)(Object(O.a)({},bt),{},{late_penalty:qe.inputValue,penalty_type:qe.type}))}})),_.a.createElement(l.a,{flex:"1",className:"ml5"},_.a.createElement("span",{className:"c-grey-c ml10"},bt.penalty_type===Ie.a.Number?"(\u8865\u4EA4\u65F6\u6309\u7167\u5B66\u751F\u603B\u6210\u7EE9\u6263\u5206)":"(\u5B66\u751F\u6210\u7EE9\u5C06\u6263\u9664\u8865\u4EA4\u5173\u5361\u5206\u503C\u7684\u767E\u5206\u6BD4)"))),_.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(l.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),_.a.createElement(l.a,{className:"ml5"},_.a.createElement(v.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:A()(Object(q.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:yt||Qt,value:bt.late_time?A()(bt.late_time):"",disabledDate:function(qe){return Ye(qe,nt==null?void 0:nt.course_end_date)},onChange:function(qe,mt){bt.late_time=mt,Jt(Object.assign({},bt))}})),_.a.createElement(l.a,null,_.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u201C\u5EF6\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u7684\u65F6\u95F4\u622A\u70B9)")))):Ke.map(function(Le,qe){var mt;return _.a.createElement(l.a,{span:24,key:qe},_.a.createElement(M.a,{className:"mt25"},_.a.createElement(l.a,{style:{marginLeft:30}},_.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",qe+1,"\uFF1A"),_.a.createElement(R.a,{disabled:yt||!(tn!=null&&(mt=tn.homework_status)!==null&&mt!==void 0&&mt.includes("\u672A\u53D1\u5E03"))&&Le.id||(nt==null?void 0:nt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Le.group_name=="string"?[Le.group_name]:Le.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(sn){Ke[qe].group_name=sn,Ke[qe].group_id=Le.group_id,St(Ke.slice())}},nt.group_settings&&nt.group_settings.map(function(jt){var sn=Ke.map(function(nr){return nr.group_name}).flat(),yn=oe.map(function(nr){return nr.group_name}).flat();if(bt!=null&&bt.unified_setting){if(!sn.includes(jt.group_name))return _.a.createElement(lt,{value:jt.group_name,key:jt.id},jt.group_name)}else if(yn.includes(jt.group_name)&&(!sn.includes(jt.group_name)&&A()(jt.end_time)<=A()()))return _.a.createElement(lt,{value:jt.group_name,key:jt.id},jt.group_name)}))),_.a.createElement(l.a,{className:"ml20"},_.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),_.a.createElement(Ie.b,{disabled:yt||un(Le.id),value:{type:Le.penalty_type,inputValue:Le.late_penalty},onChange:function(sn){Ke[qe].late_penalty=sn.inputValue,Ke[qe].penalty_type=sn.type,St(Object(n.a)(Ke))}})),_.a.createElement(l.a,{className:"ml20"},_.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),_.a.createElement(v.a,{disabled:yt||un(Le.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:A()(Object(q.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(sn){return Ye(sn,nt==null?void 0:nt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Le!=null&&Le.late_time?A()(Le.late_time):void 0,onChange:function(sn,yn){Ke[qe].late_time=yn,St(Object(n.a)(Ke))}})),!yt&&_.a.createElement(l.a,{className:"ml20"},qe>0&&!Le.id&&_.a.createElement(g.a,{onClick:function(){Ke=Ke.filter(function(sn,yn){return qe!==yn}),St(Ke.slice()),setTimeout(function(){return St(Ke.slice())},10)}}),_.a.createElement(w.a,{className:"c-green ml20",onClick:function(){St(Ke.concat({penalty_type:Ie.a.Percent,late_minus_score:20}))}}))))})),_.a.createElement(I.a,null),!yt&&_.a.createElement(l.a,{className:"mb50"},_.a.createElement(f.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:De,onClick:function(){return Ct()}},"\u63D0\u4EA4"),_.a.createElement(f.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){At(!0),Et()}},"\u53D6\u6D88")))};he.a=Object(xe.a)(function(Ft){var Ot=Ft.shixunHomeworks,Ve=Ft.loading;return{shixunHomeworks:Ot,loading:Ve.effects}})(qt)},fjLI:function(Kt,he,D){"use strict";D.d(he,"f",function(){return m}),D.d(he,"b",function(){return l}),D.d(he,"a",function(){return o}),D.d(he,"d",function(){return a}),D.d(he,"e",function(){return c}),D.d(he,"c",function(){return s});var Z=D("8HAY"),V=D("Vhoy"),U=D("MI8n"),G=D("JYp7"),P=D("pmY6"),I=D("24hK"),K=D("nnTU"),k=D("T8No"),r=D("Cg/j"),M=D("t9D7"),b=function(i,n,O,T){var C=arguments.length,R=C<3?n:T===null?T=Object.getOwnPropertyDescriptor(n,O):T,S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(i,n,O,T);else for(var v=i.length-1;v>=0;v--)(S=i[v])&&(R=(C<3?S(R):C>3?S(n,O,R):S(n,O))||R);return C>3&&R&&Object.defineProperty(n,O,R),R},f=function(i,n){return function(O,T){n(O,T,i)}};function m(i){return i.command!==void 0}class l{constructor(i){this.id=l._idPool++,this._debugName=i}}l._idPool=0,l.CommandPalette=new l("CommandPalette"),l.EditorContext=new l("EditorContext"),l.SimpleEditorContext=new l("SimpleEditorContext"),l.EditorContextCopy=new l("EditorContextCopy"),l.EditorContextPeek=new l("EditorContextPeek"),l.MenubarEditMenu=new l("MenubarEditMenu"),l.MenubarCopy=new l("MenubarCopy"),l.MenubarGoMenu=new l("MenubarGoMenu"),l.MenubarSelectionMenu=new l("MenubarSelectionMenu"),l.InlineCompletionsActions=new l("InlineCompletionsActions");const o=Object(r.c)("menuService"),a=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new U.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===l.CommandPalette}}addCommand(i){return this.addCommands(G.a.single(i))}addCommands(i){for(const n of i)this._commands.set(n.id,n);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(P.i)(()=>{let n=!1;for(const O of i)n=this._commands.delete(O.id)||n;n&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((n,O)=>i.set(O,n)),i}appendMenuItem(i,n){return this.appendMenuItems(G.a.single({id:i,item:n}))}appendMenuItems(i){const n=new Set,O=new I.a;for(const{id:T,item:C}of i){let R=this._menuItems.get(T);R||(R=new I.a,this._menuItems.set(T,R)),O.push(R.push(C)),n.add(T)}return this._onDidChangeMenu.fire(n),Object(P.i)(()=>{if(O.size>0){for(let T of O)T();this._onDidChangeMenu.fire(n),O.clear()}})}getMenuItems(i){let n;return this._menuItems.has(i)?n=[...this._menuItems.get(i)]:n=[],i===l.CommandPalette&&this._appendImplicitItems(n),n}_appendImplicitItems(i){const n=new Set;for(const O of i)m(O)&&(n.add(O.command.id),O.alt&&n.add(O.alt.id));this._commands.forEach((O,T)=>{n.has(T)||i.push({command:O})})}};class c extends Z.e{constructor(i,n,O,T){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=n,this._contextKeyService=O,this._options=T}get actions(){const i=[],n=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=n.getActions(this._options);n.dispose();for(const[,T]of O)T.length>0&&(i.push(...T),i.push(new Z.d));return i.length&&i.pop(),i}}let s=class i{constructor(n,O,T,C,R){var S,v;if(this._commandService=R,this.id=n.id,this.label=(T==null?void 0:T.renderShortTitle)&&n.shortTitle?typeof n.shortTitle=="string"?n.shortTitle:n.shortTitle.value:typeof n.title=="string"?n.title:n.title.value,this.tooltip=(v=typeof n.tooltip=="string"?n.tooltip:(S=n.tooltip)===null||S===void 0?void 0:S.value)!==null&&v!==void 0?v:"",this.enabled=!n.precondition||C.contextMatchesRules(n.precondition),this.checked=void 0,n.toggled){const E=n.toggled.condition?n.toggled:{condition:n.toggled};this.checked=C.contextMatchesRules(E.condition),this.checked&&E.tooltip&&(this.tooltip=typeof E.tooltip=="string"?E.tooltip:E.tooltip.value),E.title&&(this.label=typeof E.title=="string"?E.title:E.title.value)}this.item=n,this.alt=O?new i(O,void 0,T,C,R):void 0,this._options=T,M.d.isThemeIcon(n.icon)&&(this.class=V.a.asClassName(n.icon))}dispose(){}run(...n){var O,T;let C=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(C=[...C,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(C=[...C,...n]),this._commandService.executeCommand(this.id,...C)}};s=b([f(3,k.b),f(4,K.b)],s)},fyJ8:function(Kt,he,D){"use strict";var Z=D("rePB"),V=D("VTBJ"),U=D("Ff2n"),G=D("U8pU"),P=D("q1tI"),I=D.n(P),K=D("TSYQ"),k=D.n(K),r=D("c+Xe"),M=D("sR1s");function b(a){return a&&Object(G.a)(a)==="object"&&!Array.isArray(a)&&!P.isValidElement(a)}function f(a){return typeof a=="string"?!0:Object(r.c)(a)}function m(a,c){var s,i=a.prefixCls,n=a.className,O=a.record,T=a.index,C=a.dataIndex,R=a.render,S=a.children,v=a.component,E=v===void 0?"td":v,h=a.colSpan,p=a.rowSpan,_=a.fixLeft,g=a.fixRight,w=a.firstFixLeft,j=a.lastFixLeft,B=a.firstFixRight,A=a.lastFixRight,H=a.appendNode,F=a.additionalProps,x=F===void 0?{}:F,Y=a.ellipsis,q=a.align,ie=a.rowType,me=a.isSticky,$e="".concat(i,"-cell"),xe,Ie;if(S)Ie=S;else{var Je=Object(M.b)(O,C);if(Ie=Je,R){var Ye=R(Je,O,T);b(Ye)?(Ie=Ye.children,xe=Ye.props):Ie=Ye}}Object(G.a)(Ie)==="object"&&!Array.isArray(Ie)&&!P.isValidElement(Ie)&&(Ie=null),Y&&(j||B)&&(Ie=P.createElement("span",{className:"".concat($e,"-content")},Ie));var ve=xe||{},fe=ve.colSpan,lt=ve.rowSpan,qt=ve.style,Ft=ve.className,Ot=Object(U.a)(ve,["colSpan","rowSpan","style","className"]),Ve=fe!==void 0?fe:h,vt=lt!==void 0?lt:p;if(Ve===0||vt===0)return null;var ht={},Bt=typeof _=="number",se=typeof g=="number";Bt&&(ht.position="sticky",ht.left=_),se&&(ht.position="sticky",ht.right=g);var Ue={};q&&(Ue.textAlign=q);var Ge,et=Y===!0?{showTitle:!0}:Y;et&&(et.showTitle||ie==="header")&&(typeof Ie=="string"||typeof Ie=="number"?Ge=Ie.toString():P.isValidElement(Ie)&&typeof Ie.props.children=="string"&&(Ge=Ie.props.children));var Wt=Object(V.a)(Object(V.a)(Object(V.a)({title:Ge},Ot),x),{},{colSpan:Ve&&Ve!==1?Ve:null,rowSpan:vt&&vt!==1?vt:null,className:k()($e,n,(s={},Object(Z.a)(s,"".concat($e,"-fix-left"),Bt),Object(Z.a)(s,"".concat($e,"-fix-left-first"),w),Object(Z.a)(s,"".concat($e,"-fix-left-last"),j),Object(Z.a)(s,"".concat($e,"-fix-right"),se),Object(Z.a)(s,"".concat($e,"-fix-right-first"),B),Object(Z.a)(s,"".concat($e,"-fix-right-last"),A),Object(Z.a)(s,"".concat($e,"-ellipsis"),Y),Object(Z.a)(s,"".concat($e,"-with-append"),H),Object(Z.a)(s,"".concat($e,"-fix-sticky"),(Bt||se)&&me),s),x.className,Ft),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},x.style),Ue),ht),qt),ref:f(E)?c:null});return P.createElement(E,Object.assign({},Wt),H,Ie)}var l=P.forwardRef(m);l.displayName="Cell";var o=P.memo(l,function(a,c){return c.shouldCellUpdate?!c.shouldCellUpdate(c.record,a.record):!1});he.a=o},hW8S:function(Kt,he,D){"use strict";D.d(he,"a",function(){return G}),D.d(he,"c",function(){return P}),D.d(he,"b",function(){return I});var Z=D("VTBJ"),V=D("Ff2n"),U=D("Kwbf"),G="RC_TABLE_INTERNAL_COL_DEFINE";function P(K){var k=K.expandable,r=Object(V.a)(K,["expandable"]);return"expandable"in K?Object(Z.a)(Object(Z.a)({},r),k):r}function I(K){return Object.keys(K).reduce(function(k,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(k[r]=K[r]),k},{})}},iF7n:function(Kt,he,D){Kt.exports={flex_box_center:"flex_box_center___1Hyu4",flex_space_between:"flex_space_between___3ssyf",flex_box_vertical_center:"flex_box_vertical_center___1Gkv-",flex_box_center_end:"flex_box_center_end___1fs_5",flex_box_column:"flex_box_column___3KImt",top:"top___FkMRG",desc:"desc___zZgSM",liked:"liked___1eBGI",likedActive:"likedActive___1i_lJ",reply:"reply___1mww8",replyList:"replyList___3NmMj",comment:"comment___1kF3h"}},ic2d:function(Kt,he,D){"use strict";D.d(he,"a",function(){return G});var Z=D("FWmy"),V=D("746U");class U{constructor(){this.data=new Map}add(P,I){Z.a(V.l(P)),Z.a(V.k(I)),Z.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,I)}as(P){return this.data.get(P)||null}}const G=new U},k3GJ:function(Kt,he,D){"use strict";D.d(he,"a",function(){return mr});var Z=D("rePB"),V=D("ODXe"),U=D("Ff2n"),G=D("VTBJ"),P=D("q1tI"),I=D("TSYQ"),K=D.n(I),k=D("Zm9Q"),r=D("6cGi"),M=D("KQm4"),b=D("xEkU"),f=D.n(b),m=D("t23M");function l(Ee){var Ne=Object(P.useRef)(),ze=Object(P.useRef)(!1);function Se(){for(var re=arguments.length,ge=new Array(re),ue=0;ue<re;ue++)ge[ue]=arguments[ue];ze.current||(f.a.cancel(Ne.current),Ne.current=f()(function(){Ee.apply(void 0,ge)}))}return Object(P.useEffect)(function(){return function(){ze.current=!0,f.a.cancel(Ne.current)}},[]),Se}function o(Ee){var Ne=Object(P.useRef)([]),ze=Object(P.useState)({}),Se=Object(V.a)(ze,2),re=Se[1],ge=Object(P.useRef)(typeof Ee=="function"?Ee():Ee),ue=l(function(){var Pe=ge.current;Ne.current.forEach(function(Ze){Pe=Ze(Pe)}),Ne.current=[],ge.current=Pe,re({})});function Oe(Pe){Ne.current.push(Pe),ue()}return[ge.current,Oe]}var a=D("4IlW");function c(Ee,Ne){var ze,Se=Ee.prefixCls,re=Ee.id,ge=Ee.active,ue=Ee.rtl,Oe=Ee.tab,Pe=Oe.key,Ze=Oe.tab,ke=Oe.disabled,ut=Oe.closeIcon,Ut=Ee.tabBarGutter,rn=Ee.tabPosition,mn=Ee.closable,Hn=Ee.renderWrapper,Vn=Ee.removeAriaLabel,fr=Ee.editable,dr=Ee.onClick,wr=Ee.onRemove,Ar=Ee.onFocus,gr="".concat(Se,"-tab");P.useEffect(function(){return wr},[]);var Cr={};rn==="top"||rn==="bottom"?Cr[ue?"marginLeft":"marginRight"]=Ut:Cr.marginBottom=Ut;var Lr=fr&&mn!==!1&&!ke;function gn(Gt){if(ke)return;dr(Gt)}function en(Gt){Gt.preventDefault(),Gt.stopPropagation(),fr.onEdit("remove",{key:Pe,event:Gt})}var En=P.createElement("div",{key:Pe,ref:Ne,className:K()(gr,(ze={},Object(Z.a)(ze,"".concat(gr,"-with-remove"),Lr),Object(Z.a)(ze,"".concat(gr,"-active"),ge),Object(Z.a)(ze,"".concat(gr,"-disabled"),ke),ze)),style:Cr,onClick:gn},P.createElement("div",{role:"tab","aria-selected":ge,id:re&&"".concat(re,"-tab-").concat(Pe),className:"".concat(gr,"-btn"),"aria-controls":re&&"".concat(re,"-panel-").concat(Pe),"aria-disabled":ke,tabIndex:ke?null:0,onClick:function(zt){zt.stopPropagation(),gn(zt)},onKeyDown:function(zt){[a.a.SPACE,a.a.ENTER].includes(zt.which)&&(zt.preventDefault(),gn(zt))},onFocus:Ar},Ze),Lr&&P.createElement("button",{type:"button","aria-label":Vn||"remove",tabIndex:0,className:"".concat(gr,"-remove"),onClick:function(zt){zt.stopPropagation(),en(zt)}},ut||fr.removeIcon||"\xD7"));return Hn&&(En=Hn(En)),En}var s=P.forwardRef(c),i={width:0,height:0,left:0,top:0};function n(Ee,Ne,ze){return Object(P.useMemo)(function(){for(var Se,re=new Map,ge=Ne.get((Se=Ee[0])===null||Se===void 0?void 0:Se.key)||i,ue=ge.left+ge.width,Oe=0;Oe<Ee.length;Oe+=1){var Pe=Ee[Oe].key,Ze=Ne.get(Pe);if(!Ze){var ke;Ze=Ne.get((ke=Ee[Oe-1])===null||ke===void 0?void 0:ke.key)||i}var ut=re.get(Pe)||Object(G.a)({},Ze);ut.right=ue-ut.left-ut.width,re.set(Pe,ut)}return re},[Ee.map(function(Se){return Se.key}).join("_"),Ne,ze])}var O={width:0,height:0,left:0,top:0,right:0};function T(Ee,Ne,ze,Se,re){var ge=re.tabs,ue=re.tabPosition,Oe=re.rtl,Pe,Ze,ke;["top","bottom"].includes(ue)?(Pe="width",Ze=Oe?"right":"left",ke=Math.abs(Ne.left)):(Pe="height",Ze="top",ke=-Ne.top);var ut=Ne[Pe],Ut=ze[Pe],rn=Se[Pe],mn=ut;return Ut+rn>ut&&(mn=ut-rn),Object(P.useMemo)(function(){if(!ge.length)return[0,0];for(var Hn=ge.length,Vn=Hn,fr=0;fr<Hn;fr+=1){var dr=Ee.get(ge[fr].key)||O;if(dr[Ze]+dr[Pe]>ke+mn){Vn=fr-1;break}}for(var wr=0,Ar=Hn-1;Ar>=0;Ar-=1){var gr=Ee.get(ge[Ar].key)||O;if(gr[Ze]<ke){wr=Ar+1;break}}return[wr,Vn]},[Ee,ke,mn,ue,ge.map(function(Hn){return Hn.key}).join("_"),Oe])}var C=D("wx14"),R=D("1OyB"),S=D("vuIU"),v=D("JX7q"),E=D("Ji7U"),h=D("LK+K"),p=D("I8Z2"),_=D("bT9E"),g=D("2GS6"),w=D("Gytx"),j=D.n(w),B=D("U8pU"),A=/iPhone/i,H=/iPod/i,F=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,Y=/Android/i,q=/\bAndroid(?:.+)SD4930UR\b/i,ie=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,me=/Windows Phone/i,$e=/\bWindows(?:.+)ARM\b/i,xe=/BlackBerry/i,Ie=/BB10/i,Je=/Opera Mini/i,Ye=/\b(CriOS|Chrome)(?:.+)Mobile/i,ve=/Mobile(?:.+)Firefox\b/i;function fe(Ee,Ne){return Ee.test(Ne)}function lt(Ee){var Ne=Ee||(typeof navigator!="undefined"?navigator.userAgent:""),ze=(Ne||"").split("[FBAN");if(typeof ze[1]!="undefined"){var Se=ze,re=Object(V.a)(Se,1);Ne=re[0]}if(ze=Ne.split("Twitter"),typeof ze[1]!="undefined"){var ge=ze,ue=Object(V.a)(ge,1);Ne=ue[0]}var Oe={apple:{phone:fe(A,Ne)&&!fe(me,Ne),ipod:fe(H,Ne),tablet:!fe(A,Ne)&&fe(F,Ne)&&!fe(me,Ne),device:(fe(A,Ne)||fe(H,Ne)||fe(F,Ne))&&!fe(me,Ne)},amazon:{phone:fe(q,Ne),tablet:!fe(q,Ne)&&fe(ie,Ne),device:fe(q,Ne)||fe(ie,Ne)},android:{phone:!fe(me,Ne)&&fe(q,Ne)||!fe(me,Ne)&&fe(x,Ne),tablet:!fe(me,Ne)&&!fe(q,Ne)&&!fe(x,Ne)&&(fe(ie,Ne)||fe(Y,Ne)),device:!fe(me,Ne)&&(fe(q,Ne)||fe(ie,Ne)||fe(x,Ne)||fe(Y,Ne))||fe(/\bokhttp\b/i,Ne)},windows:{phone:fe(me,Ne),tablet:fe($e,Ne),device:fe(me,Ne)||fe($e,Ne)},other:{blackberry:fe(xe,Ne),blackberry10:fe(Ie,Ne),opera:fe(Je,Ne),firefox:fe(ve,Ne),chrome:fe(Ye,Ne),device:fe(xe,Ne)||fe(Ie,Ne)||fe(Je,Ne)||fe(ve,Ne)||fe(Ye,Ne)},any:null,phone:null,tablet:null};return Oe.any=Oe.apple.device||Oe.android.device||Oe.windows.device||Oe.other.device,Oe.phone=Oe.apple.phone||Oe.android.phone||Oe.windows.phone,Oe.tablet=Oe.apple.tablet||Oe.android.tablet||Oe.windows.tablet,Oe}var qt=Object(G.a)(Object(G.a)({},lt()),{},{isMobile:lt}),Ft=qt;function Ot(){}function Ve(Ee,Ne,ze){var Se=Ne||"";return Ee.key||"".concat(Se,"item_").concat(ze)}function vt(Ee){return"".concat(Ee,"-menu-")}function ht(Ee,Ne){var ze=-1;P.Children.forEach(Ee,function(Se){ze+=1,Se&&Se.type&&Se.type.isMenuItemGroup?P.Children.forEach(Se.props.children,function(re){ze+=1,Ne(re,ze)}):Ne(Se,ze)})}function Bt(Ee,Ne,ze){if(!Ee||ze.find)return;P.Children.forEach(Ee,function(Se){if(Se){var re=Se.type;if(!re||!(re.isSubMenu||re.isMenuItem||re.isMenuItemGroup))return;Ne.indexOf(Se.key)!==-1?ze.find=!0:Se.props.children&&Bt(Se.props.children,Ne,ze)}})}var se=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ue=function(Ne){var ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=Ne&&typeof Ne.getBoundingClientRect=="function"&&Ne.getBoundingClientRect().width;if(Se){if(ze){var re=getComputedStyle(Ne),ge=re.marginLeft,ue=re.marginRight;Se+=+ge.replace("px","")+ +ue.replace("px","")}Se=+Se.toFixed(6)}return Se||0},Ge=function(Ne,ze,Se){Ne&&Object(B.a)(Ne.style)==="object"&&(Ne.style[ze]=Se)},et=function(){return Ft.any},Wt=D("bdgK"),Yt=D("i8i4"),on=D.n(Yt),nt=D("wgJM"),tn=D("l4aY"),Ln=D("m+aA"),We=D("c+Xe"),Fe=D("zT1h"),yt=D("QC+M");function At(Ee,Ne,ze){return ze?Ee[0]===Ne[0]:Ee[0]===Ne[0]&&Ee[1]===Ne[1]}function tt(Ee,Ne,ze){var Se=Ee[Ne]||{};return Object(G.a)(Object(G.a)({},Se),ze)}function ot(Ee,Ne,ze,Se){for(var re=ze.points,ge=Object.keys(Ee),ue=0;ue<ge.length;ue+=1){var Oe=ge[ue];if(At(Ee[Oe].points,re,Se))return"".concat(Ne,"-placement-").concat(Oe)}return""}var De=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ee=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee==null?void 0:Ee.substr(0,4)))},ye=D("MNnm");function we(Ee,Ne){var ze={};return ze[Ee.toLowerCase()]=Ne.toLowerCase(),ze["Webkit".concat(Ee)]="webkit".concat(Ne),ze["Moz".concat(Ee)]="moz".concat(Ne),ze["ms".concat(Ee)]="MS".concat(Ne),ze["O".concat(Ee)]="o".concat(Ne.toLowerCase()),ze}function ae(Ee,Ne){var ze={animationend:we("Animation","AnimationEnd"),transitionend:we("Transition","TransitionEnd")};return Ee&&("AnimationEvent"in Ne||delete ze.animationend.animation,"TransitionEvent"in Ne||delete ze.transitionend.transition),ze}var oe=ae(Object(ye.a)(),typeof window!="undefined"?window:{}),pe={};if(Object(ye.a)()){var _e=document.createElement("div");pe=_e.style}var be={};function Ke(Ee){if(be[Ee])return be[Ee];var Ne=oe[Ee];if(Ne)for(var ze=Object.keys(Ne),Se=ze.length,re=0;re<Se;re+=1){var ge=ze[re];if(Object.prototype.hasOwnProperty.call(Ne,ge)&&ge in pe)return be[Ee]=Ne[ge],be[Ee]}return""}var St=Ke("animationend"),nn=Ke("transitionend"),An=!!(St&&nn),bt=St||"animationend",Jt=nn||"transitionend";function Et(Ee,Ne){if(!Ee)return null;if(Object(B.a)(Ee)==="object"){var ze=Ne.replace(/-\w/g,function(Se){return Se[1].toUpperCase()});return Ee[ze]}return"".concat(Ee,"-").concat(Ne)}var Ct="none",st="appear",de="enter",Ae="leave",kt="none",ct="prepare",Qt="start",un="active",Le="end";function qe(Ee){var Ne=Object(P.useRef)(!1),ze=Object(P.useState)(Ee),Se=Object(V.a)(ze,2),re=Se[0],ge=Se[1];function ue(Oe){Ne.current||ge(Oe)}return Object(P.useEffect)(function(){return function(){Ne.current=!0}},[]),[re,ue]}var mt=Object(ye.a)()?P.useLayoutEffect:P.useEffect,jt=mt,sn=function(){var Ee=P.useRef(null);function Ne(){nt.a.cancel(Ee.current)}function ze(Se){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Ne();var ge=Object(nt.a)(function(){re<=1?Se({isCanceled:function(){return ge!==Ee.current}}):ze(Se,re-1)});Ee.current=ge}return P.useEffect(function(){return function(){Ne()}},[]),[ze,Ne]},yn=[ct,Qt,un,Le],nr=!1,Kn=!0;function wn(Ee){return Ee===un||Ee===Le}var br=function(Ee,Ne){var ze=P.useState(kt),Se=Object(V.a)(ze,2),re=Se[0],ge=Se[1],ue=sn(),Oe=Object(V.a)(ue,2),Pe=Oe[0],Ze=Oe[1];function ke(){ge(ct)}return jt(function(){if(re!==kt&&re!==Le){var ut=yn.indexOf(re),Ut=yn[ut+1],rn=Ne(re);rn===nr?ge(Ut):Pe(function(mn){function Hn(){if(mn.isCanceled())return;ge(Ut)}rn===!0?Hn():Promise.resolve(rn).then(Hn)})}},[Ee,re]),P.useEffect(function(){return function(){Ze()}},[]),[ke,re]},Er=function(Ee){var Ne=Object(P.useRef)(),ze=Object(P.useRef)(Ee);ze.current=Ee;var Se=P.useCallback(function(ue){ze.current(ue)},[]);function re(ue){ue&&(ue.removeEventListener(Jt,Se),ue.removeEventListener(bt,Se))}function ge(ue){Ne.current&&Ne.current!==ue&&re(Ne.current),ue&&ue!==Ne.current&&(ue.addEventListener(Jt,Se),ue.addEventListener(bt,Se),Ne.current=ue)}return P.useEffect(function(){return function(){re(Ne.current)}},[]),[ge,re]};function rr(Ee,Ne,ze,Se){var re=Se.motionEnter,ge=re===void 0?!0:re,ue=Se.motionAppear,Oe=ue===void 0?!0:ue,Pe=Se.motionLeave,Ze=Pe===void 0?!0:Pe,ke=Se.motionDeadline,ut=Se.motionLeaveImmediately,Ut=Se.onAppearPrepare,rn=Se.onEnterPrepare,mn=Se.onLeavePrepare,Hn=Se.onAppearStart,Vn=Se.onEnterStart,fr=Se.onLeaveStart,dr=Se.onAppearActive,wr=Se.onEnterActive,Ar=Se.onLeaveActive,gr=Se.onAppearEnd,Cr=Se.onEnterEnd,Lr=Se.onLeaveEnd,gn=Se.onVisibleChanged,en=qe(),En=Object(V.a)(en,2),Gt=En[0],zt=En[1],pr=qe(Ct),Mr=Object(V.a)(pr,2),ir=Mr[0],Ur=Mr[1],oi=qe(null),jr=Object(V.a)(oi,2),Xr=jr[0],zr=jr[1],Wr=Object(P.useRef)(!1),Hr=Object(P.useRef)(null),vr=Object(P.useRef)(!1),yi=Object(P.useRef)(null);function Qi(){var si=ze();return si||yi.current}var ji=Object(P.useRef)(!1);function Ri(si){var Qr=Qi();if(si&&!si.deadline&&si.target!==Qr)return;var Ti;ir===st&&ji.current?Ti=gr==null?void 0:gr(Qr,si):ir===de&&ji.current?Ti=Cr==null?void 0:Cr(Qr,si):ir===Ae&&ji.current&&(Ti=Lr==null?void 0:Lr(Qr,si)),Ti!==!1&&!vr.current&&(Ur(Ct),zr(null))}var ui=Er(Ri),qr=Object(V.a)(ui,1),ii=qr[0],ci=P.useMemo(function(){var si,Qr,Ti;switch(ir){case"appear":return si={},Object(Z.a)(si,ct,Ut),Object(Z.a)(si,Qt,Hn),Object(Z.a)(si,un,dr),si;case"enter":return Qr={},Object(Z.a)(Qr,ct,rn),Object(Z.a)(Qr,Qt,Vn),Object(Z.a)(Qr,un,wr),Qr;case"leave":return Ti={},Object(Z.a)(Ti,ct,mn),Object(Z.a)(Ti,Qt,fr),Object(Z.a)(Ti,un,Ar),Ti;default:return{}}},[ir]),Fi=br(ir,function(si){if(si===ct){var Qr=ci[ct];return Qr?Qr(Qi()):nr}if(ei in ci){var Ti;zr(((Ti=ci[ei])===null||Ti===void 0?void 0:Ti.call(ci,Qi(),null))||null)}return ei===un&&(ii(Qi()),ke>0&&(clearTimeout(Hr.current),Hr.current=setTimeout(function(){Ri({deadline:!0})},ke))),Kn}),ha=Object(V.a)(Fi,2),sa=ha[0],ei=ha[1],Zi=wn(ei);ji.current=Zi,jt(function(){zt(Ne);var si=Wr.current;if(Wr.current=!0,!Ee)return;var Qr;!si&&Ne&&Oe&&(Qr=st),si&&Ne&&ge&&(Qr=de),(si&&!Ne&&Ze||!si&&ut&&!Ne&&Ze)&&(Qr=Ae),Qr&&(Ur(Qr),sa())},[Ne]),Object(P.useEffect)(function(){(ir===st&&!Oe||ir===de&&!ge||ir===Ae&&!Ze)&&Ur(Ct)},[Oe,ge,Ze]),Object(P.useEffect)(function(){return function(){clearTimeout(Hr.current),vr.current=!0}},[]),Object(P.useEffect)(function(){Gt!==void 0&&ir===Ct&&(gn==null||gn(Gt))},[Gt,ir]);var qi=Xr;return ci[ct]&&ei===Qt&&(qi=Object(G.a)({transition:"none"},qi)),[ir,ei,qi,Gt!=null?Gt:Ne]}var cr=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(){return Object(R.a)(this,ze),Ne.apply(this,arguments)}return Object(S.a)(ze,[{key:"render",value:function(){return this.props.children}}]),ze}(P.Component),Pr=cr;function Kr(Ee){var Ne=Ee;Object(B.a)(Ee)==="object"&&(Ne=Ee.transitionSupport);function ze(re){return!!(re.motionName&&Ne)}var Se=P.forwardRef(function(re,ge){var ue=re.visible,Oe=ue===void 0?!0:ue,Pe=re.removeOnLeave,Ze=Pe===void 0?!0:Pe,ke=re.forceRender,ut=re.children,Ut=re.motionName,rn=re.leavedClassName,mn=re.eventProps,Hn=ze(re),Vn=Object(P.useRef)(),fr=Object(P.useRef)();function dr(){try{return Object(Ln.a)(Vn.current||fr.current)}catch(Ur){return null}}var wr=rr(Hn,Oe,dr,re),Ar=Object(V.a)(wr,4),gr=Ar[0],Cr=Ar[1],Lr=Ar[2],gn=Ar[3],en=P.useRef(gn);gn&&(en.current=!0);var En=Object(P.useRef)(ge);En.current=ge;var Gt=P.useCallback(function(Ur){Vn.current=Ur,Object(We.b)(En.current,Ur)},[]),zt,pr=Object(G.a)(Object(G.a)({},mn),{},{visible:Oe});if(!ut)zt=null;else if(gr===Ct||!ze(re))gn?zt=ut(Object(G.a)({},pr),Gt):!Ze&&en.current?zt=ut(Object(G.a)(Object(G.a)({},pr),{},{className:rn}),Gt):ke?zt=ut(Object(G.a)(Object(G.a)({},pr),{},{style:{display:"none"}}),Gt):zt=null;else{var Mr,ir;Cr===ct?ir="prepare":wn(Cr)?ir="active":Cr===Qt&&(ir="start"),zt=ut(Object(G.a)(Object(G.a)({},pr),{},{className:K()(Et(Ut,gr),(Mr={},Object(Z.a)(Mr,Et(Ut,"".concat(gr,"-").concat(ir)),ir),Object(Z.a)(Mr,Ut,typeof Ut=="string"),Mr)),style:Lr}),Gt)}return P.createElement(Pr,{ref:fr},zt)});return Se.displayName="CSSMotion",Se}var hi=Kr(An),pn="add",or="keep",mi="remove",wi="removed";function ti(Ee){var Ne;return Ee&&Object(B.a)(Ee)==="object"&&"key"in Ee?Ne=Ee:Ne={key:Ee},Object(G.a)(Object(G.a)({},Ne),{},{key:String(Ne.key)})}function ni(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ee.map(ti)}function X(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ze=[],Se=0,re=Ne.length,ge=ni(Ee),ue=ni(Ne);ge.forEach(function(Ze){for(var ke=!1,ut=Se;ut<re;ut+=1){var Ut=ue[ut];if(Ut.key===Ze.key){Se<ut&&(ze=ze.concat(ue.slice(Se,ut).map(function(rn){return Object(G.a)(Object(G.a)({},rn),{},{status:pn})})),Se=ut),ze.push(Object(G.a)(Object(G.a)({},Ut),{},{status:or})),Se+=1,ke=!0;break}}ke||ze.push(Object(G.a)(Object(G.a)({},Ze),{},{status:mi}))}),Se<re&&(ze=ze.concat(ue.slice(Se).map(function(Ze){return Object(G.a)(Object(G.a)({},Ze),{},{status:pn})})));var Oe={};ze.forEach(function(Ze){var ke=Ze.key;Oe[ke]=(Oe[ke]||0)+1});var Pe=Object.keys(Oe).filter(function(Ze){return Oe[Ze]>1});return Pe.forEach(function(Ze){ze=ze.filter(function(ke){var ut=ke.key,Ut=ke.status;return ut!==Ze||Ut!==mi}),ze.forEach(function(ke){ke.key===Ze&&(ke.status=or)})}),ze}var L=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function N(Ee){var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hi,ze=function(Se){Object(E.a)(ge,Se);var re=Object(h.a)(ge);function ge(){var ue;return Object(R.a)(this,ge),ue=re.apply(this,arguments),ue.state={keyEntities:[]},ue.removeKey=function(Oe){ue.setState(function(Pe){var Ze=Pe.keyEntities;return{keyEntities:Ze.map(function(ke){return ke.key!==Oe?ke:Object(G.a)(Object(G.a)({},ke),{},{status:wi})})}})},ue}return Object(S.a)(ge,[{key:"render",value:function(){var Oe=this,Pe=this.state.keyEntities,Ze=this.props,ke=Ze.component,ut=Ze.children,Ut=Ze.onVisibleChanged,rn=Object(U.a)(Ze,["component","children","onVisibleChanged"]),mn=ke||P.Fragment,Hn={};return L.forEach(function(Vn){Hn[Vn]=rn[Vn],delete rn[Vn]}),delete rn.keys,P.createElement(mn,rn,Pe.map(function(Vn){var fr=Vn.status,dr=Object(U.a)(Vn,["status"]),wr=fr===pn||fr===or;return P.createElement(Ne,Object(C.a)({},Hn,{key:dr.key,visible:wr,eventProps:dr,onVisibleChanged:function(gr){Ut==null||Ut(gr,{key:dr.key}),gr||Oe.removeKey(dr.key)}}),ut)}))}}],[{key:"getDerivedStateFromProps",value:function(Oe,Pe){var Ze=Oe.keys,ke=Pe.keyEntities,ut=ni(Ze),Ut=X(ke,ut);return{keyEntities:Ut.filter(function(rn){var mn=ke.find(function(Hn){var Vn=Hn.key;return rn.key===Vn});return!(mn&&mn.status===wi&&rn.status===mi)})}}}]),ge}(P.Component);return ze.defaultProps={component:"div"},ze}var z=N(An),ne=hi;function J(Ee){var Ne=Ee.prefixCls,ze=Ee.motion,Se=Ee.animation,re=Ee.transitionName;return ze||(Se?{motionName:"".concat(Ne,"-").concat(Se)}:re?{motionName:re}:null)}function je(Ee){var Ne=Ee.prefixCls,ze=Ee.visible,Se=Ee.zIndex,re=Ee.mask,ge=Ee.maskMotion,ue=Ee.maskAnimation,Oe=Ee.maskTransitionName;if(!re)return null;var Pe={};return(ge||Oe||ue)&&(Pe=Object(G.a)({motionAppear:!0},J({motion:ge,prefixCls:Ne,transitionName:Oe,animation:ue}))),P.createElement(ne,Object(C.a)({},Pe,{visible:ze,removeOnLeave:!0}),function(Ze){var ke=Ze.className;return P.createElement("div",{style:{zIndex:Se},className:K()("".concat(Ne,"-mask"),ke)})})}var $t=D("9mu1"),In=D("o0o1"),Jn=D.n(In),ln=D("HaE+"),tr=["measure","align",null,"motion"],qn=function(Ee,Ne){var ze=Object(P.useState)(null),Se=Object(V.a)(ze,2),re=Se[0],ge=Se[1],ue=Object(P.useRef)(),Oe=Object(P.useRef)(!1);function Pe(ut){Oe.current||ge(ut)}function Ze(){nt.a.cancel(ue.current)}function ke(ut){Ze(),ue.current=Object(nt.a)(function(){Pe(function(Ut){switch(re){case"align":return"motion";case"motion":return"stable";default:}return Ut}),ut==null||ut()})}return Object(P.useEffect)(function(){Pe("measure")},[Ee]),Object(P.useEffect)(function(){switch(re){case"measure":Ne();break;default:}re&&(ue.current=Object(nt.a)(Object(ln.a)(Jn.a.mark(function ut(){var Ut,rn;return Jn.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:Ut=tr.indexOf(re),rn=tr[Ut+1],rn&&Ut!==-1&&Pe(rn);case 3:case"end":return Hn.stop()}},ut)}))))},[re]),Object(P.useEffect)(function(){return function(){Oe.current=!0,Ze()}},[]),[re,ke]},kr=function(Ee){var Ne=P.useState({width:0,height:0}),ze=Object(V.a)(Ne,2),Se=ze[0],re=ze[1];function ge(Oe){re({width:Oe.offsetWidth,height:Oe.offsetHeight})}var ue=P.useMemo(function(){var Oe={};if(Ee){var Pe=Se.width,Ze=Se.height;Ee.indexOf("height")!==-1&&Ze?Oe.height=Ze:Ee.indexOf("minHeight")!==-1&&Ze&&(Oe.minHeight=Ze),Ee.indexOf("width")!==-1&&Pe?Oe.width=Pe:Ee.indexOf("minWidth")!==-1&&Pe&&(Oe.minWidth=Pe)}return Oe},[Ee,Se]);return[ue,ge]},li=P.forwardRef(function(Ee,Ne){var ze=Ee.visible,Se=Ee.prefixCls,re=Ee.className,ge=Ee.style,ue=Ee.children,Oe=Ee.zIndex,Pe=Ee.stretch,Ze=Ee.destroyPopupOnHide,ke=Ee.forceRender,ut=Ee.align,Ut=Ee.point,rn=Ee.getRootDomNode,mn=Ee.getClassNameFromAlign,Hn=Ee.onAlign,Vn=Ee.onMouseEnter,fr=Ee.onMouseLeave,dr=Ee.onMouseDown,wr=Ee.onTouchStart,Ar=Object(P.useRef)(),gr=Object(P.useRef)(),Cr=Object(P.useState)(),Lr=Object(V.a)(Cr,2),gn=Lr[0],en=Lr[1],En=kr(Pe),Gt=Object(V.a)(En,2),zt=Gt[0],pr=Gt[1];function Mr(){Pe&&pr(rn())}var ir=qn(ze,Mr),Ur=Object(V.a)(ir,2),oi=Ur[0],jr=Ur[1],Xr=Object(P.useRef)();function zr(){return Ut||rn}function Wr(){var ui;(ui=Ar.current)===null||ui===void 0||ui.forceAlign()}function Hr(ui,qr){var ii=mn(qr);gn!==ii&&en(ii),oi==="align"&&(gn!==ii?Promise.resolve().then(function(){Wr()}):jr(function(){var ci;(ci=Xr.current)===null||ci===void 0||ci.call(Xr)}),Hn==null||Hn(ui,qr))}var vr=Object(G.a)({},J(Ee));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(ui){var qr=vr[ui];vr[ui]=function(ii,ci){return jr(),qr==null?void 0:qr(ii,ci)}});function yi(){return new Promise(function(ui){Xr.current=ui})}P.useEffect(function(){!vr.motionName&&oi==="motion"&&jr()},[vr.motionName,oi]),P.useImperativeHandle(Ne,function(){return{forceAlign:Wr,getElement:function(){return gr.current}}});var Qi=Object(G.a)(Object(G.a)({},zt),{},{zIndex:Oe,opacity:oi==="motion"||oi==="stable"||!ze?void 0:0,pointerEvents:oi==="stable"?void 0:"none"},ge),ji=!0;(ut==null?void 0:ut.points)&&(oi==="align"||oi==="stable")&&(ji=!1);var Ri=ue;return P.Children.count(ue)>1&&(Ri=P.createElement("div",{className:"".concat(Se,"-content")},ue)),P.createElement(ne,Object(C.a)({visible:ze,ref:gr,leavedClassName:"".concat(Se,"-hidden")},vr,{onAppearPrepare:yi,onEnterPrepare:yi,removeOnLeave:Ze,forceRender:ke}),function(ui,qr){var ii=ui.className,ci=ui.style,Fi=K()(Se,re,gn,ii);return P.createElement($t.a,{target:zr(),key:"popup",ref:Ar,monitorWindowResize:!0,disabled:ji,align:ut,onAlign:Hr},P.createElement("div",{ref:qr,className:Fi,onMouseEnter:Vn,onMouseLeave:fr,onMouseDownCapture:dr,onTouchStartCapture:wr,style:Object(G.a)(Object(G.a)({},ci),Qi)},Ri))})});li.displayName="PopupInner";var ai=li,Gr=P.forwardRef(function(Ee,Ne){var ze=Ee.prefixCls,Se=Ee.visible,re=Ee.zIndex,ge=Ee.children,ue=Ee.mobile;ue=ue===void 0?{}:ue;var Oe=ue.popupClassName,Pe=ue.popupStyle,Ze=ue.popupMotion,ke=Ze===void 0?{}:Ze,ut=ue.popupRender,Ut=P.useRef();P.useImperativeHandle(Ne,function(){return{forceAlign:function(){},getElement:function(){return Ut.current}}});var rn=Object(G.a)({zIndex:re},Pe),mn=ge;return P.Children.count(ge)>1&&(mn=P.createElement("div",{className:"".concat(ze,"-content")},ge)),ut&&(mn=ut(mn)),P.createElement(ne,Object(C.a)({visible:Se,ref:Ut,removeOnLeave:!0},ke),function(Hn,Vn){var fr=Hn.className,dr=Hn.style,wr=K()(ze,Oe,fr);return P.createElement("div",{ref:Vn,className:wr,style:Object(G.a)(Object(G.a)({},dr),rn)},mn)})});Gr.displayName="MobilePopupInner";var Li=Gr,Vi=["visible","mobile"],Dr=P.forwardRef(function(Ee,Ne){var ze=Ee.visible,Se=Ee.mobile,re=Object(U.a)(Ee,Vi),ge=Object(P.useState)(ze),ue=Object(V.a)(ge,2),Oe=ue[0],Pe=ue[1],Ze=Object(P.useState)(!1),ke=Object(V.a)(Ze,2),ut=ke[0],Ut=ke[1],rn=Object(G.a)(Object(G.a)({},re),{},{visible:Oe});Object(P.useEffect)(function(){Pe(ze),ze&&Se&&Ut(De())},[ze,Se]);var mn=ut?P.createElement(Li,Object(C.a)({},rn,{mobile:Se,ref:Ne})):P.createElement(ai,Object(C.a)({},rn,{ref:Ne}));return P.createElement("div",null,P.createElement(je,rn),mn)});Dr.displayName="Popup";var Sr=Dr,ri=P.createContext(null),Br=ri;function Bn(){}function _n(){return""}function Tn(Ee){return Ee?Ee.ownerDocument:window.document}var bn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function ur(Ee){var Ne=function(ze){Object(E.a)(re,ze);var Se=Object(h.a)(re);function re(ge){var ue;Object(R.a)(this,re),ue=Se.call(this,ge),ue.popupRef=P.createRef(),ue.triggerRef=P.createRef(),ue.attachId=void 0,ue.clickOutsideHandler=void 0,ue.touchOutsideHandler=void 0,ue.contextMenuOutsideHandler1=void 0,ue.contextMenuOutsideHandler2=void 0,ue.mouseDownTimeout=void 0,ue.focusTime=void 0,ue.preClickTime=void 0,ue.preTouchTime=void 0,ue.delayTimer=void 0,ue.hasPopupMouseDown=void 0,ue.onMouseEnter=function(Pe){var Ze=ue.props.mouseEnterDelay;ue.fireEvents("onMouseEnter",Pe),ue.delaySetPopupVisible(!0,Ze,Ze?null:Pe)},ue.onMouseMove=function(Pe){ue.fireEvents("onMouseMove",Pe),ue.setPoint(Pe)},ue.onMouseLeave=function(Pe){ue.fireEvents("onMouseLeave",Pe),ue.delaySetPopupVisible(!1,ue.props.mouseLeaveDelay)},ue.onPopupMouseEnter=function(){ue.clearDelayTimer()},ue.onPopupMouseLeave=function(Pe){var Ze;if(Pe.relatedTarget&&!Pe.relatedTarget.setTimeout&&Object(tn.a)((Ze=ue.popupRef.current)===null||Ze===void 0?void 0:Ze.getElement(),Pe.relatedTarget))return;ue.delaySetPopupVisible(!1,ue.props.mouseLeaveDelay)},ue.onFocus=function(Pe){ue.fireEvents("onFocus",Pe),ue.clearDelayTimer(),ue.isFocusToShow()&&(ue.focusTime=Date.now(),ue.delaySetPopupVisible(!0,ue.props.focusDelay))},ue.onMouseDown=function(Pe){ue.fireEvents("onMouseDown",Pe),ue.preClickTime=Date.now()},ue.onTouchStart=function(Pe){ue.fireEvents("onTouchStart",Pe),ue.preTouchTime=Date.now()},ue.onBlur=function(Pe){ue.fireEvents("onBlur",Pe),ue.clearDelayTimer(),ue.isBlurToHide()&&ue.delaySetPopupVisible(!1,ue.props.blurDelay)},ue.onContextMenu=function(Pe){Pe.preventDefault(),ue.fireEvents("onContextMenu",Pe),ue.setPopupVisible(!0,Pe)},ue.onContextMenuClose=function(){ue.isContextMenuToShow()&&ue.close()},ue.onClick=function(Pe){if(ue.fireEvents("onClick",Pe),ue.focusTime){var Ze;if(ue.preClickTime&&ue.preTouchTime?Ze=Math.min(ue.preClickTime,ue.preTouchTime):ue.preClickTime?Ze=ue.preClickTime:ue.preTouchTime&&(Ze=ue.preTouchTime),Math.abs(Ze-ue.focusTime)<20)return;ue.focusTime=0}ue.preClickTime=0,ue.preTouchTime=0,ue.isClickToShow()&&(ue.isClickToHide()||ue.isBlurToHide())&&Pe&&Pe.preventDefault&&Pe.preventDefault();var ke=!ue.state.popupVisible;(ue.isClickToHide()&&!ke||ke&&ue.isClickToShow())&&ue.setPopupVisible(!ue.state.popupVisible,Pe)},ue.onPopupMouseDown=function(){if(ue.hasPopupMouseDown=!0,clearTimeout(ue.mouseDownTimeout),ue.mouseDownTimeout=window.setTimeout(function(){ue.hasPopupMouseDown=!1},0),ue.context){var Pe;(Pe=ue.context).onPopupMouseDown.apply(Pe,arguments)}},ue.onDocumentClick=function(Pe){if(ue.props.mask&&!ue.props.maskClosable)return;var Ze=Pe.target,ke=ue.getRootDomNode(),ut=ue.getPopupDomNode();(!Object(tn.a)(ke,Ze)||ue.isContextMenuOnly())&&!Object(tn.a)(ut,Ze)&&!ue.hasPopupMouseDown&&ue.close()},ue.getRootDomNode=function(){var Pe=ue.props.getTriggerDOMNode;if(Pe)return Pe(ue.triggerRef.current);try{var Ze=Object(Ln.a)(ue.triggerRef.current);if(Ze)return Ze}catch(ke){}return on.a.findDOMNode(Object(v.a)(ue))},ue.getPopupClassNameFromAlign=function(Pe){var Ze=[],ke=ue.props,ut=ke.popupPlacement,Ut=ke.builtinPlacements,rn=ke.prefixCls,mn=ke.alignPoint,Hn=ke.getPopupClassNameFromAlign;return ut&&Ut&&Ze.push(ot(Ut,rn,Pe,mn)),Hn&&Ze.push(Hn(Pe)),Ze.join(" ")},ue.getComponent=function(){var Pe=ue.props,Ze=Pe.prefixCls,ke=Pe.destroyPopupOnHide,ut=Pe.popupClassName,Ut=Pe.onPopupAlign,rn=Pe.popupMotion,mn=Pe.popupAnimation,Hn=Pe.popupTransitionName,Vn=Pe.popupStyle,fr=Pe.mask,dr=Pe.maskAnimation,wr=Pe.maskTransitionName,Ar=Pe.maskMotion,gr=Pe.zIndex,Cr=Pe.popup,Lr=Pe.stretch,gn=Pe.alignPoint,en=Pe.mobile,En=Pe.forceRender,Gt=ue.state,zt=Gt.popupVisible,pr=Gt.point,Mr=ue.getPopupAlign(),ir={};return ue.isMouseEnterToShow()&&(ir.onMouseEnter=ue.onPopupMouseEnter),ue.isMouseLeaveToHide()&&(ir.onMouseLeave=ue.onPopupMouseLeave),ir.onMouseDown=ue.onPopupMouseDown,ir.onTouchStart=ue.onPopupMouseDown,P.createElement(Sr,Object(C.a)({prefixCls:Ze,destroyPopupOnHide:ke,visible:zt,point:gn&&pr,className:ut,align:Mr,onAlign:Ut,animation:mn,getClassNameFromAlign:ue.getPopupClassNameFromAlign},ir,{stretch:Lr,getRootDomNode:ue.getRootDomNode,style:Vn,mask:fr,zIndex:gr,transitionName:Hn,maskAnimation:dr,maskTransitionName:wr,maskMotion:Ar,ref:ue.popupRef,motion:rn,mobile:en,forceRender:En}),typeof Cr=="function"?Cr():Cr)},ue.attachParent=function(Pe){nt.a.cancel(ue.attachId);var Ze=ue.props,ke=Ze.getPopupContainer,ut=Ze.getDocument,Ut=ue.getRootDomNode(),rn;ke?(Ut||ke.length===0)&&(rn=ke(Ut)):rn=ut(ue.getRootDomNode()).body,rn?rn.appendChild(Pe):ue.attachId=Object(nt.a)(function(){ue.attachParent(Pe)})},ue.getContainer=function(){var Pe=ue.props.getDocument,Ze=Pe(ue.getRootDomNode()).createElement("div");return Ze.style.position="absolute",Ze.style.top="0",Ze.style.left="0",Ze.style.width="100%",ue.attachParent(Ze),Ze},ue.setPoint=function(Pe){var Ze=ue.props.alignPoint;if(!Ze||!Pe)return;ue.setState({point:{pageX:Pe.pageX,pageY:Pe.pageY}})},ue.handlePortalUpdate=function(){ue.state.prevPopupVisible!==ue.state.popupVisible&&ue.props.afterPopupVisibleChange(ue.state.popupVisible)},ue.triggerContextValue={onPopupMouseDown:ue.onPopupMouseDown};var Oe;return"popupVisible"in ge?Oe=!!ge.popupVisible:Oe=!!ge.defaultPopupVisible,ue.state={prevPopupVisible:Oe,popupVisible:Oe},bn.forEach(function(Pe){ue["fire".concat(Pe)]=function(Ze){ue.fireEvents(Pe,Ze)}}),ue}return Object(S.a)(re,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this.props,Oe=this.state;if(Oe.popupVisible){var Pe;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Pe=ue.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Fe.a)(Pe,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Pe=Pe||ue.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Fe.a)(Pe,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Pe=Pe||ue.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Fe.a)(Pe,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Fe.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),nt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var ue;return((ue=this.popupRef.current)===null||ue===void 0?void 0:ue.getElement())||null}},{key:"getPopupAlign",value:function(){var ue=this.props,Oe=ue.popupPlacement,Pe=ue.popupAlign,Ze=ue.builtinPlacements;return Oe&&Ze?tt(Ze,Oe,Pe):Pe}},{key:"setPopupVisible",value:function(ue,Oe){var Pe=this.props.alignPoint,Ze=this.state.popupVisible;this.clearDelayTimer(),Ze!==ue&&("popupVisible"in this.props||this.setState({popupVisible:ue,prevPopupVisible:Ze}),this.props.onPopupVisibleChange(ue)),Pe&&Oe&&ue&&this.setPoint(Oe)}},{key:"delaySetPopupVisible",value:function(ue,Oe,Pe){var Ze=this,ke=Oe*1e3;if(this.clearDelayTimer(),ke){var ut=Pe?{pageX:Pe.pageX,pageY:Pe.pageY}:null;this.delayTimer=window.setTimeout(function(){Ze.setPopupVisible(ue,ut),Ze.clearDelayTimer()},ke)}else this.setPopupVisible(ue,Pe)}},{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(ue){var Oe=this.props.children.props,Pe=this.props;return Oe[ue]&&Pe[ue]?this["fire".concat(ue)]:Oe[ue]||Pe[ue]}},{key:"isClickToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("click")!==-1||Pe.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var ue=this.props.action;return ue==="contextMenu"||ue.length===1&&ue[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("contextMenu")!==-1||Pe.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.hideAction;return Oe.indexOf("click")!==-1||Pe.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("hover")!==-1||Pe.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.hideAction;return Oe.indexOf("hover")!==-1||Pe.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.showAction;return Oe.indexOf("focus")!==-1||Pe.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var ue=this.props,Oe=ue.action,Pe=ue.hideAction;return Oe.indexOf("focus")!==-1||Pe.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var ue;(ue=this.popupRef.current)===null||ue===void 0||ue.forceAlign()}}},{key:"fireEvents",value:function(ue,Oe){var Pe=this.props.children.props[ue];Pe&&Pe(Oe);var Ze=this.props[ue];Ze&&Ze(Oe)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var ue=this.state.popupVisible,Oe=this.props,Pe=Oe.children,Ze=Oe.forceRender,ke=Oe.alignPoint,ut=Oe.className,Ut=Oe.autoDestroy,rn=P.Children.only(Pe),mn={key:"trigger"};this.isContextMenuToShow()?mn.onContextMenu=this.onContextMenu:mn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(mn.onClick=this.onClick,mn.onMouseDown=this.onMouseDown,mn.onTouchStart=this.onTouchStart):(mn.onClick=this.createTwoChains("onClick"),mn.onMouseDown=this.createTwoChains("onMouseDown"),mn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(mn.onMouseEnter=this.onMouseEnter,ke&&(mn.onMouseMove=this.onMouseMove)):mn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?mn.onMouseLeave=this.onMouseLeave:mn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(mn.onFocus=this.onFocus,mn.onBlur=this.onBlur):(mn.onFocus=this.createTwoChains("onFocus"),mn.onBlur=this.createTwoChains("onBlur"));var Hn=K()(rn&&rn.props&&rn.props.className,ut);Hn&&(mn.className=Hn);var Vn=Object(G.a)({},mn);Object(We.c)(rn)&&(Vn.ref=Object(We.a)(this.triggerRef,rn.ref));var fr=P.cloneElement(rn,Vn),dr;return(ue||this.popupRef.current||Ze)&&(dr=P.createElement(Ee,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!ue&&Ut&&(dr=null),P.createElement(Br.Provider,{value:this.triggerContextValue},fr,dr)}}],[{key:"getDerivedStateFromProps",value:function(ue,Oe){var Pe=ue.popupVisible,Ze={};return Pe!==void 0&&Oe.popupVisible!==Pe&&(Ze.popupVisible=Pe,Ze.prevPopupVisible=Oe.popupVisible),Ze}}]),re}(P.Component);return Ne.contextType=Br,Ne.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:_n,getDocument:Tn,onPopupVisibleChange:Bn,afterPopupVisibleChange:Bn,onPopupAlign:Bn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Ne}var sr=ur(yt.a),Q={adjustX:1,adjustY:1},ce={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Ce={topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Q,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Q,offset:[4,0]}},Te=ce,rt=0,Re={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Xe=function(Ne,ze,Se){var re=vt(ze),ge=Ne.getState();Ne.setState({defaultActiveFirst:Object(G.a)(Object(G.a)({},ge.defaultActiveFirst),{},Object(Z.a)({},re,Se))})},it=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(Se){var re;Object(R.a)(this,ze),re=Ne.call(this,Se),re.onDestroy=function(ke){re.props.onDestroy(ke)},re.onKeyDown=function(ke){var ut=ke.keyCode,Ut=re.menuInstance,rn=re.props.store,mn=re.getVisible();if(ut===a.a.ENTER)return re.onTitleClick(ke),Xe(rn,re.props.eventKey,!0),!0;if(ut===a.a.RIGHT)return mn?Ut.onKeyDown(ke):(re.triggerOpenChange(!0),Xe(rn,re.props.eventKey,!0)),!0;if(ut===a.a.LEFT){var Hn;if(mn)Hn=Ut.onKeyDown(ke);else return;return Hn||(re.triggerOpenChange(!1),Hn=!0),Hn}return mn&&(ut===a.a.UP||ut===a.a.DOWN)?Ut.onKeyDown(ke):void 0},re.onOpenChange=function(ke){re.props.onOpenChange(ke)},re.onPopupVisibleChange=function(ke){re.triggerOpenChange(ke,ke?"mouseenter":"mouseleave")},re.onMouseEnter=function(ke){var ut=re.props,Ut=ut.eventKey,rn=ut.onMouseEnter,mn=ut.store;Xe(mn,re.props.eventKey,!1),rn({key:Ut,domEvent:ke})},re.onMouseLeave=function(ke){var ut=re.props,Ut=ut.parentMenu,rn=ut.eventKey,mn=ut.onMouseLeave;Ut.subMenuInstance=Object(v.a)(re),mn({key:rn,domEvent:ke})},re.onTitleMouseEnter=function(ke){var ut=re.props,Ut=ut.eventKey,rn=ut.onItemHover,mn=ut.onTitleMouseEnter;rn({key:Ut,hover:!0}),mn({key:Ut,domEvent:ke})},re.onTitleMouseLeave=function(ke){var ut=re.props,Ut=ut.parentMenu,rn=ut.eventKey,mn=ut.onItemHover,Hn=ut.onTitleMouseLeave;Ut.subMenuInstance=Object(v.a)(re),mn({key:rn,hover:!1}),Hn({key:rn,domEvent:ke})},re.onTitleClick=function(ke){var ut=Object(v.a)(re),Ut=ut.props;if(Ut.onTitleClick({key:Ut.eventKey,domEvent:ke}),Ut.triggerSubMenuAction==="hover")return;re.triggerOpenChange(!re.getVisible(),"click"),Xe(Ut.store,re.props.eventKey,!1)},re.onSubMenuClick=function(ke){typeof re.props.onClick=="function"&&re.props.onClick(re.addKeyPath(ke))},re.onSelect=function(ke){re.props.onSelect(ke)},re.onDeselect=function(ke){re.props.onDeselect(ke)},re.getPrefixCls=function(){return"".concat(re.props.rootPrefixCls,"-submenu")},re.getActiveClassName=function(){return"".concat(re.getPrefixCls(),"-active")},re.getDisabledClassName=function(){return"".concat(re.getPrefixCls(),"-disabled")},re.getSelectedClassName=function(){return"".concat(re.getPrefixCls(),"-selected")},re.getOpenClassName=function(){return"".concat(re.props.rootPrefixCls,"-submenu-open")},re.getVisible=function(){return re.state.isOpen},re.getMode=function(){return re.state.mode},re.saveMenuInstance=function(ke){re.menuInstance=ke},re.addKeyPath=function(ke){return Object(G.a)(Object(G.a)({},ke),{},{keyPath:(ke.keyPath||[]).concat(re.props.eventKey)})},re.triggerOpenChange=function(ke,ut){var Ut=re.props.eventKey,rn=function(){re.onOpenChange({key:Ut,item:Object(v.a)(re),trigger:ut,open:ke})};ut==="mouseenter"?re.mouseenterTimeout=setTimeout(function(){rn()},0):rn()},re.isChildrenSelected=function(){var ke={find:!1};return Bt(re.props.children,re.props.selectedKeys,ke),ke.find},re.isInlineMode=function(){return re.getMode()==="inline"},re.adjustWidth=function(){if(!re.subMenuTitle||!re.menuInstance)return;var ke=Yt.findDOMNode(re.menuInstance);if(ke.offsetWidth>=re.subMenuTitle.offsetWidth)return;ke.style.minWidth="".concat(re.subMenuTitle.offsetWidth,"px")},re.saveSubMenuTitle=function(ke){re.subMenuTitle=ke},re.getBaseProps=function(){var ke=Object(v.a)(re),ut=ke.props,Ut=re.getMode();return{mode:Ut==="horizontal"?"vertical":Ut,visible:re.getVisible(),level:ut.level+1,inlineIndent:ut.inlineIndent,focusable:!1,onClick:re.onSubMenuClick,onSelect:re.onSelect,onDeselect:re.onDeselect,onDestroy:re.onDestroy,selectedKeys:ut.selectedKeys,eventKey:"".concat(ut.eventKey,"-menu-"),openKeys:ut.openKeys,motion:ut.motion,onOpenChange:re.onOpenChange,subMenuOpenDelay:ut.subMenuOpenDelay,parentMenu:Object(v.a)(re),subMenuCloseDelay:ut.subMenuCloseDelay,forceSubMenuRender:ut.forceSubMenuRender,triggerSubMenuAction:ut.triggerSubMenuAction,builtinPlacements:ut.builtinPlacements,defaultActiveFirst:ut.store.getState().defaultActiveFirst[vt(ut.eventKey)],multiple:ut.multiple,prefixCls:ut.rootPrefixCls,id:re.internalMenuId,manualRef:re.saveMenuInstance,itemIcon:ut.itemIcon,expandIcon:ut.expandIcon,direction:ut.direction}},re.getMotion=function(ke,ut){var Ut=Object(v.a)(re),rn=Ut.haveRendered,mn=re.props,Hn=mn.motion,Vn=mn.rootPrefixCls,fr=Object(G.a)(Object(G.a)({},Hn),{},{leavedClassName:"".concat(Vn,"-hidden"),removeOnLeave:!1,motionAppear:rn||!ut||ke!=="inline"});return fr};var ge=Se.store,ue=Se.eventKey,Oe=ge.getState(),Pe=Oe.defaultActiveFirst;re.isRootMenu=!1;var Ze=!1;return Pe&&(Ze=Pe[ue]),Xe(ge,ue,Ze),re.state={mode:Se.mode,isOpen:Se.isOpen},re}return Object(S.a)(ze,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this,ge=this.props,ue=ge.mode,Oe=ge.parentMenu,Pe=ge.manualRef,Ze=ge.isOpen,ke=function(){re.setState({mode:ue,isOpen:Ze})},ut=Ze!==this.state.isOpen,Ut=ue!==this.state.mode;if((Ut||ut)&&(nt.a.cancel(this.updateStateRaf),Ut?this.updateStateRaf=Object(nt.a)(ke):ke()),Pe&&Pe(this),ue!=="horizontal"||!(Oe==null?void 0:Oe.isRootMenu)||!Ze)return;this.minWidthTimeout=setTimeout(function(){return re.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var re=this.props,ge=re.onDestroy,ue=re.eventKey;ge&&ge(ue),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),nt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(re,ge){var ue=this.getBaseProps();return P.createElement(Sn,Object(C.a)({},ue,{id:this.internalMenuId,className:re,style:ge}),this.props.children)}},{key:"renderChildren",value:function(){var re=this,ge=this.getBaseProps(),ue=ge.mode,Oe=ge.visible,Pe=ge.forceSubMenuRender,Ze=ge.direction,ke=this.getMotion(ue,Oe);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Oe||Pe,!this.haveOpened)return P.createElement("div",null);var ut=K()("".concat(ge.prefixCls,"-sub"),Object(Z.a)({},"".concat(ge.prefixCls,"-rtl"),Ze==="rtl"));return this.isInlineMode()?P.createElement(ne,Object(C.a)({visible:ge.visible,forceRender:Pe},ke),function(Ut){var rn=Ut.className,mn=Ut.style,Hn=K()(ut,rn);return re.renderPopupMenu(Hn,mn)}):this.renderPopupMenu(ut)}},{key:"render",value:function(){var re,ge,ue,Oe=Object(G.a)({},this.props),Pe=this.getVisible(),Ze=this.getPrefixCls(),ke=this.isInlineMode(),ut=this.getMode(),Ut=K()(Ze,"".concat(Ze,"-").concat(ut),(re={},Object(Z.a)(re,Oe.className,!!Oe.className),Object(Z.a)(re,this.getOpenClassName(),Pe),Object(Z.a)(re,this.getActiveClassName(),Oe.active||Pe&&!ke),Object(Z.a)(re,this.getDisabledClassName(),Oe.disabled),Object(Z.a)(re,this.getSelectedClassName(),this.isChildrenSelected()),re));this.internalMenuId||(Oe.eventKey?this.internalMenuId="".concat(Oe.eventKey,"$Menu"):(rt+=1,this.internalMenuId="$__$".concat(rt,"$Menu")));var rn={},mn={},Hn={};Oe.disabled||(rn={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},mn={onClick:this.onTitleClick},Hn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Vn={},fr=Oe.direction,dr=fr==="rtl";ke&&(dr?Vn.paddingRight=Oe.inlineIndent*Oe.level:Vn.paddingLeft=Oe.inlineIndent*Oe.level);var wr={};this.getVisible()&&(wr={"aria-owns":this.internalMenuId});var Ar=null;ut!=="horizontal"&&(Ar=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ar=P.createElement(this.props.expandIcon,Object(G.a)({},this.props))));var gr=P.createElement("div",Object(C.a)({ref:this.saveSubMenuTitle,style:Vn,className:"".concat(Ze,"-title"),role:"button"},Hn,mn,{"aria-expanded":Pe},wr,{"aria-haspopup":"true",title:typeof Oe.title=="string"?Oe.title:void 0}),Oe.title,Ar||P.createElement("i",{className:"".concat(Ze,"-arrow")})),Cr=this.renderChildren(),Lr=((ge=Oe.parentMenu)===null||ge===void 0?void 0:ge.isRootMenu)?Oe.parentMenu.props.getPopupContainer:function(zr){return zr.parentNode},gn=Re[ut],en=Oe.popupOffset?{offset:Oe.popupOffset}:{},En=K()((ue={},Object(Z.a)(ue,Oe.popupClassName,Oe.popupClassName&&!ke),Object(Z.a)(ue,"".concat(Ze,"-rtl"),dr),ue)),Gt=Oe.disabled,zt=Oe.triggerSubMenuAction,pr=Oe.subMenuOpenDelay,Mr=Oe.forceSubMenuRender,ir=Oe.subMenuCloseDelay,Ur=Oe.builtinPlacements;se.forEach(function(zr){return delete Oe[zr]}),delete Oe.onClick;var oi=dr?Object(G.a)(Object(G.a)({},Ce),Ur):Object(G.a)(Object(G.a)({},ce),Ur);delete Oe.direction;var jr=this.getBaseProps(),Xr=ke?null:this.getMotion(jr.mode,jr.visible);return P.createElement("li",Object(C.a)({},Oe,rn,{className:Ut,role:"menuitem"}),P.createElement(sr,{prefixCls:Ze,popupClassName:K()("".concat(Ze,"-popup"),En),getPopupContainer:Lr,builtinPlacements:oi,popupPlacement:gn,popupVisible:ke?!1:Pe,popupAlign:en,popup:ke?null:Cr,action:Gt||ke?[]:[zt],mouseEnterDelay:pr,mouseLeaveDelay:ir,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Mr,popupMotion:Xr},gr),ke?Cr:null)}}]),ze}(P.Component);it.defaultProps={onMouseEnter:Ot,onMouseLeave:Ot,onTitleMouseEnter:Ot,onTitleMouseLeave:Ot,onTitleClick:Ot,manualRef:Ot,mode:"vertical",title:""};var Dt=Object(p.b)(function(Ee,Ne){var ze=Ee.openKeys,Se=Ee.activeKey,re=Ee.selectedKeys,ge=Ne.eventKey,ue=Ne.subMenuKey;return{isOpen:ze.indexOf(ge)>-1,active:Se[ue]===ge,selectedKeys:re}})(it);Dt.isSubMenu=!0;var Tt=Dt,Be="menuitem-overflowed",_t=.5,at=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(){var Se;return Object(R.a)(this,ze),Se=Ne.apply(this,arguments),Se.resizeObserver=null,Se.mutationObserver=null,Se.originalTotalWidth=0,Se.overflowedItems=[],Se.menuItemSizes=[],Se.cancelFrameId=null,Se.state={lastVisibleIndex:void 0},Se.childRef=P.createRef(),Se.getMenuItemNodes=function(){var re=Se.props.prefixCls,ge=Se.childRef.current;return ge?[].slice.call(ge.children).filter(function(ue){return ue.className.split(" ").indexOf("".concat(re,"-overflowed-submenu"))<0}):[]},Se.getOverflowedSubMenuItem=function(re,ge,ue){var Oe=Se.props,Pe=Oe.overflowedIndicator,Ze=Oe.level,ke=Oe.mode,ut=Oe.prefixCls,Ut=Oe.theme;if(Ze!==1||ke!=="horizontal")return null;var rn=Se.props.children[0],mn=rn.props,Hn=mn.children,Vn=mn.title,fr=mn.style,dr=Object(U.a)(mn,["children","title","style"]),wr=Object(G.a)({},fr),Ar="".concat(re,"-overflowed-indicator"),gr="".concat(re,"-overflowed-indicator");ge.length===0&&ue!==!0?wr=Object(G.a)(Object(G.a)({},wr),{},{display:"none"}):ue&&(wr=Object(G.a)(Object(G.a)({},wr),{},{visibility:"hidden",position:"absolute"}),Ar="".concat(Ar,"-placeholder"),gr="".concat(gr,"-placeholder"));var Cr=Ut?"".concat(ut,"-").concat(Ut):"",Lr={};return se.forEach(function(gn){dr[gn]!==void 0&&(Lr[gn]=dr[gn])}),P.createElement(Tt,Object(C.a)({title:Pe,className:"".concat(ut,"-overflowed-submenu"),popupClassName:Cr},Lr,{key:Ar,eventKey:gr,disabled:!1,style:wr}),ge)},Se.setChildrenWidthAndResize=function(){if(Se.props.mode!=="horizontal")return;var re=Se.childRef.current;if(!re)return;var ge=re.children;if(!ge||ge.length===0)return;var ue=re.children[ge.length-1];Ge(ue,"display","inline-block");var Oe=Se.getMenuItemNodes(),Pe=Oe.filter(function(Ze){return Ze.className.split(" ").indexOf(Be)>=0});Pe.forEach(function(Ze){Ge(Ze,"display","inline-block")}),Se.menuItemSizes=Oe.map(function(Ze){return Ue(Ze,!0)}),Pe.forEach(function(Ze){Ge(Ze,"display","none")}),Se.overflowedIndicatorWidth=Ue(re.children[re.children.length-1],!0),Se.originalTotalWidth=Se.menuItemSizes.reduce(function(Ze,ke){return Ze+ke},0),Se.handleResize(),Ge(ue,"display","none")},Se.handleResize=function(){if(Se.props.mode!=="horizontal")return;var re=Se.childRef.current;if(!re)return;var ge=Ue(re);Se.overflowedItems=[];var ue=0,Oe;Se.originalTotalWidth>ge+_t&&(Oe=-1,Se.menuItemSizes.forEach(function(Pe){ue+=Pe,ue+Se.overflowedIndicatorWidth<=ge&&(Oe+=1)})),Se.setState({lastVisibleIndex:Oe})},Se}return Object(S.a)(ze,[{key:"componentDidMount",value:function(){var re=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ge=this.childRef.current;if(!ge)return;this.resizeObserver=new Wt.default(function(ue){ue.forEach(function(){var Oe=re.cancelFrameId;cancelAnimationFrame(Oe),re.cancelFrameId=requestAnimationFrame(re.setChildrenWidthAndResize)})}),[].slice.call(ge.children).concat(ge).forEach(function(ue){re.resizeObserver.observe(ue)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){re.resizeObserver.disconnect(),[].slice.call(ge.children).concat(ge).forEach(function(ue){re.resizeObserver.observe(ue)}),re.setChildrenWidthAndResize()}),this.mutationObserver.observe(ge,{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(re){var ge=this,ue=this.state.lastVisibleIndex;return(re||[]).reduce(function(Oe,Pe,Ze){var ke=Pe;if(ge.props.mode==="horizontal"){var ut=ge.getOverflowedSubMenuItem(Pe.props.eventKey,[]);ue!==void 0&&ge.props.className.indexOf("".concat(ge.props.prefixCls,"-root"))!==-1&&(Ze>ue&&(ke=P.cloneElement(Pe,{style:{display:"none"},eventKey:"".concat(Pe.props.eventKey,"-hidden"),className:"".concat(Be)})),Ze===ue+1&&(ge.overflowedItems=re.slice(ue+1).map(function(rn){return P.cloneElement(rn,{key:rn.props.eventKey,mode:"vertical-left"})}),ut=ge.getOverflowedSubMenuItem(Pe.props.eventKey,ge.overflowedItems)));var Ut=[].concat(Object(M.a)(Oe),[ut,ke]);return Ze===re.length-1&&Ut.push(ge.getOverflowedSubMenuItem(Pe.props.eventKey,[],!0)),Ut}return[].concat(Object(M.a)(Oe),[ke])},[])}},{key:"render",value:function(){var re=this.props,ge=re.visible,ue=re.prefixCls,Oe=re.overflowedIndicator,Pe=re.mode,Ze=re.level,ke=re.tag,ut=re.children,Ut=re.theme,rn=Object(U.a)(re,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),mn=ke;return P.createElement(mn,Object(C.a)({ref:this.childRef},rn),this.renderChildren(ut))}}]),ze}(P.Component);at.defaultProps={tag:"div",className:""};var dt=at;function wt(Ee){return Ee.length?Ee.every(function(Ne){return!!Ne.props.disabled}):!0}function It(Ee,Ne,ze){var Se=Ee.getState();Ee.setState({activeKey:Object(G.a)(Object(G.a)({},Se.activeKey),{},Object(Z.a)({},Ne,ze))})}function gt(Ee){return Ee.eventKey||"0-menu-"}function Xt(Ee,Ne){var ze=Ne,Se=Ee.children,re=Ee.eventKey;if(ze){var ge;if(ht(Se,function(ue,Oe){ue&&ue.props&&!ue.props.disabled&&ze===Ve(ue,re,Oe)&&(ge=!0)}),ge)return ze}return ze=null,Ee.defaultActiveFirst&&ht(Se,function(ue,Oe){!ze&&ue&&!ue.props.disabled&&(ze=Ve(ue,re,Oe))}),ze}function dn(Ee){if(!Ee)return;var Ne=this.instanceArray.indexOf(Ee);Ne!==-1?this.instanceArray[Ne]=Ee:this.instanceArray.push(Ee)}var Pn=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(Se){var re;return Object(R.a)(this,ze),re=Ne.call(this,Se),re.onKeyDown=function(ge,ue){var Oe=ge.keyCode,Pe;if(re.getFlatInstanceArray().forEach(function(ke){ke&&ke.props.active&&ke.onKeyDown&&(Pe=ke.onKeyDown(ge))}),Pe)return 1;var Ze=null;return(Oe===a.a.UP||Oe===a.a.DOWN)&&(Ze=re.step(Oe===a.a.UP?-1:1)),Ze?(ge.preventDefault(),It(re.props.store,gt(re.props),Ze.props.eventKey),typeof ue=="function"&&ue(Ze),1):void 0},re.onItemHover=function(ge){var ue=ge.key,Oe=ge.hover;It(re.props.store,gt(re.props),Oe?ue:null)},re.onDeselect=function(ge){re.props.onDeselect(ge)},re.onSelect=function(ge){re.props.onSelect(ge)},re.onClick=function(ge){re.props.onClick(ge)},re.onOpenChange=function(ge){re.props.onOpenChange(ge)},re.onDestroy=function(ge){re.props.onDestroy(ge)},re.getFlatInstanceArray=function(){return re.instanceArray},re.step=function(ge){var ue=re.getFlatInstanceArray(),Oe=re.props.store.getState().activeKey[gt(re.props)],Pe=ue.length;if(!Pe)return null;ge<0&&(ue=ue.concat().reverse());var Ze=-1;if(ue.every(function(rn,mn){return rn&&rn.props.eventKey===Oe?(Ze=mn,!1):!0}),!re.props.defaultActiveFirst&&Ze!==-1&&wt(ue.slice(Ze,Pe-1)))return;var ke=(Ze+1)%Pe,ut=ke;do{var Ut=ue[ut];if(!Ut||Ut.props.disabled)ut=(ut+1)%Pe;else return Ut}while(ut!==ke);return null},re.renderCommonMenuItem=function(ge,ue,Oe){var Pe=re.props.store.getState(),Ze=Object(v.a)(re),ke=Ze.props,ut=Ve(ge,ke.eventKey,ue),Ut=ge.props;if(!Ut||typeof ge.type=="string")return ge;var rn=ut===Pe.activeKey,mn=Object(G.a)(Object(G.a)({mode:Ut.mode||ke.mode,level:ke.level,inlineIndent:ke.inlineIndent,renderMenuItem:re.renderMenuItem,rootPrefixCls:ke.prefixCls,index:ue,parentMenu:ke.parentMenu,manualRef:Ut.disabled?void 0:Object(g.a)(ge.ref,dn.bind(Object(v.a)(re))),eventKey:ut,active:!Ut.disabled&&rn,multiple:ke.multiple,onClick:function(Vn){(Ut.onClick||Ot)(Vn),re.onClick(Vn)},onItemHover:re.onItemHover,motion:ke.motion,subMenuOpenDelay:ke.subMenuOpenDelay,subMenuCloseDelay:ke.subMenuCloseDelay,forceSubMenuRender:ke.forceSubMenuRender,onOpenChange:re.onOpenChange,onDeselect:re.onDeselect,onSelect:re.onSelect,builtinPlacements:ke.builtinPlacements,itemIcon:Ut.itemIcon||re.props.itemIcon,expandIcon:Ut.expandIcon||re.props.expandIcon},Oe),{},{direction:ke.direction});return(ke.mode==="inline"||et())&&(mn.triggerSubMenuAction="click"),P.cloneElement(ge,Object(G.a)(Object(G.a)({},mn),{},{key:ut||ue}))},re.renderMenuItem=function(ge,ue,Oe){if(!ge)return null;var Pe=re.props.store.getState(),Ze={openKeys:Pe.openKeys,selectedKeys:Pe.selectedKeys,triggerSubMenuAction:re.props.triggerSubMenuAction,subMenuKey:Oe};return re.renderCommonMenuItem(ge,ue,Ze)},Se.store.setState({activeKey:Object(G.a)(Object(G.a)({},Se.store.getState().activeKey),{},Object(Z.a)({},Se.eventKey,Xt(Se,Se.activeKey)))}),re.instanceArray=[],re}return Object(S.a)(ze,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(re){return this.props.visible||re.visible||this.props.className!==re.className||!j()(this.props.style,re.style)}},{key:"componentDidUpdate",value:function(re){var ge=this.props,ue="activeKey"in ge?ge.activeKey:ge.store.getState().activeKey[gt(ge)],Oe=Xt(ge,ue);if(Oe!==ue)It(ge.store,gt(ge),Oe);else if("activeKey"in re){var Pe=Xt(re,re.activeKey);Oe!==Pe&&It(ge.store,gt(ge),Oe)}}},{key:"render",value:function(){var re=this,ge=Object(C.a)({},this.props);this.instanceArray=[];var ue=K()(ge.prefixCls,ge.className,"".concat(ge.prefixCls,"-").concat(ge.mode)),Oe={className:ue,role:ge.role||"menu"};ge.id&&(Oe.id=ge.id),ge.focusable&&(Oe.tabIndex=0,Oe.onKeyDown=this.onKeyDown);var Pe=ge.prefixCls,Ze=ge.eventKey,ke=ge.visible,ut=ge.level,Ut=ge.mode,rn=ge.overflowedIndicator,mn=ge.theme;return se.forEach(function(Hn){return delete ge[Hn]}),delete ge.onClick,P.createElement(dt,Object(C.a)({},ge,{prefixCls:Pe,mode:Ut,tag:"ul",level:ut,theme:mn,visible:ke,overflowedIndicator:rn},Oe),Object(k.a)(ge.children).map(function(Hn,Vn){return re.renderMenuItem(Hn,Vn,Ze||"0-menu-")}))}}]),ze}(P.Component);Pn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ot};var Gn=Object(p.b)()(Pn),Sn=Gn,Nn=D("Kwbf");function Mn(Ee,Ne,ze){var Se=Ee.prefixCls,re=Ee.motion,ge=Ee.defaultMotions,ue=ge===void 0?{}:ge,Oe=Ee.openAnimation,Pe=Ee.openTransitionName,Ze=Ne.switchingModeFromInline;if(re)return re;if(Object(B.a)(Oe)==="object"&&Oe)Object(Nn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Oe=="string")return{motionName:"".concat(Se,"-open-").concat(Oe)};if(Pe)return{motionName:Pe};var ke=ue[ze];return ke||(Ze?null:ue.other)}var Pt=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(Se){var re;Object(R.a)(this,ze),re=Ne.call(this,Se),re.onSelect=function(Oe){var Pe=Object(v.a)(re),Ze=Pe.props;if(Ze.selectable){var ke=re.store.getState(),ut=ke.selectedKeys,Ut=Oe.key;Ze.multiple?ut=ut.concat([Ut]):ut=[Ut],"selectedKeys"in Ze||re.store.setState({selectedKeys:ut}),Ze.onSelect(Object(G.a)(Object(G.a)({},Oe),{},{selectedKeys:ut}))}},re.onClick=function(Oe){var Pe=re.getRealMenuMode(),Ze=Object(v.a)(re),ke=Ze.store,ut=Ze.props.onOpenChange;Pe!=="inline"&&!("openKeys"in re.props)&&(ke.setState({openKeys:[]}),ut([])),re.props.onClick(Oe)},re.onKeyDown=function(Oe,Pe){re.innerMenu.getWrappedInstance().onKeyDown(Oe,Pe)},re.onOpenChange=function(Oe){var Pe=Object(v.a)(re),Ze=Pe.props,ke=re.store.getState().openKeys.concat(),ut=!1,Ut=function(mn){var Hn=!1;if(mn.open)Hn=ke.indexOf(mn.key)===-1,Hn&&ke.push(mn.key);else{var Vn=ke.indexOf(mn.key);Hn=Vn!==-1,Hn&&ke.splice(Vn,1)}ut=ut||Hn};Array.isArray(Oe)?Oe.forEach(Ut):Ut(Oe),ut&&("openKeys"in re.props||re.store.setState({openKeys:ke}),Ze.onOpenChange(ke))},re.onDeselect=function(Oe){var Pe=Object(v.a)(re),Ze=Pe.props;if(Ze.selectable){var ke=re.store.getState().selectedKeys.concat(),ut=Oe.key,Ut=ke.indexOf(ut);Ut!==-1&&ke.splice(Ut,1),"selectedKeys"in Ze||re.store.setState({selectedKeys:ke}),Ze.onDeselect(Object(G.a)(Object(G.a)({},Oe),{},{selectedKeys:ke}))}},re.onMouseEnter=function(Oe){re.restoreModeVerticalFromInline();var Pe=re.props.onMouseEnter;Pe&&Pe(Oe)},re.onTransitionEnd=function(Oe){var Pe=Oe.propertyName==="width"&&Oe.target===Oe.currentTarget,Ze=Oe.target.className,ke=Object.prototype.toString.call(Ze)==="[object SVGAnimatedString]"?Ze.animVal:Ze,ut=Oe.propertyName==="font-size"&&ke.indexOf("anticon")>=0;(Pe||ut)&&re.restoreModeVerticalFromInline()},re.setInnerMenu=function(Oe){re.innerMenu=Oe},re.isRootMenu=!0;var ge=Se.defaultSelectedKeys,ue=Se.defaultOpenKeys;return"selectedKeys"in Se&&(ge=Se.selectedKeys||[]),"openKeys"in Se&&(ue=Se.openKeys||[]),re.store=Object(p.c)({selectedKeys:ge,openKeys:ue,activeKey:{"0-menu-":Xt(Se,Se.activeKey)}}),re.state={switchingModeFromInline:!1,prevProps:Se,inlineOpenKeys:[],store:re.store},re}return Object(S.a)(ze,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(re){var ge=this.props,ue=ge.siderCollapsed,Oe=ge.inlineCollapsed,Pe=ge.onOpenChange;(!re.inlineCollapsed&&Oe||!re.siderCollapsed&&ue)&&Pe([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var re=this.props.collapsedWidth,ge=this.store,ue=this.prevOpenKeys,Oe=this.getInlineCollapsed()&&(re===0||re==="0"||re==="0px");Oe?(this.prevOpenKeys=ge.getState().openKeys.concat(),this.store.setState({openKeys:[]})):ue&&(this.store.setState({openKeys:ue}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var re=this.props.mode,ge=this.state.switchingModeFromInline,ue=this.getInlineCollapsed();return ge&&ue?"inline":ue?"vertical":re}},{key:"getInlineCollapsed",value:function(){var re=this.props,ge=re.inlineCollapsed,ue=re.siderCollapsed;return ue!==void 0?ue:ge}},{key:"restoreModeVerticalFromInline",value:function(){var re=this.state.switchingModeFromInline;re&&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 re=Object(G.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ge=this.getRealMenuMode();return re.className+=" ".concat(re.prefixCls,"-root"),re.direction==="rtl"&&(re.className+=" ".concat(re.prefixCls,"-rtl")),re=Object(G.a)(Object(G.a)({},re),{},{mode:ge,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Mn(this.props,this.state,ge)}),delete re.openAnimation,delete re.openTransitionName,P.createElement(p.a,{store:this.store},P.createElement(Sn,Object(C.a)({},re,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(re,ge){var ue=ge.prevProps,Oe=ge.store,Pe=Oe.getState(),Ze={},ke={prevProps:re};return ue.mode==="inline"&&re.mode!=="inline"&&(ke.switchingModeFromInline=!0),"openKeys"in re?Ze.openKeys=re.openKeys||[]:((re.inlineCollapsed&&!ue.inlineCollapsed||re.siderCollapsed&&!ue.siderCollapsed)&&(ke.switchingModeFromInline=!0,ke.inlineOpenKeys=Pe.openKeys,Ze.openKeys=[]),(!re.inlineCollapsed&&ue.inlineCollapsed||!re.siderCollapsed&&ue.siderCollapsed)&&(Ze.openKeys=ge.inlineOpenKeys,ke.inlineOpenKeys=[])),Object.keys(Ze).length&&Oe.setState(Ze),ke}}]),ze}(P.Component);Pt.defaultProps={selectable:!0,onClick:Ot,onSelect:Ot,onOpenChange:Ot,onDeselect:Ot,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:P.createElement("span",null,"\xB7\xB7\xB7")};var hn=Pt,Ht=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(){var Se;return Object(R.a)(this,ze),Se=Ne.apply(this,arguments),Se.onKeyDown=function(re){var ge=re.keyCode;return ge===a.a.ENTER?(Se.onClick(re),!0):void 0},Se.onMouseLeave=function(re){var ge=Se.props,ue=ge.eventKey,Oe=ge.onItemHover,Pe=ge.onMouseLeave;Oe({key:ue,hover:!1}),Pe({key:ue,domEvent:re})},Se.onMouseEnter=function(re){var ge=Se.props,ue=ge.eventKey,Oe=ge.onItemHover,Pe=ge.onMouseEnter;Oe({key:ue,hover:!0}),Pe({key:ue,domEvent:re})},Se.onClick=function(re){var ge=Se.props,ue=ge.eventKey,Oe=ge.multiple,Pe=ge.onClick,Ze=ge.onSelect,ke=ge.onDeselect,ut=ge.isSelected,Ut={key:ue,keyPath:[ue],item:Object(v.a)(Se),domEvent:re};Pe(Ut),Oe?ut?ke(Ut):Ze(Ut):ut||Ze(Ut)},Se.saveNode=function(re){Se.node=re},Se}return Object(S.a)(ze,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var re=this.props;re.onDestroy&&re.onDestroy(re.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 re,ge=Object(G.a)({},this.props),ue=K()(this.getPrefixCls(),ge.className,(re={},Object(Z.a)(re,this.getActiveClassName(),!ge.disabled&&ge.active),Object(Z.a)(re,this.getSelectedClassName(),ge.isSelected),Object(Z.a)(re,this.getDisabledClassName(),ge.disabled),re)),Oe=Object(G.a)(Object(G.a)({},ge.attribute),{},{title:typeof ge.title=="string"?ge.title:void 0,className:ue,role:ge.role||"menuitem","aria-disabled":ge.disabled});ge.role==="option"?Oe=Object(G.a)(Object(G.a)({},Oe),{},{role:"option","aria-selected":ge.isSelected}):(ge.role===null||ge.role==="none")&&(Oe.role="none");var Pe={onClick:ge.disabled?null:this.onClick,onMouseLeave:ge.disabled?null:this.onMouseLeave,onMouseEnter:ge.disabled?null:this.onMouseEnter},Ze=Object(G.a)({},ge.style);ge.mode==="inline"&&(ge.direction==="rtl"?Ze.paddingRight=ge.inlineIndent*ge.level:Ze.paddingLeft=ge.inlineIndent*ge.level),se.forEach(function(ut){return delete ge[ut]}),delete ge.direction;var ke=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ke=P.createElement(this.props.itemIcon,this.props)),P.createElement("li",Object(C.a)({},Object(_.a)(ge,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Oe,Pe,{style:Ze,ref:this.saveNode}),ge.children,ke)}}]),ze}(P.Component);Ht.isMenuItem=!0,Ht.defaultProps={onSelect:Ot,onMouseEnter:Ot,onMouseLeave:Ot,manualRef:Ot};var Rt=Object(p.b)(function(Ee,Ne){var ze=Ee.activeKey,Se=Ee.selectedKeys,re=Ne.eventKey,ge=Ne.subMenuKey;return{active:ze[ge]===re,isSelected:Array.isArray(Se)?Se.indexOf(re)!==-1:Se===re}})(Ht),Un=Rt,On=function(Ee){Object(E.a)(ze,Ee);var Ne=Object(h.a)(ze);function ze(){var Se;return Object(R.a)(this,ze),Se=Ne.apply(this,arguments),Se.renderInnerMenuItem=function(re){var ge=Se.props,ue=ge.renderMenuItem,Oe=ge.index;return ue(re,Oe,Se.props.subMenuKey)},Se}return Object(S.a)(ze,[{key:"render",value:function(){var re=Object(C.a)({},this.props),ge=re.className,ue=ge===void 0?"":ge,Oe=re.rootPrefixCls,Pe="".concat(Oe,"-item-group-title"),Ze="".concat(Oe,"-item-group-list"),ke=re.title,ut=re.children;return se.forEach(function(Ut){return delete re[Ut]}),delete re.direction,P.createElement("li",Object(C.a)({},re,{onClick:function(rn){return rn.stopPropagation()},className:"".concat(ue," ").concat(Oe,"-item-group")}),P.createElement("div",{className:Pe,title:typeof ke=="string"?ke:void 0},ke),P.createElement("ul",{className:Ze},P.Children.map(ut,this.renderInnerMenuItem)))}}]),ze}(P.Component);On.isMenuItemGroup=!0,On.defaultProps={disabled:!0};var Vt=On,ft=function(Ne){var ze=Ne.className,Se=Ne.rootPrefixCls,re=Ne.style;return P.createElement("li",{className:"".concat(ze," ").concat(Se,"-item-divider"),style:re})};ft.defaultProps={disabled:!0,className:"",style:{}};var jn=ft,fn=hn,Qn=D("eDIo");function Zt(Ee,Ne){var ze=Ee.prefixCls,Se=Ee.editable,re=Ee.locale,ge=Ee.style;return!Se||Se.showAdd===!1?null:P.createElement("button",{ref:Ne,type:"button",className:"".concat(ze,"-nav-add"),style:ge,"aria-label":(re==null?void 0:re.addAriaLabel)||"Add tab",onClick:function(Oe){Se.onEdit("add",{event:Oe})}},Se.addIcon||"+")}var Rn=P.forwardRef(Zt);function Fn(Ee,Ne){var ze=Ee.prefixCls,Se=Ee.id,re=Ee.tabs,ge=Ee.locale,ue=Ee.mobile,Oe=Ee.moreIcon,Pe=Oe===void 0?"More":Oe,Ze=Ee.moreTransitionName,ke=Ee.style,ut=Ee.className,Ut=Ee.editable,rn=Ee.tabBarGutter,mn=Ee.rtl,Hn=Ee.onTabClick,Vn=Object(P.useState)(!1),fr=Object(V.a)(Vn,2),dr=fr[0],wr=fr[1],Ar=Object(P.useState)(null),gr=Object(V.a)(Ar,2),Cr=gr[0],Lr=gr[1],gn="".concat(Se,"-more-popup"),en="".concat(ze,"-dropdown"),En=Cr!==null?"".concat(gn,"-").concat(Cr):null,Gt=ge==null?void 0:ge.dropdownAriaLabel,zt=P.createElement(fn,{onClick:function(Xr){var zr=Xr.key,Wr=Xr.domEvent;Hn(zr,Wr),wr(!1)},id:gn,tabIndex:-1,role:"listbox","aria-activedescendant":En,selectedKeys:[Cr],"aria-label":Gt!==void 0?Gt:"expanded dropdown"},re.map(function(jr){return P.createElement(Un,{key:jr.key,id:"".concat(gn,"-").concat(jr.key),role:"option","aria-controls":Se&&"".concat(Se,"-panel-").concat(jr.key),disabled:jr.disabled},jr.tab)}));function pr(jr){for(var Xr=re.filter(function(yi){return!yi.disabled}),zr=Xr.findIndex(function(yi){return yi.key===Cr})||0,Wr=Xr.length,Hr=0;Hr<Wr;Hr+=1){zr=(zr+jr+Wr)%Wr;var vr=Xr[zr];if(!vr.disabled){Lr(vr.key);return}}}function Mr(jr){var Xr=jr.which;if(!dr){[a.a.DOWN,a.a.SPACE,a.a.ENTER].includes(Xr)&&(wr(!0),jr.preventDefault());return}switch(Xr){case a.a.UP:pr(-1),jr.preventDefault();break;case a.a.DOWN:pr(1),jr.preventDefault();break;case a.a.ESC:wr(!1);break;case a.a.SPACE:case a.a.ENTER:Cr!==null&&Hn(Cr,jr);break}}Object(P.useEffect)(function(){var jr=document.getElementById(En);jr&&jr.scrollIntoView&&jr.scrollIntoView(!1)},[Cr]),Object(P.useEffect)(function(){dr||Lr(null)},[dr]);var ir=Object(Z.a)({},mn?"marginLeft":"marginRight",rn);re.length||(ir.visibility="hidden",ir.order=1);var Ur=K()(Object(Z.a)({},"".concat(en,"-rtl"),mn)),oi=ue?null:P.createElement(Qn.a,{prefixCls:en,overlay:zt,trigger:["hover"],visible:dr,transitionName:Ze,onVisibleChange:wr,overlayClassName:Ur,mouseEnterDelay:.1,mouseLeaveDelay:.1},P.createElement("button",{type:"button",className:"".concat(ze,"-nav-more"),style:ir,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":gn,id:"".concat(Se,"-more"),"aria-expanded":dr,onKeyDown:Mr},Pe));return P.createElement("div",{className:K()("".concat(ze,"-nav-operations"),ut),style:ke,ref:Ne},oi,P.createElement(Rn,{prefixCls:ze,locale:ge,editable:Ut}))}var vn=P.forwardRef(Fn),yr=Object(P.createContext)(null),Dn=.1,xn=.01,Lt=20,Qe=Math.pow(.995,Lt);function Nt(){var Ee=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Ee)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Ee.substr(0,4)))}function Mt(Ee,Ne){var ze=Object(P.useState)(),Se=Object(V.a)(ze,2),re=Se[0],ge=Se[1],ue=Object(P.useState)(0),Oe=Object(V.a)(ue,2),Pe=Oe[0],Ze=Oe[1],ke=Object(P.useState)(0),ut=Object(V.a)(ke,2),Ut=ut[0],rn=ut[1],mn=Object(P.useState)(),Hn=Object(V.a)(mn,2),Vn=Hn[0],fr=Hn[1],dr=Object(P.useRef)();function wr(Gt){var zt=Gt.touches[0],pr=zt.screenX,Mr=zt.screenY;ge({x:pr,y:Mr}),window.clearInterval(dr.current)}function Ar(Gt){if(!re)return;Gt.preventDefault();var zt=Gt.touches[0],pr=zt.screenX,Mr=zt.screenY;ge({x:pr,y:Mr});var ir=pr-re.x,Ur=Mr-re.y;Ne(ir,Ur);var oi=Date.now();Ze(oi),rn(oi-Pe),fr({x:ir,y:Ur})}function gr(){if(!re)return;if(ge(null),fr(null),Vn){var Gt=Vn.x/Ut,zt=Vn.y/Ut,pr=Math.abs(Gt),Mr=Math.abs(zt);if(Math.max(pr,Mr)<Dn)return;var ir=Gt,Ur=zt;dr.current=window.setInterval(function(){if(Math.abs(ir)<xn&&Math.abs(Ur)<xn){window.clearInterval(dr.current);return}ir*=Qe,Ur*=Qe,Ne(ir*Lt,Ur*Lt)},Lt)}}var Cr=Object(P.useRef)(0),Lr=Object(P.useRef)(!1),gn=Object(P.useRef)();function en(Gt){var zt=Gt.deltaX,pr=Gt.deltaY,Mr=0,ir=Math.abs(zt),Ur=Math.abs(pr);ir===Ur?Mr=gn.current==="x"?zt:pr:ir>Ur?(Mr=zt,gn.current="x"):(Mr=pr,gn.current="y");var oi=Date.now();oi-Cr.current>100&&(Lr.current=!1),(Ne(-Mr,-Mr)||Lr.current)&&(Gt.preventDefault(),Lr.current=!0),Cr.current=oi}var En=Object(P.useRef)(null);En.current={onTouchStart:wr,onTouchMove:Ar,onTouchEnd:gr,onWheel:en},P.useEffect(function(){function Gt(ir){En.current.onTouchStart(ir)}function zt(ir){En.current.onTouchMove(ir)}function pr(ir){En.current.onTouchEnd(ir)}function Mr(ir){En.current.onWheel(ir)}return document.addEventListener("touchmove",zt,{passive:!1}),document.addEventListener("touchend",pr,{passive:!1}),Ee.current.addEventListener("touchstart",Gt,{passive:!1}),Ee.current.addEventListener("wheel",Mr),function(){document.removeEventListener("touchmove",zt),document.removeEventListener("touchend",pr)}},[])}function cn(){var Ee=Object(P.useRef)(new Map);function Ne(Se){return Ee.current.has(Se)||Ee.current.set(Se,P.createRef()),Ee.current.get(Se)}function ze(Se){Ee.current.delete(Se)}return[Ne,ze]}function zn(Ee,Ne){var ze=P.useRef(Ee),Se=P.useState({}),re=Object(V.a)(Se,2),ge=re[1];function ue(Oe){var Pe=typeof Oe=="function"?Oe(ze.current):Oe;Pe!==ze.current&&Ne(Pe,ze.current),ze.current=Pe,ge({})}return[ze.current,ue]}var kn=function(Ne){var ze=Ne.position,Se=Ne.prefixCls,re=Ne.extra;if(!re)return null;var ge,ue=re;return ze==="right"&&(ge=ue.right||!ue.left&&ue||null),ze==="left"&&(ge=ue.left||null),ge?P.createElement("div",{className:"".concat(Se,"-extra-content")},ge):null};function lr(Ee,Ne){var ze,Se=P.useContext(yr),re=Se.prefixCls,ge=Se.tabs,ue=Ee.className,Oe=Ee.style,Pe=Ee.id,Ze=Ee.animated,ke=Ee.activeKey,ut=Ee.rtl,Ut=Ee.extra,rn=Ee.editable,mn=Ee.locale,Hn=Ee.tabPosition,Vn=Ee.tabBarGutter,fr=Ee.children,dr=Ee.onTabClick,wr=Ee.onTabScroll,Ar=Object(P.useRef)(),gr=Object(P.useRef)(),Cr=Object(P.useRef)(),Lr=Object(P.useRef)(),gn=cn(),en=Object(V.a)(gn,2),En=en[0],Gt=en[1],zt=Hn==="top"||Hn==="bottom",pr=zn(0,function($r,Nr){zt&&wr&&wr({direction:$r>Nr?"left":"right"})}),Mr=Object(V.a)(pr,2),ir=Mr[0],Ur=Mr[1],oi=zn(0,function($r,Nr){!zt&&wr&&wr({direction:$r>Nr?"top":"bottom"})}),jr=Object(V.a)(oi,2),Xr=jr[0],zr=jr[1],Wr=Object(P.useState)(0),Hr=Object(V.a)(Wr,2),vr=Hr[0],yi=Hr[1],Qi=Object(P.useState)(0),ji=Object(V.a)(Qi,2),Ri=ji[0],ui=ji[1],qr=Object(P.useState)(0),ii=Object(V.a)(qr,2),ci=ii[0],Fi=ii[1],ha=Object(P.useState)(0),sa=Object(V.a)(ha,2),ei=sa[0],Zi=sa[1],qi=Object(P.useState)(null),si=Object(V.a)(qi,2),Qr=si[0],Ti=si[1],Ma=Object(P.useState)(null),no=Object(V.a)(Ma,2),la=no[0],Ca=no[1],Ta=Object(P.useState)(0),Sa=Object(V.a)(Ta,2),ka=Sa[0],co=Sa[1],Ro=Object(P.useState)(0),za=Object(V.a)(Ro,2),Oa=za[0],Va=za[1],_a=o(new Map),Ra=Object(V.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(ge,ho,vr),Da="".concat(re,"-nav-operations-hidden"),ya=0,Ni=0;zt?ut?(ya=0,Ni=Math.max(0,vr-Qr)):(ya=Math.min(0,Qr-vr),Ni=0):(ya=Math.min(0,la-Ri),Ni=0);function fa($r){return $r<ya?[ya,!1]:$r>Ni?[Ni,!1]:[$r,!0]}var pa=Object(P.useRef)(),ba=Object(P.useState)(),ma=Object(V.a)(ba,2),Xa=ma[0],$a=ma[1];function Ja(){$a(Date.now())}function Ia(){window.clearTimeout(pa.current)}Mt(Ar,function($r,Nr){var gi=!1;function Bi(La,ca){La(function(ja){var da=fa(ja+ca),Si=Object(V.a)(da,2),Fa=Si[0],Ba=Si[1];return gi=Ba,Fa})}if(zt){if(Qr>=vr)return gi;Bi(Ur,$r)}else{if(la>=Ri)return gi;Bi(zr,Nr)}return Ia(),Ja(),gi}),Object(P.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var $r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ke,Nr=Aa.get($r);if(!Nr)return;if(zt){var gi=ir;ut?Nr.right<ir?gi=Nr.right:Nr.right+Nr.width>ir+Qr&&(gi=Nr.right+Nr.width-Qr):Nr.left<-ir?gi=-Nr.left:Nr.left+Nr.width>-ir+Qr&&(gi=-(Nr.left+Nr.width-Qr)),zr(0),Ur(fa(gi)[0])}else{var Bi=Xr;Nr.top<-Xr?Bi=-Nr.top:Nr.top+Nr.height>-Xr+la&&(Bi=-(Nr.top+Nr.height-la)),Ur(0),zr(fa(Bi)[0])}}var Ea=T(Aa,{width:Qr,height:la,left:ir,top:Xr},{width:ci,height:ei},{width:ka,height:Oa},Object(G.a)(Object(G.a)({},Ee),{},{tabs:ge})),ro=Object(V.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=ge.map(function($r){var Nr=$r.key;return P.createElement(s,{id:Pe,prefixCls:re,key:Nr,rtl:ut,tab:$r,closable:$r.closable,editable:rn,active:Nr===ke,tabPosition:Hn,tabBarGutter:Vn,renderWrapper:fr,removeAriaLabel:mn==null?void 0:mn.removeAriaLabel,ref:En(Nr),onClick:function(Bi){dr(Nr,Bi)},onRemove:function(){Gt(Nr)},onFocus:function(){ua(Nr),Ja(),ut||(Ar.current.scrollLeft=0),Ar.current.scrollTop=0}})}),io=l(function(){var $r,Nr,gi,Bi,La,ca,ja,da,Si,Fa=(($r=Ar.current)===null||$r===void 0?void 0:$r.offsetWidth)||0,Ba=((Nr=Ar.current)===null||Nr===void 0?void 0:Nr.offsetHeight)||0,Ha=((gi=Lr.current)===null||gi===void 0?void 0:gi.offsetWidth)||0,Gi=((Bi=Lr.current)===null||Bi===void 0?void 0:Bi.offsetHeight)||0,Vr=((La=Cr.current)===null||La===void 0?void 0:La.offsetWidth)||0,Or=((ca=Cr.current)===null||ca===void 0?void 0:ca.offsetHeight)||0;Ti(Fa),Ca(Ba),co(Ha),Va(Gi);var $n=(((ja=gr.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,hr=(((da=gr.current)===null||da===void 0?void 0:da.offsetHeight)||0)-Gi;yi($n),ui(hr);var Ir=(Si=Cr.current)===null||Si===void 0?void 0:Si.className.includes(Da);Fi($n-(Ir?0:Vr)),Zi(hr-(Ir?0:Or)),Ya(function(){var fi=new Map;return ge.forEach(function(ga){var aa=ga.key,Mi=En(aa).current;Mi&&fi.set(aa,{width:Mi.offsetWidth,height:Mi.offsetHeight,left:Mi.offsetLeft,top:Mi.offsetTop})}),fi})}),po=ge.slice(0,Ao),Ki=ge.slice(Do+1),bi=[].concat(Object(M.a)(po),Object(M.a)(Ki)),Pi=Object(P.useState)(),Ei=Object(V.a)(Pi,2),Na=Ei[0],mo=Ei[1],ea=Aa.get(ke),ao=Object(P.useRef)();function oo(){f.a.cancel(ao.current)}Object(P.useEffect)(function(){var $r={};return ea&&(zt?(ut?$r.right=ea.right:$r.left=ea.left,$r.width=ea.width):($r.top=ea.top,$r.height=ea.height)),oo(),ao.current=f()(function(){mo($r)}),oo},[ea,zt,ut]),Object(P.useEffect)(function(){ua()},[ke,ea,Aa,zt]),Object(P.useEffect)(function(){io()},[ut,Vn,ke,ge.map(function($r){return $r.key}).join("_")]);var so=!!bi.length,xa="".concat(re,"-nav-wrap"),Qa,Ua,go,Za;return zt?ut?(Ua=ir>0,Qa=ir+Qr<vr):(Qa=ir<0,Ua=-ir+Qr<vr):(go=Xr<0,Za=-Xr+la<Ri),P.createElement("div",{ref:Ne,role:"tablist",className:K()("".concat(re,"-nav"),ue),style:Oe,onKeyDown:function(){Ja()}},P.createElement(kn,{position:"left",extra:Ut,prefixCls:re}),P.createElement(m.a,{onResize:io},P.createElement("div",{className:K()(xa,(ze={},Object(Z.a)(ze,"".concat(xa,"-ping-left"),Qa),Object(Z.a)(ze,"".concat(xa,"-ping-right"),Ua),Object(Z.a)(ze,"".concat(xa,"-ping-top"),go),Object(Z.a)(ze,"".concat(xa,"-ping-bottom"),Za),ze)),ref:Ar},P.createElement(m.a,{onResize:io},P.createElement("div",{ref:gr,className:"".concat(re,"-nav-list"),style:{transform:"translate(".concat(ir,"px, ").concat(Xr,"px)"),transition:Xa?"none":void 0}},fo,P.createElement(Rn,{ref:Lr,prefixCls:re,locale:mn,editable:rn,style:{visibility:so?"hidden":null}}),P.createElement("div",{className:K()("".concat(re,"-ink-bar"),Object(Z.a)({},"".concat(re,"-ink-bar-animated"),Ze.inkBar)),style:Na}))))),P.createElement(vn,Object.assign({},Ee,{ref:Cr,prefixCls:re,tabs:bi,className:!so&&Da})),P.createElement(kn,{position:"right",extra:Ut,prefixCls:re}))}var er=P.forwardRef(lr);function Rr(Ee){var Ne=Ee.id,ze=Ee.activeKey,Se=Ee.animated,re=Ee.tabPosition,ge=Ee.rtl,ue=Ee.destroyInactiveTabPane,Oe=P.useContext(yr),Pe=Oe.prefixCls,Ze=Oe.tabs,ke=Se.tabPane,ut=Ze.findIndex(function(Ut){return Ut.key===ze});return P.createElement("div",{className:K()("".concat(Pe,"-content-holder"))},P.createElement("div",{className:K()("".concat(Pe,"-content"),"".concat(Pe,"-content-").concat(re),Object(Z.a)({},"".concat(Pe,"-content-animated"),ke)),style:ut&&ke?Object(Z.a)({},ge?"marginRight":"marginLeft","-".concat(ut,"00%")):null},Ze.map(function(Ut){return P.cloneElement(Ut.node,{key:Ut.key,prefixCls:Pe,tabKey:Ut.key,id:Ne,animated:ke,active:Ut.key===ze,destroyInactiveTabPane:ue})})))}function mr(Ee){var Ne=Ee.prefixCls,ze=Ee.forceRender,Se=Ee.className,re=Ee.style,ge=Ee.id,ue=Ee.active,Oe=Ee.animated,Pe=Ee.destroyInactiveTabPane,Ze=Ee.tabKey,ke=Ee.children,ut=P.useState(ze),Ut=Object(V.a)(ut,2),rn=Ut[0],mn=Ut[1];P.useEffect(function(){ue?mn(!0):Pe&&mn(!1)},[ue,Pe]);var Hn={};return ue||(Oe?(Hn.visibility="hidden",Hn.height=0,Hn.overflowY="hidden"):Hn.display="none"),P.createElement("div",{id:ge&&"".concat(ge,"-panel-").concat(Ze),role:"tabpanel",tabIndex:ue?0:-1,"aria-labelledby":ge&&"".concat(ge,"-tab-").concat(Ze),"aria-hidden":!ue,style:Object(G.a)(Object(G.a)({},Hn),re),className:K()("".concat(Ne,"-tabpane"),ue&&"".concat(Ne,"-tabpane-active"),Se)},(ue||rn||ze)&&ke)}var xr=0;function Zr(Ee){return Object(k.a)(Ee).map(function(Ne){if(P.isValidElement(Ne)){var ze=Ne.key!==void 0?String(Ne.key):void 0;return Object(G.a)(Object(G.a)({key:ze},Ne.props),{},{node:Ne})}return null}).filter(function(Ne){return Ne})}function Yr(Ee,Ne){var ze,Se=Ee.id,re=Ee.prefixCls,ge=re===void 0?"rc-tabs":re,ue=Ee.className,Oe=Ee.children,Pe=Ee.direction,Ze=Ee.activeKey,ke=Ee.defaultActiveKey,ut=Ee.editable,Ut=Ee.animated,rn=Ee.tabPosition,mn=rn===void 0?"top":rn,Hn=Ee.tabBarGutter,Vn=Ee.tabBarStyle,fr=Ee.tabBarExtraContent,dr=Ee.locale,wr=Ee.moreIcon,Ar=Ee.moreTransitionName,gr=Ee.destroyInactiveTabPane,Cr=Ee.renderTabBar,Lr=Ee.onChange,gn=Ee.onTabClick,en=Ee.onTabScroll,En=Object(U.a)(Ee,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Gt=Zr(Oe),zt=Pe==="rtl",pr;Ut===!1?pr={inkBar:!1,tabPane:!1}:pr=Object(G.a)({inkBar:!0,tabPane:!1},Ut!==!0?Ut:null);var Mr=Object(P.useState)(!1),ir=Object(V.a)(Mr,2),Ur=ir[0],oi=ir[1];Object(P.useEffect)(function(){oi(Nt())},[]);var jr=Object(r.a)(function(){var ei;return(ei=Gt[0])===null||ei===void 0?void 0:ei.key},{value:Ze,defaultValue:ke}),Xr=Object(V.a)(jr,2),zr=Xr[0],Wr=Xr[1],Hr=Object(P.useState)(function(){return Gt.findIndex(function(ei){return ei.key===zr})}),vr=Object(V.a)(Hr,2),yi=vr[0],Qi=vr[1];Object(P.useEffect)(function(){var ei=Gt.findIndex(function(qi){return qi.key===zr});if(ei===-1){var Zi;ei=Math.max(0,Math.min(yi,Gt.length-1)),Wr((Zi=Gt[ei])===null||Zi===void 0?void 0:Zi.key)}Qi(ei)},[Gt.map(function(ei){return ei.key}).join("_"),zr,yi]);var ji=Object(r.a)(null,{value:Se}),Ri=Object(V.a)(ji,2),ui=Ri[0],qr=Ri[1],ii=mn;Ur&&!["left","right"].includes(mn)&&(ii="top"),Object(P.useEffect)(function(){Se||(qr("rc-tabs-".concat(xr)),xr+=1)},[]);function ci(ei,Zi){gn==null||gn(ei,Zi),Wr(ei),Lr==null||Lr(ei)}var Fi={id:ui,activeKey:zr,animated:pr,tabPosition:ii,rtl:zt,mobile:Ur},ha,sa=Object(G.a)(Object(G.a)({},Fi),{},{editable:ut,locale:dr,moreIcon:wr,moreTransitionName:Ar,tabBarGutter:Hn,onTabClick:ci,onTabScroll:en,extra:fr,style:Vn,panes:Oe});return Cr?ha=Cr(sa,er):ha=P.createElement(er,Object.assign({},sa)),P.createElement(yr.Provider,{value:{tabs:Gt,prefixCls:ge}},P.createElement("div",Object.assign({ref:Ne,id:Se,className:K()(ge,"".concat(ge,"-").concat(ii),(ze={},Object(Z.a)(ze,"".concat(ge,"-mobile"),Ur),Object(Z.a)(ze,"".concat(ge,"-editable"),ut),Object(Z.a)(ze,"".concat(ge,"-rtl"),zt),ze),ue)},En),ha,P.createElement(Rr,Object.assign({destroyInactiveTabPane:gr},Fi,{animated:pr}))))}var Jr=P.forwardRef(Yr);Jr.TabPane=mr;var vi=Jr,_i=he.b=vi},kSUc:function(Kt,he,D){},lZu9:function(Kt,he,D){(function(Z){Z(D("VrN/"),D("1eCo"),D("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(V,U){var G=Z.getMode(V,"text/html"),P=G.name=="null";function I(F){if(Z.findModeByName){var x=Z.findModeByName(F);x&&(F=x.mime||x.mimes[0])}var Y=Z.getMode(V,F);return Y.name=="null"?null:Y}U.highlightFormatting===void 0&&(U.highlightFormatting=!1),U.maxBlockquoteDepth===void 0&&(U.maxBlockquoteDepth=0),U.taskLists===void 0&&(U.taskLists=!1),U.strikethrough===void 0&&(U.strikethrough=!1),U.emoji===void 0&&(U.emoji=!1),U.fencedCodeBlockHighlighting===void 0&&(U.fencedCodeBlockHighlighting=!0),U.fencedCodeBlockDefaultMode===void 0&&(U.fencedCodeBlockDefaultMode="text/plain"),U.xml===void 0&&(U.xml=!0),U.tokenTypeOverrides===void 0&&(U.tokenTypeOverrides={});var K={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var k in K)K.hasOwnProperty(k)&&U.tokenTypeOverrides[k]&&(K[k]=U.tokenTypeOverrides[k]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,f=U.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,a=/^\s*\[[^\]]+?\]:.*$/,c=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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 i(F,x,Y){return x.f=x.inline=Y,Y(F,x)}function n(F,x,Y){return x.f=x.block=Y,Y(F,x)}function O(F){return!F||!/\S/.test(F.string)}function T(F){if(F.linkTitle=!1,F.linkHref=!1,F.linkText=!1,F.em=!1,F.strong=!1,F.strikethrough=!1,F.quote=0,F.indentedCode=!1,F.f==R){var x=P;if(!x){var Y=Z.innerMode(G,F.htmlState);x=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}x&&(F.f=h,F.block=C,F.htmlState=null)}return F.trailingSpace=0,F.trailingSpaceNewLine=!1,F.prevLine=F.thisLine,F.thisLine={stream:null},null}function C(F,x){var Y=F.column()===x.indentation,q=O(x.prevLine.stream),ie=x.indentedCode,me=x.prevLine.hr,$e=x.list!==!1,xe=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var Ie=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,$e)){for(x.list=null;Ie<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=Ie-x.listStack[x.listStack.length-1])}var Je=!q&&!me&&!x.prevLine.header&&(!$e||!ie)&&!x.prevLine.fencedCodeEnd,Ye=(x.list===!1||me||q)&&x.indentation<=xe&&F.match(r),ve=null;if(x.indentationDiff>=4&&(ie||x.prevLine.fencedCodeEnd||x.prevLine.header||q))return F.skipToEnd(),x.indentedCode=!0,K.code;if(F.eatSpace())return null;if(Y&&x.indentation<=xe&&(ve=F.match(f))&&ve[1].length<=6)return x.quote=0,x.header=ve[1].length,x.thisLine.header=!0,U.highlightFormatting&&(x.formatting="header"),x.f=x.inline,v(x);if(x.indentation<=xe&&F.eat(">"))return x.quote=Y?1:x.quote+1,U.highlightFormatting&&(x.formatting="quote"),F.eatSpace(),v(x);if(!Ye&&!x.setext&&Y&&x.indentation<=xe&&(ve=F.match(M))){var fe=ve[1]?"ol":"ul";return x.indentation=Ie+F.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,U.taskLists&&F.match(b,!1)&&(x.taskList=!0),x.f=x.inline,U.highlightFormatting&&(x.formatting=["list","list-"+fe]),v(x)}else{if(Y&&x.indentation<=xe&&(ve=F.match(o,!0)))return x.quote=0,x.fencedEndRE=new RegExp(ve[1]+"+ *$"),x.localMode=U.fencedCodeBlockHighlighting&&I(ve[2]||U.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=Z.startState(x.localMode)),x.f=x.block=S,U.highlightFormatting&&(x.formatting="code-block"),x.code=-1,v(x);if(x.setext||(!Je||!$e)&&!x.quote&&x.list===!1&&!x.code&&!Ye&&!a.test(F.string)&&(ve=F.lookAhead(1))&&(ve=ve.match(m)))return x.setext?(x.header=x.setext,x.setext=0,F.skipToEnd(),U.highlightFormatting&&(x.formatting="header")):(x.header=ve[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,v(x);if(Ye)return F.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,K.hr;if(F.peek()==="[")return i(F,x,j)}return i(F,x,x.inline)}function R(F,x){var Y=G.token(F,x.htmlState);if(!P){var q=Z.innerMode(G,x.htmlState);(q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText||x.md_inside&&F.current().indexOf(">")>-1)&&(x.f=h,x.block=C,x.htmlState=null)}return Y}function S(F,x){var Y=x.listStack[x.listStack.length-1]||0,q=x.indentation<Y,ie=Y+3;if(x.fencedEndRE&&x.indentation<=ie&&(q||F.match(x.fencedEndRE))){U.highlightFormatting&&(x.formatting="code-block");var me;return q||(me=v(x)),x.localMode=x.localState=null,x.block=C,x.f=h,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,q?n(F,x,x.block):me}else return x.localMode?x.localMode.token(F,x.localState):(F.skipToEnd(),K.code)}function v(F){var x=[];if(F.formatting){x.push(K.formatting),typeof F.formatting=="string"&&(F.formatting=[F.formatting]);for(var Y=0;Y<F.formatting.length;Y++)x.push(K.formatting+"-"+F.formatting[Y]),F.formatting[Y]==="header"&&x.push(K.formatting+"-"+F.formatting[Y]+"-"+F.header),F.formatting[Y]==="quote"&&(!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=F.quote?x.push(K.formatting+"-"+F.formatting[Y]+"-"+F.quote):x.push("error"))}if(F.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(F.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(F.linkHref?x.push(K.linkHref,"url"):(F.strong&&x.push(K.strong),F.em&&x.push(K.em),F.strikethrough&&x.push(K.strikethrough),F.emoji&&x.push(K.emoji),F.linkText&&x.push(K.linkText),F.code&&x.push(K.code),F.image&&x.push(K.image),F.imageAltText&&x.push(K.imageAltText,"link"),F.imageMarker&&x.push(K.imageMarker)),F.header&&x.push(K.header,K.header+"-"+F.header),F.quote&&(x.push(K.quote),!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=F.quote?x.push(K.quote+"-"+F.quote):x.push(K.quote+"-"+U.maxBlockquoteDepth)),F.list!==!1){var q=(F.listStack.length-1)%3;q?q===1?x.push(K.list2):x.push(K.list3):x.push(K.list1)}return F.trailingSpaceNewLine?x.push("trailing-space-new-line"):F.trailingSpace&&x.push("trailing-space-"+(F.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function E(F,x){return F.match(l,!0)?v(x):void 0}function h(F,x){var Y=x.text(F,x);if(typeof Y!="undefined")return Y;if(x.list)return x.list=null,v(x);if(x.taskList){var q=F.match(b,!0)[1]===" ";return q?x.taskOpen=!0:x.taskClosed=!0,U.highlightFormatting&&(x.formatting="task"),x.taskList=!1,v(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&F.match(/^#+$/,!0))return U.highlightFormatting&&(x.formatting="header"),v(x);var ie=F.next();if(x.linkTitle){x.linkTitle=!1;var me=ie;ie==="("&&(me=")"),me=(me+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var $e="^\\s*(?:[^"+me+"\\\\]+|\\\\\\\\|\\\\.)"+me;if(F.match(new RegExp($e),!0))return K.linkHref}if(ie==="`"){var xe=x.formatting;U.highlightFormatting&&(x.formatting="code"),F.eatWhile("`");var Ie=F.current().length;if(x.code==0&&(!x.quote||Ie==1))return x.code=Ie,v(x);if(Ie==x.code){var Je=v(x);return x.code=0,Je}else return x.formatting=xe,v(x)}else if(x.code)return v(x);if(ie==="\\"&&(F.next(),U.highlightFormatting)){var Ye=v(x),ve=K.formatting+"-escape";return Ye?Ye+" "+ve:ve}if(ie==="!"&&F.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,U.highlightFormatting&&(x.formatting="image"),v(x);if(ie==="["&&x.imageMarker&&F.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,U.highlightFormatting&&(x.formatting="image"),v(x);if(ie==="]"&&x.imageAltText){U.highlightFormatting&&(x.formatting="image");var Ye=v(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=_,Ye}if(ie==="["&&!x.image)return x.linkText&&F.match(/^.*?\]/)||(x.linkText=!0,U.highlightFormatting&&(x.formatting="link")),v(x);if(ie==="]"&&x.linkText){U.highlightFormatting&&(x.formatting="link");var Ye=v(x);return x.linkText=!1,x.inline=x.f=F.match(/\(.*?\)| ?\[.*?\]/,!1)?_:h,Ye}if(ie==="<"&&F.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=p,U.highlightFormatting&&(x.formatting="link");var Ye=v(x);return Ye?Ye+=" ":Ye="",Ye+K.linkInline}if(ie==="<"&&F.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=p,U.highlightFormatting&&(x.formatting="link");var Ye=v(x);return Ye?Ye+=" ":Ye="",Ye+K.linkEmail}if(U.xml&&ie==="<"&&F.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var fe=F.string.indexOf(">",F.pos);if(fe!=-1){var lt=F.string.substring(F.start,fe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(lt)&&(x.md_inside=!0)}return F.backUp(1),x.htmlState=Z.startState(G),n(F,x,R)}if(U.xml&&ie==="<"&&F.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var qt=1,Ft=F.pos==1?" ":F.string.charAt(F.pos-2);qt<3&&F.eat(ie);)qt++;var Ot=F.peek()||" ",Ve=!/\s/.test(Ot)&&(!c.test(Ot)||/\s/.test(Ft)||c.test(Ft)),vt=!/\s/.test(Ft)&&(!c.test(Ft)||/\s/.test(Ot)||c.test(Ot)),ht=null,Bt=null;if(qt%2&&(!x.em&&Ve&&(ie==="*"||!vt||c.test(Ft))?ht=!0:x.em==ie&&vt&&(ie==="*"||!Ve||c.test(Ot))&&(ht=!1)),qt>1&&(!x.strong&&Ve&&(ie==="*"||!vt||c.test(Ft))?Bt=!0:x.strong==ie&&vt&&(ie==="*"||!Ve||c.test(Ot))&&(Bt=!1)),Bt!=null||ht!=null){U.highlightFormatting&&(x.formatting=ht==null?"strong":Bt==null?"em":"strong em"),ht===!0&&(x.em=ie),Bt===!0&&(x.strong=ie);var Je=v(x);return ht===!1&&(x.em=!1),Bt===!1&&(x.strong=!1),Je}}else if(ie===" "&&(F.eat("*")||F.eat("_"))){if(F.peek()===" ")return v(x);F.backUp(1)}if(U.strikethrough){if(ie==="~"&&F.eatWhile(ie)){if(x.strikethrough){U.highlightFormatting&&(x.formatting="strikethrough");var Je=v(x);return x.strikethrough=!1,Je}else if(F.match(/^[^\s]/,!1))return x.strikethrough=!0,U.highlightFormatting&&(x.formatting="strikethrough"),v(x)}else if(ie===" "&&F.match(/^~~/,!0)){if(F.peek()===" ")return v(x);F.backUp(2)}}if(U.emoji&&ie===":"&&F.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,U.highlightFormatting&&(x.formatting="emoji");var se=v(x);return x.emoji=!1,se}return ie===" "&&(F.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),v(x)}function p(F,x){var Y=F.next();if(Y===">"){x.f=x.inline=h,U.highlightFormatting&&(x.formatting="link");var q=v(x);return q?q+=" ":q="",q+K.linkInline}return F.match(/^[^>]+/,!0),K.linkInline}function _(F,x){if(F.eatSpace())return null;var Y=F.next();return Y==="("||Y==="["?(x.f=x.inline=w(Y==="("?")":"]"),U.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,v(x)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(F){return function(x,Y){var q=x.next();if(q===F){Y.f=Y.inline=h,U.highlightFormatting&&(Y.formatting="link-string");var ie=v(Y);return Y.linkHref=!1,ie}return x.match(g[F]),Y.linkHref=!0,v(Y)}}function j(F,x){return F.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=B,F.next(),U.highlightFormatting&&(x.formatting="link"),x.linkText=!0,v(x)):i(F,x,h)}function B(F,x){if(F.match(/^\]:/,!0)){x.f=x.inline=A,U.highlightFormatting&&(x.formatting="link");var Y=v(x);return x.linkText=!1,Y}return F.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function A(F,x){return F.eatSpace()?null:(F.match(/^[^\s]+/,!0),F.peek()===void 0?x.linkTitle=!0:F.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),x.f=x.inline=h,K.linkHref+" url")}var H={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:h,text:E,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(F){return{f:F.f,prevLine:F.prevLine,thisLine:F.thisLine,block:F.block,htmlState:F.htmlState&&Z.copyState(G,F.htmlState),indentation:F.indentation,localMode:F.localMode,localState:F.localMode?Z.copyState(F.localMode,F.localState):null,inline:F.inline,text:F.text,formatting:!1,linkText:F.linkText,linkTitle:F.linkTitle,linkHref:F.linkHref,code:F.code,em:F.em,strong:F.strong,strikethrough:F.strikethrough,emoji:F.emoji,header:F.header,setext:F.setext,hr:F.hr,taskList:F.taskList,list:F.list,listStack:F.listStack.slice(0),quote:F.quote,indentedCode:F.indentedCode,trailingSpace:F.trailingSpace,trailingSpaceNewLine:F.trailingSpaceNewLine,md_inside:F.md_inside,fencedEndRE:F.fencedEndRE}},token:function(F,x){if(x.formatting=!1,F!=x.thisLine.stream){if(x.header=0,x.hr=!1,F.match(/^\s*$/,!0))return T(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:F},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=R)){var Y=F.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(x.indentation=Y,x.indentationDiff=null,Y>0)return null}}return x.f(F,x)},innerMode:function(F){return F.block==R?{state:F.htmlState,mode:G}:F.localState?{state:F.localState,mode:F.localMode}:{state:F,mode:H}},indent:function(F,x,Y){return F.block==R&&G.indent?G.indent(F.htmlState,x,Y):F.localState&&F.localMode.indent?F.localMode.indent(F.localState,x,Y):Z.Pass},blankLine:T,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},mgmH:function(Kt,he,D){"use strict";D.d(he,"d",function(){return m}),D.d(he,"b",function(){return l}),D.d(he,"e",function(){return o}),D.d(he,"c",function(){return a}),D.d(he,"n",function(){return c}),D.d(he,"g",function(){return s}),D.d(he,"h",function(){return i}),D.d(he,"j",function(){return O}),D.d(he,"a",function(){return T}),D.d(he,"l",function(){return C}),D.d(he,"f",function(){return R}),D.d(he,"k",function(){return S}),D.d(he,"m",function(){return v}),D.d(he,"i",function(){return E}),D.d(he,"o",function(){return h}),D.d(he,"t",function(){return p}),D.d(he,"s",function(){return _}),D.d(he,"p",function(){return g}),D.d(he,"q",function(){return w}),D.d(he,"r",function(){return j}),D.d(he,"v",function(){return B}),D.d(he,"u",function(){return A});var Z=D("miYZ"),V=D("tsqr"),U=D("k1fw"),G=D("9og8"),P=D("WmNS"),I=D.n(P),K=D("oUNq"),k=D("9kvl"),r=D("1vsH"),M=D("m3rI"),b=function(){Object(k.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},f=function(){Object(k.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},m=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return b(),ie.next=3,Object(K.t)(Object(U.a)({},x));case 3:if(Y=ie.sent,!(Y.status===0)){ie.next=7;break}return ie.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_couser_info.json"),query:x}));case 7:f();case 8:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),l=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.r)(Object(U.a)({},x));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),o=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.u)(Object(U.a)({},x));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),a=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.s)(Object(U.a)({},x));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),c=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.z)(Object(U.a)({},x));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),s=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.v)(Object(U.a)({},x));case 2:if(Y=ie.sent,!(Y.status===0)){ie.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")),ie.next=13;break;case 8:if(!(Y.status===-2)){ie.next=12;break}return ie.abrupt("return",Y);case 12:Y.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),i=function(){var H=Object(G.a)(I.a.mark(function F(x,Y){var q;return I.a.wrap(function(me){for(;;)switch(me.prev=me.next){case 0:return me.next=2,Object(K.x)(Object(U.a)({},x));case 2:q=me.sent,q.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(Y))):q.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(Y)));case 4:case"end":return me.stop()}},F)}));return function(x,Y){return H.apply(this,arguments)}}(),n=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return b(),ie.next=3,Object(K.w)(Object(U.a)({},x));case 3:if(Y=ie.sent,!(Y.status===0)){ie.next=7;break}return ie.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/homework_commons/".concat(x.categoryId,"/works_list.zip"),query:x}));case 7:f();case 8:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),O=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return b(),ie.next=3,Object(K.A)(Object(U.a)({},x));case 3:if(Y=ie.sent,!(Y.status===0)){ie.next=7;break}return ie.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/polls/".concat(x.categoryId,"/commit_result.xlsx"),query:x}));case 7:f();case 8:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),T=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/attendances/export_xlsx_data.xlsx"),query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),C=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/video_study_statics.xlsx"),query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),R=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_course_students_info.xlsx"),query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),S=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/item_banks/export.xlsx",query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),v=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),E=function(){var H=Object(G.a)(I.a.mark(function F(x){var Y;return I.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.y)(Object(U.a)({},x));case 2:Y=ie.sent,Y.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score"))):Y.status===-3&&(Object(k.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),k.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ie.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),h=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),q.next=3,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/export_records/".concat(x.id,".xlsx"),query:x}));case 3:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),p=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),_=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_training_objectives.xlsx"),query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),g=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)(x==null?void 0:x.name,Object(r.Y)({url:M.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),w=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_courses.xlsx"),query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),j=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_graduation_requirements.xlsx"),query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),B=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/rank_list.xlsx",query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}(),A=function(){var H=Object(G.a)(I.a.mark(function F(x){return I.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:x}));case 2:case"end":return q.stop()}},F)}));return function(x){return H.apply(this,arguments)}}()},n6Qo:function(Kt,he,D){"use strict";D.d(he,"a",function(){return k});var Z=D("q1tI"),V=D("biw7"),U=D("fyJ8");function G(r){var M=r.className,b=r.index,f=r.children,m=r.colSpan,l=r.rowSpan,o=Z.useContext(V.a),a=o.prefixCls,c=o.fixedInfoList,s=c[b];return Z.createElement(U.a,Object.assign({className:M,index:b,component:"td",prefixCls:a,record:null,dataIndex:null,render:function(){return{children:f,props:{colSpan:m,rowSpan:l}}}},s))}function P(r){return Z.createElement("tr",Object.assign({},r))}function I(r){var M=r.children,b=Z.useContext(V.a),f=b.prefixCls;return Z.createElement("tfoot",{className:"".concat(f,"-summary")},M)}var K=he.b=I,k={Cell:G,Row:P}},nEHx:function(Kt,he,D){"use strict";D.d(he,"a",function(){return Z});var Z;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(Z||(Z={}))},nPLb:function(Kt,he,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),U=D("g9YV"),G=D("wCAj"),P=D("5NDa"),I=D("5rEg"),K=D("14J3"),k=D("BMrR"),r=D("iQDF"),M=D("+eQT"),b=D("miYZ"),f=D("tsqr"),m=D("jrin"),l=D("oBTY"),o=D("k1fw"),a=D("9og8"),c=D("y8nQ"),s=D("Vl3Y"),i=D("tJVT"),n=D("PpiC"),O=D("WmNS"),T=D.n(O),C=D("q1tI"),R=D.n(C),S=D("wd/R"),v=D.n(S),E=D("ErOA"),h=D("1vsH"),p=D("Ty5D"),_=D("9kvl"),g=D("oUNq"),w=D("xKgJ"),j=D("eozf"),B=function(H){var F=H.classroomList,x=H.dispatch,Y=H.courseEndTime,q=Object(n.a)(H,["classroomList","dispatch","courseEndTime"]),ie=Object(p.i)(),me=s.a.useForm(),$e=Object(i.a)(me,1),xe=$e[0],Ie=Object(C.useState)(1),Je=Object(i.a)(Ie,2),Ye=Je[0],ve=Je[1],fe=Object(C.useState)([]),lt=Object(i.a)(fe,2),qt=lt[0],Ft=lt[1],Ot=Object(C.useState)(0),Ve=Object(i.a)(Ot,2),vt=Ve[0],ht=Ve[1],Bt=Object(C.useState)(2e4),se=Object(i.a)(Bt,2),Ue=se[0],Ge=se[1],et=Object(C.useState)(!0),Wt=Object(i.a)(et,2),Yt=Wt[0],on=Wt[1],nt=Object(C.useState)(),tn=Object(i.a)(nt,2),Ln=tn[0],We=tn[1],Fe=Object(C.useState)([]),yt=Object(i.a)(Fe,2),At=yt[0],tt=yt[1];ie.id=ie.coursesId,Object(C.useEffect)(function(){F.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?ot():(tt([]),Ft([]))},[F.actionTabs.key]);var ot=function(){var ae=Object(a.a)(T.a.mark(function oe(pe){var _e,be,Ke;return T.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return on(!0),nn.next=3,Object(g.D)(Object(o.a)(Object(o.a)({},ie),{},{page:pe||Ye,limit:Ue,homework_id:F.actionTabs.type===1?"":F.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:_e=nn.sent,_e==null||_e.course_groups.map(function(An){An.key=An.id}),_e&&(Ft([].concat(Object(l.a)(qt),Object(l.a)(_e==null?void 0:_e.course_groups))),ht(_e==null?void 0:_e.group_count),We(_e==null?void 0:_e.course_groups),on(!1),pe||xe.setFieldsValue((Ke={},Object(m.a)(Ke,"group_ids",_e==null||((be=_e.course_groups)===null||be===void 0)?void 0:be.map(function(An){return String(An.id)})),Object(m.a)(Ke,"end_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Ke)));case 6:case"end":return nn.stop()}},oe)}));return function(pe){return ae.apply(this,arguments)}}(),De=function(){var ae=Object(a.a)(T.a.mark(function oe(){var pe,_e,be,Ke;return T.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:if(pe=Object(o.a)({},xe.getFieldsValue()),console.log("----",pe.group_ids),!(Ln!=null&&Ln.length&&!(At!=null&&At.length))){nn.next=5;break}return f.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),nn.abrupt("return");case 5:return nn.next=7,Object(E.a)("/api/courses/".concat(ie.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(l.a)(F.actionTabs.selectArrs),group_ids:(At==null?void 0:At.length)>0?At:[],unified_setting:!(qt!=null&&qt.length),end_time:v()(pe.end_time).format("YYYY-MM-DD HH:mm")}});case 7:_e=nn.sent,_e.status===0&&(ye(),Object(h.cb)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),f.b.success("\u64CD\u4F5C\u6210\u529F"),x({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),q.onCallback&&q.onCallback(),Object(w.c)()?(x({type:"classroomList/setActionTabs",payload:{}}),(F==null||((be=F.actionTabs)===null||be===void 0||((Ke=be.selectArrsAll)===null||Ke===void 0))?void 0:Ke.length)>0?x({type:"classroomList/getClassroomTeacherCommonList",payload:Object(o.a)(Object(o.a)({},F.actionTabs.params),{},{type:5})}):x({type:"shixunHomeworks/getWorkList",payload:Object(o.a)({},ie)})):x({type:"classroomList/getClassroomCommonList",payload:Object(o.a)({},F.actionTabs.params)}));case 9:case"end":return nn.stop()}},oe)}));return function(){return ae.apply(this,arguments)}}(),ye=function(){ve(1),Ft([])},we=F.detailCommonHomeworksList;return R.a.createElement(V.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:F.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:De,onCancel:function(){ye(),x({type:"classroomList/setActionTabs",payload:{}})}},R.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u4E0D\u80FD\u518D\u63D0\u4EA4\u4F5C\u4E1A",R.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u63D0\u4EA4\u4E2D" \u201C\u8865\u4EA4\u4E2D\u201D\u7684\u4F5C\u4E1A\u6709\u6548'),qt&&R.a.createElement(s.a,{form:xe},R.a.createElement(k.a,null,R.a.createElement("span",{className:"mr5"},"\u622A\u6B62\u65F6\u95F4:"),R.a.createElement(s.a.Item,{name:"end_time"},R.a.createElement(M.a,{style:{width:170},getPopupContainer:function(oe){return oe.parentNode},disabledDate:function(oe){return Object(j.b)(oe,Y)},disabledTime:function(oe){return Object(j.c)(oe)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(h.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(Ln==null?void 0:Ln.length)>0&&R.a.createElement(k.a,null,R.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),R.a.createElement(I.a.Search,{style:{width:"300px"},onChange:function(oe){Ft(Ln.filter(function(pe){return pe.name.indexOf(oe.target.value)>-1}))}})),(qt==null?void 0:qt.length)>0&&F.actionTabs.type===1&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(oe,pe){tt(oe)}},rowKey:"id",pagination:!1,dataSource:qt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(qt==null?void 0:qt.length)>0&&F.actionTabs.type===2&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(oe,pe){tt(oe)}},rowKey:"id",pagination:!1,dataSource:qt,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"},{title:"\u53D1\u5E03\u65F6\u95F4",dataIndex:"publish_time",key:"publish_time"},{title:"\u622A\u6B62\u65F6\u95F4",dataIndex:"end_time",key:"end_time"}]})))};he.a=Object(_.a)(function(A){var H=A.classroomList;return{classroomList:H}})(B)},nnTU:function(Kt,he,D){"use strict";D.d(he,"b",function(){return K}),D.d(he,"a",function(){return k});var Z=D("MI8n"),V=D("JYp7"),U=D("pmY6"),G=D("24hK"),P=D("746U"),I=D("Cg/j");const K=Object(I.c)("commandService"),k=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Z.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,M){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!M)throw new Error("invalid command");return this.registerCommand({id:r,handler:M})}if(r.description){const o=[];for(let c of r.description.args)o.push(c.constraint);const a=r.handler;r.handler=function(c,...s){return Object(P.o)(s,o),a(c,...s)}}const{id:b}=r;let f=this._commands.get(b);f||(f=new G.a,this._commands.set(b,f));let m=f.unshift(r),l=Object(U.i)(()=>{m();const o=this._commands.get(b);(o==null?void 0:o.isEmpty())&&this._commands.delete(b)});return this._onDidRegisterCommand.fire(b),l}registerCommandAlias(r,M){return k.registerCommand(r,(b,...f)=>b.get(K).executeCommand(M,...f))}getCommand(r){const M=this._commands.get(r);return!M||M.isEmpty()?void 0:V.a.first(M)}getCommands(){const r=new Map;for(const M of this._commands.keys()){const b=this.getCommand(M);b&&r.set(M,b)}return r}};k.registerCommand("noop",()=>{})},oOBs:function(Kt,he,D){Kt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(Kt,he,D){"use strict";D.d(he,"a",function(){return ur});var Z=D("1OyB"),V=D("vuIU"),U=D("Ji7U"),G=D("LK+K"),P=D("rePB"),I=D("VTBJ"),K=D("ODXe"),k=D("q1tI"),r=D("TSYQ"),M=D.n(r),b=D("Kwbf"),f=D("6cGi"),m=D("U8pU"),l=D("4IlW"),o=k.createContext({}),a=o,c={visibility:"hidden"};function s(Q){var ce=Q.prefixCls,Ce=Q.prevIcon,Te=Ce===void 0?"\u2039":Ce,rt=Q.nextIcon,Re=rt===void 0?"\u203A":rt,Xe=Q.superPrevIcon,it=Xe===void 0?"\xAB":Xe,Dt=Q.superNextIcon,Tt=Dt===void 0?"\xBB":Dt,Be=Q.onSuperPrev,_t=Q.onSuperNext,at=Q.onPrev,dt=Q.onNext,wt=Q.children,It=k.useContext(a),gt=It.hideNextBtn,Xt=It.hidePrevBtn;return k.createElement("div",{className:ce},Be&&k.createElement("button",{type:"button",onClick:Be,tabIndex:-1,className:"".concat(ce,"-super-prev-btn"),style:Xt?c:{}},it),at&&k.createElement("button",{type:"button",onClick:at,tabIndex:-1,className:"".concat(ce,"-prev-btn"),style:Xt?c:{}},Te),k.createElement("div",{className:"".concat(ce,"-view")},wt),dt&&k.createElement("button",{type:"button",onClick:dt,tabIndex:-1,className:"".concat(ce,"-next-btn"),style:gt?c:{}},Re),_t&&k.createElement("button",{type:"button",onClick:_t,tabIndex:-1,className:"".concat(ce,"-super-next-btn"),style:gt?c:{}},Tt))}var i=s;function n(Q){var ce=k.useContext(a),Ce=ce.hideHeader;if(Ce)return null;var Te=Q.prefixCls,rt=Q.generateConfig,Re=Q.locale,Xe=Q.value,it=Q.format,Dt="".concat(Te,"-header");return k.createElement(i,{prefixCls:Dt},Xe?rt.locale.format(Re.locale,Xe,it):"\xA0")}var O=n,T=D("YrtM"),C=D("KQm4"),R=new Map;function S(Q,ce,Ce){if(R.get(Q)&&cancelAnimationFrame(R.get(Q)),Ce<=0){R.set(Q,requestAnimationFrame(function(){Q.scrollTop=ce}));return}var Te=ce-Q.scrollTop,rt=Te/Ce*10;R.set(Q,requestAnimationFrame(function(){Q.scrollTop+=rt,Q.scrollTop!==ce&&S(Q,ce,Ce-10)}))}function v(Q,ce){var Ce=ce.onLeftRight,Te=ce.onCtrlLeftRight,rt=ce.onUpDown,Re=ce.onPageUpDown,Xe=ce.onEnter,it=Q.which,Dt=Q.ctrlKey,Tt=Q.metaKey;switch(it){case l.a.LEFT:if(Dt||Tt){if(Te)return Te(-1),!0}else if(Ce)return Ce(-1),!0;break;case l.a.RIGHT:if(Dt||Tt){if(Te)return Te(1),!0}else if(Ce)return Ce(1),!0;break;case l.a.UP:if(rt)return rt(-1),!0;break;case l.a.DOWN:if(rt)return rt(1),!0;break;case l.a.PAGE_UP:if(Re)return Re(-1),!0;break;case l.a.PAGE_DOWN:if(Re)return Re(1),!0;break;case l.a.ENTER:if(Xe)return Xe(),!0;break}return!1}function E(Q,ce,Ce,Te){var rt=Q;if(!rt)switch(ce){case"time":rt=Te?"hh:mm:ss a":"HH:mm:ss";break;case"week":rt="gggg-wo";break;case"month":rt="YYYY-MM";break;case"quarter":rt="YYYY-[Q]Q";break;case"year":rt="YYYY";break;default:rt=Ce?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return rt}function h(Q,ce){var Ce=Q==="time"?8:10;return Math.max(Ce,ce.length)+2}var p=null,_=new Set;function g(Q){return!p&&typeof window!="undefined"&&window.addEventListener&&(p=function(Ce){Object(C.a)(_).forEach(function(Te){Te(Ce)})},window.addEventListener("mousedown",p)),_.add(Q),function(){_.delete(Q),_.size===0&&(window.removeEventListener("mousedown",p),p=null)}}var w=function(ce){return ce==="month"||ce==="date"?"year":ce},j=function(ce){return ce==="date"?"month":ce},B=function(ce){return ce==="month"||ce==="date"?"quarter":ce},A=function(ce){return ce==="date"?"week":ce},H={year:w,month:j,quarter:B,week:A,time:null,date:null};function F(Q,ce){return Q.some(function(Ce){return Ce&&Ce.contains(ce)})}function x(Q){var ce=Q.prefixCls,Ce=Q.units,Te=Q.onSelect,rt=Q.value,Re=Q.active,Xe=Q.hideDisabledOptions,it="".concat(ce,"-cell"),Dt=k.useContext(a),Tt=Dt.open,Be=k.useRef(null),_t=k.useRef(new Map);return k.useLayoutEffect(function(){var at=_t.current.get(rt);at&&Tt!==!1&&S(Be.current,at.offsetTop,120)},[rt]),k.useLayoutEffect(function(){if(Tt){var at=_t.current.get(rt);at&&S(Be.current,at.offsetTop,0)}},[Tt]),k.createElement("ul",{className:M()("".concat(ce,"-column"),Object(P.a)({},"".concat(ce,"-column-active"),Re)),ref:Be,style:{position:"relative"}},Ce.map(function(at){var dt;return Xe&&at.disabled?null:k.createElement("li",{key:at.value,ref:function(It){_t.current.set(at.value,It)},className:M()(it,(dt={},Object(P.a)(dt,"".concat(it,"-disabled"),at.disabled),Object(P.a)(dt,"".concat(it,"-selected"),rt===at.value),dt)),onClick:function(){if(at.disabled)return;Te(at.value)}},k.createElement("div",{className:"".concat(it,"-inner")},at.label))}))}var Y=x;function q(Q,ce){for(var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Te=String(Q);Te.length<ce;)Te="".concat(Ce).concat(Q);return Te}var ie=function(){for(var ce=arguments.length,Ce=new Array(ce),Te=0;Te<ce;Te++)Ce[Te]=arguments[Te];return Ce};function me(Q){return Q==null?[]:Array.isArray(Q)?Q:[Q]}function $e(Q){var ce={};return Object.keys(Q).forEach(function(Ce){(Ce.substr(0,5)==="data-"||Ce.substr(0,5)==="aria-"||Ce==="role"||Ce==="name")&&Ce.substr(0,7)!=="data-__"&&(ce[Ce]=Q[Ce])}),ce}function xe(Q,ce){return Q?Q[ce]:null}function Ie(Q,ce,Ce){var Te=[xe(Q,0),xe(Q,1)];return Te[Ce]=typeof ce=="function"?ce(Te[Ce]):ce,!Te[0]&&!Te[1]?null:Te}function Je(Q,ce,Ce,Te,rt){var Re=Q.setHour(ce,Ce);return Re=Q.setMinute(Re,Te),Re=Q.setSecond(Re,rt),Re}function Ye(Q,ce,Ce,Te,rt,Re){var Xe=Math.floor(Q/Te)*Te;if(Xe<Q)return[Xe,60-rt,60-Re];var it=Math.floor(ce/rt)*rt;if(it<ce)return[Xe,it,60-Re];var Dt=Math.floor(Ce/Re)*Re;return[Xe,it,Dt]}function ve(Q,ce){if(Q.length!==ce.length)return!0;for(var Ce=0;Ce<Q.length;Ce+=1)if(Q[Ce].disabled!==ce[Ce].disabled)return!0;return!1}function fe(Q,ce,Ce,Te){for(var rt=[],Re=Q;Re<=ce;Re+=Ce)rt.push({label:q(Re,2),value:Re,disabled:(Te||[]).includes(Re)});return rt}function lt(Q){var ce=Q.generateConfig,Ce=Q.prefixCls,Te=Q.operationRef,rt=Q.activeColumnIndex,Re=Q.value,Xe=Q.showHour,it=Q.showMinute,Dt=Q.showSecond,Tt=Q.use12Hours,Be=Q.hourStep,_t=Be===void 0?1:Be,at=Q.minuteStep,dt=at===void 0?1:at,wt=Q.secondStep,It=wt===void 0?1:wt,gt=Q.disabledHours,Xt=Q.disabledMinutes,dn=Q.disabledSeconds,Pn=Q.hideDisabledOptions,Gn=Q.onSelect,Sn=[],Nn="".concat(Ce,"-content"),Mn="".concat(Ce,"-time-panel"),Pt,hn=Re?ce.getHour(Re):-1,Ht=Re?ce.getMinute(Re):-1,Rt=Re?ce.getSecond(Re):-1,Un=function(xn,Lt,Qe,Nt){var Mt=Re||ce.getNow(),cn=Math.max(0,Lt),zn=Math.max(0,Qe),kn=Math.max(0,Nt);return Mt=Je(ce,Mt,!Tt||!xn?cn:cn+12,zn,kn),Mt},On=fe(0,23,_t,gt&&gt()),Vt=Object(T.a)(function(){return On},On,ve);Tt&&(Pt=hn>=12,hn%=12);var ft=k.useMemo(function(){if(!Tt)return[!1,!1];var Dn=[!0,!0];return Vt.forEach(function(xn){var Lt=xn.disabled,Qe=xn.value;if(Lt)return;Qe>=12?Dn[1]=!1:Dn[0]=!1}),Dn},[Tt,Vt]),jn=Object(K.a)(ft,2),fn=jn[0],Qn=jn[1],Zt=k.useMemo(function(){return Tt?Vt.filter(Pt?function(Dn){return Dn.value>=12}:function(Dn){return Dn.value<12}).map(function(Dn){var xn=Dn.value%12,Lt=xn===0?"12":q(xn,2);return Object(I.a)(Object(I.a)({},Dn),{},{label:Lt,value:xn})}):Vt},[Tt,Vt]),Rn=fe(0,59,dt,Xt&&Xt(hn)),Fn=fe(0,59,It,dn&&dn(hn,Ht));Te.current={onUpDown:function(xn){var Lt=Sn[rt];if(Lt)for(var Qe=Lt.units.findIndex(function(zn){return zn.value===Lt.value}),Nt=Lt.units.length,Mt=1;Mt<Nt;Mt+=1){var cn=Lt.units[(Qe+xn*Mt+Nt)%Nt];if(cn.disabled!==!0){Lt.onSelect(cn.value);break}}}};function vn(Dn,xn,Lt,Qe,Nt){Dn!==!1&&Sn.push({node:k.cloneElement(xn,{prefixCls:Mn,value:Lt,active:rt===Sn.length,onSelect:Nt,units:Qe,hideDisabledOptions:Pn}),onSelect:Nt,value:Lt,units:Qe})}vn(Xe,k.createElement(Y,{key:"hour"}),hn,Zt,function(Dn){Gn(Un(Pt,Dn,Ht,Rt),"mouse")}),vn(it,k.createElement(Y,{key:"minute"}),Ht,Rn,function(Dn){Gn(Un(Pt,hn,Dn,Rt),"mouse")}),vn(Dt,k.createElement(Y,{key:"second"}),Rt,Fn,function(Dn){Gn(Un(Pt,hn,Ht,Dn),"mouse")});var yr=-1;return typeof Pt=="boolean"&&(yr=Pt?1:0),vn(Tt===!0,k.createElement(Y,{key:"12hours"}),yr,[{label:"AM",value:0,disabled:fn},{label:"PM",value:1,disabled:Qn}],function(Dn){Gn(Un(!!Dn,hn,Ht,Rt),"mouse")}),k.createElement("div",{className:Nn},Sn.map(function(Dn){var xn=Dn.node;return xn}))}var qt=lt,Ft=function(ce){return ce.filter(function(Ce){return Ce!==!1}).length};function Ot(Q){var ce=Q.generateConfig,Ce=Q.format,Te=Ce===void 0?"HH:mm:ss":Ce,rt=Q.prefixCls,Re=Q.active,Xe=Q.operationRef,it=Q.showHour,Dt=Q.showMinute,Tt=Q.showSecond,Be=Q.use12Hours,_t=Be===void 0?!1:Be,at=Q.onSelect,dt=Q.value,wt="".concat(rt,"-time-panel"),It=k.useRef(),gt=k.useState(-1),Xt=Object(K.a)(gt,2),dn=Xt[0],Pn=Xt[1],Gn=Ft([it,Dt,Tt,_t]);return Xe.current={onKeyDown:function(Nn){return v(Nn,{onLeftRight:function(Pt){Pn((dn+Pt+Gn)%Gn)},onUpDown:function(Pt){dn===-1?Pn(0):It.current&&It.current.onUpDown(Pt)},onEnter:function(){at(dt||ce.getNow(),"key"),Pn(-1)}})},onBlur:function(){Pn(-1)}},k.createElement("div",{className:M()(wt,Object(P.a)({},"".concat(wt,"-active"),Re))},k.createElement(O,Object.assign({},Q,{format:Te,prefixCls:rt})),k.createElement(qt,Object.assign({},Q,{prefixCls:rt,activeColumnIndex:dn,operationRef:It})))}var Ve=Ot,vt=7;function ht(Q,ce){return!Q&&!ce?!0:!Q||!ce?!1:void 0}function Bt(Q,ce,Ce){var Te=ht(ce,Ce);if(typeof Te=="boolean")return Te;var rt=Math.floor(Q.getYear(ce)/10),Re=Math.floor(Q.getYear(Ce)/10);return rt===Re}function se(Q,ce,Ce){var Te=ht(ce,Ce);return typeof Te=="boolean"?Te:Q.getYear(ce)===Q.getYear(Ce)}function Ue(Q,ce){var Ce=Math.floor(Q.getMonth(ce)/3);return Ce+1}function Ge(Q,ce,Ce){var Te=ht(ce,Ce);return typeof Te=="boolean"?Te:se(Q,ce,Ce)&&Ue(Q,ce)===Ue(Q,Ce)}function et(Q,ce,Ce){var Te=ht(ce,Ce);return typeof Te=="boolean"?Te:se(Q,ce,Ce)&&Q.getMonth(ce)===Q.getMonth(Ce)}function Wt(Q,ce,Ce){var Te=ht(ce,Ce);return typeof Te=="boolean"?Te:Q.getYear(ce)===Q.getYear(Ce)&&Q.getMonth(ce)===Q.getMonth(Ce)&&Q.getDate(ce)===Q.getDate(Ce)}function Yt(Q,ce,Ce){var Te=ht(ce,Ce);return typeof Te=="boolean"?Te:Q.getHour(ce)===Q.getHour(Ce)&&Q.getMinute(ce)===Q.getMinute(Ce)&&Q.getSecond(ce)===Q.getSecond(Ce)}function on(Q,ce,Ce,Te){var rt=ht(Ce,Te);return typeof rt=="boolean"?rt:Q.locale.getWeek(ce,Ce)===Q.locale.getWeek(ce,Te)}function nt(Q,ce,Ce){return Wt(Q,ce,Ce)&&Yt(Q,ce,Ce)}function tn(Q,ce,Ce,Te){return!ce||!Ce||!Te?!1:!Wt(Q,ce,Te)&&!Wt(Q,Ce,Te)&&Q.isAfter(Te,ce)&&Q.isAfter(Ce,Te)}function Ln(Q,ce,Ce){var Te=ce.locale.getWeekFirstDay(Q),rt=ce.setDate(Ce,1),Re=ce.getWeekDay(rt),Xe=ce.addDate(rt,Te-Re);return ce.getMonth(Xe)===ce.getMonth(Ce)&&ce.getDate(Xe)>1&&(Xe=ce.addDate(Xe,-7)),Xe}function We(Q,ce,Ce){var Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ce){case"year":return Ce.addYear(Q,Te*10);case"quarter":case"month":return Ce.addYear(Q,Te);default:return Ce.addMonth(Q,Te)}}var Fe=k.createContext({}),yt=Fe;function At(Q){var ce=Q.cellPrefixCls,Ce=Q.generateConfig,Te=Q.rangedValue,rt=Q.hoverRangedValue,Re=Q.isInView,Xe=Q.isSameCell,it=Q.offsetCell,Dt=Q.today,Tt=Q.value;function Be(_t){var at,dt=it(_t,-1),wt=it(_t,1),It=xe(Te,0),gt=xe(Te,1),Xt=xe(rt,0),dn=xe(rt,1),Pn=tn(Ce,Xt,dn,_t);function Gn(Ht){return Xe(It,Ht)}function Sn(Ht){return Xe(gt,Ht)}var Nn=Xe(Xt,_t),Mn=Xe(dn,_t),Pt=(Pn||Mn)&&(!Re(dt)||Sn(dt)),hn=(Pn||Nn)&&(!Re(wt)||Gn(wt));return at={},Object(P.a)(at,"".concat(ce,"-in-view"),Re(_t)),Object(P.a)(at,"".concat(ce,"-in-range"),tn(Ce,It,gt,_t)),Object(P.a)(at,"".concat(ce,"-range-start"),Gn(_t)),Object(P.a)(at,"".concat(ce,"-range-end"),Sn(_t)),Object(P.a)(at,"".concat(ce,"-range-start-single"),Gn(_t)&&!gt),Object(P.a)(at,"".concat(ce,"-range-end-single"),Sn(_t)&&!It),Object(P.a)(at,"".concat(ce,"-range-start-near-hover"),Gn(_t)&&(Xe(dt,Xt)||tn(Ce,Xt,dn,dt))),Object(P.a)(at,"".concat(ce,"-range-end-near-hover"),Sn(_t)&&(Xe(wt,dn)||tn(Ce,Xt,dn,wt))),Object(P.a)(at,"".concat(ce,"-range-hover"),Pn),Object(P.a)(at,"".concat(ce,"-range-hover-start"),Nn),Object(P.a)(at,"".concat(ce,"-range-hover-end"),Mn),Object(P.a)(at,"".concat(ce,"-range-hover-edge-start"),Pt),Object(P.a)(at,"".concat(ce,"-range-hover-edge-end"),hn),Object(P.a)(at,"".concat(ce,"-range-hover-edge-start-near-range"),Pt&&Xe(dt,gt)),Object(P.a)(at,"".concat(ce,"-range-hover-edge-end-near-range"),hn&&Xe(wt,It)),Object(P.a)(at,"".concat(ce,"-today"),Xe(Dt,_t)),Object(P.a)(at,"".concat(ce,"-selected"),Xe(Tt,_t)),at}return Be}function tt(Q){for(var ce=Q.prefixCls,Ce=Q.disabledDate,Te=Q.onSelect,rt=Q.rowNum,Re=Q.colNum,Xe=Q.prefixColumn,it=Q.rowClassName,Dt=Q.baseDate,Tt=Q.getCellClassName,Be=Q.getCellText,_t=Q.getCellNode,at=Q.getCellDate,dt=Q.titleCell,wt=Q.headerCells,It=k.useContext(a),gt=It.onDateMouseEnter,Xt=It.onDateMouseLeave,dn="".concat(ce,"-cell"),Pn=[],Gn=0;Gn<rt;Gn+=1){for(var Sn=[],Nn=void 0,Mn=function(Ht){var Rt=Gn*Re+Ht,Un=at(Dt,Rt),On=Ce&&Ce(Un);Ht===0&&(Nn=Un,Xe&&Sn.push(Xe(Nn))),Sn.push(k.createElement("td",{key:Ht,title:dt&&dt(Un),className:M()(dn,Object(I.a)(Object(P.a)({},"".concat(dn,"-disabled"),On),Tt(Un))),onClick:function(){On||Te(Un)},onMouseEnter:function(){!On&&gt&&gt(Un)},onMouseLeave:function(){!On&&Xt&&Xt(Un)}},_t?_t(Un):k.createElement("div",{className:"".concat(dn,"-inner")},Be(Un))))},Pt=0;Pt<Re;Pt+=1)Mn(Pt);Pn.push(k.createElement("tr",{key:Gn,className:it&&it(Nn)},Sn))}return k.createElement("div",{className:"".concat(ce,"-body")},k.createElement("table",{className:"".concat(ce,"-content")},wt&&k.createElement("thead",null,k.createElement("tr",null,wt)),k.createElement("tbody",null,Pn)))}function ot(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.prefixColumn,rt=Q.locale,Re=Q.rowCount,Xe=Q.viewDate,it=Q.value,Dt=Q.dateRender,Tt=k.useContext(yt),Be=Tt.rangedValue,_t=Tt.hoverRangedValue,at=Ln(rt.locale,Ce,Xe),dt="".concat(ce,"-cell"),wt=Ce.locale.getWeekFirstDay(rt.locale),It=Ce.getNow(),gt=[],Xt=rt.shortWeekDays||(Ce.locale.getShortWeekDays?Ce.locale.getShortWeekDays(rt.locale):[]);Te&&gt.push(k.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var dn=0;dn<vt;dn+=1)gt.push(k.createElement("th",{key:dn},Xt[(dn+wt)%vt]));var Pn=At({cellPrefixCls:dt,today:It,value:it,generateConfig:Ce,rangedValue:Te?null:Be,hoverRangedValue:Te?null:_t,isSameCell:function(Nn,Mn){return Wt(Ce,Nn,Mn)},isInView:function(Nn){return et(Ce,Nn,Xe)},offsetCell:function(Nn,Mn){return Ce.addDate(Nn,Mn)}}),Gn=Dt?function(Sn){return Dt(Sn,It)}:void 0;return k.createElement(tt,Object.assign({},Q,{rowNum:Re,colNum:vt,baseDate:at,getCellNode:Gn,getCellText:Ce.getDate,getCellClassName:Pn,getCellDate:Ce.addDate,titleCell:function(Nn){return Ce.locale.format(rt.locale,Nn,"YYYY-MM-DD")},headerCells:gt}))}var De=ot;function ye(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.viewDate,Re=Q.onNextMonth,Xe=Q.onPrevMonth,it=Q.onNextYear,Dt=Q.onPrevYear,Tt=Q.onYearClick,Be=Q.onMonthClick,_t=k.useContext(a),at=_t.hideHeader;if(at)return null;var dt="".concat(ce,"-header"),wt=Te.shortMonths||(Ce.locale.getShortMonths?Ce.locale.getShortMonths(Te.locale):[]),It=Ce.getMonth(rt),gt=k.createElement("button",{type:"button",key:"year",onClick:Tt,tabIndex:-1,className:"".concat(ce,"-year-btn")},Ce.locale.format(Te.locale,rt,Te.yearFormat)),Xt=k.createElement("button",{type:"button",key:"month",onClick:Be,tabIndex:-1,className:"".concat(ce,"-month-btn")},Te.monthFormat?Ce.locale.format(Te.locale,rt,Te.monthFormat):wt[It]),dn=Te.monthBeforeYear?[Xt,gt]:[gt,Xt];return k.createElement(i,Object.assign({},Q,{prefixCls:dt,onSuperPrev:Dt,onPrev:Xe,onNext:Re,onSuperNext:it}),dn)}var we=ye,ae=6;function oe(Q){var ce=Q.prefixCls,Ce=Q.panelName,Te=Ce===void 0?"date":Ce,rt=Q.keyboardConfig,Re=Q.active,Xe=Q.operationRef,it=Q.generateConfig,Dt=Q.value,Tt=Q.viewDate,Be=Q.onViewDateChange,_t=Q.onPanelChange,at=Q.onSelect,dt="".concat(ce,"-").concat(Te,"-panel");Xe.current={onKeyDown:function(Xt){return v(Xt,Object(I.a)({onLeftRight:function(Pn){at(it.addDate(Dt||Tt,Pn),"key")},onCtrlLeftRight:function(Pn){at(it.addYear(Dt||Tt,Pn),"key")},onUpDown:function(Pn){at(it.addDate(Dt||Tt,Pn*vt),"key")},onPageUpDown:function(Pn){at(it.addMonth(Dt||Tt,Pn),"key")}},rt))}};var wt=function(Xt){var dn=it.addYear(Tt,Xt);Be(dn),_t(null,dn)},It=function(Xt){var dn=it.addMonth(Tt,Xt);Be(dn),_t(null,dn)};return k.createElement("div",{className:M()(dt,Object(P.a)({},"".concat(dt,"-active"),Re))},k.createElement(we,Object.assign({},Q,{prefixCls:ce,value:Dt,viewDate:Tt,onPrevYear:function(){wt(-1)},onNextYear:function(){wt(1)},onPrevMonth:function(){It(-1)},onNextMonth:function(){It(1)},onMonthClick:function(){_t("month",Tt)},onYearClick:function(){_t("year",Tt)}})),k.createElement(De,Object.assign({},Q,{onSelect:function(Xt){return at(Xt,"mouse")},prefixCls:ce,value:Dt,viewDate:Tt,rowCount:ae})))}var pe=oe;function _e(Q,ce,Ce){if(!Ce)return ce;var Te=ce;return Te=Q.setHour(Te,Q.getHour(Ce)),Te=Q.setMinute(Te,Q.getMinute(Ce)),Te=Q.setSecond(Te,Q.getSecond(Ce)),Te}var be=ie("date","time");function Ke(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.generateConfig,rt=Q.value,Re=Q.defaultValue,Xe=Q.disabledTime,it=Q.showTime,Dt=Q.onSelect,Tt="".concat(ce,"-datetime-panel"),Be=k.useState(null),_t=Object(K.a)(Be,2),at=_t[0],dt=_t[1],wt=k.useRef({}),It=k.useRef({}),gt=Object(m.a)(it)==="object"?Object(I.a)({},it):{};function Xt(Sn){var Nn=be.indexOf(at)+Sn,Mn=be[Nn]||null;return Mn}var dn=function(Nn){It.current.onBlur&&It.current.onBlur(Nn),dt(null)};Ce.current={onKeyDown:function(Nn){if(Nn.which===l.a.TAB){var Mn=Xt(Nn.shiftKey?-1:1);return dt(Mn),Mn&&Nn.preventDefault(),!0}if(at){var Pt=at==="date"?wt:It;return Pt.current&&Pt.current.onKeyDown&&Pt.current.onKeyDown(Nn),!0}return[l.a.LEFT,l.a.RIGHT,l.a.UP,l.a.DOWN].includes(Nn.which)?(dt("date"),!0):!1},onBlur:dn,onClose:dn};var Pn=function(Nn,Mn){var Pt=Nn;Mn==="date"&&!rt&&gt.defaultValue?(Pt=Te.setHour(Pt,Te.getHour(gt.defaultValue)),Pt=Te.setMinute(Pt,Te.getMinute(gt.defaultValue)),Pt=Te.setSecond(Pt,Te.getSecond(gt.defaultValue))):Mn==="time"&&!rt&&Re&&(Pt=Te.setYear(Pt,Te.getYear(Re)),Pt=Te.setMonth(Pt,Te.getMonth(Re)),Pt=Te.setDate(Pt,Te.getDate(Re))),Dt&&Dt(Pt,"mouse")},Gn=Xe?Xe(rt||null):{};return k.createElement("div",{className:M()(Tt,Object(P.a)({},"".concat(Tt,"-active"),at))},k.createElement(pe,Object.assign({},Q,{operationRef:wt,active:at==="date",onSelect:function(Nn){Pn(_e(Te,Nn,it&&Object(m.a)(it)==="object"?it.defaultValue:null),"date")}})),k.createElement(Ve,Object.assign({},Q,{format:void 0},gt,Gn,{defaultValue:void 0,operationRef:It,active:at==="time",onSelect:function(Nn){Pn(Nn,"time")}})))}var St=Ke;function nn(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.value,Re="".concat(ce,"-cell"),Xe=function(Be){return k.createElement("td",{key:"week",className:M()(Re,"".concat(Re,"-week"))},Ce.locale.getWeek(Te.locale,Be))},it="".concat(ce,"-week-panel-row"),Dt=function(Be){return M()(it,Object(P.a)({},"".concat(it,"-selected"),on(Ce,Te.locale,rt,Be)))};return k.createElement(pe,Object.assign({},Q,{panelName:"week",prefixColumn:Xe,rowClassName:Dt,keyboardConfig:{onLeftRight:null}}))}var An=nn;function bt(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.viewDate,Re=Q.onNextYear,Xe=Q.onPrevYear,it=Q.onYearClick,Dt=k.useContext(a),Tt=Dt.hideHeader;if(Tt)return null;var Be="".concat(ce,"-header");return k.createElement(i,Object.assign({},Q,{prefixCls:Be,onSuperPrev:Xe,onSuperNext:Re}),k.createElement("button",{type:"button",onClick:it,className:"".concat(ce,"-year-btn")},Ce.locale.format(Te.locale,rt,Te.yearFormat)))}var Jt=bt,Et=3,Ct=4;function st(Q){var ce=Q.prefixCls,Ce=Q.locale,Te=Q.value,rt=Q.viewDate,Re=Q.generateConfig,Xe=Q.monthCellRender,it=k.useContext(yt),Dt=it.rangedValue,Tt=it.hoverRangedValue,Be="".concat(ce,"-cell"),_t=At({cellPrefixCls:Be,value:Te,generateConfig:Re,rangedValue:Dt,hoverRangedValue:Tt,isSameCell:function(gt,Xt){return et(Re,gt,Xt)},isInView:function(){return!0},offsetCell:function(gt,Xt){return Re.addMonth(gt,Xt)}}),at=Ce.shortMonths||(Re.locale.getShortMonths?Re.locale.getShortMonths(Ce.locale):[]),dt=Re.setMonth(rt,0),wt=Xe?function(It){return Xe(It,Ce)}:void 0;return k.createElement(tt,Object.assign({},Q,{rowNum:Ct,colNum:Et,baseDate:dt,getCellNode:wt,getCellText:function(gt){return Ce.monthFormat?Re.locale.format(Ce.locale,gt,Ce.monthFormat):at[Re.getMonth(gt)]},getCellClassName:_t,getCellDate:Re.addMonth,titleCell:function(gt){return Re.locale.format(Ce.locale,gt,"YYYY-MM")}}))}var de=st;function Ae(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.onViewDateChange,rt=Q.generateConfig,Re=Q.value,Xe=Q.viewDate,it=Q.onPanelChange,Dt=Q.onSelect,Tt="".concat(ce,"-month-panel");Ce.current={onKeyDown:function(at){return v(at,{onLeftRight:function(wt){Dt(rt.addMonth(Re||Xe,wt),"key")},onCtrlLeftRight:function(wt){Dt(rt.addYear(Re||Xe,wt),"key")},onUpDown:function(wt){Dt(rt.addMonth(Re||Xe,wt*Et),"key")},onEnter:function(){it("date",Re||Xe)}})}};var Be=function(at){var dt=rt.addYear(Xe,at);Te(dt),it(null,dt)};return k.createElement("div",{className:Tt},k.createElement(Jt,Object.assign({},Q,{prefixCls:ce,onPrevYear:function(){Be(-1)},onNextYear:function(){Be(1)},onYearClick:function(){it("year",Xe)}})),k.createElement(de,Object.assign({},Q,{prefixCls:ce,onSelect:function(at){Dt(at,"mouse"),it("date",at)}})))}var kt=Ae;function ct(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.locale,rt=Q.viewDate,Re=Q.onNextYear,Xe=Q.onPrevYear,it=Q.onYearClick,Dt=k.useContext(a),Tt=Dt.hideHeader;if(Tt)return null;var Be="".concat(ce,"-header");return k.createElement(i,Object.assign({},Q,{prefixCls:Be,onSuperPrev:Xe,onSuperNext:Re}),k.createElement("button",{type:"button",onClick:it,className:"".concat(ce,"-year-btn")},Ce.locale.format(Te.locale,rt,Te.yearFormat)))}var Qt=ct,un=4,Le=1;function qe(Q){var ce=Q.prefixCls,Ce=Q.locale,Te=Q.value,rt=Q.viewDate,Re=Q.generateConfig,Xe=k.useContext(yt),it=Xe.rangedValue,Dt=Xe.hoverRangedValue,Tt="".concat(ce,"-cell"),Be=At({cellPrefixCls:Tt,value:Te,generateConfig:Re,rangedValue:it,hoverRangedValue:Dt,isSameCell:function(dt,wt){return Ge(Re,dt,wt)},isInView:function(){return!0},offsetCell:function(dt,wt){return Re.addMonth(dt,wt*3)}}),_t=Re.setDate(Re.setMonth(rt,0),1);return k.createElement(tt,Object.assign({},Q,{rowNum:Le,colNum:un,baseDate:_t,getCellText:function(dt){return Re.locale.format(Ce.locale,dt,Ce.quarterFormat||"[Q]Q")},getCellClassName:Be,getCellDate:function(dt,wt){return Re.addMonth(dt,wt*3)},titleCell:function(dt){return Re.locale.format(Ce.locale,dt,"YYYY-[Q]Q")}}))}var mt=qe;function jt(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.onViewDateChange,rt=Q.generateConfig,Re=Q.value,Xe=Q.viewDate,it=Q.onPanelChange,Dt=Q.onSelect,Tt="".concat(ce,"-quarter-panel");Ce.current={onKeyDown:function(at){return v(at,{onLeftRight:function(wt){Dt(rt.addMonth(Re||Xe,wt*3),"key")},onCtrlLeftRight:function(wt){Dt(rt.addYear(Re||Xe,wt),"key")},onUpDown:function(wt){Dt(rt.addYear(Re||Xe,wt),"key")}})}};var Be=function(at){var dt=rt.addYear(Xe,at);Te(dt),it(null,dt)};return k.createElement("div",{className:Tt},k.createElement(Qt,Object.assign({},Q,{prefixCls:ce,onPrevYear:function(){Be(-1)},onNextYear:function(){Be(1)},onYearClick:function(){it("year",Xe)}})),k.createElement(mt,Object.assign({},Q,{prefixCls:ce,onSelect:function(at){Dt(at,"mouse")}})))}var sn=jt;function yn(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.viewDate,rt=Q.onPrevDecade,Re=Q.onNextDecade,Xe=Q.onDecadeClick,it=k.useContext(a),Dt=it.hideHeader;if(Dt)return null;var Tt="".concat(ce,"-header"),Be=Ce.getYear(Te),_t=Math.floor(Be/rr)*rr,at=_t+rr-1;return k.createElement(i,Object.assign({},Q,{prefixCls:Tt,onSuperPrev:rt,onSuperNext:Re}),k.createElement("button",{type:"button",onClick:Xe,className:"".concat(ce,"-decade-btn")},_t,"-",at))}var nr=yn,Kn=3,wn=4;function br(Q){var ce=Q.prefixCls,Ce=Q.value,Te=Q.viewDate,rt=Q.locale,Re=Q.generateConfig,Xe=k.useContext(yt),it=Xe.rangedValue,Dt=Xe.hoverRangedValue,Tt="".concat(ce,"-cell"),Be=Re.getYear(Te),_t=Math.floor(Be/rr)*rr,at=_t+rr-1,dt=Re.setYear(Te,_t-Math.ceil((Kn*wn-rr)/2)),wt=function(Xt){var dn=Re.getYear(Xt);return _t<=dn&&dn<=at},It=At({cellPrefixCls:Tt,value:Ce,generateConfig:Re,rangedValue:it,hoverRangedValue:Dt,isSameCell:function(Xt,dn){return se(Re,Xt,dn)},isInView:wt,offsetCell:function(Xt,dn){return Re.addYear(Xt,dn)}});return k.createElement(tt,Object.assign({},Q,{rowNum:wn,colNum:Kn,baseDate:dt,getCellText:Re.getYear,getCellClassName:It,getCellDate:Re.addYear,titleCell:function(Xt){return Re.locale.format(rt.locale,Xt,"YYYY")}}))}var Er=br,rr=10;function cr(Q){var ce=Q.prefixCls,Ce=Q.operationRef,Te=Q.onViewDateChange,rt=Q.generateConfig,Re=Q.value,Xe=Q.viewDate,it=Q.sourceMode,Dt=Q.onSelect,Tt=Q.onPanelChange,Be="".concat(ce,"-year-panel");Ce.current={onKeyDown:function(dt){return v(dt,{onLeftRight:function(It){Dt(rt.addYear(Re||Xe,It),"key")},onCtrlLeftRight:function(It){Dt(rt.addYear(Re||Xe,It*rr),"key")},onUpDown:function(It){Dt(rt.addYear(Re||Xe,It*Kn),"key")},onEnter:function(){Tt(it==="date"?"date":"month",Re||Xe)}})}};var _t=function(dt){var wt=rt.addYear(Xe,dt*10);Te(wt),Tt(null,wt)};return k.createElement("div",{className:Be},k.createElement(nr,Object.assign({},Q,{prefixCls:ce,onPrevDecade:function(){_t(-1)},onNextDecade:function(){_t(1)},onDecadeClick:function(){Tt("decade",Xe)}})),k.createElement(Er,Object.assign({},Q,{prefixCls:ce,onSelect:function(dt){Tt(it==="date"?"date":"month",dt),Dt(dt,"mouse")}})))}var Pr=cr;function Kr(Q){var ce=Q.prefixCls,Ce=Q.generateConfig,Te=Q.viewDate,rt=Q.onPrevDecades,Re=Q.onNextDecades,Xe=k.useContext(a),it=Xe.hideHeader;if(it)return null;var Dt="".concat(ce,"-header"),Tt=Ce.getYear(Te),Be=Math.floor(Tt/ni)*ni,_t=Be+ni-1;return k.createElement(i,Object.assign({},Q,{prefixCls:Dt,onSuperPrev:rt,onSuperNext:Re}),Be,"-",_t)}var hi=Kr,pn=3,or=4;function mi(Q){var ce=ti-1,Ce=Q.prefixCls,Te=Q.viewDate,rt=Q.generateConfig,Re=Q.disabledDate,Xe="".concat(Ce,"-cell"),it=rt.getYear(Te),Dt=Math.floor(it/ti)*ti,Tt=Math.floor(it/ni)*ni,Be=Tt+ni-1,_t=rt.setYear(Te,Tt-Math.ceil((pn*or*ti-ni)/2)),at=function(wt){var It,gt=Re&&Re(wt),Xt=rt.getYear(wt),dn=Xt+ce;return It={},Object(P.a)(It,"".concat(Xe,"-disabled"),gt),Object(P.a)(It,"".concat(Xe,"-in-view"),Tt<=Xt&&dn<=Be),Object(P.a)(It,"".concat(Xe,"-selected"),Xt===Dt),It};return k.createElement(tt,Object.assign({},Q,{rowNum:or,colNum:pn,baseDate:_t,getCellText:function(wt){var It=rt.getYear(wt);return"".concat(It,"-").concat(It+ce)},getCellClassName:at,getCellDate:function(wt,It){return rt.addYear(wt,It*ti)}}))}var wi=mi,ti=10,ni=ti*10;function X(Q){var ce=Q.prefixCls,Ce=Q.onViewDateChange,Te=Q.generateConfig,rt=Q.viewDate,Re=Q.operationRef,Xe=Q.onSelect,it=Q.onPanelChange,Dt="".concat(ce,"-decade-panel");Re.current={onKeyDown:function(at){return v(at,{onLeftRight:function(wt){Xe(Te.addYear(rt,wt*ti),"key")},onCtrlLeftRight:function(wt){Xe(Te.addYear(rt,wt*ni),"key")},onUpDown:function(wt){Xe(Te.addYear(rt,wt*ti*pn),"key")},onEnter:function(){it("year",rt)}})}};var Tt=function(at){var dt=Te.addYear(rt,at*ni);Ce(dt),it(null,dt)},Be=function(at){Xe(at,"mouse"),it("year",at)};return k.createElement("div",{className:Dt},k.createElement(hi,Object.assign({},Q,{prefixCls:ce,onPrevDecades:function(){Tt(-1)},onNextDecades:function(){Tt(1)}})),k.createElement(wi,Object.assign({},Q,{prefixCls:ce,onSelect:Be})))}var L=X;function N(Q,ce,Ce){return Ce?k.createElement("div",{className:"".concat(Q,"-footer-extra")},Ce(ce)):null}function z(Q){var ce=Q.prefixCls,Ce=Q.rangeList,Te=Ce===void 0?[]:Ce,rt=Q.components,Re=rt===void 0?{}:rt,Xe=Q.needConfirmButton,it=Q.onNow,Dt=Q.onOk,Tt=Q.okDisabled,Be=Q.showNow,_t=Q.locale,at,dt;if(Te.length){var wt=Re.rangeItem||"span";at=k.createElement(k.Fragment,null,Te.map(function(gt){var Xt=gt.label,dn=gt.onClick,Pn=gt.onMouseEnter,Gn=gt.onMouseLeave;return k.createElement("li",{key:Xt,className:"".concat(ce,"-preset")},k.createElement(wt,{onClick:dn,onMouseEnter:Pn,onMouseLeave:Gn},Xt))}))}if(Xe){var It=Re.button||"button";it&&!at&&Be!==!1&&(at=k.createElement("li",{className:"".concat(ce,"-now")},k.createElement("a",{className:"".concat(ce,"-now-btn"),onClick:it},_t.now))),dt=Xe&&k.createElement("li",{className:"".concat(ce,"-ok")},k.createElement(It,{disabled:Tt,onClick:Dt},_t.ok))}return!at&&!dt?null:k.createElement("ul",{className:"".concat(ce,"-ranges")},at,dt)}function ne(Q){var ce,Ce=Q.prefixCls,Te=Ce===void 0?"rc-picker":Ce,rt=Q.className,Re=Q.style,Xe=Q.locale,it=Q.generateConfig,Dt=Q.value,Tt=Q.defaultValue,Be=Q.pickerValue,_t=Q.defaultPickerValue,at=Q.disabledDate,dt=Q.mode,wt=Q.picker,It=wt===void 0?"date":wt,gt=Q.tabIndex,Xt=gt===void 0?0:gt,dn=Q.showNow,Pn=Q.showTime,Gn=Q.showToday,Sn=Q.renderExtraFooter,Nn=Q.hideHeader,Mn=Q.onSelect,Pt=Q.onChange,hn=Q.onPanelChange,Ht=Q.onMouseDown,Rt=Q.onPickerValueChange,Un=Q.onOk,On=Q.components,Vt=Q.direction,ft=Q.hourStep,jn=ft===void 0?1:ft,fn=Q.minuteStep,Qn=fn===void 0?1:fn,Zt=Q.secondStep,Rn=Zt===void 0?1:Zt,Fn=It==="date"&&!!Pn||It==="time",vn=24%jn===0,yr=60%Qn===0,Dn=60%Rn===0,xn=k.useContext(a),Lt=xn.operationRef,Qe=xn.panelRef,Nt=xn.onSelect,Mt=xn.hideRanges,cn=xn.defaultOpenValue,zn=k.useContext(yt),kn=zn.inRange,lr=zn.panelPosition,er=zn.rangedValue,Rr=zn.hoverRangedValue,mr=k.useRef({}),xr=k.useRef(!0),Zr=Object(f.a)(null,{value:Dt,defaultValue:Tt,postState:function(Gt){return!Gt&&cn&&It==="time"?cn:Gt}}),Yr=Object(K.a)(Zr,2),Jr=Yr[0],vi=Yr[1],_i=Object(f.a)(null,{value:Be,defaultValue:_t||Jr,postState:function(Gt){return Gt||it.getNow()}}),Ee=Object(K.a)(_i,2),Ne=Ee[0],ze=Ee[1],Se=function(Gt){ze(Gt),Rt&&Rt(Gt)},re=function(Gt){var zt=H[It];return zt?zt(Gt):Gt},ge=Object(f.a)(function(){return It==="time"?"time":re("date")},{value:dt}),ue=Object(K.a)(ge,2),Oe=ue[0],Pe=ue[1];k.useEffect(function(){Pe(It)},[It]);var Ze=k.useState(function(){return Oe}),ke=Object(K.a)(Ze,2),ut=ke[0],Ut=ke[1],rn=function(Gt,zt){var pr=re(Gt||Oe);Ut(Oe),Pe(pr),hn&&(Oe!==pr||nt(it,Ne,Ne))&&hn(zt,pr)},mn=function(Gt,zt){var pr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Oe===It||pr)&&(vi(Gt),Mn&&Mn(Gt),Nt&&Nt(Gt,zt),Pt&&!nt(it,Gt,Jr)&&Pt(Gt))},Hn=function(Gt){return mr.current&&mr.current.onKeyDown?([l.a.LEFT,l.a.RIGHT,l.a.UP,l.a.DOWN,l.a.PAGE_UP,l.a.PAGE_DOWN,l.a.ENTER].includes(Gt.which)&&Gt.preventDefault(),mr.current.onKeyDown(Gt)):(Object(b.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Vn=function(Gt){mr.current&&mr.current.onBlur&&mr.current.onBlur(Gt)};Lt&&lr!=="right"&&(Lt.current={onKeyDown:Hn,onClose:function(){mr.current&&mr.current.onClose&&mr.current.onClose()}}),k.useEffect(function(){Dt&&!xr.current&&ze(Dt)},[Dt]),k.useEffect(function(){xr.current=!1},[]);var fr,dr=Object(I.a)(Object(I.a)({},Q),{},{operationRef:mr,prefixCls:Te,viewDate:Ne,value:Jr,onViewDateChange:Se,sourceMode:ut,onPanelChange:rn,disabledDate:Oe!=="decade"?at:void 0});delete dr.onChange,delete dr.onSelect;switch(Oe){case"decade":fr=k.createElement(L,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}));break;case"year":fr=k.createElement(Pr,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}));break;case"month":fr=k.createElement(kt,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}));break;case"quarter":fr=k.createElement(sn,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}));break;case"week":fr=k.createElement(An,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}));break;case"time":delete dr.showTime,fr=k.createElement(Ve,Object.assign({},dr,Object(m.a)(Pn)==="object"?Pn:null,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}));break;default:Pn?fr=k.createElement(St,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}})):fr=k.createElement(pe,Object.assign({},dr,{onSelect:function(Gt,zt){Se(Gt),mn(Gt,zt)}}))}var wr,Ar,gr=function(){var Gt=it.getNow(),zt=Ye(it.getHour(Gt),it.getMinute(Gt),it.getSecond(Gt),vn?jn:1,yr?Qn:1,Dn?Rn:1),pr=Je(it,Gt,zt[0],zt[1],zt[2]);mn(pr,"submit")};Mt||(wr=N(Te,Oe,Sn),Ar=z({prefixCls:Te,components:On,needConfirmButton:Fn,okDisabled:!Jr||at&&at(Jr),locale:Xe,showNow:dn,onNow:Fn&&gr,onOk:function(){Jr&&(mn(Jr,"submit",!0),Un&&Un(Jr))}}));var Cr;if(Gn&&Oe==="date"&&It==="date"&&!Pn){var Lr=it.getNow(),gn="".concat(Te,"-today-btn"),en=at&&at(Lr);Cr=k.createElement("a",{className:M()(gn,en&&"".concat(gn,"-disabled")),"aria-disabled":en,onClick:function(){en||mn(Lr,"mouse",!0)}},Xe.today)}return k.createElement(a.Provider,{value:Object(I.a)(Object(I.a)({},xn),{},{hideHeader:"hideHeader"in Q?Nn:xn.hideHeader,hidePrevBtn:kn&&lr==="right",hideNextBtn:kn&&lr==="left"})},k.createElement("div",{tabIndex:Xt,className:M()("".concat(Te,"-panel"),rt,(ce={},Object(P.a)(ce,"".concat(Te,"-panel-has-range"),er&&er[0]&&er[1]),Object(P.a)(ce,"".concat(Te,"-panel-has-range-hover"),Rr&&Rr[0]&&Rr[1]),Object(P.a)(ce,"".concat(Te,"-panel-rtl"),Vt==="rtl"),ce)),style:Re,onKeyDown:Hn,onBlur:Vn,onMouseDown:Ht,ref:Qe},fr,wr||Ar||Cr?k.createElement("div",{className:"".concat(Te,"-footer")},wr,Ar,Cr):null))}var J=ne,je=D("uciX"),$t={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function In(Q){var ce,Ce=Q.prefixCls,Te=Q.popupElement,rt=Q.popupStyle,Re=Q.visible,Xe=Q.dropdownClassName,it=Q.dropdownAlign,Dt=Q.transitionName,Tt=Q.getPopupContainer,Be=Q.children,_t=Q.range,at=Q.popupPlacement,dt=Q.direction,wt="".concat(Ce,"-dropdown"),It=function(){return at!==void 0?at:dt==="rtl"?"bottomRight":"bottomLeft"};return k.createElement(je.a,{showAction:[],hideAction:[],popupPlacement:It(),builtinPlacements:$t,prefixCls:wt,popupTransitionName:Dt,popup:Te,popupAlign:it,popupVisible:Re,popupClassName:M()(Xe,(ce={},Object(P.a)(ce,"".concat(wt,"-range"),_t),Object(P.a)(ce,"".concat(wt,"-rtl"),dt==="rtl"),ce)),popupStyle:rt,getPopupContainer:Tt},Be)}var Jn=In;function ln(Q){var ce=Q.open,Ce=Q.value,Te=Q.isClickOutside,rt=Q.triggerOpen,Re=Q.forwardKeyDown,Xe=Q.blurToCancel,it=Q.onSubmit,Dt=Q.onCancel,Tt=Q.onFocus,Be=Q.onBlur,_t=Object(k.useState)(!1),at=Object(K.a)(_t,2),dt=at[0],wt=at[1],It=Object(k.useState)(!1),gt=Object(K.a)(It,2),Xt=gt[0],dn=gt[1],Pn=Object(k.useRef)(!1),Gn=Object(k.useRef)(!1),Sn={onMouseDown:function(){wt(!0),rt(!0)},onKeyDown:function(Mn){switch(Mn.which){case l.a.ENTER:{ce?it()!==!1&&wt(!0):rt(!0),Mn.preventDefault();return}case l.a.TAB:{dt&&ce&&!Mn.shiftKey?(wt(!1),Mn.preventDefault()):!dt&&ce&&(!Re(Mn)&&Mn.shiftKey&&(wt(!0),Mn.preventDefault()));return}case l.a.ESC:{wt(!0),Dt();return}}!ce&&![l.a.SHIFT].includes(Mn.which)?rt(!0):dt||Re(Mn)},onFocus:function(Mn){wt(!0),dn(!0),Tt&&Tt(Mn)},onBlur:function(Mn){if(Pn.current||!Te(document.activeElement)){Pn.current=!1;return}Xe?setTimeout(function(){Te(document.activeElement)&&Dt()},0):ce&&(rt(!1),Gn.current&&it()),dn(!1),Be&&Be(Mn)}};return Object(k.useEffect)(function(){Gn.current=!1},[ce]),Object(k.useEffect)(function(){Gn.current=!0},[Ce]),Object(k.useEffect)(function(){return g(function(Nn){var Mn=Nn.target;ce&&(Te(Mn)?Xt||rt(!1):(Pn.current=!0,requestAnimationFrame(function(){Pn.current=!1})))})}),[Sn,{focused:Xt,typing:dt}]}function tr(Q){var ce=Q.valueTexts,Ce=Q.onTextChange,Te=k.useState(""),rt=Object(K.a)(Te,2),Re=rt[0],Xe=rt[1],it=k.useRef([]);it.current=ce;function Dt(Be){Xe(Be),Ce(Be)}function Tt(){Xe(it.current[0])}return k.useEffect(function(){ce.every(function(Be){return Be!==Re})&&Tt()},[ce.join("||")]),[Re,Dt,Tt]}var qn=D("Gytx"),kr=D.n(qn);function li(Q,ce){var Ce=ce.formatList,Te=ce.generateConfig,rt=ce.locale;return Object(T.a)(function(){if(!Q)return[[""],""];for(var Re="",Xe=[],it=0;it<Ce.length;it+=1){var Dt=Ce[it],Tt=Te.locale.format(rt.locale,Q,Dt);Xe.push(Tt),it===0&&(Re=Tt)}return[Xe,Re]},[Q,Ce],function(Re,Xe){return Re[0]!==Xe[0]||!kr()(Re[1],Xe[1])})}function ai(Q,ce){var Ce=ce.formatList,Te=ce.generateConfig,rt=ce.locale,Re=Object(k.useState)(null),Xe=Object(K.a)(Re,2),it=Xe[0],Dt=Xe[1],Tt=Object(k.useRef)(null);function Be(gt){var Xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(Tt.current),Xt){Dt(gt);return}Tt.current=requestAnimationFrame(function(){Dt(gt)})}var _t=li(it,{formatList:Ce,generateConfig:Te,locale:rt}),at=Object(K.a)(_t,2),dt=at[1];function wt(gt){Be(gt)}function It(){var gt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Be(null,gt)}return Object(k.useEffect)(function(){It(!0)},[Q]),Object(k.useEffect)(function(){return function(){return cancelAnimationFrame(Tt.current)}},[]),[dt,wt,It]}function Gr(Q){var ce,Ce=Q.prefixCls,Te=Ce===void 0?"rc-picker":Ce,rt=Q.id,Re=Q.tabIndex,Xe=Q.style,it=Q.className,Dt=Q.dropdownClassName,Tt=Q.dropdownAlign,Be=Q.popupStyle,_t=Q.transitionName,at=Q.generateConfig,dt=Q.locale,wt=Q.inputReadOnly,It=Q.allowClear,gt=Q.autoFocus,Xt=Q.showTime,dn=Q.picker,Pn=dn===void 0?"date":dn,Gn=Q.format,Sn=Q.use12Hours,Nn=Q.value,Mn=Q.defaultValue,Pt=Q.open,hn=Q.defaultOpen,Ht=Q.defaultOpenValue,Rt=Q.suffixIcon,Un=Q.clearIcon,On=Q.disabled,Vt=Q.disabledDate,ft=Q.placeholder,jn=Q.getPopupContainer,fn=Q.pickerRef,Qn=Q.panelRender,Zt=Q.onChange,Rn=Q.onOpenChange,Fn=Q.onFocus,vn=Q.onBlur,yr=Q.onMouseDown,Dn=Q.onMouseUp,xn=Q.onMouseEnter,Lt=Q.onMouseLeave,Qe=Q.onContextMenu,Nt=Q.onClick,Mt=Q.direction,cn=Q.autoComplete,zn=cn===void 0?"off":cn,kn=k.useRef(null),lr=Pn==="date"&&!!Xt||Pn==="time",er=me(E(Gn,Pn,Xt,Sn)),Rr=k.useRef(null),mr=k.useRef(null),xr=Object(f.a)(null,{value:Nn,defaultValue:Mn}),Zr=Object(K.a)(xr,2),Yr=Zr[0],Jr=Zr[1],vi=k.useState(Yr),_i=Object(K.a)(vi,2),Ee=_i[0],Ne=_i[1],ze=k.useRef(null),Se=Object(f.a)(!1,{value:Pt,defaultValue:hn,postState:function(vr){return On?!1:vr},onChange:function(vr){Rn&&Rn(vr),!vr&&ze.current&&ze.current.onClose&&ze.current.onClose()}}),re=Object(K.a)(Se,2),ge=re[0],ue=re[1],Oe=li(Ee,{formatList:er,generateConfig:at,locale:dt}),Pe=Object(K.a)(Oe,2),Ze=Pe[0],ke=Pe[1],ut=tr({valueTexts:Ze,onTextChange:function(vr){var yi=at.locale.parse(dt.locale,vr,er);yi&&(!Vt||!Vt(yi))&&Ne(yi)}}),Ut=Object(K.a)(ut,3),rn=Ut[0],mn=Ut[1],Hn=Ut[2],Vn=function(vr){Ne(vr),Jr(vr),Zt&&!nt(at,Yr,vr)&&Zt(vr,vr?at.locale.format(dt.locale,vr,er[0]):"")},fr=function(vr){if(On&&vr)return;ue(vr)},dr=function(vr){return ge&&ze.current&&ze.current.onKeyDown?ze.current.onKeyDown(vr):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},wr=function(){Dn&&Dn.apply(void 0,arguments),kn.current&&(kn.current.focus(),fr(!0))},Ar=ln({blurToCancel:lr,open:ge,value:rn,triggerOpen:fr,forwardKeyDown:dr,isClickOutside:function(vr){return!F([Rr.current,mr.current],vr)},onSubmit:function(){return Vt&&Vt(Ee)?!1:(Vn(Ee),fr(!1),Hn(),!0)},onCancel:function(){fr(!1),Ne(Yr),Hn()},onFocus:Fn,onBlur:vn}),gr=Object(K.a)(Ar,2),Cr=gr[0],Lr=gr[1],gn=Lr.focused,en=Lr.typing;k.useEffect(function(){ge||(Ne(Yr),!Ze.length||Ze[0]===""?mn(""):ke!==rn&&Hn())},[ge,Ze]),k.useEffect(function(){ge||Hn()},[Pn]),k.useEffect(function(){Ne(Yr)},[Yr]),fn&&(fn.current={focus:function(){kn.current&&kn.current.focus()},blur:function(){kn.current&&kn.current.blur()}});var En=Object(I.a)(Object(I.a)({},Q),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),Gt=k.createElement(J,Object.assign({},En,{generateConfig:at,className:M()(Object(P.a)({},"".concat(Te,"-panel-focused"),!en)),value:Ee,locale:dt,tabIndex:-1,onChange:Ne,direction:Mt}));Qn&&(Gt=Qn(Gt));var zt=k.createElement("div",{className:"".concat(Te,"-panel-container"),onMouseDown:function(vr){vr.preventDefault()}},Gt),pr;Rt&&(pr=k.createElement("span",{className:"".concat(Te,"-suffix")},Rt));var Mr;It&&Yr&&!On&&(Mr=k.createElement("span",{onMouseDown:function(vr){vr.preventDefault(),vr.stopPropagation()},onMouseUp:function(vr){vr.preventDefault(),vr.stopPropagation(),Vn(null),fr(!1)},className:"".concat(Te,"-clear")},Un||k.createElement("span",{className:"".concat(Te,"-clear-btn")})));var ir=function(vr,yi){(yi==="submit"||yi!=="key"&&!lr)&&(Vn(vr),fr(!1))},Ur=Mt==="rtl"?"bottomRight":"bottomLeft",oi=ai(rn,{formatList:er,generateConfig:at,locale:dt}),jr=Object(K.a)(oi,3),Xr=jr[0],zr=jr[1],Wr=jr[2];return k.createElement(a.Provider,{value:{operationRef:ze,hideHeader:Pn==="time",panelRef:Rr,onSelect:ir,open:ge,defaultOpenValue:Ht,onDateMouseEnter:zr,onDateMouseLeave:Wr}},k.createElement(Jn,{visible:ge,popupElement:zt,popupStyle:Be,prefixCls:Te,dropdownClassName:Dt,dropdownAlign:Tt,getPopupContainer:jn,transitionName:_t,popupPlacement:Ur,direction:Mt},k.createElement("div",{className:M()(Te,it,(ce={},Object(P.a)(ce,"".concat(Te,"-disabled"),On),Object(P.a)(ce,"".concat(Te,"-focused"),gn),Object(P.a)(ce,"".concat(Te,"-rtl"),Mt==="rtl"),ce)),style:Xe,onMouseDown:yr,onMouseUp:wr,onMouseEnter:xn,onMouseLeave:Lt,onContextMenu:Qe,onClick:Nt},k.createElement("div",{className:M()("".concat(Te,"-input"),Object(P.a)({},"".concat(Te,"-input-placeholder"),!!Xr)),ref:mr},k.createElement("input",Object.assign({id:rt,tabIndex:Re,disabled:On,readOnly:wt||!en,value:Xr||rn,onChange:function(vr){mn(vr.target.value)},autoFocus:gt,placeholder:ft,ref:kn,title:rn},Cr,{size:h(Pn,er[0])},$e(Q),{autoComplete:zn})),pr,Mr))))}var Li=function(Q){Object(U.a)(Ce,Q);var ce=Object(G.a)(Ce);function Ce(){var Te;return Object(Z.a)(this,Ce),Te=ce.apply(this,arguments),Te.pickerRef=k.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(V.a)(Ce,[{key:"render",value:function(){return k.createElement(Gr,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(k.Component),Vi=Li;function Dr(Q,ce,Ce){var Te=Q.picker,rt=Q.locale,Re=Q.selectedValue,Xe=Q.disabledDate,it=Q.disabled,Dt=Q.generateConfig,Tt=xe(Re,0),Be=xe(Re,1);function _t(gt){var Xt=Dt.getYear(gt),dn=Dt.locale.getWeek(rt.locale,gt);return Xt*100+dn}function at(gt){var Xt=Dt.getYear(gt),dn=Dt.getMonth(gt);return Xt*100+dn}function dt(gt){var Xt=Dt.getYear(gt),dn=Ue(Dt,gt);return Xt*10+dn}var wt=k.useCallback(function(gt){if(Xe&&Xe(gt))return!0;if(it[1]&&Be)return!Wt(Dt,gt,Be)&&Dt.isAfter(gt,Be);if(ce&&Be)switch(Te){case"quarter":return dt(gt)>dt(Be);case"month":return at(gt)>at(Be);case"week":return _t(gt)>_t(Be);default:return!Wt(Dt,gt,Be)&&Dt.isAfter(gt,Be)}return!1},[Xe,it[1],Be,ce]),It=k.useCallback(function(gt){if(Xe&&Xe(gt))return!0;if(it[0]&&Tt)return!Wt(Dt,gt,Be)&&Dt.isAfter(Tt,gt);if(Ce&&Tt)switch(Te){case"quarter":return dt(gt)<dt(Tt);case"month":return at(gt)<at(Tt);case"week":return _t(gt)<_t(Tt);default:return!Wt(Dt,gt,Tt)&&Dt.isAfter(Tt,gt)}return!1},[Xe,it[0],Tt,Ce]);return[wt,It]}function Sr(Q,ce,Ce,Te){var rt=We(Q,Ce,Te,1);function Re(Xe){return Xe(Q,ce)?"same":Xe(rt,ce)?"closing":"far"}switch(Ce){case"year":return Re(function(Xe,it){return Bt(Te,Xe,it)});case"quarter":case"month":return Re(function(Xe,it){return se(Te,Xe,it)});default:return Re(function(Xe,it){return et(Te,Xe,it)})}}function ri(Q,ce,Ce,Te){var rt=xe(Q,0),Re=xe(Q,1);if(ce===0)return rt;if(rt&&Re){var Xe=Sr(rt,Re,Ce,Te);switch(Xe){case"same":return rt;case"closing":return rt;default:return We(Re,Ce,Te,-1)}}return rt}function Br(Q){var ce=Q.values,Ce=Q.picker,Te=Q.defaultDates,rt=Q.generateConfig,Re=k.useState(function(){return[xe(Te,0),xe(Te,1)]}),Xe=Object(K.a)(Re,2),it=Xe[0],Dt=Xe[1],Tt=k.useState(null),Be=Object(K.a)(Tt,2),_t=Be[0],at=Be[1],dt=xe(ce,0),wt=xe(ce,1);function It(Xt){return it[Xt]?it[Xt]:xe(_t,Xt)||ri(ce,Xt,Ce,rt)||dt||wt||rt.getNow()}function gt(Xt,dn){if(Xt){var Pn=Ie(_t,Xt,dn);Dt(Ie(it,null,dn)||[null,null]);var Gn=(dn+1)%2;xe(ce,Gn)||(Pn=Ie(Pn,Xt,Gn)),at(Pn)}else(dt||wt)&&at(null)}return[It,gt]}function Bn(Q,ce){return Q&&Q[0]&&Q[1]&&ce.isAfter(Q[0],Q[1])?[Q[1],Q[0]]:Q}function _n(Q,ce,Ce,Te){return Q||Te&&Te[ce]?!0:!!Ce[(ce+1)%2]}function Tn(Q){var ce,Ce,Te,rt=Q.prefixCls,Re=rt===void 0?"rc-picker":rt,Xe=Q.id,it=Q.style,Dt=Q.className,Tt=Q.popupStyle,Be=Q.dropdownClassName,_t=Q.transitionName,at=Q.dropdownAlign,dt=Q.getPopupContainer,wt=Q.generateConfig,It=Q.locale,gt=Q.placeholder,Xt=Q.autoFocus,dn=Q.disabled,Pn=Q.format,Gn=Q.picker,Sn=Gn===void 0?"date":Gn,Nn=Q.showTime,Mn=Q.use12Hours,Pt=Q.separator,hn=Pt===void 0?"~":Pt,Ht=Q.value,Rt=Q.defaultValue,Un=Q.defaultPickerValue,On=Q.open,Vt=Q.defaultOpen,ft=Q.disabledDate,jn=Q.disabledTime,fn=Q.dateRender,Qn=Q.panelRender,Zt=Q.ranges,Rn=Q.allowEmpty,Fn=Q.allowClear,vn=Q.suffixIcon,yr=Q.clearIcon,Dn=Q.pickerRef,xn=Q.inputReadOnly,Lt=Q.mode,Qe=Q.renderExtraFooter,Nt=Q.onChange,Mt=Q.onOpenChange,cn=Q.onPanelChange,zn=Q.onCalendarChange,kn=Q.onFocus,lr=Q.onBlur,er=Q.onOk,Rr=Q.components,mr=Q.order,xr=Q.direction,Zr=Q.activePickerIndex,Yr=Q.autoComplete,Jr=Yr===void 0?"off":Yr,vi=Sn==="date"&&!!Nn||Sn==="time",_i=Object(k.useRef)({}),Ee=Object(k.useRef)(null),Ne=Object(k.useRef)(null),ze=Object(k.useRef)(null),Se=Object(k.useRef)(null),re=Object(k.useRef)(null),ge=Object(k.useRef)(null),ue=Object(k.useRef)(null),Oe=me(E(Pn,Sn,Nn,Mn)),Pe=Object(f.a)(0,{value:Zr}),Ze=Object(K.a)(Pe,2),ke=Ze[0],ut=Ze[1],Ut=Object(k.useRef)(null),rn=k.useMemo(function(){return Array.isArray(dn)?dn:[dn||!1,dn||!1]},[dn]),mn=Object(f.a)(null,{value:Ht,defaultValue:Rt,postState:function($n){return Sn==="time"&&!mr?$n:Bn($n,wt)}}),Hn=Object(K.a)(mn,2),Vn=Hn[0],fr=Hn[1],dr=Br({values:Vn,picker:Sn,defaultDates:Un,generateConfig:wt}),wr=Object(K.a)(dr,2),Ar=wr[0],gr=wr[1],Cr=Object(f.a)(Vn,{postState:function($n){var hr=$n;if(rn[0]&&rn[1])return hr;for(var Ir=0;Ir<2;Ir+=1)rn[Ir]&&!xe(hr,Ir)&&!xe(Rn,Ir)&&(hr=Ie(hr,wt.getNow(),Ir));return hr}}),Lr=Object(K.a)(Cr,2),gn=Lr[0],en=Lr[1],En=Object(f.a)([Sn,Sn],{value:Lt}),Gt=Object(K.a)(En,2),zt=Gt[0],pr=Gt[1];Object(k.useEffect)(function(){pr([Sn,Sn])},[Sn]);var Mr=function($n,hr){pr($n),cn&&cn(hr,$n)},ir=Dr({picker:Sn,selectedValue:gn,locale:It,disabled:rn,disabledDate:ft,generateConfig:wt},_i.current[1],_i.current[0]),Ur=Object(K.a)(ir,2),oi=Ur[0],jr=Ur[1],Xr=Object(f.a)(!1,{value:On,defaultValue:Vt,postState:function($n){return rn[ke]?!1:$n},onChange:function($n){Mt&&Mt($n),!$n&&Ut.current&&Ut.current.onClose&&Ut.current.onClose()}}),zr=Object(K.a)(Xr,2),Wr=zr[0],Hr=zr[1],vr=Wr&&ke===0,yi=Wr&&ke===1,Qi=Object(k.useState)(0),ji=Object(K.a)(Qi,2),Ri=ji[0],ui=ji[1];Object(k.useEffect)(function(){!Wr&&Ee.current&&ui(Ee.current.offsetWidth)},[Wr]);var qr=k.useRef();function ii(Or,$n){if(Or)clearTimeout(qr.current),_i.current[$n]=!0,ut($n),Hr(Or),Wr||gr(null,$n);else if(ke===$n){Hr(Or);var hr=_i.current;qr.current=setTimeout(function(){hr===_i.current&&(_i.current={})})}}function ci(Or){ii(!0,Or),setTimeout(function(){var $n=[ge,ue][Or];$n.current&&$n.current.focus()},0)}function Fi(Or,$n){var hr=Or,Ir=xe(hr,0),fi=xe(hr,1);Ir&&fi&&wt.isAfter(Ir,fi)&&(Sn==="week"&&!on(wt,It.locale,Ir,fi)||Sn==="quarter"&&!Ge(wt,Ir,fi)||Sn!=="week"&&Sn!=="quarter"&&Sn!=="time"&&!Wt(wt,Ir,fi)?($n===0?(hr=[Ir,null],fi=null):(Ir=null,hr=[null,fi]),_i.current=Object(P.a)({},$n,!0)):(Sn!=="time"||mr!==!1)&&(hr=Bn(hr,wt))),en(hr);var ga=hr&&hr[0]?wt.locale.format(It.locale,hr[0],Oe[0]):"",aa=hr&&hr[1]?wt.locale.format(It.locale,hr[1],Oe[0]):"";if(zn){var Mi={range:$n===0?"start":"end"};zn(hr,[ga,aa],Mi)}var $i=_n(Ir,0,rn,Rn),va=_n(fi,1,rn,Rn),Wa=hr===null||$i&&va;Wa&&(fr(hr),Nt&&(!nt(wt,xe(Vn,0),Ir)||!nt(wt,xe(Vn,1),fi))&&Nt(hr,[ga,aa]));var Ai=null;$n===0&&!rn[1]?Ai=1:$n===1&&!rn[0]&&(Ai=0),Ai!==null&&Ai!==ke&&(!_i.current[Ai]||!xe(hr,Ai))&&xe(hr,$n)?ci(Ai):ii(!1,$n)}var ha=function($n){return Wr&&Ut.current&&Ut.current.onKeyDown?Ut.current.onKeyDown($n):(Object(b.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:Oe,generateConfig:wt,locale:It},ei=li(xe(gn,0),sa),Zi=Object(K.a)(ei,2),qi=Zi[0],si=Zi[1],Qr=li(xe(gn,1),sa),Ti=Object(K.a)(Qr,2),Ma=Ti[0],no=Ti[1],la=function($n,hr){var Ir=wt.locale.parse(It.locale,$n,Oe),fi=hr===0?oi:jr;Ir&&!fi(Ir)&&(en(Ie(gn,Ir,hr)),gr(Ir,hr))},Ca=tr({valueTexts:qi,onTextChange:function($n){return la($n,0)}}),Ta=Object(K.a)(Ca,3),Sa=Ta[0],ka=Ta[1],co=Ta[2],Ro=tr({valueTexts:Ma,onTextChange:function($n){return la($n,1)}}),za=Object(K.a)(Ro,3),Oa=za[0],Va=za[1],_a=za[2],Ra=Object(k.useState)(null),ho=Object(K.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(k.useState)(null),ya=Object(K.a)(Da,2),Ni=ya[0],fa=ya[1],pa=ai(Sa,{formatList:Oe,generateConfig:wt,locale:It}),ba=Object(K.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Ja=ai(Oa,{formatList:Oe,generateConfig:wt,locale:It}),Ia=Object(K.a)(Ja,3),ua=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function($n){fa(Ie(gn,$n,ke)),ke===0?Xa($n):Ea($n)},Do=function(){fa(Ie(gn,null,ke)),ke===0?$a():ro()},fo=function($n,hr){return{blurToCancel:vi,forwardKeyDown:ha,onBlur:lr,isClickOutside:function(fi){return!F([Ne.current,ze.current,Se.current],fi)},onFocus:function(fi){ut($n),kn&&kn(fi)},triggerOpen:function(fi){ii(fi,$n)},onSubmit:function(){Fi(gn,$n),hr()},onCancel:function(){ii(!1,$n),en(Vn),hr()}}},io=ln(Object(I.a)(Object(I.a)({},fo(0,co)),{},{open:vr,value:Sa})),po=Object(K.a)(io,2),Ki=po[0],bi=po[1],Pi=bi.focused,Ei=bi.typing,Na=ln(Object(I.a)(Object(I.a)({},fo(1,_a)),{},{open:yi,value:Oa})),mo=Object(K.a)(Na,2),ea=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function($n){!Wr&&!ge.current.contains($n.target)&&!ue.current.contains($n.target)&&(rn[0]?rn[1]||ci(1):ci(0))},Qa=function($n){Wr&&(Pi||oo)&&!ge.current.contains($n.target)&&!ue.current.contains($n.target)&&$n.preventDefault()},Ua=Vn&&Vn[0]?wt.locale.format(It.locale,Vn[0],"YYYYMMDDHHmmss"):"",go=Vn&&Vn[1]?wt.locale.format(It.locale,Vn[1],"YYYYMMDDHHmmss"):"";Object(k.useEffect)(function(){Wr||(en(Vn),!qi.length||qi[0]===""?ka(""):si!==Sa&&co(),!Ma.length||Ma[0]===""?Va(""):no!==Oa&&_a())},[Wr,qi,Ma]),Object(k.useEffect)(function(){en(Vn)},[Ua,go]),Dn&&(Dn.current={focus:function(){ge.current&&ge.current.focus()},blur:function(){ge.current&&ge.current.blur(),ue.current&&ue.current.blur()}});var Za=Object.keys(Zt||{}),$r=Za.map(function(Or){var $n=Zt[Or],hr=typeof $n=="function"?$n():$n;return{label:Or,onClick:function(){Fi(hr,null),ii(!1,ke)},onMouseEnter:function(){Aa(hr)},onMouseLeave:function(){Aa(null)}}});function Nr(){var Or=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,$n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},hr=null;Wr&&Ni&&Ni[0]&&Ni[1]&&wt.isAfter(Ni[1],Ni[0])&&(hr=Ni);var Ir=Nn;if(Nn&&Object(m.a)(Nn)==="object"&&Nn.defaultValue){var fi=Nn.defaultValue;Ir=Object(I.a)(Object(I.a)({},Nn),{},{defaultValue:xe(fi,ke)||void 0})}var ga=null;return fn&&(ga=function(Mi,$i){return fn(Mi,$i,{range:ke?"end":"start"})}),k.createElement(yt.Provider,{value:{inRange:!0,panelPosition:Or,rangedValue:Ya||gn,hoverRangedValue:hr}},k.createElement(J,Object.assign({},Q,$n,{dateRender:ga,showTime:Ir,mode:zt[ke],generateConfig:wt,style:void 0,direction:xr,disabledDate:ke===0?oi:jr,disabledTime:function(Mi){return jn?jn(Mi,ke===0?"start":"end"):!1},className:M()(Object(P.a)({},"".concat(Re,"-panel-focused"),ke===0?!Ei:!so)),value:xe(gn,ke),locale:It,tabIndex:-1,onPanelChange:function(Mi,$i){Mr(Ie(zt,$i,ke),Ie(gn,Mi,ke));var va=Mi;Or==="right"&&zt[ke]===$i&&(va=We(va,$i,wt,-1)),gr(va,ke)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var gi=0,Bi=0;ke&&ze.current&&re.current&&Ne.current&&(gi=ze.current.offsetWidth+re.current.offsetWidth,Ne.current.offsetWidth&&gi>Ne.current.offsetWidth&&(Bi=gi));var La=xr==="rtl"?{right:gi}:{left:gi};function ca(){var Or,$n=N(Re,zt[ke],Qe),hr=z({prefixCls:Re,components:Rr,needConfirmButton:vi,okDisabled:!xe(gn,ke)||ft&&ft(gn[ke]),locale:It,rangeList:$r,onOk:function(){xe(gn,ke)&&(Fi(gn,ke),er&&er(gn))}});if(Sn!=="time"&&!Nn){var Ir=Ar(ke),fi=We(Ir,Sn,wt),ga=zt[ke],aa=ga===Sn,Mi=Nr(aa?"left":!1,{pickerValue:Ir,onPickerValueChange:function(Ai){gr(Ai,ke)}}),$i=Nr("right",{pickerValue:fi,onPickerValueChange:function(Ai){gr(We(Ai,Sn,wt,-1),ke)}});xr==="rtl"?Or=k.createElement(k.Fragment,null,$i,aa&&Mi):Or=k.createElement(k.Fragment,null,Mi,aa&&$i)}else Or=Nr();var va=k.createElement(k.Fragment,null,k.createElement("div",{className:"".concat(Re,"-panels")},Or),($n||hr)&&k.createElement("div",{className:"".concat(Re,"-footer")},$n,hr));return Qn&&(va=Qn(va)),k.createElement("div",{className:"".concat(Re,"-panel-container"),style:{marginLeft:Bi},ref:Ne,onMouseDown:function(Ai){Ai.preventDefault()}},va)}var ja=k.createElement("div",{className:M()("".concat(Re,"-range-wrapper"),"".concat(Re,"-").concat(Sn,"-range-wrapper")),style:{minWidth:Ri}},k.createElement("div",{className:"".concat(Re,"-range-arrow"),style:La}),ca()),da;vn&&(da=k.createElement("span",{className:"".concat(Re,"-suffix")},vn));var Si;Fn&&(xe(Vn,0)&&!rn[0]||xe(Vn,1)&&!rn[1])&&(Si=k.createElement("span",{onMouseDown:function($n){$n.preventDefault(),$n.stopPropagation()},onMouseUp:function($n){$n.preventDefault(),$n.stopPropagation();var hr=Vn;rn[0]||(hr=Ie(hr,null,0)),rn[1]||(hr=Ie(hr,null,1)),Fi(hr,null),ii(!1,ke)},className:"".concat(Re,"-clear")},yr||k.createElement("span",{className:"".concat(Re,"-clear-btn")})));var Fa={size:h(Sn,Oe[0])},Ba=0,Ha=0;ze.current&&Se.current&&re.current&&(ke===0?Ha=ze.current.offsetWidth:(Ba=gi,Ha=Se.current.offsetWidth));var Gi=xr==="rtl"?{right:Ba}:{left:Ba},Vr=function($n,hr){var Ir=Ie(gn,$n,ke);hr==="submit"||hr!=="key"&&!vi?(Fi(Ir,ke),ke===0?$a():ro()):en(Ir)};return k.createElement(a.Provider,{value:{operationRef:Ut,hideHeader:Sn==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Vr,open:Wr}},k.createElement(Jn,{visible:Wr,popupElement:ja,popupStyle:Tt,prefixCls:Re,dropdownClassName:Be,dropdownAlign:at,getPopupContainer:dt,transitionName:_t,range:!0,direction:xr},k.createElement("div",Object.assign({ref:Ee,className:M()(Re,"".concat(Re,"-range"),Dt,(ce={},Object(P.a)(ce,"".concat(Re,"-disabled"),rn[0]&&rn[1]),Object(P.a)(ce,"".concat(Re,"-focused"),ke===0?Pi:oo),Object(P.a)(ce,"".concat(Re,"-rtl"),xr==="rtl"),ce)),style:it,onClick:xa,onMouseDown:Qa},$e(Q)),k.createElement("div",{className:M()("".concat(Re,"-input"),(Ce={},Object(P.a)(Ce,"".concat(Re,"-input-active"),ke===0),Object(P.a)(Ce,"".concat(Re,"-input-placeholder"),!!ma),Ce)),ref:ze},k.createElement("input",Object.assign({id:Xe,disabled:rn[0],readOnly:xn||!Ei,value:ma||Sa,onChange:function($n){ka($n.target.value)},autoFocus:Xt,placeholder:xe(gt,0)||"",ref:ge},Ki,Fa,{autoComplete:Jr}))),k.createElement("div",{className:"".concat(Re,"-range-separator"),ref:re},hn),k.createElement("div",{className:M()("".concat(Re,"-input"),(Te={},Object(P.a)(Te,"".concat(Re,"-input-active"),ke===1),Object(P.a)(Te,"".concat(Re,"-input-placeholder"),!!ua),Te)),ref:Se},k.createElement("input",Object.assign({disabled:rn[1],readOnly:xn||!so,value:ua||Oa,onChange:function($n){Va($n.target.value)},placeholder:xe(gt,1)||"",ref:ue},ea,Fa,{autoComplete:Jr}))),k.createElement("div",{className:"".concat(Re,"-active-bar"),style:Object(I.a)(Object(I.a)({},Gi),{},{width:Ha,position:"absolute"})}),da,Si)))}var bn=function(Q){Object(U.a)(Ce,Q);var ce=Object(G.a)(Ce);function Ce(){var Te;return Object(Z.a)(this,Ce),Te=ce.apply(this,arguments),Te.pickerRef=k.createRef(),Te.focus=function(){Te.pickerRef.current&&Te.pickerRef.current.focus()},Te.blur=function(){Te.pickerRef.current&&Te.pickerRef.current.blur()},Te}return Object(V.a)(Ce,[{key:"render",value:function(){return k.createElement(Tn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Ce}(k.Component),ur=bn,sr=he.b=Vi},osHv:function(Kt,he,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";var V=Z.Pos;function U(c,s){return c.line-s.line||c.ch-s.ch}var G="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",P=G+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+G+"]["+P+"]*)","g");function K(c,s,i,n){this.line=s,this.ch=i,this.cm=c,this.text=c.getLine(s),this.min=n?Math.max(n.from,c.firstLine()):c.firstLine(),this.max=n?Math.min(n.to-1,c.lastLine()):c.lastLine()}function k(c,s){var i=c.cm.getTokenTypeAt(V(c.line,s));return i&&/\btag\b/.test(i)}function r(c){return c.line>=c.max?void 0:(c.ch=0,c.text=c.cm.getLine(++c.line),!0)}function M(c){return c.line<=c.min?void 0:(c.text=c.cm.getLine(--c.line),c.ch=c.text.length,!0)}function b(c){for(;;){var s=c.text.indexOf(">",c.ch);if(s==-1){if(r(c))continue;return}if(!k(c,s+1)){c.ch=s+1;continue}var i=c.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(c.text.slice(i+1,s));return c.ch=s+1,n?"selfClose":"regular"}}function f(c){for(;;){var s=c.ch?c.text.lastIndexOf("<",c.ch-1):-1;if(s==-1){if(M(c))continue;return}if(!k(c,s+1)){c.ch=s;continue}I.lastIndex=s,c.ch=s;var i=I.exec(c.text);if(i&&i.index==s)return i}}function m(c){for(;;){I.lastIndex=c.ch;var s=I.exec(c.text);if(!s){if(r(c))continue;return}if(!k(c,s.index+1)){c.ch=s.index+1;continue}return c.ch=s.index+s[0].length,s}}function l(c){for(;;){var s=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(s==-1){if(M(c))continue;return}if(!k(c,s+1)){c.ch=s;continue}var i=c.text.lastIndexOf("/",s),n=i>-1&&!/\S/.test(c.text.slice(i+1,s));return c.ch=s+1,n?"selfClose":"regular"}}function o(c,s){for(var i=[];;){var n=m(c),O,T=c.line,C=c.ch-(n?n[0].length:0);if(!n||!(O=b(c)))return;if(O=="selfClose")continue;if(n[1]){for(var R=i.length-1;R>=0;--R)if(i[R]==n[2]){i.length=R;break}if(R<0&&(!s||s==n[2]))return{tag:n[2],from:V(T,C),to:V(c.line,c.ch)}}else i.push(n[2])}}function a(c,s){for(var i=[];;){var n=l(c);if(!n)return;if(n=="selfClose"){f(c);continue}var O=c.line,T=c.ch,C=f(c);if(!C)return;if(C[1])i.push(C[2]);else{for(var R=i.length-1;R>=0;--R)if(i[R]==C[2]){i.length=R;break}if(R<0&&(!s||s==C[2]))return{tag:C[2],from:V(c.line,c.ch),to:V(O,T)}}}}Z.registerHelper("fold","xml",function(c,s){for(var i=new K(c,s.line,0);;){var n=m(i);if(!n||i.line!=s.line)return;var O=b(i);if(!O)return;if(!n[1]&&O!="selfClose"){var T=V(i.line,i.ch),C=o(i,n[2]);return C&&U(C.from,T)>0?{from:T,to:C.from}:null}}}),Z.findMatchingTag=function(c,s,i){var n=new K(c,s.line,s.ch,i);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var O=b(n),T=O&&V(n.line,n.ch),C=O&&f(n);if(!O||!C||U(n,s)>0)return;var R={from:V(n.line,n.ch),to:T,tag:C[2]};return O=="selfClose"?{open:R,close:null,at:"open"}:C[1]?{open:a(n,C[2]),close:R,at:"close"}:(n=new K(c,T.line,T.ch,i),{open:R,close:o(n,C[2]),at:"open"})},Z.findEnclosingTag=function(c,s,i,n){for(var O=new K(c,s.line,s.ch,i);;){var T=a(O,n);if(!T)break;var C=new K(c,s.line,s.ch,i),R=o(C,T.tag);if(R)return{open:T,close:R}}},Z.scanForClosingTag=function(c,s,i,n){var O=new K(c,s.line,s.ch,n?{from:0,to:n}:null);return o(O,i)}})},p5ED:function(Kt,he,D){"use strict";var Z=D("+L6B"),V=D("2/Rp"),U=D("5Dmo"),G=D("3S7+"),P=D("k1fw"),I=D("tJVT"),K=D("q1tI"),k=D.n(K),r=D("vHTk"),M=D.n(r),b=D("yEEn"),f=D("ZW9T"),m=D("1vsH");he.a=function(l){var o=l.name,a=l.data,c=l.theme,s=l.type,i=l.filename,n=l.monacoEditor,O=l.className,T=l.style,C=l.close,R=l.onClose,S=l.hasMask,v=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),E=Object(I.a)(v,2),h=E[0],p=E[1],_=Object(K.useState)(""),g=Object(I.a)(_,2),w=g[0],j=g[1],B,A=1024*1024,H=10*A,F=Object(K.useRef)();s==="office"&&(B=Object(m.T)(a).filesize,B>H&&(s="other")),i&&(n.filename=i),Object(K.useEffect)(function(){var q,ie,me=(q=document.cookie)===null||q===void 0||((ie=q.replace(/\s/g,""))===null||ie===void 0)?void 0:ie.split(";");me==null||me.map(function($e){var xe=$e.split("=");xe[0]==="_educoder_session"&&j(xe[1])})},[]);var x=function(){if(a.startsWith("http")||a.startsWith("/")){Y();return}Object(m.z)(i||"educoder",a,i)},Y=function(){Object(m.x)(i||o,a)};return console.log("data:",a,"fileanme:",i," name:",o),k.a.createElement("div",{style:Object(P.a)({},T||{}),className:"".concat(S&&M.a.bgBlack," ").concat(s?M.a.wrp:"hide")},C&&k.a.createElement("div",{className:M.a.close,ref:F},k.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return F.current}},k.a.createElement("span",{onClick:Y},k.a.createElement("i",{className:"icon-quxiaozhiding"}))),k.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return F.current}},k.a.createElement("span",{className:"",onClick:R},k.a.createElement("i",{className:"icon-guanbi1"})))),k.a.createElement("div",{className:"".concat(M.a[O]," ").concat(O," ").concat(M.a.monaco," ").concat(s==="txt"?"show":"hide")},s==="txt"&&k.a.createElement(f.b,n)),s==="audio"&&k.a.createElement("audio",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?a:"data:audio/mp3;base64,").concat(a),autoPlay:!0}),s==="video"&&k.a.createElement(k.a.Fragment,null,a!=null&&a.startsWith("/")?k.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):k.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),s==="html"&&k.a.createElement("iframe",{src:a+"&disposition=inline"}),s==="pdf"&&k.a.createElement("embed",{className:M.a.embed,src:a}),s==="image"&&k.a.createElement(k.a.Fragment,null,k.a.createElement("img",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(a)})),s==="other"&&k.a.createElement("div",null,k.a.createElement(V.a,{type:"primary",size:"large",onClick:x},k.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(s==="download"||s==="office")&&k.a.createElement(V.a,{type:"primary",size:"large",onClick:x},k.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Kt,he,D){},pmY6:function(Kt,he,D){"use strict";D.d(he,"h",function(){return M}),D.d(he,"g",function(){return f}),D.d(he,"f",function(){return m}),D.d(he,"e",function(){return l}),D.d(he,"i",function(){return o}),D.d(he,"b",function(){return a}),D.d(he,"a",function(){return c}),D.d(he,"d",function(){return s}),D.d(he,"c",function(){return i});var Z=D("C/vA"),V=D("JYp7");const U=!1;let G=null;function P(n){G=n}if(U){const n="__is_disposable_tracked__";P(new class{trackDisposable(O){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[n]||console.log(T)},3e3)}setParent(O,T){if(O&&O!==c.None)try{O[n]=!0}catch(C){}}markAsDisposed(O){if(O&&O!==c.None)try{O[n]=!0}catch(T){}}markAsSingleton(O){}})}function I(n){return G==null||G.trackDisposable(n),n}function K(n){G==null||G.markAsDisposed(n)}function k(n,O){G==null||G.setParent(n,O)}function r(n,O){if(!G)return;for(const T of n)G.setParent(T,O)}function M(n){return G==null||G.markAsSingleton(n),n}class b extends Error{constructor(n){super(`Encountered errors while disposing of store. Errors: [${n.join(", ")}]`);this.errors=n}}function f(n){return typeof n.dispose=="function"&&n.dispose.length===0}function m(n){if(V.a.is(n)){let O=[];for(const T of n)if(T)try{T.dispose()}catch(C){O.push(C)}if(O.length===1)throw O[0];if(O.length>1)throw new b(O);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function l(...n){const O=o(()=>m(n));return r(n,O),O}function o(n){const O=I({dispose:Object(Z.a)(()=>{K(O),n()})});return O}class a{constructor(){this._toDispose=new Set,this._isDisposed=!1,I(this)}dispose(){if(this._isDisposed)return;K(this),this._isDisposed=!0,this.clear()}clear(){try{m(this._toDispose.values())}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return k(n,this),this._isDisposed?a.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(n),n}}a.DISABLE_DISPOSED_WARNING=!1;class c{constructor(){this._store=new a,I(this),k(this._store,this)}dispose(){K(this),this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}}c.None=Object.freeze({dispose(){}});class s{constructor(){this._isDisposed=!1,I(this)}get value(){return this._isDisposed?void 0:this._value}set value(n){var O;if(this._isDisposed||n===this._value)return;(O=this._value)===null||O===void 0||O.dispose(),n&&k(n,this),this._value=n}clear(){this.value=void 0}dispose(){var n;this._isDisposed=!0,K(this),(n=this._value)===null||n===void 0||n.dispose(),this._value=void 0}clearAndLeak(){const n=this._value;return this._value=void 0,n&&k(n,null),n}}class i{constructor(n){this.object=n}dispose(){}}},psGv:function(Kt,he,D){var Z,V;(function(){var U;(function(){"use strict";var K=[,,function(b){function f(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var o=new f(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},f.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},f.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},f.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},f.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function m(o,a){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(o,a){var c=this.__base_string_length;return a=a||0,o<0&&(c=0),c+=o*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(o,a){var c=this.__base_string;return a=a||0,o<0&&(o=0,c=""),a+=o*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var o=this.__cache.length,a=0,c="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),o&&(c+=new Array(o+1).join(" ")),this.__cache.push(c)};function l(o,a){this.__indent_cache=new m(o,a),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},l.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return o!==`
`&&(c=c.replace(/[\n]/g,o)),c},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},l.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},l.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},l.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},l.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(o,a){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(o)!==0&&s.item(-1)!==a){this.__lines.splice(c+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},b.exports.Output=l},function(b){function f(m,l,o,a){this.type=m,this.text=l,this.comments_before=null,this.newlines=o||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=f},,,function(b){function f(o,a){this.raw_options=m(o,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(o,a){var c=this.raw_options[o],s=a||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},f.prototype._get_boolean=function(o,a){var c=this.raw_options[o],s=c===void 0?!!a:!!c;return s},f.prototype._get_characters=function(o,a){var c=this.raw_options[o],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},f.prototype._get_number=function(o,a){var c=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},f.prototype._get_selection=function(o,a,c){var s=this._get_selection_list(o,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[o]+"'");return s[0]},f.prototype._get_selection_list=function(o,a,c){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[a[0]],!this._is_valid_selection(c,a))throw new Error("Invalid Default Value!");var s=this._get_array(o,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[o]+"'");return s},f.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(c){return a.indexOf(c)===-1})};function m(o,a){var c={};o=l(o);var s;for(s in o)s!==a&&(c[s]=o[s]);if(a&&o[a])for(s in o[a])c[s]=o[a][s];return c}function l(o){var a={},c;for(c in o){var s=c.replace(/-/g,"_");a[s]=o[c]}return a}b.exports.Options=f,b.exports.normalizeOpts=l,b.exports.mergeOpts=m},,function(b){var f=RegExp.prototype.hasOwnProperty("sticky");function m(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position<this.__input_length},m.prototype.next=function(){var l=null;return this.hasNext()&&(l=this.__input.charAt(this.__position),this.__position+=1),l},m.prototype.peek=function(l){var o=null;return l=l||0,l+=this.__position,l>=0&&l<this.__input_length&&(o=this.__input.charAt(l)),o},m.prototype.__match=function(l,o){l.lastIndex=o;var a=l.exec(this.__input);return a&&!(f&&l.sticky)&&(a.index!==o&&(a=null)),a},m.prototype.test=function(l,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(l,o):!1},m.prototype.testChar=function(l,o){var a=this.peek(o);return l.lastIndex=0,a!==null&&l.test(a)},m.prototype.match=function(l){var o=this.__match(l,this.__position);return o?this.__position+=o[0].length:o=null,o},m.prototype.read=function(l,o,a){var c="",s;return l&&(s=this.match(l),s&&(c+=s[0])),o&&(s||!l)&&(c+=this.readUntil(o,a)),c},m.prototype.readUntil=function(l,o){var a="",c=this.__position;l.lastIndex=this.__position;var s=l.exec(this.__input);return s?(c=s.index,o&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(l){return this.readUntil(l,!0)},m.prototype.get_regexp=function(l,o){var a=null,c="g";return o&&f&&(c="y"),typeof l=="string"&&l!==""?a=new RegExp(l,c):l&&(a=new RegExp(l.source,c)),a},m.prototype.get_literal_regexp=function(l){return RegExp(l.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(l){var o=this.__position,a=this.readUntilAfter(l);return this.__position=o,a},m.prototype.lookBack=function(l){var o=this.__position-1;return o>=l.length&&this.__input.substring(o-l.length,o).toLowerCase()===l},b.exports.InputScanner=m},function(b,f,m){var l=m(8).InputScanner,o=m(3).Token,a=m(10).TokenStream,c=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(n,O){this._input=new l(n),this._options=O||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var n,O=new o(s.START,""),T=null,C=[],R=new a;O.type!==s.EOF;){for(n=this._get_next_token(O,T);this._is_comment(n);)R.add(n),n=this._get_next_token(O,T);R.isEmpty()||(n.comments_before=R,R=new a),n.parent=T,this._is_opening(n)?(C.push(T),T=n):T&&this._is_closing(n,T)&&(n.opened=T,T.closed=n,T=C.pop(),n.parent=T),n.previous=O,O.next=n,this.__tokens.add(n),O=n}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(n,O){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(s.RAW,T):this._create_token(s.EOF,"")},i.prototype._is_comment=function(n){return!1},i.prototype._is_opening=function(n){return!1},i.prototype._is_closing=function(n,O){return!1},i.prototype._create_token=function(n,O){var T=new o(n,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=i,b.exports.TOKEN=s},function(b){function f(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},f.prototype.peek=function(m){var l=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(l=this.__tokens[m]),l},f.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},b.exports.TokenStream=f},function(b,f,m){var l=m(12).Pattern;function o(a,c){l.call(this,a,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new l,o.prototype.__set_whitespace_patterns=function(a,c){a+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var c=this.__split(this._newline_regexp,a);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return a},o.prototype.matching=function(a,c){var s=this._create();return s.__set_whitespace_patterns(a,c),s._update(),s},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(a,c){a.lastIndex=0;for(var s=0,i=[],n=a.exec(c);n;)i.push(c.substring(s,n.index)),s=n.index+n[0].length,n=a.exec(c);return s<c.length?i.push(c.substring(s,c.length)):i.push(""),i},b.exports.WhitespacePattern=o},function(b){function f(m,l){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,l&&(this._starting_pattern=this._input.get_regexp(l._starting_pattern,!0),this._match_pattern=this._input.get_regexp(l._match_pattern,!0),this._until_pattern=this._input.get_regexp(l._until_pattern),this._until_after=l._until_after)}f.prototype.read=function(){var m=this._input.read(this._starting_pattern);return(!this._starting_pattern||m)&&(m+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),m},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(m){var l=this._create();return l._until_after=!0,l._until_pattern=this._input.get_regexp(m),l._update(),l},f.prototype.until=function(m){var l=this._create();return l._until_after=!1,l._until_pattern=this._input.get_regexp(m),l._update(),l},f.prototype.starting_with=function(m){var l=this._create();return l._starting_pattern=this._input.get_regexp(m,!0),l._update(),l},f.prototype.matching=function(m){var l=this._create();return l._match_pattern=this._input.get_regexp(m,!0),l._update(),l},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},b.exports.Pattern=f},function(b){function f(m,l){m=typeof m=="string"?m:m.source,l=typeof l=="string"?l:l.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+l,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+l,"g")}f.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var l={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(m);o;)l[o[1]]=o[2],o=this.__directive_pattern.exec(m);return l},f.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=f},function(b,f,m){var l=m(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(c,s){l.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new l(c);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new l,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(c){var s=this._create();return s._disabled[c]=!0,s._update(),s},a.prototype.read_options=function(c){var s=this._create();for(var i in o)s._disabled[i]=c.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(c){var s=this._create();return s._excluded[c]=!0,s._update(),s},a.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),c+=s,s=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},a.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},a.prototype._read_template=function(){var c="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(c=c||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},b.exports.TemplatablePattern=a},,,,function(b,f,m){var l=m(19).Beautifier,o=m(20).Options;function a(c,s,i,n){var O=new l(c,s,i,n);return O.beautify()}b.exports=a,b.exports.defaultOptions=function(){return new o}},function(b,f,m){var l=m(20).Options,o=m(2).Output,a=m(21).Tokenizer,c=m(21).TOKEN,s=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,n=function(_,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=_.max_preserve_newlines,this.preserve_newlines=_.preserve_newlines,this._output=new o(_,g)};n.prototype.current_line_has_match=function(_){return this._output.current_line.has_match(_)},n.prototype.set_space_before_token=function(_,g){this._output.space_before_token=_,this._output.non_breaking_space=g},n.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},n.prototype.add_raw_token=function(_){this._output.add_raw_token(_)},n.prototype.print_preserved_newlines=function(_){var g=0;_.type!==c.TEXT&&_.previous.type!==c.TEXT&&(g=_.newlines?1:0),this.preserve_newlines&&(g=_.newlines<this.max_preserve_newlines+1?_.newlines:this.max_preserve_newlines+1);for(var w=0;w<g;w++)this.print_newline(w>0);return g!==0},n.prototype.traverse_whitespace=function(_){return _.whitespace_before||_.newlines?(this.print_preserved_newlines(_)||(this._output.space_before_token=!0),!0):!1},n.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},n.prototype.print_newline=function(_){this._output.add_new_line(_)},n.prototype.print_token=function(_){_.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(_.text))},n.prototype.indent=function(){this.indent_level++},n.prototype.get_full_indent=function(_){return _=this.indent_level+(_||0),_<1?"":this._output.get_indent_string(_)};var O=function(_){for(var g=null,w=_.next;w.type!==c.EOF&&_.closed!==w;){if(w.type===c.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===c.EQUALS&&w.next.next&&w.next.next.type===c.VALUE&&(g=w.next.next.text);break}w=w.next}return g},T=function(_,g){var w=null,j=null;return g.closed?(_==="script"?w="text/javascript":_==="style"&&(w="text/css"),w=O(g)||w,w.search("text/css")>-1?j="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":w.search(/test\/null/)>-1&&(j="null"),j):null};function C(_,g){return g.indexOf(_)!==-1}function R(_,g,w){this.parent=_||null,this.tag=g?g.tag_name:"",this.indent_level=w||0,this.parser_token=g||null}function S(_){this._printer=_,this._current_frame=null}S.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},S.prototype.record_tag=function(_){var g=new R(this._current_frame,_,this._printer.indent_level);this._current_frame=g},S.prototype._try_pop_frame=function(_){var g=null;return _&&(g=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),g},S.prototype._get_frame=function(_,g){for(var w=this._current_frame;w&&!(_.indexOf(w.tag)!==-1);){if(g&&g.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},S.prototype.try_pop=function(_,g){var w=this._get_frame([_],g);return this._try_pop_frame(w)},S.prototype.indent_to_tag=function(_){var g=this._get_frame(_);g&&(this._printer.indent_level=g.indent_level)};function v(_,g,w,j){this._source_text=_||"",g=g||{},this._js_beautify=w,this._css_beautify=j,this._tag_stack=null;var B=new l(g,"html");this._options=B,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
`,_&&s.test(_)&&(g=_.match(s)[0])),_=_.replace(i,`
`);var w=_.match(/^[\t ]*/)[0],j={text:"",type:""},B=new E,A=new n(this._options,w),H=new a(_,this._options).tokenize();this._tag_stack=new S(A);for(var F=null,x=H.next();x.type!==c.EOF;)x.type===c.TAG_OPEN||x.type===c.COMMENT?(F=this._handle_tag_open(A,x,B,j),B=F):x.type===c.ATTRIBUTE||x.type===c.EQUALS||x.type===c.VALUE||x.type===c.TEXT&&!B.tag_complete?F=this._handle_inside_tag(A,x,B,H):x.type===c.TAG_CLOSE?F=this._handle_tag_close(A,x,B):x.type===c.TEXT?F=this._handle_text(A,x,B):A.add_raw_token(x),j=F,x=H.next();var Y=A._output.get_code(g);return Y},v.prototype._handle_tag_close=function(_,g,w){var j={text:g.text,type:g.type};return _.alignment_size=0,w.tag_complete=!0,_.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),w.is_unformatted?_.add_raw_token(g):(w.tag_start_char==="<"&&(_.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(g)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(_.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&_.set_wrap_point(),j},v.prototype._handle_inside_tag=function(_,g,w,j){var B=w.has_wrapped_attrs,A={text:g.text,type:g.type};if(_.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),w.is_unformatted)_.add_raw_token(g);else if(w.tag_start_char==="{"&&g.type===c.TEXT)_.print_preserved_newlines(g)?(g.newlines=0,_.add_raw_token(g)):_.print_token(g);else{if(g.type===c.ATTRIBUTE?(_.set_space_before_token(!0),w.attr_count+=1):(g.type===c.EQUALS||g.type===c.VALUE&&g.previous.type===c.EQUALS)&&_.set_space_before_token(!1),g.type===c.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(g),B=B||g.newlines!==0),this._is_wrap_attributes_force)){var H=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var F=!0,x=0,Y;do{if(Y=j.peek(x),Y.type===c.ATTRIBUTE){F=!1;break}x+=1}while(x<4&&Y.type!==c.EOF&&Y.type!==c.TAG_CLOSE);H=!F}H&&(_.print_newline(!1),B=!0)}_.print_token(g),B=B||_.previous_token_wrapped(),w.has_wrapped_attrs=B}return A},v.prototype._handle_text=function(_,g,w){var j={text:g.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(_,g,w):w.is_unformatted||w.is_content_unformatted?_.add_raw_token(g):(_.traverse_whitespace(g),_.print_token(g)),j},v.prototype._print_custom_beatifier_text=function(_,g,w){var j=this;if(g.text!==""){var B=g.text,A,H=1,F="",x="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:w.custom_beautifier_name==="html"&&(A=function(xe,Ie){var Je=new v(xe,Ie,j._js_beautify,j._css_beautify);return Je.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-_.indent_level);var Y=_.get_full_indent(H);if(B=B.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(<!--|<!\[CDATA\[)/)){var q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(B);if(!q){_.add_raw_token(g);return}F=Y+q[1]+`
`,B=q[4],q[5]&&(x=Y+q[5]),B=B.replace(/\n[ \t]*$/,""),(q[2]||q[3].indexOf(`
`)!==-1)&&(q=q[3].match(/[ \t]+$/),q&&(g.whitespace_before=q[0]))}if(B)if(A){var ie=function(){this.eol=`
`};ie.prototype=this._options.raw_options;var me=new ie;B=A(Y+B,me)}else{var $e=g.whitespace_before;$e&&(B=B.replace(new RegExp(`
(`+$e+")?","g"),`
`)),B=Y+B.replace(/\n/g,`
`+Y)}F&&(B?B=F+B+`
`+x:B=F+x),_.print_newline(!1),B&&(g.text=B,g.whitespace_before="",g.newlines=0,_.add_raw_token(g),_.print_newline(!0))}},v.prototype._handle_tag_open=function(_,g,w,j){var B=this._get_tag_open_token(g);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&g.type===c.TAG_OPEN&&g.text.indexOf("</")===0?(_.add_raw_token(g),B.start_tag_token=this._tag_stack.try_pop(B.tag_name)):(_.traverse_whitespace(g),this._set_tag_position(_,g,B,w,j),B.is_inline_element||_.set_wrap_point(),_.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(B.alignment_size=g.text.length+1),!B.tag_complete&&!B.is_unformatted&&(_.alignment_size=B.alignment_size),B};var E=function(_,g){if(this.parent=_||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!g)this.tag_complete=!0;else{var w;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(w=g.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===c.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||g.closed&&g.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};v.prototype._get_tag_open_token=function(_){var g=new E(this._tag_stack.get_parser_token(),_);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||C(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&C(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&C(g.tag_check,this._options.content_unformatted),g.is_inline_element=C(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},v.prototype._set_tag_position=function(_,g,w,j,B){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=T(w.tag_check,g)))),C(w.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var A=_.current_line_has_match(/{{#if/);A||_.print_newline(!1)}w.tag_name==="!--"&&B.type===c.TAG_CLOSE&&j.is_end_tag&&w.text.indexOf(`
`)===-1||(w.is_inline_element||w.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,w))}else if(w.is_end_tag){var H=!1;H=w.start_tag_token&&w.start_tag_token.multiline_content,H=H||!w.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(B.type===c.TAG_CLOSE&&w.start_tag_token===j)&&B.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(H=!1),H&&_.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(B.type!=="TK_CONTENT"||w.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,w)},v.prototype._calcluate_parent_multiline=function(_,g){g.parent&&_._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],p=["a","audio","del","ins","map","noscript","video"];v.prototype._do_optional_end_element=function(_){var g=null;if(_.is_empty_element||!_.is_start_tag||!_.parent)return;if(_.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(_.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(_.tag_name==="dd"||_.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(_.parent.tag_name==="p"&&h.indexOf(_.tag_name)!==-1){var w=_.parent.parent;(!w||p.indexOf(w.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else _.tag_name==="rp"||_.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):_.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):_.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):_.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):_.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):_.tag_name==="tbody"||_.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):_.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(_.tag_name==="th"||_.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return _.parent=this._tag_stack.get_parser_token(),g},b.exports.Beautifier=v},function(b,f,m){var l=m(6).Options;function o(a){l.call(this,a,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}o.prototype=new l,b.exports.Options=o},function(b,f,m){var l=m(9).Tokenizer,o=m(9).TOKEN,a=m(13).Directives,c=m(14).TemplatablePattern,s=m(12).Pattern,i={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:o.START,RAW:o.RAW,EOF:o.EOF},n=new a(/<\!--/,/-->/),O=function(T,C){l.call(this,T,C),this._current_tag_name="";var R=new c(this._input).read_options(this._options),S=new s(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:S.starting_with(/{{!--/).until_after(/--}}/),handlebars:S.starting_with(/{{/).until_after(/}}/),handlebars_open:S.until(/[\n\r\t }]/),handlebars_raw_close:S.until(/}}/),comment:S.starting_with(/<!--/).until_after(/-->/),cdata:S.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:S.starting_with(/<!\[/).until_after(/]>/),processing:S.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=S.matching(v).until_after(v)}};O.prototype=new l,O.prototype._is_comment=function(T){return!1},O.prototype._is_opening=function(T){return T.type===i.TAG_OPEN},O.prototype._is_closing=function(T,C){return T.type===i.TAG_CLOSE&&C&&((T.text===">"||T.text==="/>")&&C.text[0]==="<"||T.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(T,C){var R=null;this._readWhitespace();var S=this._input.peek();return S===null?this._create_token(i.EOF,""):(R=R||this._read_open_handlebars(S,C),R=R||this._read_attribute(S,T,C),R=R||this._read_close(S,C),R=R||this._read_raw_content(S,T,C),R=R||this._read_content_word(S),R=R||this._read_comment_or_cdata(S),R=R||this._read_processing(S),R=R||this._read_open(S,C),R=R||this._create_token(i.UNKNOWN,this._input.next()),R)},O.prototype._read_comment_or_cdata=function(T){var C=null,R=null,S=null;if(T==="<"){var v=this._input.peek(1);v==="!"&&(R=this.__patterns.comment.read(),R?(S=n.get_directives(R),S&&S.ignore==="start"&&(R+=n.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(C=this._create_token(i.COMMENT,R),C.directives=S)}return C},O.prototype._read_processing=function(T){var C=null,R=null,S=null;if(T==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(C=this._create_token(i.COMMENT,R),C.directives=S)}return C},O.prototype._read_open=function(T,C){var R=null,S=null;return C||T==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),S=this._create_token(i.TAG_OPEN,R)),S},O.prototype._read_open_handlebars=function(T,C){var R=null,S=null;return C||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),S=this._create_token(i.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),S=this._create_token(i.TAG_OPEN,R))),S},O.prototype._read_close=function(T,C){var R=null,S=null;return C&&(C.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(R=this._input.next(),T==="/"&&(R+=this._input.next()),S=this._create_token(i.TAG_CLOSE,R)):C.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),S=this._create_token(i.TAG_CLOSE,"}}"))),S},O.prototype._read_attribute=function(T,C,R){var S=null,v="";if(R&&R.text[0]==="<")if(T==="=")S=this._create_token(i.EQUALS,this._input.next());else if(T==='"'||T==="'"){var E=this._input.next();T==='"'?E+=this.__patterns.double_quote.read():E+=this.__patterns.single_quote.read(),S=this._create_token(i.VALUE,E)}else v=this.__patterns.attribute.read(),v&&(C.type===i.EQUALS?S=this._create_token(i.VALUE,v):S=this._create_token(i.ATTRIBUTE,v));return S},O.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},O.prototype._read_raw_content=function(T,C,R){var S="";if(R&&R.text[0]==="{")S=this.__patterns.handlebars_raw_close.read();else if(C.type===i.TAG_CLOSE&&C.opened.text[0]==="<"&&C.text[0]!=="/"){var v=C.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var E=this._read_comment_or_cdata(T);if(E)return E.type=i.TEXT,E;S=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(S=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return S?this._create_token(i.TEXT,S):null},O.prototype._read_content_word=function(T){var C="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(C=this.__patterns.unformatted_content_delimiter.read())),C||(C=this.__patterns.word.read()),C)return this._create_token(i.TEXT,C)},b.exports.Tokenizer=O,b.exports.TOKEN=i}],k={};function r(b){var f=k[b];if(f!==void 0)return f.exports;var m=k[b]={exports:{}};return K[b](m,m.exports,r),m.exports}var M=r(18);U=M})();var G=U;if(!0)!(Z=[D,D("6UM0"),D("TXwP")],V=function(K){var k=D("6UM0"),r=D("TXwP");return{html_beautify:function(M,b){return G(M,b,k.js_beautify,r.css_beautify)}}}.apply(he,Z),V!==void 0&&(Kt.exports=V));else var P,I})()},"rAM+":function(Kt,he,D){"use strict";D.d(he,"a",function(){return V});var Z=D("Qw5x");function V(U,G){var P;if(typeof Symbol=="undefined"||U[Symbol.iterator]==null){if(Array.isArray(U)||(P=Object(Z.a)(U))||G&&U&&typeof U.length=="number"){P&&(U=P);var I=0,K=function(){};return{s:K,n:function(){return I>=U.length?{done:!0}:{done:!1,value:U[I++]}},e:function(f){throw f},f:K}}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 k=!0,r=!1,M;return{s:function(){P=U[Symbol.iterator]()},n:function(){var f=P.next();return k=f.done,f},e:function(f){r=!0,M=f},f:function(){try{!k&&P.return!=null&&P.return()}finally{if(r)throw M}}}}},rUJ1:function(Kt,he){const D=/[&<>"']/,Z=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=S=>G[S];function I(S,v){if(v){if(D.test(S))return S.replace(Z,P)}else if(V.test(S))return S.replace(U,P);return S}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(S){return S.replace(K,(v,E)=>(E=E.toLowerCase(),E==="colon"?":":E.charAt(0)==="#"?E.charAt(1)==="x"?String.fromCharCode(parseInt(E.substring(2),16)):String.fromCharCode(+E.substring(1)):""))}const r=/(^|[^\[])\^/g;function M(S,v){S=S.source||S,v=v||"";const E={replace:(h,p)=>(p=p.source||p,p=p.replace(r,"$1"),S=S.replace(h,p),E),getRegex:()=>new RegExp(S,v)};return E}const b=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(S,v,E){if(S){let h;try{h=decodeURIComponent(k(E)).replace(b,"").toLowerCase()}catch(p){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}v&&!f.test(E)&&(E=s(v,E));try{E=encodeURI(E).replace(/%25/g,"%")}catch(h){return null}return E}const l={},o=/^[^:]+:\/*[^/]*$/,a=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(S,v){l[" "+S]||(o.test(S)?l[" "+S]=S+"/":l[" "+S]=T(S,"/",!0)),S=l[" "+S];const E=S.indexOf(":")===-1;return v.substring(0,2)==="//"?E?v:S.replace(a,"$1")+v:v.charAt(0)==="/"?E?v:S.replace(c,"$1")+v:S+v}const i={exec:function(){}};function n(S){let v=1,E,h;for(;v<arguments.length;v++){E=arguments[v];for(h in E)Object.prototype.hasOwnProperty.call(E,h)&&(S[h]=E[h])}return S}function O(S,v){const E=S.replace(/\|/g,(_,g,w)=>{let j=!1,B=g;for(;--B>=0&&w[B]==="\\";)j=!j;return j?"|":" |"}),h=E.split(/ \|/);let p=0;if(h.length>v)h.splice(v);else for(;h.length<v;)h.push("");for(;p<h.length;p++)h[p]=h[p].trim().replace(/\\\|/g,"|");return h}function T(S,v,E){const h=S.length;if(h===0)return"";let p=0;for(;p<h;){const _=S.charAt(h-p-1);if(_===v&&!E)p++;else if(_!==v&&E)p++;else break}return S.substr(0,h-p)}function C(S,v){if(S.indexOf(v[1])===-1)return-1;const E=S.length;let h=0,p=0;for(;p<E;p++)if(S[p]==="\\")p++;else if(S[p]===v[0])h++;else if(S[p]===v[1]&&(h--,h<0))return p;return-1}function R(S){S&&S.sanitize&&!S.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Kt.exports={escape:I,unescape:k,edit:M,cleanUrl:m,resolveUrl:s,noopTest:i,merge:n,splitCells:O,rtrim:T,findClosingBracket:C,checkSanitizeDeprecation:R}},sR1s:function(Kt,he,D){"use strict";D.d(he,"b",function(){return G}),D.d(he,"a",function(){return P}),D.d(he,"c",function(){return I}),D.d(he,"d",function(){return K});var Z=D("U8pU"),V="RC_TABLE_KEY";function U(k){return k==null?[]:Array.isArray(k)?k:[k]}function G(k,r){if(!r&&typeof r!="number")return k;for(var M=U(r),b=k,f=0;f<M.length;f+=1){if(!b)return null;var m=M[f];b=b[m]}return b}function P(k){var r=[],M={};return k.forEach(function(b){for(var f=b||{},m=f.key,l=f.dataIndex,o=m||U(l).join("-")||V;M[o];)o="".concat(o,"_next");M[o]=!0,r.push(o)}),r}function I(){var k={};function r(m,l){l&&Object.keys(l).forEach(function(o){var a=l[o];a&&Object(Z.a)(a)==="object"?(m[o]=m[o]||{},r(m[o],a)):m[o]=a})}for(var M=arguments.length,b=new Array(M),f=0;f<M;f++)b[f]=arguments[f];return b.forEach(function(m){r(k,m)}),k}function K(k){return k!=null}},sboe:function(Kt,he,D){"use strict";D.d(he,"a",function(){return U});var Z=D("q1tI"),V=D.n(Z),U=Z.createContext(null)},t23M:function(Kt,he,D){"use strict";var Z=D("VTBJ"),V=D("1OyB"),U=D("vuIU"),G=D("Ji7U"),P=D("LK+K"),I=D("q1tI"),K=D.n(I),k=D("m+aA"),r=D("Zm9Q"),M=D("Kwbf"),b=D("c+Xe"),f=D("bdgK"),m="rc-observer-key",l=function(o){Object(G.a)(c,o);var a=Object(P.a)(c);function c(){var s;return Object(V.a)(this,c),s=a.apply(this,arguments),s.resizeObserver=null,s.childNode=null,s.currentElement=null,s.state={width:0,height:0,offsetHeight:0,offsetWidth:0},s.onResize=function(i){var n=s.props.onResize,O=i[0].target,T=O.getBoundingClientRect(),C=T.width,R=T.height,S=O.offsetWidth,v=O.offsetHeight,E=Math.floor(C),h=Math.floor(R);if(s.state.width!==E||s.state.height!==h||s.state.offsetWidth!==S||s.state.offsetHeight!==v){var p={width:E,height:h,offsetWidth:S,offsetHeight:v};s.setState(p),n&&Promise.resolve().then(function(){n(Object(Z.a)(Object(Z.a)({},p),{},{offsetWidth:S,offsetHeight:v}))})}},s.setChildNode=function(i){s.childNode=i},s}return Object(U.a)(c,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var i=this.props.disabled;if(i){this.destroyObserver();return}var n=Object(k.a)(this.childNode||this),O=n!==this.currentElement;O&&(this.destroyObserver(),this.currentElement=n),!this.resizeObserver&&n&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(n))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var i=this.props.children,n=Object(r.a)(i);if(n.length>1)Object(M.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(n.length===0)return Object(M.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var O=n[0];if(I.isValidElement(O)&&Object(b.c)(O)){var T=O.ref;n[0]=I.cloneElement(O,{ref:Object(b.a)(T,this.setChildNode)})}return n.length===1?n[0]:n.map(function(C,R){return!I.isValidElement(C)||"key"in C&&C.key!==null?C:I.cloneElement(C,{key:"".concat(m,"-").concat(R)})})}}]),c}(I.Component);l.displayName="ResizeObserver",he.a=l},t9D7:function(Kt,he,D){"use strict";D.d(he,"b",function(){return K}),D.d(he,"g",function(){return r}),D.d(he,"d",function(){return M}),D.d(he,"e",function(){return b}),D.d(he,"a",function(){return f}),D.d(he,"f",function(){return o}),D.d(he,"c",function(){return a});var Z=D("Vhoy"),V=D("MI8n"),U=D("pmY6"),G=D("Cg/j"),P=D("ic2d"),I=D("nEHx");const K=Object(G.c)("themeService");var k;(function(c){function s(i){return i&&typeof i=="object"&&typeof i.id=="string"}c.isThemeColor=s})(k||(k={}));function r(c){return{id:c}}var M;(function(c){function s(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||k.isThemeColor(R.color))}c.isThemeIcon=s;const i=new RegExp(`^\\$\\((${Z.a.iconNameExpression}(?:${Z.a.iconModifierExpression})?)\\)$`);function n(R){const S=i.exec(R);if(!S)return;let[,v]=S;return{id:v}}c.fromString=n;function O(R,S){let v=R.id;const E=v.lastIndexOf("~");return E!==-1&&(v=v.substring(0,E)),S&&(v=`${v}~${S}`),{id:v}}c.modify=O;function T(R,S){var v,E;return R.id===S.id&&((v=R.color)===null||v===void 0?void 0:v.id)===((E=S.color)===null||E===void 0?void 0:E.id)}c.isEqual=T;function C(R,S){return{id:R.id,color:S?r(S):void 0}}c.asThemeIcon=C,c.asClassNameArray=Z.a.asClassNameArray,c.asClassName=Z.a.asClassName,c.asCSSSelector=Z.a.asCSSSelector})(M||(M={}));function b(c){switch(c){case I.a.DARK:return"vs-dark";case I.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class m{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new V.b}onColorThemeChange(c){return this.themingParticipants.push(c),this.onThemingParticipantAddedEmitter.fire(c),Object(U.i)(()=>{const s=this.themingParticipants.indexOf(c);this.themingParticipants.splice(s,1)})}getThemingParticipants(){return this.themingParticipants}}let l=new m;P.a.add(f.ThemingContribution,l);function o(c){return l.onColorThemeChange(c)}class a extends U.a{constructor(c){super();this.themeService=c,this.theme=c.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(s=>this.onThemeChange(s)))}onThemeChange(c){this.theme=c,this.updateStyles()}updateStyles(){}}},ulZh:function(Kt,he,D){typeof window!="undefined"&&function(V,U){Kt.exports=U()}(this,function(){return function(Z){var V={};function U(G){if(V[G])return V[G].exports;var P=V[G]={i:G,l:!1,exports:{}};return Z[G].call(P.exports,P,P.exports,U),P.l=!0,P.exports}return U.m=Z,U.c=V,U.d=function(G,P,I){U.o(G,P)||Object.defineProperty(G,P,{enumerable:!0,get:I})},U.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},U.t=function(G,P){if(P&1&&(G=U(G)),P&8)return G;if(P&4&&typeof G=="object"&&G&&G.__esModule)return G;var I=Object.create(null);if(U.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:G}),P&2&&typeof G!="string")for(var K in G)U.d(I,K,function(k){return G[k]}.bind(null,K));return I},U.n=function(G){var P=G&&G.__esModule?function(){return G.default}:function(){return G};return U.d(P,"a",P),P},U.o=function(G,P){return Object.prototype.hasOwnProperty.call(G,P)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,V,U){"use strict";var G=Object.prototype.hasOwnProperty,P="~";function I(){}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(P=!1));function K(b,f,m){this.fn=b,this.context=f,this.once=m||!1}function k(b,f,m,l,o){if(typeof m!="function")throw new TypeError("The listener must be a function");var a=new K(m,l||b,o),c=P?P+f:f;return b._events[c]?b._events[c].fn?b._events[c]=[b._events[c],a]:b._events[c].push(a):(b._events[c]=a,b._eventsCount++),b}function r(b,f){--b._eventsCount===0?b._events=new I:delete b._events[f]}function M(){this._events=new I,this._eventsCount=0}M.prototype.eventNames=function(){var f=[],m,l;if(this._eventsCount===0)return f;for(l in m=this._events)G.call(m,l)&&f.push(P?l.slice(1):l);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(m)):f},M.prototype.listeners=function(f){var m=P?P+f:f,l=this._events[m];if(!l)return[];if(l.fn)return[l.fn];for(var o=0,a=l.length,c=new Array(a);o<a;o++)c[o]=l[o].fn;return c},M.prototype.listenerCount=function(f){var m=P?P+f:f,l=this._events[m];return l?l.fn?1:l.length:0},M.prototype.emit=function(f,m,l,o,a,c){var s=P?P+f:f;if(!this._events[s])return!1;var i=this._events[s],n=arguments.length,O,T;if(i.fn){i.once&&this.removeListener(f,i.fn,void 0,!0);switch(n){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,m),!0;case 3:return i.fn.call(i.context,m,l),!0;case 4:return i.fn.call(i.context,m,l,o),!0;case 5:return i.fn.call(i.context,m,l,o,a),!0;case 6:return i.fn.call(i.context,m,l,o,a,c),!0}for(T=1,O=new Array(n-1);T<n;T++)O[T-1]=arguments[T];i.fn.apply(i.context,O)}else{var C=i.length,R;for(T=0;T<C;T++){i[T].once&&this.removeListener(f,i[T].fn,void 0,!0);switch(n){case 1:i[T].fn.call(i[T].context);break;case 2:i[T].fn.call(i[T].context,m);break;case 3:i[T].fn.call(i[T].context,m,l);break;case 4:i[T].fn.call(i[T].context,m,l,o);break;default:if(!O)for(R=1,O=new Array(n-1);R<n;R++)O[R-1]=arguments[R];i[T].fn.apply(i[T].context,O)}}}return!0},M.prototype.on=function(f,m,l){return k(this,f,m,l,!1)},M.prototype.once=function(f,m,l){return k(this,f,m,l,!0)},M.prototype.removeListener=function(f,m,l,o){var a=P?P+f:f;if(!this._events[a])return this;if(!m)return r(this,a),this;var c=this._events[a];if(c.fn)c.fn===m&&(!o||c.once)&&(!l||c.context===l)&&r(this,a);else{for(var s=0,i=[],n=c.length;s<n;s++)(c[s].fn!==m||o&&!c[s].once||l&&c[s].context!==l)&&i.push(c[s]);i.length?this._events[a]=i.length===1?i[0]:i:r(this,a)}return this},M.prototype.removeAllListeners=function(f){var m;return f?(m=P?P+f:f,this._events[m]&&r(this,m)):(this._events=new I,this._eventsCount=0),this},M.prototype.off=M.prototype.removeListener,M.prototype.addListener=M.prototype.on,M.prefixed=P,M.EventEmitter=M,Z.exports=M},"./node_modules/url-toolkit/src/url-toolkit.js":function(Z,V,U){(function(G){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,I=/^([^\/?#]*)([^]*)$/,K=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(M,b,f){if(f=f||{},M=M.trim(),b=b.trim(),!b){if(!f.alwaysNormalize)return M;var m=r.parseURL(M);if(!m)throw new Error("Error trying to parse base URL.");return m.path=r.normalizePath(m.path),r.buildURLFromParts(m)}var l=r.parseURL(b);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return f.alwaysNormalize?(l.path=r.normalizePath(l.path),r.buildURLFromParts(l)):b;var o=r.parseURL(M);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&o.path[0]!=="/"){var a=I.exec(o.path);o.netLoc=a[1],o.path=a[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(c.netLoc=o.netLoc,l.path[0]!=="/"))if(!l.path)c.path=o.path,l.params||(c.params=o.params,l.query||(c.query=o.query));else{var s=o.path,i=s.substring(0,s.lastIndexOf("/")+1)+l.path;c.path=r.normalizePath(i)}return c.path===null&&(c.path=f.alwaysNormalize?r.normalizePath(l.path):l.path),r.buildURLFromParts(c)},parseURL:function(M){var b=P.exec(M);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(M){for(M=M.split("").reverse().join("").replace(K,"");M.length!==(M=M.replace(k,"")).length;);return M.split("").reverse().join("")},buildURLFromParts:function(M){return M.scheme+M.netLoc+M.path+M.params+M.query+M.fragment}};Z.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(Z,V,U){function G(f){var m={};function l(a){if(m[a])return m[a].exports;var c=m[a]={i:a,l:!1,exports:{}};return f[a].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=f,l.c=m,l.i=function(a){return a},l.d=function(a,c,s){l.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:s})},l.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},l.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return l.d(c,"a",c),c},l.o=function(a,c){return Object.prototype.hasOwnProperty.call(a,c)},l.p="/",l.oe=function(a){throw console.error(a),a};var o=l(l.s=ENTRY_MODULE);return o.default||o}var P="[\\.|\\-|\\+|\\w|/|@]+",I="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function K(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function k(f){return!isNaN(1*f)}function r(f,m,l){var o={};o[l]=[];var a=m.toString(),c=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return o;for(var s=c[1],i=new RegExp("(\\\\n|\\W)"+K(s)+I,"g"),n;n=i.exec(a);){if(n[3]==="dll-reference")continue;o[l].push(n[3])}for(i=new RegExp("\\("+K(s)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+I,"g");n=i.exec(a);)f[n[2]]||(o[l].push(n[1]),f[n[2]]=U(n[1]).m),o[n[2]]=o[n[2]]||[],o[n[2]].push(n[4]);for(var O=Object.keys(o),T=0;T<O.length;T++)for(var C=0;C<o[O[T]].length;C++)k(o[O[T]][C])&&(o[O[T]][C]=1*o[O[T]][C]);return o}function M(f){var m=Object.keys(f);return m.reduce(function(l,o){return l||f[o].length>0},!1)}function b(f,m){for(var l={main:[m]},o={main:[]},a={main:{}};M(l);)for(var c=Object.keys(l),s=0;s<c.length;s++){var i=c[s],n=l[i],O=n.pop();if(a[i]=a[i]||{},a[i][O]||!f[i][O])continue;a[i][O]=!0,o[i]=o[i]||[],o[i].push(O);for(var T=r(f,f[i][O],i),C=Object.keys(T),R=0;R<C.length;R++)l[C[R]]=l[C[R]]||[],l[C[R]]=l[C[R]].concat(T[C[R]])}return o}Z.exports=function(f,m){m=m||{};var l={main:U.m},o=m.all?{main:Object.keys(l.main)}:b(l,f),a="";Object.keys(o).filter(function(O){return O!=="main"}).forEach(function(O){for(var T=0;o[O][T];)T++;o[O].push(T),l[O][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+O+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+o[O].map(function(C){return""+JSON.stringify(C)+": "+l[O][C].toString()}).join(",")+`});
`}),a=a+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+o.main.map(function(O){return""+JSON.stringify(O)+": "+l.main[O].toString()}).join(",")+"}))(self);";var c=new window.Blob([a],{type:"text/javascript"});if(m.bare)return c;var s=window.URL||window.webkitURL||window.mozURL||window.msURL,i=s.createObjectURL(c),n=new window.Worker(i);return n.objectURL=i,n}},"./src/config.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"hlsDefaultConfig",function(){return R}),U.d(V,"mergeConfig",function(){return v}),U.d(V,"enableStreamingMode",function(){return E});var G=U("./src/controller/abr-controller.ts"),P=U("./src/controller/audio-stream-controller.ts"),I=U("./src/controller/audio-track-controller.ts"),K=U("./src/controller/subtitle-stream-controller.ts"),k=U("./src/controller/subtitle-track-controller.ts"),r=U("./src/controller/buffer-controller.ts"),M=U("./src/controller/timeline-controller.ts"),b=U("./src/controller/cap-level-controller.ts"),f=U("./src/controller/fps-controller.ts"),m=U("./src/controller/eme-controller.ts"),l=U("./src/controller/cmcd-controller.ts"),o=U("./src/utils/xhr-loader.ts"),a=U("./src/utils/fetch-loader.ts"),c=U("./src/utils/cues.ts"),s=U("./src/utils/mediakeys-helper.ts"),i=U("./src/utils/logger.ts");function n(){return n=Object.assign||function(h){for(var p=1;p<arguments.length;p++){var _=arguments[p];for(var g in _)Object.prototype.hasOwnProperty.call(_,g)&&(h[g]=_[g])}return h},n.apply(this,arguments)}function O(h,p){var _=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);p&&(g=g.filter(function(w){return Object.getOwnPropertyDescriptor(h,w).enumerable})),_.push.apply(_,g)}return _}function T(h){for(var p=1;p<arguments.length;p++){var _=arguments[p]!=null?arguments[p]:{};p%2?O(Object(_),!0).forEach(function(g){C(h,g,_[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(_)):O(Object(_)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(_,g))})}return h}function C(h,p,_){return p in h?Object.defineProperty(h,p,{value:_,enumerable:!0,configurable:!0,writable:!0}):h[p]=_,h}var R=T(T({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:o.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:r.default,capLevelController:b.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:s.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},S()),{},{subtitleStreamController:K.SubtitleStreamController,subtitleTrackController:k.default,timelineController:M.TimelineController,audioStreamController:P.default,audioTrackController:I.default,emeController:m.default,cmcdController:l.default});function S(){return{cueHandler:c.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function v(h,p){if((p.liveSyncDurationCount||p.liveMaxLatencyDurationCount)&&(p.liveSyncDuration||p.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(p.liveMaxLatencyDurationCount!==void 0&&(p.liveSyncDurationCount===void 0||p.liveMaxLatencyDurationCount<=p.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(p.liveMaxLatencyDuration!==void 0&&(p.liveSyncDuration===void 0||p.liveMaxLatencyDuration<=p.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},h,p)}function E(h){var p=h.loader;if(p!==a.default&&p!==o.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var _=Object(a.fetchSupported)();_&&(h.loader=a.default,h.progressive=!0,h.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/utils/ewma-bandwidth-estimator.ts"),I=U("./src/events.ts"),K=U("./src/utils/buffer-helper.ts"),k=U("./src/errors.ts"),r=U("./src/types/loader.ts"),M=U("./src/utils/logger.ts");function b(l,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}function f(l,o,a){return o&&b(l.prototype,o),a&&b(l,a),l}var m=function(){function l(a){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=a;var c=a.config;this.bwEstimator=new P.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var o=l.prototype;return o.registerListeners=function(){var c=this.hls;c.on(I.Events.FRAG_LOADING,this.onFragLoading,this),c.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(I.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var c=this.hls;c.off(I.Events.FRAG_LOADING,this.onFragLoading,this),c.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(I.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},o.onFragLoading=function(c,s){var i=s.frag;if(i.type===r.PlaylistLevelType.MAIN&&!this.timer){var n;this.fragCurrent=i,this.partCurrent=(n=s.part)!=null?n:null,this.timer=self.setInterval(this.onCheck,100)}},o.onLevelLoaded=function(c,s){var i=this.hls.config;s.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},o._abandonRulesCheck=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,O=i.config,T=i.media;if(!c||!T)return;var C=s?s.stats:c.stats,R=s?s.duration:c.duration;if(C.aborted){M.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!n||T.paused||!T.playbackRate||!T.readyState)return;var S=performance.now()-C.loading.start,v=Math.abs(T.playbackRate);if(S<=500*R/v)return;var E=i.levels,h=i.minAutoLevel,p=E[c.level],_=C.total||Math.max(C.loaded,Math.round(R*p.maxBitrate/8)),g=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/S),w=(_-C.loaded)/g,j=T.currentTime,B=(K.BufferHelper.bufferInfo(T,j,O.maxBufferHole).end-j)/v;if(B>=2*R/v||w<=B)return;var A=Number.POSITIVE_INFINITY,H;for(H=c.level-1;H>h;H--){var F=E[H].maxBitrate;if(A=R*F/(8*.8*g),A<B)break}if(A>=w)return;var x=this.bwEstimator.getEstimate();M.logger.warn("Fragment "+c.sn+(s?" part "+s.index:"")+" of level "+c.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object(G.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+w.toFixed(3)+` s
Estimated load time for the next fragment: `+A.toFixed(3)+` s
Time to underbuffer: `+B.toFixed(3)+" s"),i.nextLoadLevel=H,this.bwEstimator.sample(S,C.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),i.trigger(I.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:s,stats:C})},o.onFragLoaded=function(c,s){var i=s.frag,n=s.part;if(i.type===r.PlaylistLevelType.MAIN&&Object(G.isFiniteNumber)(i.sn)){var O=n?n.stats:i.stats,T=n?n.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var C=this.hls.levels[i.level],R=(C.loaded?C.loaded.bytes:0)+O.loaded,S=(C.loaded?C.loaded.duration:0)+T;C.loaded={bytes:R,duration:S},C.realBitrate=Math.round(8*R/S)}if(i.bitrateTest){var v={stats:O,frag:i,part:n,id:i.type};this.onFragBuffered(I.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},o.onFragBuffered=function(c,s){var i=s.frag,n=s.part,O=n?n.stats:i.stats;if(O.aborted)return;if(i.type!==r.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var T=O.parsing.end-O.loading.start;this.bwEstimator.sample(T,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},o.onError=function(c,s){switch(s.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.maxAutoLevel,O=i.config,T=i.minAutoLevel,C=i.media,R=s?s.duration:c?c.duration:0,S=C?C.currentTime:0,v=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,E=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,h=(K.BufferHelper.bufferInfo(C,S,O.maxBufferHole).end-S)/v,p=this.findBestLevel(E,T,n,h,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(p>=0)return p;M.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=R?Math.min(R,O.maxStarvationDelay):O.maxStarvationDelay,g=O.abrBandWidthFactor,w=O.abrBandWidthUpFactor;if(!h){var j=this.bitrateTestDelay;if(j){var B=R?Math.min(R,O.maxLoadingDelay):O.maxLoadingDelay;_=B-j,M.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),g=w=1}}return p=this.findBestLevel(E,T,n,h+_,g,w),Math.max(p,0)},o.findBestLevel=function(c,s,i,n,O,T){for(var C,R=this.fragCurrent,S=this.partCurrent,v=this.lastLoadedFragLevel,E=this.hls.levels,h=E[v],p=!!(h!=null&&(C=h.details)!==null&&C!==void 0&&C.live),_=h==null?void 0:h.codecSet,g=S?S.duration:R?R.duration:0,w=i;w>=s;w--){var j=E[w];if(!j||_&&j.codecSet!==_)continue;var B=j.details,A=(S?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||g,H=void 0;w<=v?H=O*c:H=T*c;var F=E[w].maxBitrate,x=F*A/H;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(H)+"/"+F+"/"+A+"/"+n+"/"+x),H>F&&(!x||p&&!this.bitrateTestDelay||x<n))return w}return-1},f(l,[{key:"nextAutoLevel",get:function(){var c=this._nextAutoLevel,s=this.bwEstimator;if(c!==-1&&(!s||!s.canEstimate()))return c;var i=this.getNextABRAutoLevel();return c!==-1&&(i=Math.min(c,i)),i},set:function(c){this._nextAutoLevel=c}}]),l}();V.default=m},"./src/controller/audio-stream-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/controller/base-stream-controller.ts"),I=U("./src/events.ts"),K=U("./src/utils/buffer-helper.ts"),k=U("./src/controller/fragment-tracker.ts"),r=U("./src/types/level.ts"),M=U("./src/types/loader.ts"),b=U("./src/loader/fragment.ts"),f=U("./src/demux/chunk-cache.ts"),m=U("./src/demux/transmuxer-interface.ts"),l=U("./src/types/transmuxer.ts"),o=U("./src/controller/fragment-finders.ts"),a=U("./src/utils/discontinuities.ts"),c=U("./src/errors.ts"),s=U("./src/utils/logger.ts");function i(){return i=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var v=arguments[S];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E])}return R},i.apply(this,arguments)}function n(R,S){R.prototype=Object.create(S.prototype),R.prototype.constructor=R,O(R,S)}function O(R,S){return O=Object.setPrototypeOf||function(E,h){return E.__proto__=h,E},O(R,S)}var T=100,C=function(R){n(S,R);function S(E,h){var p;return p=R.call(this,E,h,"[audio-stream-controller]")||this,p.videoBuffer=null,p.videoTrackCC=-1,p.waitingVideoCC=-1,p.audioSwitch=!1,p.trackId=-1,p.waitingData=null,p.mainDetails=null,p.bufferFlushed=!1,p._registerListeners(),p}var v=S.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var h=this.hls;h.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(I.Events.ERROR,this.onError,this),h.on(I.Events.BUFFER_RESET,this.onBufferReset,this),h.on(I.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var h=this.hls;h.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(I.Events.ERROR,this.onError,this),h.off(I.Events.BUFFER_RESET,this.onBufferReset,this),h.off(I.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(h,p){var _=p.frag,g=p.id,w=p.initPTS;if(g==="main"){var j=_.cc;this.initPTS[_.cc]=w,this.log("InitPTS for cc: "+j+" found from main: "+w),this.videoTrackCC=j,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=P.State.STOPPED;return}var p=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,p>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+p.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},v.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var h,p=this.levels,_=this.trackId,g=p==null||((h=p[_])===null||h===void 0)?void 0:h.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var w,j=performance.now(),B=this.retryDate;(!B||j>=B||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var A=this.waitingData;if(A){var H=A.frag,F=A.part,x=A.cache,Y=A.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var q=x.flush(),ie={frag:H,part:F,payload:q,networkDetails:null};this._handleFragmentLoadProgress(ie),Y&&R.prototype._handleFragmentLoadComplete.call(this,ie)}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 me=this.getLoadPosition(),$e=K.BufferHelper.bufferInfo(this.mediaBuffer,me,this.config.maxBufferHole),xe=Object(o.fragmentWithinToleranceTest)($e.end,this.config.maxFragLookUpTolerance,H);xe<0&&(s.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+$e.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},v.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var p=this.mediaBuffer?this.mediaBuffer:h,_=p.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},v.doTickIdle=function(){var h,p,_=this.hls,g=this.levels,w=this.media,j=this.trackId,B=_.config;if(!g||!g[j])return;if(!w&&(this.startFragRequested||!B.startFragPrefetch))return;var A=g[j],H=A.details;if(!H||H.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(H)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(F===null)return;var x=F.len,Y=this.getMaxBufferLength(),q=this.audioSwitch;if(x>=Y&&!q)return;if(!q&&this._streamEnded(F,H)){_.trigger(I.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var ie=H.fragments,me=ie[0].start,$e=F.end;if(q){var xe=this.getLoadPosition();$e=xe,H.PTSKnown&&xe<me&&((F.end>me||F.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=me+.05))}var Ie=this.getNextFragment($e,H);if(!Ie){this.bufferFlushed=!0;return}((h=Ie.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((p=Ie.decryptdata)!==null&&p!==void 0&&p.key)?this.loadKey(Ie,H):this.loadFragment(Ie,H,$e)},v.getMaxBufferLength=function(){var h=R.prototype.getMaxBufferLength.call(this),p=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return p===null?h:Math.max(h,p.len)},v.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(h,p){var _=p.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(g){return new r.Level(g)})},v.onAudioTrackSwitching=function(h,p){var _=!!p.url;this.trackId=p.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(T):this.resetTransmuxer(),_?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},v.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},v.onLevelLoaded=function(h,p){this.mainDetails=p.details},v.onAudioTrackLoaded=function(h,p){var _,g=this.levels,w=p.details,j=p.id;if(!g){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var B=g[j],A=0;if(w.live||(_=B.details)!==null&&_!==void 0&&_.live){var H=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!H)return;!B.details&&w.hasProgramDateTime&&H.hasProgramDateTime?(Object(a.alignMediaPlaylistByPDT)(w,H),A=w.fragments[0].start):A=this.alignPlaylists(w,B.details)}B.details=w,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(B.details,A),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=P.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(h){var p,_=h.frag,g=h.part,w=h.payload,j=this.config,B=this.trackId,A=this.levels;if(!A){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+_.sn+" of level "+_.level+" will not be buffered");return}var H=A[B];console.assert(H,"Audio track is defined on fragment load progress");var F=H.details;console.assert(F,"Audio track details are defined on fragment load progress");var x=j.defaultAudioCodec||H.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new m.default(this.hls,M.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var q=this.initPTS[_.cc],ie=(p=_.initSegment)===null||p===void 0?void 0:p.data;if(q!==void 0){var me=!1,$e=g?g.index:-1,xe=$e!==-1,Ie=new l.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,w.byteLength,$e,xe);Y.push(w,ie,x,"",_,g,F.totalduration,me,Ie,q)}else{s.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+B);var Je=this.waitingData=this.waitingData||{frag:_,part:g,cache:new f.default,complete:!1},Ye=Je.cache;Ye.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,h)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(h,p){var _=p.tracks.audio;_&&(this.mediaBuffer=_.buffer),p.tracks.video&&(this.videoBuffer=p.tracks.video.buffer)},v.onFragBuffered=function(h,p){var _=p.frag,g=p.part;if(_.type!==M.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(_)){this.warn("Fragment "+_.sn+(g?" p: "+g.index:"")+" of level "+_.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}_.sn!=="initSegment"&&(this.fragPrevious=_,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,g)},v.onError=function(h,p){switch(p.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.AUDIO,p);break;case c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=p.fatal?P.State.ERROR:P.State.IDLE,this.warn(p.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(p.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var _=!0,g=this.getFwdBufferInfo(this.mediaBuffer,M.PlaylistLevelType.AUDIO);g&&g.len>.5&&(_=!this.reduceMaxBufferLength(g.len)),_&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},v.onBufferFlushed=function(h,p){var _=p.type;_===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(h){var p,_="audio",g=this.hls,w=h.remuxResult,j=h.chunkMeta,B=this.getCurrentContext(j);if(!B){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var A=B.frag,H=B.part,F=w.audio,x=w.text,Y=w.id3,q=w.initSegment;if(this.fragContextChanged(A))return;if(this.state=P.State.PARSING,this.audioSwitch&&F&&this.completeAudioSwitch(),q!=null&&q.tracks&&(this._bufferInitSegment(q.tracks,A,j),g.trigger(I.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:_,tracks:q.tracks})),F){var ie=F.startPTS,me=F.endPTS,$e=F.startDTS,xe=F.endDTS;H&&(H.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:me,startDTS:$e,endDTS:xe}),A.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ie,me,$e,xe),this.bufferFragmentData(F,A,H,j)}if(Y!=null&&(p=Y.samples)!==null&&p!==void 0&&p.length){var Ie=i({frag:A,id:_},Y);g.trigger(I.Events.FRAG_PARSING_METADATA,Ie)}if(x){var Je=i({frag:A,id:_},x);g.trigger(I.Events.FRAG_PARSING_USERDATA,Je)}},v._bufferInitSegment=function(h,p,_){if(this.state!==P.State.PARSING)return;h.video&&delete h.video;var g=h.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(I.Events.BUFFER_CODECS,h);var w=g.initSegment;if(w!=null&&w.byteLength){var j={type:"audio",frag:p,part:null,chunkMeta:_,parent:p.type,data:w};this.hls.trigger(I.Events.BUFFER_APPENDING,j)}this.tick()},v.loadFragment=function(h,p,_){var g=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||g===k.FragmentState.NOT_LOADED||g===k.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):p.live&&!Object(G.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,h,p,_)))},v.completeAudioSwitch=function(){var h=this.hls,p=this.media,_=this.trackId;p&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:_})},S}(P.default);V.default=C},"./src/controller/audio-track-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/errors.ts"),I=U("./src/controller/base-playlist-controller.ts"),K=U("./src/types/loader.ts");function k(m,l){for(var o=0;o<l.length;o++){var a=l[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(m,a.key,a)}}function r(m,l,o){return l&&k(m.prototype,l),o&&k(m,o),m}function M(m,l){m.prototype=Object.create(l.prototype),m.prototype.constructor=m,b(m,l)}function b(m,l){return b=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},b(m,l)}var f=function(m){M(l,m);function l(a){var c;return c=m.call(this,a,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var o=l.prototype;return o.registerListeners=function(){var c=this.hls;c.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(G.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var c=this.hls;c.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(G.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(G.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(c,s){this.tracks=s.audioTracks||[]},o.onAudioTrackLoaded=function(c,s){var i=s.id,n=s.details,O=this.tracksInGroup[i];if(!O){this.warn("Invalid audio track id "+i);return}var T=O.details;O.details=s.details,this.log("audioTrack "+i+" loaded ["+n.startSN+"-"+n.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,T))},o.onLevelLoading=function(c,s){this.switchLevel(s.level)},o.onLevelSwitching=function(c,s){this.switchLevel(s.level)},o.switchLevel=function(c){var s=this.hls.levels[c];if(!(s!=null&&s.audioGroupIds))return;var i=s.audioGroupIds[s.urlId];if(this.groupId!==i){this.groupId=i;var n=this.tracks.filter(function(T){return!i||T.groupId===i});this.selectDefaultTrack&&!n.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var O={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(G.Events.AUDIO_TRACKS_UPDATED,O),this.selectInitialTrack()}},o.onError=function(c,s){if(m.prototype.onError.call(this,c,s),s.fatal||!s.context)return;s.context.type===K.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},o.setAudioTrack=function(c){var s=this.tracksInGroup;if(c<0||c>=s.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=s[this.trackId];this.log("Now switching to audio-track index "+c);var n=s[c],O=n.id,T=n.groupId,C=T===void 0?"":T,R=n.name,S=n.type,v=n.url;if(this.trackId=c,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(G.Events.AUDIO_TRACK_SWITCHING,{id:O,groupId:C,name:R,type:S,url:v}),n.details&&!n.details.live)return;var E=this.switchParams(n.url,i==null?void 0:i.details);this.loadPlaylist(E)},o.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var s=this.trackName,i=this.findTrackId(s)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(c){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var n=s[i];if((!this.selectDefaultTrack||n.default)&&(!c||c===n.name))return n.id}return-1},o.loadPlaylist=function(c){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,n=s.groupId,O=s.url;if(c)try{O=c.addDirectives(O)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(G.Events.AUDIO_TRACK_LOADING,{url:O,id:i,groupId:n,deliveryDirectives:c||null})}},r(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),l}(I.default);V.default=f},"./src/controller/base-playlist-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return r});var G=U("./src/polyfills/number.ts"),P=U("./src/types/level.ts"),I=U("./src/controller/level-helper.ts"),K=U("./src/utils/logger.ts"),k=U("./src/errors.ts"),r=function(){function M(f,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=K.logger.log.bind(K.logger,m+":"),this.warn=K.logger.warn.bind(K.logger,m+":"),this.hls=f}var b=M.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(m,l){l.fatal&&l.type===k.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(m,l){var o=l==null?void 0:l.renditionReports;if(o)for(var a=0;a<o.length;a++){var c=o[a],s=""+c.URI;if(s===m.substr(-s.length)){var i=parseInt(c["LAST-MSN"]),n=parseInt(c["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var O=Math.min(l.age-l.partTarget,l.targetduration);n!==void 0&&O>l.partTarget&&(n+=1)}if(Object(G.isFiniteNumber)(i))return new P.HlsUrlParameters(i,Object(G.isFiniteNumber)(n)?n:void 0,P.HlsSkip.No)}}},b.loadPlaylist=function(m){},b.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},b.playlistLoaded=function(m,l,o){var a=this,c=l.details,s=l.stats,i=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(c.advancedDateTime=Date.now()-i,c.live||o!=null&&o.live){if(c.reloaded(o),o&&this.log("live playlist "+m+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),o&&c.fragments.length>0&&Object(I.mergeDetails)(o,c),!this.canLoad||!c.live)return;var n,O=void 0,T=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var C=this.hls.config.lowLatencyMode,R=c.lastPartSn,S=c.endSN,v=c.lastPartIndex,E=v!==-1,h=R===S,p=C?0:v;E?(O=h?S+1:R,T=h?p:v+1):O=S+1;var _=c.age,g=_+c.ageHeader,w=Math.min(g-c.partTarget,c.targetduration*1.5);if(w>0){if(o&&w>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+w+" with playlist age: "+c.age),w=0;else{var j=Math.floor(w/c.targetduration);if(O+=j,T!==void 0){var B=Math.round(w%c.targetduration/c.partTarget);T+=B}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+w+" skip sn "+j+" to part "+T)}c.tuneInGoal=w}if(n=this.getDeliveryDirectives(c,l.deliveryDirectives,O,T),C||!h){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(c,l.deliveryDirectives,O,T);var A=Object(I.computeReloadInterval)(c,s);O!==void 0&&c.canBlockReload&&(A-=c.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(A)+" ms"),this.timer=self.setTimeout(function(){return a.loadPlaylist(n)},A)}else this.clearTimer()},b.getDeliveryDirectives=function(m,l,o,a){var c=Object(P.getSkipValue)(m,o);return l!=null&&l.skip&&m.deltaUpdateFailed&&(o=l.msn,a=l.part,c=P.HlsSkip.No),new P.HlsUrlParameters(o,a,c)},b.retryLoadingOrFail=function(m){var l=this,o=this.hls.config,a=this.retryCount<o.levelLoadingMaxRetry;if(a){var c;if(this.retryCount++,m.details.indexOf("LoadTimeOut")>-1&&(c=m.context)!==null&&c!==void 0&&c.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return a},M}()},"./src/controller/base-stream-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"State",function(){return S}),U.d(V,"default",function(){return v});var G=U("./src/polyfills/number.ts"),P=U("./src/task-loop.ts"),I=U("./src/controller/fragment-tracker.ts"),K=U("./src/utils/buffer-helper.ts"),k=U("./src/utils/logger.ts"),r=U("./src/events.ts"),M=U("./src/errors.ts"),b=U("./src/types/transmuxer.ts"),f=U("./src/utils/mp4-tools.ts"),m=U("./src/utils/discontinuities.ts"),l=U("./src/controller/fragment-finders.ts"),o=U("./src/controller/level-helper.ts"),a=U("./src/loader/fragment-loader.ts"),c=U("./src/crypt/decrypter.ts"),s=U("./src/utils/time-ranges.ts"),i=U("./src/types/loader.ts");function n(E,h){for(var p=0;p<h.length;p++){var _=h[p];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(E,_.key,_)}}function O(E,h,p){return h&&n(E.prototype,h),p&&n(E,p),E}function T(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}function C(E,h){E.prototype=Object.create(h.prototype),E.prototype.constructor=E,R(E,h)}function R(E,h){return R=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},R(E,h)}var S={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},v=function(E){C(h,E);function h(_,g,w){var j;return j=E.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=S.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=w,j.log=k.logger.log.bind(k.logger,w+":"),j.warn=k.logger.warn.bind(k.logger,w+":"),j.hls=_,j.fragmentLoader=new a.default(_.config),j.fragmentTracker=g,j.config=_.config,j.decrypter=new c.default(_,_.config),_.on(r.Events.KEY_LOADED,j.onKeyLoaded,T(j)),j}var p=h.prototype;return p.doTick=function(){this.onTickEnd()},p.onTickEnd=function(){},p.startLoad=function(g){},p.stopLoad=function(){this.fragmentLoader.abort();var g=this.fragCurrent;g&&this.fragmentTracker.removeFragment(g),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},p._streamEnded=function(g,w){var j=this.fragCurrent,B=this.fragmentTracker;if(!w.live&&j&&j.sn===w.endSN&&!g.nextStart){var A=B.getState(j);return A===I.FragmentState.PARTIAL||A===I.FragmentState.OK}return!1},p.onMediaAttached=function(g,w){var j=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var B=this.config;this.levels&&B.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(B.startPosition)},p.onMediaDetaching=function(){var g=this.media;g!=null&&g.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),g&&(g.removeEventListener("seeking",this.onvseeking),g.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},p.onMediaSeeking=function(){var g=this.config,w=this.fragCurrent,j=this.media,B=this.mediaBuffer,A=this.state,H=j?j.currentTime:0,F=K.BufferHelper.bufferInfo(B||j,H,g.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+A),A===S.ENDED)this.resetLoadingState();else if(w&&!F.len){var x=g.maxFragLookUpTolerance,Y=w.start-x,q=w.start+w.duration+x,ie=H>q;(H<Y||ie)&&(ie&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=H),!this.loadedmetadata&&!F.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},p.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},p.onKeyLoaded=function(g,w){if(this.state!==S.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=S.IDLE;var j=this.levels[w.frag.level].details;j&&this.loadFragment(w.frag,j,w.frag.start)},p.onHandlerDestroying=function(){this.stopLoad(),E.prototype.onHandlerDestroying.call(this)},p.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,E.prototype.onHandlerDestroyed.call(this)},p.loadKey=function(g,w){this.log("Loading key for "+g.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=S.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})},p.loadFragment=function(g,w,j){this._loadFragForPlayback(g,w,j)},p._loadFragForPlayback=function(g,w,j){var B=this,A=function(F){if(B.fragContextChanged(g)){B.warn("Fragment "+g.sn+(F.part?" p: "+F.part.index:"")+" of level "+g.level+" was dropped during download."),B.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,B._handleFragmentLoadProgress(F)};this._doFragLoad(g,w,j,A).then(function(H){if(!H)return;B.fragLoadError=0;var F=B.state;if(B.fragContextChanged(g)){(F===S.FRAG_LOADING||F===S.BACKTRACKING||!B.fragCurrent&&F===S.PARSING)&&(B.fragmentTracker.removeFragment(g),B.state=S.IDLE);return}if("payload"in H&&(B.log("Loaded fragment "+g.sn+" of level "+g.level),B.hls.trigger(r.Events.FRAG_LOADED,H),B.state===S.BACKTRACKING)){B.fragmentTracker.backtrack(g,H),B.resetFragmentLoading(g);return}B._handleFragmentLoadComplete(H)}).catch(function(H){B.warn(H),B.resetFragmentLoading(g)})},p.flushMainBuffer=function(g,w,j){if(j===void 0&&(j=null),!(g-w))return;var B={startOffset:g,endOffset:w,type:j};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,B)},p._loadInitSegment=function(g){var w=this;this._doFragLoad(g).then(function(j){if(!j||w.fragContextChanged(g)||!w.levels)throw new Error("init load aborted");return j}).then(function(j){var B=w.hls,A=j.payload,H=g.decryptdata;if(A&&A.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var F=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(A),H.key.buffer,H.iv.buffer).then(function(x){var Y=self.performance.now();return B.trigger(r.Events.FRAG_DECRYPTED,{frag:g,payload:x,stats:{tstart:F,tdecrypt:Y}}),j.payload=x,j})}return j}).then(function(j){var B=w.fragCurrent,A=w.hls,H=w.levels;if(!H)throw new Error("init load aborted, missing levels");var F=H[g.level].details;console.assert(F,"Level details are defined when init segment is loaded");var x=g.stats;w.state=S.IDLE,w.fragLoadError=0,g.data=new Uint8Array(j.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),j.frag===B&&A.trigger(r.Events.FRAG_BUFFERED,{stats:x,frag:B,part:null,id:g.type}),w.tick()}).catch(function(j){w.warn(j),w.resetFragmentLoading(g)})},p.fragContextChanged=function(g){var w=this.fragCurrent;return!g||!w||g.level!==w.level||g.sn!==w.sn||g.urlId!==w.urlId},p.fragBufferedComplete=function(g,w){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+s.default.toString(K.BufferHelper.getBuffered(j))),this.state=S.IDLE,this.tick()},p._handleFragmentLoadComplete=function(g){var w=this.transmuxer;if(!w)return;var j=g.frag,B=g.part,A=g.partsLoaded,H=!A||A.length===0||A.some(function(x){return!x}),F=new b.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,B?B.index:-1,!H);w.flush(F)},p._handleFragmentLoadProgress=function(g){},p._doFragLoad=function(g,w,j,B){var A=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(g.start,j||0),this.config.lowLatencyMode&&w){var H=w.partList;if(H&&B){j>g.end&&w.fragmentHint&&(g=w.fragmentHint);var F=this.getNextPart(H,g,j);if(F>-1){var x=H[F];return this.log("Loading part sn: "+g.sn+" p: "+x.index+" cc: "+g.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+F+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,part:H[F],targetBufferTime:j}),this.doFragPartsLoad(g,H,F,B).catch(function(Y){return A.handleFragLoadError(Y)})}else if(!g.url||this.loadedEndOfParts(H,j))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(j.toFixed(3))),Object(G.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=S.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,targetBufferTime:j}),this.fragmentLoader.load(g,B).catch(function(Y){return A.handleFragLoadError(Y)})},p.doFragPartsLoad=function(g,w,j,B){var A=this;return new Promise(function(H,F){var x=[],Y=function q(ie){var me=w[ie];A.fragmentLoader.loadPart(g,me,B).then(function($e){x[me.index]=$e;var xe=$e.part;A.hls.trigger(r.Events.FRAG_LOADED,$e);var Ie=w[ie+1];if(Ie&&Ie.fragment===g)q(ie+1);else return H({frag:g,part:xe,partsLoaded:x})}).catch(F)};Y(j)})},p.handleFragLoadError=function(g){var w=g.data;return w&&w.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(r.Events.ERROR,w),null},p._handleTransmuxerFlush=function(g){var w=this.getCurrentContext(g);if(!w||this.state!==S.PARSING){this.fragCurrent||(this.state=S.IDLE);return}var j=w.frag,B=w.part,A=w.level,H=self.performance.now();j.stats.parsing.end=H,B&&(B.stats.parsing.end=H),this.updateLevelTiming(j,B,A,g.partial)},p.getCurrentContext=function(g){var w=this.levels,j=g.level,B=g.sn,A=g.part;if(!w||!w[j])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+j+". The current chunk will not be buffered."),null;var H=w[j],F=A>-1?Object(o.getPartWith)(H,B,A):null,x=F?F.fragment:Object(o.getFragmentWithSN)(H,B,this.fragCurrent);return x?{frag:x,part:F,level:H}:null},p.bufferFragmentData=function(g,w,j,B){if(!g||this.state!==S.PARSING)return;var A=g.data1,H=g.data2,F=A;if(A&&H&&(F=Object(f.appendUint8Array)(A,H)),!F||!F.length)return;var x={type:g.type,frag:w,part:j,chunkMeta:B,parent:w.type,data:F};this.hls.trigger(r.Events.BUFFER_APPENDING,x),g.dropped&&g.independent&&!j&&this.flushBufferGap(w)},p.flushBufferGap=function(g){var w=this.media;if(!w)return;if(!K.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,g.start);return}var j=w.currentTime,B=K.BufferHelper.bufferInfo(w,j,0),A=g.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),F=Math.max(Math.min(g.start-H,B.end-H),j+H);g.start-F>H&&this.flushMainBuffer(F,g.start)},p.getFwdBufferInfo=function(g,w){var j=this.config,B=this.getLoadPosition();if(!Object(G.isFiniteNumber)(B))return null;var A=K.BufferHelper.bufferInfo(g,B,j.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(B,w);if(H&&A.nextStart<H.end)return K.BufferHelper.bufferInfo(g,B,Math.max(A.nextStart,j.maxBufferHole))}return A},p.getMaxBufferLength=function(g){var w=this.config,j;return g?j=Math.max(8*w.maxBufferSize/g,w.maxBufferLength):j=w.maxBufferLength,Math.min(j,w.maxMaxBufferLength)},p.reduceMaxBufferLength=function(g){var w=this.config,j=g||w.maxBufferLength;return w.maxMaxBufferLength>=j?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},p.getNextFragment=function(g,w){var j,B,A=w.fragments,H=A.length;if(!H)return null;var F=this.config,x=A[0].start,Y;if(w.live){var q=F.initialLiveManifestSize;if(H<q)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+q+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(w,A),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:g)}else g<=x&&(Y=A[0]);if(!Y){var ie=F.lowLatencyMode?w.partEnd:w.fragmentEnd;Y=this.getFragmentAtPosition(g,ie,w)}return(j=Y)!==null&&j!==void 0&&j.initSegment&&!((B=Y)!==null&&B!==void 0&&B.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},p.getNextPart=function(g,w,j){for(var B=-1,A=!1,H=!0,F=0,x=g.length;F<x;F++){var Y=g[F];if(H=H&&!Y.independent,B>-1&&j<Y.start)break;var q=Y.loaded;!q&&(A||Y.independent||H)&&Y.fragment===w&&(B=F),A=q}return B},p.loadedEndOfParts=function(g,w){var j=g[g.length-1];return j&&w>j.start&&j.loaded},p.getInitialLiveFragment=function(g,w){var j=this.fragPrevious,B=null;if(j){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),B=Object(l.findFragmentByPDT)(w,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var A=j.sn+1;if(A>=g.startSN&&A<=g.endSN){var H=w[A-g.startSN];j.cc===H.cc&&(B=H,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(l.findFragWithCC)(w,j.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var F=this.hls.liveSyncPosition;F!==null&&(B=this.getFragmentAtPosition(F,this.bitrateTest?g.fragmentEnd:g.edge,g))}return B},p.getFragmentAtPosition=function(g,w,j){var B=this.config,A=this.fragPrevious,H=j.fragments,F=j.endSN,x=j.fragmentHint,Y=B.maxFragLookUpTolerance,q=!!(B.lowLatencyMode&&j.partList&&x);q&&x&&!this.bitrateTest&&(H=H.concat(x),F=x.sn);var ie;if(g<w){var me=g>w-Y?0:Y;ie=Object(l.findFragmentByPTS)(A,H,g,me)}else ie=H[H.length-1];if(ie){var $e=ie.sn-j.startSN,xe=A&&ie.level===A.level,Ie=H[$e+1],Je=this.fragmentTracker.getState(ie);if(Je===I.FragmentState.BACKTRACKED){ie=null;for(var Ye=$e;H[Ye]&&this.fragmentTracker.getState(H[Ye])===I.FragmentState.BACKTRACKED;)A?ie=H[Ye--]:ie=H[--Ye];ie||(ie=Ie)}else A&&ie.sn===A.sn&&!q&&(xe&&(ie.sn<F&&this.fragmentTracker.getState(Ie)!==I.FragmentState.OK?(this.log("SN "+ie.sn+" just loaded, load next one: "+Ie.sn),ie=Ie):ie=null))}return ie},p.synchronizeToLiveEdge=function(g){var w=this.config,j=this.media;if(!j)return;var B=this.hls.liveSyncPosition,A=j.currentTime,H=g.fragments[0].start,F=g.edge,x=A>=H-w.maxFragLookUpTolerance&&A<=F;if(B!==null&&j.duration>B&&(A<B||!x)){var Y=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*g.targetduration;(!x&&j.readyState<4||A<F-Y)&&(this.loadedmetadata||(this.nextLoadPosition=B),j.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+F+", reset currentTime to : "+B.toFixed(3)),j.currentTime=B))}},p.alignPlaylists=function(g,w){var j=this.levels,B=this.levelLastLoaded,A=this.fragPrevious,H=B!==null?j[B]:null,F=g.fragments.length;if(!F)return this.warn("No fragments in live playlist"),0;var x=g.fragments[0].start,Y=!w,q=g.alignedSliding&&Object(G.isFiniteNumber)(x);if(Y||!q&&!x){Object(m.alignStream)(A,H,g);var ie=g.fragments[0].start;return this.log("Live playlist sliding: "+ie.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+g.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+F),ie}return x},p.waitForCdnTuneIn=function(g){var w=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*w)},p.setStartPosition=function(g,w){var j=this.startPosition;if(j<w&&(j=-1),j===-1||this.lastCurrentTime===-1){var B=g.startTimeOffset;Object(G.isFiniteNumber)(B)?(j=w+B,B<0&&(j+=g.totalduration),j=Math.min(Math.max(w,j),w+g.totalduration),this.log("Start time offset "+B+" found in playlist, adjust startPosition to "+j),this.startPosition=j):g.live?j=this.hls.liveSyncPosition||w:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},p.getLoadPosition=function(){var g=this.media,w=0;return this.loadedmetadata&&g?w=g.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},p.handleFragLoadAborted=function(g,w){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(w?" part"+w.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},p.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=S.IDLE)},p.onFragmentOrKeyLoadError=function(g,w){if(w.fatal)return;var j=w.frag;if(!j||j.type!==g)return;var B=this.fragCurrent;console.assert(B&&j.sn===B.sn&&j.level===B.level&&j.urlId===B.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+g+" "+j.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(g===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(k.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)},p.afterBufferFlushed=function(g,w,j){if(!g)return;var B=K.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(w,B,j),this.state===S.ENDED&&this.resetLoadingState()},p.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},p.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[g].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},p.updateLevelTiming=function(g,w,j,B){var A=this,H=j.details;console.assert(!!H,"level.details must be defined");var F=Object.keys(g.elementaryStreams).reduce(function(x,Y){var q=g.elementaryStreams[Y];if(q){var ie=q.endPTS-q.startPTS;if(ie<=0)return A.warn("Could not parse fragment "+g.sn+" "+Y+" duration reliably ("+ie+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),x||!1;var me=B?0:Object(o.updateFragPTSDTS)(H,g,q.startPTS,q.endPTS,q.startDTS,q.endDTS);return A.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:H,level:j,drift:me,type:Y,frag:g,start:q.startPTS,end:q.endPTS}),!0}return x},!1);F?(this.state=S.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:g,part:w})):this.resetLoadingState()},p.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(h,[{key:"state",get:function(){return this._state},set:function(g){var w=this._state;w!==g&&(this._state=g,this.log(w+"->"+g))}}]),h}(P.default)},"./src/controller/buffer-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return l});var G=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),I=U("./src/utils/logger.ts"),K=U("./src/errors.ts"),k=U("./src/utils/buffer-helper.ts"),r=U("./src/utils/mediasource-helper.ts"),M=U("./src/loader/fragment.ts"),b=U("./src/controller/buffer-operation-queue.ts"),f=Object(r.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function o(c){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 i=s.hls,n=s.media,O=s.mediaSource;I.logger.log("[buffer-controller]: Media source opened"),n&&(s.updateMediaElementDuration(),i.trigger(P.Events.MEDIA_ATTACHED,{media:n})),O&&O.removeEventListener("sourceopen",s._onMediaSourceOpen),s.checkPendingTracks()},this._onMediaSourceClose=function(){I.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){I.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var a=o.prototype;return a.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},a.destroy=function(){this.unregisterListeners(),this.details=null},a.registerListeners=function(){var s=this.hls;s.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(P.Events.BUFFER_RESET,this.onBufferReset,this),s.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.on(P.Events.BUFFER_EOS,this.onBufferEos,this),s.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.on(P.Events.FRAG_PARSED,this.onFragParsed,this),s.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},a.unregisterListeners=function(){var s=this.hls;s.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(P.Events.BUFFER_RESET,this.onBufferReset,this),s.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),s.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),s.off(P.Events.BUFFER_EOS,this.onBufferEos,this),s.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),s.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),s.off(P.Events.FRAG_PARSED,this.onFragParsed,this),s.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},a._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},a.onManifestParsed=function(s,i){var n=2;(i.audio&&!i.video||!i.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,I.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},a.onMediaAttaching=function(s,i){var n=this.media=i.media;if(n&&f){var O=this.mediaSource=new f;O.addEventListener("sourceopen",this._onMediaSourceOpen),O.addEventListener("sourceended",this._onMediaSourceEnded),O.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(O),this._objectUrl=n.src}},a.onMediaDetaching=function(){var s=this.media,i=this.mediaSource,n=this._objectUrl;if(i){if(I.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(O){I.logger.warn("[buffer-controller]: onMediaDetaching: "+O.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),s&&(n&&self.URL.revokeObjectURL(n),s.src===n?(s.removeAttribute("src"),s.load()):I.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(P.Events.MEDIA_DETACHED,void 0)},a.onBufferReset=function(){var s=this;this.getSourceBufferTypes().forEach(function(i){var n=s.sourceBuffer[i];try{n&&(s.removeBufferListeners(i),s.mediaSource&&s.mediaSource.removeSourceBuffer(n),s.sourceBuffer[i]=void 0)}catch(O){I.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",O)}}),this._initSourceBuffer()},a.onBufferCodecs=function(s,i){var n=this,O=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(T){if(O){var C=n.tracks[T];if(C&&typeof C.buffer.changeType=="function"){var R=i[T],S=R.codec,v=R.levelCodec,E=R.container,h=(C.levelCodec||C.codec).replace(m,"$1"),p=(v||S).replace(m,"$1");if(h!==p){var _=E+";codecs="+(v||S);n.appendChangeType(T,_)}}}else n.pendingTracks[T]=i[T]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},a.appendChangeType=function(s,i){var n=this,O=this.operationQueue,T={execute:function(){var R=n.sourceBuffer[s];R&&(I.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+i),R.changeType(i)),O.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(R){I.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",R)}};O.append(T,s)},a.onBufferAppending=function(s,i){var n=this,O=this.hls,T=this.operationQueue,C=this.tracks,R=i.data,S=i.type,v=i.frag,E=i.part,h=i.chunkMeta,p=h.buffering[S],_=self.performance.now();p.start=_;var g=v.stats.buffering,w=E?E.stats.buffering:null;g.start===0&&(g.start=_),w&&w.start===0&&(w.start=_);var j=C.audio,B=S==="audio"&&h.id===1&&(j==null?void 0:j.container)==="audio/mpeg",A={execute:function(){if(p.executeStart=self.performance.now(),B){var F=n.sourceBuffer[S];if(F){var x=v.start-F.timestampOffset;Math.abs(x)>=.1&&(I.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+x+") sn: "+v.sn+")"),F.timestampOffset=v.start)}}n.appendExecutor(R,S)},onStart:function(){},onComplete:function(){var F=self.performance.now();p.executeEnd=p.end=F,g.first===0&&(g.first=F),w&&w.first===0&&(w.first=F);var x=n.sourceBuffer,Y={};for(var q in x)Y[q]=k.BufferHelper.getBuffered(x[q]);n.appendError=0,n.hls.trigger(P.Events.BUFFER_APPENDED,{type:S,frag:v,part:E,chunkMeta:h,parent:v.type,timeRanges:Y})},onError:function(F){I.logger.error("[buffer-controller]: Error encountered while trying to append to the "+S+" SourceBuffer",F);var x={type:K.ErrorTypes.MEDIA_ERROR,parent:v.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:F,fatal:!1};F.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=K.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,x.details=K.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>O.config.appendErrorMaxRetry&&(I.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),O.trigger(P.Events.ERROR,x)}};T.append(A,S)},a.onBufferFlushing=function(s,i){var n=this,O=this.operationQueue,T=function(R){return{execute:n.removeExecutor.bind(n,R,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(P.Events.BUFFER_FLUSHED,{type:R})},onError:function(v){I.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",v)}}};i.type?O.append(T(i.type),i.type):this.getSourceBufferTypes().forEach(function(C){O.append(T(C),C)})},a.onFragParsed=function(s,i){var n=this,O=i.frag,T=i.part,C=[],R=T?T.elementaryStreams:O.elementaryStreams;R[M.ElementaryStreamTypes.AUDIOVIDEO]?C.push("audiovideo"):(R[M.ElementaryStreamTypes.AUDIO]&&C.push("audio"),R[M.ElementaryStreamTypes.VIDEO]&&C.push("video"));var S=function(){var E=self.performance.now();O.stats.buffering.end=E,T&&(T.stats.buffering.end=E);var h=T?T.stats:O.stats;n.hls.trigger(P.Events.FRAG_BUFFERED,{frag:O,part:T,stats:h,id:O.type})};C.length===0&&I.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(S,C)},a.onFragChanged=function(s,i){this.flushBackBuffer()},a.onBufferEos=function(s,i){var n=this,O=this.getSourceBufferTypes().reduce(function(T,C){var R=n.sourceBuffer[C];return(!i.type||i.type===C)&&(R&&!R.ended&&(R.ended=!0,I.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),T&&!!(!R||R.ended)},!0);O&&this.blockBuffers(function(){var T=n.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},a.onLevelUpdated=function(s,i){var n=i.details;if(!n.fragments.length)return;this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},a.flushBackBuffer=function(){var s=this.hls,i=this.details,n=this.media,O=this.sourceBuffer;if(!n||i===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var C=i.live&&s.config.liveBackBufferLength!==null?s.config.liveBackBufferLength:s.config.backBufferLength;if(!Object(G.isFiniteNumber)(C)||C<0)return;var R=n.currentTime,S=i.levelTargetDuration,v=Math.max(C,S),E=Math.floor(R/S)*S-v;T.forEach(function(h){var p=O[h];if(p){var _=k.BufferHelper.getBuffered(p);_.length>0&&E>_.start(0)&&(s.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:E}),i.live&&s.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:E}),s.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:E,type:h}))}})},a.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var s=this.details,i=this.hls,n=this.media,O=this.mediaSource,T=s.fragments[0].start+s.totalduration,C=n.duration,R=Object(G.isFiniteNumber)(O.duration)?O.duration:0;s.live&&i.config.liveDurationInfinity?(I.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(s)):(T>R&&T>C||!Object(G.isFiniteNumber)(C))&&(I.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),O.duration=T)},a.updateSeekableRange=function(s){var i=this.mediaSource,n=s.fragments,O=n.length;if(O&&s.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var T=Math.max(0,n[0].start),C=Math.max(T,T+s.totalduration);i.setLiveSeekableRange(T,C)}},a.checkPendingTracks=function(){var s=this.bufferCodecEventsExpected,i=this.operationQueue,n=this.pendingTracks,O=Object.keys(n).length;if(O&&!s||O===2){this.createSourceBuffers(n),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(C){i.executeNext(C)})}},a.createSourceBuffers=function(s){var i=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var O=0;for(var T in s)if(!i[T]){var C=s[T];if(!C)throw Error("source buffer exists for track "+T+", however track does not");var R=C.levelCodec||C.codec,S=C.container+";codecs="+R;I.logger.log("[buffer-controller]: creating sourceBuffer("+S+")");try{var v=i[T]=n.addSourceBuffer(S),E=T;this.addBufferListener(E,"updatestart",this._onSBUpdateStart),this.addBufferListener(E,"updateend",this._onSBUpdateEnd),this.addBufferListener(E,"error",this._onSBUpdateError),this.tracks[T]={buffer:v,codec:R,container:C.container,levelCodec:C.levelCodec,id:C.id},O++}catch(h){I.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:S})}}O&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},a._onSBUpdateStart=function(s){var i=this.operationQueue,n=i.current(s);n.onStart()},a._onSBUpdateEnd=function(s){var i=this.operationQueue,n=i.current(s);n.onComplete(),i.shiftAndExecuteNext(s)},a._onSBUpdateError=function(s,i){I.logger.error("[buffer-controller]: "+s+" SourceBuffer error",i),this.hls.trigger(P.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(s);n&&n.onError(i)},a.removeExecutor=function(s,i,n){var O=this.media,T=this.mediaSource,C=this.operationQueue,R=this.sourceBuffer,S=R[s];if(!O||!T||!S){I.logger.warn("[buffer-controller]: Attempting to remove from the "+s+" SourceBuffer, but it does not exist"),C.shiftAndExecuteNext(s);return}var v=Object(G.isFiniteNumber)(O.duration)?O.duration:Infinity,E=Object(G.isFiniteNumber)(T.duration)?T.duration:Infinity,h=Math.max(0,i),p=Math.min(n,v,E);p>h?(I.logger.log("[buffer-controller]: Removing ["+h+","+p+"] from the "+s+" SourceBuffer"),console.assert(!S.updating,s+" sourceBuffer must not be updating"),S.remove(h,p)):C.shiftAndExecuteNext(s)},a.appendExecutor=function(s,i){var n=this.operationQueue,O=this.sourceBuffer,T=O[i];if(!T){I.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(i);return}T.ended=!1,console.assert(!T.updating,i+" sourceBuffer must not be updating"),T.appendBuffer(s)},a.blockBuffers=function(s,i){var n=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){I.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var O=this.operationQueue,T=i.map(function(C){return O.appendBlocker(C)});Promise.all(T).then(function(){s(),i.forEach(function(C){var R=n.sourceBuffer[C];(!R||!R.updating)&&O.shiftAndExecuteNext(C)})})},a.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},a.addBufferListener=function(s,i,n){var O=this.sourceBuffer[s];if(!O)return;var T=n.bind(this,s);this.listeners[s].push({event:i,listener:T}),O.addEventListener(i,T)},a.removeBufferListeners=function(s){var i=this.sourceBuffer[s];if(!i)return;this.listeners[s].forEach(function(n){i.removeEventListener(n.event,n.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return P});var G=U("./src/utils/logger.ts"),P=function(){function I(k){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=k}var K=I.prototype;return K.append=function(r,M){var b=this.queues[M];b.push(r),b.length===1&&this.buffers[M]&&this.executeNext(M)},K.insertAbort=function(r,M){var b=this.queues[M];b.unshift(r),this.executeNext(M)},K.appendBlocker=function(r){var M,b=new Promise(function(m){M=m}),f={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,r),b},K.executeNext=function(r){var M=this.buffers,b=this.queues,f=M[r],m=b[r];if(m.length){var l=m[0];try{l.execute()}catch(o){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(o),(!f||!f.updating)&&(m.shift(),this.executeNext(r))}}},K.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},K.current=function(r){return this.queues[r][0]},I}()},"./src/controller/cap-level-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts");function P(k,r){for(var M=0;M<r.length;M++){var b=r[M];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(k,b.key,b)}}function I(k,r,M){return r&&P(k.prototype,r),M&&P(k,M),k}var K=function(){function k(M){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=M,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=k.prototype;return r.setStreamController=function(b){this.streamController=b},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var b=this.hls;b.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var b=this.hls;b.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(b,f){k.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},r.onMediaAttaching=function(b,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},r.onManifestParsed=function(b,f){var m=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,m.config.capLevelToPlayerSize&&f.video&&this.startCapping()},r.onBufferCodecs=function(b,f){var m=this.hls;m.config.capLevelToPlayerSize&&f.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(b.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},r.getMaxLevel=function(b){var f=this,m=this.hls.levels;if(!m.length)return-1;var l=m.filter(function(o,a){return k.isLevelAllowed(a,f.restrictedLevels)&&a<=b});return this.clientRect=null,k.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},r.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()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,f={width:0,height:0};if(b){var m=b.getBoundingClientRect();f.width=m.width,f.height=m.height,!f.width&&!f.height&&(f.width=m.right-m.left||b.width||0,f.height=m.bottom-m.top||b.height||0)}return this.clientRect=f,f},k.isLevelAllowed=function(b,f){return f===void 0&&(f=[]),f.indexOf(b)===-1},k.getMaxLevelByMediaSize=function(b,f,m){if(!b||!b.length)return-1;for(var l=function(i,n){return n?i.width!==n.width||i.height!==n.height:!0},o=b.length-1,a=0;a<b.length;a+=1){var c=b[a];if((c.width>=f||c.height>=m)&&l(c,b[a+1])){o=a;break}}return o},I(k,[{key:"mediaWidth",get:function(){return this.getDimensions().width*k.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*k.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(f){}return b}}]),k}();V.default=K},"./src/controller/cmcd-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return l});var G=U("./src/events.ts"),P=U("./src/types/cmcd.ts"),I=U("./src/utils/buffer-helper.ts"),K=U("./src/utils/logger.ts");function k(o,a){for(var c=0;c<a.length;c++){var s=a[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function r(o,a,c){return a&&k(o.prototype,a),c&&k(o,c),o}function M(o,a){var c=typeof Symbol!="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(c)return(c=c.call(o)).next.bind(c);if(Array.isArray(o)||(c=b(o))||a&&o&&typeof o.length=="number"){c&&(o=c);var s=0;return function(){return s>=o.length?{done:!0}:{done:!1,value:o[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 b(o,a){if(!o)return;if(typeof o=="string")return f(o,a);var c=Object.prototype.toString.call(o).slice(8,-1);if(c==="Object"&&o.constructor&&(c=o.constructor.name),c==="Map"||c==="Set")return Array.from(o);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return f(o,a)}function f(o,a){(a==null||a>o.length)&&(a=o.length);for(var c=0,s=new Array(a);c<a;c++)s[c]=o[c];return s}function m(){return m=Object.assign||function(o){for(var a=1;a<arguments.length;a++){var c=arguments[a];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(o[s]=c[s])}return o},m.apply(this,arguments)}var l=function(){function o(c){var s=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){s.initialized&&(s.starved=!0),s.buffering=!0},this.onPlaying=function(){s.initialized||(s.initialized=!0),s.buffering=!1},this.applyPlaylistData=function(O){try{s.apply(O,{ot:P.CMCDObjectType.MANIFEST,su:!s.initialized})}catch(T){K.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(O){try{var T=O.frag,C=s.hls.levels[T.level],R=s.getObjectType(T),S={d:T.duration*1e3,ot:R};(R===P.CMCDObjectType.VIDEO||R===P.CMCDObjectType.AUDIO||R==P.CMCDObjectType.MUXED)&&(S.br=C.bitrate/1e3,S.tb=s.getTopBandwidth(R),S.bl=s.getBufferLength(R)),s.apply(O,S)}catch(v){K.logger.warn("Could not generate segment CMCD data.",v)}},this.hls=c;var i=this.config=c.config,n=i.cmcd;n!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||o.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var a=o.prototype;return a.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this)},a.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),s.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},a.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},a.onMediaAttached=function(s,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},a.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},a.onBufferCreated=function(s,i){var n,O;this.audioBuffer=(n=i.tracks.audio)===null||n===void 0?void 0:n.buffer,this.videoBuffer=(O=i.tracks.video)===null||O===void 0?void 0:O.buffer},a.createData=function(){var s;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(s=this.media)===null||s===void 0?void 0:s.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},a.apply=function(s,i){i===void 0&&(i={}),m(i,this.createData());var n=i.ot===P.CMCDObjectType.INIT||i.ot===P.CMCDObjectType.VIDEO||i.ot===P.CMCDObjectType.MUXED;if(this.starved&&n&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var O=o.toHeaders(i);if(!Object.keys(O).length)return;s.headers||(s.headers={}),m(s.headers,O)}else{var T=o.toQuery(i);if(!T)return;s.url=o.appendQueryToUri(s.url,T)}},a.getObjectType=function(s){var i=s.type;return i==="subtitle"?P.CMCDObjectType.TIMED_TEXT:s.sn==="initSegment"?P.CMCDObjectType.INIT:i==="audio"?P.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},a.getTopBandwidth=function(s){for(var i=0,n=s===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=M(n),T;!(T=O()).done;){var C=T.value;C.bitrate>i&&(i=C.bitrate)}return i>0?i:NaN},a.getBufferLength=function(s){var i=this.hls.media,n=s===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!i)return NaN;var O=I.BufferHelper.bufferInfo(n,i.currentTime,this.config.maxBufferHole);return O.len*1e3},a.createPlaylistLoader=function(){var s=this.config.pLoader,i=this.applyPlaylistData,n=s||this.config.loader;return function(){function O(C){this.loader=void 0,this.loader=new n(C)}var T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(R,S,v){i(R),this.loader.load(R,S,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},a.createFragmentLoader=function(){var s=this.config.fLoader,i=this.applyFragmentData,n=s||this.config.loader;return function(){function O(C){this.loader=void 0,this.loader=new n(C)}var T=O.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(R,S,v){i(R),this.loader.load(R,S,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},o.uuid=function(){var s=URL.createObjectURL(new Blob),i=s.toString();return URL.revokeObjectURL(s),i.substr(i.lastIndexOf("/")+1)},o.serialize=function(s){for(var i=[],n=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},O=function(B){return Math.round(B)},T=function(B){return O(B/100)*100},C=function(B){return encodeURIComponent(B)},R={br:O,d:O,bl:T,dl:T,mtp:T,nor:C,rtp:T,tb:O},S=Object.keys(s||{}).sort(),v=M(S),E;!(E=v()).done;){var h=E.value,p=s[h];if(!n(p))continue;if(h==="v"&&p===1)continue;if(h=="pr"&&p===1)continue;var _=R[h];_&&(p=_(p));var g=typeof p,w=void 0;h==="ot"||h==="sf"||h==="st"?w=h+"="+p:g==="boolean"?w=h:g==="number"?w=h+"="+p:w=h+"="+JSON.stringify(p),i.push(w)}return i.join(",")},o.toHeaders=function(s){for(var i=Object.keys(s),n={},O=["Object","Request","Session","Status"],T=[{},{},{},{}],C={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,S=i;R<S.length;R++){var v=S[R],E=C[v]!=null?C[v]:1;T[E][v]=s[v]}for(var h=0;h<T.length;h++){var p=o.serialize(T[h]);p&&(n["CMCD-"+O[h]]=p)}return n},o.toQuery=function(s){return"CMCD="+encodeURIComponent(o.serialize(s))},o.appendQueryToUri=function(s,i){if(!i)return s;var n=s.includes("?")?"&":"?";return""+s+n+i},o}()},"./src/controller/eme-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/errors.ts"),I=U("./src/utils/logger.ts"),K=U("./src/utils/mediakeys-helper.ts");function k(l,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}function r(l,o,a){return o&&k(l.prototype,o),a&&k(l,a),l}var M=3,b=function(o,a,c){var s={audioCapabilities:[],videoCapabilities:[]};return o.forEach(function(i){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:c.audioRobustness||""})}),a.forEach(function(i){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:c.videoRobustness||""})}),[s]},f=function(o,a,c,s){switch(o){case K.KeySystems.WIDEVINE:return b(a,c,s);default:throw new Error("Unknown key-system: "+o)}},m=function(){function l(a){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=a,this._config=a.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var o=l.prototype;return o.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},o._registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o._unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(G.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this)},o.getLicenseServerUrl=function(c){switch(c){case K.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},o._attemptKeySystemAccess=function(c,s,i){var n=this,O=f(c,s,i,this._drmSystemOptions);I.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(c,O);this.mediaKeysPromise=T.then(function(C){return n._onMediaKeySystemAccessObtained(c,C)}),T.catch(function(C){I.logger.error('Failed to obtain key-system "'+c+'" access:',C)})},o._onMediaKeySystemAccessObtained=function(c,s){var i=this;I.logger.log('Access for key-system "'+c+'" obtained');var n={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:s,mediaKeySystemDomain:c};this._mediaKeysList.push(n);var O=Promise.resolve().then(function(){return s.createMediaKeys()}).then(function(T){return n.mediaKeys=T,I.logger.log('Media-keys created for key-system "'+c+'"'),i._onMediaKeysCreated(),T});return O.catch(function(T){I.logger.error("Failed to create media-keys:",T)}),O},o._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),c._onNewMediaKeySession(s.mediaKeysSession))})},o._onNewMediaKeySession=function(c){var s=this;I.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(i){s._onKeySessionMessage(c,i.message)},!1)},o._onKeySessionMessage=function(c,s){I.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(i){I.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),c.update(i)})},o.onMediaEncrypted=function(c){var s=this;if(I.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(O){if(!s._media)return;s._attemptSetMediaKeys(O),s._generateRequestWithPreferredKeySession(c.initDataType,c.initData)};this.mediaKeysPromise.then(i).catch(i)},o._attemptSetMediaKeys=function(c){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var s=this._mediaKeysList[0];if(!s||!s.mediaKeys){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}I.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},o._generateRequestWithPreferredKeySession=function(c,s){var i=this,n=this._mediaKeysList[0];if(!n){I.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(n.mediaKeysSessionInitialized){I.logger.warn("Key-Session already initialized but requested again");return}var O=n.mediaKeysSession;if(!O){I.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!s){I.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}I.logger.log('Generating key-session request for "'+c+'" init data type'),n.mediaKeysSessionInitialized=!0,O.generateRequest(c,s).then(function(){I.logger.debug("Key-session generation succeeded")}).catch(function(T){I.logger.error("Error generating key-session request:",T),i.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},o._createLicenseXhr=function(c,s,i){var n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,n,c,s,i);var O=this._licenseXhrSetup;if(O)try{O.call(this.hls,n,c),O=void 0}catch(T){I.logger.error(T)}try{n.readyState||n.open("POST",c,!0),O&&O.call(this.hls,n,c)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return n},o._onLicenseRequestReadyStageChange=function(c,s,i,n){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,I.logger.log("License request succeeded");var O=c.response,T=this._licenseResponseCallback;if(T)try{O=T.call(this.hls,c,s)}catch(R){I.logger.error(R)}n(O)}else{if(I.logger.error("License Request XHR failed ("+s+"). Status: "+c.status+" ("+c.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>M){this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var C=M-this._requestLicenseFailureCount+1;I.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(i,n)}break}},o._generateLicenseRequestChallenge=function(c,s){switch(c.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},o._requestLicense=function(c,s){I.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){I.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var n=this.getLicenseServerUrl(i.mediaKeySystemDomain),O=this._createLicenseXhr(n,c,s);I.logger.log("Sending license request to URL: "+n);var T=this._generateLicenseRequestChallenge(i,c);O.send(T)}catch(C){I.logger.error("Failure requesting DRM license: "+C),this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(c,s){if(!this._emeEnabled)return;var i=s.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var c=this._media,s=this._mediaKeysList;if(!c)return;c.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(s.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return c.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(c,s){if(!this._emeEnabled)return;var i=s.levels.map(function(O){return O.audioCodec}).filter(function(O){return!!O}),n=s.levels.map(function(O){return O.videoCodec}).filter(function(O){return!!O});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,i,n)},r(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();V.default=m},"./src/controller/fps-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/utils/logger.ts"),I=function(){function K(r){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=r,this.registerListeners()}var k=K.prototype;return k.setStreamController=function(M){this.streamController=M},k.registerListeners=function(){this.hls.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},k.unregisterListeners=function(){this.hls.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching)},k.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},k.onMediaAttaching=function(M,b){var f=this.hls.config;if(f.capLevelOnFPSDrop){var m=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},k.checkFPS=function(M,b,f){var m=performance.now();if(b){if(this.lastTime){var l=m-this.lastTime,o=f-this.lastDroppedFrames,a=b-this.lastDecodedFrames,c=1e3*o/l,s=this.hls;if(s.trigger(G.Events.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:f}),c>0&&o>s.config.fpsDroppedMonitoringThreshold*a){var i=s.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(s.autoLevelCapping===-1||s.autoLevelCapping>=i)&&(i=i-1,s.trigger(G.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:s.currentLevel}),s.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=f,this.lastDecodedFrames=b}},k.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var b=M.getVideoPlaybackQuality();this.checkFPS(M,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},K}();V.default=I},"./src/controller/fragment-finders.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"findFragmentByPDT",function(){return I}),U.d(V,"findFragmentByPTS",function(){return K}),U.d(V,"fragmentWithinToleranceTest",function(){return k}),U.d(V,"pdtWithinToleranceTest",function(){return r}),U.d(V,"findFragWithCC",function(){return M});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/binary-search.ts");function I(b,f,m){if(f===null||!Array.isArray(b)||!b.length||!Object(G.isFiniteNumber)(f))return null;var l=b[0].programDateTime;if(f<(l||0))return null;var o=b[b.length-1].endProgramDateTime;if(f>=(o||0))return null;m=m||0;for(var a=0;a<b.length;++a){var c=b[a];if(r(f,m,c))return c}return null}function K(b,f,m,l){m===void 0&&(m=0),l===void 0&&(l=0);var o=null;if(b?o=f[b.sn-f[0].sn+1]||null:m===0&&f[0].start===0&&(o=f[0]),o&&k(m,l,o)===0)return o;var a=P.default.search(f,k.bind(null,m,l));return a||o}function k(b,f,m){b===void 0&&(b=0),f===void 0&&(f=0);var l=Math.min(f,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-l<=b?1:m.start-l>b&&m.start?-1:0}function r(b,f,m){var l=Math.min(f,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,o=m.endProgramDateTime||0;return o-l>b}function M(b,f){return P.default.search(b,function(m){return m.cc<f?1:m.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"FragmentState",function(){return I}),U.d(V,"FragmentTracker",function(){return K});var G=U("./src/events.ts"),P=U("./src/types/loader.ts"),I;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(I||(I={}));var K=function(){function M(f){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=f,this._registerListeners()}var b=M.prototype;return b._registerListeners=function(){var m=this.hls;m.on(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(G.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var m=this.hls;m.off(G.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(G.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(m,l){if(l===P.PlaylistLevelType.MAIN){var o=this.activeFragment,a=this.activeParts;if(!o)return null;if(a)for(var c=a.length;c--;){var s=a[c],i=s?s.end:o.appendedPTS;if(s.start<=m&&i!==void 0&&m<=i)return c>9&&(this.activeParts=a.slice(c-9)),s}else if(o.start<=m&&o.appendedPTS!==void 0&&m<=o.appendedPTS)return o}return this.getBufferedFrag(m,l)},b.getBufferedFrag=function(m,l){for(var o=this.fragments,a=Object.keys(o),c=a.length;c--;){var s=o[a[c]];if((s==null?void 0:s.body.type)===l&&s.buffered){var i=s.body;if(i.start<=m&&m<=i.end)return i}}return null},b.detectEvictedFragments=function(m,l,o){var a=this;Object.keys(this.fragments).forEach(function(c){var s=a.fragments[c];if(!s)return;if(!s.buffered){s.body.type===o&&a.removeFragment(s.body);return}var i=s.range[m];if(!i)return;i.time.some(function(n){var O=!a.isTimeBuffered(n.startPTS,n.endPTS,l);return O&&a.removeFragment(s.body),O})})},b.detectPartialFragments=function(m){var l=this,o=this.timeRanges,a=m.frag,c=m.part;if(!o||a.sn==="initSegment")return;var s=r(a),i=this.fragments[s];if(!i)return;Object.keys(o).forEach(function(n){var O=a.elementaryStreams[n];if(!O)return;var T=o[n],C=c!==null||O.partial===!0;i.range[n]=l.getBufferedTimes(a,c,C,T)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},b.fragBuffered=function(m){var l=r(m),o=this.fragments[l];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},b.getBufferedTimes=function(m,l,o,a){for(var c={time:[],partial:o},s=l?l.start:m.start,i=l?l.end:m.end,n=m.minEndPTS||i,O=m.maxStartPTS||s,T=0;T<a.length;T++){var C=a.start(T)-this.bufferPadding,R=a.end(T)+this.bufferPadding;if(O>=C&&n<=R){c.time.push({startPTS:Math.max(s,a.start(T)),endPTS:Math.min(i,a.end(T))});break}else if(s<R&&i>C)c.partial=!0,c.time.push({startPTS:Math.max(s,a.start(T)),endPTS:Math.min(i,a.end(T))});else if(i<=C)break}return c},b.getPartialFragment=function(m){var l=null,o,a,c,s=0,i=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(O){var T=n[O];if(!T)return;k(T)&&(a=T.body.start-i,c=T.body.end+i,m>=a&&m<=c&&(o=Math.min(m-a,c-m),s<=o&&(l=T.body,s=o)))}),l},b.getState=function(m){var l=r(m),o=this.fragments[l];return o?o.buffered?k(o)?I.PARTIAL:I.OK:o.backtrack?I.BACKTRACKED:I.APPENDING:I.NOT_LOADED},b.backtrack=function(m,l){var o=r(m),a=this.fragments[o];if(!a||a.backtrack)return null;var c=a.backtrack=l||a.loaded;return a.loaded=null,c},b.getBacktrackData=function(m){var l=r(m),o=this.fragments[l];if(o){var a,c=o.backtrack;if(c!=null&&(a=c.payload)!==null&&a!==void 0&&a.byteLength)return c;this.removeFragment(m)}return null},b.isTimeBuffered=function(m,l,o){for(var a,c,s=0;s<o.length;s++){if(a=o.start(s)-this.bufferPadding,c=o.end(s)+this.bufferPadding,m>=a&&l<=c)return!0;if(l<=a)return!1}return!1},b.onFragLoaded=function(m,l){var o=l.frag,a=l.part;if(o.sn==="initSegment"||o.bitrateTest||a)return;var c=r(o);this.fragments[c]={body:o,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(m,l){var o=this,a=l.frag,c=l.part,s=l.timeRanges;if(a.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=a,c){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(c)}else this.activeParts=null;this.timeRanges=s,Object.keys(s).forEach(function(n){var O=s[n];if(o.detectEvictedFragments(n,O),!c)for(var T=0;T<O.length;T++)a.appendedPTS=Math.max(O.end(T),a.appendedPTS||0)})},b.onFragBuffered=function(m,l){this.detectPartialFragments(l)},b.hasFragment=function(m){var l=r(m);return!!this.fragments[l]},b.removeFragmentsInRange=function(m,l,o){var a=this;Object.keys(this.fragments).forEach(function(c){var s=a.fragments[c];if(!s)return;if(s.buffered){var i=s.body;i.type===o&&i.start<l&&i.end>m&&a.removeFragment(i)}})},b.removeFragment=function(m){var l=r(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[l]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function k(M){var b,f;return M.buffered&&(((b=M.range.video)===null||b===void 0?void 0:b.partial)||((f=M.range.audio)===null||f===void 0?void 0:f.partial))}function r(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"STALL_MINIMUM_DURATION_MS",function(){return k}),U.d(V,"MAX_START_GAP_JUMP",function(){return r}),U.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),U.d(V,"SKIP_BUFFER_RANGE_START",function(){return b}),U.d(V,"default",function(){return f});var G=U("./src/utils/buffer-helper.ts"),P=U("./src/errors.ts"),I=U("./src/events.ts"),K=U("./src/utils/logger.ts"),k=250,r=2,M=.1,b=.05,f=function(){function m(o,a,c,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=o,this.media=a,this.fragmentTracker=c,this.hls=s}var l=m.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(a){var c=this.config,s=this.media,i=this.stalled,n=s.currentTime,O=s.seeking,T=this.seeking&&!O,C=!this.seeking&&O;if(this.seeking=O,n!==a){if(this.moved=!0,i!==null){if(this.stallReported){var R=self.performance.now()-i;K.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||T)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!G.BufferHelper.getBuffered(s).length)return;var S=G.BufferHelper.bufferInfo(s,n,0),v=S.len>0,E=S.nextStart||0;if(!v&&!E)return;if(O){var h=S.len>r,p=!E||E-n>r&&!this.fragmentTracker.getPartialFragment(n);if(h||p)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,g=Math.max(E,S.start||0)-n,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=w==null||((_=w.details)===null||_===void 0)?void 0:_.live,B=j?w.details.targetduration*2:r;if(g>0&&g<=B){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(i===null){this.stalled=A;return}var H=A-i;!O&&H>=k&&this._reportStall(S.len);var F=G.BufferHelper.bufferInfo(s,n,c.maxBufferHole);this._tryFixBufferStall(F,H)},l._tryFixBufferStall=function(a,c){var s=this.config,i=this.fragmentTracker,n=this.media,O=n.currentTime,T=i.getPartialFragment(O);if(T){var C=this._trySkipBufferHole(T);if(C)return}a.len>s.maxBufferHole&&c>s.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(a){var c=this.hls,s=this.media,i=this.stallReported;i||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+a+")"),c.trigger(I.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:a}))},l._trySkipBufferHole=function(a){for(var c=this.config,s=this.hls,i=this.media,n=i.currentTime,O=0,T=G.BufferHelper.getBuffered(i),C=0;C<T.length;C++){var R=T.start(C);if(n+c.maxBufferHole>=O&&n<R){var S=Math.max(R+b,i.currentTime+M);return K.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+S),this.moved=!0,this.stalled=null,i.currentTime=S,a&&s.trigger(I.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+n+" to "+S,frag:a}),S}O=T.end(C)}return 0},l._tryNudgeBuffer=function(){var a=this.config,c=this.hls,s=this.media,i=s.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<a.nudgeMaxRetry){var O=i+n*a.nudgeOffset;K.logger.warn("Nudging 'currentTime' from "+i+" to "+O),s.currentTime=O,c.trigger(I.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else K.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+a.nudgeMaxRetry+" nudges"),c.trigger(I.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},m}()},"./src/controller/id3-track-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/utils/texttrack-utils.ts"),I=U("./src/demux/id3.ts"),K=.25,k=function(){function r(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var M=r.prototype;return M.destroy=function(){this._unregisterListeners()},M._registerListeners=function(){var f=this.hls;f.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var f=this.hls;f.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(f,m){this.media=m.media},M.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},M.getID3Track=function(f){if(!this.media)return;for(var m=0;m<f.length;m++){var l=f[m];if(l.kind==="metadata"&&l.label==="id3")return Object(P.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},M.onFragParsingMetadata=function(f,m){if(!this.media)return;var l=m.frag,o=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var a=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<o.length;c++){var s=I.getID3Frames(o[c].data);if(s){var i=o[c].pts,n=c<o.length-1?o[c+1].pts:l.end,O=n-i;O<=0&&(n=i+K);for(var T=0;T<s.length;T++){var C=s[T];if(!I.isTimeStampFrame(C)){var R=new a(i,n,"");R.value=C,this.id3Track.addCue(R)}}}}},M.onBufferFlushing=function(f,m){var l=m.startOffset,o=m.endOffset,a=m.type;if(!a||a==="audio"){var c=this.id3Track;c&&Object(P.removeCuesInRange)(c,l,o)}},r}();V.default=k},"./src/controller/latency-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return r});var G=U("./src/errors.ts"),P=U("./src/events.ts"),I=U("./src/utils/logger.ts");function K(M,b){for(var f=0;f<b.length;f++){var m=b[f];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(M,m.key,m)}}function k(M,b,f){return b&&K(M.prototype,b),f&&K(M,f),M}var r=function(){function M(f){var m=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return m.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var b=M.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},b.onMediaAttached=function(m,l){this.media=l.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(m,l){var o=l.details;this.levelDetails=o,o.advanced&&this.timeupdate(),!o.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(m,l){if(l.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,I.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var m=this.media,l=this.levelDetails;if(!m||!l)return;this.currentTime=m.currentTime;var o=this.computeLatency();if(o===null)return;this._latency=o;var a=this.config,c=a.lowLatencyMode,s=a.maxLiveSyncPlaybackRate;if(!c||s===1)return;var i=this.targetLatency;if(i===null)return;var n=o-i,O=Math.min(this.maxLatency,i+l.targetduration),T=n<O;if(l.live&&T&&n>.05&&this.forwardBufferLength>1){var C=Math.min(2,Math.max(1,s)),R=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;m.playbackRate=Math.min(C,Math.max(1,R))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},b.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},b.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},k(M,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,l=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:l?m.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var l=m.holdBack,o=m.partHoldBack,a=m.targetduration,c=this.config,s=c.liveSyncDuration,i=c.liveSyncDurationCount,n=c.lowLatencyMode,O=this.hls.userConfig,T=n&&o||l;(O.liveSyncDuration||O.liveSyncDurationCount||T===0)&&(T=s!==void 0?s:i*a);var C=a,R=1;return T+Math.min(this.stallCount*R,C)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),l=this.targetLatency,o=this.levelDetails;if(m===null||l===null||o===null)return null;var a=o.edge,c=m-l-this.edgeStalled,s=a-o.totalduration,i=a-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(s,c),i)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var l=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-l,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,l=this.levelDetails;if(!m||!l)return 0;var o=m.buffered.length;return o?m.buffered.end(o-1):l.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return c});var G=U("./src/types/level.ts"),P=U("./src/events.ts"),I=U("./src/errors.ts"),K=U("./src/utils/codecs.ts"),k=U("./src/controller/level-helper.ts"),r=U("./src/controller/base-playlist-controller.ts"),M=U("./src/types/loader.ts");function b(){return b=Object.assign||function(s){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var O in n)Object.prototype.hasOwnProperty.call(n,O)&&(s[O]=n[O])}return s},b.apply(this,arguments)}function f(s,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(s,O.key,O)}}function m(s,i,n){return i&&f(s.prototype,i),n&&f(s,n),s}function l(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,o(s,i)}function o(s,i){return o=Object.setPrototypeOf||function(O,T){return O.__proto__=T,O},o(s,i)}var a=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(s){l(i,s);function i(O){var T;return T=s.call(this,O,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var n=i.prototype;return n._registerListeners=function(){var T=this.hls;T.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(P.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var T=this.hls;T.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(P.Events.ERROR,this.onError,this)},n.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,s.prototype.destroy.call(this)},n.startLoad=function(){var T=this._levels;T.forEach(function(C){C.loadError=0}),s.prototype.startLoad.call(this)},n.onManifestLoaded=function(T,C){var R=[],S=[],v=[],E,h={},p,_=!1,g=!1,w=!1;if(C.levels.forEach(function(H){var F=H.attrs;_=_||!!(H.width&&H.height),g=g||!!H.videoCodec,w=w||!!H.audioCodec,a&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var x=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;p=h[x],p?p.url.push(H.url):(p=new G.Level(H),h[x]=p,R.push(p)),F&&(F.AUDIO&&Object(k.addGroupId)(p,"audio",F.AUDIO),F.SUBTITLES&&Object(k.addGroupId)(p,"text",F.SUBTITLES))}),(_||g)&&w&&(R=R.filter(function(H){var F=H.videoCodec,x=H.width,Y=H.height;return!!F||!!(x&&Y)})),R=R.filter(function(H){var F=H.audioCodec,x=H.videoCodec;return(!F||Object(K.isCodecSupportedInMp4)(F,"audio"))&&(!x||Object(K.isCodecSupportedInMp4)(x,"video"))}),C.audioTracks&&(S=C.audioTracks.filter(function(H){return!H.audioCodec||Object(K.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(k.assignTrackIdsByGroup)(S)),C.subtitles&&(v=C.subtitles,Object(k.assignTrackIdsByGroup)(v)),R.length>0){E=R[0].bitrate,R.sort(function(H,F){return H.bitrate-F.bitrate}),this._levels=R;for(var j=0;j<R.length;j++)if(R[j].bitrate===E){this._firstLevel=j,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+E);break}var B=w&&!g,A={levels:R,audioTracks:S,subtitleTracks:v,firstLevel:this._firstLevel,stats:C.stats,audio:w,video:g,altAudio:!B&&S.some(function(H){return!!H.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,A),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(T,C){if(s.prototype.onError.call(this,T,C),C.fatal)return;var R=C.context,S=this._levels[this.currentLevelIndex];if(R&&(R.type===M.PlaylistContextType.AUDIO_TRACK&&S.audioGroupIds&&R.groupId===S.audioGroupIds[S.urlId]||R.type===M.PlaylistContextType.SUBTITLE_TRACK&&S.textGroupIds&&R.groupId===S.textGroupIds[S.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,E=!0,h;switch(C.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:case I.ErrorDetails.KEY_LOAD_ERROR:case I.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var p=this._levels[C.frag.level];p?(p.fragmentError++,p.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=C.frag.level)):h=C.frag.level}break;case I.ErrorDetails.LEVEL_LOAD_ERROR:case I.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(E=!1),h=R.level),v=!0;break;case I.ErrorDetails.REMUX_ALLOC_ERROR:h=C.level,v=!0;break}h!==void 0&&this.recoverLevel(C,h,v,E)},n.recoverLevel=function(T,C,R,S){var v=T.details,E=this._levels[C];if(E.loadError++,R){var h=this.retryLoadingOrFail(T);if(h)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(S){var p=E.url.length;if(p>1&&E.loadError<p)T.levelRetry=!0,this.redundantFailover(C);else if(this.manualLevelIndex===-1){var _=C===0?this._levels.length-1:C-1;this.currentLevelIndex!==_&&this._levels[_].loadError===0&&(this.warn(v+": switch to "+_),T.levelRetry=!0,this.hls.nextAutoLevel=_)}}},n.redundantFailover=function(T){var C=this._levels[T],R=C.url.length;if(R>1){var S=(C.urlId+1)%R;this.warn("Switching to redundant URL-id "+S),this._levels.forEach(function(v){v.urlId=S}),this.level=T}},n.onFragLoaded=function(T,C){var R=C.frag;if(R!==void 0&&R.type===M.PlaylistLevelType.MAIN){var S=this._levels[R.level];S!==void 0&&(S.fragmentError=0,S.loadError=0)}},n.onLevelLoaded=function(T,C){var R,S=C.level,v=C.details,E=this._levels[S];if(!E){var h;this.warn("Invalid level index "+S),(h=C.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(v.deltaUpdateFailed=!0);return}S===this.currentLevelIndex?(E.fragmentError===0&&(E.loadError=0,this.retryCount=0),this.playlistLoaded(S,C,E.details)):(R=C.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(v.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(T,C){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var S=-1,v=this.hls.audioTracks[C.id].groupId,E=0;E<R.audioGroupIds.length;E++)if(R.audioGroupIds[E]===v){S=E;break}S!==R.urlId&&(R.urlId=S,this.startLoad())}},n.loadPlaylist=function(T){var C=this.currentLevelIndex,R=this._levels[C];if(this.canLoad&&R&&R.url.length>0){var S=R.urlId,v=R.url[S];if(T)try{v=T.addDirectives(v)}catch(E){this.warn("Could not construct new URL with HLS Delivery Directives: "+E)}this.log("Attempt loading level index "+C+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+S+" "+v),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:v,level:C,id:S,deliveryDirectives:T||null})}},n.removeLevel=function(T,C){var R=function(E,h){return h!==C},S=this._levels.filter(function(v,E){return E!==T?!0:v.url.length>1&&C!==void 0?(v.url=v.url.filter(R),v.audioGroupIds&&(v.audioGroupIds=v.audioGroupIds.filter(R)),v.textGroupIds&&(v.textGroupIds=v.textGroupIds.filter(R)),v.urlId=0,!0):!1}).map(function(v,E){var h=v.details;return h!=null&&h.fragments&&h.fragments.forEach(function(p){p.level=E}),v});this._levels=S,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:S})},m(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var C,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===T&&(C=R[T])!==null&&C!==void 0&&C.details)return;if(T<0||T>=R.length){var S=T<0;if(this.hls.trigger(P.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:S,reason:"invalid level idx"}),S)return;T=Math.min(T,R.length-1)}this.clearTimer();var v=this.currentLevelIndex,E=R[v],h=R[T];this.log("switching to level "+T+" from "+v),this.currentLevelIndex=T;var p=b({},h,{level:T,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete p._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,p);var _=h.details;if(!_||_.live){var g=this.switchParams(h.uri,E==null?void 0:E.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),i}(r.default)},"./src/controller/level-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"addGroupId",function(){return I}),U.d(V,"assignTrackIdsByGroup",function(){return K}),U.d(V,"updatePTS",function(){return k}),U.d(V,"updateFragPTSDTS",function(){return M}),U.d(V,"mergeDetails",function(){return b}),U.d(V,"mapPartIntersection",function(){return f}),U.d(V,"mapFragmentIntersection",function(){return m}),U.d(V,"adjustSliding",function(){return l}),U.d(V,"addSliding",function(){return o}),U.d(V,"computeReloadInterval",function(){return a}),U.d(V,"getFragmentWithSN",function(){return c}),U.d(V,"getPartWith",function(){return s});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/logger.ts");function I(i,n,O){switch(n){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(O);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(O);break}}function K(i){var n={};i.forEach(function(O){var T=O.groupId||"";O.id=n[T]=n[T]||0,n[T]++})}function k(i,n,O){var T=i[n],C=i[O];r(T,C)}function r(i,n){var O=n.startPTS;if(Object(G.isFiniteNumber)(O)){var T=0,C;n.sn>i.sn?(T=O-i.start,C=i):(T=i.start-O,C=n),C.duration!==T&&(C.duration=T)}else if(n.sn>i.sn){var R=i.cc===n.cc;R&&i.minEndPTS?n.start=i.start+(i.minEndPTS-i.start):n.start=i.start+i.duration}else n.start=Math.max(i.start-n.duration,0)}function M(i,n,O,T,C,R){var S=T-O;S<=0&&(P.logger.warn("Fragment should have a positive duration",n),T=O+n.duration,R=C+n.duration);var v=O,E=T,h=n.startPTS,p=n.endPTS;if(Object(G.isFiniteNumber)(h)){var _=Math.abs(h-O);Object(G.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(_,n.deltaPTS):n.deltaPTS=_,v=Math.max(O,h),O=Math.min(O,h),C=Math.min(C,n.startDTS),E=Math.min(T,p),T=Math.max(T,p),R=Math.max(R,n.endDTS)}n.duration=T-O;var g=O-n.start;n.appendedPTS=T,n.start=n.startPTS=O,n.maxStartPTS=v,n.startDTS=C,n.endPTS=T,n.minEndPTS=E,n.endDTS=R;var w=n.sn;if(!i||w<i.startSN||w>i.endSN)return 0;var j,B=w-i.startSN,A=i.fragments;for(A[B]=n,j=B;j>0;j--)r(A[j],A[j-1]);for(j=B;j<A.length-1;j++)r(A[j],A[j+1]);return i.fragmentHint&&r(A[A.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,g}function b(i,n){for(var O=null,T=i.fragments,C=T.length-1;C>=0;C--){var R=T[C].initSegment;if(R){O=R;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var S=0,v;if(m(i,n,function(j,B){j.relurl&&(S=j.cc-B.cc),Object(G.isFiniteNumber)(j.startPTS)&&Object(G.isFiniteNumber)(j.endPTS)&&(B.start=B.startPTS=j.startPTS,B.startDTS=j.startDTS,B.appendedPTS=j.appendedPTS,B.maxStartPTS=j.maxStartPTS,B.endPTS=j.endPTS,B.endDTS=j.endDTS,B.minEndPTS=j.minEndPTS,B.duration=j.endPTS-j.startPTS,B.duration&&(v=B),n.PTSKnown=n.alignedSliding=!0),B.elementaryStreams=j.elementaryStreams,B.loader=j.loader,B.stats=j.stats,B.urlId=j.urlId,j.initSegment&&(B.initSegment=j.initSegment,O=j.initSegment)}),O){var E=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;E.forEach(function(j){var B;(!j.initSegment||j.initSegment.relurl===((B=O)===null||B===void 0?void 0:B.relurl))&&(j.initSegment=O)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(j){return!j}),n.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=n.skippedSegments;h--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var p=n.fragments;if(S){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<p.length;_++)p[_].cc+=S}n.skippedSegments&&(n.startCC=n.fragments[0].cc),f(i.partList,n.partList,function(j,B){B.elementaryStreams=j.elementaryStreams,B.stats=j.stats}),v?M(n,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):l(i,n),p.length&&(n.totalduration=n.edge-p[0].start),n.driftStartTime=i.driftStartTime,n.driftStart=i.driftStart;var g=n.advancedDateTime;if(n.advanced&&g){var w=n.edge;n.driftStart||(n.driftStartTime=g,n.driftStart=w),n.driftEndTime=g,n.driftEnd=w}else n.driftEndTime=i.driftEndTime,n.driftEnd=i.driftEnd,n.advancedDateTime=i.advancedDateTime}function f(i,n,O){if(i&&n)for(var T=0,C=0,R=i.length;C<=R;C++){var S=i[C],v=n[C+T];S&&v&&S.index===v.index&&S.fragment.sn===v.fragment.sn?O(S,v):T--}}function m(i,n,O){for(var T=n.skippedSegments,C=Math.max(i.startSN,n.startSN)-n.startSN,R=(i.fragmentHint?1:0)+(T?n.endSN:Math.min(i.endSN,n.endSN))-n.startSN,S=n.startSN-i.startSN,v=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,E=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,h=C;h<=R;h++){var p=E[S+h],_=v[h];T&&!_&&h<T&&(_=n.fragments[h]=p),p&&_&&O(p,_)}}function l(i,n){var O=n.startSN+n.skippedSegments-i.startSN,T=i.fragments;if(O<0||O>=T.length)return;o(n,T[O].start)}function o(i,n){if(n){for(var O=i.fragments,T=i.skippedSegments;T<O.length;T++)O[T].start+=n;i.fragmentHint&&(i.fragmentHint.start+=n)}}function a(i,n){var O=1e3*i.levelTargetDuration,T=O/2,C=i.age,R=C>0&&C<O*3,S=n.loading.end-n.loading.start,v,E=i.availabilityDelay;if(i.updated===!1)if(R){var h=333*i.misses;v=Math.max(Math.min(T,S*2),h),i.availabilityDelay=(i.availabilityDelay||0)+v}else v=T;else R?(E=Math.min(E||O/2,C),i.availabilityDelay=E,v=E+O-C):v=O-S;return Math.round(v)}function c(i,n,O){if(!i||!i.details)return null;var T=i.details,C=T.fragments[n-T.startSN];return C||(C=T.fragmentHint,C&&C.sn===n?C:n<T.startSN&&O&&O.sn===n?O:null)}function s(i,n,O){if(!i||!i.details)return null;var T=i.details.partList;if(T)for(var C=T.length;C--;){var R=T[C];if(R.index===O&&R.fragment.sn===n)return R}return null}},"./src/controller/stream-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return T});var G=U("./src/polyfills/number.ts"),P=U("./src/controller/base-stream-controller.ts"),I=U("./src/is-supported.ts"),K=U("./src/events.ts"),k=U("./src/utils/buffer-helper.ts"),r=U("./src/controller/fragment-tracker.ts"),M=U("./src/types/loader.ts"),b=U("./src/loader/fragment.ts"),f=U("./src/demux/transmuxer-interface.ts"),m=U("./src/types/transmuxer.ts"),l=U("./src/controller/gap-controller.ts"),o=U("./src/errors.ts"),a=U("./src/utils/logger.ts");function c(C,R){for(var S=0;S<R.length;S++){var v=R[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function s(C,R,S){return R&&c(C.prototype,R),S&&c(C,S),C}function i(C,R){C.prototype=Object.create(R.prototype),C.prototype.constructor=C,n(C,R)}function n(C,R){return n=Object.setPrototypeOf||function(v,E){return v.__proto__=E,v},n(C,R)}var O=100,T=function(C){i(R,C);function R(v,E){var h;return h=C.call(this,v,E,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var S=R.prototype;return S._registerListeners=function(){var E=this.hls;E.on(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),E.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.on(K.Events.ERROR,this.onError,this),E.on(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.on(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.on(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.on(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.on(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var E=this.hls;E.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(K.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),E.off(K.Events.ERROR,this.onError,this),E.off(K.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),E.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),E.off(K.Events.BUFFER_CREATED,this.onBufferCreated,this),E.off(K.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),E.off(K.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),E.off(K.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},S.startLoad=function(E){if(this.levels){var h=this.lastCurrentTime,p=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=p.startLevel;_===-1&&(p.config.testBandwidth?(_=0,this.bitrateTest=!0):_=p.nextAutoLevel),this.level=p.nextLoadLevel=_,this.loadedmetadata=!1}h>0&&E===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),E=h),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=E,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},S.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},S.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var E,h=this.levels,p=this.level,_=h==null||((E=h[p])===null||E===void 0)?void 0:E.details;if(_&&(!_.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(_))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var g,w=self.performance.now(),j=this.retryDate;(!j||w>=j||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},S.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},S.doTickIdle=function(){var E,h,p=this.hls,_=this.levelLastLoaded,g=this.levels,w=this.media,j=p.config,B=p.nextLoadLevel;if(_===null||!w&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[B])return;var A=g[B];this.level=p.nextLoadLevel=B;var H=A.details;if(!H||this.state===P.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==B){this.state=P.State.WAITING_LEVEL;return}var F=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,M.PlaylistLevelType.MAIN);if(F===null)return;var x=F.len,Y=this.getMaxBufferLength(A.maxBitrate);if(x>=Y)return;if(this._streamEnded(F,H)){var q={};this.altAudio&&(q.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,q),this.state=P.State.ENDED;return}var ie=F.end,me=this.getNextFragment(ie,H);if(this.couldBacktrack&&!this.fragPrevious&&me&&me.sn!=="initSegment"){var $e=me.sn-H.startSN;$e>1&&(me=H.fragments[$e-1],this.fragmentTracker.removeFragment(me))}if(me&&this.fragmentTracker.getState(me)===r.FragmentState.OK&&this.nextLoadPosition>ie){var xe=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,xe,M.PlaylistLevelType.MAIN),me=this.getNextFragment(this.nextLoadPosition,H)}if(!me)return;me.initSegment&&!me.initSegment.data&&!this.bitrateTest&&(me=me.initSegment),((E=me.decryptdata)===null||E===void 0?void 0:E.keyFormat)==="identity"&&!((h=me.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(me,H):this.loadFragment(me,H,ie)},S.loadFragment=function(E,h,p){var _,g=this.fragmentTracker.getState(E);if(this.fragCurrent=E,g===r.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(E);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else g=r.FragmentState.NOT_LOADED}g===r.FragmentState.NOT_LOADED||g===r.FragmentState.PARTIAL?E.sn==="initSegment"?this._loadInitSegment(E):this.bitrateTest?(E.bitrateTest=!0,this.log("Fragment "+E.sn+" of level "+E.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(E)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,E,h,p)):g===r.FragmentState.APPENDING?this.reduceMaxBufferLength(E.duration)&&this.fragmentTracker.removeFragment(E):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},S.getAppendedFrag=function(E){var h=this.fragmentTracker.getAppendedFrag(E,M.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},S.getBufferedFrag=function(E){return this.fragmentTracker.getBufferedFrag(E,M.PlaylistLevelType.MAIN)},S.followingBufferedFrag=function(E){return E?this.getBufferedFrag(E.end+.5):null},S.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},S.nextLevelSwitch=function(){var E=this.levels,h=this.media;if(h!=null&&h.readyState){var p,_=this.getAppendedFrag(h.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!h.paused&&E){var g=this.hls.nextLoadLevel,w=E[g],j=this.fragLastKbps;j&&this.fragCurrent?p=this.fragCurrent.duration*w.maxBitrate/(1e3*j)+1:p=0}else p=0;var B=this.getBufferedFrag(h.currentTime+p);if(B){var A=this.followingBufferedFrag(B);if(A){this.abortCurrentFrag();var H=A.maxStartPTS?A.maxStartPTS:A.start,F=A.duration,x=Math.max(B.end,H+Math.min(Math.max(F-this.config.maxFragLookUpTolerance,F*.5),F*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},S.abortCurrentFrag=function(){var E=this.fragCurrent;this.fragCurrent=null,E!=null&&E.loader&&E.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},S.flushMainBuffer=function(E,h){C.prototype.flushMainBuffer.call(this,E,h,this.altAudio?"video":null)},S.onMediaAttached=function(E,h){C.prototype.onMediaAttached.call(this,E,h);var p=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),p.addEventListener("playing",this.onvplaying),p.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,p,this.fragmentTracker,this.hls)},S.onMediaDetaching=function(){var E=this.media;E&&(E.removeEventListener("playing",this.onvplaying),E.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},S.onMediaPlaying=function(){this.tick()},S.onMediaSeeked=function(){var E=this.media,h=E?E.currentTime:null;Object(G.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},S.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},S.onManifestParsed=function(E,h){var p=!1,_=!1,g;h.levels.forEach(function(w){g=w.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(p=!0),g.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=p&&_&&!Object(I.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},S.onLevelLoading=function(E,h){var p=this.levels;if(!p||this.state!==P.State.IDLE)return;var _=p[h.level];(!_.details||_.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(_.details))&&(this.state=P.State.WAITING_LEVEL)},S.onLevelLoaded=function(E,h){var p,_=this.levels,g=h.level,w=h.details,j=w.totalduration;if(!_){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+j);var B=this.fragCurrent;B&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==h.level&&B.loader&&(this.state=P.State.IDLE,B.loader.abort()));var A=_[g],H=0;if(w.live||(p=A.details)!==null&&p!==void 0&&p.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;H=this.alignPlaylists(w,A.details)}if(A.details=w,this.levelLastLoaded=g,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:w,level:g}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=P.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,H),this.tick()},S._handleFragmentLoadProgress=function(E){var h,p=E.frag,_=E.part,g=E.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+p.sn+" of level "+p.level+" will not be buffered");return}var j=w[p.level],B=j.details;if(!B){this.warn("Dropping fragment "+p.sn+" of level "+p.level+" after level details were reset");return}var A=j.videoCodec,H=B.PTSKnown||!B.live,F=(h=p.initSegment)===null||h===void 0?void 0:h.data,x=this._getAudioCodec(j),Y=this.transmuxer=this.transmuxer||new f.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),q=_?_.index:-1,ie=q!==-1,me=new m.ChunkMetadata(p.level,p.sn,p.stats.chunkCount,g.byteLength,q,ie),$e=this.initPTS[p.cc];Y.push(g,F,x,A,p,_,B.totalduration,H,me,$e)},S.onAudioTrackSwitching=function(E,h){var p=this.altAudio,_=!!h.url,g=h.id;if(!_){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;p&&j.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:g})}},S.onAudioTrackSwitched=function(E,h){var p=h.id,_=!!this.hls.audioTracks[p].url;if(_){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=_,this.tick()},S.onBufferCreated=function(E,h){var p=h.tracks,_,g,w=!1;for(var j in p){var B=p[j];if(B.id==="main"){if(g=j,_=B,j==="video"){var A=p[j];A&&(this.videoBuffer=A.buffer)}}else w=!0}w&&_?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},S.onFragBuffered=function(E,h){var p=h.frag,_=h.part;if(p&&p.type!==M.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(p)){this.warn("Fragment "+p.sn+(_?" p: "+_.index:"")+" of level "+p.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var g=_?_.stats:p.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),p.sn!=="initSegment"&&(this.fragPrevious=p),this.fragBufferedComplete(p,_)},S.onError=function(E,h){switch(h.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,h);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=P.State.ERROR):!h.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var p=!0,_=this.getFwdBufferInfo(this.media,M.PlaylistLevelType.MAIN);_&&_.len>.5&&(p=!this.reduceMaxBufferLength(_.len)),p&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},S.checkBuffer=function(){var E=this.media,h=this.gapController;if(!E||!h||!E.readyState)return;var p=k.BufferHelper.getBuffered(E);!this.loadedmetadata&&p.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=E.currentTime},S.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},S.onBufferFlushed=function(E,h){var p=h.type;if(p!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(p===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,p,M.PlaylistLevelType.MAIN)}},S.onLevelsUpdated=function(E,h){this.levels=h.levels},S.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},S.seekToStartPos=function(){var E=this.media,h=E.currentTime,p=this.startPosition;if(p>=0&&h<p){if(E.seeking){a.logger.log("could not seek to "+p+", already seeking at "+h);return}var _=k.BufferHelper.getBuffered(E),g=_.length?_.start(0):0,w=g-p;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(a.logger.log("adjusting start position by "+w+" to match buffer start"),p+=w,this.startPosition=p),this.log("seek to target start position "+p+" from current time "+h),E.currentTime=p}},S._getAudioCodec=function(E){var h=this.config.defaultAudioCodec||E.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},S._loadBitrateTestFrag=function(E){var h=this;this._doFragLoad(E).then(function(p){var _=h.hls;if(!p||_.nextLoadLevel||h.fragContextChanged(E))return;h.fragLoadError=0,h.state=P.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var g=E.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),_.trigger(K.Events.FRAG_LOADED,p)})},S._handleTransmuxComplete=function(E){var h,p="main",_=this.hls,g=E.remuxResult,w=E.chunkMeta,j=this.getCurrentContext(w);if(!j){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var B=j.frag,A=j.part,H=j.level,F=g.video,x=g.text,Y=g.id3,q=g.initSegment,ie=this.altAudio?void 0:g.audio;if(this.fragContextChanged(B))return;if(this.state=P.State.PARSING,q){q.tracks&&(this._bufferInitSegment(H,q.tracks,B,w),_.trigger(K.Events.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:p,tracks:q.tracks}));var me=q.initPTS,$e=q.timescale;Object(G.isFiniteNumber)(me)&&(this.initPTS[B.cc]=me,_.trigger(K.Events.INIT_PTS_FOUND,{frag:B,id:p,initPTS:me,timescale:$e}))}if(F&&g.independent!==!1){if(H.details){var xe=F.startPTS,Ie=F.endPTS,Je=F.startDTS,Ye=F.endDTS;if(A)A.elementaryStreams[F.type]={startPTS:xe,endPTS:Ie,startDTS:Je,endDTS:Ye};else if(F.firstKeyFrame&&F.independent&&(this.couldBacktrack=!0),F.dropped&&F.independent){var ve=this.getLoadPosition()+this.config.maxBufferHole;if(ve<xe){this.backtrack(B);return}B.setElementaryStreamInfo(F.type,B.start,Ie,B.start,Ye,!0)}B.setElementaryStreamInfo(F.type,xe,Ie,Je,Ye),this.bufferFragmentData(F,B,A,w)}}else if(g.independent===!1){this.backtrack(B);return}if(ie){var fe=ie.startPTS,lt=ie.endPTS,qt=ie.startDTS,Ft=ie.endDTS;A&&(A.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:fe,endPTS:lt,startDTS:qt,endDTS:Ft}),B.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,fe,lt,qt,Ft),this.bufferFragmentData(ie,B,A,w)}if(Y!=null&&(h=Y.samples)!==null&&h!==void 0&&h.length){var Ot={frag:B,id:p,samples:Y.samples};_.trigger(K.Events.FRAG_PARSING_METADATA,Ot)}if(x){var Ve={frag:B,id:p,samples:x.samples};_.trigger(K.Events.FRAG_PARSING_USERDATA,Ve)}},S._bufferInitSegment=function(E,h,p,_){var g=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var w=h.audio,j=h.video,B=h.audiovideo;if(w){var A=E.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),w.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(A="mp4a.40.5")),H.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),E.audioCodec&&E.audioCodec!==A&&this.log('Swapping manifest audio codec "'+E.audioCodec+'" for "'+A+'"'),w.levelCodec=A,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(E.audioCodec||"")+"/"+w.codec+"]")}j&&(j.levelCodec=E.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(E.videoCodec||"")+"/"+j.codec+"]")),B&&this.log("Init audiovideo buffer, container:"+B.container+", codecs[level/parsed]=["+(E.attrs.CODECS||"")+"/"+B.codec+"]"),this.hls.trigger(K.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(F){var x=h[F],Y=x.initSegment;Y!=null&&Y.byteLength&&g.hls.trigger(K.Events.BUFFER_APPENDING,{type:F,data:Y,frag:p,part:null,chunkMeta:_,parent:p.type})}),this.tick()},S.backtrack=function(E){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(E);var h=this.fragmentTracker.backtrack(E);this.fragPrevious=null,this.nextLoadPosition=E.start,h?this.resetFragmentLoading(E):this.state=P.State.BACKTRACKING},S.checkFragmentChanged=function(){var E=this.media,h=null;if(E&&E.readyState>1&&E.seeking===!1){var p=E.currentTime;if(k.BufferHelper.isBuffered(E,p)?h=this.getAppendedFrag(p):k.BufferHelper.isBuffered(E,p+.1)&&(h=this.getAppendedFrag(p+.1)),h){var _=this.fragPlaying,g=h.level;(!_||h.sn!==_.sn||_.level!==g||h.urlId!==_.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:h}),(!_||_.level!==g)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=h)}}},s(R,[{key:"nextLevel",get:function(){var E=this.nextBufferedFrag;return E?E.level:-1}},{key:"currentLevel",get:function(){var E=this.media;if(E){var h=this.getAppendedFrag(E.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var E=this.media;if(E){var h=this.getAppendedFrag(E.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"SubtitleStreamController",function(){return i});var G=U("./src/events.ts"),P=U("./src/utils/logger.ts"),I=U("./src/utils/buffer-helper.ts"),K=U("./src/controller/fragment-finders.ts"),k=U("./src/utils/discontinuities.ts"),r=U("./src/controller/level-helper.ts"),M=U("./src/controller/fragment-tracker.ts"),b=U("./src/controller/base-stream-controller.ts"),f=U("./src/types/loader.ts"),m=U("./src/types/level.ts");function l(n,O){for(var T=0;T<O.length;T++){var C=O[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(n,C.key,C)}}function o(n,O,T){return O&&l(n.prototype,O),T&&l(n,T),n}function a(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,c(n,O)}function c(n,O){return c=Object.setPrototypeOf||function(C,R){return C.__proto__=R,C},c(n,O)}var s=500,i=function(n){a(O,n);function O(C,R){var S;return S=n.call(this,C,R,"[subtitle-stream-controller]")||this,S.levels=[],S.currentTrackId=-1,S.tracksBuffered=[],S.mainDetails=null,S._registerListeners(),S}var T=O.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var R=this.hls;R.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(G.Events.ERROR,this.onError,this),R.on(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var R=this.hls;R.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(G.Events.ERROR,this.onError,this),R.off(G.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(G.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(G.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(s),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(R,S){this.mainDetails=S.details},T.onSubtitleFragProcessed=function(R,S){var v=S.frag,E=S.success;if(this.fragPrevious=v,this.state=b.State.IDLE,!E)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var p,_=v.start,g=0;g<h.length;g++)if(_>=h[g].start&&_<=h[g].end){p=h[g];break}var w=v.start+v.duration;p?p.end=w:(p={start:_,end:w},h.push(p)),this.fragmentTracker.fragBuffered(v)},T.onBufferFlushing=function(R,S){var v=S.startOffset,E=S.endOffset;if(v===0&&E!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,p=this.levels;if(!p.length||!p[h]||!p[h].details)return;var _=p[h].details,g=_.targetduration,w=E-g;if(w<=0)return;S.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(j){for(var B=0;B<j.length;){if(j[B].end<=w){j.shift();continue}else if(j[B].start<w)j[B].start=w;else break;B++}}),this.fragmentTracker.removeFragmentsInRange(v,w,f.PlaylistLevelType.SUBTITLE)}},T.onError=function(R,S){var v,E=S.frag;if(!E||E.type!==f.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},T.onSubtitleTracksUpdated=function(R,S){var v=this,E=S.subtitleTracks;this.tracksBuffered=[],this.levels=E.map(function(h){return new m.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){v.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(R,S){if(this.currentTrackId=S.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var v=this.levels[this.currentTrackId];v!=null&&v.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,v&&this.setInterval(s)},T.onSubtitleTrackLoaded=function(R,S){var v,E=S.details,h=S.id,p=this.currentTrackId,_=this.levels;if(!_.length)return;var g=_[p];if(h>=_.length||h!==p||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,E.live||(v=g.details)!==null&&v!==void 0&&v.live){var w=this.mainDetails;if(E.deltaUpdateFailed||!w)return;var j=w.fragments[0];if(!g.details)E.hasProgramDateTime&&w.hasProgramDateTime?Object(k.alignMediaPlaylistByPDT)(E,w):j&&Object(r.addSliding)(E,j.start);else{var B=this.alignPlaylists(E,g.details);B===0&&j&&Object(r.addSliding)(E,j.start)}}if(g.details=E,this.levelLastLoaded=h,this.tick(),E.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var A=Object(K.findFragmentByPTS)(null,E.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},T._handleFragmentLoadComplete=function(R){var S=R.frag,v=R.payload,E=S.decryptdata,h=this.hls;if(this.fragContextChanged(S))return;if(v&&v.byteLength>0&&E&&E.key&&E.iv&&E.method==="AES-128"){var p=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),E.key.buffer,E.iv.buffer).then(function(_){var g=performance.now();h.trigger(G.Events.FRAG_DECRYPTED,{frag:S,payload:_,stats:{tstart:p,tdecrypt:g}})})}},T.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var R,S=this.currentTrackId,v=this.levels;if(!v.length||!v[S]||!v[S].details)return;var E=v[S].details,h=E.targetduration,p=this.config,_=this.media,g=I.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-h,p.maxBufferHole),w=g.end,j=g.len,B=this.getMaxBufferLength()+h;if(j>B)return;console.assert(E,"Subtitle track details are defined on idle subtitle stream controller tick");var A=E.fragments,H=A.length,F=E.edge,x,Y=this.fragPrevious;if(w<F){var q=p.maxFragLookUpTolerance;Y&&E.hasProgramDateTime&&(x=Object(K.findFragmentByPDT)(A,Y.endProgramDateTime,q)),x||(x=Object(K.findFragmentByPTS)(Y,A,w,q),!x&&Y&&Y.start<A[0].start&&(x=A[0]))}else x=A[H-1];(R=x)!==null&&R!==void 0&&R.encrypted?(P.logger.log("Loading key for "+x.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:x})):x&&this.fragmentTracker.getState(x)===M.FragmentState.NOT_LOADED&&this.loadFragment(x,E,w)}},T.loadFragment=function(R,S,v){this.fragCurrent=R,n.prototype.loadFragment.call(this,R,S,v)},o(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(b.default)},"./src/controller/subtitle-track-controller.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/events.ts"),P=U("./src/utils/texttrack-utils.ts"),I=U("./src/controller/base-playlist-controller.ts"),K=U("./src/types/loader.ts");function k(l,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}function r(l,o,a){return o&&k(l.prototype,o),a&&k(l,a),l}function M(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,b(l,o)}function b(l,o){return b=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},b(l,o)}var f=function(l){M(o,l);function o(c){var s;return s=l.call(this,c,"[subtitle-track-controller]")||this,s.media=null,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.selectDefaultTrack=!0,s.queuedDefaultTrack=-1,s.trackChangeListener=function(){return s.onTextTracksChanged()},s.asyncPollTrackChange=function(){return s.pollTrackChange(0)},s.useTextTrackPolling=!1,s.subtitlePollingInterval=-1,s.subtitleDisplay=!0,s.registerListeners(),s}var a=o.prototype;return a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},a.registerListeners=function(){var s=this.hls;s.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.on(G.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),s.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(G.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(G.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(G.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),s.off(G.Events.ERROR,this.onError,this)},a.onMediaAttached=function(s,i){if(this.media=i.media,!this.media)return;this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange)},a.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},a.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=m(this.media.textTracks);s.forEach(function(i){Object(P.clearCurrentCues)(i)}),this.subtitleTrack=-1,this.media=null},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},a.onManifestParsed=function(s,i){this.tracks=i.subtitleTracks},a.onSubtitleTrackLoaded=function(s,i){var n=i.id,O=i.details,T=this.trackId,C=this.tracksInGroup[T];if(!C){this.warn("Invalid subtitle track id "+n);return}var R=C.details;C.details=i.details,this.log("subtitle track "+n+" loaded ["+O.startSN+"-"+O.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,i,R))},a.onLevelLoading=function(s,i){this.switchLevel(i.level)},a.onLevelSwitching=function(s,i){this.switchLevel(i.level)},a.switchLevel=function(s){var i=this.hls.levels[s];if(!(i!=null&&i.textGroupIds))return;var n=i.textGroupIds[i.urlId];if(this.groupId!==n){var O=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(S){return!n||S.groupId===n});this.tracksInGroup=T;var C=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=n;var R={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,R),C!==-1&&this.setSubtitleTrack(C,O)}},a.findTrackId=function(s){for(var i=this.tracksInGroup,n=0;n<i.length;n++){var O=i[n];if((!this.selectDefaultTrack||O.default)&&(!s||s===O.name))return O.id}return-1},a.onError=function(s,i){if(l.prototype.onError.call(this,s,i),i.fatal||!i.context)return;i.context.type===K.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},a.loadPlaylist=function(s){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var n=i.id,O=i.groupId,T=i.url;if(s)try{T=s.addDirectives(T)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("Loading subtitle playlist for id "+n),this.hls.trigger(G.Events.SUBTITLE_TRACK_LOADING,{url:T,id:n,groupId:O,deliveryDirectives:s||null})}},a.toggleTrackModes=function(s){var i=this,n=this.media,O=this.subtitleDisplay,T=this.trackId;if(!n)return;var C=m(n.textTracks),R=C.filter(function(E){return E.groupId===i.groupId});if(s===-1)[].slice.call(C).forEach(function(E){E.mode="disabled"});else{var S=R[T];S&&(S.mode="disabled")}var v=R[s];v&&(v.mode=O?"showing":"hidden")},a.setSubtitleTrack=function(s,i){var n,O=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=s;return}if(this.trackId!==s&&this.toggleTrackModes(s),this.trackId===s&&(s===-1||(n=O[s])!==null&&n!==void 0&&n.details)||s<-1||s>=O.length)return;this.clearTimer();var T=O[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,T){var C=T.id,R=T.groupId,S=R===void 0?"":R,v=T.name,E=T.type,h=T.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:S,name:v,type:E,url:h});var p=this.switchParams(T.url,i==null?void 0:i.details);this.loadPlaylist(p)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:s})},a.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var s=-1,i=m(this.media.textTracks),n=0;n<i.length;n++)if(i[n].mode==="hidden")s=n;else if(i[n].mode==="showing"){s=n;break}this.subtitleTrack!==s&&(this.subtitleTrack=s)},r(o,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(s,i)}}]),o}(I.default);function m(l){for(var o=[],a=0;a<l.length;a++){var c=l[a];c.kind==="subtitles"&&c.label&&o.push(l[a])}return o}V.default=f},"./src/controller/timeline-controller.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"TimelineController",function(){return m});var G=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),I=U("./src/utils/cea-608-parser.ts"),K=U("./src/utils/output-filter.ts"),k=U("./src/utils/webvtt-parser.ts"),r=U("./src/utils/texttrack-utils.ts"),M=U("./src/utils/imsc1-ttml-parser.ts"),b=U("./src/types/loader.ts"),f=U("./src/utils/logger.ts"),m=function(){function c(i){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=a(),this.captionsProperties=void 0,this.hls=i,this.config=i.config,this.Cues=i.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var n=new K.default(this,"textTrack1"),O=new K.default(this,"textTrack2"),T=new K.default(this,"textTrack3"),C=new K.default(this,"textTrack4");this.cea608Parser1=new I.default(1,n,O),this.cea608Parser2=new I.default(3,T,C)}i.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(P.Events.FRAG_LOADING,this.onFragLoading,this),i.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var s=c.prototype;return s.destroy=function(){var n=this.hls;n.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),n.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),n.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),n.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),n.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),n.off(P.Events.FRAG_LOADING,this.onFragLoading,this),n.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),n.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),n.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),n.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),n.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),n.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},s.addCues=function(n,O,T,C,R){for(var S=!1,v=R.length;v--;){var E=R[v],h=o(E[0],E[1],O,T);if(h>=0&&(E[0]=Math.min(E[0],O),E[1]=Math.max(E[1],T),S=!0,h/(T-O)>.5))return}if(S||R.push([O,T]),this.config.renderTextTracksNatively){var p=this.captionsTracks[n];this.Cues.newCue(p,O,T,C)}else{var _=this.Cues.newCue(null,O,T,C);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:_,track:n})}},s.onInitPtsFound=function(n,O){var T=this,C=O.frag,R=O.id,S=O.initPTS,v=O.timescale,E=this.unparsedVttFrags;R==="main"&&(this.initPTS[C.cc]=S,this.timescale[C.cc]=v),E.length&&(this.unparsedVttFrags=[],E.forEach(function(h){T.onFragLoaded(P.Events.FRAG_LOADED,h)}))},s.getExistingTrack=function(n){var O=this.media;if(O)for(var T=0;T<O.textTracks.length;T++){var C=O.textTracks[T];if(C[n])return C}return null},s.createCaptionsTrack=function(n){this.config.renderTextTracksNatively?this.createNativeTrack(n):this.createNonNativeTrack(n)},s.createNativeTrack=function(n){if(this.captionsTracks[n])return;var O=this.captionsProperties,T=this.captionsTracks,C=this.media,R=O[n],S=R.label,v=R.languageCode,E=this.getExistingTrack(n);if(E)T[n]=E,Object(r.clearCurrentCues)(T[n]),Object(r.sendAddTrackEvent)(T[n],C);else{var h=this.createTextTrack("captions",S,v);h&&(h[n]=!0,T[n]=h)}},s.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var O=this.captionsProperties[n];if(!O)return;var T=O.label,C={_id:n,label:T,kind:"captions",default:O.media?!!O.media.default:!1,closedCaptions:O.media};this.nonNativeCaptionsTracks[n]=C,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})},s.createTextTrack=function(n,O,T){var C=this.media;return C?C.addTextTrack(n,O,T):void 0},s.onMediaAttaching=function(n,O){this.media=O.media,this._cleanTracks()},s.onMediaDetaching=function(){var n=this.captionsTracks;Object.keys(n).forEach(function(O){Object(r.clearCurrentCues)(n[O]),delete n[O]}),this.nonNativeCaptionsTracks={}},s.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=a(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},s._cleanTracks=function(){var n=this.media;if(!n)return;var O=n.textTracks;if(O)for(var T=0;T<O.length;T++)Object(r.clearCurrentCues)(O[T])},s.onSubtitleTracksUpdated=function(n,O){var T=this;this.textTracks=[];var C=O.subtitleTracks||[],R=C.some(function(h){return h.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var S=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var v=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,p){var _;if(p<v.length){for(var g=null,w=0;w<v.length;w++)if(l(v[w],h)){g=v[w];break}g&&(_=g)}_?Object(r.clearCurrentCues)(_):(_=T.createTextTrack("subtitles",h.name,h.lang),_&&(_.mode="disabled")),_&&(_.groupId=h.groupId,T.textTracks.push(_))})}else if(!S&&this.tracks&&this.tracks.length){var E=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:E})}}},s.onManifestLoaded=function(n,O){var T=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(C){var R=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!R)return;var S="textTrack"+R[1],v=T.captionsProperties[S];if(!v)return;v.label=C.name,C.lang&&(v.languageCode=C.lang),v.media=C})},s.onFragLoading=function(n,O){var T=this.cea608Parser1,C=this.cea608Parser2,R=this.lastSn,S=this.lastPartIndex;if(!this.enabled||!(T&&C))return;if(O.frag.type===b.PlaylistLevelType.MAIN){var v,E,h=O.frag.sn,p=(v=O==null||((E=O.part)===null||E===void 0)?void 0:E.index)!=null?v:-1;h===R+1||h===R&&p===S+1||(T.reset(),C.reset()),this.lastSn=h,this.lastPartIndex=p}},s.onFragLoaded=function(n,O){var T=O.frag,C=O.payload,R=this.initPTS,S=this.unparsedVttFrags;if(T.type===b.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object(G.isFiniteNumber)(R[T.cc])){S.push(O),R.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var v=T.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var E=this.tracks[T.level],h=this.vttCCs;h[T.cc]||(h[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),E&&E.textCodec===M.IMSC1_CODEC?this._parseIMSC1(T,C):this._parseVTTs(T,C,h)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(n,O){var T=this,C=this.hls;Object(M.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(R){T._appendCues(R,n.level),C.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(R){f.logger.log("Failed to parse IMSC1: "+R),C.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:R})})},s._parseVTTs=function(n,O,T){var C=this,R=this.hls;Object(k.parseWebVTT)(O,this.initPTS[n.cc],this.timescale[n.cc],T,n.cc,n.start,function(S){C._appendCues(S,n.level),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(S){C._fallbackToIMSC1(n,O),f.logger.log("Failed to parse VTT cue: "+S),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:S})})},s._fallbackToIMSC1=function(n,O){var T=this,C=this.tracks[n.level];C.textCodec||Object(M.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(){C.textCodec=M.IMSC1_CODEC,T._parseIMSC1(n,O)},function(){C.textCodec="wvtt"})},s._appendCues=function(n,O){var T=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[O];if(C.mode==="disabled")return;n.forEach(function(v){return Object(r.addCueToTrack)(C,v)})}else{var R=this.tracks[O],S=R.default?"default":"subtitles"+O;T.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:n,track:S})}},s.onFragDecrypted=function(n,O){var T=O.frag;if(T.type===b.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(O);return}this.onFragLoaded(P.Events.FRAG_LOADED,O)}},s.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},s.onFragParsingUserdata=function(n,O){var T=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(T&&C))return;for(var R=0;R<O.samples.length;R++){var S=O.samples[R].bytes;if(S){var v=this.extractCea608Data(S);T.addData(O.samples[R].pts,v[0]),C.addData(O.samples[R].pts,v[1])}}},s.onBufferFlushing=function(n,O){var T=O.startOffset,C=O.endOffset,R=O.endOffsetSubtitles,S=O.type,v=this.media;if(!v||v.currentTime<C)return;if(!S||S==="video"){var E=this.captionsTracks;Object.keys(E).forEach(function(p){return Object(r.removeCuesInRange)(E[p],T,C)})}if(this.config.renderTextTracksNatively&&(T===0&&R!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(p){return Object(r.removeCuesInRange)(h[p],T,R)})}},s.extractCea608Data=function(n){for(var O=n[0]&31,T=2,C=[[],[]],R=0;R<O;R++){var S=n[T++],v=127&n[T++],E=127&n[T++],h=(4&S)!==0,p=3&S;if(v===0&&E===0)continue;h&&((p===0||p===1)&&(C[p].push(v),C[p].push(E)))}return C},c}();function l(c,s){return c&&c.label===s.name&&!(c.textTrack1||c.textTrack2)}function o(c,s,i,n){return Math.min(s,n)-Math.max(c,i)}function a(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(K,k){this.subtle=void 0,this.aesIV=void 0,this.subtle=K,this.aesIV=k}var I=P.prototype;return I.decrypt=function(k,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,k)},P}()},"./src/crypt/aes-decryptor.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"removePadding",function(){return P}),U.d(V,"default",function(){return I});var G=U("./src/utils/typed-array.ts");function P(K){var k=K.byteLength,r=k&&new DataView(K.buffer).getUint8(k-1);return r?Object(G.sliceUint8)(K,0,k-r):K}var I=function(){function K(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var k=K.prototype;return k.uint8ArrayToUint32Array_=function(M){for(var b=new DataView(M),f=new Uint32Array(4),m=0;m<4;m++)f[m]=b.getUint32(m*4);return f},k.initTable=function(){var M=this.sBox,b=this.invSBox,f=this.subMix,m=f[0],l=f[1],o=f[2],a=f[3],c=this.invSubMix,s=c[0],i=c[1],n=c[2],O=c[3],T=new Uint32Array(256),C=0,R=0,S=0;for(S=0;S<256;S++)S<128?T[S]=S<<1:T[S]=S<<1^283;for(S=0;S<256;S++){var v=R^R<<1^R<<2^R<<3^R<<4;v=v>>>8^v&255^99,M[C]=v,b[v]=C;var E=T[C],h=T[E],p=T[h],_=T[v]*257^v*16843008;m[C]=_<<24|_>>>8,l[C]=_<<16|_>>>16,o[C]=_<<8|_>>>24,a[C]=_,_=p*16843009^h*65537^E*257^C*16843008,s[v]=_<<24|_>>>8,i[v]=_<<16|_>>>16,n[v]=_<<8|_>>>24,O[v]=_,C?(C=E^T[T[T[p^E]]],R^=T[T[R]]):C=R=1}},k.expandKey=function(M){for(var b=this.uint8ArrayToUint32Array_(M),f=!0,m=0;m<b.length&&f;)f=b[m]===this.key[m],m++;if(f)return;this.key=b;var l=this.keySize=b.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var o=this.ksRows=(l+6+1)*4,a,c,s=this.keySchedule=new Uint32Array(o),i=this.invKeySchedule=new Uint32Array(o),n=this.sBox,O=this.rcon,T=this.invSubMix,C=T[0],R=T[1],S=T[2],v=T[3],E,h;for(a=0;a<o;a++){if(a<l){E=s[a]=b[a];continue}h=E,a%l===0?(h=h<<8|h>>>24,h=n[h>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[h&255],h^=O[a/l|0]<<24):l>6&&a%l===4&&(h=n[h>>>24]<<24|n[h>>>16&255]<<16|n[h>>>8&255]<<8|n[h&255]),s[a]=E=(s[a-l]^h)>>>0}for(c=0;c<o;c++)a=o-c,c&3?h=s[a]:h=s[a-4],c<4||a<=4?i[c]=h:i[c]=C[n[h>>>24]]^R[n[h>>>16&255]]^S[n[h>>>8&255]]^v[n[h&255]],i[c]=i[c]>>>0},k.networkToHostOrderSwap=function(M){return M<<24|(M&65280)<<8|(M&16711680)>>8|M>>>24},k.decrypt=function(M,b,f){for(var m=this.keySize+6,l=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,c=a[0],s=a[1],i=a[2],n=a[3],O=this.uint8ArrayToUint32Array_(f),T=O[0],C=O[1],R=O[2],S=O[3],v=new Int32Array(M),E=new Int32Array(v.length),h,p,_,g,w,j,B,A,H,F,x,Y,q,ie,me=this.networkToHostOrderSwap;b<v.length;){for(H=me(v[b]),F=me(v[b+1]),x=me(v[b+2]),Y=me(v[b+3]),w=H^l[0],j=Y^l[1],B=x^l[2],A=F^l[3],q=4,ie=1;ie<m;ie++)h=c[w>>>24]^s[j>>16&255]^i[B>>8&255]^n[A&255]^l[q],p=c[j>>>24]^s[B>>16&255]^i[A>>8&255]^n[w&255]^l[q+1],_=c[B>>>24]^s[A>>16&255]^i[w>>8&255]^n[j&255]^l[q+2],g=c[A>>>24]^s[w>>16&255]^i[j>>8&255]^n[B&255]^l[q+3],w=h,j=p,B=_,A=g,q=q+4;h=o[w>>>24]<<24^o[j>>16&255]<<16^o[B>>8&255]<<8^o[A&255]^l[q],p=o[j>>>24]<<24^o[B>>16&255]<<16^o[A>>8&255]<<8^o[w&255]^l[q+1],_=o[B>>>24]<<24^o[A>>16&255]<<16^o[w>>8&255]<<8^o[j&255]^l[q+2],g=o[A>>>24]<<24^o[w>>16&255]<<16^o[j>>8&255]<<8^o[B&255]^l[q+3],E[b]=me(h^T),E[b+1]=me(g^C),E[b+2]=me(_^R),E[b+3]=me(p^S),T=H,C=F,R=x,S=Y,b=b+4}return E.buffer},K}()},"./src/crypt/decrypter.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return b});var G=U("./src/crypt/aes-crypto.ts"),P=U("./src/crypt/fast-aes-key.ts"),I=U("./src/crypt/aes-decryptor.ts"),K=U("./src/utils/logger.ts"),k=U("./src/utils/mp4-tools.ts"),r=U("./src/utils/typed-array.ts"),M=16,b=function(){function f(l,o,a){var c=a===void 0?{}:a,s=c.removePKCS7Padding,i=s===void 0?!0:s;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=l,this.config=o,this.removePKCS7Padding=i,i)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(O){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var m=f.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var o=this.currentResult;if(!o){this.reset();return}var a=new Uint8Array(o);return this.reset(),this.removePKCS7Padding?Object(I.removePadding)(a):a},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(o,a,c,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(o),a,c);var i=this.flush();i&&s(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(o),a,c).then(s)},m.softwareDecrypt=function(o,a,c){var s=this.currentIV,i=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(o=Object(k.appendUint8Array)(n,o),this.remainderData=null);var O=this.getValidChunk(o);if(!O.length)return null;s&&(c=s);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new I.default),T.expandKey(a);var C=i;return this.currentResult=T.decrypt(O.buffer,0,c),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,C||null},m.webCryptoDecrypt=function(o,a,c){var s=this,i=this.subtle;return(this.key!==a||!this.fastAesKey)&&(this.key=a,this.fastAesKey=new P.default(i,a)),this.fastAesKey.expandKey().then(function(n){if(!i)return Promise.reject(new Error("web crypto not initialized"));var O=new G.default(i,c);return O.decrypt(o.buffer,n)}).catch(function(n){return s.onWebCryptoError(n,o,a,c)})},m.onWebCryptoError=function(o,a,c,s){return K.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",o),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(a,c,s)},m.getValidChunk=function(o){var a=o,c=o.length-o.length%M;return c!==o.length&&(a=Object(r.sliceUint8)(o,0,c),this.remainderData=Object(r.sliceUint8)(o,c)),a},m.logOnce=function(o){if(!this.logEnabled)return;K.logger.log("[decrypter.ts]: "+o),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(K,k){this.subtle=void 0,this.key=void 0,this.subtle=K,this.key=k}var I=P.prototype;return I.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/demux/base-audio-demuxer.ts"),P=U("./src/demux/adts.ts"),I=U("./src/utils/logger.ts"),K=U("./src/demux/id3.ts");function k(b,f){b.prototype=Object.create(f.prototype),b.prototype.constructor=b,r(b,f)}function r(b,f){return r=Object.setPrototypeOf||function(l,o){return l.__proto__=o,l},r(b,f)}var M=function(b){k(f,b);function f(l,o){var a;return a=b.call(this)||this,a.observer=void 0,a.config=void 0,a.observer=l,a.config=o,a}var m=f.prototype;return m.resetInitSegment=function(o,a,c){b.prototype.resetInitSegment.call(this,o,a,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:o,duration:c,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var a=K.getID3Data(o,0)||[],c=a.length,s=o.length;c<s;c++)if(P.probe(o,c))return I.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(o,a){return P.canParse(o,a)},m.appendFrame=function(o,a,c){P.initTrackConfig(o,this.observer,a,c,o.manifestCodec);var s=P.appendFrame(o,a,c,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},f}(G.default);M.minProbeByteLength=9,V.default=M},"./src/demux/adts.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"getAudioConfig",function(){return K}),U.d(V,"isHeaderPattern",function(){return k}),U.d(V,"getHeaderLength",function(){return r}),U.d(V,"getFullFrameLength",function(){return M}),U.d(V,"canGetFrameLength",function(){return b}),U.d(V,"isHeader",function(){return f}),U.d(V,"canParse",function(){return m}),U.d(V,"probe",function(){return l}),U.d(V,"initTrackConfig",function(){return o}),U.d(V,"getFrameDuration",function(){return a}),U.d(V,"parseFrameHeader",function(){return c}),U.d(V,"appendFrame",function(){return s});var G=U("./src/utils/logger.ts"),P=U("./src/errors.ts"),I=U("./src/events.ts");function K(i,n,O,T){var C,R,S,v,E=navigator.userAgent.toLowerCase(),h=T,p=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];C=((n[O+2]&192)>>>6)+1;var _=(n[O+2]&60)>>>2;if(_>p.length-1){i.trigger(I.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return S=(n[O+2]&1)<<2,S|=(n[O+3]&192)>>>6,G.logger.log("manifest codec:"+T+", ADTS type:"+C+", samplingIndex:"+_),/firefox/i.test(E)?_>=6?(C=5,v=new Array(4),R=_-3):(C=2,v=new Array(2),R=_):E.indexOf("android")!==-1?(C=2,v=new Array(2),R=_):(C=5,v=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&_>=6?R=_-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(_>=6&&S===1||/vivaldi/i.test(E))||!T&&S===1)&&(C=2,v=new Array(2)),R=_)),v[0]=C<<3,v[0]|=(_&14)>>1,v[1]|=(_&1)<<7,v[1]|=S<<3,C===5&&(v[1]|=(R&14)>>1,v[2]=(R&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:p[_],channelCount:S,codec:"mp4a.40."+C,manifestCodec:h}}function k(i,n){return i[n]===255&&(i[n+1]&246)===240}function r(i,n){return i[n+1]&1?7:9}function M(i,n){return(i[n+3]&3)<<11|i[n+4]<<3|(i[n+5]&224)>>>5}function b(i,n){return n+5<i.length}function f(i,n){return n+1<i.length&&k(i,n)}function m(i,n){return b(i,n)&&k(i,n)&&M(i,n)<=i.length-n}function l(i,n){if(f(i,n)){var O=r(i,n);if(n+O>=i.length)return!1;var T=M(i,n);if(T<=O)return!1;var C=n+T;return C===i.length||f(i,C)}return!1}function o(i,n,O,T,C){if(!i.samplerate){var R=K(n,O,T,C);if(!R)return;i.config=R.config,i.samplerate=R.samplerate,i.channelCount=R.channelCount,i.codec=R.codec,i.manifestCodec=R.manifestCodec,G.logger.log("parsed codec:"+i.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function a(i){return 1024*9e4/i}function c(i,n,O,T,C){var R=r(i,n),S=M(i,n);if(S-=R,S>0){var v=O+T*C;return{headerLength:R,frameLength:S,stamp:v}}}function s(i,n,O,T,C){var R=a(i.samplerate),S=c(n,O,T,C,R);if(S){var v=S.frameLength,E=S.headerLength,h=S.stamp,p=E+v,_=Math.max(0,O+p-n.length),g;_?(g=new Uint8Array(p-E),g.set(n.subarray(O+E,n.length),0)):g=n.subarray(O+E,O+p);var w={unit:g,pts:h};return _||i.samples.push(w),{sample:w,length:p,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"initPTSFn",function(){return M});var G=U("./src/polyfills/number.ts"),P=U("./src/demux/id3.ts"),I=U("./src/demux/dummy-demuxed-track.ts"),K=U("./src/utils/mp4-tools.ts"),k=U("./src/utils/typed-array.ts"),r=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=b.prototype;return f.resetInitSegment=function(l,o,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(l,o){return!1},f.appendFrame=function(l,o,a){},f.demux=function(l,o){this.cachedData&&(l=Object(K.appendUint8Array)(this.cachedData,l),this.cachedData=null);var a=P.getID3Data(l,0),c=a?a.length:0,s,i,n=this._audioTrack,O=this._id3Track,T=a?P.getTimeStamp(a):void 0,C=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(T,o)),a&&a.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:a}),i=this.initPTS;c<C;){if(this.canParse(l,c)){var R=this.appendFrame(n,l,c);R?(this.frameIndex++,i=R.sample.pts,c+=R.length,s=c):c=C}else P.canParse(l,c)?(a=P.getID3Data(l,c),O.samples.push({pts:i,dts:i,data:a}),c+=a.length,s=c):c++;if(c===C&&s!==C){var S=Object(k.sliceUint8)(l,s);this.cachedData?this.cachedData=Object(K.appendUint8Array)(this.cachedData,S):this.cachedData=S}}return{audioTrack:n,avcTrack:Object(I.dummyTrack)(),id3Track:O,textTrack:Object(I.dummyTrack)()}},f.demuxSampleAes=function(l,o,a){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(l){var o=this.cachedData;return o&&(this.cachedData=null,this.demux(o,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(I.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(I.dummyTrack)()}},f.destroy=function(){},b}(),M=function(f,m){return Object(G.isFiniteNumber)(f)?f*90:m*9e4};V.default=r},"./src/demux/chunk-cache.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function I(){this.chunks=[],this.dataLength=0}var K=I.prototype;return K.push=function(r){this.chunks.push(r),this.dataLength+=r.length},K.flush=function(){var r=this.chunks,M=this.dataLength,b;if(r.length)r.length===1?b=r[0]:b=P(r,M);else return new Uint8Array(0);return this.reset(),b},K.reset=function(){this.chunks.length=0,this.dataLength=0},I}();function P(I,K){for(var k=new Uint8Array(K),r=0,M=0;M<I.length;M++){var b=I[M];k.set(b,r),r+=b.length}return k}},"./src/demux/dummy-demuxed-track.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"dummyTrack",function(){return G});function G(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/logger.ts"),P=function(){function I(k){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=k,this.bytesAvailable=k.byteLength,this.word=0,this.bitsAvailable=0}var K=I.prototype;return K.loadWord=function(){var r=this.data,M=this.bytesAvailable,b=r.byteLength-M,f=new Uint8Array(4),m=Math.min(4,M);if(m===0)throw new Error("no bytes available");f.set(r.subarray(b,b+m)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},K.skipBits=function(r){var M;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,M=r>>3,r-=M>>3,this.bytesAvailable-=M,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},K.readBits=function(r){var M=Math.min(this.bitsAvailable,r),b=this.word>>>32-M;return r>32&&G.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=M,this.bitsAvailable>0?this.word<<=M:this.bytesAvailable>0&&this.loadWord(),M=r-M,M>0&&this.bitsAvailable?b<<M|this.readBits(M):b},K.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},K.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(r){for(var M=8,b=8,f,m=0;m<r;m++)b!==0&&(f=this.readEG(),b=(M+f+256)%256),M=b===0?M:b},K.readSPS=function(){var r=0,M=0,b=0,f=0,m,l,o,a=this.readUByte.bind(this),c=this.readBits.bind(this),s=this.readUEG.bind(this),i=this.readBoolean.bind(this),n=this.skipBits.bind(this),O=this.skipEG.bind(this),T=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);a();var R=a();if(c(5),n(3),a(),T(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var S=s();if(S===3&&n(1),T(),T(),n(1),i())for(l=S!==3?8:12,o=0;o<l;o++)i()&&(o<6?C(16):C(64))}T();var v=s();if(v===0)s();else if(v===1)for(n(1),O(),O(),m=s(),o=0;o<m;o++)O();T(),n(1);var E=s(),h=s(),p=c(1);p===0&&n(1),n(1),i()&&(r=s(),M=s(),b=s(),f=s());var _=[1,1];if(i()&&i()){var g=a();switch(g){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[a()<<8|a(),a()<<8|a()];break}}}return{width:Math.ceil((E+1)*16-r*2-M*2),height:(2-p)*(h+1)*16-(p?2:4)*(b+f),pixelRatio:_}},K.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},I}();V.default=P},"./src/demux/id3.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isHeader",function(){return G}),U.d(V,"isFooter",function(){return P}),U.d(V,"getID3Data",function(){return I}),U.d(V,"canParse",function(){return k}),U.d(V,"getTimeStamp",function(){return r}),U.d(V,"isTimeStampFrame",function(){return M}),U.d(V,"getID3Frames",function(){return f}),U.d(V,"decodeFrame",function(){return m}),U.d(V,"utf8ArrayToStr",function(){return s}),U.d(V,"testables",function(){return i});var G=function(C,R){return R+10<=C.length&&(C[R]===73&&C[R+1]===68&&C[R+2]===51&&(C[R+3]<255&&C[R+4]<255&&(C[R+6]<128&&C[R+7]<128&&C[R+8]<128&&C[R+9]<128)))},P=function(C,R){return R+10<=C.length&&(C[R]===51&&C[R+1]===68&&C[R+2]===73&&(C[R+3]<255&&C[R+4]<255&&(C[R+6]<128&&C[R+7]<128&&C[R+8]<128&&C[R+9]<128)))},I=function(C,R){for(var S=R,v=0;G(C,R);){v+=10;var E=K(C,R+6);v+=E,P(C,R+10)&&(v+=10),R+=v}return v>0?C.subarray(S,S+v):void 0},K=function(C,R){var S=0;return S=(C[R]&127)<<21,S|=(C[R+1]&127)<<14,S|=(C[R+2]&127)<<7,S|=C[R+3]&127,S},k=function(C,R){return G(C,R)&&K(C,R+6)+10<=C.length-R},r=function(C){for(var R=f(C),S=0;S<R.length;S++){var v=R[S];if(M(v))return c(v)}return},M=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},b=function(C){var R=String.fromCharCode(C[0],C[1],C[2],C[3]),S=K(C,4),v=10;return{type:R,size:S,data:C.subarray(v,v+S)}},f=function(C){for(var R=0,S=[];G(C,R);){var v=K(C,R+6);R+=10;for(var E=R+v;R+8<E;){var h=b(C.subarray(R)),p=m(h);p&&S.push(p),R+=h.size+10}P(C,R)&&(R+=10)}return S},m=function(C){return C.type==="PRIV"?l(C):C.type[0]==="W"?a(C):o(C)},l=function(C){if(C.size<2)return;var R=s(C.data,!0),S=new Uint8Array(C.data.subarray(R.length+1));return{key:C.type,info:R,data:S.buffer}},o=function(C){if(C.size<2)return;if(C.type==="TXXX"){var R=1,S=s(C.data.subarray(R),!0);R+=S.length+1;var v=s(C.data.subarray(R));return{key:C.type,info:S,data:v}}var E=s(C.data.subarray(1));return{key:C.type,data:E}},a=function(C){if(C.type==="WXXX"){if(C.size<2)return;var R=1,S=s(C.data.subarray(R),!0);R+=S.length+1;var v=s(C.data.subarray(R));return{key:C.type,info:S,data:v}}var E=s(C.data);return{key:C.type,data:E}},c=function(C){if(C.data.byteLength===8){var R=new Uint8Array(C.data),S=R[3]&1,v=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return v/=45,S&&(v+=4772185884e-2),Math.round(v)}return},s=function(C,R){R===void 0&&(R=!1);var S=O();if(S){var v=S.decode(C);if(R){var E=v.indexOf("\0");return E!==-1?v.substring(0,E):v}return v.replace(/\0/g,"")}for(var h=C.length,p,_,g,w="",j=0;j<h;){if(p=C[j++],p===0&&R)return w;if(p===0||p===3)continue;switch(p>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(p);break;case 12:case 13:_=C[j++],w+=String.fromCharCode((p&31)<<6|_&63);break;case 14:_=C[j++],g=C[j++],w+=String.fromCharCode((p&15)<<12|(_&63)<<6|(g&63)<<0);break;default:}}return w},i={decodeTextFrame:o},n;function O(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/demux/base-audio-demuxer.ts"),P=U("./src/demux/id3.ts"),I=U("./src/utils/logger.ts"),K=U("./src/demux/mpegaudio.ts");function k(b,f){b.prototype=Object.create(f.prototype),b.prototype.constructor=b,r(b,f)}function r(b,f){return r=Object.setPrototypeOf||function(l,o){return l.__proto__=o,l},r(b,f)}var M=function(b){k(f,b);function f(){return b.apply(this,arguments)||this}var m=f.prototype;return m.resetInitSegment=function(o,a,c){b.prototype.resetInitSegment.call(this,o,a,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:c,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var a=P.getID3Data(o,0)||[],c=a.length,s=o.length;c<s;c++)if(K.probe(o,c))return I.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(o,a){return K.canParse(o,a)},m.appendFrame=function(o,a,c){return this.initPTS===null?void 0:K.appendFrame(o,a,c,this.initPTS,this.frameIndex)},f}(G.default);M.minProbeByteLength=4,V.default=M},"./src/demux/mp4demuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/mp4-tools.ts"),P=U("./src/demux/dummy-demuxed-track.ts"),I=function(){function K(r,M){this.remainderData=null,this.config=void 0,this.config=M}var k=K.prototype;return k.resetTimeStamp=function(){},k.resetInitSegment=function(){},k.resetContiguity=function(){},K.probe=function(M){return Object(G.findBox)({data:M,start:0,end:Math.min(M.length,16384)},["moof"]).length>0},k.demux=function(M){var b=M,f=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(G.appendUint8Array)(this.remainderData,M));var m=Object(G.segmentValidRange)(b);this.remainderData=m.remainder,f.samples=m.valid||new Uint8Array}else f.samples=b;return{audioTrack:Object(P.dummyTrack)(),avcTrack:f,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},k.flush=function(){var M=Object(P.dummyTrack)();return M.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:M,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},k.demuxSampleAes=function(M,b,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},k.destroy=function(){},K}();I.minProbeByteLength=1024,V.default=I},"./src/demux/mpegaudio.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"appendFrame",function(){return r}),U.d(V,"parseHeader",function(){return M}),U.d(V,"isHeaderPattern",function(){return b}),U.d(V,"isHeader",function(){return f}),U.d(V,"canParse",function(){return m}),U.d(V,"probe",function(){return l});var G=null,P=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function r(o,a,c,s,i){if(c+24>a.length)return;var n=M(a,c);if(n&&c+n.frameLength<=a.length){var O=n.samplesPerFrame*9e4/n.sampleRate,T=s+i*O,C={unit:a.subarray(c,c+n.frameLength),pts:T,dts:T};return o.config=[],o.channelCount=n.channelCount,o.samplerate=n.sampleRate,o.samples.push(C),{sample:C,length:n.frameLength,missing:0}}}function M(o,a){var c=o[a+1]>>3&3,s=o[a+1]>>1&3,i=o[a+2]>>4&15,n=o[a+2]>>2&3;if(c!==1&&i!==0&&i!==15&&n!==3){var O=o[a+2]>>1&1,T=o[a+3]>>6,C=c===3?3-s:s===3?3:4,R=P[C*14+i-1]*1e3,S=c===3?0:c===2?1:2,v=I[S*3+n],E=T===3?1:2,h=K[c][s],p=k[s],_=h*8*p,g=Math.floor(h*R/v+O)*p;if(G===null){var w=navigator.userAgent||"",j=w.match(/Chrome\/(\d+)/i);G=j?parseInt(j[1]):0}var B=!!G&&G<=87;return B&&s===2&&R>=224e3&&T===0&&(o[a+3]=o[a+3]|128),{sampleRate:v,channelCount:E,frameLength:g,samplesPerFrame:_}}}function b(o,a){return o[a]===255&&(o[a+1]&224)===224&&(o[a+1]&6)!==0}function f(o,a){return a+1<o.length&&b(o,a)}function m(o,a){var c=4;return b(o,a)&&c<=o.length-a}function l(o,a){if(a+1<o.length&&b(o,a)){var c=4,s=M(o,a),i=c;s!=null&&s.frameLength&&(i=s.frameLength);var n=a+i;return n===o.length||f(o,n)}return!1}},"./src/demux/sample-aes.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/crypt/decrypter.ts"),P=U("./src/demux/tsdemuxer.ts"),I=function(){function K(r,M,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new G.default(r,M,{removePKCS7Padding:!1})}var k=K.prototype;return k.decryptBuffer=function(M,b){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,b)},k.decryptAacSample=function(M,b,f,m){var l=M[b].unit,o=l.subarray(16,l.length-l.length%16),a=o.buffer.slice(o.byteOffset,o.byteOffset+o.length),c=this;this.decryptBuffer(a,function(s){var i=new Uint8Array(s);l.set(i,16),m||c.decryptAacSamples(M,b+1,f)})},k.decryptAacSamples=function(M,b,f){for(;;b++){if(b>=M.length){f();return}if(M[b].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(M,b,f,m),!m)return}},k.getAvcEncryptedData=function(M){for(var b=Math.floor((M.length-48)/160)*16+16,f=new Int8Array(b),m=0,l=32;l<=M.length-16;l+=160,m+=16)f.set(M.subarray(l,l+16),m);return f},k.getAvcDecryptedUnit=function(M,b){for(var f=new Uint8Array(b),m=0,l=32;l<=M.length-16;l+=160,m+=16)M.set(f.subarray(m,m+16),l);return M},k.decryptAvcSample=function(M,b,f,m,l,o){var a=Object(P.discardEPB)(l.data),c=this.getAvcEncryptedData(a),s=this;this.decryptBuffer(c.buffer,function(i){l.data=s.getAvcDecryptedUnit(a,i),o||s.decryptAvcSamples(M,b,f+1,m)})},k.decryptAvcSamples=function(M,b,f,m){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,f=0){if(b>=M.length){m();return}for(var l=M[b].units;!(f>=l.length);f++){var o=l[f];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var a=this.decrypter.isSync();if(this.decryptAvcSample(M,b,f,m,o,a),!a)return}}},K}();V.default=I},"./src/demux/transmuxer-interface.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return l});var G=U("./node_modules/webworkify-webpack/index.js"),P=U.n(G),I=U("./src/events.ts"),K=U("./src/demux/transmuxer.ts"),k=U("./src/utils/logger.ts"),r=U("./src/errors.ts"),M=U("./src/utils/mediasource-helper.ts"),b=U("./node_modules/eventemitter3/index.js"),f=U.n(b),m=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function o(c,s,i,n){var O=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=c,this.id=s,this.onTransmuxComplete=i,this.onFlush=n;var T=c.config,C=function(h,p){p=p||{},p.frag=O.frag,p.id=O.id,c.trigger(h,p)};this.observer=new b.EventEmitter,this.observer.on(I.Events.FRAG_DECRYPTED,C),this.observer.on(I.Events.ERROR,C);var R={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},S=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){k.logger.log("demuxing in webworker");var v;try{v=this.worker=G("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(E){c.trigger(I.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(E.message+" ("+E.filename+":"+E.lineno+")")})},v.postMessage({cmd:"init",typeSupported:R,vendor:S,id:s,config:JSON.stringify(T)})}catch(E){k.logger.warn("Error in worker:",E),k.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new K.default(this.observer,R,T,S,s),this.worker=null}}else this.transmuxer=new K.default(this.observer,R,T,S,s)}var a=o.prototype;return a.destroy=function(){var s=this.worker;if(s)s.removeEventListener("message",this.onwmsg),s.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},a.push=function(s,i,n,O,T,C,R,S,v,E){var h=this;v.transmuxing.start=self.performance.now();var p=this.transmuxer,_=this.worker,g=C?C.start:T.start,w=T.decryptdata,j=this.frag,B=!(j&&T.cc===j.cc),A=!(j&&v.level===j.level),H=j?v.sn-j.sn:-1,F=this.part?v.part-this.part.index:1,x=!A&&(H===1||H===0&&F===1),Y=self.performance.now();(A||H||T.stats.parsing.start===0)&&(T.stats.parsing.start=Y),C&&(F||!x)&&(C.stats.parsing.start=Y);var q=new K.TransmuxState(B,x,S,A,g);if(!x||B){k.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
discontinuity: `+B+`
trackSwitch: `+A+`
contiguous: `+x+`
accurateTimeOffset: `+S+`
timeOffset: `+g);var ie=new K.TransmuxConfig(n,O,i,R,E);this.configureTransmuxer(ie)}if(this.frag=T,this.part=C,_)_.postMessage({cmd:"demux",data:s,decryptdata:w,chunkMeta:v,state:q},s instanceof ArrayBuffer?[s]:[]);else if(p){var me=p.push(s,w,v,q);Object(K.isPromise)(me)?me.then(function($e){h.handleTransmuxComplete($e)}):this.handleTransmuxComplete(me)}},a.flush=function(s){var i=this;s.transmuxing.start=self.performance.now();var n=this.transmuxer,O=this.worker;if(O)O.postMessage({cmd:"flush",chunkMeta:s});else if(n){var T=n.flush(s);Object(K.isPromise)(T)?T.then(function(C){i.handleFlushResult(C,s)}):this.handleFlushResult(T,s)}},a.handleFlushResult=function(s,i){var n=this;s.forEach(function(O){n.handleTransmuxComplete(O)}),this.onFlush(i)},a.onWorkerMessage=function(s){var i=s.data,n=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,n.trigger(i.event,i.data);break}}},a.configureTransmuxer=function(s){var i=this.worker,n=this.transmuxer;i?i.postMessage({cmd:"configure",config:s}):n&&n.configure(s)},a.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},o}()},"./src/demux/transmuxer-worker.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return r});var G=U("./src/demux/transmuxer.ts"),P=U("./src/events.ts"),I=U("./src/utils/logger.ts"),K=U("./node_modules/eventemitter3/index.js"),k=U.n(K);function r(l){var o=new K.EventEmitter,a=function(s,i){l.postMessage({event:s,data:i})};o.on(P.Events.FRAG_DECRYPTED,a),o.on(P.Events.ERROR,a),l.addEventListener("message",function(c){var s=c.data;switch(s.cmd){case"init":{var i=JSON.parse(s.config);l.transmuxer=new G.default(o,s.typeSupported,i,s.vendor,s.id),Object(I.enableLogs)(i.debug),a("init",null);break}case"configure":{l.transmuxer.configure(s.config);break}case"demux":{var n=l.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(G.isPromise)(n)?n.then(function(C){M(l,C)}):M(l,n);break}case"flush":{var O=s.chunkMeta,T=l.transmuxer.flush(O);Object(G.isPromise)(T)?T.then(function(C){f(l,C,O)}):f(l,T,O);break}default:break}})}function M(l,o){if(m(o.remuxResult))return;var a=[],c=o.remuxResult,s=c.audio,i=c.video;s&&b(a,s),i&&b(a,i),l.postMessage({event:"transmuxComplete",data:o},a)}function b(l,o){o.data1&&l.push(o.data1.buffer),o.data2&&l.push(o.data2.buffer)}function f(l,o,a){o.forEach(function(c){M(l,c)}),l.postMessage({event:"flush",data:a})}function m(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return i}),U.d(V,"isPromise",function(){return T}),U.d(V,"TransmuxConfig",function(){return C}),U.d(V,"TransmuxState",function(){return R});var G=U("./src/events.ts"),P=U("./src/errors.ts"),I=U("./src/crypt/decrypter.ts"),K=U("./src/demux/aacdemuxer.ts"),k=U("./src/demux/mp4demuxer.ts"),r=U("./src/demux/tsdemuxer.ts"),M=U("./src/demux/mp3demuxer.ts"),b=U("./src/remux/mp4-remuxer.ts"),f=U("./src/remux/passthrough-remuxer.ts"),m=U("./src/demux/chunk-cache.ts"),l=U("./src/utils/mp4-tools.ts"),o=U("./src/utils/logger.ts"),a;try{a=self.performance.now.bind(self.performance)}catch(S){o.logger.debug("Unable to use Performance API on this environment"),a=self.Date.now}var c=[{demux:r.default,remux:b.default},{demux:k.default,remux:f.default},{demux:K.default,remux:b.default},{demux:M.default,remux:b.default}],s=1024;c.forEach(function(S){var v=S.demux;s=Math.max(s,v.minProbeByteLength)});var i=function(){function S(E,h,p,_,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 m.default,this.observer=E,this.typeSupported=h,this.config=p,this.vendor=_,this.id=g}var v=S.prototype;return v.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},v.push=function(h,p,_,g){var w=this,j=_.transmuxing;j.executeStart=a();var B=new Uint8Array(h),A=this.cache,H=this.config,F=this.currentTransmuxState,x=this.transmuxConfig;g&&(this.currentTransmuxState=g);var Y=n(B,p);if(Y&&Y.method==="AES-128"){var q=this.getDecrypter();if(H.enableSoftwareAES){var ie=q.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!ie)return j.executeEnd=a(),O(_);B=new Uint8Array(ie)}else return this.decryptionPromise=q.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(ht){var Bt=w.push(ht,null,_);return w.decryptionPromise=null,Bt}),this.decryptionPromise}var me=g||F,$e=me.contiguous,xe=me.discontinuity,Ie=me.trackSwitch,Je=me.accurateTimeOffset,Ye=me.timeOffset,ve=x.audioCodec,fe=x.videoCodec,lt=x.defaultInitPts,qt=x.duration,Ft=x.initSegmentData;if((xe||Ie)&&this.resetInitSegment(Ft,ve,fe,qt),xe&&this.resetInitialTimestamp(lt),$e||this.resetContiguity(),this.needsProbing(B,xe,Ie)){if(A.dataLength){var Ot=A.flush();B=Object(l.appendUint8Array)(Ot,B)}this.configureTransmuxer(B,x)}var Ve=this.transmux(B,Y,Ye,Je,_),vt=this.currentTransmuxState;return vt.contiguous=!0,vt.discontinuity=!1,vt.trackSwitch=!1,j.executeEnd=a(),Ve},v.flush=function(h){var p=this,_=h.transmuxing;_.executeStart=a();var g=this.decrypter,w=this.cache,j=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return p.flush(h)});var A=[],H=j.timeOffset;if(g){var F=g.flush();F&&A.push(this.push(F,null,h))}var x=w.dataLength;w.reset();var Y=this.demuxer,q=this.remuxer;if(!Y||!q)return x>=s&&this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),_.executeEnd=a(),[O(h)];var ie=Y.flush(H);return T(ie)?ie.then(function(me){return p.flushRemux(A,me,h),A}):(this.flushRemux(A,ie,h),A)},v.flushRemux=function(h,p,_){var g=p.audioTrack,w=p.avcTrack,j=p.id3Track,B=p.textTrack,A=this.currentTransmuxState,H=A.accurateTimeOffset,F=A.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var x=this.remuxer.remux(g,w,j,B,F,H,!0,this.id);h.push({remuxResult:x,chunkMeta:_}),_.transmuxing.executeEnd=a()},v.resetInitialTimestamp=function(h){var p=this.demuxer,_=this.remuxer;if(!p||!_)return;p.resetTimeStamp(h),_.resetTimeStamp(h)},v.resetContiguity=function(){var h=this.demuxer,p=this.remuxer;if(!h||!p)return;h.resetContiguity(),p.resetNextTimestamp()},v.resetInitSegment=function(h,p,_,g){var w=this.demuxer,j=this.remuxer;if(!w||!j)return;w.resetInitSegment(p,_,g),j.resetInitSegment(h,p,_)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(h,p,_,g,w){var j;return p&&p.method==="SAMPLE-AES"?j=this.transmuxSampleAes(h,p,_,g,w):j=this.transmuxUnencrypted(h,_,g,w),j},v.transmuxUnencrypted=function(h,p,_,g){var w=this.demuxer.demux(h,p,!1,!this.config.progressive),j=w.audioTrack,B=w.avcTrack,A=w.id3Track,H=w.textTrack,F=this.remuxer.remux(j,B,A,H,p,_,!1,this.id);return{remuxResult:F,chunkMeta:g}},v.transmuxSampleAes=function(h,p,_,g,w){var j=this;return this.demuxer.demuxSampleAes(h,p,_).then(function(B){var A=j.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,_,g,!1,j.id);return{remuxResult:A,chunkMeta:w}})},v.configureTransmuxer=function(h,p){for(var _=this.config,g=this.observer,w=this.typeSupported,j=this.vendor,B=p.audioCodec,A=p.defaultInitPts,H=p.duration,F=p.initSegmentData,x=p.videoCodec,Y,q=0,ie=c.length;q<ie;q++)if(c[q].demux.probe(h)){Y=c[q];break}Y||(o.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:k.default,remux:f.default});var me=this.demuxer,$e=this.remuxer,xe=Y.remux,Ie=Y.demux;(!$e||!($e instanceof xe))&&(this.remuxer=new xe(g,_,w,j)),(!me||!(me instanceof Ie))&&(this.demuxer=new Ie(g,_,w),this.probe=Ie.probe),this.resetInitSegment(F,B,x,H),this.resetInitialTimestamp(A)},v.needsProbing=function(h,p,_){return!this.demuxer||!this.remuxer||p||_},v.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new I.default(this.observer,this.config)),h},S}();function n(S,v){var E=null;return S.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(E=v),E}var O=function(v){return{remuxResult:{},chunkMeta:v}};function T(S){return"then"in S&&S.then instanceof Function}var C=function(v,E,h,p,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=E,this.initSegmentData=h,this.duration=p,this.defaultInitPts=_},R=function(v,E,h,p,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=E,this.accurateTimeOffset=h,this.trackSwitch=p,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"discardEPB",function(){return O});var G=U("./src/demux/adts.ts"),P=U("./src/demux/mpegaudio.ts"),I=U("./src/demux/exp-golomb.ts"),K=U("./src/demux/id3.ts"),k=U("./src/demux/sample-aes.ts"),r=U("./src/events.ts"),M=U("./src/utils/mp4-tools.ts"),b=U("./src/utils/logger.ts"),f=U("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},l=function(){function T(R,S,v){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=S,this.typeSupported=v}T.probe=function(S){var v=T.syncOffset(S);return v<0?!1:(v&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},T.syncOffset=function(S){for(var v=Math.min(1e3,S.length-3*188),E=0;E<v;){if(S[E]===71&&S[E+188]===71&&S[E+2*188]===71)return E;E++}return-1},T.createTrack=function(S,v){return{container:S==="video"||S==="audio"?"video/mp2t":void 0,type:S,id:m[S],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:S==="audio"?v:void 0}};var C=T.prototype;return C.resetInitSegment=function(S,v,E){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",E),this._audioTrack=T.createTrack("audio",E),this._id3Track=T.createTrack("id3",E),this._txtTrack=T.createTrack("text",E),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=S,this.videoCodec=v,this._duration=E},C.resetTimeStamp=function(){},C.resetContiguity=function(){var S=this._audioTrack,v=this._avcTrack,E=this._id3Track;S&&(S.pesData=null),v&&(v.pesData=null),E&&(E.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(S,v,E,h){E===void 0&&(E=!1),h===void 0&&(h=!1),E||(this.sampleAes=null);var p,_=this._avcTrack,g=this._audioTrack,w=this._id3Track,j=_.pid,B=_.pesData,A=g.pid,H=w.pid,F=g.pesData,x=w.pesData,Y=!1,q=this.pmtParsed,ie=this._pmtId,me=S.length;if(this.remainderData&&(S=Object(M.appendUint8Array)(this.remainderData,S),me=S.length,this.remainderData=null),me<188&&!h)return this.remainderData=S,{audioTrack:g,avcTrack:_,id3Track:w,textTrack:this._txtTrack};var $e=Math.max(0,T.syncOffset(S));me-=(me+$e)%188,me<S.byteLength&&!h&&(this.remainderData=new Uint8Array(S.buffer,me,S.buffer.byteLength-me));for(var xe=$e;xe<me;xe+=188)if(S[xe]===71){var Ie=!!(S[xe+1]&64),Je=((S[xe+1]&31)<<8)+S[xe+2],Ye=(S[xe+3]&48)>>4,ve=void 0;if(Ye>1){if(ve=xe+5+S[xe+4],ve===xe+188)continue}else ve=xe+4;switch(Je){case j:Ie&&(B&&(p=s(B))&&this.parseAVCPES(p,!1),B={data:[],size:0}),B&&(B.data.push(S.subarray(ve,xe+188)),B.size+=xe+188-ve);break;case A:Ie&&(F&&(p=s(F))&&(g.isAAC?this.parseAACPES(p):this.parseMPEGPES(p)),F={data:[],size:0}),F&&(F.data.push(S.subarray(ve,xe+188)),F.size+=xe+188-ve);break;case H:Ie&&(x&&(p=s(x))&&this.parseID3PES(p),x={data:[],size:0}),x&&(x.data.push(S.subarray(ve,xe+188)),x.size+=xe+188-ve);break;case 0:Ie&&(ve+=S[ve]+1),ie=this._pmtId=a(S,ve);break;case ie:{Ie&&(ve+=S[ve]+1);var fe=c(S,ve,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,E);j=fe.avc,j>0&&(_.pid=j),A=fe.audio,A>0&&(g.pid=A,g.isAAC=fe.isAAC),H=fe.id3,H>0&&(w.pid=H),Y&&!q&&(b.logger.log("reparse from beginning"),Y=!1,xe=$e-188),q=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=B,g.pesData=F,w.pesData=x;var lt={audioTrack:g,avcTrack:_,id3Track:w,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(lt),lt},C.flush=function(){var S=this.remainderData;this.remainderData=null;var v;return S?v=this.demux(S,-1,!1,!0):v={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(v),this.sampleAes?this.decrypt(v,this.sampleAes):v},C.extractRemainingSamples=function(S){var v=S.audioTrack,E=S.avcTrack,h=S.id3Track,p=E.pesData,_=v.pesData,g=h.pesData,w;p&&(w=s(p))?(this.parseAVCPES(w,!0),E.pesData=null):E.pesData=p,_&&(w=s(_))?(v.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),v.pesData=null):(_!=null&&_.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=_),g&&(w=s(g))?(this.parseID3PES(w),h.pesData=null):h.pesData=g},C.demuxSampleAes=function(S,v,E){var h=this.demux(S,E,!0,!this.config.progressive),p=this.sampleAes=new k.default(this.observer,this.config,v);return this.decrypt(h,p)},C.decrypt=function(S,v){return new Promise(function(E){var h=S.audioTrack,p=S.avcTrack;h.samples&&h.isAAC?v.decryptAacSamples(h.samples,0,function(){p.samples?v.decryptAvcSamples(p.samples,0,0,function(){E(S)}):E(S)}):p.samples&&v.decryptAvcSamples(p.samples,0,0,function(){E(S)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(S,v){var E=this,h=this._avcTrack,p=this.parseAVCNALu(S.data),_=!1,g=this.avcSample,w,j=!1;S.data=null,g&&p.length&&!h.audFound&&(i(g,h),g=this.avcSample=o(!1,S.pts,S.dts,"")),p.forEach(function(B){switch(B.type){case 1:{w=!0,g||(g=E.avcSample=o(!0,S.pts,S.dts,"")),_&&(g.debug+="NDR "),g.frame=!0;var A=B.data;if(j&&A.length>4){var H=new I.default(A).readSliceType();(H===2||H===4||H===7||H===9)&&(g.key=!0)}break}case 5:w=!0,g||(g=E.avcSample=o(!0,S.pts,S.dts,"")),_&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{w=!0,_&&g&&(g.debug+="SEI ");var F=new I.default(O(B.data));F.readUByte();for(var x=0,Y=0,q=!1,ie=0;!q&&F.bytesAvailable>1;){x=0;do ie=F.readUByte(),x+=ie;while(ie===255);Y=0;do ie=F.readUByte(),Y+=ie;while(ie===255);if(x===4&&F.bytesAvailable!==0){q=!0;var me=F.readUByte();if(me===181){var $e=F.readUShort();if($e===49){var xe=F.readUInt();if(xe===1195456820){var Ie=F.readUByte();if(Ie===3){for(var Je=F.readUByte(),Ye=F.readUByte(),ve=31&Je,fe=[Je,Ye],lt=0;lt<ve;lt++)fe.push(F.readUByte()),fe.push(F.readUByte()),fe.push(F.readUByte());n(E._txtTrack.samples,{type:3,pts:S.pts,bytes:fe})}}}}}else if(x===5&&F.bytesAvailable!==0){if(q=!0,Y>16){for(var qt=[],Ft=0;Ft<16;Ft++)qt.push(F.readUByte().toString(16)),(Ft===3||Ft===5||Ft===7||Ft===9)&&qt.push("-");for(var Ot=Y-16,Ve=new Uint8Array(Ot),vt=0;vt<Ot;vt++)Ve[vt]=F.readUByte();n(E._txtTrack.samples,{pts:S.pts,payloadType:x,uuid:qt.join(""),userData:Object(K.utf8ArrayToStr)(Ve),userDataBytes:Ve})}}else if(Y<F.bytesAvailable)for(var ht=0;ht<Y;ht++)F.readUByte()}break}case 7:if(w=!0,j=!0,_&&g&&(g.debug+="SPS "),!h.sps){var Bt=new I.default(B.data),se=Bt.readSPS();h.width=se.width,h.height=se.height,h.pixelRatio=se.pixelRatio,h.sps=[B.data],h.duration=E._duration;for(var Ue=B.data.subarray(1,4),Ge="avc1.",et=0;et<3;et++){var Wt=Ue[et].toString(16);Wt.length<2&&(Wt="0"+Wt),Ge+=Wt}h.codec=Ge}break;case 8:w=!0,_&&g&&(g.debug+="PPS "),h.pps||(h.pps=[B.data]);break;case 9:w=!1,h.audFound=!0,g&&i(g,h),g=E.avcSample=o(!1,S.pts,S.dts,_?"AUD ":"");break;case 12:w=!1;break;default:w=!1,g&&(g.debug+="unknown NAL "+B.type+" ");break}if(g&&w){var Yt=g.units;Yt.push(B)}}),v&&g&&(i(g,h),this.avcSample=null)},C.getLastNalUnit=function(){var S,v=this.avcSample,E;if(!v||v.units.length===0){var h=this._avcTrack.samples;v=h[h.length-1]}if((S=v)!==null&&S!==void 0&&S.units){var p=v.units;E=p[p.length-1]}return E},C.parseAVCNALu=function(S){var v=S.byteLength,E=this._avcTrack,h=E.naluState||0,p=h,_=[],g=0,w,j,B,A=-1,H=0;for(h===-1&&(A=0,H=S[0]&31,h=0,g=1);g<v;){if(w=S[g++],!h){h=w?0:1;continue}if(h===1){h=w?0:2;continue}if(!w)h=3;else if(w===1){if(A>=0){var F={data:S.subarray(A,g-h-1),type:H};_.push(F)}else{var x=this.getLastNalUnit();if(x&&(p&&g<=4-p&&(x.state&&(x.data=x.data.subarray(0,x.data.byteLength-p))),j=g-h-1,j>0)){var Y=new Uint8Array(x.data.byteLength+j);Y.set(x.data,0),Y.set(S.subarray(0,j),x.data.byteLength),x.data=Y,x.state=0}}g<v?(B=S[g]&31,A=g,H=B,h=0):h=-1}else h=0}if(A>=0&&h>=0){var q={data:S.subarray(A,v),type:H,state:h};_.push(q)}if(_.length===0){var ie=this.getLastNalUnit();if(ie){var me=new Uint8Array(ie.data.byteLength+S.byteLength);me.set(ie.data,0),me.set(S,ie.data.byteLength),ie.data=me}}return E.naluState=h,_},C.parseAACPES=function(S){var v=0,E=this._audioTrack,h=this.aacOverFlow,p=S.data;if(h){this.aacOverFlow=null;var _=h.sample.unit.byteLength,g=Math.min(h.missing,_),w=_-g;h.sample.unit.set(p.subarray(0,g),w),E.samples.push(h.sample),v=h.missing}var j,B;for(j=v,B=p.length;j<B-1&&!G.isHeader(p,j);j++);if(j!==v){var A,H;if(j<B-1?(A="AAC PES did not start with ADTS header,offset:"+j,H=!1):(A="no ADTS header found in AAC PES",H=!0),b.logger.warn("parsing error:"+A),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:A}),H)return}G.initTrackConfig(E,this.observer,p,j,this.audioCodec);var F;if(S.pts!==void 0)F=S.pts;else if(h){var x=G.getFrameDuration(E.samplerate);F=h.sample.pts+x}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;j<B;)if(G.isHeader(p,j)){if(j+5<B){var q=G.appendFrame(E,p,j,F,Y);if(q)if(q.missing)this.aacOverFlow=q;else{j+=q.length,Y++;continue}}break}else j++},C.parseMPEGPES=function(S){var v=S.data,E=v.length,h=0,p=0,_=S.pts;if(_===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;p<E;)if(P.isHeader(v,p)){var g=P.appendFrame(this._audioTrack,v,p,_,h);if(g)p+=g.length,h++;else break}else p++},C.parseID3PES=function(S){if(S.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(S)},T}();l.minProbeByteLength=188;function o(T,C,R,S){return{key:T,frame:!1,pts:C,dts:R,units:[],debug:S,length:0}}function a(T,C){return(T[C+10]&31)<<8|T[C+11]}function c(T,C,R,S){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},E=(T[C+1]&15)<<8|T[C+2],h=C+3+E-4,p=(T[C+10]&15)<<8|T[C+11];for(C+=12+p;C<h;){var _=(T[C+1]&31)<<8|T[C+2];switch(T[C]){case 207:if(!S){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:v.audio===-1&&(v.audio=_);break;case 21:v.id3===-1&&(v.id3=_);break;case 219:if(!S){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:v.avc===-1&&(v.avc=_);break;case 3:case 4:R?v.audio===-1&&(v.audio=_,v.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((T[C+3]&15)<<8|T[C+4])+5}return v}function s(T){var C=0,R,S,v,E,h,p=T.data;if(!T||T.size===0)return null;for(;p[0].length<19&&p.length>1;){var _=new Uint8Array(p[0].length+p[1].length);_.set(p[0]),_.set(p[1],p[0].length),p[0]=_,p.splice(1,1)}R=p[0];var g=(R[0]<<16)+(R[1]<<8)+R[2];if(g===1){if(S=(R[4]<<8)+R[5],S&&S>T.size-6)return null;var w=R[7];w&192&&(E=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,w&64?(h=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,E-h>60*9e4&&(b.logger.warn(Math.round((E-h)/9e4)+"s delta between PTS and DTS, align them"),E=h)):h=E),v=R[8];var j=v+9;if(T.size<=j)return null;T.size-=j;for(var B=new Uint8Array(T.size),A=0,H=p.length;A<H;A++){R=p[A];var F=R.byteLength;if(j)if(j>F){j-=F;continue}else R=R.subarray(j),F-=j,j=0;B.set(R,C),C+=F}return S&&(S-=v+3),{data:B,pts:E,dts:h,len:S}}return null}function i(T,C){if(T.units.length&&T.frame){if(T.pts===void 0){var R=C.samples,S=R.length;if(S){var v=R[S-1];T.pts=v.pts,T.dts=v.dts}else{C.dropped++;return}}C.samples.push(T)}T.debug.length&&b.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function n(T,C){var R=T.length;if(R>0){if(C.pts>=T[R-1].pts)T.push(C);else for(var S=R-1;S>=0;S--)if(C.pts<T[S].pts){T.splice(S,0,C);break}}else T.push(C)}function O(T){for(var C=T.byteLength,R=[],S=1;S<C-2;)T[S]===0&&T[S+1]===0&&T[S+2]===3?(R.push(S+2),S+=2):S++;if(R.length===0)return T;var v=C-R.length,E=new Uint8Array(v),h=0;for(S=0;S<v;h++,S++)h===R[0]&&(h++,R.shift()),E[S]=T[h];return E}V.default=l},"./src/errors.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"ErrorTypes",function(){return G}),U.d(V,"ErrorDetails",function(){return P});var G;(function(I){I.NETWORK_ERROR="networkError",I.MEDIA_ERROR="mediaError",I.KEY_SYSTEM_ERROR="keySystemError",I.MUX_ERROR="muxError",I.OTHER_ERROR="otherError"})(G||(G={}));var P;(function(I){I.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",I.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",I.KEY_SYSTEM_NO_SESSION="keySystemNoSession",I.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",I.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",I.MANIFEST_LOAD_ERROR="manifestLoadError",I.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",I.MANIFEST_PARSING_ERROR="manifestParsingError",I.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",I.LEVEL_EMPTY_ERROR="levelEmptyError",I.LEVEL_LOAD_ERROR="levelLoadError",I.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",I.LEVEL_SWITCH_ERROR="levelSwitchError",I.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",I.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",I.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",I.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",I.FRAG_LOAD_ERROR="fragLoadError",I.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",I.FRAG_DECRYPT_ERROR="fragDecryptError",I.FRAG_PARSING_ERROR="fragParsingError",I.REMUX_ALLOC_ERROR="remuxAllocError",I.KEY_LOAD_ERROR="keyLoadError",I.KEY_LOAD_TIMEOUT="keyLoadTimeOut",I.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",I.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",I.BUFFER_APPEND_ERROR="bufferAppendError",I.BUFFER_APPENDING_ERROR="bufferAppendingError",I.BUFFER_STALLED_ERROR="bufferStalledError",I.BUFFER_FULL_ERROR="bufferFullError",I.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",I.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",I.INTERNAL_EXCEPTION="internalException",I.INTERNAL_ABORTED="aborted",I.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"Events",function(){return G});var G;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(G||(G={}))},"./src/hls.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return T});var G=U("./node_modules/url-toolkit/src/url-toolkit.js"),P=U.n(G),I=U("./src/loader/playlist-loader.ts"),K=U("./src/loader/key-loader.ts"),k=U("./src/controller/id3-track-controller.ts"),r=U("./src/controller/latency-controller.ts"),M=U("./src/controller/level-controller.ts"),b=U("./src/controller/fragment-tracker.ts"),f=U("./src/controller/stream-controller.ts"),m=U("./src/is-supported.ts"),l=U("./src/utils/logger.ts"),o=U("./src/config.ts"),a=U("./node_modules/eventemitter3/index.js"),c=U.n(a),s=U("./src/events.ts"),i=U("./src/errors.ts");function n(C,R){for(var S=0;S<R.length;S++){var v=R[S];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function O(C,R,S){return R&&n(C.prototype,R),S&&n(C,S),C}var T=function(){C.isSupported=function(){return Object(m.isSupported)()};function C(S){S===void 0&&(S={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new a.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var v=this.config=Object(o.mergeConfig)(C.DefaultConfig,S);this.userConfig=S,Object(l.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(o.enableStreamingMode)(v);var E=v.abrController,h=v.bufferController,p=v.capLevelController,_=v.fpsController,g=this.abrController=new E(this),w=this.bufferController=new h(this),j=this.capLevelController=new p(this),B=new _(this),A=new I.default(this),H=new K.default(this),F=new k.default(this),x=this.levelController=new M.default(this),Y=new b.FragmentTracker(this),q=this.streamController=new f.default(this,Y);j.setStreamController(q),B.setStreamController(q);var ie=[x,q];this.networkControllers=ie;var me=[A,H,g,w,j,B,F,Y];this.audioTrackController=this.createController(v.audioTrackController,null,ie),this.createController(v.audioStreamController,Y,ie),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,ie),this.createController(v.subtitleStreamController,Y,ie),this.createController(v.timelineController,null,me),this.emeController=this.createController(v.emeController,null,me),this.cmcdController=this.createController(v.cmcdController,null,me),this.latencyController=this.createController(r.default,null,me),this.coreComponents=me}var R=C.prototype;return R.createController=function(v,E,h){if(v){var p=E?new v(this,E):new v(this);return h&&h.push(p),p}return null},R.on=function(v,E,h){h===void 0&&(h=this),this._emitter.on(v,E,h)},R.once=function(v,E,h){h===void 0&&(h=this),this._emitter.once(v,E,h)},R.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},R.off=function(v,E,h,p){h===void 0&&(h=this),this._emitter.off(v,E,h,p)},R.listeners=function(v){return this._emitter.listeners(v)},R.emit=function(v,E,h){return this._emitter.emit(v,E,h)},R.trigger=function(v,E){if(this.config.debug)return this.emit(v,v,E);try{return this.emit(v,v,E)}catch(h){l.logger.error("An internal error happened while handling event "+v+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(s.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:h})}return!1},R.listenerCount=function(v){return this._emitter.listenerCount(v)},R.destroy=function(){l.logger.log("destroy"),this.trigger(s.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(v){return v.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(v){return v.destroy()}),this.coreComponents.length=0},R.attachMedia=function(v){l.logger.log("attachMedia"),this._media=v,this.trigger(s.Events.MEDIA_ATTACHING,{media:v})},R.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(v){this.stopLoad();var E=this.media,h=this.url,p=this.url=G.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});l.logger.log("loadSource:"+p),E&&h&&h!==p&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(E)),this.trigger(s.Events.MANIFEST_LOADING,{url:v})},R.startLoad=function(v){v===void 0&&(v=-1),l.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(E){E.startLoad(v)})},R.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},R.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){l.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},R.removeLevel=function(v,E){E===void 0&&(E=0),this.levelController.removeLevel(v,E)},O(C,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){l.logger.log("set currentLevel:"+v),this.loadLevel=v,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(v){l.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){l.logger.log("set loadLevel:"+v),this.levelController.manualLevel=v}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(v){this.levelController.nextLoadLevel=v}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(v){l.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){l.logger.log("set startLevel:"+v),v!==-1&&(v=Math.max(v,this.minAutoLevel)),this.levelController.startLevel=v}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(v){var E=!!v;E!==this.config.capLevelToPlayerSize&&(E?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=E)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(l.logger.log("set autoLevelCapping:"+v),this._autoLevelCapping=v)}},{key:"bandwidthEstimate",get:function(){var v=this.abrController.bwEstimator;return v?v.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var v=this.levels,E=this.config.minAutoBitrate;if(!v)return 0;for(var h=v.length,p=0;p<h;p++)if(v[p].maxBitrate>E)return p;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,E=this.autoLevelCapping,h;return E===-1&&v&&v.length?h=v.length-1:h=E,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var E=this.audioTrackController;E&&(E.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var E=this.subtitleTrackController;E&&(E.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var E=this.subtitleTrackController;E&&(E.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return s.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return C.defaultConfig?C.defaultConfig:o.hlsDefaultConfig},set:function(v){C.defaultConfig=v}}]),C}();T.defaultConfig=void 0},"./src/is-supported.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isSupported",function(){return I}),U.d(V,"changeTypeSupported",function(){return K});var G=U("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function I(){var k=Object(G.getMediaSource)();if(!k)return!1;var r=P(),M=k&&typeof k.isTypeSupported=="function"&&k.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!M&&!!b}function K(){var k,r=P();return typeof(r==null||((k=r.prototype)===null||k===void 0)?void 0:k.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return l}),U.d(V,"LoadError",function(){return a});var G=U("./src/polyfills/number.ts"),P=U("./src/errors.ts");function I(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,b(c,s)}function K(c){var s=typeof Map=="function"?new Map:void 0;return K=function(n){if(n===null||!M(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof s!="undefined"){if(s.has(n))return s.get(n);s.set(n,O)}function O(){return k(n,arguments,f(this).constructor)}return O.prototype=Object.create(n.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),b(O,n)},K(c)}function k(c,s,i){return r()?k=Reflect.construct:k=function(O,T,C){var R=[null];R.push.apply(R,T);var S=Function.bind.apply(O,R),v=new S;return C&&b(v,C.prototype),v},k.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function M(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function b(c,s){return b=Object.setPrototypeOf||function(n,O){return n.__proto__=O,n},b(c,s)}function f(c){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},f(c)}var m=Math.pow(2,17),l=function(){function c(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var s=c.prototype;return s.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},s.abort=function(){this.loader&&this.loader.abort()},s.load=function(n,O){var T=this,C=n.url;if(!C)return Promise.reject(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,networkDetails:null},"Fragment does not have a "+(C?"part list":"url")));this.abort();var R=this.config,S=R.fLoader,v=R.loader;return new Promise(function(E,h){T.loader&&T.loader.destroy();var p=T.loader=n.loader=S?new S(R):new v(R),_=o(n),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};n.stats=p.stats,p.load(_,g,{onSuccess:function(j,B,A,H){T.resetLoader(n,p),E({frag:n,part:null,payload:j.data,networkDetails:H})},onError:function(j,B,A){T.resetLoader(n,p),h(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:j,networkDetails:A}))},onAbort:function(j,B,A){T.resetLoader(n,p),h(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:A}))},onTimeout:function(j,B,A){T.resetLoader(n,p),h(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:A}))},onProgress:function(j,B,A,H){O&&O({frag:n,part:null,payload:A,networkDetails:H})}})})},s.loadPart=function(n,O,T){var C=this;this.abort();var R=this.config,S=R.fLoader,v=R.loader;return new Promise(function(E,h){C.loader&&C.loader.destroy();var p=C.loader=n.loader=S?new S(R):new v(R),_=o(n,O),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};O.stats=p.stats,p.load(_,g,{onSuccess:function(j,B,A,H){C.resetLoader(n,p),C.updateStatsFromPart(n,O);var F={frag:n,part:O,payload:j.data,networkDetails:H};T(F),E(F)},onError:function(j,B,A){C.resetLoader(n,p),h(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:O,response:j,networkDetails:A}))},onAbort:function(j,B,A){n.stats.aborted=O.stats.aborted,C.resetLoader(n,p),h(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:O,networkDetails:A}))},onTimeout:function(j,B,A){C.resetLoader(n,p),h(new a({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,part:O,networkDetails:A}))}})})},s.updateStatsFromPart=function(n,O){var T=n.stats,C=O.stats,R=C.total;if(T.loaded+=C.loaded,R){var S=Math.round(n.duration/O.duration),v=Math.min(Math.round(T.loaded/R),S),E=S-v,h=E*Math.round(T.loaded/v);T.total=T.loaded+h}else T.total=Math.max(T.loaded,T.total);var p=T.loading,_=C.loading;p.start?p.first+=_.first-_.start:(p.start=_.start,p.first=_.first),p.end=_.end},s.resetLoader=function(n,O){n.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},c}();function o(c,s){s===void 0&&(s=null);var i=s||c,n={frag:c,part:s,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},O=i.byteRangeStartOffset,T=i.byteRangeEndOffset;return Object(G.isFiniteNumber)(O)&&Object(G.isFiniteNumber)(T)&&(n.rangeStart=O,n.rangeEnd=T),n}var a=function(c){I(s,c);function s(i){for(var n,O=arguments.length,T=new Array(O>1?O-1:0),C=1;C<O;C++)T[C-1]=arguments[C];return n=c.call.apply(c,[this].concat(T))||this,n.data=void 0,n.data=i,n}return s}(K(Error))},"./src/loader/fragment.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"ElementaryStreamTypes",function(){return l}),U.d(V,"BaseSegment",function(){return o}),U.d(V,"Fragment",function(){return a}),U.d(V,"Part",function(){return c});var G=U("./src/polyfills/number.ts"),P=U("./node_modules/url-toolkit/src/url-toolkit.js"),I=U.n(P),K=U("./src/utils/logger.ts"),k=U("./src/loader/level-key.ts"),r=U("./src/loader/load-stats.ts");function M(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,b(s,i)}function b(s,i){return b=Object.setPrototypeOf||function(O,T){return O.__proto__=T,O},b(s,i)}function f(s,i){for(var n=0;n<i.length;n++){var O=i[n];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(s,O.key,O)}}function m(s,i,n){return i&&f(s.prototype,i),n&&f(s,n),s}var l;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(l||(l={}));var o=function(){function s(n){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[l.AUDIO]=null,O[l.VIDEO]=null,O[l.AUDIOVIDEO]=null,O),this.baseurl=n}var i=s.prototype;return i.setByteRange=function(O,T){var C=O.split("@",2),R=[];C.length===1?R[0]=T?T.byteRangeEndOffset:0:R[0]=parseInt(C[1]),R[1]=parseInt(C[0])+R[0],this._byteRange=R},m(s,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(O){this._url=O}}]),s}(),a=function(s){M(i,s);function i(O,T){var C;return C=s.call(this,T)||this,C._decryptdata=null,C.rawProgramDateTime=null,C.programDateTime=null,C.tagList=[],C.duration=0,C.sn=0,C.levelkey=void 0,C.type=void 0,C.loader=null,C.level=-1,C.cc=0,C.startPTS=void 0,C.endPTS=void 0,C.appendedPTS=void 0,C.startDTS=void 0,C.endDTS=void 0,C.start=0,C.deltaPTS=void 0,C.maxStartPTS=void 0,C.minEndPTS=void 0,C.stats=new r.LoadStats,C.urlId=0,C.data=void 0,C.bitrateTest=!1,C.title=null,C.initSegment=null,C.type=O,C}var n=i.prototype;return n.createInitializationVector=function(T){for(var C=new Uint8Array(16),R=12;R<16;R++)C[R]=T>>8*(15-R)&255;return C},n.setDecryptDataFromLevelKey=function(T,C){var R=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(R=k.LevelKey.fromURI(T.uri),R.method=T.method,R.iv=this.createInitializationVector(C),R.keyFormat="identity"),R},n.setElementaryStreamInfo=function(T,C,R,S,v,E){E===void 0&&(E=!1);var h=this.elementaryStreams,p=h[T];if(!p){h[T]={startPTS:C,endPTS:R,startDTS:S,endDTS:v,partial:E};return}p.startPTS=Math.min(p.startPTS,C),p.endPTS=Math.max(p.endPTS,R),p.startDTS=Math.min(p.startDTS,S),p.endDTS=Math.max(p.endDTS,v)},n.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[l.AUDIO]=null,T[l.VIDEO]=null,T[l.AUDIOVIDEO]=null},m(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(G.isFiniteNumber)(this.programDateTime))return null;var T=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),i}(o),c=function(s){M(i,s);function i(n,O,T,C,R){var S;S=s.call(this,T)||this,S.fragOffset=0,S.duration=0,S.gap=!1,S.independent=!1,S.relurl=void 0,S.fragment=void 0,S.index=void 0,S.stats=new r.LoadStats,S.duration=n.decimalFloatingPoint("DURATION"),S.gap=n.bool("GAP"),S.independent=n.bool("INDEPENDENT"),S.relurl=n.enumeratedString("URI"),S.fragment=O,S.index=C;var v=n.enumeratedString("BYTERANGE");return v&&S.setByteRange(v,R),R&&(S.fragOffset=R.fragOffset+R.duration),S}return m(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var O=this.elementaryStreams;return!!(O.audio||O.video||O.audiovideo)}}]),i}(o)},"./src/loader/key-loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return K});var G=U("./src/events.ts"),P=U("./src/errors.ts"),I=U("./src/utils/logger.ts"),K=function(){function k(M){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=M,this._registerListeners()}var r=k.prototype;return r._registerListeners=function(){this.hls.on(G.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(G.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var f=this.loaders[b];f&&f.destroy()}this.loaders={}},r.onKeyLoading=function(b,f){var m=f.frag,l=m.type,o=this.loaders[l];if(!m.decryptdata){I.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var a=m.decryptdata.uri;if(a!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(o&&(I.logger.warn("abort previous key loader for type:"+l),o.abort()),!a){I.logger.warn("key uri is falsy");return}var s=c.loader,i=m.loader=this.loaders[l]=new s(c);this.decrypturl=a,this.decryptkey=null;var n={url:a,frag:m,responseType:"arraybuffer"},O={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(n,O,T)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:m}))},r.loadsuccess=function(b,f,m){var l=m.frag;if(!l.decryptdata){I.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(b.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:l})},r.loaderror=function(b,f){var m=f.frag,l=m.loader;l&&l.abort(),delete this.loaders[m.type],this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:b})},r.loadtimeout=function(b,f){var m=f.frag,l=m.loader;l&&l.abort(),delete this.loaders[m.type],this.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},k}()},"./src/loader/level-details.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"LevelDetails",function(){return k});var G=U("./src/polyfills/number.ts");function P(r,M){for(var b=0;b<M.length;b++){var f=M[b];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function I(r,M,b){return M&&P(r.prototype,M),b&&P(r,b),r}var K=10,k=function(){function r(b){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=b}var M=r.prototype;return M.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-f.lastPartSn,l=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!l||!!m,this.advanced=this.endSN>f.endSN||m>0||m===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},I(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(G.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var m=this.driftEnd-this.driftStart;return m*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"LevelKey",function(){return k});var G=U("./node_modules/url-toolkit/src/url-toolkit.js"),P=U.n(G);function I(r,M){for(var b=0;b<M.length;b++){var f=M[b];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(r,f.key,f)}}function K(r,M,b){return M&&I(r.prototype,M),b&&I(r,b),r}var k=function(){r.fromURL=function(b,f){return new r(b,f)},r.fromURI=function(b){return new r(b)};function r(M,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(G.buildAbsoluteURL)(M,b,{alwaysNormalize:!0}):this._uri=M}return K(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"LoadStats",function(){return G});var G=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return i});var G=U("./src/polyfills/number.ts"),P=U("./node_modules/url-toolkit/src/url-toolkit.js"),I=U.n(P),K=U("./src/loader/fragment.ts"),k=U("./src/loader/level-details.ts"),r=U("./src/loader/level-key.ts"),M=U("./src/utils/attr-list.ts"),b=U("./src/utils/logger.ts"),f=U("./src/utils/codecs.ts"),m=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,o=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),a=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),c=/\.(mp4|m4s|m4v|m4a)$/i;function s(R){var S,v;return c.test((S=(v=P.parseURL(R))===null||v===void 0?void 0:v.path)!=null?S:"")}var i=function(){function R(){}return R.findGroup=function(v,E){for(var h=0;h<v.length;h++){var p=v[h];if(p.id===E)return p}},R.convertAVC1ToAVCOTI=function(v){var E=v.split(".");if(E.length>2){var h=E.shift()+".";return h+=parseInt(E.shift()).toString(16),h+=("000"+parseInt(E.shift()).toString(16)).substr(-4),h}return v},R.resolve=function(v,E){return P.buildAbsoluteURL(E,v,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(v,E){var h=[],p={},_=!1;m.lastIndex=0;for(var g;(g=m.exec(v))!=null;)if(g[1]){var w=new M.AttrList(g[1]),j={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:R.resolve(g[2],E)},B=w.decimalResolution("RESOLUTION");B&&(j.width=B.width,j.height=B.height),n((w.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=R.convertAVC1ToAVCOTI(j.videoCodec)),h.push(j)}else if(g[3]){var A=new M.AttrList(g[3]);A["DATA-ID"]&&(_=!0,p[A["DATA-ID"]]=A)}return{levels:h,sessionData:_?p:null}},R.parseMasterPlaylistMedia=function(v,E,h,p){p===void 0&&(p=[]);var _,g=[],w=0;for(l.lastIndex=0;(_=l.exec(v))!==null;){var j=new M.AttrList(_[1]);if(j.TYPE===h){var B={attrs:j,bitrate:0,id:w++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:h,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?R.resolve(j.URI,E):""};if(p.length){var A=R.findGroup(p,B.groupId)||p[0];O(B,A,"audioCodec"),O(B,A,"textCodec")}g.push(B)}}return g},R.parseLevelPlaylist=function(v,E,h,p,_){var g=new k.LevelDetails(E),w=g.fragments,j=null,B=0,A=0,H=0,F=0,x=null,Y=new K.Fragment(p,E),q,ie,me,$e=-1,xe=!1;for(o.lastIndex=0,g.m3u8=v;(q=o.exec(v))!==null;){xe&&(xe=!1,Y=new K.Fragment(p,E),Y.start=H,Y.sn=B,Y.cc=F,Y.level=h,j&&(Y.initSegment=j,Y.rawProgramDateTime=j.rawProgramDateTime));var Ie=q[1];if(Ie){Y.duration=parseFloat(Ie);var Je=(" "+q[2]).slice(1);Y.title=Je||null,Y.tagList.push(Je?["INF",Ie,Je]:["INF",Ie])}else if(q[3])Object(G.isFiniteNumber)(Y.duration)&&(Y.start=H,me&&(Y.levelkey=me),Y.sn=B,Y.level=h,Y.cc=F,Y.urlId=_,w.push(Y),Y.relurl=(" "+q[3]).slice(1),C(Y,x),x=Y,H+=Y.duration,B++,A=0,xe=!0);else if(q[4]){var Ye=(" "+q[4]).slice(1);x?Y.setByteRange(Ye,x):Y.setByteRange(Ye)}else if(q[5])Y.rawProgramDateTime=(" "+q[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),$e===-1&&($e=w.length);else{if(q=q[0].match(a),!q){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<q.length&&!(typeof q[ie]!="undefined");ie++);var ve=(" "+q[ie]).slice(1),fe=(" "+q[ie+1]).slice(1),lt=q[ie+2]?(" "+q[ie+2]).slice(1):"";switch(ve){case"PLAYLIST-TYPE":g.type=fe.toUpperCase();break;case"MEDIA-SEQUENCE":B=g.startSN=parseInt(fe);break;case"SKIP":{var qt=new M.AttrList(fe),Ft=qt.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(Ft)){g.skippedSegments=Ft;for(var Ot=Ft;Ot--;)w.unshift(null);B+=Ft}var Ve=qt.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ve&&(g.recentlyRemovedDateranges=Ve.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(fe);break;case"VERSION":g.version=parseInt(fe);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(fe||lt)&&Y.tagList.push(lt?[fe,lt]:[fe]);break;case"DIS":F++;case"GAP":Y.tagList.push([ve]);break;case"BITRATE":Y.tagList.push([ve,fe]);break;case"DISCONTINUITY-SEQ":F=parseInt(fe);break;case"KEY":{var vt,ht=new M.AttrList(fe),Bt=ht.enumeratedString("METHOD"),se=ht.URI,Ue=ht.hexadecimalInteger("IV"),Ge=ht.enumeratedString("KEYFORMATVERSIONS"),et=ht.enumeratedString("KEYID"),Wt=(vt=ht.enumeratedString("KEYFORMAT"))!=null?vt:"identity",Yt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Yt.indexOf(Wt)>-1){b.logger.warn("Keyformat "+Wt+" is not supported from the manifest");continue}else if(Wt!=="identity")continue;Bt&&(me=r.LevelKey.fromURL(E,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Bt)>=0&&(me.method=Bt,me.keyFormat=Wt,et&&(me.keyID=et),Ge&&(me.keyFormatVersions=Ge),me.iv=Ue));break}case"START":{var on=new M.AttrList(fe),nt=on.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(nt)&&(g.startTimeOffset=nt);break}case"MAP":{var tn=new M.AttrList(fe);Y.relurl=tn.URI,tn.BYTERANGE&&Y.setByteRange(tn.BYTERANGE),Y.level=h,Y.sn="initSegment",me&&(Y.levelkey=me),Y.initSegment=null,j=Y,xe=!0;break}case"SERVER-CONTROL":{var Ln=new M.AttrList(fe);g.canBlockReload=Ln.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=Ln.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&Ln.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=Ln.optionalFloat("PART-HOLD-BACK",0),g.holdBack=Ln.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var We=new M.AttrList(fe);g.partTarget=We.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Fe=g.partList;Fe||(Fe=g.partList=[]);var yt=A>0?Fe[Fe.length-1]:void 0,At=A++,tt=new K.Part(new M.AttrList(fe),Y,E,At,yt);Fe.push(tt),Y.duration+=tt.duration;break}case"PRELOAD-HINT":{var ot=new M.AttrList(fe);g.preloadHint=ot;break}case"RENDITION-REPORT":{var De=new M.AttrList(fe);g.renditionReports=g.renditionReports||[],g.renditionReports.push(De);break}default:b.logger.warn("line parsed but not handled: "+q);break}}}x&&!x.relurl?(w.pop(),H-=x.duration,g.partList&&(g.fragmentHint=x)):g.partList&&(C(Y,x),Y.cc=F,g.fragmentHint=Y);var ye=w.length,we=w[0],ae=w[ye-1];if(H+=g.skippedSegments*g.targetduration,H>0&&ye&&ae){g.averagetargetduration=H/ye;var oe=ae.sn;g.endSN=oe!=="initSegment"?oe:0,we&&(g.startCC=we.cc,we.initSegment||g.fragments.every(function(pe){return pe.relurl&&s(pe.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new K.Fragment(p,E),Y.relurl=ae.relurl,Y.level=h,Y.sn="initSegment",we.initSegment=Y,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(H+=g.fragmentHint.duration),g.totalduration=H,g.endCC=F,$e>0&&T(w,$e),g},R}();function n(R,S){["video","audio","text"].forEach(function(v){var E=R.filter(function(p){return Object(f.isCodecType)(p,v)});if(E.length){var h=E.filter(function(p){return p.lastIndexOf("avc1",0)===0||p.lastIndexOf("mp4a",0)===0});S[v+"Codec"]=h.length>0?h[0]:E[0],R=R.filter(function(p){return E.indexOf(p)===-1})}}),S.unknownCodecs=R}function O(R,S,v){var E=S[v];E&&(R[v]=E)}function T(R,S){for(var v=R[S],E=S;E--;){var h=R[E];if(!h)return;h.programDateTime=v.programDateTime-h.duration*1e3,v=h}}function C(R,S){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):S!=null&&S.programDateTime&&(R.programDateTime=S.endProgramDateTime),Object(G.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/events.ts"),I=U("./src/errors.ts"),K=U("./src/utils/logger.ts"),k=U("./src/utils/mp4-tools.ts"),r=U("./src/loader/m3u8-parser.ts"),M=U("./src/types/loader.ts"),b=U("./src/utils/attr-list.ts");function f(o){var a=o.type;switch(a){case M.PlaylistContextType.AUDIO_TRACK:return M.PlaylistLevelType.AUDIO;case M.PlaylistContextType.SUBTITLE_TRACK:return M.PlaylistLevelType.SUBTITLE;default:return M.PlaylistLevelType.MAIN}}function m(o,a){var c=o.url;return(c===void 0||c.indexOf("data:")===0)&&(c=a.url),c}var l=function(){function o(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var a=o.prototype;return a.registerListeners=function(){var s=this.hls;s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.unregisterListeners=function(){var s=this.hls;s.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),s.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.createInternalLoader=function(s){var i=this.hls.config,n=i.pLoader,O=i.loader,T=n||O,C=new T(i);return s.loader=C,this.loaders[s.type]=C,C},a.getInternalLoader=function(s){return this.loaders[s.type]},a.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},a.destroyInternalLoaders=function(){for(var s in this.loaders){var i=this.loaders[s];i&&i.destroy(),this.resetInternalLoader(s)}},a.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},a.onManifestLoading=function(s,i){var n=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:M.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},a.onLevelLoading=function(s,i){var n=i.id,O=i.level,T=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:null,level:O,responseType:"text",type:M.PlaylistContextType.LEVEL,url:T,deliveryDirectives:C})},a.onAudioTrackLoading=function(s,i){var n=i.id,O=i.groupId,T=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:C})},a.onSubtitleTrackLoading=function(s,i){var n=i.id,O=i.groupId,T=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:C})},a.load=function(s){var i,n=this.hls.config,O=this.getInternalLoader(s);if(O){var T=O.context;if(T&&T.url===s.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),O.abort()}var C,R,S,v;switch(s.type){case M.PlaylistContextType.MANIFEST:C=n.manifestLoadingMaxRetry,R=n.manifestLoadingTimeOut,S=n.manifestLoadingRetryDelay,v=n.manifestLoadingMaxRetryTimeout;break;case M.PlaylistContextType.LEVEL:case M.PlaylistContextType.AUDIO_TRACK:case M.PlaylistContextType.SUBTITLE_TRACK:C=0,R=n.levelLoadingTimeOut;break;default:C=n.levelLoadingMaxRetry,R=n.levelLoadingTimeOut,S=n.levelLoadingRetryDelay,v=n.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(s),(i=s.deliveryDirectives)!==null&&i!==void 0&&i.part){var E;if(s.type===M.PlaylistContextType.LEVEL&&s.level!==null?E=this.hls.levels[s.level].details:s.type===M.PlaylistContextType.AUDIO_TRACK&&s.id!==null?E=this.hls.audioTracks[s.id].details:s.type===M.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(E=this.hls.subtitleTracks[s.id].details),E){var h=E.partTarget,p=E.targetduration;h&&p&&(R=Math.min(Math.max(h*3,p*.8)*1e3,R))}}var _={timeout:R,maxRetry:C,retryDelay:S,maxRetryDelay:v,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(s,_,g)},a.loadsuccess=function(s,i,n,O){if(O===void 0&&(O=null),n.isSidxRequest){this.handleSidxRequest(s,n),this.handlePlaylistLoaded(s,i,n,O);return}this.resetInternalLoader(n.type);var T=s.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,n,"no EXTM3U delimiter",O);return}i.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,i,n,O):this.handleMasterPlaylist(s,i,n,O)},a.loaderror=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!1,s)},a.loadtimeout=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!0)},a.handleMasterPlaylist=function(s,i,n,O){var T=this.hls,C=s.data,R=m(s,n),S=r.default.parseMasterPlaylist(C,R),v=S.levels,E=S.sessionData;if(!v.length){this.handleManifestParsingError(s,n,"no level found in manifest",O);return}var h=v.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),p=v.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),_=r.default.parseMasterPlaylistMedia(C,R,"AUDIO",h),g=r.default.parseMasterPlaylistMedia(C,R,"SUBTITLES",p),w=r.default.parseMasterPlaylistMedia(C,R,"CLOSED-CAPTIONS");if(_.length){var j=_.some(function(B){return!B.url});!j&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),_.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}T.trigger(P.Events.MANIFEST_LOADED,{levels:v,audioTracks:_,subtitles:g,captions:w,url:R,stats:i,networkDetails:O,sessionData:E})},a.handleTrackOrLevelPlaylist=function(s,i,n,O){var T=this.hls,C=n.id,R=n.level,S=n.type,v=m(s,n),E=Object(G.isFiniteNumber)(C)?C:0,h=Object(G.isFiniteNumber)(R)?R:E,p=f(n),_=r.default.parseLevelPlaylist(s.data,v,h,p,E);if(!_.fragments.length){T.trigger(P.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:v,reason:"no fragments found in level",level:typeof n.level=="number"?n.level:void 0});return}if(S===M.PlaylistContextType.MANIFEST){var g={attrs:new b.AttrList({}),bitrate:0,details:_,name:"",url:v};T.trigger(P.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:v,stats:i,networkDetails:O,sessionData:null})}if(i.parsing.end=performance.now(),_.needSidxRanges){var w,j=(w=_.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:j,isSidxRequest:!0,type:S,level:R,levelDetails:_,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=_,this.handlePlaylistLoaded(s,i,n,O)},a.handleSidxRequest=function(s,i){var n=Object(k.parseSegmentIndex)(new Uint8Array(s.data));if(!n)return;var O=n.references,T=i.levelDetails;O.forEach(function(C,R){var S=C.info,v=T.fragments[R];v.byteRange.length===0&&v.setByteRange(String(1+S.end-S.start)+"@"+String(S.start)),v.initSegment&&v.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},a.handleManifestParsingError=function(s,i,n,O){this.hls.trigger(P.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===M.PlaylistContextType.MANIFEST,url:s.url,reason:n,response:s,context:i,networkDetails:O})},a.handleNetworkError=function(s,i,n,O){n===void 0&&(n=!1),K.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+s.type+" level: "+s.level+" id: "+s.id+' group-id: "'+s.groupId+'"');var T=I.ErrorDetails.UNKNOWN,C=!1,R=this.getInternalLoader(s);switch(s.type){case M.PlaylistContextType.MANIFEST:T=n?I.ErrorDetails.MANIFEST_LOAD_TIMEOUT:I.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case M.PlaylistContextType.LEVEL:T=n?I.ErrorDetails.LEVEL_LOAD_TIMEOUT:I.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case M.PlaylistContextType.AUDIO_TRACK:T=n?I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:T=n?I.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:I.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}R&&this.resetInternalLoader(s.type);var S={type:I.ErrorTypes.NETWORK_ERROR,details:T,fatal:C,url:s.url,loader:R,context:s,networkDetails:i};O&&(S.response=O),this.hls.trigger(P.Events.ERROR,S)},a.handlePlaylistLoaded=function(s,i,n,O){var T=n.type,C=n.level,R=n.id,S=n.groupId,v=n.loader,E=n.levelDetails,h=n.deliveryDirectives;if(!(E!=null&&E.targetduration)){this.handleManifestParsingError(s,n,"invalid target duration",O);return}if(!v)return;E.live&&(v.getCacheAge&&(E.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(E.ageHeader))&&(E.ageHeader=0));switch(T){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:E,level:C||0,id:R||0,stats:i,networkDetails:O,deliveryDirectives:h});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:h});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:E,id:R||0,groupId:S||"",stats:i,networkDetails:O,deliveryDirectives:h});break}},o}();V.default=l},"./src/polyfills/number.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isFiniteNumber",function(){return G}),U.d(V,"MAX_SAFE_INTEGER",function(){return P});var G=Number.isFinite||function(I){return typeof I=="number"&&isFinite(I)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,V,U){"use strict";U.r(V);var G=function(){function P(){}return P.getSilentFrame=function(K,k){switch(K){case"mp4a.40.2":if(k===1)return new Uint8Array([0,200,0,128,35,128]);if(k===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(k===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(k===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(k===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(k===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(k===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(k===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(k===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},P}();V.default=G},"./src/remux/mp4-generator.ts":function(Z,V,U){"use strict";U.r(V);var G=Math.pow(2,32)-1,P=function(){function I(){}return I.init=function(){I.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var k;for(k in I.types)I.types.hasOwnProperty(k)&&(I.types[k]=[k.charCodeAt(0),k.charCodeAt(1),k.charCodeAt(2),k.charCodeAt(3)]);var r=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]),M=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);I.HDLR_TYPES={video:r,audio:M};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);I.STTS=I.STSC=I.STCO=f,I.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),I.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),I.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),I.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);I.FTYP=I.box(I.types.ftyp,m,o,m,l),I.DINF=I.box(I.types.dinf,I.box(I.types.dref,b))},I.box=function(k){for(var r=8,M=arguments.length,b=new Array(M>1?M-1:0),f=1;f<M;f++)b[f-1]=arguments[f];for(var m=b.length,l=m;m--;)r+=b[m].byteLength;var o=new Uint8Array(r);for(o[0]=r>>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=r&255,o.set(k,4),m=0,r=8;m<l;m++)o.set(b[m],r),r+=b[m].byteLength;return o},I.hdlr=function(k){return I.box(I.types.hdlr,I.HDLR_TYPES[k])},I.mdat=function(k){return I.box(I.types.mdat,k)},I.mdhd=function(k,r){r*=k;var M=Math.floor(r/(G+1)),b=Math.floor(r%(G+1));return I.box(I.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,M>>24,M>>16&255,M>>8&255,M&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},I.mdia=function(k){return I.box(I.types.mdia,I.mdhd(k.timescale,k.duration),I.hdlr(k.type),I.minf(k))},I.mfhd=function(k){return I.box(I.types.mfhd,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255]))},I.minf=function(k){return k.type==="audio"?I.box(I.types.minf,I.box(I.types.smhd,I.SMHD),I.DINF,I.stbl(k)):I.box(I.types.minf,I.box(I.types.vmhd,I.VMHD),I.DINF,I.stbl(k))},I.moof=function(k,r,M){return I.box(I.types.moof,I.mfhd(k),I.traf(M,r))},I.moov=function(k){for(var r=k.length,M=[];r--;)M[r]=I.trak(k[r]);return I.box.apply(null,[I.types.moov,I.mvhd(k[0].timescale,k[0].duration)].concat(M).concat(I.mvex(k)))},I.mvex=function(k){for(var r=k.length,M=[];r--;)M[r]=I.trex(k[r]);return I.box.apply(null,[I.types.mvex].concat(M))},I.mvhd=function(k,r){r*=k;var M=Math.floor(r/(G+1)),b=Math.floor(r%(G+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,M>>24,M>>16&255,M>>8&255,M&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return I.box(I.types.mvhd,f)},I.sdtp=function(k){var r=k.samples||[],M=new Uint8Array(4+r.length),b,f;for(b=0;b<r.length;b++)f=r[b].flags,M[b+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return I.box(I.types.sdtp,M)},I.stbl=function(k){return I.box(I.types.stbl,I.stsd(k),I.box(I.types.stts,I.STTS),I.box(I.types.stsc,I.STSC),I.box(I.types.stsz,I.STSZ),I.box(I.types.stco,I.STCO))},I.avc1=function(k){var r=[],M=[],b,f,m;for(b=0;b<k.sps.length;b++)f=k.sps[b],m=f.byteLength,r.push(m>>>8&255),r.push(m&255),r=r.concat(Array.prototype.slice.call(f));for(b=0;b<k.pps.length;b++)f=k.pps[b],m=f.byteLength,M.push(m>>>8&255),M.push(m&255),M=M.concat(Array.prototype.slice.call(f));var l=I.box(I.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|k.sps.length].concat(r).concat([k.pps.length]).concat(M))),o=k.width,a=k.height,c=k.pixelRatio[0],s=k.pixelRatio[1];return I.box(I.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,o&255,a>>8&255,a&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]),l,I.box(I.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),I.box(I.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])))},I.esds=function(k){var r=k.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(k.config).concat([6,1,2]))},I.mp4a=function(k){var r=k.samplerate;return I.box(I.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),I.box(I.types.esds,I.esds(k)))},I.mp3=function(k){var r=k.samplerate;return I.box(I.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,k.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},I.stsd=function(k){return k.type==="audio"?!k.isAAC&&k.codec==="mp3"?I.box(I.types.stsd,I.STSD,I.mp3(k)):I.box(I.types.stsd,I.STSD,I.mp4a(k)):I.box(I.types.stsd,I.STSD,I.avc1(k))},I.tkhd=function(k){var r=k.id,M=k.duration*k.timescale,b=k.width,f=k.height,m=Math.floor(M/(G+1)),l=Math.floor(M%(G+1));return I.box(I.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,l>>24,l>>16&255,l>>8&255,l&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,b>>8&255,b&255,0,0,f>>8&255,f&255,0,0]))},I.traf=function(k,r){var M=I.sdtp(k),b=k.id,f=Math.floor(r/(G+1)),m=Math.floor(r%(G+1));return I.box(I.types.traf,I.box(I.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),I.box(I.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,m>>24,m>>16&255,m>>8&255,m&255])),I.trun(k,M.length+16+20+8+16+8+8),M)},I.trak=function(k){return k.duration=k.duration||4294967295,I.box(I.types.trak,I.tkhd(k),I.mdia(k))},I.trex=function(k){var r=k.id;return I.box(I.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},I.trun=function(k,r){var M=k.samples||[],b=M.length,f=12+16*b,m=new Uint8Array(f),l,o,a,c,s,i;for(r+=8+f,m.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),l=0;l<b;l++)o=M[l],a=o.duration,c=o.size,s=o.flags,i=o.cts,m.set([a>>>24&255,a>>>16&255,a>>>8&255,a&255,c>>>24&255,c>>>16&255,c>>>8&255,c&255,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,s.degradPrio&240<<8,s.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*l);return I.box(I.types.trun,m)},I.initSegment=function(k){I.types||I.init();var r=I.moov(k),M=new Uint8Array(I.FTYP.byteLength+r.byteLength);return M.set(I.FTYP),M.set(r,I.FTYP.byteLength),M},I}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,V.default=P},"./src/remux/mp4-remuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return i}),U.d(V,"normalizePts",function(){return n});var G=U("./src/polyfills/number.ts"),P=U("./src/remux/aac-helper.ts"),I=U("./src/remux/mp4-generator.ts"),K=U("./src/events.ts"),k=U("./src/errors.ts"),r=U("./src/utils/logger.ts"),M=U("./src/types/loader.ts"),b=U("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var S=1;S<arguments.length;S++){var v=arguments[S];for(var E in v)Object.prototype.hasOwnProperty.call(v,E)&&(R[E]=v[E])}return R},f.apply(this,arguments)}var m=10*1e3,l=1024,o=1152,a=null,c=null,s=!1,i=function(){function R(v,E,h,p){if(p===void 0&&(p=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=v,this.config=E,this.typeSupported=h,this.ISGenerated=!1,a===null){var _=navigator.userAgent||"",g=_.match(/Chrome\/(\d+)/i);a=g?parseInt(g[1]):0}if(c===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);c=w?parseInt(w[1]):0}s=!!a&&a<75||!!c&&c<600}var S=R.prototype;return S.destroy=function(){},S.resetTimeStamp=function(E){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=E},S.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},S.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},S.getVideoStartPts=function(E){var h=!1,p=E.reduce(function(_,g){var w=g.pts-_;return w<-4294967296?(h=!0,n(_,g.pts)):w>0?_:g.pts},E[0].pts);return h&&r.logger.debug("PTS rollover detected"),p},S.remux=function(E,h,p,_,g,w,j,B){var A,H,F,x,Y,q,ie=g,me=g,$e=E.pid>-1,xe=h.pid>-1,Ie=h.samples.length,Je=E.samples.length>0,Ye=Ie>1,ve=(!$e||Je)&&(!xe||Ye)||this.ISGenerated||j;if(ve){this.ISGenerated||(F=this.generateIS(E,h,g));var fe=this.isVideoContiguous,lt=-1;if(Ye&&(lt=O(h.samples),!fe&&this.config.forceKeyFrameOnDiscontinuity))if(q=!0,lt>0){r.logger.warn("[mp4-remuxer]: Dropped "+lt+" out of "+Ie+" video samples due to a missing keyframe");var qt=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(lt),h.dropped+=lt,me+=(h.samples[0].pts-qt)/(h.timescale||9e4)}else lt===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Ie+" video samples"),q=!1);if(this.ISGenerated){if(Je&&Ye){var Ft=this.getVideoStartPts(h.samples),Ot=n(E.samples[0].pts,Ft)-Ft,Ve=Ot/h.inputTimeScale;ie+=Math.max(0,Ve),me+=Math.max(0,-Ve)}if(Je){if(E.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),F=this.generateIS(E,h,g)),H=this.remuxAudio(E,ie,this.isAudioContiguous,w,xe||Ye||B===M.PlaylistLevelType.AUDIO?me:void 0),Ye){var vt=H?H.endPTS-H.startPTS:0;h.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),F=this.generateIS(E,h,g)),A=this.remuxVideo(h,me,fe,vt)}}else Ye&&(A=this.remuxVideo(h,me,fe,0));A&&(A.firstKeyFrame=lt,A.independent=lt!==-1)}}return this.ISGenerated&&(p.samples.length&&(Y=this.remuxID3(p,g)),_.samples.length&&(x=this.remuxText(_,g))),{audio:H,video:A,initSegment:F,independent:q,text:x,id3:Y}},S.generateIS=function(E,h,p){var _=E.samples,g=h.samples,w=this.typeSupported,j={},B=!Object(G.isFiniteNumber)(this._initPTS),A="audio/mp4",H,F,x;if(B&&(H=F=Infinity),E.config&&_.length&&(E.timescale=E.samplerate,E.isAAC||(w.mpeg?(A="audio/mpeg",E.codec=""):w.mp3&&(E.codec="mp3")),j.audio={id:"audio",container:A,codec:E.codec,initSegment:!E.isAAC&&w.mpeg?new Uint8Array(0):I.default.initSegment([E]),metadata:{channelCount:E.channelCount}},B&&(x=E.inputTimeScale,H=F=_[0].pts-Math.round(x*p))),h.sps&&h.pps&&g.length&&(h.timescale=h.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:I.default.initSegment([h]),metadata:{width:h.width,height:h.height}},B)){x=h.inputTimeScale;var Y=this.getVideoStartPts(g),q=Math.round(x*p);F=Math.min(F,n(g[0].dts,Y)-q),H=Math.min(H,Y-q)}if(Object.keys(j).length)return this.ISGenerated=!0,B&&(this._initPTS=H,this._initDTS=F),{tracks:j,initPTS:H,timescale:x}},S.remuxVideo=function(E,h,p,_){var g=E.inputTimeScale,w=E.samples,j=[],B=w.length,A=this._initPTS,H=this.nextAvcDts,F=8,x,Y,q,ie=Number.POSITIVE_INFINITY,me=Number.NEGATIVE_INFINITY,$e=0,xe=!1;if(!p||H===null){var Ie=h*g,Je=w[0].pts-n(w[0].dts,w[0].pts);H=Ie-Je}for(var Ye=0;Ye<B;Ye++){var ve=w[Ye];if(ve.pts=n(ve.pts-A,H),ve.dts=n(ve.dts-A,H),ve.dts>ve.pts){var fe=9e4*.2;$e=Math.max(Math.min($e,ve.pts-ve.dts),-1*fe)}ve.dts<w[Ye>0?Ye-1:Ye].dts&&(xe=!0)}xe&&w.sort(function(Jt,Et){var Ct=Jt.dts-Et.dts,st=Jt.pts-Et.pts;return Ct||st}),Y=w[0].dts,q=w[w.length-1].dts;var lt=Math.round((q-Y)/(B-1));if($e<0){if($e<lt*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-lt,!0)+" ms");for(var qt=$e,Ft=0;Ft<B;Ft++)w[Ft].dts=qt=Math.max(qt,w[Ft].pts-lt),w[Ft].pts=Math.max(qt,w[Ft].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)($e,!0)+" ms to overcome this issue");for(var Ot=0;Ot<B;Ot++)w[Ot].dts=w[Ot].dts+$e}Y=w[0].dts}if(p){var Ve=Y-H,vt=Ve>lt,ht=Ve<-1;if(vt||ht){vt?r.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(Ve,!0)+" ms ("+Ve+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-Ve,!0)+" ms ("+Ve+"dts) overlapping between fragments detected"),Y=H;var Bt=w[0].pts-Ve;w[0].dts=Y,w[0].pts=Bt,r.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Bt,!0)+"/"+Object(b.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(Ve,!0)+" ms")}}s&&(Y=Math.max(0,Y));for(var se=0,Ue=0,Ge=0;Ge<B;Ge++){for(var et=w[Ge],Wt=et.units,Yt=Wt.length,on=0,nt=0;nt<Yt;nt++)on+=Wt[nt].data.length;Ue+=on,se+=Yt,et.length=on,et.dts=Math.max(et.dts,Y),et.pts=Math.max(et.pts,et.dts,0),ie=Math.min(et.pts,ie),me=Math.max(et.pts,me)}q=w[B-1].dts;var tn=Ue+4*se+8,Ln;try{Ln=new Uint8Array(tn)}catch(Jt){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:tn,reason:"fail allocating video mdat "+tn});return}var We=new DataView(Ln.buffer);We.setUint32(0,tn),Ln.set(I.default.types.mdat,4);for(var Fe=0;Fe<B;Fe++){for(var yt=w[Fe],At=yt.units,tt=0,ot=0,De=At.length;ot<De;ot++){var ye=At[ot],we=ye.data,ae=ye.data.byteLength;We.setUint32(F,ae),F+=4,Ln.set(we,F),F+=ae,tt+=4+ae}if(Fe<B-1)x=w[Fe+1].dts-yt.dts;else{var oe=this.config,pe=yt.dts-w[Fe>0?Fe-1:Fe].dts;if(oe.stretchShortVideoTrack&&this.nextAudioPts!==null){var _e=Math.floor(oe.maxBufferHole*g),be=(_?ie+_*g:this.nextAudioPts)-yt.pts;be>_e?(x=be-pe,x<0&&(x=pe),r.logger.log("[mp4-remuxer]: It is approximately "+be/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=pe}else x=pe}var Ke=Math.round(yt.pts-yt.dts);j.push(new T(yt.key,x,tt,Ke))}if(j.length&&a&&a<70){var St=j[0].flags;St.dependsOn=2,St.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=q+x,this.isVideoContiguous=!0;var nn=I.default.moof(E.sequenceNumber++,Y,f({},E,{samples:j})),An="video",bt={data1:nn,data2:Ln,startPTS:ie/g,endPTS:(me+x)/g,startDTS:Y/g,endDTS:H/g,type:An,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:E.dropped};return E.samples=[],E.dropped=0,console.assert(Ln.length,"MDAT length must not be zero"),bt},S.remuxAudio=function(E,h,p,_,g){var w=E.inputTimeScale,j=E.samplerate?E.samplerate:w,B=w/j,A=E.isAAC?l:o,H=A*B,F=this._initPTS,x=!E.isAAC&&this.typeSupported.mpeg,Y=[],q=E.samples,ie=x?0:8,me=this.nextAudioPts||-1,$e=h*w;if(this.isAudioContiguous=p=p||q.length&&me>0&&(_&&Math.abs($e-me)<9e3||Math.abs(n(q[0].pts-F,$e)-me)<20*H),q.forEach(function(we){we.pts=n(we.pts-F,$e)}),!p||me<0){if(q=q.filter(function(we){return we.pts>=0}),!q.length)return;g===0?me=0:_?me=Math.max(0,$e):me=q[0].pts}if(E.isAAC)for(var xe=g!==void 0,Ie=this.config.maxAudioFramesDrift,Je=0,Ye=me;Je<q.length;Je++){var ve=q[Je],fe=ve.pts,lt=fe-Ye,qt=Math.abs(1e3*lt/w);if(lt<=-Ie*H&&xe)Je===0&&(r.logger.warn("Audio frame @ "+(fe/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*lt/w)+" ms."),this.nextAudioPts=me=Ye=fe);else if(lt>=Ie*H&&qt<m&&xe){var Ft=Math.round(lt/H);Ye=fe-Ft*H,Ye<0&&(Ft--,Ye+=H),Je===0&&(this.nextAudioPts=me=Ye),r.logger.warn("[mp4-remuxer]: Injecting "+Ft+" audio frame @ "+(Ye/w).toFixed(3)+"s due to "+Math.round(1e3*lt/w)+" ms gap.");for(var Ot=0;Ot<Ft;Ot++){var Ve=Math.max(Ye,0),vt=P.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);vt||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),vt=ve.unit.subarray()),q.splice(Je,0,{unit:vt,pts:Ve}),Ye+=H,Je++}}ve.pts=Ye,Ye+=H}for(var ht=null,Bt=null,se,Ue=0,Ge=q.length;Ge--;)Ue+=q[Ge].unit.byteLength;for(var et=0,Wt=q.length;et<Wt;et++){var Yt=q[et],on=Yt.unit,nt=Yt.pts;if(Bt!==null){var tn=Y[et-1];tn.duration=Math.round((nt-Bt)/B)}else if(p&&E.isAAC&&(nt=me),ht=nt,Ue>0){Ue+=ie;try{se=new Uint8Array(Ue)}catch(we){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ue,reason:"fail allocating audio mdat "+Ue});return}if(!x){var Ln=new DataView(se.buffer);Ln.setUint32(0,Ue),se.set(I.default.types.mdat,4)}}else return;se.set(on,ie);var We=on.byteLength;ie+=We,Y.push(new T(!0,A,We,0)),Bt=nt}var Fe=Y.length;if(!Fe)return;var yt=Y[Y.length-1];this.nextAudioPts=me=Bt+B*yt.duration;var At=x?new Uint8Array(0):I.default.moof(E.sequenceNumber++,ht/B,f({},E,{samples:Y}));E.samples=[];var tt=ht/w,ot=me/w,De="audio",ye={data1:At,data2:se,startPTS:tt,endPTS:ot,startDTS:tt,endDTS:ot,type:De,hasAudio:!0,hasVideo:!1,nb:Fe};return this.isAudioContiguous=!0,console.assert(se.length,"MDAT length must not be zero"),ye},S.remuxEmptyAudio=function(E,h,p,_){var g=E.inputTimeScale,w=E.samplerate?E.samplerate:g,j=g/w,B=this.nextAudioPts,A=(B!==null?B:_.startDTS*g)+this._initDTS,H=_.endDTS*g+this._initDTS,F=j*l,x=Math.ceil((H-A)/F),Y=P.default.getSilentFrame(E.manifestCodec||E.codec,E.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var q=[],ie=0;ie<x;ie++){var me=A+ie*F;q.push({unit:Y,pts:me,dts:me})}return E.samples=q,this.remuxAudio(E,h,p,!1)},S.remuxID3=function(E,h){var p=E.samples.length;if(!p)return;for(var _=E.inputTimeScale,g=this._initPTS,w=this._initDTS,j=0;j<p;j++){var B=E.samples[j];B.pts=n(B.pts-g,h*_)/_,B.dts=n(B.dts-w,h*_)/_}var A=E.samples;return E.samples=[],{samples:A}},S.remuxText=function(E,h){var p=E.samples.length;if(!p)return;for(var _=E.inputTimeScale,g=this._initPTS,w=0;w<p;w++){var j=E.samples[w];j.pts=n(j.pts-g,h*_)/_}E.samples.sort(function(A,H){return A.pts-H.pts});var B=E.samples;return E.samples=[],{samples:B}},R}();function n(R,S){var v;if(S===null)return R;for(S<R?v=-8589934592:v=8589934592;Math.abs(R-S)>4294967296;)R+=v;return R}function O(R){for(var S=0;S<R.length;S++)if(R[S].key)return S;return-1}var T=function(S,v,E,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=E,this.cts=h,this.flags=new C(S)},C=function(S){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=S?2:1,this.isNonSync=S?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/polyfills/number.ts"),P=U("./src/utils/mp4-tools.ts"),I=U("./src/loader/fragment.ts"),K=U("./src/utils/logger.ts"),k=function(){function b(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var f=b.prototype;return f.destroy=function(){},f.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(l,o,a){this.audioCodec=o,this.videoCodec=a,this.generateInitSegment(l),this.emitInitSegment=!0},f.generateInitSegment=function(l){var o=this.audioCodec,a=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(P.parseInitSegment)(l);o||(o=M(c.audio,I.ElementaryStreamTypes.AUDIO)),a||(a=M(c.video,I.ElementaryStreamTypes.VIDEO));var s={};c.audio&&c.video?s.audiovideo={container:"video/mp4",codec:o+","+a,initSegment:l,id:"main"}:c.audio?s.audio={container:"audio/mp4",codec:o,initSegment:l,id:"audio"}:c.video?s.video={container:"video/mp4",codec:a,initSegment:l,id:"main"}:K.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},f.remux=function(l,o,a,c,s){var i=this.initPTS,n=this.lastEndDTS,O={audio:void 0,video:void 0,text:c,id3:a,initSegment:void 0};Object(G.isFiniteNumber)(n)||(n=this.lastEndDTS=s||0);var T=o.samples;if(!T||!T.length)return O;var C={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(T),R=this.initData),!R||!R.length)return K.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),O;this.emitInitSegment&&(C.tracks=this.initTracks,this.emitInitSegment=!1),Object(G.isFiniteNumber)(i)||(this.initPTS=C.initPTS=i=r(R,T,n));var S=Object(P.getDuration)(T,R),v=n,E=S+v;Object(P.offsetStartDTS)(R,T,i),S>0?this.lastEndDTS=E:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!R.audio,p=!!R.video,_="";h&&(_+="audio"),p&&(_+="video");var g={data1:T,startPTS:v,startDTS:v,endPTS:E,endDTS:E,type:_,hasAudio:h,hasVideo:p,nb:1,dropped:0};return O.audio=g.type==="audio"?g:void 0,O.video=g.type!=="audio"?g:void 0,O.text=c,O.id3=a,O.initSegment=C,O},b}(),r=function(f,m,l){return Object(P.getStartDTS)(f,m)-l};function M(b,f){var m=b==null?void 0:b.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||f===I.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=k},"./src/task-loop.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var I=P.prototype;return I.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},I.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},I.onHandlerDestroyed=function(){},I.hasInterval=function(){return!!this._tickInterval},I.hasNextTick=function(){return!!this._tickTimer},I.setInterval=function(k){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,k),!0)},I.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},I.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},I.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},I.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},I.doTick=function(){},P}()},"./src/types/cmcd.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"CMCDVersion",function(){return G}),U.d(V,"CMCDObjectType",function(){return P}),U.d(V,"CMCDStreamingFormat",function(){return I}),U.d(V,"CMCDStreamType",function(){return K});var G=1,P;(function(k){k.MANIFEST="m",k.AUDIO="a",k.VIDEO="v",k.MUXED="av",k.INIT="i",k.CAPTION="c",k.TIMED_TEXT="tt",k.KEY="k",k.OTHER="o"})(P||(P={}));var I;(function(k){k.DASH="d",k.HLS="h",k.SMOOTH="s",k.OTHER="o"})(I||(I={}));var K;(function(k){k.VOD="v",k.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"HlsSkip",function(){return I}),U.d(V,"getSkipValue",function(){return K}),U.d(V,"HlsUrlParameters",function(){return k}),U.d(V,"Level",function(){return r});function G(M,b){for(var f=0;f<b.length;f++){var m=b[f];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(M,m.key,m)}}function P(M,b,f){return b&&G(M.prototype,b),f&&G(M,f),M}var I;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(I||(I={}));function K(M,b){var f=M.canSkipUntil,m=M.canSkipDateRanges,l=M.endSN,o=b!==void 0?b-l:0;return f&&o<f?m?I.v2:I.Yes:I.No}var k=function(){function M(f,m,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=m,this.skip=l}var b=M.prototype;return b.addDirectives=function(m){var l=new self.URL(m);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},M}(),r=function(){function M(b){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return P(M,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(f){var m=f%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),M}()},"./src/types/loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"PlaylistContextType",function(){return G}),U.d(V,"PlaylistLevelType",function(){return P});var G;(function(I){I.MANIFEST="manifest",I.LEVEL="level",I.AUDIO_TRACK="audioTrack",I.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var P;(function(I){I.MAIN="main",I.AUDIO="audio",I.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"ChunkMetadata",function(){return G});var G=function(K,k,r,M,b,f){M===void 0&&(M=0),b===void 0&&(b=-1),f===void 0&&(f=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=K,this.sn=k,this.id=r,this.size=M,this.part=b,this.partial=f};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"AttrList",function(){return I});var G=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,I=function(){function K(r){typeof r=="string"&&(r=K.parseAttrList(r));for(var M in r)r.hasOwnProperty(M)&&(this[M]=r[M])}var k=K.prototype;return k.decimalInteger=function(M){var b=parseInt(this[M],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},k.hexadecimalInteger=function(M){if(this[M]){var b=(this[M]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var f=new Uint8Array(b.length/2),m=0;m<b.length/2;m++)f[m]=parseInt(b.slice(m*2,m*2+2),16);return f}else return null},k.hexadecimalIntegerAsNumber=function(M){var b=parseInt(this[M],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},k.decimalFloatingPoint=function(M){return parseFloat(this[M])},k.optionalFloat=function(M,b){var f=this[M];return f?parseFloat(f):b},k.enumeratedString=function(M){return this[M]},k.bool=function(M){return this[M]==="YES"},k.decimalResolution=function(M){var b=G.exec(this[M]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},K.parseAttrList=function(M){var b,f={},m='"';for(P.lastIndex=0;(b=P.exec(M))!==null;){var l=b[2];l.indexOf(m)===0&&l.lastIndexOf(m)===l.length-1&&(l=l.slice(1,-1)),f[b[1]]=l}return f},K}()},"./src/utils/binary-search.ts":function(Z,V,U){"use strict";U.r(V);var G={search:function(I,K){for(var k=0,r=I.length-1,M=null,b=null;k<=r;){M=(k+r)/2|0,b=I[M];var f=K(b);if(f>0)k=M+1;else if(f<0)r=M-1;else return b}return null}};V.default=G},"./src/utils/buffer-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"BufferHelper",function(){return I});var G=U("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},I=function(){function K(){}return K.isBuffered=function(r,M){try{if(r){for(var b=K.getBuffered(r),f=0;f<b.length;f++)if(M>=b.start(f)&&M<=b.end(f))return!0}}catch(m){}return!1},K.bufferInfo=function(r,M,b){try{if(r){var f=K.getBuffered(r),m=[],l;for(l=0;l<f.length;l++)m.push({start:f.start(l),end:f.end(l)});return this.bufferedInfo(m,M,b)}}catch(o){}return{len:0,start:M,end:M,nextStart:void 0}},K.bufferedInfo=function(r,M,b){M=Math.max(0,M),r.sort(function(C,R){var S=C.start-R.start;return S||R.end-C.end});var f=[];if(b)for(var m=0;m<r.length;m++){var l=f.length;if(l){var o=f[l-1].end;r[m].start-o<b?r[m].end>o&&(f[l-1].end=r[m].end):f.push(r[m])}else f.push(r[m])}else f=r;for(var a=0,c,s=M,i=M,n=0;n<f.length;n++){var O=f[n].start,T=f[n].end;if(M+b>=O&&M<T)s=O,i=T,a=i-M;else if(M+b<O){c=O;break}}return{len:a,start:s||0,end:i||0,nextStart:c}},K.getBuffered=function(r){try{return r.buffered}catch(M){return G.logger.log("failed to get media.buffered",M),P}},K}()},"./src/utils/cea-608-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"Row",function(){return i}),U.d(V,"CaptionScreen",function(){return n});var G=U("./src/utils/logger.ts"),P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},I=function(E){var h=E;return P.hasOwnProperty(E)&&(h=P[E]),String.fromCharCode(h)},K=15,k=100,r={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},M={17:2,18:4,21:6,22:8,23:10,19:13,20:15},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(v){v[v.ERROR=0]="ERROR",v[v.TEXT=1]="TEXT",v[v.WARNING=2]="WARNING",v[v.INFO=2]="INFO",v[v.DEBUG=3]="DEBUG",v[v.DATA=3]="DATA"})(l||(l={}));var o=function(){function v(){this.time=null,this.verboseLevel=l.ERROR}var E=v.prototype;return E.log=function(p,_){this.verboseLevel>=p&&G.logger.log(this.time+" ["+p+"] "+_)},v}(),a=function(E){for(var h=[],p=0;p<E.length;p++)h.push(E[p].toString(16));return h},c=function(){function v(h,p,_,g,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=p||!1,this.italics=_||!1,this.background=g||"black",this.flash=w||!1}var E=v.prototype;return E.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},E.setStyles=function(p){for(var _=["foreground","underline","italics","background","flash"],g=0;g<_.length;g++){var w=_[g];p.hasOwnProperty(w)&&(this[w]=p[w])}},E.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},E.equals=function(p){return this.foreground===p.foreground&&this.underline===p.underline&&this.italics===p.italics&&this.background===p.background&&this.flash===p.flash},E.copy=function(p){this.foreground=p.foreground,this.underline=p.underline,this.italics=p.italics,this.background=p.background,this.flash=p.flash},E.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),s=function(){function v(h,p,_,g,w,j){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new c(p,_,g,w,j)}var E=v.prototype;return E.reset=function(){this.uchar=" ",this.penState.reset()},E.setChar=function(p,_){this.uchar=p,this.penState.copy(_)},E.setPenState=function(p){this.penState.copy(p)},E.equals=function(p){return this.uchar===p.uchar&&this.penState.equals(p.penState)},E.copy=function(p){this.uchar=p.uchar,this.penState.copy(p.penState)},E.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),i=function(){function v(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var p=0;p<k;p++)this.chars.push(new s);this.logger=h,this.pos=0,this.currPenState=new c}var E=v.prototype;return E.equals=function(p){for(var _=!0,g=0;g<k;g++)if(!this.chars[g].equals(p.chars[g])){_=!1;break}return _},E.copy=function(p){for(var _=0;_<k;_++)this.chars[_].copy(p.chars[_])},E.isEmpty=function(){for(var p=!0,_=0;_<k;_++)if(!this.chars[_].isEmpty()){p=!1;break}return p},E.setCursor=function(p){this.pos!==p&&(this.pos=p),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>k&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=k)},E.moveCursor=function(p){var _=this.pos+p;if(p>1)for(var g=this.pos+1;g<_+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(_)},E.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},E.insertChar=function(p){p>=144&&this.backSpace();var _=I(p);if(this.pos>=k){this.logger.log(l.ERROR,"Cannot insert "+p.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},E.clearFromPos=function(p){var _;for(_=p;_<k;_++)this.chars[_].reset()},E.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},E.clearToEndOfRow=function(){this.clearFromPos(this.pos)},E.getTextString=function(){for(var p=[],_=!0,g=0;g<k;g++){var w=this.chars[g].uchar;w!==" "&&(_=!1),p.push(w)}return _?"":p.join("")},E.setPenStyles=function(p){this.currPenState.setStyles(p);var _=this.chars[this.pos];_.setPenState(this.currPenState)},v}(),n=function(){function v(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var p=0;p<K;p++)this.rows.push(new i(h));this.logger=h,this.currRow=K-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var E=v.prototype;return E.reset=function(){for(var p=0;p<K;p++)this.rows[p].clear();this.currRow=K-1},E.equals=function(p){for(var _=!0,g=0;g<K;g++)if(!this.rows[g].equals(p.rows[g])){_=!1;break}return _},E.copy=function(p){for(var _=0;_<K;_++)this.rows[_].copy(p.rows[_])},E.isEmpty=function(){for(var p=!0,_=0;_<K;_++)if(!this.rows[_].isEmpty()){p=!1;break}return p},E.backSpace=function(){var p=this.rows[this.currRow];p.backSpace()},E.clearToEndOfRow=function(){var p=this.rows[this.currRow];p.clearToEndOfRow()},E.insertChar=function(p){var _=this.rows[this.currRow];_.insertChar(p)},E.setPen=function(p){var _=this.rows[this.currRow];_.setPenStyles(p)},E.moveCursor=function(p){var _=this.rows[this.currRow];_.moveCursor(p)},E.setCursor=function(p){this.logger.log(l.INFO,"setCursor: "+p);var _=this.rows[this.currRow];_.setCursor(p)},E.setPAC=function(p){this.logger.log(l.INFO,"pacData = "+JSON.stringify(p));var _=p.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var g=0;g<K;g++)this.rows[g].clear();var w=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var B=j.rows[w].cueStartTime,A=this.logger.time;if(B&&A!==null&&B<A)for(var H=0;H<this.nrRollUpRows;H++)this.rows[_-this.nrRollUpRows+H+1].copy(j.rows[w+H])}}this.currRow=_;var F=this.rows[this.currRow];if(p.indent!==null){var x=p.indent,Y=Math.max(x-1,0);F.setCursor(p.indent),p.color=F.chars[Y].penState.foreground}var q={foreground:p.color,underline:p.underline,italics:p.italics,background:"black",flash:!1};this.setPen(q)},E.setBkgData=function(p){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(p)),this.backSpace(),this.setPen(p),this.insertChar(32)},E.setRollUpRows=function(p){this.nrRollUpRows=p},E.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var p=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(p,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(l.INFO,"Rolling up")},E.getDisplayText=function(p){p=p||!1;for(var _=[],g="",w=-1,j=0;j<K;j++){var B=this.rows[j].getTextString();B&&(w=j+1,p?_.push("Row "+w+": '"+B+"'"):_.push(B.trim()))}return _.length>0&&(p?g="["+_.join(" | ")+"]":g=_.join(`
`)),g},E.getTextAndFormat=function(){return this.rows},v}(),O=function(){function v(h,p,_){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=h,this.outputFilter=p,this.mode=null,this.verbose=0,this.displayedMemory=new n(_),this.nonDisplayedMemory=new n(_),this.lastOutputScreen=new n(_),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var E=v.prototype;return E.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},E.getHandler=function(){return this.outputFilter},E.setHandler=function(p){this.outputFilter=p},E.setPAC=function(p){this.writeScreen.setPAC(p)},E.setBkgData=function(p){this.writeScreen.setBkgData(p)},E.setMode=function(p){if(p===this.mode)return;this.mode=p,this.logger.log(l.INFO,"MODE="+p),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=p},E.insertChars=function(p){for(var _=0;_<p.length;_++)this.writeScreen.insertChar(p[_]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},E.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},E.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},E.ccAOF=function(){},E.ccAON=function(){},E.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},E.ccRU=function(p){this.logger.log(l.INFO,"RU("+p+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(p)},E.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},E.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},E.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},E.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},E.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},E.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},E.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},E.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var p=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=p,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},E.ccTO=function(p){this.logger.log(l.INFO,"TO("+p+") - Tab Offset"),this.writeScreen.moveCursor(p)},E.ccMIDROW=function(p){var _={flash:!1};if(_.underline=p%2===1,_.italics=p>=46,_.italics)_.foreground="white";else{var g=Math.floor(p/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=w[g]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},E.outputDataUpdate=function(p){p===void 0&&(p=!1);var _=this.logger.time;if(_===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=_:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,_,this.lastOutputScreen),p&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},E.cueSplitAtTime=function(p){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,p,this.displayedMemory),this.cueStartTime=p))},v}(),T=function(){function v(h,p,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new o;this.channels=[null,new O(h,p,g),new O(h+1,_,g)],this.cmdHistory=S(),this.logger=g}var E=v.prototype;return E.getHandler=function(p){return this.channels[p].getHandler()},E.setHandler=function(p,_){this.channels[p].setHandler(_)},E.addData=function(p,_){var g,w,j,B=!1;this.logger.time=p;for(var A=0;A<_.length;A+=2){if(w=_[A]&127,j=_[A+1]&127,w===0&&j===0)continue;if(this.logger.log(l.DATA,"["+a([_[A],_[A+1]])+"] -> ("+a([w,j])+")"),g=this.parseCmd(w,j),g||(g=this.parseMidrow(w,j)),g||(g=this.parsePAC(w,j)),g||(g=this.parseBackgroundAttributes(w,j)),!g&&(B=this.parseChars(w,j),B)){var H=this.currentChannel;if(H&&H>0){var F=this.channels[H];F.insertChars(B)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!B&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+a([w,j])+" orig: "+a([_[A],_[A+1]]))}},E.parseCmd=function(p,_){var g=this.cmdHistory,w=(p===20||p===28||p===21||p===29)&&_>=32&&_<=47,j=(p===23||p===31)&&_>=33&&_<=35;if(!(w||j))return!1;if(R(p,_,g))return C(null,null,g),this.logger.log(l.DEBUG,"Repeated command ("+a([p,_])+") is dropped"),!0;var B=p===20||p===21||p===23?1:2,A=this.channels[B];return p===20||p===21||p===28||p===29?_===32?A.ccRCL():_===33?A.ccBS():_===34?A.ccAOF():_===35?A.ccAON():_===36?A.ccDER():_===37?A.ccRU(2):_===38?A.ccRU(3):_===39?A.ccRU(4):_===40?A.ccFON():_===41?A.ccRDC():_===42?A.ccTR():_===43?A.ccRTD():_===44?A.ccEDM():_===45?A.ccCR():_===46?A.ccENM():_===47&&A.ccEOC():A.ccTO(_-32),C(p,_,g),this.currentChannel=B,!0},E.parseMidrow=function(p,_){var g=0;if((p===17||p===25)&&_>=32&&_<=47){if(p===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[g];return w?(w.ccMIDROW(_),this.logger.log(l.DEBUG,"MIDROW ("+a([p,_])+")"),!0):!1}return!1},E.parsePAC=function(p,_){var g,w=this.cmdHistory,j=(p>=17&&p<=23||p>=25&&p<=31)&&_>=64&&_<=127,B=(p===16||p===24)&&_>=64&&_<=95;if(!(j||B))return!1;if(R(p,_,w))return C(null,null,w),!0;var A=p<=23?1:2;_>=64&&_<=95?g=A===1?r[p]:b[p]:g=A===1?M[p]:f[p];var H=this.channels[A];return H?(H.setPAC(this.interpretPAC(g,_)),C(p,_,w),this.currentChannel=A,!0):!1},E.interpretPAC=function(p,_){var g,w={color:null,italics:!1,indent:null,underline:!1,row:p};return _>95?g=_-96:g=_-64,w.underline=(g&1)===1,g<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((g-16)/2)*4,w},E.parseChars=function(p,_){var g,w=null,j=null;if(p>=25?(g=2,j=p-8):(g=1,j=p),j>=17&&j<=19){var B;j===17?B=_+80:j===18?B=_+112:B=_+144,this.logger.log(l.INFO,"Special char '"+I(B)+"' in channel "+g),w=[B]}else p>=32&&p<=127&&(w=_===0?[p]:[p,_]);if(w){var A=a(w);this.logger.log(l.DEBUG,"Char codes = "+A.join(",")),C(p,_,this.cmdHistory)}return w},E.parseBackgroundAttributes=function(p,_){var g=(p===16||p===24)&&_>=32&&_<=47,w=(p===23||p===31)&&_>=45&&_<=47;if(!(g||w))return!1;var j,B={};p===16||p===24?(j=Math.floor((_-32)/2),B.background=m[j],_%2===1&&(B.background=B.background+"_semi")):_===45?B.background="transparent":(B.foreground="black",_===47&&(B.underline=!0));var A=p<=23?1:2,H=this.channels[A];return H.setBkgData(B),C(p,_,this.cmdHistory),!0},E.reset=function(){for(var p=0;p<Object.keys(this.channels).length;p++){var _=this.channels[p];_&&_.reset()}this.cmdHistory=S()},E.cueSplitAtTime=function(p){for(var _=0;_<this.channels.length;_++){var g=this.channels[_];g&&g.cueSplitAtTime(p)}},v}();function C(v,E,h){h.a=v,h.b=E}function R(v,E,h){return h.a===v&&h.b===E}function S(){return{a:null,b:null}}V.default=T},"./src/utils/codecs.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"isCodecType",function(){return P}),U.d(V,"isCodecSupportedInMp4",function(){return I});var G={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function P(K,k){var r=G[k];return!!r&&r[K.slice(0,4)]===!0}function I(K,k){return MediaSource.isTypeSupported((k||"video")+'/mp4;codecs="'+K+'"')}},"./src/utils/cues.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/vttparser.ts"),P=U("./src/utils/webvtt-parser.ts"),I=U("./src/utils/texttrack-utils.ts"),K=/\s/,k={newCue:function(M,b,f,m){for(var l=[],o,a,c,s,i,n=self.VTTCue||self.TextTrackCue,O=0;O<m.rows.length;O++)if(o=m.rows[O],c=!0,s=0,i="",!o.isEmpty()){for(var T=0;T<o.chars.length;T++)K.test(o.chars[T].uchar)&&c?s++:(i+=o.chars[T].uchar,c=!1);o.cueStartTime=b,b===f&&(f+=1e-4),s>=16?s--:s++;var C=Object(G.fixLineBreaks)(i.trim()),R=Object(P.generateCueId)(b,f,C);(!M||!M.cues||!M.cues.getCueById(R))&&(a=new n(b,f,C),a.id=R,a.line=O+1,a.align="left",a.position=10+Math.min(80,Math.floor(s*8/32)*10),l.push(a))}return M&&l.length&&(l.sort(function(S,v){return S.line==="auto"||v.line==="auto"?0:S.line>8&&v.line>8?v.line-S.line:S.line-v.line}),l.forEach(function(S){return Object(I.addCueToTrack)(M,S)})),l}};V.default=k},"./src/utils/discontinuities.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"findFirstFragWithCC",function(){return K}),U.d(V,"shouldAlignOnDiscontinuities",function(){return k}),U.d(V,"findDiscontinuousReferenceFrag",function(){return r}),U.d(V,"adjustSlidingStart",function(){return b}),U.d(V,"alignStream",function(){return f}),U.d(V,"alignPDT",function(){return l}),U.d(V,"alignFragmentByPDTDelta",function(){return o}),U.d(V,"alignMediaPlaylistByPDT",function(){return a});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/logger.ts"),I=U("./src/controller/level-helper.ts");function K(c,s){for(var i=null,n=0,O=c.length;n<O;n++){var T=c[n];if(T&&T.cc===s){i=T;break}}return i}function k(c,s,i){return!!(s.details&&(i.endCC>i.startCC||c&&c.cc<i.startCC))}function r(c,s){var i=c.fragments,n=s.fragments;if(!n.length||!i.length){P.logger.log("No fragments to align");return}var O=K(i,n[0].cc);if(!O||O&&!O.startPTS){P.logger.log("No frag in previous level to align on");return}return O}function M(c,s){if(c){var i=c.start+s;c.start=c.startPTS=i,c.endPTS=i+c.duration}}function b(c,s){for(var i=s.fragments,n=0,O=i.length;n<O;n++)M(i[n],c);s.fragmentHint&&M(s.fragmentHint,c),s.alignedSliding=!0}function f(c,s,i){if(!s)return;m(c,i,s),!i.alignedSliding&&s.details&&l(i,s.details),!i.alignedSliding&&s.details&&!i.skippedSegments&&Object(I.adjustSliding)(s.details,i)}function m(c,s,i){if(k(c,i,s)){var n=r(i.details,s);n&&Object(G.isFiniteNumber)(n.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+s.url),b(n.start,s))}}function l(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=c.fragments[0].programDateTime,O=(n-i)/1e3+s.fragments[0].start;O&&Object(G.isFiniteNumber)(O)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(n-i)+"ms, sliding:"+O.toFixed(3)+" "+c.url+" "),b(O,c))}function o(c,s){var i=c.programDateTime;if(!i)return;var n=(i-s)/1e3;c.start=c.startPTS=n,c.endPTS=n+c.duration}function a(c,s){if(!s.fragments.length||!c.hasProgramDateTime||!s.hasProgramDateTime)return;var i=s.fragments[0].programDateTime,n=s.fragments[0].start,O=i-n*1e3;c.fragments.forEach(function(T){o(T,O)}),c.fragmentHint&&o(c.fragmentHint,O),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/ewma.ts"),P=function(){function I(k,r,M){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=M,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new G.default(k),this.fast_=new G.default(r)}var K=I.prototype;return K.update=function(r,M){var b=this.slow_,f=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new G.default(r,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==M&&(this.fast_=new G.default(M,f.getEstimate(),f.getTotalWeight()))},K.sample=function(r,M){r=Math.max(r,this.minDelayMs_);var b=8*M,f=r/1e3,m=b/f;this.fast_.sample(f,m),this.slow_.sample(f,m)},K.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},I}();V.default=P},"./src/utils/ewma.ts":function(Z,V,U){"use strict";U.r(V);var G=function(){function P(K,k,r){k===void 0&&(k=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=k,this.totalWeight_=r}var I=P.prototype;return I.sample=function(k,r){var M=Math.pow(this.alpha_,k);this.estimate_=r*(1-M)+M*this.estimate_,this.totalWeight_+=k},I.getTotalWeight=function(){return this.totalWeight_},I.getEstimate=function(){if(this.alpha_){var k=1-Math.pow(this.alpha_,this.totalWeight_);if(k)return this.estimate_/k}return this.estimate_},P}();V.default=G},"./src/utils/fetch-loader.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"fetchSupported",function(){return o});var G=U("./src/polyfills/number.ts"),P=U("./src/loader/load-stats.ts"),I=U("./src/demux/chunk-cache.ts");function K(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,f(n,O)}function k(n){var O=typeof Map=="function"?new Map:void 0;return k=function(C){if(C===null||!b(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof O!="undefined"){if(O.has(C))return O.get(C);O.set(C,R)}function R(){return r(C,arguments,m(this).constructor)}return R.prototype=Object.create(C.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,C)},k(n)}function r(n,O,T){return M()?r=Reflect.construct:r=function(R,S,v){var E=[null];E.push.apply(E,S);var h=Function.bind.apply(R,E),p=new h;return v&&f(p,v.prototype),p},r.apply(null,arguments)}function M(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(n){return!1}}function b(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function f(n,O){return f=Object.setPrototypeOf||function(C,R){return C.__proto__=R,C},f(n,O)}function m(n){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},m(n)}function l(){return l=Object.assign||function(n){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&(n[C]=T[C])}return n},l.apply(this,arguments)}function o(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var a=function(){function n(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||s,this.controller=new self.AbortController,this.stats=new P.LoadStats}var O=n.prototype;return O.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},O.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},O.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},O.load=function(C,R,S){var v=this,E=this.stats;if(E.loading.start)throw new Error("Loader can only be used once.");E.loading.start=self.performance.now();var h=c(C,this.controller.signal),p=S.onProgress,_=C.responseType==="arraybuffer",g=_?"byteLength":"length";this.context=C,this.config=R,this.callbacks=S,this.request=this.fetchSetup(C,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),S.onTimeout(E,C,v.response)},R.timeout),self.fetch(this.request).then(function(w){if(v.response=v.loader=w,!w.ok){var j=w.status,B=w.statusText;throw new i(B||"fetch, bad network response",j,w)}return E.loading.first=Math.max(self.performance.now(),E.loading.start),E.total=parseInt(w.headers.get("Content-Length")||"0"),p&&Object(G.isFiniteNumber)(R.highWaterMark)?v.loadProgressively(w,E,C,R.highWaterMark,p):_?w.arrayBuffer():w.text()}).then(function(w){var j=v.response;self.clearTimeout(v.requestTimeout),E.loading.end=Math.max(self.performance.now(),E.loading.first),E.loaded=E.total=w[g];var B={url:j.url,data:w};p&&!Object(G.isFiniteNumber)(R.highWaterMark)&&p(E,C,w,j),S.onSuccess(B,E,C,j)}).catch(function(w){if(self.clearTimeout(v.requestTimeout),E.aborted)return;var j=w.code||0;S.onError({code:j,text:w.message},C,w.details)})},O.getCacheAge=function(){var C=null;if(this.response){var R=this.response.headers.get("age");C=R?parseFloat(R):null}return C},O.loadProgressively=function(C,R,S,v,E){v===void 0&&(v=0);var h=new I.default,p=C.body.getReader(),_=function g(){return p.read().then(function(w){if(w.done)return h.dataLength&&E(R,S,h.flush(),C),Promise.resolve(new ArrayBuffer(0));var j=w.value,B=j.length;return R.loaded+=B,B<v||h.dataLength?(h.push(j),h.dataLength>=v&&E(R,S,h.flush(),C)):E(R,S,j,C),g()}).catch(function(){return Promise.reject()})};return _()},n}();function c(n,O){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(l({},n.headers))};return n.rangeEnd&&T.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),T}function s(n,O){return new self.Request(n.url,O)}var i=function(n){K(O,n);function O(T,C,R){var S;return S=n.call(this,T)||this,S.code=void 0,S.details=void 0,S.code=C,S.details=R,S}return O}(k(Error));V.default=a},"./src/utils/imsc1-ttml-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"IMSC1_CODEC",function(){return b}),U.d(V,"parseIMSC1",function(){return o});var G=U("./src/utils/mp4-tools.ts"),P=U("./src/utils/vttparser.ts"),I=U("./src/utils/vttcue.ts"),K=U("./src/demux/id3.ts"),k=U("./src/utils/timescale-conversion.ts"),r=U("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(v){for(var E=1;E<arguments.length;E++){var h=arguments[E];for(var p in h)Object.prototype.hasOwnProperty.call(h,p)&&(v[p]=h[p])}return v},M.apply(this,arguments)}var b="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function o(v,E,h,p,_){var g=Object(G.findBox)(new Uint8Array(v),["mdat"]);if(g.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var w=g[0],j=Object(K.utf8ArrayToStr)(new Uint8Array(v,w.start,w.end-w.start)),B=Object(k.toTimescaleFromScale)(E,1,h);try{p(a(j,B))}catch(A){_(A)}}function a(v,E){var h=new DOMParser,p=h.parseFromString(v,"text/xml"),_=p.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(g).reduce(function(F,x){return F[x]=_.getAttribute("ttp:"+x)||g[x],F},{}),j=_.getAttribute("xml:space")!=="preserve",B=s(c(_,"styling","style")),A=s(c(_,"layout","region")),H=c(_,"body","[begin]");return[].map.call(H,function(F){var x=i(F,j);if(!x||!F.hasAttribute("begin"))return null;var Y=C(F.getAttribute("begin"),w),q=C(F.getAttribute("dur"),w),ie=C(F.getAttribute("end"),w);if(Y===null)throw T(F);if(ie===null){if(q===null)throw T(F);ie=Y+q}var me=new I.default(Y-E,ie-E,x);me.id=Object(r.generateCueId)(me.startTime,me.endTime,me.text);var $e=A[F.getAttribute("region")],xe=B[F.getAttribute("style")];me.position=10,me.size=80;var Ie=n($e,xe),Je=Ie.textAlign;if(Je){var Ye=l[Je];Ye&&(me.lineAlign=Ye),me.align=Je}return M(me,Ie),me}).filter(function(F){return F!==null})}function c(v,E,h){var p=v.getElementsByTagName(E)[0];return p?[].slice.call(p.querySelectorAll(h)):[]}function s(v){return v.reduce(function(E,h){var p=h.getAttribute("xml:id");return p&&(E[p]=h),E},{})}function i(v,E){return[].slice.call(v.childNodes).reduce(function(h,p,_){var g;return p.nodeName==="br"&&_?h+`
`:(g=p.childNodes)!==null&&g!==void 0&&g.length?i(p,E):E?h+p.textContent.trim().replace(/\s+/g," "):h+p.textContent},"")}function n(v,E){var h="http://www.w3.org/ns/ttml#styling",p=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return p.reduce(function(_,g){var w=O(E,h,g)||O(v,h,g);return w&&(_[g]=w),_},{})}function O(v,E,h){return v.hasAttributeNS(E,h)?v.getAttributeNS(E,h):null}function T(v){return new Error("Could not parse ttml timestamp "+v)}function C(v,E){if(!v)return null;var h=Object(P.parseTimeStamp)(v);return h===null&&(f.test(v)?h=R(v,E):m.test(v)&&(h=S(v,E))),h}function R(v,E){var h=f.exec(v),p=(h[4]|0)+(h[5]|0)/E.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+p/E.frameRate}function S(v,E){var h=m.exec(v),p=Number(h[1]),_=h[2];switch(_){case"h":return p*3600;case"m":return p*60;case"ms":return p*1e3;case"f":return p/E.frameRate;case"t":return p/E.tickRate}return p}},"./src/utils/logger.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"enableLogs",function(){return r}),U.d(V,"logger",function(){return M});var G=function(){},P={trace:G,debug:G,log:G,warn:G,info:G,error:G},I=P;function K(b){var f=self.console[b];return f?f.bind(self.console,"["+b+"] >"):G}function k(b){for(var f=arguments.length,m=new Array(f>1?f-1:0),l=1;l<f;l++)m[l-1]=arguments[l];m.forEach(function(o){I[o]=b[o]?b[o].bind(b):K(o)})}function r(b){if(self.console&&b===!0||typeof b=="object"){k(b,"debug","log","info","warn","error");try{I.log()}catch(f){I=P}}else I=P}var M=I},"./src/utils/mediakeys-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"KeySystems",function(){return G}),U.d(V,"requestMediaKeySystemAccess",function(){return P});var G;(function(I){I.WIDEVINE="com.widevine.alpha",I.PLAYREADY="com.microsoft.playready"})(G||(G={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"bin2str",function(){return k}),U.d(V,"readUint16",function(){return r}),U.d(V,"readUint32",function(){return M}),U.d(V,"writeUint32",function(){return b}),U.d(V,"findBox",function(){return f}),U.d(V,"parseSegmentIndex",function(){return m}),U.d(V,"parseInitSegment",function(){return l}),U.d(V,"getStartDTS",function(){return o}),U.d(V,"getDuration",function(){return a}),U.d(V,"computeRawDurationFromSamples",function(){return c}),U.d(V,"offsetStartDTS",function(){return s}),U.d(V,"segmentValidRange",function(){return i}),U.d(V,"appendUint8Array",function(){return n});var G=U("./src/utils/typed-array.ts"),P=U("./src/loader/fragment.ts"),I=Math.pow(2,32)-1,K=[].push;function k(O){return String.fromCharCode.apply(null,O)}function r(O,T){"data"in O&&(T+=O.start,O=O.data);var C=O[T]<<8|O[T+1];return C<0?65536+C:C}function M(O,T){"data"in O&&(T+=O.start,O=O.data);var C=O[T]<<24|O[T+1]<<16|O[T+2]<<8|O[T+3];return C<0?4294967296+C:C}function b(O,T,C){"data"in O&&(T+=O.start,O=O.data),O[T]=C>>24,O[T+1]=C>>16&255,O[T+2]=C>>8&255,O[T+3]=C&255}function f(O,T){var C=[];if(!T.length)return C;var R,S,v;"data"in O?(R=O.data,S=O.start,v=O.end):(R=O,S=0,v=R.byteLength);for(var E=S;E<v;){var h=M(R,E),p=k(R.subarray(E+4,E+8)),_=h>1?E+h:v;if(p===T[0])if(T.length===1)C.push({data:R,start:E+8,end:_});else{var g=f({data:R,start:E+8,end:_},T.slice(1));g.length&&K.apply(C,g)}E=_}return C}function m(O){var T=f(O,["moov"]),C=T[0],R=C?C.end:null,S=f(O,["sidx"]);if(!S||!S[0])return null;var v=[],E=S[0],h=E.data[0],p=h===0?8:16,_=M(E,p);p+=4;var g=0,w=0;h===0?p+=8:p+=16,p+=2;var j=E.end+w,B=r(E,p);p+=2;for(var A=0;A<B;A++){var H=p,F=M(E,H);H+=4;var x=F&2147483647,Y=(F&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var q=M(E,H);H+=4,v.push({referenceSize:x,subsegmentDuration:q,info:{duration:q/_,start:j,end:j+x-1}}),j+=x,H+=4,p=H}return{earliestPresentationTime:g,timescale:_,version:h,referencesCount:B,references:v,moovEndOffset:R}}function l(O){for(var T=[],C=f(O,["moov","trak"]),R=0;R<C.length;R++){var S=C[R],v=f(S,["tkhd"])[0];if(v){var E=v.data[v.start],h=E===0?12:20,p=M(v,h),_=f(S,["mdia","mdhd"])[0];if(_){E=_.data[_.start],h=E===0?12:20;var g=M(_,h),w=f(S,["mdia","hdlr"])[0];if(w){var j=k(w.data.subarray(w.start+8,w.start+12)),B={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[j];if(B){var A=f(S,["mdia","minf","stbl","stsd"])[0],H=void 0;A&&(H=k(A.data.subarray(A.start+12,A.start+16))),T[p]={timescale:g,type:B},T[B]={timescale:g,id:p,codec:H}}}}}}var F=f(O,["moov","mvex","trex"]);return F.forEach(function(x){var Y=M(x,4),q=T[Y];q&&(q.default={duration:M(x,12),flags:M(x,20)})}),T}function o(O,T){return f(T,["moof","traf"]).reduce(function(C,R){var S=f(R,["tfdt"])[0],v=S.data[S.start],E=f(R,["tfhd"]).reduce(function(h,p){var _=M(p,4),g=O[_];if(g){var w=M(S,4);v===1&&(w*=Math.pow(2,32),w+=M(S,8));var j=g.timescale||9e4,B=w/j;if(isFinite(B)&&(h===null||B<h))return B}return h},null);return E!==null&&isFinite(E)&&(C===null||E<C)?E:C},null)||0}function a(O,T){for(var C=0,R=0,S=0,v=f(O,["moof","traf"]),E=0;E<v.length;E++){var h=v[E],p=f(h,["tfhd"])[0],_=M(p,4),g=T[_];if(!g)continue;var w=g.default,j=M(p,0)|(w==null?void 0:w.flags),B=w==null?void 0:w.duration;j&8&&(j&2?B=M(p,12):B=M(p,8));for(var A=g.timescale||9e4,H=f(h,["trun"]),F=0;F<H.length;F++){if(B){var x=M(H[F],4);C=B*x}else C=c(H[F]);g.type===P.ElementaryStreamTypes.VIDEO?R+=C/A:g.type===P.ElementaryStreamTypes.AUDIO&&(S+=C/A)}}if(R===0&&S===0){var Y=m(O);if(Y!=null&&Y.references)return Y.references.reduce(function(q,ie){return q+ie.info.duration||0},0)}return R||S}function c(O){var T=M(O,0),C=8;T&1&&(C+=4),T&4&&(C+=4);for(var R=0,S=M(O,4),v=0;v<S;v++){if(T&256){var E=M(O,C);R+=E,C+=4}T&512&&(C+=4),T&1024&&(C+=4),T&2048&&(C+=4)}return R}function s(O,T,C){f(T,["moof","traf"]).forEach(function(R){f(R,["tfhd"]).forEach(function(S){var v=M(S,4),E=O[v];if(!E)return;var h=E.timescale||9e4;f(R,["tfdt"]).forEach(function(p){var _=p.data[p.start],g=M(p,4);if(_===0)b(p,4,g-C*h);else{g*=Math.pow(2,32),g+=M(p,8),g-=C*h,g=Math.max(g,0);var w=Math.floor(g/(I+1)),j=Math.floor(g%(I+1));b(p,4,w),b(p,8,j)}})})})}function i(O){var T={valid:null,remainder:null},C=f(O,["moof"]);if(C){if(C.length<2)return T.remainder=O,T}else return T;var R=C[C.length-1];return T.valid=Object(G.sliceUint8)(O,0,R.start-8),T.remainder=Object(G.sliceUint8)(O,R.start-8),T}function n(O,T){var C=new Uint8Array(O.length+T.length);return C.set(O),C.set(T,O.length),C}},"./src/utils/output-filter.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"default",function(){return G});var G=function(){function P(K,k){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=K,this.trackName=k}var I=P.prototype;return I.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},I.newCue=function(k,r,M){(this.startTime===null||this.startTime>k)&&(this.startTime=k),this.endTime=r,this.screen=M,this.timelineController.createCaptionsTrack(this.trackName)},I.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"sendAddTrackEvent",function(){return P}),U.d(V,"addCueToTrack",function(){return I}),U.d(V,"clearCurrentCues",function(){return K}),U.d(V,"removeCuesInRange",function(){return k}),U.d(V,"getCuesInRange",function(){return M});var G=U("./src/utils/logger.ts");function P(b,f){var m;try{m=new Event("addtrack")}catch(l){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=b,f.dispatchEvent(m)}function I(b,f){var m=b.mode;if(m==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(f.id))try{if(b.addCue(f),!b.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(o){G.logger.debug("[texttrack-utils]: "+o);var l=new self.TextTrackCue(f.startTime,f.endTime,f.text);l.id=f.id,b.addCue(l)}m==="disabled"&&(b.mode=m)}function K(b){var f=b.mode;if(f==="disabled"&&(b.mode="hidden"),b.cues)for(var m=b.cues.length;m--;)b.removeCue(b.cues[m]);f==="disabled"&&(b.mode=f)}function k(b,f,m){var l=b.mode;if(l==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var o=M(b.cues,f,m),a=0;a<o.length;a++)b.removeCue(o[a]);l==="disabled"&&(b.mode=l)}function r(b,f){if(f<b[0].startTime)return 0;var m=b.length-1;if(f>b[m].endTime)return-1;for(var l=0,o=m;l<=o;){var a=Math.floor((o+l)/2);if(f<b[a].startTime)o=a-1;else if(f>b[a].startTime&&l<m)l=a+1;else return a}return b[l].startTime-f<f-b[o].startTime?l:o}function M(b,f,m){var l=[],o=r(b,f);if(o>-1)for(var a=o,c=b.length;a<c;a++){var s=b[a];if(s.startTime>=f&&s.endTime<=m)l.push(s);else if(s.startTime>m)return l}return l}},"./src/utils/time-ranges.ts":function(Z,V,U){"use strict";U.r(V);var G={toString:function(I){for(var K="",k=I.length,r=0;r<k;r++)K+="["+I.start(r).toFixed(3)+","+I.end(r).toFixed(3)+"]";return K}};V.default=G},"./src/utils/timescale-conversion.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"toTimescaleFromBase",function(){return P}),U.d(V,"toTimescaleFromScale",function(){return I}),U.d(V,"toMsFromMpegTsClock",function(){return K}),U.d(V,"toMpegTsClockFromTimescale",function(){return k});var G=9e4;function P(r,M,b,f){b===void 0&&(b=1),f===void 0&&(f=!1);var m=r*M*b;return f?Math.round(m):m}function I(r,M,b,f){return b===void 0&&(b=1),f===void 0&&(f=!1),P(r,M,1/b,f)}function K(r,M){return M===void 0&&(M=!1),P(r,1e3,1/G,M)}function k(r,M){return M===void 0&&(M=1),P(r,G,1/M)}},"./src/utils/typed-array.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"sliceUint8",function(){return G});function G(P,I,K){return Uint8Array.prototype.slice?P.slice(I,K):new Uint8Array(Array.prototype.slice.call(P,I,K))}},"./src/utils/vttcue.ts":function(Z,V,U){"use strict";U.r(V),V.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var G=["","lr","rl"],P=["start","middle","end","left","right"];function I(b,f){if(typeof f!="string")return!1;if(!Array.isArray(b))return!1;var m=f.toLowerCase();return~b.indexOf(m)?m:!1}function K(b){return I(G,b)}function k(b){return I(P,b)}function r(b){for(var f=arguments.length,m=new Array(f>1?f-1:0),l=1;l<f;l++)m[l-1]=arguments[l];for(var o=1;o<arguments.length;o++){var a=arguments[o];for(var c in a)b[c]=a[c]}return b}function M(b,f,m){var l=this,o={enumerable:!0};l.hasBeenReset=!1;var a="",c=!1,s=b,i=f,n=m,O=null,T="",C=!0,R="auto",S="start",v=50,E="middle",h=50,p="middle";Object.defineProperty(l,"id",r({},o,{get:function(){return a},set:function(g){a=""+g}})),Object.defineProperty(l,"pauseOnExit",r({},o,{get:function(){return c},set:function(g){c=!!g}})),Object.defineProperty(l,"startTime",r({},o,{get:function(){return s},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",r({},o,{get:function(){return i},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");i=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",r({},o,{get:function(){return n},set:function(g){n=""+g,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",r({},o,{get:function(){return O},set:function(g){O=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",r({},o,{get:function(){return T},set:function(g){var w=K(g);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=w,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",r({},o,{get:function(){return C},set:function(g){C=!!g,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",r({},o,{get:function(){return R},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",r({},o,{get:function(){return S},set:function(g){var w=k(g);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");S=w,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",r({},o,{get:function(){return v},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");v=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",r({},o,{get:function(){return E},set:function(g){var w=k(g);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");E=w,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",r({},o,{get:function(){return h},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");h=g,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",r({},o,{get:function(){return p},set:function(g){var w=k(g);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");p=w,this.hasBeenReset=!0}})),l.displayState=void 0}return M.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"parseTimeStamp",function(){return I}),U.d(V,"fixLineBreaks",function(){return f}),U.d(V,"VTTParser",function(){return m});var G=U("./src/utils/vttcue.ts"),P=function(){function l(){}var o=l.prototype;return o.decode=function(c,s){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},l}();function I(l){function o(c,s,i,n){return(c|0)*3600+(s|0)*60+(i|0)+parseFloat(n||0)}var a=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return a?parseFloat(a[2])>59?o(a[2],a[3],0,a[4]):o(a[1],a[2],a[3],a[4]):null}var K=function(){function l(){this.values=Object.create(null)}var o=l.prototype;return o.set=function(c,s){!this.get(c)&&s!==""&&(this.values[c]=s)},o.get=function(c,s,i){return i?this.has(c)?this.values[c]:s[i]:this.has(c)?this.values[c]:s},o.has=function(c){return c in this.values},o.alt=function(c,s,i){for(var n=0;n<i.length;++n)if(s===i[n]){this.set(c,s);break}},o.integer=function(c,s){/^-?\d+$/.test(s)&&this.set(c,parseInt(s,10))},o.percent=function(c,s){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(s)){var i=parseFloat(s);if(i>=0&&i<=100)return this.set(c,i),!0}return!1},l}();function k(l,o,a,c){var s=c?l.split(c):[l];for(var i in s){if(typeof s[i]!="string")continue;var n=s[i].split(a);if(n.length!==2)continue;var O=n[0],T=n[1];o(O,T)}}var r=new G.default(0,0,""),M=r.align==="middle"?"middle":"center";function b(l,o,a){var c=l;function s(){var O=I(l);if(O===null)throw new Error("Malformed timestamp: "+c);return l=l.replace(/^[^\sa-zA-Z-]+/,""),O}function i(O,T){var C=new K;k(O,function(v,E){var h;switch(v){case"region":for(var p=a.length-1;p>=0;p--)if(a[p].id===E){C.set(v,a[p].region);break}break;case"vertical":C.alt(v,E,["rl","lr"]);break;case"line":h=E.split(","),C.integer(v,h[0]),C.percent(v,h[0])&&C.set("snapToLines",!1),C.alt(v,h[0],["auto"]),h.length===2&&C.alt("lineAlign",h[1],["start",M,"end"]);break;case"position":h=E.split(","),C.percent(v,h[0]),h.length===2&&C.alt("positionAlign",h[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":C.percent(v,E);break;case"align":C.alt(v,E,["start",M,"end","left","right"]);break}},/:/,/\s/),T.region=C.get("region",null),T.vertical=C.get("vertical","");var R=C.get("line","auto");R==="auto"&&r.line===-1&&(R=-1),T.line=R,T.lineAlign=C.get("lineAlign","start"),T.snapToLines=C.get("snapToLines",!0),T.size=C.get("size",100),T.align=C.get("align",M);var S=C.get("position","auto");S==="auto"&&r.position===50&&(S=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=S}function n(){l=l.replace(/^\s+/,"")}if(n(),o.startTime=s(),n(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);l=l.substr(3),n(),o.endTime=s(),n(),i(l,o)}function f(l){return l.replace(/<br(?: \/)?>/gi,`
`)}var m=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=l.prototype;return o.parse=function(c){var s=this;c&&(s.buffer+=s.decoder.decode(c,{stream:!0}));function i(){var S=s.buffer,v=0;for(S=f(S);v<S.length&&S[v]!=="\r"&&S[v]!==`
`;)++v;var E=S.substr(0,v);return S[v]==="\r"&&++v,S[v]===`
`&&++v,s.buffer=S.substr(v),E}function n(S){k(S,function(v,E){},/:/)}try{var O="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;O=i();var T=O.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");s.state="HEADER"}for(var C=!1;s.buffer;){if(!/\r\n|\n/.test(s.buffer))return this;C?C=!1:O=i();switch(s.state){case"HEADER":/:/.test(O)?n(O):O||(s.state="ID");continue;case"NOTE":O||(s.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(O)){s.state="NOTE";break}if(!O)continue;if(s.cue=new G.default(0,0,""),s.state="CUE",O.indexOf("-->")===-1){s.cue.id=O;continue}case"CUE":if(!s.cue){s.state="BADCUE";continue}try{b(O,s.cue,s.regionList)}catch(S){s.cue=null,s.state="BADCUE";continue}s.state="CUETEXT";continue;case"CUETEXT":{var R=O.indexOf("-->")!==-1;if(!O||R&&(C=!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+=O}continue;case"BADCUE":O||(s.state="ID")}}}catch(S){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var c=this;try{if((c.cue||c.state==="HEADER")&&(c.buffer+=`
`,c.parse()),c.state==="INITIAL"||c.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(s){c.onparsingerror&&c.onparsingerror(s)}return c.onflush&&c.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(Z,V,U){"use strict";U.r(V),U.d(V,"generateCueId",function(){return m}),U.d(V,"parseWebVTT",function(){return o});var G=U("./src/polyfills/number.ts"),P=U("./src/utils/vttparser.ts"),I=U("./src/demux/id3.ts"),K=U("./src/utils/timescale-conversion.ts"),k=U("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,M=function(c,s,i){return i===void 0&&(i=0),c.substr(i,s.length)===s},b=function(c){var s=parseInt(c.substr(-3)),i=parseInt(c.substr(-6,2)),n=parseInt(c.substr(-9,2)),O=c.length>9?parseInt(c.substr(0,c.indexOf(":"))):0;if(!Object(G.isFiniteNumber)(s)||!Object(G.isFiniteNumber)(i)||!Object(G.isFiniteNumber)(n)||!Object(G.isFiniteNumber)(O))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+c);return s+=1e3*i,s+=60*1e3*n,s+=60*60*1e3*O,s},f=function(c){for(var s=5381,i=c.length;i;)s=s*33^c.charCodeAt(--i);return(s>>>0).toString()};function m(a,c,s){return f(a.toString())+f(c.toString())+f(s)}var l=function(c,s,i){var n=c[s],O=c[n.prevCC];if(!O||!O.new&&n.new){c.ccOffset=c.presentationOffset=n.start,n.new=!1;return}for(;(T=O)!==null&&T!==void 0&&T.new;){var T;c.ccOffset+=n.start-O.start,n.new=!1,n=O,O=c[n.prevCC]}c.presentationOffset=i};function o(a,c,s,i,n,O,T,C){var R=new P.VTTParser,S=Object(I.utf8ArrayToStr)(new Uint8Array(a)).trim().replace(r,`
`).split(`
`),v=[],E=Object(K.toMpegTsClockFromTimescale)(c,s),h="00:00.000",p=0,_=0,g,w=!0,j=!1;R.oncue=function(B){var A=i[n],H=i.ccOffset,F=(p-E)/9e4;if(A!=null&&A.new&&(_!==void 0?H=i.ccOffset=A.start:l(i,n,F)),F&&(H=F-i.presentationOffset),j){var x=B.endTime-B.startTime,Y=Object(k.normalizePts)((B.startTime+H-_)*9e4,O*9e4)/9e4;B.startTime=Y,B.endTime=Y+x}var q=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(q)),B.id||(B.id=m(B.startTime,B.endTime,q)),B.endTime>0&&v.push(B)},R.onparsingerror=function(B){g=B},R.onflush=function(){if(g){C(g);return}T(v)},S.forEach(function(B){if(w)if(M(B,"X-TIMESTAMP-MAP=")){w=!1,j=!0,B.substr(16).split(",").forEach(function(A){M(A,"LOCAL:")?h=A.substr(6):M(A,"MPEGTS:")&&(p=parseInt(A.substr(7)))});try{_=b(h)/1e3}catch(A){j=!1,g=A}return}else B===""&&(w=!1);R.parse(B+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(Z,V,U){"use strict";U.r(V);var G=U("./src/utils/logger.ts"),P=U("./src/loader/load-stats.ts"),I=/^age:\s*[\d.]+\s*$/m,K=function(){function k(M){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=M?M.xhrSetup:null,this.stats=new P.LoadStats,this.retryDelay=0}var r=k.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},r.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(b,f,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=f,this.callbacks=m,this.retryDelay=f.retryDelay,this.loadInternal()},r.loadInternal=function(){var b=this.config,f=this.context;if(!b)return;var m=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var o=this.xhrSetup;try{if(o)try{o(m,f.url)}catch(s){m.open("GET",f.url,!0),o(m,f.url)}m.readyState||m.open("GET",f.url,!0);var a=this.context.headers;if(a)for(var c in a)m.setRequestHeader(c,a[c])}catch(s){this.callbacks.onError({code:m.status,text:s.message},f,m);return}f.rangeEnd&&m.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),m.send()},r.readystatechange=function(){var b=this.context,f=this.loader,m=this.stats;if(!b||!f)return;var l=f.readyState,o=this.config;if(m.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),l===4){f.onreadystatechange=null,f.onprogress=null;var a=f.status;if(a>=200&&a<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var c,s;if(b.responseType==="arraybuffer"?(c=f.response,s=c.byteLength):(c=f.responseText,s=c.length),m.loaded=m.total=s,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(m,b,c,f),!this.callbacks)return;var n={url:f.responseURL,data:c};this.callbacks.onSuccess(n,m,b,f)}else m.retry>=o.maxRetry||a>=400&&a<499?(G.logger.error(a+" while loading "+b.url),this.callbacks.onError({code:a,text:f.statusText},b,f)):(G.logger.warn(a+" while loading "+b.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},r.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(b){var f=this.stats;f.loaded=b.loaded,b.lengthComputable&&(f.total=b.total)},r.getCacheAge=function(){var b=null;if(this.loader&&I.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");b=f?parseFloat(f):null}return b},k}();V.default=K}}).default})},vHTk:function(Kt,he,D){Kt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Kt,he,D){"use strict";D.d(he,"a",function(){return on});var Z=D("rePB"),V=D("VTBJ"),U=D("KQm4"),G=D("U8pU"),P=D("ODXe"),I=D("q1tI"),K=D("TSYQ"),k=D.n(K),r=D("Gytx"),M=D.n(r),b=D("Kwbf"),f=D("t23M"),m=D("qx4F"),l=D("6eGT"),o=D("IBYe"),a=D("Ff2n"),c=D("c+Xe"),s=D("fyJ8"),i=D("biw7");function n(We,Fe,yt,At,tt){var ot=yt[We]||{},De=yt[Fe]||{},ye,we;ot.fixed==="left"?ye=At.left[We]:De.fixed==="right"&&(we=At.right[Fe]);var ae=!1,oe=!1,pe=!1,_e=!1,be=yt[Fe+1],Ke=yt[We-1];if(tt==="rtl"){if(ye!==void 0){var St=Ke&&Ke.fixed==="left";_e=!St}else if(we!==void 0){var nn=be&&be.fixed==="right";pe=!nn}}else if(ye!==void 0){var An=be&&be.fixed==="left";ae=!An}else if(we!==void 0){var bt=Ke&&Ke.fixed==="right";oe=!bt}return{fixLeft:ye,fixRight:we,lastFixLeft:ae,firstFixRight:oe,lastFixRight:pe,firstFixLeft:_e,isSticky:At.isSticky}}var O=D("sR1s");function T(We){var Fe=We.cells,yt=We.stickyOffsets,At=We.flattenColumns,tt=We.rowComponent,ot=We.cellComponent,De=We.onHeaderRow,ye=We.index,we=I.useContext(i.a),ae=we.prefixCls,oe=we.direction,pe;De&&(pe=De(Fe.map(function(be){return be.column}),ye));var _e=Object(O.a)(Fe.map(function(be){return be.column}));return I.createElement(tt,Object.assign({},pe),Fe.map(function(be,Ke){var St=be.column,nn=n(be.colStart,be.colEnd,At,yt,oe),An;return St&&St.onHeaderCell&&(An=be.column.onHeaderCell(St)),I.createElement(s.a,Object.assign({},be,{ellipsis:St.ellipsis,align:St.align,component:ot,prefixCls:ae,key:_e[Ke]},nn,{additionalProps:An,rowType:"header"}))}))}T.displayName="HeaderRow";var C=T;function R(We){var Fe=[];function yt(De,ye){var we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Fe[we]=Fe[we]||[];var ae=ye,oe=De.filter(Boolean).map(function(pe){var _e={key:pe.key,className:pe.className||"",children:pe.title,column:pe,colStart:ae},be=1,Ke=pe.children;return Ke&&Ke.length>0&&(be=yt(Ke,ae,we+1).reduce(function(St,nn){return St+nn},0),_e.hasSubColumns=!0),"colSpan"in pe&&(be=pe.colSpan),"rowSpan"in pe&&(_e.rowSpan=pe.rowSpan),_e.colSpan=be,_e.colEnd=_e.colStart+be-1,Fe[we].push(_e),ae+=be,be});return oe}yt(We,0);for(var At=Fe.length,tt=function(ye){Fe[ye].forEach(function(we){!("rowSpan"in we)&&!we.hasSubColumns&&(we.rowSpan=At-ye)})},ot=0;ot<At;ot+=1)tt(ot);return Fe}function S(We){var Fe=We.stickyOffsets,yt=We.columns,At=We.flattenColumns,tt=We.onHeaderRow,ot=I.useContext(i.a),De=ot.prefixCls,ye=ot.getComponent,we=I.useMemo(function(){return R(yt)},[yt]),ae=ye(["header","wrapper"],"thead"),oe=ye(["header","row"],"tr"),pe=ye(["header","cell"],"th");return I.createElement(ae,{className:"".concat(De,"-thead")},we.map(function(_e,be){var Ke=I.createElement(C,{key:be,flattenColumns:At,cells:_e,stickyOffsets:Fe,rowComponent:oe,cellComponent:pe,onHeaderRow:tt,index:be});return Ke}))}var v=S,E=D("hW8S");function h(We){for(var Fe=We.colWidths,yt=We.columns,At=We.columCount,tt=[],ot=At||yt.length,De=!1,ye=ot-1;ye>=0;ye-=1){var we=Fe[ye],ae=yt&&yt[ye],oe=ae&&ae[E.a];(we||oe||De)&&(tt.unshift(I.createElement("col",Object.assign({key:ye,style:{width:we,minWidth:we}},oe))),De=!0)}return I.createElement("colgroup",null,tt)}var p=h;function _(We,Fe){return Object(I.useMemo)(function(){for(var yt=[],At=0;At<Fe;At+=1){var tt=We[At];if(tt!==void 0)yt[At]=tt;else return null}return yt},[We.join("_"),Fe])}var g=I.forwardRef(function(We,Fe){var yt=We.noData,At=We.columns,tt=We.flattenColumns,ot=We.colWidths,De=We.columCount,ye=We.stickyOffsets,we=We.direction,ae=We.fixHeader,oe=We.offsetHeader,pe=We.stickyClassName,_e=We.onScroll,be=Object(a.a)(We,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),Ke=I.useContext(i.a),St=Ke.prefixCls,nn=Ke.scrollbarSize,An=Ke.isSticky,bt=An&&!ae?0:nn,Jt=I.useRef(null),Et=I.useCallback(function(Qt){Object(c.b)(Fe,Qt),Object(c.b)(Jt,Qt)},[]);I.useEffect(function(){var Qt;function un(Le){var qe=Le.currentTarget,mt=Le.deltaX;mt&&(_e({currentTarget:qe,scrollLeft:qe.scrollLeft+mt}),Le.preventDefault())}return(Qt=Jt.current)===null||Qt===void 0||Qt.addEventListener("wheel",un),function(){var Le;(Le=Jt.current)===null||Le===void 0||Le.removeEventListener("wheel",un)}},[]);var Ct=tt[tt.length-1],st={fixed:Ct?Ct.fixed:null,onHeaderCell:function(){return{className:"".concat(St,"-cell-scrollbar")}}},de=Object(I.useMemo)(function(){return bt?[].concat(Object(U.a)(At),[st]):At},[bt,At]),Ae=Object(I.useMemo)(function(){return bt?[].concat(Object(U.a)(tt),[st]):tt},[bt,tt]),kt=Object(I.useMemo)(function(){var Qt=ye.right,un=ye.left;return Object(V.a)(Object(V.a)({},ye),{},{left:we==="rtl"?[].concat(Object(U.a)(un.map(function(Le){return Le+bt})),[0]):un,right:we==="rtl"?Qt:[].concat(Object(U.a)(Qt.map(function(Le){return Le+bt})),[0]),isSticky:An})},[bt,ye,An]),ct=_(ot,De);return I.createElement("div",{style:Object(V.a)({overflow:"hidden"},An?{top:oe}:{}),ref:Et,className:k()("".concat(St,"-header"),Object(Z.a)({},pe,!!pe))},I.createElement("table",{style:{tableLayout:"fixed",visibility:yt||ct?null:"hidden"}},I.createElement(p,{colWidths:ct?[].concat(Object(U.a)(ct),[bt]):[],columCount:De+1,columns:Ae}),I.createElement(v,Object.assign({},be,{stickyOffsets:kt,columns:de,flattenColumns:Ae}))))});g.displayName="FixedHeader";var w=g,j=I.createContext(null),B=j;function A(We){var Fe=We.prefixCls,yt=We.children,At=We.component,tt=We.cellComponent,ot=We.fixHeader,De=We.fixColumn,ye=We.horizonScroll,we=We.className,ae=We.expanded,oe=We.componentWidth,pe=We.colSpan,_e=I.useContext(i.a),be=_e.scrollbarSize;return I.useMemo(function(){var Ke=yt;return De&&(Ke=I.createElement("div",{style:{width:oe-(ot?be:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Fe,"-expanded-row-fixed")},Ke)),I.createElement(At,{className:we,style:{display:ae?null:"none"}},I.createElement(s.a,{component:tt,prefixCls:Fe,colSpan:pe},Ke))},[yt,At,ot,ye,we,ae,oe,pe,be])}var H=A;function F(We){var Fe=We.className,yt=We.style,At=We.record,tt=We.index,ot=We.rowKey,De=We.getRowKey,ye=We.rowExpandable,we=We.expandedKeys,ae=We.onRow,oe=We.indent,pe=oe===void 0?0:oe,_e=We.rowComponent,be=We.cellComponent,Ke=We.childrenColumnName,St=I.useContext(i.a),nn=St.prefixCls,An=St.fixedInfoList,bt=I.useContext(B),Jt=bt.fixHeader,Et=bt.fixColumn,Ct=bt.horizonScroll,st=bt.componentWidth,de=bt.flattenColumns,Ae=bt.expandableType,kt=bt.expandRowByClick,ct=bt.onTriggerExpand,Qt=bt.rowClassName,un=bt.expandedRowClassName,Le=bt.indentSize,qe=bt.expandIcon,mt=bt.expandedRowRender,jt=bt.expandIconColumnIndex,sn=I.useState(!1),yn=Object(P.a)(sn,2),nr=yn[0],Kn=yn[1],wn=we&&we.has(We.recordKey);I.useEffect(function(){wn&&Kn(!0)},[wn]);var br=Ae==="row"&&(!ye||ye(At)),Er=Ae==="nest",rr=Ke&&At&&At[Ke],cr=br||Er,Pr;ae&&(Pr=ae(At,tt));var Kr=function(L){if(kt&&cr&&ct(At,L),Pr&&Pr.onClick){for(var N,z=arguments.length,ne=new Array(z>1?z-1:0),J=1;J<z;J++)ne[J-1]=arguments[J];(N=Pr).onClick.apply(N,[L].concat(ne))}},hi;typeof Qt=="string"?hi=Qt:typeof Qt=="function"&&(hi=Qt(At,tt,pe));var pn=Object(O.a)(de),or=I.createElement(_e,Object.assign({},Pr,{"data-row-key":ot,className:k()(Fe,"".concat(nn,"-row"),"".concat(nn,"-row-level-").concat(pe),hi,Pr&&Pr.className),style:Object(V.a)(Object(V.a)({},yt),Pr?Pr.style:null),onClick:Kr}),de.map(function(X,L){var N=X.render,z=X.dataIndex,ne=X.className,J=pn[L],je=An[L],$t;L===(jt||0)&&Er&&($t=I.createElement(I.Fragment,null,I.createElement("span",{style:{paddingLeft:"".concat(Le*pe,"px")},className:"".concat(nn,"-row-indent indent-level-").concat(pe)}),qe({prefixCls:nn,expanded:wn,expandable:rr,record:At,onExpand:ct})));var In;return X.onCell&&(In=X.onCell(At,tt)),I.createElement(s.a,Object.assign({className:ne,ellipsis:X.ellipsis,align:X.align,component:be,prefixCls:nn,key:J,record:At,index:tt,dataIndex:z,render:N,shouldCellUpdate:X.shouldCellUpdate},je,{appendNode:$t,additionalProps:In}))})),mi;if(br&&(nr||wn)){var wi=mt(At,tt,pe+1,wn),ti=un&&un(At,tt,pe);mi=I.createElement(H,{expanded:wn,className:k()("".concat(nn,"-expanded-row"),"".concat(nn,"-expanded-row-level-").concat(pe+1),ti),prefixCls:nn,fixHeader:Jt,fixColumn:Et,horizonScroll:Ct,component:_e,componentWidth:st,cellComponent:be,colSpan:de.length},wi)}var ni;return rr&&wn&&(ni=(At[Ke]||[]).map(function(X,L){var N=De(X,L);return I.createElement(F,Object.assign({},We,{key:N,rowKey:N,record:X,recordKey:N,index:L,indent:pe+1}))})),I.createElement(I.Fragment,null,or,mi,ni)}F.displayName="BodyRow";var x=F,Y=I.createContext(null),q=Y;function ie(We){var Fe=We.columnKey,yt=We.onColumnResize,At=I.useRef();return I.useEffect(function(){At.current&&yt(Fe,At.current.offsetWidth)},[]),I.createElement(f.a,{onResize:function(ot){var De=ot.offsetWidth;yt(Fe,De)}},I.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},I.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function me(We){var Fe=We.data,yt=We.getRowKey,At=We.measureColumnWidth,tt=We.expandedKeys,ot=We.onRow,De=We.rowExpandable,ye=We.emptyNode,we=We.childrenColumnName,ae=I.useContext(q),oe=ae.onColumnResize,pe=I.useContext(i.a),_e=pe.prefixCls,be=pe.getComponent,Ke=I.useContext(B),St=Ke.fixHeader,nn=Ke.horizonScroll,An=Ke.flattenColumns,bt=Ke.componentWidth;return I.useMemo(function(){var Jt=be(["body","wrapper"],"tbody"),Et=be(["body","row"],"tr"),Ct=be(["body","cell"],"td"),st;Fe.length?st=Fe.map(function(Ae,kt){var ct=yt(Ae,kt);return I.createElement(x,{key:ct,rowKey:ct,record:Ae,recordKey:ct,index:kt,rowComponent:Et,cellComponent:Ct,expandedKeys:tt,onRow:ot,getRowKey:yt,rowExpandable:De,childrenColumnName:we})}):st=I.createElement(H,{expanded:!0,className:"".concat(_e,"-placeholder"),prefixCls:_e,fixHeader:St,fixColumn:nn,horizonScroll:nn,component:Et,componentWidth:bt,cellComponent:Ct,colSpan:An.length},ye);var de=Object(O.a)(An);return I.createElement(Jt,{className:"".concat(_e,"-tbody")},At&&I.createElement("tr",{"aria-hidden":"true",className:"".concat(_e,"-measure-row"),style:{height:0}},de.map(function(Ae){return I.createElement(ie,{key:Ae,columnKey:Ae,onColumnResize:oe})})),st)},[Fe,_e,ot,At,tt,yt,be,bt,ye,An])}var $e=I.memo(me);$e.displayName="Body";var xe=$e,Ie=D("wRmb"),Je=D("xEkU"),Ye=D.n(Je);function ve(We){var Fe=Object(I.useRef)(We),yt=Object(I.useState)({}),At=Object(P.a)(yt,2),tt=At[1],ot=Object(I.useRef)(null),De=Object(I.useRef)([]);function ye(we){ot.current===null&&(De.current=[],ot.current=Ye()(function(){De.current.forEach(function(ae){Fe.current=ae(Fe.current)}),ot.current=null,tt({})})),De.current.push(we)}return Object(I.useEffect)(function(){return function(){Ye.a.cancel(ot.current)}},[]),[Fe.current,ye]}function fe(We){var Fe=Object(I.useRef)(We),yt=Object(I.useRef)(null);function At(){window.clearTimeout(yt.current)}function tt(De){Fe.current=De,At(),yt.current=window.setTimeout(function(){Fe.current=null,yt.current=null},100)}function ot(){return Fe.current}return Object(I.useEffect)(function(){return At},[]),[tt,ot]}function lt(We,Fe,yt){var At=Object(I.useMemo)(function(){for(var tt=[],ot=[],De=0,ye=0,we=0;we<Fe;we+=1)if(yt==="rtl"){ot[we]=ye,ye+=We[we]||0;var ae=Fe-we-1;tt[ae]=De,De+=We[ae]||0}else{tt[we]=De,De+=We[we]||0;var oe=Fe-we-1;ot[oe]=ye,ye+=We[oe]||0}return{left:tt,right:ot}},[We,Fe,yt]);return At}var qt=lt;function Ft(We){var Fe=We.className,yt=We.children;return I.createElement("div",{className:Fe},yt)}var Ot=Ft,Ve=D("n6Qo");function vt(We){var Fe,yt=We.prefixCls,At=We.record,tt=We.onExpand,ot=We.expanded,De=We.expandable,ye="".concat(yt,"-row-expand-icon");if(!De)return I.createElement("span",{className:k()(ye,"".concat(yt,"-row-spaced"))});var we=function(oe){tt(At,oe),oe.stopPropagation()};return I.createElement("span",{className:k()(ye,(Fe={},Object(Z.a)(Fe,"".concat(yt,"-row-expanded"),ot),Object(Z.a)(Fe,"".concat(yt,"-row-collapsed"),!ot),Fe)),onClick:we})}function ht(We,Fe,yt){var At=[];function tt(ot){(ot||[]).forEach(function(De,ye){At.push(Fe(De,ye)),tt(De[yt])})}return tt(We),At}var Bt=D("zT1h"),se=D("y0+3"),Ue=function(Fe,yt){var At,tt,ot=Fe.scrollBodyRef,De=Fe.onScroll,ye=Fe.offsetScroll,we=I.useContext(i.a),ae=we.prefixCls,oe=((At=ot.current)===null||At===void 0?void 0:At.scrollWidth)||0,pe=((tt=ot.current)===null||tt===void 0?void 0:tt.clientWidth)||0,_e=oe&&pe*(pe/oe),be=I.useRef(),Ke=ve({scrollLeft:0,isHiddenScrollBar:!1}),St=Object(P.a)(Ke,2),nn=St[0],An=St[1],bt=I.useRef({delta:0,x:0}),Jt=I.useState(!1),Et=Object(P.a)(Jt,2),Ct=Et[0],st=Et[1],de=function(){st(!1)},Ae=function(Le){Le.persist(),bt.current.delta=Le.pageX-nn.scrollLeft,bt.current.x=0,st(!0),Le.preventDefault()},kt=function(Le){var qe,mt=Le||((qe=window)===null||qe===void 0?void 0:qe.event),jt=mt.buttons;if(!Ct||jt===0){Ct&&st(!1);return}var sn=bt.current.x+Le.pageX-bt.current.x-bt.current.delta;sn<=0&&(sn=0),sn+_e>=pe&&(sn=pe-_e),De({scrollLeft:sn/pe*(oe+2)}),bt.current.x=Le.pageX},ct=function(){var Le=Object(se.b)(ot.current).top,qe=Le+ot.current.offsetHeight,mt=document.documentElement.scrollTop+window.innerHeight;qe-Object(m.a)()<=mt||Le>=mt-ye?An(function(jt){return Object(V.a)(Object(V.a)({},jt),{},{isHiddenScrollBar:!0})}):An(function(jt){return Object(V.a)(Object(V.a)({},jt),{},{isHiddenScrollBar:!1})})},Qt=function(Le){An(function(qe){return Object(V.a)(Object(V.a)({},qe),{},{scrollLeft:Le/oe*pe||0})})};return I.useImperativeHandle(yt,function(){return{setScrollLeft:Qt}}),I.useEffect(function(){var un=Object(Bt.a)(document.body,"mouseup",de,!1),Le=Object(Bt.a)(document.body,"mousemove",kt,!1);return ct(),function(){un.remove(),Le.remove()}},[_e,Ct]),I.useEffect(function(){var un=Object(Bt.a)(window,"scroll",ct,!1),Le=Object(Bt.a)(window,"resize",ct,!1);return function(){un.remove(),Le.remove()}},[]),I.useEffect(function(){nn.isHiddenScrollBar||An(function(un){var Le,qe;return Object(V.a)(Object(V.a)({},un),{},{scrollLeft:ot.current.scrollLeft/((Le=ot.current)===null||Le===void 0?void 0:Le.scrollWidth)*((qe=ot.current)===null||qe===void 0?void 0:qe.clientWidth)})})},[nn.isHiddenScrollBar]),oe<=pe||!_e||nn.isHiddenScrollBar?null:I.createElement("div",{style:{height:Object(m.a)(),width:pe,bottom:ye},className:"".concat(ae,"-sticky-scroll")},I.createElement("div",{onMouseDown:Ae,ref:be,className:k()("".concat(ae,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ae,"-sticky-scroll-bar-active"),Ct)),style:{width:"".concat(_e,"px"),transform:"translate3d(".concat(nn.scrollLeft,"px, 0, 0)")}}))},Ge=I.forwardRef(Ue);function et(We,Fe){return I.useMemo(function(){var yt=!!We;return{isSticky:yt,stickyClassName:yt?"".concat(Fe,"-sticky-header"):"",offsetHeader:Object(G.a)(We)==="object"&&We.offsetHeader||0,offsetScroll:Object(G.a)(We)==="object"&&We.offsetScroll||0}},[We,Fe])}var Wt=[],Yt={},on="rc-table-internal-hook",nt=I.memo(function(We){var Fe=We.children;return Fe},function(We,Fe){return M()(We.props,Fe.props)?We.pingLeft!==Fe.pingLeft||We.pingRight!==Fe.pingRight:!1});function tn(We){var Fe,yt=We.prefixCls,At=We.className,tt=We.rowClassName,ot=We.style,De=We.data,ye=We.rowKey,we=We.scroll,ae=We.tableLayout,oe=We.direction,pe=We.title,_e=We.footer,be=We.summary,Ke=We.id,St=We.showHeader,nn=We.components,An=We.emptyText,bt=We.onRow,Jt=We.onHeaderRow,Et=We.internalHooks,Ct=We.transformColumns,st=We.internalRefs,de=We.sticky,Ae=De||Wt,kt=!!Ae.length,ct=I.useState(0),Qt=Object(P.a)(ct,2),un=Qt[0],Le=Qt[1];I.useEffect(function(){Le(Object(m.a)())});var qe=I.useMemo(function(){return Object(O.c)(nn,{})},[nn]),mt=I.useCallback(function(Dn,xn){return Object(O.b)(qe,Dn)||xn},[qe]),jt=I.useMemo(function(){return typeof ye=="function"?ye:function(Dn){var xn=Dn&&Dn[ye];return xn}},[ye]),sn=Object(E.c)(We),yn=sn.expandIcon,nr=sn.expandedRowKeys,Kn=sn.defaultExpandedRowKeys,wn=sn.defaultExpandAllRows,br=sn.expandedRowRender,Er=sn.onExpand,rr=sn.onExpandedRowsChange,cr=sn.expandRowByClick,Pr=sn.rowExpandable,Kr=sn.expandIconColumnIndex,hi=sn.expandedRowClassName,pn=sn.childrenColumnName,or=sn.indentSize,mi=yn||vt,wi=pn||"children",ti=I.useMemo(function(){return br?"row":We.expandable&&Et===on&&We.expandable.__PARENT_RENDER_ICON__||Ae.some(function(Dn){return Dn&&Object(G.a)(Dn)==="object"&&Dn[wi]})?"nest":!1},[!!br,Ae]),ni=I.useState(function(){return Kn||(wn?ht(Ae,jt,wi):[])}),X=Object(P.a)(ni,2),L=X[0],N=X[1],z=I.useMemo(function(){return new Set(nr||L||[])},[nr,L]),ne=I.useCallback(function(Dn){var xn=jt(Dn,Ae.indexOf(Dn)),Lt,Qe=z.has(xn);Qe?(z.delete(xn),Lt=Object(U.a)(z)):Lt=[].concat(Object(U.a)(z),[xn]),N(Lt),Er&&Er(!Qe,Dn),rr&&rr(Lt)},[jt,z,Ae,Er,rr]),J=I.useState(0),je=Object(P.a)(J,2),$t=je[0],In=je[1],Jn=Object(Ie.b)(Object(V.a)(Object(V.a)(Object(V.a)({},We),sn),{},{expandable:!!br,expandedKeys:z,getRowKey:jt,onTriggerExpand:ne,expandIcon:mi,expandIconColumnIndex:Kr,direction:oe}),Et===on?Ct:null),ln=Object(P.a)(Jn,2),tr=ln[0],qn=ln[1],kr=I.useMemo(function(){return{columns:tr,flattenColumns:qn}},[tr,qn]),li=I.useRef(),ai=I.useRef(),Gr=I.useRef(),Li=I.useState(!1),Vi=Object(P.a)(Li,2),Dr=Vi[0],Sr=Vi[1],ri=I.useState(!1),Br=Object(P.a)(ri,2),Bn=Br[0],_n=Br[1],Tn=ve(new Map),bn=Object(P.a)(Tn,2),ur=bn[0],sr=bn[1],Q=Object(O.a)(qn),ce=Q.map(function(Dn){return ur.get(Dn)}),Ce=I.useMemo(function(){return ce},[ce.join("_")]),Te=qt(Ce,qn.length,oe),rt=we&&Object(O.d)(we.y),Re=we&&Object(O.d)(we.x),Xe=Re&&qn.some(function(Dn){var xn=Dn.fixed;return xn}),it=I.useRef(),Dt=et(de,yt),Tt=Dt.isSticky,Be=Dt.offsetHeader,_t=Dt.offsetScroll,at=Dt.stickyClassName,dt,wt,It;rt&&(wt={overflowY:"scroll",maxHeight:we.y}),Re&&(dt={overflowX:"auto"},rt||(wt={overflowY:"hidden"}),It={width:we.x===!0?"auto":we.x,minWidth:"100%"});var gt=I.useCallback(function(Dn,xn){sr(function(Lt){var Qe=new Map(Lt);return Qe.set(Dn,xn),Qe})},[]),Xt=fe(null),dn=Object(P.a)(Xt,2),Pn=dn[0],Gn=dn[1];function Sn(Dn,xn){if(!xn)return;typeof xn=="function"?xn(Dn):xn.scrollLeft!==Dn&&(xn.scrollLeft=Dn)}var Nn=function(xn){var Lt=xn.currentTarget,Qe=xn.scrollLeft,Nt=typeof Qe=="number"?Qe:Lt.scrollLeft,Mt=Lt||Yt;if(!Gn()||Gn()===Mt){var cn;Pn(Mt),Sn(Nt,ai.current),Sn(Nt,Gr.current),Sn(Nt,(cn=it.current)===null||cn===void 0?void 0:cn.setScrollLeft)}if(Lt){var zn=Lt.scrollWidth,kn=Lt.clientWidth;Sr(Nt>0),_n(Nt<zn-kn)}},Mn=function(){Gr.current&&Nn({currentTarget:Gr.current})},Pt=function(xn){var Lt=xn.width;Mn(),In(li.current?li.current.offsetWidth:Lt)};I.useEffect(function(){return Mn},[]),I.useEffect(function(){Re&&Mn()},[Re]),I.useEffect(function(){Et===on&&st&&(st.body.current=Gr.current)});var hn=mt(["table"],"table"),Ht=I.useMemo(function(){return ae||(Xe?we.x==="max-content"?"auto":"fixed":rt||qn.some(function(Dn){var xn=Dn.ellipsis;return xn})?"fixed":"auto")},[rt,Xe,qn,ae]),Rt,Un={colWidths:Ce,columCount:qn.length,stickyOffsets:Te,onHeaderRow:Jt,fixHeader:rt},On=I.useMemo(function(){return kt?null:typeof An=="function"?An():An},[kt,An]),Vt=I.createElement(xe,{data:Ae,measureColumnWidth:rt||Re||Tt,expandedKeys:z,rowExpandable:Pr,getRowKey:jt,onRow:bt,emptyNode:On,childrenColumnName:wi}),ft=I.createElement(p,{colWidths:qn.map(function(Dn){var xn=Dn.width;return xn}),columns:qn}),jn=be&&I.createElement(Ve.b,null,be(Ae)),fn=mt(["body"]);if(rt||Tt){var Qn;typeof fn=="function"?(Qn=fn(Ae,{scrollbarSize:un,ref:Gr,onScroll:Nn}),Un.colWidths=qn.map(function(Dn,xn){var Lt=Dn.width,Qe=xn===tr.length-1?Lt-un:Lt;return typeof Qe=="number"&&!Number.isNaN(Qe)?Qe:(Object(b.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Qn=I.createElement("div",{style:Object(V.a)(Object(V.a)({},dt),wt),onScroll:Nn,ref:Gr,className:k()("".concat(yt,"-body"))},I.createElement(hn,{style:Object(V.a)(Object(V.a)({},It),{},{tableLayout:Ht})},ft,Vt,jn),Tt&&I.createElement(Ge,{ref:it,offsetScroll:_t,scrollBodyRef:Gr,onScroll:Nn})),Rt=I.createElement(I.Fragment,null,St!==!1&&I.createElement(w,Object.assign({noData:!Ae.length},Un,kr,{direction:oe,offsetHeader:Be,stickyClassName:at,ref:ai,onScroll:Nn})),Qn)}else Rt=I.createElement("div",{style:Object(V.a)(Object(V.a)({},dt),wt),className:k()("".concat(yt,"-content")),onScroll:Nn,ref:Gr},I.createElement(hn,{style:Object(V.a)(Object(V.a)({},It),{},{tableLayout:Ht})},ft,St!==!1&&I.createElement(v,Object.assign({},Un,kr)),Vt,jn));var Zt=Object(E.b)(We),Rn=I.createElement("div",Object.assign({className:k()(yt,At,(Fe={},Object(Z.a)(Fe,"".concat(yt,"-rtl"),oe==="rtl"),Object(Z.a)(Fe,"".concat(yt,"-ping-left"),Dr),Object(Z.a)(Fe,"".concat(yt,"-ping-right"),Bn),Object(Z.a)(Fe,"".concat(yt,"-layout-fixed"),ae==="fixed"),Object(Z.a)(Fe,"".concat(yt,"-fixed-header"),rt),Object(Z.a)(Fe,"".concat(yt,"-fixed-column"),Xe),Object(Z.a)(Fe,"".concat(yt,"-scroll-horizontal"),Re),Object(Z.a)(Fe,"".concat(yt,"-has-fix-left"),qn[0]&&qn[0].fixed),Object(Z.a)(Fe,"".concat(yt,"-has-fix-right"),qn[qn.length-1]&&qn[qn.length-1].fixed==="right"),Fe)),style:ot,id:Ke,ref:li},Zt),I.createElement(nt,{pingLeft:Dr,pingRight:Bn,props:Object(V.a)(Object(V.a)({},We),{},{stickyOffsets:Te,mergedExpandedKeys:z})},pe&&I.createElement(Ot,{className:"".concat(yt,"-title")},pe(Ae)),I.createElement("div",{className:"".concat(yt,"-container")},Rt),_e&&I.createElement(Ot,{className:"".concat(yt,"-footer")},_e(Ae))));Re&&(Rn=I.createElement(f.a,{onResize:Pt},Rn));var Fn=I.useMemo(function(){return{prefixCls:yt,getComponent:mt,scrollbarSize:un,direction:oe,fixedInfoList:qn.map(function(Dn,xn){return n(xn,xn,qn,Te,oe)}),isSticky:Tt}},[yt,mt,un,oe,qn,Te,oe,Tt]),vn=I.useMemo(function(){return Object(V.a)(Object(V.a)({},kr),{},{tableLayout:Ht,rowClassName:tt,expandedRowClassName:hi,componentWidth:$t,fixHeader:rt,fixColumn:Xe,horizonScroll:Re,expandIcon:mi,expandableType:ti,expandRowByClick:cr,expandedRowRender:br,onTriggerExpand:ne,expandIconColumnIndex:Kr,indentSize:or})},[kr,Ht,tt,hi,$t,rt,Xe,Re,mi,ti,cr,br,ne,Kr,or]),yr=I.useMemo(function(){return{onColumnResize:gt}},[gt]);return I.createElement(i.a.Provider,{value:Fn},I.createElement(B.Provider,{value:vn},I.createElement(q.Provider,{value:yr},Rn)))}tn.Column=o.a,tn.ColumnGroup=l.a,tn.Summary=Ve.a,tn.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var Ln=he.b=tn},wRmb:function(Kt,he,D){"use strict";D.d(he,"a",function(){return M});var Z=D("rePB"),V=D("KQm4"),U=D("VTBJ"),G=D("Ff2n"),P=D("q1tI"),I=D.n(P),K=D("Kwbf"),k=D("Zm9Q"),r=D("hW8S");function M(o){return Object(k.a)(o).filter(function(a){return P.isValidElement(a)}).map(function(a){var c=a.key,s=a.props,i=s.children,n=Object(G.a)(s,["children"]),O=Object(U.a)({key:c},n);return i&&(O.children=M(i)),O})}function b(o){return o.reduce(function(a,c){var s=c.fixed,i=s===!0?"left":s,n=c.children;return n&&n.length>0?[].concat(Object(V.a)(a),Object(V.a)(b(n).map(function(O){return Object(U.a)({fixed:i},O)}))):[].concat(Object(V.a)(a),[Object(U.a)(Object(U.a)({},c),{},{fixed:i})])},[])}function f(o){for(var a=!0,c=0;c<o.length;c+=1){var s=o[c];if(a&&s.fixed!=="left")a=!1;else if(!a&&s.fixed==="left"){Object(K.a)(!1,"Index ".concat(c-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,n=o.length-1;n>=0;n-=1){var O=o[n];if(i&&O.fixed!=="right")i=!1;else if(!i&&O.fixed==="right"){Object(K.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function m(o){return o.map(function(a){var c=a.fixed,s=Object(G.a)(a,["fixed"]),i=c;return c==="left"?i="right":c==="right"&&(i="left"),Object(U.a)({fixed:i},s)})}function l(o,a){var c=o.prefixCls,s=o.columns,i=o.children,n=o.expandable,O=o.expandedKeys,T=o.getRowKey,C=o.onTriggerExpand,R=o.expandIcon,S=o.rowExpandable,v=o.expandIconColumnIndex,E=o.direction,h=o.expandRowByClick,p=P.useMemo(function(){return s||M(i)},[s,i]),_=P.useMemo(function(){if(n){var j,B=v||0,A=p[B],H=(j={},Object(Z.a)(j,r.a,{className:"".concat(c,"-expand-icon-col")}),Object(Z.a)(j,"title",""),Object(Z.a)(j,"fixed",A?A.fixed:null),Object(Z.a)(j,"className","".concat(c,"-row-expand-icon-cell")),Object(Z.a)(j,"render",function(Y,q,ie){var me=T(q,ie),$e=O.has(me),xe=S?S(q):!0,Ie=R({prefixCls:c,expanded:$e,expandable:xe,record:q,onExpand:C});return h?P.createElement("span",{onClick:function(Ye){return Ye.stopPropagation()}},Ie):Ie}),j),F=p.slice();return B>=0&&F.splice(B,0,H),F}return p},[n,p,T,O,R,E]),g=P.useMemo(function(){var j=_;return a&&(j=a(j)),j.length||(j=[{render:function(){return null}}]),j},[a,_,E]),w=P.useMemo(function(){return E==="rtl"?m(b(g)):b(g)},[g,E]);return[g,w]}he.b=l},wwSX:function(Kt,he,D){Kt.exports=D.p+"static/b2.2c844a2a.svg"},xOL1:function(Kt,he){Kt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(Kt,he,D){Kt.exports={flex_box_center:"flex_box_center___2oNqn",flex_space_between:"flex_space_between___eTRhm",flex_box_vertical_center:"flex_box_vertical_center___1jD6_",flex_box_center_end:"flex_box_center_end___3s_Sd",flex_box_column:"flex_box_column___11Wn_",form:"form___34z-w",btns:"btns___3O6K5",hackList:"hackList___2L3co",title:"title___2fVFF",subtitle:"subtitle___Ydv-g",efficiency:"efficiency___1wrjh"}},"y0+3":function(Kt,he,D){"use strict";D.d(he,"a",function(){return b}),D.d(he,"b",function(){return m});var Z=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},U={cssFloat:1,styleFloat:1,float:1};function G(l){return l.nodeType===1?l.ownerDocument.defaultView.getComputedStyle(l,null):{}}function P(l,o,a){if(o=o.toLowerCase(),a==="auto"){if(o==="height")return l.offsetHeight;if(o==="width")return l.offsetWidth}return o in V||(V[o]=Z.test(o)),V[o]?parseFloat(a)||0:a}function I(l,o){var a=arguments.length,c=G(l);return o=U[o]?"cssFloat"in l.style?"cssFloat":"styleFloat":o,a===1?c:P(l,o,c[o]||l.style[o])}function K(l,o,a){var c=arguments.length;if(o=U[o]?"cssFloat"in l.style?"cssFloat":"styleFloat":o,c===3)return typeof a=="number"&&Z.test(o)&&(a="".concat(a,"px")),l.style[o]=a,a;for(var s in o)o.hasOwnProperty(s)&&K(l,s,o[s]);return G(l)}function k(l){return l===document.body?document.documentElement.clientWidth:l.offsetWidth}function r(l){return l===document.body?window.innerHeight||document.documentElement.clientHeight:l.offsetHeight}function M(){var l=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:l,height:o}}function b(){var l=document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return{width:l,height:o}}function f(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(l){var o=l.getBoundingClientRect(),a=document.documentElement;return{left:o.left+(window.pageXOffset||a.scrollLeft)-(a.clientLeft||document.body.clientLeft||0),top:o.top+(window.pageYOffset||a.scrollTop)-(a.clientTop||document.body.clientTop||0)}}},"yTi+":function(Kt,he,D){Kt.exports=D.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(Kt,he,D){Kt.exports={flex_box_center:"flex_box_center___Joa_H",flex_space_between:"flex_space_between___3VhCy",flex_box_vertical_center:"flex_box_vertical_center___3wSNZ",flex_box_center_end:"flex_box_center_end___3z8HR",flex_box_column:"flex_box_column___KdHzx",form:"form___3KoYn",efficiency:"efficiency___1LMk4"}},zlzj:function(Kt,he,D){Kt.exports=D.p+"static/b3.30079151.svg"}}]);