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([[107,3,5,7,8,9,16],{"+92d":function(jt,_e,D){jt.exports=D.p+"static/b1.8d46544a.svg"},"+NIl":function(jt,_e,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";Z.defineMode("stex",function(V,I){"use strict";function G(u,a){u.cmdState.push(a)}function P(u){return u.cmdState.length>0?u.cmdState[u.cmdState.length-1]:null}function L(u){var a=u.cmdState.pop();a&&a.closeBracket()}function W(u){for(var a=u.cmdState,o=a.length-1;o>=0;o--){var c=a[o];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function k(u,a,o){return function(){this.name=u,this.bracketNo=0,this.style=a,this.styles=o,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(u,a){u.f=a}function E(u,a){var o;if(u.match(/^\\[a-zA-Z@]+/)){var c=u.current().slice(1);return o=r.hasOwnProperty(c)?r[c]:r.DEFAULT,o=new o,G(a,o),M(a,m),o.style}if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/\\]/))return"tag";if(u.match("\\["))return M(a,function(i,n){return p(i,n,"\\]")}),"keyword";if(u.match("\\("))return M(a,function(i,n){return p(i,n,"\\)")}),"keyword";if(u.match("$$"))return M(a,function(i,n){return p(i,n,"$$")}),"keyword";if(u.match("$"))return M(a,function(i,n){return p(i,n,"$")}),"keyword";var s=u.next();if(s=="%")return u.skipToEnd(),"comment";if(s=="}"||s=="]"){if(o=P(a),o)o.closeBracket(s),M(a,m);else return"error";return"bracket"}else return s=="{"||s=="["?(o=r.DEFAULT,o=new o,G(a,o),"bracket"):/\d/.test(s)?(u.eatWhile(/[\w.%]/),"atom"):(u.eatWhile(/[\w\-_]/),o=W(a),o.name=="begin"&&(o.argument=u.current()),o.styleIdentifier())}function p(u,a,o){if(u.eatSpace())return null;if(o&&u.match(o))return M(a,E),"keyword";if(u.match(/^\\[a-zA-Z@]+/))return"tag";if(u.match(/^[a-zA-Z]+/))return"variable-2";if(u.match(/^\\[$&%#{}_]/))return"tag";if(u.match(/^\\[,;!\/]/))return"tag";if(u.match(/^[\^_&]/))return"tag";if(u.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(u.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=u.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(u.skipToEnd(),"comment"):"error"}function m(u,a){var o=u.peek(),c;return o=="{"||o=="["?(c=P(a),c.openBracket(o),u.eat(o),M(a,E),"bracket"):/[ \t\r]/.test(o)?(u.eat(o),null):(M(a,E),L(a),E(u,a))}return{startState:function(){var u=I.inMathMode?function(a,o){return p(a,o)}:E;return{cmdState:[],f:u}},copyState:function(u){return{cmdState:u.cmdState.slice(),f:u.f}},token:function(u,a){return a.f(u,a)},blankLine:function(u){u.f=E,u.cmdState.length=0},lineComment:"%"}}),Z.defineMIME("text/x-stex","stex"),Z.defineMIME("text/x-latex","stex")})},"+ua5":function(jt,_e,D){},"/cxE":function(jt,_e,D){"use strict";D.d(_e,"f",function(){return I}),D.d(_e,"g",function(){return G}),D.d(_e,"h",function(){return P}),D.d(_e,"e",function(){return W}),D.d(_e,"b",function(){return k}),D.d(_e,"c",function(){return r}),D.d(_e,"d",function(){return M}),D.d(_e,"a",function(){return E});class Z{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
`+p.stack):p},0)}}emit(p){this.listeners.forEach(m=>{m(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const V=new Z;function I(p){W(p)||V.onUnexpectedError(p);return}function G(p){W(p)||V.onUnexpectedExternalError(p);return}function P(p){if(p instanceof Error){let{name:m,message:u}=p;const a=p.stacktrace||p.stack;return{$isError:!0,name:m,message:u,stack:a}}return p}const L="Canceled";function W(p){return p instanceof Error&&p.name===L&&p.message===L}function k(){const p=new Error(L);return p.name=p.message,p}function r(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function M(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class E extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"19Vz":function(jt,_e,D){(function(Z){Z(D("VrN/"))})(function(Z){Z.defineOption("placeholder","",function(k,r,M){var E=M&&M!=Z.Init;if(r&&!E)k.on("blur",P),k.on("change",L),k.on("swapDoc",L),Z.on(k.getInputField(),"compositionupdate",k.state.placeholderCompose=function(){G(k)}),L(k);else if(!r&&E){k.off("blur",P),k.off("change",L),k.off("swapDoc",L),Z.off(k.getInputField(),"compositionupdate",k.state.placeholderCompose),V(k);var p=k.getWrapperElement();p.className=p.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 I(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?I(k):V(k)},20)}function P(k){W(k)&&I(k)}function L(k){var r=k.getWrapperElement(),M=W(k);r.className=r.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?I(k):V(k)}function W(k){return k.lineCount()===1&&k.getLine(0)===""}})},"1eCo":function(jt,_e,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},I={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Z.defineMode("xml",function(G,P){var L=G.indentUnit,W={},k=P.htmlMode?V:I;for(var r in k)W[r]=k[r];for(var r in P)W[r]=P[r];var M,E;function p(h,_){function g(F){return _.tokenize=F,F(h,_)}var x=h.next();if(x=="<")return h.eat("!")?h.eat("[")?h.match("CDATA[")?g(a("atom","]]>")):null:h.match("--")?g(a("comment","-->")):h.match("DOCTYPE",!0,!0)?(h.eatWhile(/[\w\._\-]/),g(o(1))):null:h.eat("?")?(h.eatWhile(/[\w\._\-]/),_.tokenize=a("meta","?>"),"meta"):(M=h.eat("/")?"closeTag":"openTag",_.tokenize=m,"tag bracket");if(x=="&"){var N;return h.eat("#")?h.eat("x")?N=h.eatWhile(/[a-fA-F\d]/)&&h.eat(";"):N=h.eatWhile(/[\d]/)&&h.eat(";"):N=h.eatWhile(/[\w\.\-:]/)&&h.eat(";"),N?"atom":"error"}else return h.eatWhile(/[^&<]/),null}p.isInText=!0;function m(h,_){var g=h.next();if(g==">"||g=="/"&&h.eat(">"))return _.tokenize=p,M=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return M="equals",null;if(g=="<"){_.tokenize=p,_.state=n,_.tagName=_.tagStart=null;var x=_.tokenize(h,_);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(g)?(_.tokenize=u(g),_.stringStartCol=h.column(),_.tokenize(h,_)):(h.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function u(h){var _=function(g,x){for(;!g.eol();)if(g.next()==h){x.tokenize=m;break}return"string"};return _.isInAttribute=!0,_}function a(h,_){return function(g,x){for(;!g.eol();){if(g.match(_)){x.tokenize=p;break}g.next()}return h}}function o(h){return function(_,g){for(var x;(x=_.next())!=null;){if(x=="<")return g.tokenize=o(h+1),g.tokenize(_,g);if(x==">")if(h==1){g.tokenize=p;break}else return g.tokenize=o(h-1),g.tokenize(_,g)}return"meta"}}function c(h,_,g){this.prev=h.context,this.tagName=_,this.indent=h.indented,this.startOfLine=g,(W.doNotIndent.hasOwnProperty(_)||h.context&&h.context.noIndent)&&(this.noIndent=!0)}function s(h){h.context&&(h.context=h.context.prev)}function i(h,_){for(var g;;){if(!h.context)return;if(g=h.context.tagName,!W.contextGrabbers.hasOwnProperty(g)||!W.contextGrabbers[g].hasOwnProperty(_))return;s(h)}}function n(h,_,g){return h=="openTag"?(g.tagStart=_.column(),O):h=="closeTag"?S:n}function O(h,_,g){return h=="word"?(g.tagName=_.current(),E="tag",T):W.allowMissingTagName&&h=="endTag"?(E="tag bracket",T(h,_,g)):(E="error",O)}function S(h,_,g){if(h=="word"){var x=_.current();return g.context&&g.context.tagName!=x&&W.implicitlyClosed.hasOwnProperty(g.context.tagName)&&s(g),g.context&&g.context.tagName==x||W.matchClosing===!1?(E="tag",C):(E="tag error",R)}else return W.allowMissingTagName&&h=="endTag"?(E="tag bracket",C(h,_,g)):(E="error",R)}function C(h,_,g){return h!="endTag"?(E="error",C):(s(g),n)}function R(h,_,g){return E="error",C(h,_,g)}function T(h,_,g){if(h=="word")return E="attribute",v;if(h=="endTag"||h=="selfcloseTag"){var x=g.tagName,N=g.tagStart;return g.tagName=g.tagStart=null,h=="selfcloseTag"||W.autoSelfClosers.hasOwnProperty(x)?i(g,x):(i(g,x),g.context=new c(g,x,N==g.indented)),n}return E="error",T}function v(h,_,g){return h=="equals"?b:(W.allowMissing||(E="error"),T(h,_,g))}function b(h,_,g){return h=="string"?f:h=="word"&&W.allowUnquoted?(E="string",T):(E="error",T(h,_,g))}function f(h,_,g){return h=="string"?f:T(h,_,g)}return{startState:function(h){var _={tokenize:p,state:n,indented:h||0,tagName:null,tagStart:null,context:null};return h!=null&&(_.baseIndent=h),_},token:function(h,_){if(!_.tagName&&h.sol()&&(_.indented=h.indentation()),h.eatSpace())return null;M=null;var g=_.tokenize(h,_);return(g||M)&&g!="comment"&&(E=null,_.state=_.state(M||g,h,_),E&&(g=E=="error"?g+" error":E)),g},indent:function(h,_,g){var x=h.context;if(h.tokenize.isInAttribute)return h.tagStart==h.indented?h.stringStartCol+1:h.indented+L;if(x&&x.noIndent)return Z.Pass;if(h.tokenize!=m&&h.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(h.tagName)return W.multilineTagIndentPastTag!==!1?h.tagStart+h.tagName.length+2:h.tagStart+L*(W.multilineTagIndentFactor||1);if(W.alignCDATA&&/<!\[CDATA\[/.test(_))return 0;var N=_&&/^<(\/)?([\w_:\.-]*)/.exec(_);if(N&&N[1])for(;x;)if(x.tagName==N[2]){x=x.prev;break}else if(W.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(N)for(;x;){var F=W.contextGrabbers[x.tagName];if(F&&F.hasOwnProperty(N[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+L:h.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:W.htmlMode?"html":"xml",helperType:W.htmlMode?"html":"xml",skipAttribute:function(h){h.state==b&&(h.state=T)},xmlCurrentTag:function(h){return h.tagName?{name:h.tagName,close:h.type=="closeTag"}:null},xmlCurrentContext:function(h){for(var _=[],g=h.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(jt,_e,D){"use strict";D.d(_e,"d",function(){return Tt}),D.d(_e,"b",function(){return xe}),D.d(_e,"c",function(){return ct}),D.d(_e,"a",function(){return un});var Z=D("VTBJ"),V=D("1OyB"),I=D("vuIU"),G=D("JX7q"),P=D("Ji7U"),L=D("LK+K"),W=D("q1tI"),k=D("I8Z2"),r=D("BGR+"),M=D("wx14"),E=D("rePB"),p=D("4IlW"),m=D("2GS6"),u=D("Gytx"),a=D.n(u),o=D("TSYQ"),c=D.n(o),s=D("U8pU"),i=D("ODXe"),n=/iPhone/i,O=/iPod/i,S=/iPad/i,C=/\bAndroid(?:.+)Mobile\b/i,R=/Android/i,T=/\bAndroid(?:.+)SD4930UR\b/i,v=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,f=/\bWindows(?:.+)ARM\b/i,h=/BlackBerry/i,_=/BB10/i,g=/Opera Mini/i,x=/\b(CriOS|Chrome)(?:.+)Mobile/i,N=/Mobile(?:.+)Firefox\b/i;function F(Qt,ht){return Qt.test(ht)}function A(Qt){var ht=Qt||(typeof navigator!="undefined"?navigator.userAgent:""),Et=ht.split("[FBAN");if(typeof Et[1]!="undefined"){var it=Et,ve=Object(i.a)(it,1);ht=ve[0]}if(Et=ht.split("Twitter"),typeof Et[1]!="undefined"){var Me=Et,St=Object(i.a)(Me,1);ht=St[0]}var lt={apple:{phone:F(n,ht)&&!F(b,ht),ipod:F(O,ht),tablet:!F(n,ht)&&F(S,ht)&&!F(b,ht),device:(F(n,ht)||F(O,ht)||F(S,ht))&&!F(b,ht)},amazon:{phone:F(T,ht),tablet:!F(T,ht)&&F(v,ht),device:F(T,ht)||F(v,ht)},android:{phone:!F(b,ht)&&F(T,ht)||!F(b,ht)&&F(C,ht),tablet:!F(b,ht)&&!F(T,ht)&&!F(C,ht)&&(F(v,ht)||F(R,ht)),device:!F(b,ht)&&(F(T,ht)||F(v,ht)||F(C,ht)||F(R,ht))||F(/\bokhttp\b/i,ht)},windows:{phone:F(b,ht),tablet:F(f,ht),device:F(b,ht)||F(f,ht)},other:{blackberry:F(h,ht),blackberry10:F(_,ht),opera:F(g,ht),firefox:F(N,ht),chrome:F(x,ht),device:F(h,ht)||F(_,ht)||F(g,ht)||F(N,ht)||F(x,ht)},any:null,phone:null,tablet:null};return lt.any=lt.apple.device||lt.android.device||lt.windows.device||lt.other.device,lt.phone=lt.apple.phone||lt.android.phone||lt.windows.phone,lt.tablet=lt.apple.tablet||lt.android.tablet||lt.windows.tablet,lt}var B=Object(Z.a)(Object(Z.a)({},A()),{},{isMobile:A}),U=B;function w(){}function Y(Qt,ht,Et){var it=ht||"";return Qt.key||"".concat(it,"item_").concat(Et)}function q(Qt){return"".concat(Qt,"-menu-")}function ce(Qt,ht){var Et=-1;W.Children.forEach(Qt,function(it){Et+=1,it&&it.type&&it.type.isMenuItemGroup?W.Children.forEach(it.props.children,function(ve){Et+=1,ht(ve,Et)}):ht(it,Et)})}function Ee(Qt,ht,Et){if(!Qt||Et.find)return;W.Children.forEach(Qt,function(it){if(it){var ve=it.type;if(!ve||!(ve.isSubMenu||ve.isMenuItem||ve.isMenuItemGroup))return;ht.indexOf(it.key)!==-1?Et.find=!0:it.props.children&&Ee(it.props.children,ht,Et)}})}var Qe=["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"],Te=function(ht){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,it=ht&&typeof ht.getBoundingClientRect=="function"&&ht.getBoundingClientRect().width;if(it){if(Et){var ve=getComputedStyle(ht),Me=ve.marginLeft,St=ve.marginRight;it+=+Me.replace("px","")+ +St.replace("px","")}it=+it.toFixed(6)}return it||0},We=function(ht,Et,it){ht&&Object(s.a)(ht.style)==="object"&&(ht.style[Et]=it)},$e=function(){return U.any},Je=D("KQm4"),Ce=D("Ff2n"),X=D("i8i4"),j=D("bdgK"),K=D("uciX"),Q=D("8XRh"),re={adjustX:1,adjustY:1},z={topLeft:{points:["bl","tl"],overflow:re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:re,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:re,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:re,offset:[4,0]}},we={topLeft:{points:["bl","tl"],overflow:re,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:re,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:re,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:re,offset:[4,0]}},Ue=z,rt=0,le={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Oe=function(ht,Et,it){var ve=q(Et),Me=ht.getState();ht.setState({defaultActiveFirst:Object(Z.a)(Object(Z.a)({},Me.defaultActiveFirst),{},Object(E.a)({},ve,it))})},Fe=function(Qt){Object(P.a)(Et,Qt);var ht=Object(L.a)(Et);function Et(it){var ve;Object(V.a)(this,Et),ve=ht.call(this,it),ve.onDestroy=function(Ve){ve.props.onDestroy(Ve)},ve.onKeyDown=function(Ve){var et=Ve.keyCode,gt=ve.menuInstance,Ht=ve.props,Vt=Ht.isOpen,dn=Ht.store;if(et===p.a.ENTER)return ve.onTitleClick(Ve),Oe(dn,ve.props.eventKey,!0),!0;if(et===p.a.RIGHT)return Vt?gt.onKeyDown(Ve):(ve.triggerOpenChange(!0),Oe(dn,ve.props.eventKey,!0)),!0;if(et===p.a.LEFT){var Zn;if(Vt)Zn=gt.onKeyDown(Ve);else return;return Zn||(ve.triggerOpenChange(!1),Zn=!0),Zn}return Vt&&(et===p.a.UP||et===p.a.DOWN)?gt.onKeyDown(Ve):void 0},ve.onOpenChange=function(Ve){ve.props.onOpenChange(Ve)},ve.onPopupVisibleChange=function(Ve){ve.triggerOpenChange(Ve,Ve?"mouseenter":"mouseleave")},ve.onMouseEnter=function(Ve){var et=ve.props,gt=et.eventKey,Ht=et.onMouseEnter,Vt=et.store;Oe(Vt,ve.props.eventKey,!1),Ht({key:gt,domEvent:Ve})},ve.onMouseLeave=function(Ve){var et=ve.props,gt=et.parentMenu,Ht=et.eventKey,Vt=et.onMouseLeave;gt.subMenuInstance=Object(G.a)(ve),Vt({key:Ht,domEvent:Ve})},ve.onTitleMouseEnter=function(Ve){var et=ve.props,gt=et.eventKey,Ht=et.onItemHover,Vt=et.onTitleMouseEnter;Ht({key:gt,hover:!0}),Vt({key:gt,domEvent:Ve})},ve.onTitleMouseLeave=function(Ve){var et=ve.props,gt=et.parentMenu,Ht=et.eventKey,Vt=et.onItemHover,dn=et.onTitleMouseLeave;gt.subMenuInstance=Object(G.a)(ve),Vt({key:Ht,hover:!1}),dn({key:Ht,domEvent:Ve})},ve.onTitleClick=function(Ve){var et=Object(G.a)(ve),gt=et.props;if(gt.onTitleClick({key:gt.eventKey,domEvent:Ve}),gt.triggerSubMenuAction==="hover")return;ve.triggerOpenChange(!gt.isOpen,"click"),Oe(gt.store,ve.props.eventKey,!1)},ve.onSubMenuClick=function(Ve){typeof ve.props.onClick=="function"&&ve.props.onClick(ve.addKeyPath(Ve))},ve.onSelect=function(Ve){ve.props.onSelect(Ve)},ve.onDeselect=function(Ve){ve.props.onDeselect(Ve)},ve.getPrefixCls=function(){return"".concat(ve.props.rootPrefixCls,"-submenu")},ve.getActiveClassName=function(){return"".concat(ve.getPrefixCls(),"-active")},ve.getDisabledClassName=function(){return"".concat(ve.getPrefixCls(),"-disabled")},ve.getSelectedClassName=function(){return"".concat(ve.getPrefixCls(),"-selected")},ve.getOpenClassName=function(){return"".concat(ve.props.rootPrefixCls,"-submenu-open")},ve.saveMenuInstance=function(Ve){ve.menuInstance=Ve},ve.addKeyPath=function(Ve){return Object(Z.a)(Object(Z.a)({},Ve),{},{keyPath:(Ve.keyPath||[]).concat(ve.props.eventKey)})},ve.triggerOpenChange=function(Ve,et){var gt=ve.props.eventKey,Ht=function(){ve.onOpenChange({key:gt,item:Object(G.a)(ve),trigger:et,open:Ve})};et==="mouseenter"?ve.mouseenterTimeout=setTimeout(function(){Ht()},0):Ht()},ve.isChildrenSelected=function(){var Ve={find:!1};return Ee(ve.props.children,ve.props.selectedKeys,Ve),Ve.find},ve.isOpen=function(){return ve.props.openKeys.indexOf(ve.props.eventKey)!==-1},ve.adjustWidth=function(){if(!ve.subMenuTitle||!ve.menuInstance)return;var Ve=X.findDOMNode(ve.menuInstance);if(Ve.offsetWidth>=ve.subMenuTitle.offsetWidth)return;Ve.style.minWidth="".concat(ve.subMenuTitle.offsetWidth,"px")},ve.saveSubMenuTitle=function(Ve){ve.subMenuTitle=Ve},ve.getBaseProps=function(){var Ve=Object(G.a)(ve),et=Ve.props;return{mode:et.mode==="horizontal"?"vertical":et.mode,visible:ve.props.isOpen,level:et.level+1,inlineIndent:et.inlineIndent,focusable:!1,onClick:ve.onSubMenuClick,onSelect:ve.onSelect,onDeselect:ve.onDeselect,onDestroy:ve.onDestroy,selectedKeys:et.selectedKeys,eventKey:"".concat(et.eventKey,"-menu-"),openKeys:et.openKeys,motion:et.motion,onOpenChange:ve.onOpenChange,subMenuOpenDelay:et.subMenuOpenDelay,parentMenu:Object(G.a)(ve),subMenuCloseDelay:et.subMenuCloseDelay,forceSubMenuRender:et.forceSubMenuRender,triggerSubMenuAction:et.triggerSubMenuAction,builtinPlacements:et.builtinPlacements,defaultActiveFirst:et.store.getState().defaultActiveFirst[q(et.eventKey)],multiple:et.multiple,prefixCls:et.rootPrefixCls,id:ve.internalMenuId,manualRef:ve.saveMenuInstance,itemIcon:et.itemIcon,expandIcon:et.expandIcon,direction:et.direction}},ve.getMotion=function(Ve,et){var gt=Object(G.a)(ve),Ht=gt.haveRendered,Vt=ve.props,dn=Vt.motion,Zn=Vt.rootPrefixCls,Wn=Object(Z.a)(Object(Z.a)({},dn),{},{leavedClassName:"".concat(Zn,"-hidden"),removeOnLeave:!1,motionAppear:Ht||!et||Ve!=="inline"});return Wn};var Me=it.store,St=it.eventKey,lt=Me.getState(),Gt=lt.defaultActiveFirst;ve.isRootMenu=!1;var qt=!1;return Gt&&(qt=Gt[St]),Oe(Me,St,qt),ve}return Object(I.a)(Et,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ve=this,Me=this.props,St=Me.mode,lt=Me.parentMenu,Gt=Me.manualRef;if(Gt&&Gt(this),St!=="horizontal"||!lt.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return ve.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ve=this.props,Me=ve.onDestroy,St=ve.eventKey;Me&&Me(St),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(ve){var Me=this,St=this.getBaseProps(),lt=this.getMotion(St.mode,St.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||St.visible||St.forceSubMenuRender,!this.haveOpened)return W.createElement("div",null);var Gt=St.direction;return W.createElement(Q.default,Object.assign({visible:St.visible},lt),function(qt){var Ve=qt.className,et=qt.style,gt=c()("".concat(St.prefixCls,"-sub"),Ve,Object(E.a)({},"".concat(St.prefixCls,"-rtl"),Gt==="rtl"));return W.createElement(ne,Object.assign({},St,{id:Me.internalMenuId,className:gt,style:et}),ve)})}},{key:"render",value:function(){var ve,Me=Object(Z.a)({},this.props),St=Me.isOpen,lt=this.getPrefixCls(),Gt=Me.mode==="inline",qt=c()(lt,"".concat(lt,"-").concat(Me.mode),(ve={},Object(E.a)(ve,Me.className,!!Me.className),Object(E.a)(ve,this.getOpenClassName(),St),Object(E.a)(ve,this.getActiveClassName(),Me.active||St&&!Gt),Object(E.a)(ve,this.getDisabledClassName(),Me.disabled),Object(E.a)(ve,this.getSelectedClassName(),this.isChildrenSelected()),ve));this.internalMenuId||(Me.eventKey?this.internalMenuId="".concat(Me.eventKey,"$Menu"):(rt+=1,this.internalMenuId="$__$".concat(rt,"$Menu")));var Ve={},et={},gt={};Me.disabled||(Ve={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},et={onClick:this.onTitleClick},gt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ht={},Vt=Me.direction;Gt&&(Vt==="rtl"?Ht.paddingRight=Me.inlineIndent*Me.level:Ht.paddingLeft=Me.inlineIndent*Me.level);var dn={};this.props.isOpen&&(dn={"aria-owns":this.internalMenuId});var Zn=null;Me.mode!=="horizontal"&&(Zn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Zn=W.createElement(this.props.expandIcon,Object(Z.a)({},this.props))));var Wn=W.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ht,className:"".concat(lt,"-title"),role:"button"},gt,et,{"aria-expanded":St},dn,{"aria-haspopup":"true",title:typeof Me.title=="string"?Me.title:void 0}),Me.title,Zn||W.createElement("i",{className:"".concat(lt,"-arrow")})),tn=this.renderChildren(Me.children),Hn=Me.parentMenu.isRootMenu?Me.parentMenu.props.getPopupContainer:function(Jr){return Jr.parentNode},ir=le[Me.mode],Dn=Me.popupOffset?{offset:Me.popupOffset}:{},Vn=Me.mode==="inline"?"":Me.popupClassName;Vn+=Vt==="rtl"?" ".concat(lt,"-rtl"):"";var qn=Me.disabled,Mr=Me.triggerSubMenuAction,Sr=Me.subMenuOpenDelay,on=Me.forceSubMenuRender,Jn=Me.subMenuCloseDelay,oi=Me.builtinPlacements;Qe.forEach(function(Jr){return delete Me[Jr]}),delete Me.onClick;var xi=Vt==="rtl"?Object.assign({},we,oi):Object.assign({},z,oi);return delete Me.direction,W.createElement("li",Object.assign({},Me,Ve,{className:qt,role:"menuitem"}),Gt&&Wn,Gt&&tn,!Gt&&W.createElement(K.a,{prefixCls:lt,popupClassName:c()("".concat(lt,"-popup"),Vn),getPopupContainer:Hn,builtinPlacements:xi,popupPlacement:ir,popupVisible:St,popupAlign:Dn,popup:tn,action:qn?[]:[Mr],mouseEnterDelay:Sr,mouseLeaveDelay:Jn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:on},Wn))}}]),Et}(W.Component);Fe.defaultProps={onMouseEnter:w,onMouseLeave:w,onTitleMouseEnter:w,onTitleMouseLeave:w,onTitleClick:w,manualRef:w,mode:"vertical",title:""};var Ye=Object(k.b)(function(Qt,ht){var Et=Qt.openKeys,it=Qt.activeKey,ve=Qt.selectedKeys,Me=ht.eventKey,St=ht.subMenuKey;return{isOpen:Et.indexOf(Me)>-1,active:it[St]===Me,selectedKeys:ve}})(Fe);Ye.isSubMenu=!0;var Tt=Ye,Nt="menuitem-overflowed",Xt=.5,tt=function(Qt){Object(P.a)(Et,Qt);var ht=Object(L.a)(Et);function Et(){var it;return Object(V.a)(this,Et),it=ht.apply(this,arguments),it.resizeObserver=null,it.mutationObserver=null,it.originalTotalWidth=0,it.overflowedItems=[],it.menuItemSizes=[],it.cancelFrameId=null,it.state={lastVisibleIndex:void 0},it.getMenuItemNodes=function(){var ve=it.props.prefixCls,Me=X.findDOMNode(Object(G.a)(it));return Me?[].slice.call(Me.children).filter(function(St){return St.className.split(" ").indexOf("".concat(ve,"-overflowed-submenu"))<0}):[]},it.getOverflowedSubMenuItem=function(ve,Me,St){var lt=it.props,Gt=lt.overflowedIndicator,qt=lt.level,Ve=lt.mode,et=lt.prefixCls,gt=lt.theme;if(qt!==1||Ve!=="horizontal")return null;var Ht=it.props.children[0],Vt=Ht.props,dn=Vt.children,Zn=Vt.title,Wn=Vt.style,tn=Object(Ce.a)(Vt,["children","title","style"]),Hn=Object(Z.a)({},Wn),ir="".concat(ve,"-overflowed-indicator"),Dn="".concat(ve,"-overflowed-indicator");Me.length===0&&St!==!0?Hn=Object(Z.a)(Object(Z.a)({},Hn),{},{display:"none"}):St&&(Hn=Object(Z.a)(Object(Z.a)({},Hn),{},{visibility:"hidden",position:"absolute"}),ir="".concat(ir,"-placeholder"),Dn="".concat(Dn,"-placeholder"));var Vn=gt?"".concat(et,"-").concat(gt):"",qn={};return Qe.forEach(function(Mr){tn[Mr]!==void 0&&(qn[Mr]=tn[Mr])}),W.createElement(Tt,Object.assign({title:Gt,className:"".concat(et,"-overflowed-submenu"),popupClassName:Vn},qn,{key:ir,eventKey:Dn,disabled:!1,style:Hn}),Me)},it.setChildrenWidthAndResize=function(){if(it.props.mode!=="horizontal")return;var ve=X.findDOMNode(Object(G.a)(it));if(!ve)return;var Me=ve.children;if(!Me||Me.length===0)return;var St=ve.children[Me.length-1];We(St,"display","inline-block");var lt=it.getMenuItemNodes(),Gt=lt.filter(function(qt){return qt.className.split(" ").indexOf(Nt)>=0});Gt.forEach(function(qt){We(qt,"display","inline-block")}),it.menuItemSizes=lt.map(function(qt){return Te(qt,!0)}),Gt.forEach(function(qt){We(qt,"display","none")}),it.overflowedIndicatorWidth=Te(ve.children[ve.children.length-1],!0),it.originalTotalWidth=it.menuItemSizes.reduce(function(qt,Ve){return qt+Ve},0),it.handleResize(),We(St,"display","none")},it.handleResize=function(){if(it.props.mode!=="horizontal")return;var ve=X.findDOMNode(Object(G.a)(it));if(!ve)return;var Me=Te(ve);it.overflowedItems=[];var St=0,lt;it.originalTotalWidth>Me+Xt&&(lt=-1,it.menuItemSizes.forEach(function(Gt){St+=Gt,St+it.overflowedIndicatorWidth<=Me&&(lt+=1)})),it.setState({lastVisibleIndex:lt})},it}return Object(I.a)(Et,[{key:"componentDidMount",value:function(){var ve=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var Me=X.findDOMNode(this);if(!Me)return;this.resizeObserver=new j.default(function(St){St.forEach(function(){var lt=ve.cancelFrameId;cancelAnimationFrame(lt),ve.cancelFrameId=requestAnimationFrame(ve.setChildrenWidthAndResize)})}),[].slice.call(Me.children).concat(Me).forEach(function(St){ve.resizeObserver.observe(St)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ve.resizeObserver.disconnect(),[].slice.call(Me.children).concat(Me).forEach(function(St){ve.resizeObserver.observe(St)}),ve.setChildrenWidthAndResize()}),this.mutationObserver.observe(Me,{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(ve){var Me=this,St=this.state.lastVisibleIndex;return(ve||[]).reduce(function(lt,Gt,qt){var Ve=Gt;if(Me.props.mode==="horizontal"){var et=Me.getOverflowedSubMenuItem(Gt.props.eventKey,[]);St!==void 0&&Me.props.className.indexOf("".concat(Me.props.prefixCls,"-root"))!==-1&&(qt>St&&(Ve=W.cloneElement(Gt,{style:{display:"none"},eventKey:"".concat(Gt.props.eventKey,"-hidden"),className:"".concat(Nt)})),qt===St+1&&(Me.overflowedItems=ve.slice(St+1).map(function(Ht){return W.cloneElement(Ht,{key:Ht.props.eventKey,mode:"vertical-left"})}),et=Me.getOverflowedSubMenuItem(Gt.props.eventKey,Me.overflowedItems)));var gt=[].concat(Object(Je.a)(lt),[et,Ve]);return qt===ve.length-1&&gt.push(Me.getOverflowedSubMenuItem(Gt.props.eventKey,[],!0)),gt}return[].concat(Object(Je.a)(lt),[Ve])},[])}},{key:"render",value:function(){var ve=this.props,Me=ve.visible,St=ve.prefixCls,lt=ve.overflowedIndicator,Gt=ve.mode,qt=ve.level,Ve=ve.tag,et=ve.children,gt=ve.theme,Ht=Object(Ce.a)(ve,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Vt=Ve;return W.createElement(Vt,Object.assign({},Ht),this.renderChildren(et))}}]),Et}(W.Component);tt.defaultProps={tag:"div",className:""};var Zt=tt;function vn(Qt){return Qt.length?Qt.every(function(ht){return!!ht.props.disabled}):!0}function ze(Qt,ht,Et){var it=Qt.getState();Qt.setState({activeKey:Object(Z.a)(Object(Z.a)({},it.activeKey),{},Object(E.a)({},ht,Et))})}function He(Qt){return Qt.eventKey||"0-menu-"}function vt(Qt,ht){var Et=ht,it=Qt.children,ve=Qt.eventKey;if(Et){var Me;if(ce(it,function(St,lt){St&&St.props&&!St.props.disabled&&Et===Y(St,ve,lt)&&(Me=!0)}),Me)return Et}return Et=null,Qt.defaultActiveFirst&&ce(it,function(St,lt){!Et&&St&&!St.props.disabled&&(Et=Y(St,ve,lt))}),Et}function Rt(Qt){if(Qt){var ht=this.instanceArray.indexOf(Qt);ht!==-1?this.instanceArray[ht]=Qt:this.instanceArray.push(Qt)}}var de=function(Qt){Object(P.a)(Et,Qt);var ht=Object(L.a)(Et);function Et(it){var ve;return Object(V.a)(this,Et),ve=ht.call(this,it),ve.onKeyDown=function(Me,St){var lt=Me.keyCode,Gt;if(ve.getFlatInstanceArray().forEach(function(Ve){Ve&&Ve.props.active&&Ve.onKeyDown&&(Gt=Ve.onKeyDown(Me))}),Gt)return 1;var qt=null;return(lt===p.a.UP||lt===p.a.DOWN)&&(qt=ve.step(lt===p.a.UP?-1:1)),qt?(Me.preventDefault(),ze(ve.props.store,He(ve.props),qt.props.eventKey),typeof St=="function"&&St(qt),1):void 0},ve.onItemHover=function(Me){var St=Me.key,lt=Me.hover;ze(ve.props.store,He(ve.props),lt?St:null)},ve.onDeselect=function(Me){ve.props.onDeselect(Me)},ve.onSelect=function(Me){ve.props.onSelect(Me)},ve.onClick=function(Me){ve.props.onClick(Me)},ve.onOpenChange=function(Me){ve.props.onOpenChange(Me)},ve.onDestroy=function(Me){ve.props.onDestroy(Me)},ve.getFlatInstanceArray=function(){return ve.instanceArray},ve.step=function(Me){var St=ve.getFlatInstanceArray(),lt=ve.props.store.getState().activeKey[He(ve.props)],Gt=St.length;if(!Gt)return null;Me<0&&(St=St.concat().reverse());var qt=-1;if(St.every(function(Ht,Vt){return Ht&&Ht.props.eventKey===lt?(qt=Vt,!1):!0}),!ve.props.defaultActiveFirst&&qt!==-1&&vn(St.slice(qt,Gt-1)))return;var Ve=(qt+1)%Gt,et=Ve;do{var gt=St[et];if(!gt||gt.props.disabled)et=(et+1)%Gt;else return gt}while(et!==Ve);return null},ve.renderCommonMenuItem=function(Me,St,lt){var Gt=ve.props.store.getState(),qt=Object(G.a)(ve),Ve=qt.props,et=Y(Me,Ve.eventKey,St),gt=Me.props;if(!gt||typeof Me.type=="string")return Me;var Ht=et===Gt.activeKey,Vt=Object(Z.a)(Object(Z.a)({mode:gt.mode||Ve.mode,level:Ve.level,inlineIndent:Ve.inlineIndent,renderMenuItem:ve.renderMenuItem,rootPrefixCls:Ve.prefixCls,index:St,parentMenu:Ve.parentMenu,manualRef:gt.disabled?void 0:Object(m.a)(Me.ref,Rt.bind(Object(G.a)(ve))),eventKey:et,active:!gt.disabled&&Ht,multiple:Ve.multiple,onClick:function(Zn){(gt.onClick||w)(Zn),ve.onClick(Zn)},onItemHover:ve.onItemHover,motion:Ve.motion,subMenuOpenDelay:Ve.subMenuOpenDelay,subMenuCloseDelay:Ve.subMenuCloseDelay,forceSubMenuRender:Ve.forceSubMenuRender,onOpenChange:ve.onOpenChange,onDeselect:ve.onDeselect,onSelect:ve.onSelect,builtinPlacements:Ve.builtinPlacements,itemIcon:gt.itemIcon||ve.props.itemIcon,expandIcon:gt.expandIcon||ve.props.expandIcon},lt),{},{direction:Ve.direction});return(Ve.mode==="inline"||$e())&&(Vt.triggerSubMenuAction="click"),W.cloneElement(Me,Vt)},ve.renderMenuItem=function(Me,St,lt){if(!Me)return null;var Gt=ve.props.store.getState(),qt={openKeys:Gt.openKeys,selectedKeys:Gt.selectedKeys,triggerSubMenuAction:ve.props.triggerSubMenuAction,subMenuKey:lt};return ve.renderCommonMenuItem(Me,St,qt)},it.store.setState({activeKey:Object(Z.a)(Object(Z.a)({},it.store.getState().activeKey),{},Object(E.a)({},it.eventKey,vt(it,it.activeKey)))}),ve.instanceArray=[],ve}return Object(I.a)(Et,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ve){return this.props.visible||ve.visible||this.props.className!==ve.className||!a()(this.props.style,ve.style)}},{key:"componentDidUpdate",value:function(ve){var Me=this.props,St="activeKey"in Me?Me.activeKey:Me.store.getState().activeKey[He(Me)],lt=vt(Me,St);if(lt!==St)ze(Me.store,He(Me),lt);else if("activeKey"in ve){var Gt=vt(ve,ve.activeKey);lt!==Gt&&ze(Me.store,He(Me),lt)}}},{key:"render",value:function(){var ve=this,Me=Object(M.a)({},this.props);this.instanceArray=[];var St=c()(Me.prefixCls,Me.className,"".concat(Me.prefixCls,"-").concat(Me.mode)),lt={className:St,role:Me.role||"menu"};Me.id&&(lt.id=Me.id),Me.focusable&&(lt.tabIndex=0,lt.onKeyDown=this.onKeyDown);var Gt=Me.prefixCls,qt=Me.eventKey,Ve=Me.visible,et=Me.level,gt=Me.mode,Ht=Me.overflowedIndicator,Vt=Me.theme;return Qe.forEach(function(dn){return delete Me[dn]}),delete Me.onClick,W.createElement(Zt,Object.assign({},Me,{prefixCls:Gt,mode:gt,tag:"ul",level:et,theme:Vt,visible:Ve,overflowedIndicator:Ht},lt),W.Children.map(Me.children,function(dn,Zn){return ve.renderMenuItem(dn,Zn,qt||"0-menu-")}))}}]),Et}(W.Component);de.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:w};var ee=Object(k.b)()(de),ne=ee,se=D("Kwbf");function pe(Qt,ht,Et){var it=Qt.prefixCls,ve=Qt.motion,Me=Qt.defaultMotions,St=Me===void 0?{}:Me,lt=Qt.openAnimation,Gt=Qt.openTransitionName,qt=ht.switchingModeFromInline;if(ve)return ve;if(Object(s.a)(lt)==="object"&&lt)Object(se.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof lt=="string")return{motionName:"".concat(it,"-open-").concat(lt)};if(Gt)return{motionName:Gt};var Ve=St[Et];return Ve||(qt?null:St.other)}var ae=function(Qt){Object(P.a)(Et,Qt);var ht=Object(L.a)(Et);function Et(it){var ve;Object(V.a)(this,Et),ve=ht.call(this,it),ve.inlineOpenKeys=[],ve.onSelect=function(lt){var Gt=Object(G.a)(ve),qt=Gt.props;if(qt.selectable){var Ve=ve.store.getState(),et=Ve.selectedKeys,gt=lt.key;qt.multiple?et=et.concat([gt]):et=[gt],"selectedKeys"in qt||ve.store.setState({selectedKeys:et}),qt.onSelect(Object(Z.a)(Object(Z.a)({},lt),{},{selectedKeys:et}))}},ve.onClick=function(lt){var Gt=ve.getRealMenuMode(),qt=Object(G.a)(ve),Ve=qt.store,et=qt.props.onOpenChange;Gt!=="inline"&&!("openKeys"in ve.props)&&(Ve.setState({openKeys:[]}),et([])),ve.props.onClick(lt)},ve.onKeyDown=function(lt,Gt){ve.innerMenu.getWrappedInstance().onKeyDown(lt,Gt)},ve.onOpenChange=function(lt){var Gt=Object(G.a)(ve),qt=Gt.props,Ve=ve.store.getState().openKeys.concat(),et=!1,gt=function(Vt){var dn=!1;if(Vt.open)dn=Ve.indexOf(Vt.key)===-1,dn&&Ve.push(Vt.key);else{var Zn=Ve.indexOf(Vt.key);dn=Zn!==-1,dn&&Ve.splice(Zn,1)}et=et||dn};Array.isArray(lt)?lt.forEach(gt):gt(lt),et&&("openKeys"in ve.props||ve.store.setState({openKeys:Ve}),qt.onOpenChange(Ve))},ve.onDeselect=function(lt){var Gt=Object(G.a)(ve),qt=Gt.props;if(qt.selectable){var Ve=ve.store.getState().selectedKeys.concat(),et=lt.key,gt=Ve.indexOf(et);gt!==-1&&Ve.splice(gt,1),"selectedKeys"in qt||ve.store.setState({selectedKeys:Ve}),qt.onDeselect(Object(Z.a)(Object(Z.a)({},lt),{},{selectedKeys:Ve}))}},ve.onMouseEnter=function(lt){ve.restoreModeVerticalFromInline();var Gt=ve.props.onMouseEnter;Gt&&Gt(lt)},ve.onTransitionEnd=function(lt){var Gt=lt.propertyName==="width"&&lt.target===lt.currentTarget,qt=lt.target.className,Ve=Object.prototype.toString.call(qt)==="[object SVGAnimatedString]"?qt.animVal:qt,et=lt.propertyName==="font-size"&&Ve.indexOf("anticon")>=0;(Gt||et)&&ve.restoreModeVerticalFromInline()},ve.setInnerMenu=function(lt){ve.innerMenu=lt},ve.isRootMenu=!0;var Me=it.defaultSelectedKeys,St=it.defaultOpenKeys;return"selectedKeys"in it&&(Me=it.selectedKeys||[]),"openKeys"in it&&(St=it.openKeys||[]),ve.store=Object(k.c)({selectedKeys:Me,openKeys:St,activeKey:{"0-menu-":vt(it,it.activeKey)}}),ve.state={switchingModeFromInline:!1},ve}return Object(I.a)(Et,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ve){this.updateOpentKeysWhenSwitchMode(ve),this.updateMiniStore();var Me=this.props,St=Me.siderCollapsed,lt=Me.inlineCollapsed,Gt=Me.onOpenChange;(!ve.inlineCollapsed&&lt||!ve.siderCollapsed&&St)&&Gt([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(ve){var Me=this.props,St=this.store,lt=this.inlineOpenKeys,Gt=St.getState(),qt={};ve.mode==="inline"&&Me.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in Me||((Me.inlineCollapsed&&!ve.inlineCollapsed||Me.siderCollapsed&&!ve.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=Gt.openKeys.concat(),qt.openKeys=[]),(!Me.inlineCollapsed&&ve.inlineCollapsed||!Me.siderCollapsed&&ve.siderCollapsed)&&(qt.openKeys=lt,this.inlineOpenKeys=[])),Object.keys(qt).length&&St.setState(qt)}},{key:"updateMenuDisplay",value:function(){var ve=this.props.collapsedWidth,Me=this.store,St=this.prevOpenKeys,lt=this.getInlineCollapsed()&&(ve===0||ve==="0"||ve==="0px");lt?(this.prevOpenKeys=Me.getState().openKeys.concat(),this.store.setState({openKeys:[]})):St&&(this.store.setState({openKeys:St}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ve=this.props.mode,Me=this.state.switchingModeFromInline,St=this.getInlineCollapsed();return Me&&St?"inline":St?"vertical":ve}},{key:"getInlineCollapsed",value:function(){var ve=this.props,Me=ve.inlineCollapsed,St=ve.siderCollapsed;return St!==void 0?St:Me}},{key:"restoreModeVerticalFromInline",value:function(){var ve=this.state.switchingModeFromInline;ve&&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 ve=Object(Z.a)({},Object(r.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),Me=this.getRealMenuMode();return ve.className+=" ".concat(ve.prefixCls,"-root"),ve.direction==="rtl"&&(ve.className+=" ".concat(ve.prefixCls,"-rtl")),ve=Object(Z.a)(Object(Z.a)({},ve),{},{mode:Me,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:pe(this.props,this.state,Me)}),delete ve.openAnimation,delete ve.openTransitionName,W.createElement(k.a,{store:this.store},W.createElement(ne,Object.assign({},ve,{ref:this.setInnerMenu}),this.props.children))}}]),Et}(W.Component);ae.defaultProps={selectable:!0,onClick:w,onSelect:w,onOpenChange:w,onDeselect:w,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:W.createElement("span",null,"\xB7\xB7\xB7")};var ie=ae,me=function(Qt){Object(P.a)(Et,Qt);var ht=Object(L.a)(Et);function Et(){var it;return Object(V.a)(this,Et),it=ht.apply(this,arguments),it.onKeyDown=function(ve){var Me=ve.keyCode;return Me===p.a.ENTER?(it.onClick(ve),!0):void 0},it.onMouseLeave=function(ve){var Me=it.props,St=Me.eventKey,lt=Me.onItemHover,Gt=Me.onMouseLeave;lt({key:St,hover:!1}),Gt({key:St,domEvent:ve})},it.onMouseEnter=function(ve){var Me=it.props,St=Me.eventKey,lt=Me.onItemHover,Gt=Me.onMouseEnter;lt({key:St,hover:!0}),Gt({key:St,domEvent:ve})},it.onClick=function(ve){var Me=it.props,St=Me.eventKey,lt=Me.multiple,Gt=Me.onClick,qt=Me.onSelect,Ve=Me.onDeselect,et=Me.isSelected,gt={key:St,keyPath:[St],item:Object(G.a)(it),domEvent:ve};Gt(gt),lt?et?Ve(gt):qt(gt):et||qt(gt)},it.saveNode=function(ve){it.node=ve},it}return Object(I.a)(Et,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ve=this.props;ve.onDestroy&&ve.onDestroy(ve.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 ve,Me=Object(Z.a)({},this.props),St=c()(this.getPrefixCls(),Me.className,(ve={},Object(E.a)(ve,this.getActiveClassName(),!Me.disabled&&Me.active),Object(E.a)(ve,this.getSelectedClassName(),Me.isSelected),Object(E.a)(ve,this.getDisabledClassName(),Me.disabled),ve)),lt=Object(Z.a)(Object(Z.a)({},Me.attribute),{},{title:typeof Me.title=="string"?Me.title:void 0,className:St,role:Me.role||"menuitem","aria-disabled":Me.disabled});Me.role==="option"?lt=Object(Z.a)(Object(Z.a)({},lt),{},{role:"option","aria-selected":Me.isSelected}):(Me.role===null||Me.role==="none")&&(lt.role="none");var Gt={onClick:Me.disabled?null:this.onClick,onMouseLeave:Me.disabled?null:this.onMouseLeave,onMouseEnter:Me.disabled?null:this.onMouseEnter},qt=Object(Z.a)({},Me.style);Me.mode==="inline"&&(Me.direction==="rtl"?qt.paddingRight=Me.inlineIndent*Me.level:qt.paddingLeft=Me.inlineIndent*Me.level),Qe.forEach(function(et){return delete Me[et]}),delete Me.direction;var Ve=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ve=W.createElement(this.props.itemIcon,this.props)),W.createElement("li",Object.assign({},Object(r.default)(Me,["onClick","onMouseEnter","onMouseLeave","onSelect"]),lt,Gt,{style:qt,ref:this.saveNode}),Me.children,Ve)}}]),Et}(W.Component);me.isMenuItem=!0,me.defaultProps={onSelect:w,onMouseEnter:w,onMouseLeave:w,manualRef:w};var ye=Object(k.b)(function(Qt,ht){var Et=Qt.activeKey,it=Qt.selectedKeys,ve=ht.eventKey,Me=ht.subMenuKey;return{active:Et[Me]===ve,isSelected:it.indexOf(ve)!==-1}})(me),xe=ye,De=function(Qt){Object(P.a)(Et,Qt);var ht=Object(L.a)(Et);function Et(){var it;return Object(V.a)(this,Et),it=ht.apply(this,arguments),it.renderInnerMenuItem=function(ve){var Me=it.props,St=Me.renderMenuItem,lt=Me.index;return St(ve,lt,it.props.subMenuKey)},it}return Object(I.a)(Et,[{key:"render",value:function(){var ve=Object(M.a)({},this.props),Me=ve.className,St=Me===void 0?"":Me,lt=ve.rootPrefixCls,Gt="".concat(lt,"-item-group-title"),qt="".concat(lt,"-item-group-list"),Ve=ve.title,et=ve.children;return Qe.forEach(function(gt){return delete ve[gt]}),delete ve.onClick,delete ve.direction,W.createElement("li",Object.assign({},ve,{className:"".concat(St," ").concat(lt,"-item-group")}),W.createElement("div",{className:Gt,title:typeof Ve=="string"?Ve:void 0},Ve),W.createElement("ul",{className:qt},W.Children.map(et,this.renderInnerMenuItem)))}}]),Et}(W.Component);De.isMenuItemGroup=!0,De.defaultProps={disabled:!0};var ct=De,It=function(ht){var Et=ht.className,it=ht.rootPrefixCls,ve=ht.style;return W.createElement("li",{className:"".concat(Et," ").concat(it,"-item-divider"),style:ve})};It.defaultProps={disabled:!0,className:"",style:{}};var un=It,mt=_e.e=ie},"24hK":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return V});class Z{constructor(I){this.element=I,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 I=this._first;for(;I!==Z.Undefined;){const G=I.next;I.prev=Z.Undefined,I.next=Z.Undefined,I=G}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(I){return this._insert(I,!1)}push(I){return this._insert(I,!0)}_insert(I,G){const P=new Z(I);if(this._first===Z.Undefined)this._first=P,this._last=P;else if(G){const W=this._last;this._last=P,P.prev=W,W.next=P}else{const W=this._first;this._first=P,P.next=W,W.prev=P}this._size+=1;let L=!1;return()=>{L||(L=!0,this._remove(P))}}shift(){if(this._first===Z.Undefined)return;{const I=this._first.element;return this._remove(this._first),I}}pop(){if(this._last===Z.Undefined)return;{const I=this._last.element;return this._remove(this._last),I}}_remove(I){if(I.prev!==Z.Undefined&&I.next!==Z.Undefined){const G=I.prev;G.next=I.next,I.next.prev=G}else I.prev===Z.Undefined&&I.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):I.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):I.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let I=this._first;for(;I!==Z.Undefined;)yield I.element,I=I.next}}},"3/fG":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return V});function Z(I,G){let P;return G.length===0?P=I:P=I.replace(/\{(\d+)\}/g,function(L,W){const k=W[0];return typeof G[k]!="undefined"?G[k]:L}),P}function V(I,G,...P){return Z(G,P)}},"4wi7":function(jt,_e,D){"use strict";var Z=D("14J3"),V=D("BMrR"),I=D("sRBo"),G=D("kaz8"),P=D("5NDa"),L=D("5rEg"),W=D("9og8"),k=D("tJVT"),r=D("WmNS"),M=D.n(r),E=D("q1tI"),p=D.n(E),m=D("oOBs"),u=D.n(m),a=D("xOL1"),o=D.n(a),c=D("BdwD"),s=function(n){var O=n.data,S=n.value,C=S===void 0?[]:S,R=n.handleChangePage,T=n.setSelectedRowKeys,v=n.selectedRowKeys,b=n.onChange,f=b===void 0?function(){}:b,h=Object(E.useState)([]),_=Object(k.a)(h,2),g=_[0],x=_[1],N=Object(E.useState)([]),F=Object(k.a)(N,2),A=F[0],B=F[1],U=Object(E.useState)([]),w=Object(k.a)(U,2),Y=w[0],q=w[1],ce=Object(E.useState)(1),Ee=Object(k.a)(ce,2),Qe=Ee[0],Te=Ee[1],We=Object(E.useState)(),$e=Object(k.a)(We,2),Je=$e[0],Ce=$e[1];return Object(E.useEffect)(function(){x(O),B([]),q([])},[O]),Object(E.useEffect)(function(){T&&(B(v),q(v))},[v]),p.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},p.a.createElement("div",{className:u.a.leftdiv},p.a.createElement(L.a.Search,{size:"large",onChange:function(){var X=Object(W.a)(M.a.mark(function j(K){return M.a.wrap(function(re){for(;;)switch(re.prev=re.next){case 0:x(O.filter(function(z){var we;return z==null||((we=z.name)===null||we===void 0)?void 0:we.includes(K.target.value)}));case 1:case"end":return re.stop()}},j)}));return function(j){return X.apply(this,arguments)}}(),placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),g.length===0&&p.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u65E0\u5206\u73ED"}),p.a.createElement("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"}},p.a.createElement(G.a.Group,{value:A.map(function(X){return"".concat(X.id)}),onChange:function(j){T(g.filter(function(K){return j.includes("".concat(K.id))}))},style:{marginTop:"10px"}},g.map(function(X,j){return p.a.createElement(V.a,{key:X.id,style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200}},p.a.createElement(G.a,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:X.is_published,value:"".concat(X.id)},p.a.createElement("div",{className:u.a.listClass},p.a.createElement("span",{className:u.a.spantitle,style:{width:X.is_published?"108px":"170px"}},X.name),X.is_published&&p.a.createElement("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"}},"\u5DF2\u53D1\u5E03"))))})))),p.a.createElement("div",{className:u.a.rightdiv},p.a.createElement(L.a.Search,{onChange:function(j){q(A.filter(function(K){return K.name.includes(j.target.value)}))},size:"large",placeholder:"\u53EF\u8F93\u5165\u73ED\u7EA7\u540D\u79F0\u67E5\u8BE2"}),Y.length===0&&p.a.createElement(c.a,{styles:{margin:"70px auto"},customText:"\u6682\u672A\u9009\u62E9\u5206\u73ED"}),Y.length>0&&p.a.createElement("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"}},p.a.createElement("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0}},Y.map(function(X,j){return p.a.createElement(V.a,{justify:"space-between",style:{marginTop:"10px"},key:X.id},p.a.createElement("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"}},X.name),p.a.createElement("img",{src:o.a,style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){T(A.filter(function(Q){return"".concat(Q.id)!="".concat(X.id)}))}}))})))))};_e.a=s},"55Ip":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return i});var Z=D("Ty5D"),V=D("dI71"),I=D("q1tI"),G=D.n(I),P=D("YS25"),L=D("17x9"),W=D.n(L),k=D("wx14"),r=D("zLVn"),M=D("9R94"),E=function(b){Object(V.a)(f,b);function f(){for(var _,g=arguments.length,x=new Array(g),N=0;N<g;N++)x[N]=arguments[N];return _=b.call.apply(b,[this].concat(x))||this,_.history=Object(P.a)(_.props),_}var h=f.prototype;return h.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},f}(G.a.Component),p=function(b){Object(V.a)(f,b);function f(){for(var _,g=arguments.length,x=new Array(g),N=0;N<g;N++)x[N]=arguments[N];return _=b.call.apply(b,[this].concat(x))||this,_.history=Object(P.b)(_.props),_}var h=f.prototype;return h.render=function(){return G.a.createElement(Z.c,{history:this.history,children:this.props.children})},f}(G.a.Component),m=function(f,h){return typeof f=="function"?f(h):f},u=function(f,h){return typeof f=="string"?Object(P.c)(f,null,null,h):f},a=function(f){return f},o=G.a.forwardRef;typeof o=="undefined"&&(o=a);function c(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var s=o(function(b,f){var h=b.innerRef,_=b.navigate,g=b.onClick,x=Object(r.a)(b,["innerRef","navigate","onClick"]),N=x.target,F=Object(k.a)({},x,{onClick:function(B){try{g&&g(B)}catch(U){throw B.preventDefault(),U}!B.defaultPrevented&&B.button===0&&(!N||N==="_self")&&!c(B)&&(B.preventDefault(),_())}});return a!==o?F.ref=f||h:F.ref=h,G.a.createElement("a",F)}),i=o(function(b,f){var h=b.component,_=h===void 0?s:h,g=b.replace,x=b.to,N=b.innerRef,F=Object(r.a)(b,["component","replace","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(A){A||Object(M.a)(!1);var B=A.history,U=u(m(x,A.location),A.location),w=U?B.createHref(U):"",Y=Object(k.a)({},F,{href:w,navigate:function(){var ce=m(x,A.location),Ee=g?B.replace:B.push;Ee(ce)}});return a!==o?Y.ref=f||N:Y.innerRef=N,G.a.createElement(_,Y)})});if(!1)var n,O;var S=function(f){return f},C=G.a.forwardRef;typeof C=="undefined"&&(C=S);function R(){for(var b=arguments.length,f=new Array(b),h=0;h<b;h++)f[h]=arguments[h];return f.filter(function(_){return _}).join(" ")}var T=C(function(b,f){var h=b["aria-current"],_=h===void 0?"page":h,g=b.activeClassName,x=g===void 0?"active":g,N=b.activeStyle,F=b.className,A=b.exact,B=b.isActive,U=b.location,w=b.sensitive,Y=b.strict,q=b.style,ce=b.to,Ee=b.innerRef,Qe=Object(r.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return G.a.createElement(Z.e.Consumer,null,function(Te){Te||Object(M.a)(!1);var We=U||Te.location,$e=u(m(ce,We),We),Je=$e.pathname,Ce=Je&&Je.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),X=Ce?Object(Z.f)(We.pathname,{path:Ce,exact:A,sensitive:w,strict:Y}):null,j=!!(B?B(X,We):X),K=j?R(F,x):F,Q=j?Object(k.a)({},q,{},N):q,re=Object(k.a)({"aria-current":j&&_||null,className:K,style:Q,to:$e},Qe);return S!==C?re.ref=f||Ee:re.innerRef=Ee,G.a.createElement(i,re)})});if(!1)var v},"5VLF":function(jt,_e,D){"use strict";var Z,V;function I(G,P,L){var W=function(k,r){return G.js_beautify(k,r)};return W.js=G.js_beautify,W.css=P.css_beautify,W.html=L.html_beautify,W.js_beautify=G.js_beautify,W.css_beautify=P.css_beautify,W.html_beautify=L.html_beautify,W}!(Z=[D("6UM0"),D("TXwP"),D("psGv")],V=function(G,P,L){return I(G,P,L)}.apply(_e,Z),V!==void 0&&(jt.exports=V))},"5Y4S":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return I});var Z=D("MNsG");const V=Z.b.performance&&typeof Z.b.performance.now=="function";class I{constructor(G){this._highResolution=V&&G,this._startTime=this._now(),this._stopTime=-1}static create(G=!0){return new I(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(jt,_e,D){"use strict";D.d(_e,"a",function(){return C});var Z=D("wx14"),V=D("rePB"),I=D("VTBJ"),G=D("1OyB"),P=D("vuIU"),L=D("Ji7U"),W=D("LK+K"),k=D("q1tI"),r=D.n(k),M=D("TSYQ"),E=D.n(M),p=function(T){var v,b="".concat(T.rootPrefixCls,"-item"),f=E()(b,"".concat(b,"-").concat(T.page),(v={},Object(V.a)(v,"".concat(b,"-active"),T.active),Object(V.a)(v,T.className,!!T.className),Object(V.a)(v,"".concat(b,"-disabled"),!T.page),v)),h=function(){T.onClick(T.page)},_=function(x){T.onKeyPress(x,T.onClick,T.page)};return r.a.createElement("li",{title:T.showTitle?T.page:null,className:f,onClick:h,onKeyPress:_,tabIndex:"0"},T.itemRender(T.page,"page",r.a.createElement("a",{rel:"nofollow"},T.page)))},m=p,u={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(R){Object(L.a)(v,R);var T=Object(W.a)(v);function v(){var b;Object(G.a)(this,v);for(var f=arguments.length,h=new Array(f),_=0;_<f;_++)h[_]=arguments[_];return b=T.call.apply(T,[this].concat(h)),b.state={goInputText:""},b.buildOptionText=function(g){return"".concat(g," ").concat(b.props.locale.items_per_page)},b.changeSize=function(g){b.props.changeSize(Number(g))},b.handleChange=function(g){b.setState({goInputText:g.target.value})},b.handleBlur=function(g){var x=b.props,N=x.goButton,F=x.quickGo,A=x.rootPrefixCls,B=b.state.goInputText;if(N||B==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(A,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(A,"-next"))>=0))return;b.setState({goInputText:""}),F(b.getValidValue())},b.go=function(g){var x=b.state.goInputText;if(x==="")return;(g.keyCode===u.ENTER||g.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(P.a)(v,[{key:"getValidValue",value:function(){var f=this.state,h=f.goInputText,_=f.current;return!h||isNaN(h)?_:Number(h)}},{key:"getPageSizeOptions",value:function(){var f=this.props,h=f.pageSize,_=f.pageSizeOptions;return _.some(function(g){return g.toString()===h.toString()})?_:_.concat([h.toString()]).sort(function(g,x){var N=isNaN(Number(g))?0:Number(g),F=isNaN(Number(x))?0:Number(x);return N-F})}},{key:"render",value:function(){var f=this,h=this.props,_=h.pageSize,g=h.locale,x=h.rootPrefixCls,N=h.changeSize,F=h.quickGo,A=h.goButton,B=h.selectComponentClass,U=h.buildOptionText,w=h.selectPrefixCls,Y=h.disabled,q=this.state.goInputText,ce="".concat(x,"-options"),Ee=B,Qe=null,Te=null,We=null;if(!N&&!F)return null;var $e=this.getPageSizeOptions();if(N&&Ee){var Je=$e.map(function(Ce,X){return r.a.createElement(Ee.Option,{key:X,value:Ce.toString()},(U||f.buildOptionText)(Ce))});Qe=r.a.createElement(Ee,{disabled:Y,prefixCls:w,showSearch:!1,className:"".concat(ce,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(_||$e[0]).toString(),onChange:this.changeSize,getPopupContainer:function(X){return X.parentNode}},Je)}return F&&(A&&(We=typeof A=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Y,className:"".concat(ce,"-quick-jumper-button")},g.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},A)),Te=r.a.createElement("div",{className:"".concat(ce,"-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,We)),r.a.createElement("li",{className:"".concat(ce)},Qe,Te)}}]),v}(r.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var o=a,c=D("N2Kk");function s(){}function i(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function n(R,T,v){return v}function O(R,T,v){var b=typeof R=="undefined"?T.pageSize:R;return Math.floor((v.total-1)/b)+1}var S=function(R){Object(L.a)(v,R);var T=Object(W.a)(v);function v(b){var f;Object(G.a)(this,v),f=T.call(this,b),f.getJumpPrevPage=function(){return Math.max(1,f.state.current-(f.props.showLessItems?3:5))},f.getJumpNextPage=function(){return Math.min(O(void 0,f.state,f.props),f.state.current+(f.props.showLessItems?3:5))},f.getItemIcon=function(N,F){var A=f.props.prefixCls,B=N||r.a.createElement("button",{type:"button","aria-label":F,className:"".concat(A,"-item-link")});return typeof N=="function"&&(B=r.a.createElement(N,Object(I.a)({},f.props))),B},f.savePaginationNode=function(N){f.paginationNode=N},f.isValid=function(N){return i(N)&&N!==f.state.current},f.shouldDisplayQuickJumper=function(){var N=f.props,F=N.showQuickJumper,A=N.pageSize,B=N.total;return B<=A?!1:F},f.handleKeyDown=function(N){(N.keyCode===u.ARROW_UP||N.keyCode===u.ARROW_DOWN)&&N.preventDefault()},f.handleKeyUp=function(N){var F=f.getValidValue(N),A=f.state.currentInputValue;F!==A&&f.setState({currentInputValue:F}),N.keyCode===u.ENTER?f.handleChange(F):N.keyCode===u.ARROW_UP?f.handleChange(F-1):N.keyCode===u.ARROW_DOWN&&f.handleChange(F+1)},f.changePageSize=function(N){var F=f.state.current,A=O(N,f.state,f.props);F=F>A?A:F,A===0&&(F=f.state.current),typeof N=="number"&&("pageSize"in f.props||f.setState({pageSize:N}),"current"in f.props||f.setState({current:F,currentInputValue:F})),f.props.onShowSizeChange(F,N),"onChange"in f.props&&f.props.onChange&&f.props.onChange(F,N)},f.handleChange=function(N){var F=f.props.disabled,A=N;if(f.isValid(A)&&!F){var B=O(void 0,f.state,f.props);A>B?A=B:A<1&&(A=1),"current"in f.props||f.setState({current:A,currentInputValue:A});var U=f.state.pageSize;return f.props.onChange(A,U),A}return f.state.current},f.prev=function(){f.hasPrev()&&f.handleChange(f.state.current-1)},f.next=function(){f.hasNext()&&f.handleChange(f.state.current+1)},f.jumpPrev=function(){f.handleChange(f.getJumpPrevPage())},f.jumpNext=function(){f.handleChange(f.getJumpNextPage())},f.hasPrev=function(){return f.state.current>1},f.hasNext=function(){return f.state.current<O(void 0,f.state,f.props)},f.runIfEnter=function(N,F){if(N.key==="Enter"||N.charCode===13){for(var A=arguments.length,B=new Array(A>2?A-2:0),U=2;U<A;U++)B[U-2]=arguments[U];F.apply(void 0,B)}},f.runIfEnterPrev=function(N){f.runIfEnter(N,f.prev)},f.runIfEnterNext=function(N){f.runIfEnter(N,f.next)},f.runIfEnterJumpPrev=function(N){f.runIfEnter(N,f.jumpPrev)},f.runIfEnterJumpNext=function(N){f.runIfEnter(N,f.jumpNext)},f.handleGoTO=function(N){(N.keyCode===u.ENTER||N.type==="click")&&f.handleChange(f.state.currentInputValue)};var h=b.onChange!==s,_="current"in b;_&&!h&&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=b.defaultCurrent;"current"in b&&(g=b.current);var x=b.defaultPageSize;return"pageSize"in b&&(x=b.pageSize),g=Math.min(g,O(x,void 0,b)),f.state={current:g,currentInputValue:g,pageSize:x},f}return Object(P.a)(v,[{key:"componentDidUpdate",value:function(f,h){var _=this.props.prefixCls;if(h.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(_,"-item-").concat(h.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(f){var h=f.target.value,_=O(void 0,this.state,this.props),g=this.state.currentInputValue,x;return h===""?x=h:isNaN(Number(h))?x=g:h>=_?x=_:x=Number(h),x}},{key:"getShowSizeChanger",value:function(){var f=this.props,h=f.showSizeChanger,_=f.total,g=f.totalBoundaryShowSizeChanger;return typeof h!="undefined"?h:_>g}},{key:"renderPrev",value:function(f){var h=this.props,_=h.prevIcon,g=h.itemRender,x=g(f,"prev",this.getItemIcon(_,"prev page")),N=!this.hasPrev();return Object(k.isValidElement)(x)?Object(k.cloneElement)(x,{disabled:N}):x}},{key:"renderNext",value:function(f){var h=this.props,_=h.nextIcon,g=h.itemRender,x=g(f,"next",this.getItemIcon(_,"next page")),N=!this.hasNext();return Object(k.isValidElement)(x)?Object(k.cloneElement)(x,{disabled:N}):x}},{key:"render",value:function(){var f=this,h=this.props,_=h.prefixCls,g=h.className,x=h.style,N=h.disabled,F=h.hideOnSinglePage,A=h.total,B=h.locale,U=h.showQuickJumper,w=h.showLessItems,Y=h.showTitle,q=h.showTotal,ce=h.simple,Ee=h.itemRender,Qe=h.showPrevNextJumpers,Te=h.jumpPrevIcon,We=h.jumpNextIcon,$e=h.selectComponentClass,Je=h.selectPrefixCls,Ce=h.pageSizeOptions,X=this.state,j=X.current,K=X.pageSize,Q=X.currentInputValue;if(F===!0&&A<=K)return null;var re=O(void 0,this.state,this.props),z=[],we=null,Ue=null,rt=null,le=null,Oe=null,Fe=U&&U.goButton,Ye=w?1:2,Tt=j-1>0?j-1:0,Nt=j+1<re?j+1:re,Xt=Object.keys(this.props).reduce(function(ae,ie){return(ie.substr(0,5)==="data-"||ie.substr(0,5)==="aria-"||ie==="role")&&(ae[ie]=f.props[ie]),ae},{});if(ce)return Fe&&(typeof Fe=="boolean"?Oe=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},B.jump_to_confirm):Oe=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Fe),Oe=r.a.createElement("li",{title:Y?"".concat(B.jump_to).concat(j,"/").concat(re):null,className:"".concat(_,"-simple-pager")},Oe)),r.a.createElement("ul",Object(Z.a)({className:E()(_,"".concat(_,"-simple"),Object(V.a)({},"".concat(_,"-disabled"),N),g),style:x,ref:this.savePaginationNode},Xt),r.a.createElement("li",{title:Y?B.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:E()("".concat(_,"-prev"),Object(V.a)({},"".concat(_,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Tt)),r.a.createElement("li",{title:Y?"".concat(j,"/").concat(re):null,className:"".concat(_,"-simple-pager")},r.a.createElement("input",{type:"text",value:Q,disabled:N,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(_,"-slash")},"/"),re),r.a.createElement("li",{title:Y?B.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:E()("".concat(_,"-next"),Object(V.a)({},"".concat(_,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Nt)),Oe);if(re<=3+Ye*2){var tt={locale:B,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:Y,itemRender:Ee};re||z.push(r.a.createElement(m,Object(Z.a)({},tt,{key:"noPager",page:re,className:"".concat(_,"-disabled")})));for(var Zt=1;Zt<=re;Zt+=1){var vn=j===Zt;z.push(r.a.createElement(m,Object(Z.a)({},tt,{key:Zt,page:Zt,active:vn})))}}else{var ze=w?B.prev_3:B.prev_5,He=w?B.next_3:B.next_5;Qe&&(we=r.a.createElement("li",{title:Y?ze:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:E()("".concat(_,"-jump-prev"),Object(V.a)({},"".concat(_,"-jump-prev-custom-icon"),!!Te))},Ee(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Te,"prev page"))),Ue=r.a.createElement("li",{title:Y?He:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:E()("".concat(_,"-jump-next"),Object(V.a)({},"".concat(_,"-jump-next-custom-icon"),!!We))},Ee(this.getJumpNextPage(),"jump-next",this.getItemIcon(We,"next page")))),le=r.a.createElement(m,{locale:B,last:!0,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:re,page:re,active:!1,showTitle:Y,itemRender:Ee}),rt=r.a.createElement(m,{locale:B,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:Y,itemRender:Ee});var vt=Math.max(1,j-Ye),Rt=Math.min(j+Ye,re);j-1<=Ye&&(Rt=1+Ye*2),re-j<=Ye&&(vt=re-Ye*2);for(var de=vt;de<=Rt;de+=1){var ee=j===de;z.push(r.a.createElement(m,{locale:B,rootPrefixCls:_,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:de,page:de,active:ee,showTitle:Y,itemRender:Ee}))}j-1>=Ye*2&&j!==1+2&&(z[0]=Object(k.cloneElement)(z[0],{className:"".concat(_,"-item-after-jump-prev")}),z.unshift(we)),re-j>=Ye*2&&j!==re-2&&(z[z.length-1]=Object(k.cloneElement)(z[z.length-1],{className:"".concat(_,"-item-before-jump-next")}),z.push(Ue)),vt!==1&&z.unshift(rt),Rt!==re&&z.push(le)}var ne=null;q&&(ne=r.a.createElement("li",{className:"".concat(_,"-total-text")},q(A,[A===0?0:(j-1)*K+1,j*K>A?A:j*K])));var se=!this.hasPrev()||!re,pe=!this.hasNext()||!re;return r.a.createElement("ul",Object(Z.a)({className:E()(_,g,Object(V.a)({},"".concat(_,"-disabled"),N)),style:x,unselectable:"unselectable",ref:this.savePaginationNode},Xt),ne,r.a.createElement("li",{title:Y?B.prev_page:null,onClick:this.prev,tabIndex:se?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(_,"-prev"),Object(V.a)({},"".concat(_,"-disabled"),se)),"aria-disabled":se},this.renderPrev(Tt)),z,r.a.createElement("li",{title:Y?B.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(_,"-next"),Object(V.a)({},"".concat(_,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(Nt)),r.a.createElement(o,{disabled:N,locale:B,rootPrefixCls:_,selectComponentClass:$e,selectPrefixCls:Je,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:j,pageSize:K,pageSizeOptions:Ce,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Fe}))}}],[{key:"getDerivedStateFromProps",value:function(f,h){var _={};if("current"in f&&(_.current=f.current,f.current!==h.current&&(_.currentInputValue=_.current)),"pageSize"in f&&f.pageSize!==h.pageSize){var g=h.current,x=O(f.pageSize,h,f);g=g>x?x:g,"current"in f||(_.current=g,_.currentInputValue=g),_.pageSize=f.pageSize}return _}}]),v}(r.a.Component);S.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=S},"6RRn":function(jt,_e,D){"use strict";var Z=D("wCXF"),V=D("n6Qo");D.d(_e,"b",function(){return V.a});var I=D("IBYe"),G=D("6eGT"),P=D("hW8S");D.d(_e,"a",function(){return P.a}),_e.c=Z.b},"6UM0":function(jt,_e,D){var Z,V;(function(){var I;(function(){"use strict";var P=[function(r,M,E){var p=E(1).Beautifier,m=E(5).Options;function u(a,o){var c=new p(a,o);return c.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new m}},function(r,M,E){var p=E(2).Output,m=E(3).Token,u=E(4),a=E(5).Options,o=E(7).Tokenizer,c=E(7).line_starters,s=E(7).positionable_operators,i=E(7).TOKEN;function n(w,Y){return Y.indexOf(w)!==-1}function O(w){return w.replace(/^\s+/g,"")}function S(w){for(var Y={},q=0;q<w.length;q++)Y[w[q].replace(/-/g,"_")]=w[q];return Y}function C(w,Y){return w&&w.type===i.RESERVED&&w.text===Y}function R(w,Y){return w&&w.type===i.RESERVED&&n(w.text,Y)}var T=["case","return","do","if","throw","else","await","break","continue","async"],v=["before-newline","after-newline","preserve-newline"],b=S(v),f=[b.before_newline,b.preserve_newline],h={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function _(w,Y){if(Y.multiline_frame||Y.mode===h.ForInitializer||Y.mode===h.Conditional)return;w.remove_indent(Y.start_line_index)}function g(w){w=w.replace(u.allLineBreaks,`
`);for(var Y=[],q=w.indexOf(`
`);q!==-1;)Y.push(w.substring(0,q)),w=w.substring(q+1),q=w.indexOf(`
`);return w.length&&Y.push(w),Y}function x(w){return w===h.ArrayLiteral}function N(w){return n(w,[h.Expression,h.ForInitializer,h.Conditional])}function F(w,Y){for(var q=0;q<w.length;q++){var ce=w[q].trim();if(ce.charAt(0)!==Y)return!1}return!0}function A(w,Y){for(var q=0,ce=w.length,Ee;q<ce;q++)if(Ee=w[q],Ee&&Ee.indexOf(Y)!==0)return!1;return!0}function B(w,Y){Y=Y||{},this._source_text=w||"",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 a(Y)}B.prototype.create_flags=function(w,Y){var q=0;w&&(q=w.indentation_level,!this._output.just_added_newline()&&w.line_indent_level>q&&(q=w.line_indent_level));var ce={mode:Y,parent:w,last_token:w?w.last_token:new m(i.START_BLOCK,""),last_word:w?w.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:w?w.line_indent_level:q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ce},B.prototype._reset=function(w){var Y=w.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,Y),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(h.BlockStatement);var q=new o(w,this._options);return this._tokens=q.tokenize(),w},B.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w,Y=this._reset(this._source_text),q=this._options.eol;this._options.eol==="auto"&&(q=`
`,Y&&u.lineBreak.test(Y||"")&&(q=Y.match(u.lineBreak)[0]));for(var ce=this._tokens.next();ce;)this.handle_token(ce),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ce,ce=this._tokens.next();return w=this._output.get_code(q),w},B.prototype.handle_token=function(w,Y){w.type===i.START_EXPR?this.handle_start_expr(w):w.type===i.END_EXPR?this.handle_end_expr(w):w.type===i.START_BLOCK?this.handle_start_block(w):w.type===i.END_BLOCK?this.handle_end_block(w):w.type===i.WORD?this.handle_word(w):w.type===i.RESERVED?this.handle_word(w):w.type===i.SEMICOLON?this.handle_semicolon(w):w.type===i.STRING?this.handle_string(w):w.type===i.EQUALS?this.handle_equals(w):w.type===i.OPERATOR?this.handle_operator(w):w.type===i.COMMA?this.handle_comma(w):w.type===i.BLOCK_COMMENT?this.handle_block_comment(w,Y):w.type===i.COMMENT?this.handle_comment(w,Y):w.type===i.DOT?this.handle_dot(w):w.type===i.EOF?this.handle_eof(w):w.type===i.UNKNOWN?this.handle_unknown(w,Y):this.handle_unknown(w,Y)},B.prototype.handle_whitespace_and_comments=function(w,Y){var q=w.newlines,ce=this._options.keep_array_indentation&&x(this._flags.mode);if(w.comments_before)for(var Ee=w.comments_before.next();Ee;)this.handle_whitespace_and_comments(Ee,Y),this.handle_token(Ee,Y),Ee=w.comments_before.next();if(ce)for(var Qe=0;Qe<q;Qe+=1)this.print_newline(Qe>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 Te=1;Te<q;Te+=1)this.print_newline(!0,Y)}};var U=["async","break","continue","return","throw","yield"];B.prototype.allow_wrap_or_preserved_newline=function(w,Y){if(Y=Y===void 0?!1:Y,this._output.just_added_newline())return;var q=this._options.preserve_newlines&&w.newlines||Y,ce=n(this._flags.last_token.text,s)||n(w.text,s);if(ce){var Ee=n(this._flags.last_token.text,s)&&n(this._options.operator_position,f)||n(w.text,s);q=q&&Ee}if(q)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,U))return;this._output.set_wrap_point()}},B.prototype.print_newline=function(w,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===h.Statement&&!(this._flags.if_block&&C(q,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(w)&&(this._flags.multiline_frame=!0)},B.prototype.print_token_line_indentation=function(w){this._output.just_added_newline()&&(this._options.keep_array_indentation&&w.newlines&&(w.text==="["||x(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(w.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))},B.prototype.print_token=function(w){if(this._output.raw){this._output.add_raw_token(w);return}if(this._options.comma_first&&w.previous&&w.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(w),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(w),this._output.non_breaking_space=!0,this._output.add_token(w.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},B.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},B.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))},B.prototype.set_mode=function(w){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,w),this._flags=this.create_flags(this._previous_flags,w),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},B.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===h.Statement&&_(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},B.prototype.start_of_object_property=function(){return this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},B.prototype.start_of_statement=function(w){var Y=!1;return Y=Y||R(this._flags.last_token,["var","let","const"])&&w.type===i.WORD,Y=Y||C(this._flags.last_token,"do"),Y=Y||!(this._flags.parent.mode===h.ObjectLiteral&&this._flags.mode===h.Statement)&&R(this._flags.last_token,U)&&!w.newlines,Y=Y||C(this._flags.last_token,"else")&&!(C(w,"if")&&!w.comments_before),Y=Y||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===h.ForInitializer||this._previous_flags.mode===h.Conditional),Y=Y||this._flags.last_token.type===i.WORD&&this._flags.mode===h.BlockStatement&&!this._flags.in_case&&!(w.text==="--"||w.text==="++")&&this._last_last_text!=="function"&&w.type!==i.WORD&&w.type!==i.RESERVED,Y=Y||this._flags.mode===h.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),Y?(this.set_mode(h.Statement),this.indent(),this.handle_whitespace_and_comments(w,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w,R(w,["do","for","if","while"])),!0):!1},B.prototype.handle_start_expr=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w);var Y=h.Expression;if(w.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(w),this.set_mode(Y),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}Y=h.ArrayLiteral,x(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=h.ForInitializer):n(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,Y=h.Conditional):n(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&w.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(w);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 ce=this._tokens.peek(-4);R(q,["async","function"])||q.text==="*"&&R(ce,["async","function"])?this._output.space_before_token=!0:this._flags.mode===h.ObjectLiteral?(q.text==="{"||q.text===","||q.text==="*"&&(ce.text==="{"||ce.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(w);(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===h.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(w,w.newlines),this.print_token(w),this.set_mode(Y),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},B.prototype.handle_end_expr=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(w,w.text==="]"&&x(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(w),this.restore_mode(),_(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===h.Conditional&&(this._previous_flags.mode=h.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},B.prototype.handle_start_block=function(w){this.handle_whitespace_and_comments(w);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(h.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(h.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(h.BlockStatement):this.set_mode(h.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(h.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(h.ObjectLiteral):this.set_mode(h.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ce=!Y.comments_before&&Y.text==="}",Ee=ce&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var Qe=0,Te=null;this._flags.inline_frame=!0;do if(Qe+=1,Te=this._tokens.peek(Qe-1),Te.newlines){this._flags.inline_frame=!1;break}while(Te.type!==i.EOF&&!(Te.type===i.END_BLOCK&&Te.opened===w))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(Ee||this._flags.last_token.type===i.EQUALS||R(this._flags.last_token,T)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(x(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(w),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(w),this.indent(),!ce&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},B.prototype.handle_end_block=function(w){for(this.handle_whitespace_and_comments(w);this._flags.mode===h.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||(x(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(w)},B.prototype.handle_word=function(w){if(w.type===i.RESERVED){if(n(w.text,["set","get"])&&this._flags.mode!==h.ObjectLiteral)w.type=i.WORD;else if(w.text==="import"&&n(this._tokens.peek().text,["(","."]))w.type=i.WORD;else if(n(w.text,["as","from"])&&!this._flags.import_block)w.type=i.WORD;else if(this._flags.mode===h.ObjectLiteral){var Y=this._tokens.peek();Y.text===":"&&(w.type=i.WORD)}}if(this.start_of_statement(w)?R(this._flags.last_token,["var","let","const"])&&w.type===i.WORD&&(this._flags.declaration_statement=!0):w.newlines&&!N(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(w),this.print_newline()):this.handle_whitespace_and_comments(w),this._flags.do_block&&!this._flags.do_while)if(C(w,"while")){this._output.space_before_token=!0,this.print_token(w),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(w,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===h.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(w,["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(w),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(w)),C(w,"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()&&!w.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,U)?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&&(N(this._flags.mode)||x(this._flags.mode))||this.print_newline(),this.print_token(w),this._flags.last_word=w.text;return}var q="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?q="SPACE":R(w,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines?q="NEWLINE":(q="SPACE",this._output.space_before_token=!0):q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===h.BlockStatement?q="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&N(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===h.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(w,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(w,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===h.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ce=this._output.current_line;ce.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else q==="NEWLINE"?R(this._flags.last_token,T)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(w,["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(w,["var","let","const"]))&&this._flags.last_token.text!==":"&&(C(w,"if")&&C(w.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(w,c)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&x(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():q==="SPACE"&&(this._output.space_before_token=!0);w.previous&&(w.previous.type===i.WORD||w.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(w),this._flags.last_word=w.text,w.type===i.RESERVED&&(w.text==="do"?this._flags.do_block=!0:w.text==="if"?this._flags.if_block=!0:w.text==="import"?this._flags.import_block=!0:this._flags.import_block&&C(w,"from")&&(this._flags.import_block=!1))},B.prototype.handle_semicolon=function(w){this.start_of_statement(w)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(w);for(var Y=this._tokens.peek();this._flags.mode===h.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(w)},B.prototype.handle_string=function(w){w.text.startsWith("`")&&w.newlines===0&&w.whitespace_before===""&&(w.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(w)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(w),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(w):w.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(w.previous.text==="]"||w.previous.text===")")&&w.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(w)},B.prototype.handle_equals=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0},B.prototype.handle_comma=function(w){this.handle_whitespace_and_comments(w,!0),this.print_token(w),this._output.space_before_token=!0,this._flags.declaration_statement?(N(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(w)):this._flags.mode===h.ObjectLiteral||this._flags.mode===h.Statement&&this._flags.parent.mode===h.ObjectLiteral?(this._flags.mode===h.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)},B.prototype.handle_operator=function(w){var Y=w.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(w.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(w)){var ce=!Y;this.handle_whitespace_and_comments(w,ce)}if(w.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(w);return}if(w.text==="::"){this.print_token(w);return}if(this._flags.last_token.type===i.OPERATOR&&n(this._options.operator_position,f)&&this.allow_wrap_or_preserved_newline(w),w.text===":"&&this._flags.in_case){this.print_token(w),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 Ee=!0,Qe=!0,Te=!1;if(w.text===":"?this._flags.ternary_depth===0?Ee=!1:(this._flags.ternary_depth-=1,Te=!0):w.text==="?"&&(this._flags.ternary_depth+=1),!q&&!Y&&this._options.preserve_newlines&&n(w.text,s)){var We=w.text===":",$e=We&&Te,Je=We&&!Te;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Je,this.print_token(w),(!We||$e)&&this.allow_wrap_or_preserved_newline(w),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!We||$e?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(w):this._output.space_before_token=!1,this.print_token(w),this._output.space_before_token=!0;return;case b.preserve_newline:Je||this.allow_wrap_or_preserved_newline(w),Ee=!(this._output.just_added_newline()||Je),this._output.space_before_token=Ee,this.print_token(w),this._output.space_before_token=!0;return}}if(Y){this.allow_wrap_or_preserved_newline(w),Ee=!1;var Ce=this._tokens.peek();Qe=Ce&&n(Ce.type,[i.WORD,i.RESERVED])}else if(w.text==="...")this.allow_wrap_or_preserved_newline(w),Ee=this._flags.last_token.type===i.START_BLOCK,Qe=!1;else if(n(w.text,["--","++","!","~"])||q){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(w),Ee=!1,Qe=!1,w.newlines&&(w.text==="--"||w.text==="++"||w.text==="~")){var X=R(this._flags.last_token,T)&&w.newlines;X&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(X,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(Ee=!0),this._flags.last_token.type===i.RESERVED?Ee=!0:this._flags.last_token.type===i.END_EXPR?Ee=!(this._flags.last_token.text==="]"&&(w.text==="--"||w.text==="++")):this._flags.last_token.type===i.OPERATOR&&(Ee=n(w.text,["--","-","++","+"])&&n(this._flags.last_token.text,["--","-","++","+"]),n(w.text,["+","-"])&&n(this._flags.last_token.text,["--","++"])&&(Qe=!0)),(this._flags.mode===h.BlockStatement&&!this._flags.inline_frame||this._flags.mode===h.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||Ee,this.print_token(w),this._output.space_before_token=Qe},B.prototype.handle_block_comment=function(w,Y){if(this._output.raw){this._output.add_raw_token(w),w.directives&&w.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(w.directives){this.print_newline(!1,Y),this.print_token(w),w.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!u.newline.test(w.text)&&!w.newlines){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0;return}else this.print_block_commment(w,Y)},B.prototype.print_block_commment=function(w,Y){var q=g(w.text),ce,Ee=!1,Qe=!1,Te=w.whitespace_before,We=Te.length;if(this.print_newline(!1,Y),this.print_token_line_indentation(w),this._output.add_token(q[0]),this.print_newline(!1,Y),q.length>1){for(q=q.slice(1),Ee=F(q,"*"),Qe=A(q,Te),Ee&&(this._flags.alignment=1),ce=0;ce<q.length;ce++)Ee?(this.print_token_line_indentation(w),this._output.add_token(O(q[ce]))):Qe&&q[ce]?(this.print_token_line_indentation(w),this._output.add_token(q[ce].substring(We))):(this._output.current_line.set_indent(-1),this._output.add_token(q[ce])),this.print_newline(!1,Y);this._flags.alignment=0}},B.prototype.handle_comment=function(w,Y){w.newlines?this.print_newline(!1,Y):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(w),this.print_newline(!1,Y)},B.prototype.handle_dot=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,T)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(w,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(w)},B.prototype.handle_unknown=function(w,Y){this.print_token(w),w.text[w.text.length-1]===`
`&&this.print_newline(!1,Y)},B.prototype.handle_eof=function(w){for(;this._flags.mode===h.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w)},r.exports.Beautifier=B},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 u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},M.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||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 u=m.lastIndexOf(`
`);u!==-1?this.__character_count=m.length-u: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 E(m,u){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)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}E.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},E.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},E.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,u){this.__indent_cache=new E(m,u),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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return m!==`
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)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},p.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()},p.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(" "))},p.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(m)!==0&&o.item(-1)!==u){this.__lines.splice(a+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},function(r){function M(E,p,m,u){this.type=E,this.text=p,this.comments_before=null,this.newlines=m||0,this.whitespace_before=u||"",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 E="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",u="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",a="(?:\\\\u[0-9a-fA-F]{4}|["+E+m+"])",o="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])*";M.identifier=new RegExp(a+o,"g"),M.identifierStart=new RegExp(a),M.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+m+u+"])+");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,E){var p=E(6).Options,m=["before-newline","after-newline","preserve-newline"];function u(a){p.call(this,a,"js");var o=this.raw_options.brace_style||null;o==="expand-strict"?this.raw_options.brace_style="expand":o==="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)}u.prototype=new p,r.exports.Options=u},function(r){function M(m,u){this.raw_options=E(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}M.prototype._get_array=function(m,u){var a=this.raw_options[m],o=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},M.prototype._get_boolean=function(m,u){var a=this.raw_options[m],o=a===void 0?!!u:!!a;return o},M.prototype._get_characters=function(m,u){var a=this.raw_options[m],o=u||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},M.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var o=parseInt(a,10);return isNaN(o)&&(o=u),o},M.prototype._get_selection=function(m,u,a){var o=this._get_selection_list(m,u,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o[0]},M.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var o=this._get_array(m,a);if(!this._is_valid_selection(o,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o},M.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function E(m,u){var a={};m=p(m);var o;for(o in m)o!==u&&(a[o]=m[o]);if(u&&m[u])for(o in m[u])a[o]=m[u][o];return a}function p(m){var u={},a;for(a in m){var o=a.replace(/-/g,"_");u[o]=m[a]}return u}r.exports.Options=M,r.exports.normalizeOpts=p,r.exports.mergeOpts=E},function(r,M,E){var p=E(8).InputScanner,m=E(9).Tokenizer,u=E(9).TOKEN,a=E(13).Directives,o=E(4),c=E(12).Pattern,s=E(14).TemplatablePattern;function i(F,A){return A.indexOf(F)!==-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:u.START,RAW:u.RAW,EOF:u.EOF},O=new a(/\/\*/,/\*\//),S=/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\.]/,T=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),v=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";v=v.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),v="\\?\\.(?!\\d) "+v,v=v.replace(/ /g,"|");var b=new RegExp(v),f="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),h=f.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),_=new RegExp("^(?:"+h.join("|")+")$"),g,x=function(F,A){m.call(this,F,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var B=new c(this._input),U=new s(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(o.identifier).matching(o.identifierMatch),number:B.matching(S),punct:B.matching(b),comment:B.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:B.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:B.matching(/<!--/),html_comment_end:B.matching(/-->/),include:B.starting_with(/#include/).until_after(o.lineBreak),shebang:B.starting_with(/#!/).until_after(o.lineBreak),xml:B.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:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};x.prototype=new m,x.prototype._is_comment=function(F){return F.type===n.COMMENT||F.type===n.BLOCK_COMMENT||F.type===n.UNKNOWN},x.prototype._is_opening=function(F){return F.type===n.START_BLOCK||F.type===n.START_EXPR},x.prototype._is_closing=function(F,A){return(F.type===n.END_BLOCK||F.type===n.END_EXPR)&&A&&(F.text==="]"&&A.text==="["||F.text===")"&&A.text==="("||F.text==="}"&&A.text==="{")},x.prototype._reset=function(){g=!1},x.prototype._get_next_token=function(F,A){var B=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(n.EOF,""):(B=B||this._read_non_javascript(U),B=B||this._read_string(U),B=B||this._read_word(F),B=B||this._read_singles(U),B=B||this._read_comment(U),B=B||this._read_regexp(U,F),B=B||this._read_xml(U,F),B=B||this._read_punctuation(),B=B||this._create_token(n.UNKNOWN,this._input.next()),B)},x.prototype._read_word=function(F){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(o.allLineBreaks,`
`),!(F.type===n.DOT||F.type===n.RESERVED&&(F.text==="set"||F.text==="get"))&&_.test(A)?(A==="in"||A==="of")&&(F.type===n.WORD||F.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)},x.prototype._read_singles=function(F){var A=null;return F==="("||F==="["?A=this._create_token(n.START_EXPR,F):F===")"||F==="]"?A=this._create_token(n.END_EXPR,F):F==="{"?A=this._create_token(n.START_BLOCK,F):F==="}"?A=this._create_token(n.END_BLOCK,F):F===";"?A=this._create_token(n.SEMICOLON,F):F==="."&&R.test(this._input.peek(1))?A=this._create_token(n.DOT,F):F===","&&(A=this._create_token(n.COMMA,F)),A&&this._input.next(),A},x.prototype._read_punctuation=function(){var F=this.__patterns.punct.read();if(F!=="")return F==="="?this._create_token(n.EQUALS,F):F==="?."?this._create_token(n.DOT,F):this._create_token(n.OPERATOR,F)},x.prototype._read_non_javascript=function(F){var A="";if(F==="#"){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()+`
`);F=this._input.next();var B="#";if(this._input.hasNext()&&this._input.testChar(C)){do F=this._input.next(),B+=F;while(this._input.hasNext()&&F!=="#"&&F!=="=");return F==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(B+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(B+="{}",this._input.next(),this._input.next())),this._create_token(n.WORD,B)}this._input.back()}else if(F==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(o.newline);)A+=this._input.next();return g=!0,this._create_token(n.COMMENT,A)}}else if(g&&F==="-"&&(A=this.__patterns.html_comment_end.read(),A))return g=!1,this._create_token(n.COMMENT,A);return null},x.prototype._read_comment=function(F){var A=null;if(F==="/"){var B="";if(this._input.peek(1)==="*"){B=this.__patterns.block_comment.read();var U=O.get_directives(B);U&&U.ignore==="start"&&(B+=O.readIgnored(this._input)),B=B.replace(o.allLineBreaks,`
`),A=this._create_token(n.BLOCK_COMMENT,B),A.directives=U}else this._input.peek(1)==="/"&&(B=this.__patterns.comment.read(),A=this._create_token(n.COMMENT,B))}return A},x.prototype._read_string=function(F){if(F==="`"||F==="'"||F==='"'){var A=this._input.next();return this.has_char_escapes=!1,F==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(F),this.has_char_escapes&&this._options.unescape_strings&&(A=N(A)),this._input.peek()===F&&(A+=this._input.next()),A=A.replace(o.allLineBreaks,`
`),this._create_token(n.STRING,A)}return null},x.prototype._allow_regexp_or_xml=function(F){return F.type===n.RESERVED&&i(F.text,["return","case","throw","else","do","typeof","yield"])||F.type===n.END_EXPR&&F.text===")"&&F.opened.previous.type===n.RESERVED&&i(F.opened.previous.text,["if","while","for"])||i(F.type,[n.COMMENT,n.START_EXPR,n.START_BLOCK,n.START,n.END_BLOCK,n.OPERATOR,n.EQUALS,n.EOF,n.SEMICOLON,n.COMMA])},x.prototype._read_regexp=function(F,A){if(F==="/"&&this._allow_regexp_or_xml(A)){for(var B=this._input.next(),U=!1,w=!1;this._input.hasNext()&&(U||w||this._input.peek()!==F)&&!this._input.testChar(o.newline);)B+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?w=!0:this._input.peek()==="]"&&(w=!1)),this._input.next();return this._input.peek()===F&&(B+=this._input.next(),B+=this._input.read(o.identifier)),this._create_token(n.STRING,B)}return null},x.prototype._read_xml=function(F,A){if(this._options.e4x&&F==="<"&&this._allow_regexp_or_xml(A)){var B="",U=this.__patterns.xml.read_match();if(U){for(var w=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),Y=w.indexOf("{")===0,q=0;U;){var ce=!!U[1],Ee=U[2],Qe=!!U[U.length-1]||Ee.slice(0,8)==="![CDATA[";if(!Qe&&(Ee===w||Y&&Ee.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ce?--q:++q),B+=U[0],q<=0)break;U=this.__patterns.xml.read_match()}return U||(B+=this._input.match(/[\s\S]*/g)[0]),B=B.replace(o.allLineBreaks,`
`),this._create_token(n.STRING,B)}}return null};function N(F){for(var A="",B=0,U=new p(F),w=null;U.hasNext();)if(w=U.match(/([\s]|[^\\]|\\\\)+/g),w&&(A+=w[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")w=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")w=U.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",U.hasNext()&&(A+=U.next());continue}if(!w)return F;if(B=parseInt(w[1],16),B>126&&B<=255&&w[0].indexOf("x")===0)return F;if(B>=0&&B<32){A+="\\"+w[0];continue}else B===34||B===39||B===92?A+="\\"+String.fromCharCode(B):A+=String.fromCharCode(B)}return A}x.prototype._read_string_recursive=function(F,A,B){var U,w;F==="'"?w=this.__patterns.single_quote:F==='"'?w=this.__patterns.double_quote:F==="`"?w=this.__patterns.template_text:F==="}"&&(w=this.__patterns.template_expression);for(var Y=w.read(),q="";this._input.hasNext();){if(q=this._input.next(),q===F||!A&&o.newline.test(q)){this._input.back();break}else q==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),q+=this._input.next()):B&&(B==="${"&&q==="$"&&this._input.peek()==="{"&&(q+=this._input.next()),B===q&&(F==="`"?q+=this._read_string_recursive("}",A,"`"):q+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(q+=this._input.next())));q+=w.read(),Y+=q}return Y},r.exports.Tokenizer=x,r.exports.TOKEN=n,r.exports.positionable_operators=T.slice(),r.exports.line_starters=f.slice()},function(r){var M=RegExp.prototype.hasOwnProperty("sticky");function E(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},E.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},E.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(M&&p.sticky)&&(u.index!==m&&(u=null)),u},E.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},E.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},E.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},E.prototype.read=function(p,m,u){var a="",o;return p&&(o=this.match(p),o&&(a+=o[0])),m&&(o||!p)&&(a+=this.readUntil(m,u)),a},E.prototype.readUntil=function(p,m){var u="",a=this.__position;p.lastIndex=this.__position;var o=p.exec(this.__input);return o?(a=o.index,m&&(a+=o[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},E.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},E.prototype.get_regexp=function(p,m){var u=null,a="g";return m&&M&&(a="y"),typeof p=="string"&&p!==""?u=new RegExp(p,a):p&&(u=new RegExp(p.source,a)),u},E.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},E.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=E},function(r,M,E){var p=E(8).InputScanner,m=E(3).Token,u=E(10).TokenStream,a=E(11).WhitespacePattern,o={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(s,i){this._input=new p(s),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new u,this._reset();for(var s,i=new m(o.START,""),n=null,O=[],S=new u;i.type!==o.EOF;){for(s=this._get_next_token(i,n);this._is_comment(s);)S.add(s),s=this._get_next_token(i,n);S.isEmpty()||(s.comments_before=S,S=new u),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(o.RAW,n):this._create_token(o.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=o},function(r){function M(E){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=E}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 E=null;return this.hasNext()&&(E=this.__tokens[this.__position],this.__position+=1),E},M.prototype.peek=function(E){var p=null;return E=E||0,E+=this.__position,E>=0&&E<this.__tokens_length&&(p=this.__tokens[E]),p},M.prototype.add=function(E){this.__parent_token&&(E.parent=this.__parent_token),this.__tokens.push(E),this.__tokens_length+=1},r.exports.TokenStream=M},function(r,M,E){var p=E(12).Pattern;function m(u,a){p.call(this,u,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}m.prototype=new p,m.prototype.__set_whitespace_patterns=function(u,a){u+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+u+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},m.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var u=this._input.read(this._match_pattern);if(u===" ")this.whitespace_before_token=" ";else if(u){var a=this.__split(this._newline_regexp,u);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return u},m.prototype.matching=function(u,a){var o=this._create();return o.__set_whitespace_patterns(u,a),o._update(),o},m.prototype._create=function(){return new m(this._input,this)},m.prototype.__split=function(u,a){u.lastIndex=0;for(var o=0,c=[],s=u.exec(a);s;)c.push(a.substring(o,s.index)),o=s.index+s[0].length,s=u.exec(a);return o<a.length?c.push(a.substring(o,a.length)):c.push(""),c},r.exports.WhitespacePattern=m},function(r){function M(E,p){this._input=E,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}M.prototype.read=function(){var E=this._input.read(this._starting_pattern);return(!this._starting_pattern||E)&&(E+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),E},M.prototype.read_match=function(){return this._input.match(this._match_pattern)},M.prototype.until_after=function(E){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(E),p._update(),p},M.prototype.until=function(E){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(E),p._update(),p},M.prototype.starting_with=function(E){var p=this._create();return p._starting_pattern=this._input.get_regexp(E,!0),p._update(),p},M.prototype.matching=function(E){var p=this._create();return p._match_pattern=this._input.get_regexp(E,!0),p._update(),p},M.prototype._create=function(){return new M(this._input,this)},M.prototype._update=function(){},r.exports.Pattern=M},function(r){function M(E,p){E=typeof E=="string"?E:E.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+p,"g")}M.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(E);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(E);return p},M.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=M},function(r,M,E){var p=E(12).Pattern,m={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function u(a,o){p.call(this,a,o),this.__template_pattern=null,this._disabled=Object.assign({},m),this._excluded=Object.assign({},m),o&&(this.__template_pattern=this._input.get_regexp(o.__template_pattern),this._excluded=Object.assign(this._excluded,o._excluded),this._disabled=Object.assign(this._disabled,o._disabled));var c=new p(a);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}/)}}u.prototype=new p,u.prototype._create=function(){return new u(this._input,this)},u.prototype._update=function(){this.__set_templated_pattern()},u.prototype.disable=function(a){var o=this._create();return o._disabled[a]=!0,o._update(),o},u.prototype.read_options=function(a){var o=this._create();for(var c in m)o._disabled[c]=a.templating.indexOf(c)===-1;return o._update(),o},u.prototype.exclude=function(a){var o=this._create();return o._excluded[a]=!0,o._update(),o},u.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var o=this._read_template();o;)this._match_pattern?o+=this._input.read(this._match_pattern):o+=this._input.readUntil(this.__template_pattern),a+=o,o=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},u.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},u.prototype._read_template=function(){var a="",o=this._input.peek();if(o==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(a=a||this.__patterns.erb.read())}else o==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},r.exports.TemplatablePattern=u}],L={};function W(r){var M=L[r];if(M!==void 0)return M.exports;var E=L[r]={exports:{}};return P[r](E,E.exports,W),E.exports}var k=W(0);I=k})();var G=I;!(Z=[],V=function(){return{js_beautify:G}}.apply(_e,Z),V!==void 0&&(jt.exports=V))})()},"6eGT":function(jt,_e,D){"use strict";function Z(V){return null}_e.a=Z},"746U":function(jt,_e,D){"use strict";D.d(_e,"f",function(){return Z}),D.d(_e,"l",function(){return V}),D.d(_e,"k",function(){return I}),D.d(_e,"j",function(){return G}),D.d(_e,"g",function(){return P}),D.d(_e,"m",function(){return L}),D.d(_e,"h",function(){return W}),D.d(_e,"n",function(){return k}),D.d(_e,"c",function(){return r}),D.d(_e,"a",function(){return M}),D.d(_e,"i",function(){return E}),D.d(_e,"o",function(){return p}),D.d(_e,"e",function(){return a}),D.d(_e,"d",function(){return o}),D.d(_e,"p",function(){return c}),D.d(_e,"b",function(){return s});function Z(i){return Array.isArray(i)}function V(i){return typeof i=="string"}function I(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 L(i){return typeof i=="undefined"}function W(i){return!k(i)}function k(i){return L(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 E(i){return typeof i=="function"}function p(i,n){const O=Math.min(i.length,n.length);for(let S=0;S<O;S++)m(i[S],n[S])}function m(i,n){if(V(n)){if(typeof i!==n)throw new Error(`argument does not match constraint: typeof ${n}`)}else if(E(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 u(i){let n=[],O=Object.getPrototypeOf(i);for(;Object.prototype!==O;)n=n.concat(Object.getOwnPropertyNames(O)),O=Object.getPrototypeOf(O);return n}function a(i){const n=[];for(const O of u(i))typeof i[O]=="function"&&n.push(O);return n}function o(i,n){const O=C=>function(){const R=Array.prototype.slice.call(arguments,0);return n(C,R)};let S={};for(const C of i)S[C]=O(C);return S}function c(i){return i===null?void 0:i}function s(i,n="Unreachable"){throw new Error(n)}},"7Cbv":function(jt,_e,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 I(){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 L=P,W=[],k=0;k<256;++k)W.push((k+256).toString(16).substr(1));function r(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(W[m[u+0]]+W[m[u+1]]+W[m[u+2]]+W[m[u+3]]+"-"+W[m[u+4]]+W[m[u+5]]+"-"+W[m[u+6]]+W[m[u+7]]+"-"+W[m[u+8]]+W[m[u+9]]+"-"+W[m[u+10]]+W[m[u+11]]+W[m[u+12]]+W[m[u+13]]+W[m[u+14]]+W[m[u+15]]).toLowerCase();if(!L(a))throw TypeError("Stringified UUID is invalid");return a}var M=r;function E(m,u,a){m=m||{};var o=m.random||(m.rng||I)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,u){a=a||0;for(var c=0;c<16;++c)u[a+c]=o[c];return u}return M(o)}var p=_e.a=E},"7ahc":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return O});var Z=D("k1fw"),V=D("0Owb"),I=D("+L6B"),G=D("2/Rp"),P=D("y8nQ"),L=D("Vl3Y"),W=D("tJVT"),k=D("OaEy"),r=D("2fM7"),M=D("q1tI"),E=D.n(M),p=D("VrN/"),m=D.n(p),u=D("p77/"),a=D.n(u),o=D("c5Ni"),c=D.n(o),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"]};_e.b=function(S){var C=S.callback,R=S.onCancel,T=Object(M.useState)("python"),v=Object(W.a)(T,2),b=v[0],f=v[1];function h(g){f(n[g][1])}function _(g){C(g)}return E.a.createElement(L.a,Object(V.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:_}),E.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(r.a,{onChange:h},Object.keys(n).map(function(g){return E.a.createElement(s,{key:g,value:g},n[g][0])}))),E.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(O,{mode:b})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(G.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(G.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function O(S){var C=S.value,R=S.onChange,T=S.mode,v=S.options,b=v===void 0?{}:v,f=Object(M.useRef)(),h=Object(M.useState)(),_=Object(W.a)(h,2),g=_[0],x=_[1];return Object(M.useEffect)(function(){if(g){function N(F){var A=F.getValue();R&&R(A)}return g.on("change",N),function(){g.off("change",N)}}},[g,R]),Object(M.useEffect)(function(){g&&g.setOption("mode",T)},[g,T]),Object(M.useEffect)(function(){g&&((C!==g.getValue()||C==="")&&setTimeout(function(){g.setValue(C||" ")},300))},[g,C]),Object(M.useEffect)(function(){if(f.current&&!g){var N=m.a.fromTextArea(f.current,Object(Z.a)({mode:T,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));x(N)}},[f.current,g]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:f}))}},"7ixt":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return I});var Z={adjustX:1,adjustY:1},V=[0,0],I={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=I},"815F":function(jt,_e,D){"use strict";D.d(_e,"e",function(){return W}),D.d(_e,"c",function(){return r}),D.d(_e,"d",function(){return M}),D.d(_e,"a",function(){return p}),D.d(_e,"f",function(){return m}),D.d(_e,"b",function(){return u});var Z=D("KQm4"),V=D("VTBJ"),I=D("Ff2n"),G=D("Zm9Q"),P=D("Kwbf"),L=D("OZM5");function W(a,o){return a!=null?a:o}function k(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=new Map;function c(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(s||[]).forEach(function(n){var O=n.key,S=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)(!o.has(C)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(C)),o.set(C,!0),c(S,"".concat(i).concat(C," > "))})}c(a)}function r(a){function o(c){var s=Object(G.a)(c);return s.map(function(i){if(!Object(L.i)(i))return Object(P.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var n=i.key,O=i.props,S=O.children,C=Object(I.a)(O,["children"]),R=Object(V.a)({key:n},C),T=o(S);return T.length&&(R.children=T),R}).filter(function(i){return i})}return o(a)}function M(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(o===!0?[]:o),s=[];function i(n){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return n.map(function(S,C){var R=Object(L.h)(O?O.pos:"0",C),T=W(S.key,R),v=Object(V.a)(Object(V.a)({},S),{},{parent:O,pos:R,children:null,data:S,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),o===!0||c.has(T)?v.children=i(S.children||[],v):v.children=[],v})}return i(a),s}function E(a,o,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,S){return W(O.key,S)};function i(n,O,S){var C=n?n.children:a,R=n?Object(L.h)(S.pos,O):"0";if(n){var T=s(n,R),v={node:n,index:O,pos:R,key:T,parentPos:S.node?S.pos:null,level:S.level+1};o(v)}C&&C.forEach(function(b,f){i(b,f,{node:n,pos:R,level:S?S.level+1:-1})})}i(null)}function p(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=o.initWrapper,s=o.processEntity,i=o.onProcessFinished,n=arguments.length>2?arguments[2]:void 0,O={},S={},C={posEntities:O,keyEntities:S};return c&&(C=c(C)||C),E(a,function(R){var T=R.node,v=R.index,b=R.pos,f=R.key,h=R.parentPos,_=R.level,g={node:T,index:v,key:f,pos:b,level:_},x=W(f,b);O[b]=g,S[x]=g,g.parent=O[h],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),s&&s(g,C)},n),i&&i(C),C}function m(a,o){var c=o.expandedKeys,s=o.selectedKeys,i=o.loadedKeys,n=o.loadingKeys,O=o.checkedKeys,S=o.halfCheckedKeys,C=o.dragOverNodeKey,R=o.dropPosition,T=o.keyEntities,v=T[a],b={eventKey:a,expanded:c.indexOf(a)!==-1,selected:s.indexOf(a)!==-1,loaded:i.indexOf(a)!==-1,loading:n.indexOf(a)!==-1,checked:O.indexOf(a)!==-1,halfChecked:S.indexOf(a)!==-1,pos:String(v?v.pos:""),dragOver:C===a&&R===0,dragOverGapTop:C===a&&R===-1,dragOverGapBottom:C===a&&R===1};return b}function u(a){var o=a.data,c=a.expanded,s=a.selected,i=a.checked,n=a.loaded,O=a.loading,S=a.halfChecked,C=a.dragOver,R=a.dragOverGapTop,T=a.dragOverGapBottom,v=a.pos,b=a.active,f=Object(V.a)(Object(V.a)({},o),{},{expanded:c,selected:s,checked:i,loaded:n,loading:O,halfChecked:S,dragOver:C,dragOverGapTop:R,dragOverGapBottom:T,pos:v,active:b});return"props"in f||Object.defineProperty(f,"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`."),a}}),f}},"8EBN":function(jt,_e,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 I=Z.modeInfo[V];I.mimes&&(I.mime=I.mimes[0])}Z.findModeByMIME=function(G){G=G.toLowerCase();for(var P=0;P<Z.modeInfo.length;P++){var L=Z.modeInfo[P];if(L.mime==G)return L;if(L.mimes){for(var W=0;W<L.mimes.length;W++)if(L.mimes[W]==G)return L}}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 L=Z.modeInfo[P];if(L.ext){for(var W=0;W<L.ext.length;W++)if(L.ext[W]==G)return L}}},Z.findModeByFileName=function(G){for(var P=0;P<Z.modeInfo.length;P++){var L=Z.modeInfo[P];if(L.file&&L.file.test(G))return L}var W=G.lastIndexOf("."),k=W>-1&&G.substring(W+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 L=Z.modeInfo[P];if(L.name.toLowerCase()==G)return L;if(L.alias){for(var W=0;W<L.alias.length;W++)if(L.alias[W].toLowerCase()==G)return L}}}})},"8HAY":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return P}),D.d(_e,"b",function(){return L}),D.d(_e,"d",function(){return W}),D.d(_e,"e",function(){return k}),D.d(_e,"c",function(){return r});var Z=D("MI8n"),V=D("pmY6"),I=D("3/fG"),G=function(M,E,p,m){function u(a){return a instanceof p?a:new p(function(o){o(a)})}return new(p||(p=Promise))(function(a,o){function c(n){try{i(m.next(n))}catch(O){o(O)}}function s(n){try{i(m.throw(n))}catch(O){o(O)}}function i(n){n.done?a(n.value):u(n.value).then(c,s)}i((m=m.apply(M,E||[])).next())})};class P extends V.a{constructor(M,E="",p="",m=!0,u){super();this._onDidChange=this._register(new Z.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=M,this._label=E,this._cssClass=p,this._enabled=m,this._actionCallback=u}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,E){return G(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(M))})}}class L 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,E){return G(this,void 0,void 0,function*(){if(!M.enabled)return;this._onBeforeRun.fire({action:M});let p;try{yield this.runAction(M,E)}catch(m){p=m}this._onDidRun.fire({action:M,error:p})})}runAction(M,E){return G(this,void 0,void 0,function*(){yield M.run(E)})}}class W extends P{constructor(M){super(W.ID,M,M?"separator text":"separator");this.checked=!1,this.enabled=!1}}W.ID="vs.actions.separator";class k{constructor(M,E,p,m){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=M,this.label=E,this.class=m,this._actions=p}get actions(){return this._actions}dispose(){}run(){return G(this,void 0,void 0,function*(){})}}class r extends P{constructor(){super(r.ID,I.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(jt,_e,D){jt.exports={button:"button___1wy9m"}},"9Bee":function(jt,_e,D){"use strict";var Z=D("DYRE"),V=D("zeV3"),I=D("+L6B"),G=D("2/Rp"),P=D("k1fw"),L=D("9og8"),W=D("tJVT"),k=D("WmNS"),r=D.n(k),M=D("q1tI"),E=D.n(M),p=D("vg9a"),m=D("DlQD"),u=D.n(m),a=D("rUJ1");function o(de,ee){var ne=de.match(/^(\s+)(?:```)/);if(ne===null)return ee;var se=ne[1];return ee.split(`
`).map(function(pe){var ae=pe.match(/^\s+/);if(ae===null)return pe;var ie=Object(W.a)(ae,1),me=ie[0];return me.length>=se.length?pe.slice(se.length):pe}).join(`
`)}var c=[],s=["<ul>"],i=new u.a.Renderer,n=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){c.length=0,s=["<ul>"]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(de,ee,ne,se){if(ee>=de.length||de[ee].level<=ne)return ee;var pe=de[ee];se.push("<li><a href='#"+pe.anchor+"'>"+pe.text+"</a>"),ee++;var ae=[];return ee=C(de,ee,pe.level,ae),ae.length>0&&(se.push("<ul>"),ae.forEach(function(ie){se.push(ie)}),se.push("</ul>")),se.push("</li>"),ee=C(de,ee,ne,se),ee}function R(){return C(c,0,0,s),s.push("</ul>"),s.join("")}var T={heading:function(ee){var ne=n.exec(ee);if(ne)return{type:"heading",raw:ne[0],depth:ne[1].length,text:ne[2]}},fences:function(ee){var ne=this.rules.block.fences.exec(ee);if(ne){var se=ne[0],pe=o(se,ne[3]||""),ae=ne[2]?ne[2].trim():ne[2];if(["latex","katex","math"].indexOf(ae)>=0){var ie=f(),me=pe;pe=ie,h[ie]={type:"block",expression:me}}return{type:"code",raw:se,lang:ae,text:pe}}}},v=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,f=function(){return"__special_katext_id_".concat(b++,"__")},h={};function _(){return h}function g(){b=0,h={}}function x(de){return de=de.replace(v,function(ee,ne){var se=f();return h[se]={type:"inline",expression:ne},se}),de}var N=i.listitem;i.listitem=function(de){return N(x(de))};var F=i.paragraph;i.paragraph=function(de){return F(x(de))};var A=i.tablecell;i.tablecell=function(de,ee){return A(x(de),ee)},i.code=function(de,ee,ne){var se=(ee||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"<p class='editormd-tex'>".concat(de,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ee,'">').concat(ne?de:Object(a.escape)(de,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(ne?de:Object(a.escape)(de,!0))+"</code></pre>"},i.heading=function(de,ee,ne){var se=this.options.headerPrefix+ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:se,level:ee,text:de}),"<h"+ee+' id="'+se+'">'+de+"</h"+ee+">"},u.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),u.a.use({tokenizer:T,renderer:i});var B=u.a,U=D("SJMd"),w=D("ulZh"),Y=D.n(w),q=D("m3rI"),ce=D("Oy/b"),Ee=D("p5ED"),Qe=D("ErOA"),Te=D("STEk");/* **********************************
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 We=function(de,ee){return(We=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ne,se){ne.__proto__=se}||function(ne,se){for(var pe in se)Object.prototype.hasOwnProperty.call(se,pe)&&(ne[pe]=se[pe])})(de,ee)};function $e(de,ee){if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ne(){this.constructor=de}We(de,ee),de.prototype=ee===null?Object.create(ee):(ne.prototype=ee.prototype,new ne)}function Je(de,ee,ne,se){return new(ne||(ne=Promise))(function(pe,ae){function ie(xe){try{ye(se.next(xe))}catch(De){ae(De)}}function me(xe){try{ye(se.throw(xe))}catch(De){ae(De)}}function ye(xe){var De;xe.done?pe(xe.value):(De=xe.value,De instanceof ne?De:new ne(function(ct){ct(De)})).then(ie,me)}ye((se=se.apply(de,ee||[])).next())})}function Ce(de,ee){var ne,se,pe,ae,ie={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return ae={next:me(0),throw:me(1),return:me(2)},typeof Symbol=="function"&&(ae[Symbol.iterator]=function(){return this}),ae;function me(ye){return function(xe){return function(De){if(ne)throw new TypeError("Generator is already executing.");for(;ie;)try{if(ne=1,se&&(pe=2&De[0]?se.return:De[0]?se.throw||((pe=se.return)&&pe.call(se),0):se.next)&&!(pe=pe.call(se,De[1])).done)return pe;switch(se=0,pe&&(De=[2&De[0],pe.value]),De[0]){case 0:case 1:pe=De;break;case 4:return ie.label++,{value:De[1],done:!1};case 5:ie.label++,se=De[1],De=[0];continue;case 7:De=ie.ops.pop(),ie.trys.pop();continue;default:if(!(pe=ie.trys,(pe=pe.length>0&&pe[pe.length-1])||De[0]!==6&&De[0]!==2)){ie=0;continue}if(De[0]===3&&(!pe||De[1]>pe[0]&&De[1]<pe[3])){ie.label=De[1];break}if(De[0]===6&&ie.label<pe[1]){ie.label=pe[1],pe=De;break}if(pe&&ie.label<pe[2]){ie.label=pe[2],ie.ops.push(De);break}pe[2]&&ie.ops.pop(),ie.trys.pop();continue}De=ee.call(de,ie)}catch(ct){De=[6,ct],se=0}finally{ne=pe=0}if(5&De[0])throw De[1];return{value:De[0]?De[1]:void 0,done:!0}}([ye,xe])}}}var X=function(){function de(){}return de.addKey=function(ee){de.key=ee},Object.defineProperty(de,"isLicensed",{get:function(){return!!de.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(de.key)},enumerable:!1,configurable:!0}),de}(),j=function(){function de(){}return de.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},de.setAttributes=function(ee,ne){for(var se=0,pe=ne;se<pe.length;se++){var ae=pe[se],ie=ae[0],me=ae[1];ee.setAttribute(ie,me)}},de.createRect=function(ee,ne,se){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",ee.toString()),pe.setAttribute("height",ne.toString()),se&&de.setAttributes(pe,se),pe},de.createLine=function(ee,ne,se,pe,ae){var ie=document.createElementNS("http://www.w3.org/2000/svg","line");return ie.setAttribute("x1",ee.toString()),ie.setAttribute("y1",ne.toString()),ie.setAttribute("x2",se.toString()),ie.setAttribute("y2",pe.toString()),ae&&de.setAttributes(ie,ae),ie},de.createPolygon=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","polygon");return se.setAttribute("points",ee),ne&&de.setAttributes(se,ne),se},de.createCircle=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","circle");return se.setAttribute("cx",(ee/2).toString()),se.setAttribute("cy",(ee/2).toString()),se.setAttribute("r",ee.toString()),ne&&de.setAttributes(se,ne),se},de.createEllipse=function(ee,ne,se){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(ee/2).toString()),pe.setAttribute("cy",(ne/2).toString()),pe.setAttribute("rx",(ee/2).toString()),pe.setAttribute("ry",(ne/2).toString()),se&&de.setAttributes(pe,se),pe},de.createGroup=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","g");return ee&&de.setAttributes(ne,ee),ne},de.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},de.createMarker=function(ee,ne,se,pe,ae,ie,me){var ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return de.setAttributes(ye,[["id",ee],["orient",ne],["markerWidth",se.toString()],["markerHeight",pe.toString()],["refX",ae.toString()],["refY",ie.toString()]]),ye.appendChild(me),ye},de.createText=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","text");return ne.setAttribute("x","0"),ne.setAttribute("y","0"),ee&&de.setAttributes(ne,ee),ne},de.createTSpan=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","tspan");return se.textContent=ee,ne&&de.setAttributes(se,ne),se},de.createImage=function(ee){var ne=document.createElementNS("http://www.w3.org/2000/svg","image");return ee&&de.setAttributes(ne,ee),ne},de.createPoint=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return se.x=ee,se.y=ne,se},de.createPath=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg","path");return se.setAttribute("d",ee),ne&&de.setAttributes(se,ne),se},de.createElement=function(ee,ne){var se=document.createElementNS("http://www.w3.org/2000/svg",ee);return ne&&de.setAttributes(se,ne),se},de.getHollowRectanglePath=function(ee,ne,se,pe,ae,ie,me,ye){return"M"+ee+","+ne+"V"+(ne+pe)+"H"+(ee+se)+"V"+ne+"H"+ae+"V"+ie+"H"+(ae+me)+"V"+(ie+ye)+"H"+ae+"V"+ne+"Z"},de}(),K=function(){function de(ee){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ee+"_"}return Object.defineProperty(de.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(de.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(de.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),de.prototype.addClass=function(ee){return this.styleSheet===void 0&&this.addStyleSheet(),ee.name=""+this.classNamePrefix+ee.localName,this.classes.push(ee),this.styleSheet.sheet.insertRule("."+ee.name+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length),ee},de.prototype.addRule=function(ee){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ee),this.styleSheet.sheet.insertRule(ee.selector+" {"+ee.style+"}",this.styleSheet.sheet.cssRules.length)},de.prototype.addStyleSheet=function(){var ee;this.styleSheet=document.createElement("style"),((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).appendChild(this.styleSheet),this.addRule(new Q("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Q("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Q("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new re("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new re("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},de.prototype.removeStyleSheet=function(){var ee;this.styleSheet&&(((ee=this.styleSheetRoot)!==null&&ee!==void 0?ee:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},de}(),Q=function(de,ee){this.selector=de,this.style=ee},re=function(de,ee){this.localName=de,this.style=ee},z=function(){function de(){this.blocks=[],this.display=""}return de.prototype.addButtonBlock=function(ee){ee.className=this.blockClassName,ee.buttonClassName=this.buttonClassName,ee.buttonColorsClassName=this.buttonColorsClassName,ee.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(ee)},de.prototype.addElementBlock=function(ee){ee.className===void 0&&(ee.className=this.blockClassName),this.blocks.push(ee)},de.prototype.getUI=function(){var ee=document.createElement("div");return ee.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,ee.style.display=this.display,this.blocks.forEach(function(ne){return ee.appendChild(ne.getUI())}),ee},de}(),we=function(){function de(){}return de.prototype.getUI=function(){var ee=document.createElement("div");if(ee.className=this.className,this.minWidth!==void 0&&(ee.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":ee.style.justifyContent="flex-start";break;case"center":ee.style.justifyContent="center";break;case"end":ee.style.justifyContent="flex-end"}return ee.style.whiteSpace="nowrap",ee},de}(),Ue=function(de){function ee(){var ne=de!==null&&de.apply(this,arguments)||this;return ne.buttons=[],ne}return $e(ee,de),ee.prototype.addButton=function(ne){ne.className=this.buttonClassName,ne.colorsClassName=this.buttonColorsClassName,ne.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(ne)},ee.prototype.getUI=function(){var ne=de.prototype.getUI.call(this);return this.buttons.forEach(function(se){return ne.appendChild(se.getUI())}),ne},ee}(we),rt=function(){function de(ee,ne){this._isActive=!1,this._isHidden=!1,this._icon=ee,this.title=ne,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(de.prototype,"icon",{get:function(){return this._icon},set:function(ee){this._icon=ee,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isActive",{get:function(){return this._isActive},set:function(ee){this._isActive=ee,this.adjustClassName()},enumerable:!1,configurable:!0}),de.prototype.getUI=function(){var ee=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 ee.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},de.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,"")))},de.prototype.hide=function(){this._isHidden=!0},de}(),le=function(de){function ee(){var ne=de!==null&&de.apply(this,arguments)||this;return ne.elements=[],ne}return $e(ee,de),ee.prototype.addElement=function(ne){this.elements.push(ne)},ee.prototype.getUI=function(){var ne=de.prototype.getUI.call(this);return this.elements.forEach(function(se){return ne.appendChild(se)}),ne},ee}(we),Oe=function(){function de(ee,ne){this.horizontal=ee,this.vertical=ne}return Object.defineProperty(de.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),de.prototype.getVerticalLength=function(ee){return ee/this.ratio},de.prototype.getHorizontalLength=function(ee){return ee*this.ratio},de}(),Fe=function(){function de(){}return de.getIcon=function(ee,ne){if(ee>0&&ne>0){var se=new Oe(ee,ne),pe=se.ratio>=1?20:se.getHorizontalLength(20),ae=se.ratio<1?20:se.getVerticalLength(20),ie=document.createElementNS("http://www.w3.org/2000/svg","svg");ie.setAttribute("xmlns","http://www.w3.org/2000/svg"),ie.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ie);var me=j.createDefs();ie.appendChild(me);var ye=j.createElement("clipPath",[["id","text-bg-clip"]]);me.appendChild(ye);var xe=j.createPath(j.getHollowRectanglePath((24-pe)/2,(24-ae)/2,pe,ae,(24-pe)/2+2,(24-ae)/2+2,pe-4,ae-4));ie.appendChild(xe);var De=j.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);De.appendChild(j.createTSpan(ee+":"+ne)),ie.appendChild(De);var ct=De.getBBox();j.setAttributes(De,[["x",((24-ct.width)/2).toString()],["y",((24-ct.height)/2-ct.y).toString()]]);var It=j.createPath(j.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ct.width))/2,(24-Math.ceil(ct.height))/2,Math.ceil(ct.width),Math.ceil(ct.height)));return ye.appendChild(It),j.setAttributes(xe,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ie),ie.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>'},de}(),Ye=function(de){function ee(ne,se,pe){var ae=de.call(this,ne,se)||this;return ae.isDropdownOpen=!1,ae.onClick=ae.dropdownButtonClicked,ae.dropdownButtons=pe,ae}return $e(ee,de),ee.prototype.setupDropdown=function(){var ne=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(se){se.className=ne.className,se.colorsClassName=ne.colorsClassName,ne.dropdownBlock.appendChild(se.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ee.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ee.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ee.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ee.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ee.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ee}(rt),Tt=function(){function de(ee,ne){this.GRIP_SIZE=10,this.color=ee,this.fillColor=ne,this.visual=j.createGroup(),this.visual.appendChild(j.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(j.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return de.prototype.ownsTarget=function(ee){return ee===this.visual||ee===this.visual.childNodes[0]||ee===this.visual.childNodes[1]},de.prototype.setCenter=function(ee,ne){this.visual.childNodes.forEach(function(se){return j.setAttributes(se,[["cx",ee.toString()],["cy",ne.toString()]])})},de}(),Nt=function(){function de(ee,ne,se,pe){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ee,this.canvasHeight=ne,this.margin=se,this.container=pe,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(de.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ee){this._aspectRatio=ee,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.gridContainer&&j.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ee){this._zoomFactor=ee,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),de.prototype.open=function(){var ee=this;this.cropShadeElement=j.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=j.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var ne=0;ne<this.numberOfGridLines;ne++)this.horizontalGridLines.push(j.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(j.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(se){return ee.gridContainer.appendChild(se)}),this.verticalGridLines.forEach(function(se){return ee.gridContainer.appendChild(se)}),this.cropRectElement=j.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Tt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},de.prototype.setCropRectangle=function(ee){this.cropRect=ee;var ne=Object.assign({},this.cropRect);this.zoomFactor!==1&&(ne.width=this.cropRect.width*this.zoomFactor,ne.height=this.cropRect.height*this.zoomFactor,ne.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-ne.width/2,ne.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-ne.height/2),j.setAttributes(this.cropRectElement,[["x",ne.x.toString()],["y",ne.y.toString()],["width",ne.width.toString()],["height",ne.height.toString()]]);var se=ne.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ae,ie){var me=ne.y+se*(ie+1);j.setAttributes(ae,[["x1",""+ne.x],["y1",""+me],["x2",""+(ne.x+ne.width)],["y2",""+me]])});var pe=ne.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ae,ie){var me=ne.x+pe*(ie+1);j.setAttributes(ae,[["x1",""+me],["y1",""+ne.y],["x2",""+me],["y2",""+(ne.y+ne.height)]])}),j.setAttributes(this.cropShadeElement,[["d",j.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,ne.x,ne.y,ne.width,ne.height)]]),this.topLeftGrip.setCenter(ne.x,ne.y),this.topRightGrip.setCenter(ne.x+ne.width,ne.y),this.bottomLeftGrip.setCenter(ne.x,ne.y+ne.height),this.bottomRightGrip.setCenter(ne.x+ne.width,ne.y+ne.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},de.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)},de.prototype.clientToLocalCoordinates=function(ee,ne){var se=this.container.getBoundingClientRect();return{x:ee-se.left+this.margin,y:ne-se.top+this.margin}},de.prototype.onPointerDown=function(ee){this.container.setPointerCapture(ee.pointerId),this.previousPoint=this.clientToLocalCoordinates(ee.clientX,ee.clientY),this.cropRectElement===ee.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ee.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ee.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ee.target)&&(this.activeGrip=this.bottomRightGrip)},de.prototype.onPointerMove=function(ee){if(this.isMoving)this.move(this.clientToLocalCoordinates(ee.clientX,ee.clientY));else if(this.activeGrip){var ne=this.clientToLocalCoordinates(ee.clientX,ee.clientY);this.resize(ne)}ee.preventDefault()},de.prototype.onPointerUp=function(ee){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ee.pointerId)},de.prototype.move=function(ee){var ne=ee.x-this.previousPoint.x,se=ee.y-this.previousPoint.y;this.zoomFactor!==1&&(ne=-ne/this.zoomFactor,se=-se/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+ne),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+se),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ee},de.prototype.resize=function(ee){var ne=Object.assign({},this.cropRect),se=ee.x-this.previousPoint.x,pe=ee.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:ne.x+se<this.margin&&(se=this.margin-ne.x),ne.x+=se,ne.width=this.cropRect.x+this.cropRect.width-ne.x;break;case this.bottomRightGrip:case this.topRightGrip:ne.width+se>this.canvasWidth*this.zoomFactor&&(se=this.canvasWidth*this.zoomFactor-ne.width),ne.width+=se}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(ne.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(se),ne.height=this.aspectRatio.getVerticalLength(ne.width)):(ne.y+=pe,ne.height=this.cropRect.y+this.cropRect.height-ne.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?ne.height=this.aspectRatio.getVerticalLength(ne.width):ne.height+=pe}ne.width<10&&(ne.x=this.cropRect.x,ne.width=10),ne.height<10&&(ne.y=this.cropRect.y,ne.height=10),this.previousPoint=ee,ne.x>=this.margin&&ne.y>=this.margin&&ne.x-this.margin+ne.width<=this.canvasWidth&&ne.y-this.margin+ne.height<=this.canvasHeight&&(this.cropRect=ne,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},de.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ee=this.cropRect.x+this.cropRect.width/2,ne=this.cropRect.y+this.cropRect.height/2,se=this.aspectRatio.getHorizontalLength(this.cropRect.height),pe=this.aspectRatio.getVerticalLength(this.cropRect.width);se/this.canvasWidth<pe/this.canvasHeight?this.cropRect.width=se:this.cropRect.height=pe,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=ee-this.cropRect.width/2,this.cropRect.y=ne-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)}},de.prototype.getRescaledRect=function(ee,ne,se,pe,ae,ie){var me=se/ee,ye=pe/ne;return{x:(ae.x-ie)*me+ie,y:(ae.y-ie)*ye+ie,width:ae.width*me,height:ae.height*ye}},de.prototype.scaleCanvas=function(ee,ne){var se=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ee,ne,this.cropRect,this.margin);this.canvasWidth=ee,this.canvasHeight=ne,this.onCropChange&&this.onCropChange(se),this.setCropRectangle(se)},de}(),Xt=function(){function de(ee){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ee,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(de.prototype,"angle",{get:function(){return this._angle},set:function(ee){this._angle=ee,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),de.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},de.prototype.onPointerDown=function(ee){this.controlContainer.setPointerCapture(ee.pointerId),this.isDragging=!0,this.previousPoint={x:ee.clientX,y:ee.clientY}},de.prototype.onPointerMove=function(ee){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.previousPoint.x=ee.clientX)},de.prototype.onPointerUp=function(ee){this.isDragging&&this.onAngleChange&&this.onAngleChange((ee.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ee.pointerId)},de.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ee=this.angleLabelText.getBBox();j.setAttributes(this.angleLabelElement,[["x",((this.width-ee.width)/2).toString()],["y",(this.height/2).toString()]])}},de.prototype.positionScaleShape=function(){if(this.scaleShape){var ee=this.scaleShape.transform.baseVal.getItem(0);ee.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ee,0)}},de.prototype.getVisual=function(){var ee=document.createElementNS("http://www.w3.org/2000/svg","svg");ee.setAttribute("xmlns","http://www.w3.org/2000/svg"),ee.setAttribute("width",this.width+"px"),ee.setAttribute("height",this.height+"px"),ee.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ee.style.flexShrink="0",document.body.appendChild(ee);for(var ne="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,se=1;se<=this.width/5+10;se++){var pe=se%5==0?this.height/3:this.height/6;ne+="h4v"+-pe+"h1v"+pe}ne+="v1H0Z",this.scaleShape=j.createPath(ne);var ae=j.createTransform();this.scaleShape.transform.baseVal.appendItem(ae),ee.appendChild(this.scaleShape),this.angleLabelElement=j.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=j.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ie=j.createTSpan("");return ie.innerHTML="&deg;",this.angleLabelElement.appendChild(ie),ee.appendChild(this.angleLabelElement),document.body.removeChild(ee),ee},de}(),tt=function(){function de(){this.naturalSize=!1,this.imageType="image/png"}return de.prototype.rasterize=function(ee,ne,se,pe,ae,ie,me){var ye=this;return new Promise(function(xe){var De=document.createElement("canvas");De.width=ee.width.baseVal.value-2*pe,De.height=ee.height.baseVal.value-2*pe;var ct=1,It=1;ye.naturalSize===!0?(ct=ne.naturalWidth/(ee.width.baseVal.value-2*pe)/ie,It=ne.naturalHeight/(ee.height.baseVal.value-2*pe)/me,De.width=ne.naturalWidth/ie,De.height=ne.naturalHeight/me):ye.width!==void 0&&ye.height!==void 0&&(ct=ye.width/se.width,It=ye.height/se.height,De.width*=ct,De.height*=It);var un=De.getContext("2d");un.translate(De.width/2,De.height/2),un.rotate(ae*Math.PI/180),un.scale(ie,me),un.translate(-De.width/2,-De.height/2),un.drawImage(ne,0,0,De.width,De.height);var mt=document.createElement("canvas");mt.width=se.width*ct,mt.height=se.height*It,mt.getContext("2d").putImageData(un.getImageData((se.x-pe)*ct,(se.y-pe)*It,se.width*ct,se.height*It),0,0),xe(mt.toDataURL(ye.imageType,ye.imageQuality))})},de}(),Zt=function(){function de(ee){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=de.instanceCounter++,this.styles=new K(this.instanceNo),this.target=ee,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(de.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ee){this._zoomToCropEnabled=ee,ee?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ee){this._isGridVisible=ee,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ee){this._gridLines=ee,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ee){this._rotationAngle=ee,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(de.prototype,"aspectRatio",{get:function(){var ee;return(ee=this._aspectRatio)!==null&&ee!==void 0?ee:this.aspectRatios[0]},set:function(ee){this._aspectRatio=ee},enumerable:!1,configurable:!0}),de.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},de.prototype.show=function(){this.showUI(),this.open()},de.prototype.close=function(ee){ee===void 0&&(ee=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ee||this.closeEventListeners.forEach(function(ne){return ne()}),this._isOpen=!1)},de.prototype.addRenderEventListener=function(ee){this.renderEventListeners.push(ee)},de.prototype.removeRenderEventListener=function(ee){this.renderEventListeners.indexOf(ee)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ee),1)},de.prototype.addCloseEventListener=function(ee){this.closeEventListeners.push(ee)},de.prototype.removeCloseEventListener=function(ee){this.closeEventListeners.indexOf(ee)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ee),1)},de.prototype.setupResizeObserver=function(){var ee=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ee.resize(ee.target.clientWidth,ee.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))},de.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ee=1*this.target.clientWidth/this.target.clientHeight,ne=this.contentDiv.clientWidth/ee>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ee:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,se=ne+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/ee;this.resize(ne,se)}},de.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},de.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",j.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},de.prototype.resize=function(ee,ne){this.imageWidth=Math.round(ee),this.imageHeight=Math.round(ne),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()},de.prototype.setEditingTarget=function(){var ee=document.createElement("canvas");ee.width=this.target.naturalWidth,ee.height=this.target.naturalHeight,ee.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var ne=ee.toDataURL();j.setAttributes(this.editingTarget,[["href",ne]]),this.setEditingTargetSize()},de.prototype.setTopLeft=function(){var ee=this.target.getBoundingClientRect(),ne=this.editorCanvas.getBoundingClientRect();this.left=ee.left-ne.left-this.CANVAS_MARGIN,this.top=ee.top-ne.top-this.CANVAS_MARGIN},de.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=j.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=j.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=j.createGroup(),this.editingTargetRotationScaleContainer=j.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var ee=j.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(ee);var ne=j.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(ne),this.editingTargetContainer=j.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)},de.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},de.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=j.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Nt(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()},de.prototype.zoomToCrop=function(){if(this.cropRect){var ee=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,ne=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=ee+"px "+ne+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-ee+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-ne+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},de.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)},de.prototype.cropRectChanged=function(ee){this.cropRect=ee,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},de.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},de.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"},de.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},de.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 ee=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,ne=this.target.offsetTop>ee+this.CANVAS_MARGIN?this.target.offsetTop-(ee+this.CANVAS_MARGIN):0;this.coverDiv.style.top=ne+"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},de.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},de.prototype.addTopToolbar=function(){var ee=this;this.topToolbar=new z,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 ne=new Ue;ne.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(ne);var se=[];this.aspectRatios.forEach(function(It){var un=new rt(Fe.getIcon(It.horizontal,It.vertical),It.horizontal===0&&It.vertical===0?"FREE":It.horizontal+":"+It.vertical);un.onClick=function(){return ee.ratioButtonClicked(It)},se.push(un)}),this.aspectRatioButton=new Ye(Fe.getIcon(0,0),"Aspect ratio",se),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,ne.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var pe=new rt('<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");pe.isActive=this.isGridVisible,pe.onClick=function(){ee.isGridVisible=!ee.isGridVisible,pe.isActive=ee.isGridVisible},ne.addButton(pe);var ae=new rt('<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(ae.isActive=this.zoomToCropEnabled,ae.onClick=function(){ee.zoomToCropEnabled=!ee.zoomToCropEnabled,ae.isActive=ee.zoomToCropEnabled},ne.addButton(ae),!X.isLicensed){var ie=new le;this.topToolbar.addElementBlock(ie);var me=document.createElement("div");me.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ye=document.createElement("a");ye.style.color="currentColor",ye.href="https://markerjs.com/products/cropro",ye.target="_blank",ye.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>',me.appendChild(ye),ie.addElement(me)}var xe=new Ue;xe.minWidth=3*this.toolbarHeight+"px",xe.contentAlign="end",this.topToolbar.addButtonBlock(xe);var De=new rt('<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");De.onClick=this.startRenderAndClose,xe.addButton(De),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(De.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ct=new rt('<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");ct.onClick=this.close,xe.addButton(ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},de.prototype.addBottomToolbar=function(){var ee=this;this.bottomToolbar=new z,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 ne=new Ue;ne.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(ne);var se=new rt('<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");se.onClick=this.rotateLeftButtonClicked,ne.addButton(se);var pe=new rt('<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");pe.onClick=this.rotateRightButtonClicked,ne.addButton(pe);var ae=new le;ae.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ae),this.straightener=new Xt("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(xe){ee.rotateBy(xe),ee.straightener.angle=ee.rotationAngle},ae.addElement(this.straightener.getUI());var ie=new Ue;ie.minWidth=2*this.toolbarHeight+"px",ie.contentAlign="end",this.bottomToolbar.addButtonBlock(ie);var me=new rt('<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");me.onClick=this.flipHorizontallyButtonClicked,ie.addButton(me);var ye=new rt('<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");ye.onClick=this.flipVerticallyButtonClicked,ie.addButton(ye)},de.prototype.ratioButtonClicked=function(ee){this.aspectRatio=ee,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},de.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Fe.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},de.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Oe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},de.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},de.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},de.prototype.restoreState=function(ee){if(ee){var ne=this.cropLayer.getRescaledRect(ee.width,ee.height,this.imageWidth,this.imageHeight,ee.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(ne),this.cropRectChanged(ne),this.flippedHorizontally=ee.flippedHorizontally,this.flippedVertically=ee.flippedVertically,this.applyFlip(),this.rotationAngle=ee.rotationAngle,this.applyRotation()}},de.prototype.clientToLocalCoordinates=function(ee,ne){var se=this.cropImage.getBoundingClientRect();return{x:ee-se.left,y:ne-se.top}},de.prototype.onWindowResize=function(){this.positionUI()},de.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ee=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ee+"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()},de.prototype.rotateLeftButtonClicked=function(){var ee=this.rotationAngle-90;this.rotationAngle%90!=0&&(ee+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ee)},de.prototype.rotateRightButtonClicked=function(){var ee=this.rotationAngle+90;this.rotationAngle%90!=0&&(ee-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ee)},de.prototype.rotateTo=function(ee){ee=(ee=ee>180?ee-360:ee)<=-180?ee+360:ee,this.rotationAngle=ee,this.applyRotation()},de.prototype.rotateBy=function(ee){this.rotateTo((this.rotationAngle+ee)%360)},de.prototype.applyRotation=function(){var ee=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var ne=this.editingTargetRotationContainer.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(ne,0);var se=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/se.width,this.imageHeight/se.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ee},de.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},de.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},de.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},de.prototype.startRenderAndClose=function(){return Je(this,void 0,void 0,function(){var ee,ne;return Ce(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return ee=se.sent(),ne=this.getState(),this.renderEventListeners.forEach(function(pe){return pe(ee,ne)}),this.close(!0),[2]}})})},de.prototype.render=function(){return Je(this,void 0,void 0,function(){var ee;return Ce(this,function(ne){switch(ne.label){case 0:return(ee=new tt).naturalSize=this.renderAtNaturalSize,ee.imageType=this.renderImageType,ee.imageQuality=this.renderImageQuality,ee.width=this.renderWidth,ee.height=this.renderHeight,this.unzoomFromCrop(),j.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ee.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 ne.sent(),[4,ee.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,ne.sent()]}})})},de.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new re("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 re("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new re("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var ee=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new re("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*ee)+`px;
height: `+(this.toolbarHeight-2*ee)+`px;
padding: `+ee+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new re("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Q("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Q("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new re("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 re("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new re("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 re("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*ee)+`px;
padding: `+ee+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new re("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},de.instanceCounter=0,de}(),vn=D("8hTe"),ze=D.n(vn),He=/<pre[^>]*>/g;function vt(de){var ee=document.createElement("div");return ee.innerHTML=de,ee.childNodes.length===0?"":ee.childNodes[0].nodeValue}var Rt=_e.a=function(de){var ee=de.value,ne=ee===void 0?"":ee,se=de.edit,pe=se===void 0?!1:se,ae=de.className,ie=de.showTextOnly,me=de.showLines,ye=de.replaces,xe=de.zoomImg,De=de.hasMask,ct=de.style,It=ct===void 0?{}:ct,un=de.stylesPrev,mt=un===void 0?{}:un,Qt=String(ne),ht=Object(M.useRef)(),Et=Object(M.useRef)(),it=Object(M.useState)(""),ve=Object(W.a)(it,2),Me=ve[0],St=ve[1],lt=Object(M.useState)("office"),Gt=Object(W.a)(lt,2),qt=Gt[0],Ve=Gt[1],et=function(){var Hn=new Zt(Et.current);Hn.displayMode="popup",Hn.addRenderEventListener(function(){var ir=Object(L.a)(r.a.mark(function Dn(Vn){var qn;return r.a.wrap(function(Sr){for(;;)switch(Sr.prev=Sr.next){case 0:return ht.current.style.display="none",Sr.next=3,Object(Qe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Vn}});case 3:qn=Sr.sent,qn!=null&&qn.id&&ye(Et.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(qn==null?void 0:qn.id,"?type=").concat(qn.content_type));case 5:case"end":return Sr.stop()}},Dn)}));return function(Dn){return ir.apply(this,arguments)}}()),Hn.show()},gt=function(){var Hn=new Te.a(Et.current);Hn.settings.displayMode="popup",Hn.addEventListener("render",function(){var ir=Object(L.a)(r.a.mark(function Dn(Vn){var qn;return r.a.wrap(function(Sr){for(;;)switch(Sr.prev=Sr.next){case 0:if(ht.current.style.display="none",!Et.current){Sr.next=6;break}return Sr.next=4,Object(Qe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Vn.dataUrl}});case 4:qn=Sr.sent,qn!=null&&qn.id&&ye(Et.current.getAttribute("src").replace(q.a.API_SERVER,""),"/api/attachments/".concat(qn==null?void 0:qn.id,"?type=").concat(qn.content_type));case 6:case"end":return Sr.stop()}},Dn)}));return function(Dn){return ir.apply(this,arguments)}}()),Hn.show(),window.markerArea=Hn},Ht=Object(M.useMemo)(function(){ht.current&&(ht.current.style.zIndex=-1);try{var tn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Hn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,ir=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Qt=Qt.replace(tn,"("+q.a.API_SERVER+"/api/attachments/").replace(Hn,'"'+q.a.API_SERVER+"/api/attachments/").replace(ir,'"'+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(Mr){}var Dn=B(Qt),Vn=_();if(Qt.match(/\[TOC\]/)&&(Dn=Dn.replace("<p>[TOC]</p>",R()),O()),Dn=Dn.replace(/(__special_katext_id_\d+__)/g,function(Mr,Sr){var on=Vn[Sr],Jn=on.type,oi=on.expression;return Object(ce.renderToString)(vt(oi)||"",{displayMode:Jn==="block",throwOnError:!1,output:"html"})}),Dn=Dn.replace(/▁/g,"\u2581\u2581\u2581"),g(),ie){var qn=document.createElement("div");return qn.innerHTML=Dn,qn.innerText}return setTimeout(function(){return Zn()},500),Dn},[Qt]),Vt=Object(M.useRef)();S.WebkitLineClamp=me,me&&(It=Object(P.a)(Object(P.a)({},It),S));function dn(tn){var Hn=tn.target;if(Hn.tagName.toUpperCase()==="IMG"){if(xe){var ir=Hn.getAttribute("src");St(ir),Ve("image")}}else if(Hn.tagName.toUpperCase()==="A"){var Dn=Hn.getAttribute("href");if(Dn.indexOf("office")>-1)tn.preventDefault(),St(Dn),Ve("office");else if(Dn.indexOf("application/pdf")>-1)tn.preventDefault(),St(Dn),Ve("pdf");else if(Dn.indexOf("text/html")>-1)tn.preventDefault(),St(Dn),Ve("html");else if(Dn.startsWith("#")){tn.preventDefault();var Vn=document.getElementById(Dn.replace("#",""));Vn&&Vn.scrollIntoView(!0)}}}var Zn=function(){var Hn,ir=(Hn=Vt.current)===null||Hn===void 0?void 0:Hn.querySelectorAll("video");ir==null||ir.forEach(function(Dn){if(Dn.oncontextmenu=function(){return!1},Dn.src.indexOf(".m3u8")>-1&&!Dn.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var Vn=new Y.a;Vn.loadSource(Dn.src),Vn.attachMedia(Dn)}}})};Object(M.useEffect)(function(){if(Vt.current&&Ht&&(Ht.match(He)&&window.PR.prettyPrint()),Vt.current)return Vt.current.addEventListener("click",dn),function(){Vt.current.removeEventListener("click",dn),g(),O()}},[Ht,Vt.current,dn]);var Wn=function(Hn){if(!pe)return;Hn.target.nodeName==="IMG"?(ht.current.style.zIndex=1,ht.current.style.display="flex",ht.current.style.width=Hn.target.clientWidth+"px",ht.current.style.height=Hn.target.clientHeight+"px",ht.current.style.top=Hn.target.offsetTop+"px",ht.current.style.left=Hn.target.offsetLeft+"px",Et.current.src=Hn.target.getAttribute("src")):ht.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:Vt,style:Object(P.a)({},It),className:"".concat(ae||""," markdown-body ").concat(ze.a.mdBody),onMouseOver:Wn,dangerouslySetInnerHTML:{__html:Ht}}),E.a.createElement("div",{ref:ht,className:ze.a.button},E.a.createElement(V.a,null,E.a.createElement(G.a,{onClick:function(){return et()}},"\u88C1\u526A"),E.a.createElement(G.a,{onClick:function(){return gt()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:Et,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(Ee.a,{close:!0,data:Me,type:Me!=null&&Me.length?qt:"",style:Object(P.a)({},mt),onClose:function(){return St("")}}))}},"9VGf":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return I});var Z=D("q1tI"),V=D.n(Z);function I(G,P){var L=Object(Z.useRef)();Object(Z.useEffect)(function(){L.current=G}),Object(Z.useEffect)(function(){function W(){L.current()}if(P!==null){var k=setInterval(W,P);return function(){return clearInterval(k)}}},[P])}},AHFd:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return k});var Z=D("giR+"),V=D("fyUT"),I=D("OaEy"),G=D("2fM7"),P=D("tJVT"),L=D("q1tI"),W=D.n(L),k;(function(M){M[M.Number=1]="Number",M[M.Percent=2]="Percent"})(k||(k={}));var r=function(E){var p=E.value,m=E.onChange,u=E.disabled,a=E.hidePercentOption,o=a===void 0?!1:a,c=Object(L.useMemo)(function(){return o?k.Number:k.Percent},[o]),s=Object(L.useState)(c),i=Object(P.a)(s,2),n=i[0],O=i[1],S=Object(L.useCallback)(function(R){return n===k.Number?"".concat(R,"\u5206"):"".concat(R,"%")},[n]),C=Object(L.useCallback)(function(R){if(n===k.Number){var T=R.replace("\u5206","");return isNaN(parseInt(T,10))?0:T}else{var v=R.replace("%","");return v}},[n]);return Object(L.useEffect)(function(){O(p.type)},[p]),W.a.createElement("div",{style:{display:"inline-block"}},W.a.createElement(G.a,{onChange:function(T){O(T),m({type:T,inputValue:T===k.Number?5:20})},value:n||c,style:{width:100},options:o?[{label:"\u5206\u503C",value:k.Number}]:[{label:"\u767E\u5206\u6BD4",value:k.Percent},{label:"\u5206\u503C",value:k.Number}],disabled:u}),W.a.createElement(V.a,{disabled:u,value:p.inputValue,formatter:S,parser:C,max:n===k.Percent?100:Number.MAX_SAFE_INTEGER,min:0,precision:0,onChange:function(T){m({type:n,inputValue:T})}}))};_e.b=r},BU3w:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return L});var Z=D("MNnm"),V="rc-util-key";function I(W){if(W.attachTo)return W.attachTo;var k=document.querySelector("head");return k||document.body}function G(W){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 E;M.nonce=(E=r.csp)===null||E===void 0?void 0:E.nonce}M.innerHTML=W;var p=I(r),m=p.firstChild;return r.prepend&&p.prepend?p.prepend(M):r.prepend&&m?p.insertBefore(M,m):p.appendChild(M),M}var P=new Map;function L(W,k){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},M=I(r);if(!P.has(M)){var E=G("",r),p=E.parentNode;P.set(M,p),p.removeChild(E)}var m=Array.from(P.get(M).children).find(function(s){return s.tagName==="STYLE"&&s[V]===k});if(m){var u,a;if(((u=r.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((a=r.csp)===null||a===void 0?void 0:a.nonce)){var o;m.nonce=(o=r.csp)===null||o===void 0?void 0:o.nonce}return m.innerHTML!==W&&(m.innerHTML=W),m}var c=G(W,r);return c[V]=k,c}},Bd2K:function(jt,_e,D){(function(Z){Z(D("VrN/"),D("osHv"))})(function(Z){Z.defineOption("autoCloseTags",!1,function(r,M,E){if(E!=Z.Init&&E&&r.removeKeyMap("autoCloseTags"),!M)return;var p={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(p["'/'"]=function(m){return L(m)}),(typeof M!="object"||M.whenOpening!==!1)&&(p["'>'"]=function(m){return G(m)}),r.addKeyMap(p)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],I=["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(),E=[],p=r.getOption("autoCloseTags"),m=0;m<M.length;m++){if(!M[m].empty())return Z.Pass;var u=M[m].head,a=r.getTokenAt(u),o=Z.innerMode(r.getMode(),a.state),c=o.state,s=o.mode.xmlCurrentTag&&o.mode.xmlCurrentTag(c),i=s&&s.name;if(!i)return Z.Pass;var n=o.mode.configuration=="html",O=typeof p=="object"&&p.dontCloseTags||n&&V,S=typeof p=="object"&&p.indentTags||n&&I;a.end>u.ch&&(i=i.slice(0,i.length-a.end+u.ch));var C=i.toLowerCase();if(!i||a.type=="string"&&(a.end!=u.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&s.close||a.string.indexOf("/")==u.ch-a.start-1||O&&W(O,C)>-1||k(r,o.mode.xmlCurrentContext&&o.mode.xmlCurrentContext(c)||[],i,u,!0))return Z.Pass;var R=typeof p=="object"&&p.emptyTags;if(R&&W(R,i)>-1){E[m]={text:"/>",newPos:Z.Pos(u.line,u.ch+2)};continue}var T=S&&W(S,C)>-1;E[m]={indent:T,text:">"+(T?`
`:"")+"</"+i+">",newPos:T?Z.Pos(u.line+1,0):Z.Pos(u.line,u.ch+1)}}for(var v=typeof p=="object"&&p.dontIndentOnAutoClose,m=M.length-1;m>=0;m--){var b=E[m];r.replaceRange(b.text,M[m].head,M[m].anchor,"+insert");var f=r.listSelections().slice(0);f[m]={head:b.newPos,anchor:b.newPos},r.setSelections(f),!v&&b.indent&&(r.indentLine(b.newPos.line,null,!0),r.indentLine(b.newPos.line+1,null,!0))}}function P(r,M){for(var E=r.listSelections(),p=[],m=M?"/":"</",u=r.getOption("autoCloseTags"),a=typeof u=="object"&&u.dontIndentOnSlash,o=0;o<E.length;o++){if(!E[o].empty())return Z.Pass;var c=E[o].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,S=i.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(S&&i.mode.name=="javascript")O=m+"script";else if(S&&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+=">"),p[o]=O}if(r.replaceSelections(p),E=r.listSelections(),!a)for(var o=0;o<E.length;o++)(o==E.length-1||E[o].head.line<E[o+1].head.line)&&r.indentLine(E[o].head.line)}function L(r){return r.getOption("disableInput")?Z.Pass:P(r,!0)}Z.commands.closeTag=function(r){return P(r)};function W(r,M){if(r.indexOf)return r.indexOf(M);for(var E=0,p=r.length;E<p;++E)if(r[E]==M)return E;return-1}function k(r,M,E,p,m){if(!Z.scanForClosingTag)return!1;var u=Math.min(r.lastLine()+1,p.line+500),a=Z.scanForClosingTag(r,p,null,u);if(!a||a.tag!=E)return!1;for(var o=m?1:0,c=M.length-1;c>=0&&M[c]==E;c--)++o;p=a.to;for(var c=1;c<o;c++){var s=Z.scanForClosingTag(r,p,null,u);if(!s||s.tag!=E)return!1;p=s.to}return!0}})},BdwD:function(jt,_e,D){"use strict";var Z=D("+L6B"),V=D("2/Rp"),I=D("0Owb"),G=D("k1fw"),P=D("q1tI"),L=D.n(P),W=D("FOrL"),k=D.n(W),r=function(E){var p=E.buttonProps,m=p===void 0?{}:p,u=E.styles,a=u===void 0?{}:u,o=E.imgStyles,c=o===void 0?{}:o,s=E.customText,i=E.ButtonText,n=E.ButtonClick,O=E.Buttonclass,S=E.ButtonTwo;return L.a.createElement("section",{className:"tc animated fadeIn",style:Object(G.a)(Object(G.a)({},{color:"#999",margin:"0 auto",padding:"100px 0"}),a)},L.a.createElement("img",{src:k.a,style:Object(G.a)(Object(G.a)({},{width:"200px",height:"150px"}),c)}),L.a.createElement("p",{className:"mt10 font14"},s||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),i&&L.a.createElement(V.a,Object(I.a)({className:O,onClick:n},m),i),S&&S)};_e.a=r},BjJ7:function(jt,_e,D){"use strict";D.d(_e,"d",function(){return V}),D.d(_e,"c",function(){return I}),D.d(_e,"e",function(){return G}),D.d(_e,"b",function(){return P}),D.d(_e,"a",function(){return W});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 I(k){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",M=[],E=0;E<k.length;E++){var p=k[E],m=r?"".concat(r,"/").concat(p.name):"".concat(p.name);M.push({title:p.name,isLeaf:!(p.type==="tree"),key:m})}return M}function G(k,r,M){for(var E=0;E<k.length;E++){var p=k[E];if(p.key===r){p.children=M;break}p.children&&G(p.children,r,M)}return k}function P(k,r,M){var E;return function(){var p=this,m=arguments,u=function(){E=null,M||k.apply(p,m)},a=M&&!E;clearTimeout(E),E=setTimeout(u,r),a&&k.apply(p,m)}}var L=!0,W=Z.a.API_SERVER},"C+DQ":function(jt,_e,D){},"C/vA":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return Z});function Z(V){const I=this;let G=!1,P;return function(){return G||(G=!0,P=V.apply(I,arguments)),P}}},"Cg/j":function(jt,_e,D){"use strict";D.d(_e,"b",function(){return Z}),D.d(_e,"a",function(){return V}),D.d(_e,"c",function(){return G}),D.d(_e,"d",function(){return P});var Z;(function(L){L.serviceIds=new Map,L.DI_TARGET="$di$target",L.DI_DEPENDENCIES="$di$dependencies";function W(k){return k[L.DI_DEPENDENCIES]||[]}L.getServiceDependencies=W})(Z||(Z={}));const V=G("instantiationService");function I(L,W,k,r){W[Z.DI_TARGET]===W?W[Z.DI_DEPENDENCIES].push({id:L,index:k,optional:r}):(W[Z.DI_DEPENDENCIES]=[{id:L,index:k,optional:r}],W[Z.DI_TARGET]=W)}function G(L){if(Z.serviceIds.has(L))return Z.serviceIds.get(L);const W=function(k,r,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I(W,k,M,!1)};return W.toString=()=>L,Z.serviceIds.set(L,W),W}function P(L){return function(W,k,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");I(L,W,r,!0)}}},DlQD:function(jt,_e,D){(function(Z,V){jt.exports=V()})(this,function(){"use strict";function Z(ne,se){for(var pe=0;pe<se.length;pe++){var ae=se[pe];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(ne,ae.key,ae)}}function V(ne,se,pe){return se&&Z(ne.prototype,se),pe&&Z(ne,pe),ne}function I(ne,se){if(!ne)return;if(typeof ne=="string")return G(ne,se);var pe=Object.prototype.toString.call(ne).slice(8,-1);if(pe==="Object"&&ne.constructor&&(pe=ne.constructor.name),pe==="Map"||pe==="Set")return Array.from(ne);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return G(ne,se)}function G(ne,se){(se==null||se>ne.length)&&(se=ne.length);for(var pe=0,ae=new Array(se);pe<se;pe++)ae[pe]=ne[pe];return ae}function P(ne,se){var pe;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(pe=I(ne))||se&&ne&&typeof ne.length=="number"){pe&&(ne=pe);var ae=0;return function(){return ae>=ne.length?{done:!0}:{done:!1,value:ne[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 pe=ne[Symbol.iterator](),pe.next.bind(pe)}function L(ne,se){return se={exports:{}},ne(se,se.exports),se.exports}var W=L(function(ne){function se(){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 pe(ae){ne.exports.defaults=ae}ne.exports={defaults:se(),getDefaults:se,changeDefaults:pe}}),k=W.defaults,r=W.getDefaults,M=W.changeDefaults,E=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},o=function(se){return a[se]};function c(ne,se){if(se){if(E.test(ne))return ne.replace(p,o)}else if(m.test(ne))return ne.replace(u,o);return ne}var s=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(ne){return ne.replace(s,function(se,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var n=/(^|[^\[])\^/g;function O(ne,se){ne=ne.source||ne,se=se||"";var pe={replace:function(ie,me){return me=me.source||me,me=me.replace(n,"$1"),ne=ne.replace(ie,me),pe},getRegex:function(){return new RegExp(ne,se)}};return pe}var S=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(ne,se,pe){if(ne){var ae;try{ae=decodeURIComponent(i(pe)).replace(S,"").toLowerCase()}catch(ie){return null}if(ae.indexOf("javascript:")===0||ae.indexOf("vbscript:")===0||ae.indexOf("data:")===0)return null}se&&!C.test(pe)&&(pe=h(se,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ie){return null}return pe}var T={},v=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,f=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(ne,se){T[" "+ne]||(v.test(ne)?T[" "+ne]=ne+"/":T[" "+ne]=N(ne,"/",!0)),ne=T[" "+ne];var pe=ne.indexOf(":")===-1;return se.substring(0,2)==="//"?pe?se:ne.replace(b,"$1")+se:se.charAt(0)==="/"?pe?se:ne.replace(f,"$1")+se:ne+se}var _={exec:function(){}};function g(ne){for(var se=1,pe,ae;se<arguments.length;se++){pe=arguments[se];for(ae in pe)Object.prototype.hasOwnProperty.call(pe,ae)&&(ne[ae]=pe[ae])}return ne}function x(ne,se){var pe=ne.replace(/\|/g,function(me,ye,xe){for(var De=!1,ct=ye;--ct>=0&&xe[ct]==="\\";)De=!De;return De?"|":" |"}),ae=pe.split(/ \|/),ie=0;if(ae.length>se)ae.splice(se);else for(;ae.length<se;)ae.push("");for(;ie<ae.length;ie++)ae[ie]=ae[ie].trim().replace(/\\\|/g,"|");return ae}function N(ne,se,pe){var ae=ne.length;if(ae===0)return"";for(var ie=0;ie<ae;){var me=ne.charAt(ae-ie-1);if(me===se&&!pe)ie++;else if(me!==se&&pe)ie++;else break}return ne.substr(0,ae-ie)}function F(ne,se){if(ne.indexOf(se[1])===-1)return-1;for(var pe=ne.length,ae=0,ie=0;ie<pe;ie++)if(ne[ie]==="\\")ie++;else if(ne[ie]===se[0])ae++;else if(ne[ie]===se[1]&&(ae--,ae<0))return ie;return-1}function A(ne){ne&&ne.sanitize&&!ne.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 B={escape:c,unescape:i,edit:O,cleanUrl:R,resolveUrl:h,noopTest:_,merge:g,splitCells:x,rtrim:N,findClosingBracket:F,checkSanitizeDeprecation:A},U=W.defaults,w=B.rtrim,Y=B.splitCells,q=B.escape,ce=B.findClosingBracket;function Ee(ne,se,pe){var ae=se.href,ie=se.title?q(se.title):null,me=ne[1].replace(/\\([\[\]])/g,"$1");return ne[0].charAt(0)!=="!"?{type:"link",raw:pe,href:ae,title:ie,text:me}:{type:"image",raw:pe,href:ae,title:ie,text:q(me)}}function Qe(ne,se){var pe=ne.match(/^(\s+)(?:```)/);if(pe===null)return se;var ae=pe[1];return se.split(`
`).map(function(ie){var me=ie.match(/^\s+/);if(me===null)return ie;var ye=me[0];return ye.length>=ae.length?ie.slice(ae.length):ie}).join(`
`)}var Te=function(){function ne(pe){this.options=pe||U}var se=ne.prototype;return se.space=function(ae){var ie=this.rules.block.newline.exec(ae);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:`
`}},se.code=function(ae,ie){var me=this.rules.block.code.exec(ae);if(me){var ye=ie[ie.length-1];if(ye&&ye.type==="paragraph")return{raw:me[0],text:me[0].trimRight()};var xe=me[0].replace(/^ {4}/gm,"");return{type:"code",raw:me[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:w(xe,`
`)}}},se.fences=function(ae){var ie=this.rules.block.fences.exec(ae);if(ie){var me=ie[0],ye=Qe(me,ie[3]||"");return{type:"code",raw:me,lang:ie[2]?ie[2].trim():ie[2],text:ye}}},se.heading=function(ae){var ie=this.rules.block.heading.exec(ae);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},se.nptable=function(ae){var ie=this.rules.block.nptable.exec(ae);if(ie){var me={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[],raw:ie[0]};if(me.header.length===me.align.length){var ye=me.align.length,xe;for(xe=0;xe<ye;xe++)/^ *-+: *$/.test(me.align[xe])?me.align[xe]="right":/^ *:-+: *$/.test(me.align[xe])?me.align[xe]="center":/^ *:-+ *$/.test(me.align[xe])?me.align[xe]="left":me.align[xe]=null;for(ye=me.cells.length,xe=0;xe<ye;xe++)me.cells[xe]=Y(me.cells[xe],me.header.length);return me}}},se.hr=function(ae){var ie=this.rules.block.hr.exec(ae);if(ie)return{type:"hr",raw:ie[0]}},se.blockquote=function(ae){var ie=this.rules.block.blockquote.exec(ae);if(ie){var me=ie[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ie[0],text:me}}},se.list=function(ae){var ie=this.rules.block.list.exec(ae);if(ie){for(var me=ie[0],ye=ie[2],xe=ye.length>1,De=ye[ye.length-1]===")",ct={type:"list",raw:me,ordered:xe,start:xe?+ye.slice(0,-1):"",loose:!1,items:[]},It=ie[0].match(this.rules.block.item),un=!1,mt,Qt,ht,Et,it,ve,Me,St=It.length,lt=0;lt<St;lt++)mt=It[lt],me=mt,Qt=mt.length,mt=mt.replace(/^ *([*+-]|\d+[.)]) */,""),~mt.indexOf(`
`)&&(Qt-=mt.length,mt=this.options.pedantic?mt.replace(/^ {1,4}/gm,""):mt.replace(new RegExp("^ {1,"+Qt+"}","gm"),"")),lt!==St-1&&(ht=this.rules.block.bullet.exec(It[lt+1])[0],(xe?ht.length===1||!De&&ht[ht.length-1]===")":ht.length>1||this.options.smartLists&&ht!==ye)&&(Et=It.slice(lt+1).join(`
`),ct.raw=ct.raw.substring(0,ct.raw.length-Et.length),lt=St-1)),it=un||/\n\n(?!\s*$)/.test(mt),lt!==St-1&&(un=mt.charAt(mt.length-1)===`
`,it||(it=un)),it&&(ct.loose=!0),ve=/^\[[ xX]\] /.test(mt),Me=void 0,ve&&(Me=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),ct.items.push({type:"list_item",raw:me,task:ve,checked:Me,loose:it,text:mt});return ct}},se.html=function(ae){var ie=this.rules.block.html.exec(ae);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):q(ie[0]):ie[0]}},se.def=function(ae){var ie=this.rules.block.def.exec(ae);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var me=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:me,raw:ie[0],href:ie[2],title:ie[3]}}},se.table=function(ae){var ie=this.rules.block.table.exec(ae);if(ie){var me={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(`
`):[]};if(me.header.length===me.align.length){me.raw=ie[0];var ye=me.align.length,xe;for(xe=0;xe<ye;xe++)/^ *-+: *$/.test(me.align[xe])?me.align[xe]="right":/^ *:-+: *$/.test(me.align[xe])?me.align[xe]="center":/^ *:-+ *$/.test(me.align[xe])?me.align[xe]="left":me.align[xe]=null;for(ye=me.cells.length,xe=0;xe<ye;xe++)me.cells[xe]=Y(me.cells[xe].replace(/^ *\| *| *\| *$/g,""),me.header.length);return me}}},se.lheading=function(ae){var ie=this.rules.block.lheading.exec(ae);if(ie)return{type:"heading",raw:ie[0],depth:ie[2].charAt(0)==="="?1:2,text:ie[1]}},se.paragraph=function(ae){var ie=this.rules.block.paragraph.exec(ae);if(ie)return{type:"paragraph",raw:ie[0],text:ie[1].charAt(ie[1].length-1)===`
`?ie[1].slice(0,-1):ie[1]}},se.text=function(ae,ie){var me=this.rules.block.text.exec(ae);if(me){var ye=ie[ie.length-1];return ye&&ye.type==="text"?{raw:me[0],text:me[0]}:{type:"text",raw:me[0],text:me[0]}}},se.escape=function(ae){var ie=this.rules.inline.escape.exec(ae);if(ie)return{type:"escape",raw:ie[0],text:q(ie[1])}},se.tag=function(ae,ie,me){var ye=this.rules.inline.tag.exec(ae);if(ye)return!ie&&/^<a /i.test(ye[0])?ie=!0:ie&&/^<\/a>/i.test(ye[0])&&(ie=!1),!me&&/^<(pre|code|kbd|script)(\s|>)/i.test(ye[0])?me=!0:me&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ye[0])&&(me=!1),{type:this.options.sanitize?"text":"html",raw:ye[0],inLink:ie,inRawBlock:me,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):q(ye[0]):ye[0]}},se.link=function(ae){var ie=this.rules.inline.link.exec(ae);if(ie){var me=ce(ie[2],"()");if(me>-1){var ye=ie[0].indexOf("!")===0?5:4,xe=ye+ie[1].length+me;ie[2]=ie[2].substring(0,me),ie[0]=ie[0].substring(0,xe).trim(),ie[3]=""}var De=ie[2],ct="";if(this.options.pedantic){var It=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);It?(De=It[1],ct=It[3]):ct=""}else ct=ie[3]?ie[3].slice(1,-1):"";De=De.trim().replace(/^<([\s\S]*)>$/,"$1");var un=Ee(ie,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:ct&&ct.replace(this.rules.inline._escapes,"$1")},ie[0]);return un}},se.reflink=function(ae,ie){var me;if((me=this.rules.inline.reflink.exec(ae))||(me=this.rules.inline.nolink.exec(ae))){var ye=(me[2]||me[1]).replace(/\s+/g," ");if(ye=ie[ye.toLowerCase()],!ye||!ye.href){var xe=me[0].charAt(0);return{type:"text",raw:xe,text:xe}}var De=Ee(me,ye,me[0]);return De}},se.strong=function(ae,ie,me){me===void 0&&(me="");var ye=this.rules.inline.strong.start.exec(ae);if(ye&&(!ye[1]||ye[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ie=ie.slice(-1*ae.length);var xe=ye[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var De;(ye=xe.exec(ie))!=null;)if(De=this.rules.inline.strong.middle.exec(ie.slice(0,ye.index+3)),De)return{type:"strong",raw:ae.slice(0,De[0].length),text:ae.slice(2,De[0].length-2)}}},se.em=function(ae,ie,me){me===void 0&&(me="");var ye=this.rules.inline.em.start.exec(ae);if(ye&&(!ye[1]||ye[1]&&(me===""||this.rules.inline.punctuation.exec(me)))){ie=ie.slice(-1*ae.length);var xe=ye[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var De;(ye=xe.exec(ie))!=null;)if(De=this.rules.inline.em.middle.exec(ie.slice(0,ye.index+2)),De)return{type:"em",raw:ae.slice(0,De[0].length),text:ae.slice(1,De[0].length-1)}}},se.codespan=function(ae){var ie=this.rules.inline.code.exec(ae);if(ie){var me=ie[2].replace(/\n/g," "),ye=/[^ ]/.test(me),xe=me.startsWith(" ")&&me.endsWith(" ");return ye&&xe&&(me=me.substring(1,me.length-1)),me=q(me,!0),{type:"codespan",raw:ie[0],text:me}}},se.br=function(ae){var ie=this.rules.inline.br.exec(ae);if(ie)return{type:"br",raw:ie[0]}},se.del=function(ae){var ie=this.rules.inline.del.exec(ae);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},se.autolink=function(ae,ie){var me=this.rules.inline.autolink.exec(ae);if(me){var ye,xe;return me[2]==="@"?(ye=q(this.options.mangle?ie(me[1]):me[1]),xe="mailto:"+ye):(ye=q(me[1]),xe=ye),{type:"link",raw:me[0],text:ye,href:xe,tokens:[{type:"text",raw:ye,text:ye}]}}},se.url=function(ae,ie){var me;if(me=this.rules.inline.url.exec(ae)){var ye,xe;if(me[2]==="@")ye=q(this.options.mangle?ie(me[0]):me[0]),xe="mailto:"+ye;else{var De;do De=me[0],me[0]=this.rules.inline._backpedal.exec(me[0])[0];while(De!==me[0]);ye=q(me[0]),me[1]==="www."?xe="http://"+ye:xe=ye}return{type:"link",raw:me[0],text:ye,href:xe,tokens:[{type:"text",raw:ye,text:ye}]}}},se.inlineText=function(ae,ie,me){var ye=this.rules.inline.text.exec(ae);if(ye){var xe;return ie?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):q(ye[0]):ye[0]:xe=q(this.options.smartypants?me(ye[0]):ye[0]),{type:"text",raw:ye[0],text:xe}}},ne}(),We=B.noopTest,$e=B.edit,Je=B.merge,Ce={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:We,table:We,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ce.def=$e(Ce.def).replace("label",Ce._label).replace("title",Ce._title).getRegex(),Ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Ce.item=$e(Ce.item,"gm").replace(/bull/g,Ce.bullet).getRegex(),Ce.list=$e(Ce.list).replace(/bull/g,Ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ce.def.source+")").getRegex(),Ce._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",Ce._comment=/<!--(?!-?>)[\s\S]*?-->/,Ce.html=$e(Ce.html,"i").replace("comment",Ce._comment).replace("tag",Ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ce.paragraph=$e(Ce._paragraph).replace("hr",Ce.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",Ce._tag).getRegex(),Ce.blockquote=$e(Ce.blockquote).replace("paragraph",Ce.paragraph).getRegex(),Ce.normal=Je({},Ce),Ce.gfm=Je({},Ce.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*|$)"}),Ce.gfm.nptable=$e(Ce.gfm.nptable).replace("hr",Ce.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",Ce._tag).getRegex(),Ce.gfm.table=$e(Ce.gfm.table).replace("hr",Ce.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",Ce._tag).getRegex(),Ce.pedantic=Je({},Ce.normal,{html:$e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ce._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:We,paragraph:$e(Ce.normal._paragraph).replace("hr",Ce.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:We,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:We,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=$e(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=$e(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=$e(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=$e(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=$e(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=$e(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=$e(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=$e(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=$e(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=$e(X._blockSkip,"g").getRegex(),X.overlapSkip=$e(X._overlapSkip,"g").getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._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])?)+(?![-_])/,X.autolink=$e(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=$e(X.tag).replace("comment",Ce._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=$e(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=$e(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=$e(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=Je({},X),X.pedantic=Je({},X.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:$e(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:$e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=Je({},X.normal,{escape:$e(X.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),X.gfm.url=$e(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=Je({},X.gfm,{br:$e(X.br).replace("{2,}","*").getRegex(),text:$e(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var j={block:Ce,inline:X},K=W.defaults,Q=j.block,re=j.inline;function z(ne){return ne.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 we(ne){var se="",pe,ae,ie=ne.length;for(pe=0;pe<ie;pe++)ae=ne.charCodeAt(pe),Math.random()>.5&&(ae="x"+ae.toString(16)),se+="&#"+ae+";";return se}var Ue=function(){function ne(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||K,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ae={block:Q.normal,inline:re.normal};this.options.pedantic?(ae.block=Q.pedantic,ae.inline=re.pedantic):this.options.gfm&&(ae.block=Q.gfm,this.options.breaks?ae.inline=re.breaks:ae.inline=re.gfm),this.tokenizer.rules=ae}ne.lex=function(ae,ie){var me=new ne(ie);return me.lex(ae)};var se=ne.prototype;return se.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},se.blockTokens=function(ae,ie,me){ie===void 0&&(ie=[]),me===void 0&&(me=!0),ae=ae.replace(/^ +$/gm,"");for(var ye,xe,De,ct;ae;){if(ye=this.tokenizer.space(ae)){ae=ae.substring(ye.raw.length),ye.type&&ie.push(ye);continue}if(ye=this.tokenizer.code(ae,ie)){ae=ae.substring(ye.raw.length),ye.type?ie.push(ye):(ct=ie[ie.length-1],ct.raw+=`
`+ye.raw,ct.text+=`
`+ye.text);continue}if(ye=this.tokenizer.fences(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.heading(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.nptable(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.hr(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.blockquote(ae)){ae=ae.substring(ye.raw.length),ye.tokens=this.blockTokens(ye.text,[],me),ie.push(ye);continue}if(ye=this.tokenizer.list(ae)){for(ae=ae.substring(ye.raw.length),De=ye.items.length,xe=0;xe<De;xe++)ye.items[xe].tokens=this.blockTokens(ye.items[xe].text,[],!1);ie.push(ye);continue}if(ye=this.tokenizer.html(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(me&&(ye=this.tokenizer.def(ae))){ae=ae.substring(ye.raw.length),this.tokens.links[ye.tag]||(this.tokens.links[ye.tag]={href:ye.href,title:ye.title});continue}if(ye=this.tokenizer.table(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.lheading(ae)){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(me&&(ye=this.tokenizer.paragraph(ae))){ae=ae.substring(ye.raw.length),ie.push(ye);continue}if(ye=this.tokenizer.text(ae,ie)){ae=ae.substring(ye.raw.length),ye.type?ie.push(ye):(ct=ie[ie.length-1],ct.raw+=`
`+ye.raw,ct.text+=`
`+ye.text);continue}if(ae){var It="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return ie},se.inline=function(ae){var ie,me,ye,xe,De,ct,It=ae.length;for(ie=0;ie<It;ie++){ct=ae[ie];switch(ct.type){case"paragraph":case"text":case"heading":{ct.tokens=[],this.inlineTokens(ct.text,ct.tokens);break}case"table":{for(ct.tokens={header:[],cells:[]},xe=ct.header.length,me=0;me<xe;me++)ct.tokens.header[me]=[],this.inlineTokens(ct.header[me],ct.tokens.header[me]);for(xe=ct.cells.length,me=0;me<xe;me++)for(De=ct.cells[me],ct.tokens.cells[me]=[],ye=0;ye<De.length;ye++)ct.tokens.cells[me][ye]=[],this.inlineTokens(De[ye],ct.tokens.cells[me][ye]);break}case"blockquote":{this.inline(ct.tokens);break}case"list":{for(xe=ct.items.length,me=0;me<xe;me++)this.inline(ct.items[me].tokens);break}}}return ae},se.inlineTokens=function(ae,ie,me,ye,xe){ie===void 0&&(ie=[]),me===void 0&&(me=!1),ye===void 0&&(ye=!1),xe===void 0&&(xe="");var De,ct=ae,It;if(this.tokens.links){var un=Object.keys(this.tokens.links);if(un.length>0)for(;(It=this.tokenizer.rules.inline.reflinkSearch.exec(ct))!=null;)un.includes(It[0].slice(It[0].lastIndexOf("[")+1,-1))&&(ct=ct.slice(0,It.index)+"["+"a".repeat(It[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(It=this.tokenizer.rules.inline.blockSkip.exec(ct))!=null;)ct=ct.slice(0,It.index)+"["+"a".repeat(It[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ae;){if(De=this.tokenizer.escape(ae)){ae=ae.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.tag(ae,me,ye)){ae=ae.substring(De.raw.length),me=De.inLink,ye=De.inRawBlock,ie.push(De);continue}if(De=this.tokenizer.link(ae)){ae=ae.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,ye)),ie.push(De);continue}if(De=this.tokenizer.reflink(ae,this.tokens.links)){ae=ae.substring(De.raw.length),De.type==="link"&&(De.tokens=this.inlineTokens(De.text,[],!0,ye)),ie.push(De);continue}if(De=this.tokenizer.strong(ae,ct,xe)){ae=ae.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],me,ye),ie.push(De);continue}if(De=this.tokenizer.em(ae,ct,xe)){ae=ae.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],me,ye),ie.push(De);continue}if(De=this.tokenizer.codespan(ae)){ae=ae.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.br(ae)){ae=ae.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.del(ae)){ae=ae.substring(De.raw.length),De.tokens=this.inlineTokens(De.text,[],me,ye),ie.push(De);continue}if(De=this.tokenizer.autolink(ae,we)){ae=ae.substring(De.raw.length),ie.push(De);continue}if(!me&&(De=this.tokenizer.url(ae,we))){ae=ae.substring(De.raw.length),ie.push(De);continue}if(De=this.tokenizer.inlineText(ae,ye,z)){ae=ae.substring(De.raw.length),xe=De.raw.slice(-1),ie.push(De);continue}if(ae){var mt="Infinite loop on byte: "+ae.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return ie},V(ne,null,[{key:"rules",get:function(){return{block:Q,inline:re}}}]),ne}(),rt=W.defaults,le=B.cleanUrl,Oe=B.escape,Fe=function(){function ne(pe){this.options=pe||rt}var se=ne.prototype;return se.code=function(ae,ie,me){var ye=(ie||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(ae,ye);xe!=null&&xe!==ae&&(me=!0,ae=xe)}return ye?'<pre><code class="'+this.options.langPrefix+Oe(ye,!0)+'">'+(me?ae:Oe(ae,!0))+`</code></pre>
`:"<pre><code>"+(me?ae:Oe(ae,!0))+`</code></pre>
`},se.blockquote=function(ae){return`<blockquote>
`+ae+`</blockquote>
`},se.html=function(ae){return ae},se.heading=function(ae,ie,me,ye){return this.options.headerIds?"<h"+ie+' id="'+this.options.headerPrefix+ye.slug(me)+'">'+ae+"</h"+ie+`>
`:"<h"+ie+">"+ae+"</h"+ie+`>
`},se.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},se.list=function(ae,ie,me){var ye=ie?"ol":"ul",xe=ie&&me!==1?' start="'+me+'"':"";return"<"+ye+xe+`>
`+ae+"</"+ye+`>
`},se.listitem=function(ae){return"<li>"+ae+`</li>
`},se.checkbox=function(ae){return"<input "+(ae?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},se.paragraph=function(ae){return"<p>"+ae+`</p>
`},se.table=function(ae,ie){return ie&&(ie="<tbody>"+ie+"</tbody>"),`<table>
<thead>
`+ae+`</thead>
`+ie+`</table>
`},se.tablerow=function(ae){return`<tr>
`+ae+`</tr>
`},se.tablecell=function(ae,ie){var me=ie.header?"th":"td",ye=ie.align?"<"+me+' align="'+ie.align+'">':"<"+me+">";return ye+ae+"</"+me+`>
`},se.strong=function(ae){return"<strong>"+ae+"</strong>"},se.em=function(ae){return"<em>"+ae+"</em>"},se.codespan=function(ae){return"<code>"+ae+"</code>"},se.br=function(){return this.options.xhtml?"<br/>":"<br>"},se.del=function(ae){return"<del>"+ae+"</del>"},se.link=function(ae,ie,me){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return me;var ye='<a href="'+Oe(ae)+'"';return ie&&(ye+=' title="'+ie+'"'),ye+=">"+me+"</a>",ye},se.image=function(ae,ie,me){if(ae=le(this.options.sanitize,this.options.baseUrl,ae),ae===null)return me;var ye='<img src="'+ae+'" alt="'+me+'"';return ie&&(ye+=' title="'+ie+'"'),ye+=this.options.xhtml?"/>":">",ye},se.text=function(ae){return ae},ne}(),Ye=function(){function ne(){}var se=ne.prototype;return se.strong=function(ae){return ae},se.em=function(ae){return ae},se.codespan=function(ae){return ae},se.del=function(ae){return ae},se.html=function(ae){return ae},se.text=function(ae){return ae},se.link=function(ae,ie,me){return""+me},se.image=function(ae,ie,me){return""+me},se.br=function(){return""},ne}(),Tt=function(){function ne(){this.seen={}}var se=ne.prototype;return se.slug=function(ae){var ie=ae.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var me=ie;do this.seen[me]++,ie=me+"-"+this.seen[me];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},ne}(),Nt=W.defaults,Xt=B.unescape,tt=function(){function ne(pe){this.options=pe||Nt,this.options.renderer=this.options.renderer||new Fe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ye,this.slugger=new Tt}ne.parse=function(ae,ie){var me=new ne(ie);return me.parse(ae)};var se=ne.prototype;return se.parse=function(ae,ie){ie===void 0&&(ie=!0);var me="",ye,xe,De,ct,It,un,mt,Qt,ht,Et,it,ve,Me,St,lt,Gt,qt,Ve,et=ae.length;for(ye=0;ye<et;ye++){Et=ae[ye];switch(Et.type){case"space":continue;case"hr":{me+=this.renderer.hr();continue}case"heading":{me+=this.renderer.heading(this.parseInline(Et.tokens),Et.depth,Xt(this.parseInline(Et.tokens,this.textRenderer)),this.slugger);continue}case"code":{me+=this.renderer.code(Et.text,Et.lang,Et.escaped);continue}case"table":{for(Qt="",mt="",ct=Et.header.length,xe=0;xe<ct;xe++)mt+=this.renderer.tablecell(this.parseInline(Et.tokens.header[xe]),{header:!0,align:Et.align[xe]});for(Qt+=this.renderer.tablerow(mt),ht="",ct=Et.cells.length,xe=0;xe<ct;xe++){for(un=Et.tokens.cells[xe],mt="",It=un.length,De=0;De<It;De++)mt+=this.renderer.tablecell(this.parseInline(un[De]),{header:!1,align:Et.align[De]});ht+=this.renderer.tablerow(mt)}me+=this.renderer.table(Qt,ht);continue}case"blockquote":{ht=this.parse(Et.tokens),me+=this.renderer.blockquote(ht);continue}case"list":{for(it=Et.ordered,ve=Et.start,Me=Et.loose,ct=Et.items.length,ht="",xe=0;xe<ct;xe++)lt=Et.items[xe],Gt=lt.checked,qt=lt.task,St="",lt.task&&(Ve=this.renderer.checkbox(Gt),Me?lt.tokens.length>0&&lt.tokens[0].type==="text"?(lt.tokens[0].text=Ve+" "+lt.tokens[0].text,lt.tokens[0].tokens&&lt.tokens[0].tokens.length>0&&lt.tokens[0].tokens[0].type==="text"&&(lt.tokens[0].tokens[0].text=Ve+" "+lt.tokens[0].tokens[0].text)):lt.tokens.unshift({type:"text",text:Ve}):St+=Ve),St+=this.parse(lt.tokens,Me),ht+=this.renderer.listitem(St,qt,Gt);me+=this.renderer.list(ht,it,ve);continue}case"html":{me+=this.renderer.html(Et.text);continue}case"paragraph":{me+=this.renderer.paragraph(this.parseInline(Et.tokens));continue}case"text":{for(ht=Et.tokens?this.parseInline(Et.tokens):Et.text;ye+1<et&&ae[ye+1].type==="text";)Et=ae[++ye],ht+=`
`+(Et.tokens?this.parseInline(Et.tokens):Et.text);me+=ie?this.renderer.paragraph(ht):ht;continue}default:{var gt='Token with "'+Et.type+'" type was not found.';if(this.options.silent){console.error(gt);return}else throw new Error(gt)}}}return me},se.parseInline=function(ae,ie){ie=ie||this.renderer;var me="",ye,xe,De=ae.length;for(ye=0;ye<De;ye++){xe=ae[ye];switch(xe.type){case"escape":{me+=ie.text(xe.text);break}case"html":{me+=ie.html(xe.text);break}case"link":{me+=ie.link(xe.href,xe.title,this.parseInline(xe.tokens,ie));break}case"image":{me+=ie.image(xe.href,xe.title,xe.text);break}case"strong":{me+=ie.strong(this.parseInline(xe.tokens,ie));break}case"em":{me+=ie.em(this.parseInline(xe.tokens,ie));break}case"codespan":{me+=ie.codespan(xe.text);break}case"br":{me+=ie.br();break}case"del":{me+=ie.del(this.parseInline(xe.tokens,ie));break}case"text":{me+=ie.text(xe.text);break}default:{var ct='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(ct);return}else throw new Error(ct)}}}return me},ne}(),Zt=B.merge,vn=B.checkSanitizeDeprecation,ze=B.escape,He=W.getDefaults,vt=W.changeDefaults,Rt=W.defaults;function de(ne,se,pe){if(typeof ne=="undefined"||ne===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ne!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ne)+", string expected");if(typeof se=="function"&&(pe=se,se=null),se=Zt({},de.defaults,se||{}),vn(se),pe){var ae=se.highlight,ie;try{ie=Ue.lex(ne,se)}catch(De){return pe(De)}var me=function(ct){var It;if(!ct)try{It=tt.parse(ie,se)}catch(un){ct=un}return se.highlight=ae,ct?pe(ct):pe(null,It)};if(!ae||ae.length<3)return me();if(delete se.highlight,!ie.length)return me();var ye=0;de.walkTokens(ie,function(De){De.type==="code"&&(ye++,setTimeout(function(){ae(De.text,De.lang,function(ct,It){if(ct)return me(ct);It!=null&&It!==De.text&&(De.text=It,De.escaped=!0),ye--,ye===0&&me()})},0))}),ye===0&&me();return}try{var xe=Ue.lex(ne,se);return se.walkTokens&&de.walkTokens(xe,se.walkTokens),tt.parse(xe,se)}catch(De){if(De.message+=`
Please report this to https://github.com/markedjs/marked.`,se.silent)return"<p>An error occurred:</p><pre>"+ze(De.message+"",!0)+"</pre>";throw De}}de.options=de.setOptions=function(ne){return Zt(de.defaults,ne),vt(de.defaults),de},de.getDefaults=He,de.defaults=Rt,de.use=function(ne){var se=Zt({},ne);if(ne.renderer&&function(){var ae=de.defaults.renderer||new Fe,ie=function(xe){var De=ae[xe];ae[xe]=function(){for(var ct=arguments.length,It=new Array(ct),un=0;un<ct;un++)It[un]=arguments[un];var mt=ne.renderer[xe].apply(ae,It);return mt===!1&&(mt=De.apply(ae,It)),mt}};for(var me in ne.renderer)ie(me);se.renderer=ae}(),ne.tokenizer&&function(){var ae=de.defaults.tokenizer||new Te,ie=function(xe){var De=ae[xe];ae[xe]=function(){for(var ct=arguments.length,It=new Array(ct),un=0;un<ct;un++)It[un]=arguments[un];var mt=ne.tokenizer[xe].apply(ae,It);return mt===!1&&(mt=De.apply(ae,It)),mt}};for(var me in ne.tokenizer)ie(me);se.tokenizer=ae}(),ne.walkTokens){var pe=de.defaults.walkTokens;se.walkTokens=function(ae){ne.walkTokens(ae),pe&&pe(ae)}}de.setOptions(se)},de.walkTokens=function(ne,se){for(var pe=P(ne),ae;!(ae=pe()).done;){var ie=ae.value;se(ie);switch(ie.type){case"table":{for(var me=P(ie.tokens.header),ye;!(ye=me()).done;){var xe=ye.value;de.walkTokens(xe,se)}for(var De=P(ie.tokens.cells),ct;!(ct=De()).done;)for(var It=ct.value,un=P(It),mt;!(mt=un()).done;){var Qt=mt.value;de.walkTokens(Qt,se)}break}case"list":{de.walkTokens(ie.items,se);break}default:ie.tokens&&de.walkTokens(ie.tokens,se)}}},de.Parser=tt,de.parser=tt.parse,de.Renderer=Fe,de.TextRenderer=Ye,de.Lexer=Ue,de.lexer=Ue.lex,de.Tokenizer=Te,de.Slugger=Tt,de.parse=de;var ee=de;return ee})},ELLl:function(jt,_e,D){(function(Z){Z(D("VrN/"))})(function(Z){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},I=Z.Pos;Z.defineOption("autoCloseBrackets",!1,function(a,o,c){c&&c!=Z.Init&&(a.removeKeyMap(P),a.state.closeBrackets=null),o&&(L(G(o,"pairs")),a.state.closeBrackets=o,a.addKeyMap(P))});function G(a,o){return o=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[o]!=null?a[o]:V[o]}var P={Backspace:r,Enter:M};function L(a){for(var o=0;o<a.length;o++){var c=a.charAt(o),s="'"+c+"'";P[s]||(P[s]=W(c))}}L(V.pairs+"`");function W(a){return function(o){return p(o,a)}}function k(a){var o=a.state.closeBrackets;if(!o||o.override)return o;var c=a.getModeAt(a.getCursor());return c.closeBrackets||o}function r(a){var o=k(a);if(!o||a.getOption("disableInput"))return Z.Pass;for(var c=G(o,"pairs"),s=a.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Z.Pass;var n=m(a,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;a.replaceRange("",I(O.line,O.ch-1),I(O.line,O.ch+1),"+delete")}}function M(a){var o=k(a),c=o&&G(o,"explode");if(!c||a.getOption("disableInput"))return Z.Pass;for(var s=a.listSelections(),i=0;i<s.length;i++){if(!s[i].empty())return Z.Pass;var n=m(a,s[i].head);if(!n||c.indexOf(n)%2!=0)return Z.Pass}a.operation(function(){var O=a.lineSeparator()||`
`;a.replaceSelection(O+O,null),a.execCommand("goCharLeft"),s=a.listSelections();for(var S=0;S<s.length;S++){var C=s[S].head.line;a.indentLine(C,null,!0),a.indentLine(C+1,null,!0)}})}function E(a){var o=Z.cmpPos(a.anchor,a.head)>0;return{anchor:new I(a.anchor.line,a.anchor.ch+(o?-1:1)),head:new I(a.head.line,a.head.ch+(o?1:-1))}}function p(a,o){var c=k(a);if(!c||a.getOption("disableInput"))return Z.Pass;var s=G(c,"pairs"),i=s.indexOf(o);if(i==-1)return Z.Pass;for(var n=G(c,"closeBefore"),O=G(c,"triples"),S=s.charAt(i+1)==o,C=a.listSelections(),R=i%2==0,T,v=0;v<C.length;v++){var b=C[v],f=b.head,h,_=a.getRange(f,I(f.line,f.ch+1));if(R&&!b.empty())h="surround";else if((S||!R)&&_==o)S&&u(a,f)?h="both":O.indexOf(o)>=0&&a.getRange(f,I(f.line,f.ch+3))==o+o+o?h="skipThree":h="skip";else if(S&&f.ch>1&&O.indexOf(o)>=0&&a.getRange(I(f.line,f.ch-2),f)==o+o){if(f.ch>2&&/\bstring/.test(a.getTokenTypeAt(I(f.line,f.ch-2))))return Z.Pass;h="addFour"}else if(S){var g=f.ch==0?" ":a.getRange(I(f.line,f.ch-1),f);if(!Z.isWordChar(_)&&g!=o&&!Z.isWordChar(g))h="both";else return Z.Pass}else if(R&&(_.length===0||/\s/.test(_)||n.indexOf(_)>-1))h="both";else return Z.Pass;if(!T)T=h;else if(T!=h)return Z.Pass}var x=i%2?s.charAt(i-1):o,N=i%2?o:s.charAt(i+1);a.operation(function(){if(T=="skip")a.execCommand("goCharRight");else if(T=="skipThree")for(var F=0;F<3;F++)a.execCommand("goCharRight");else if(T=="surround"){for(var A=a.getSelections(),F=0;F<A.length;F++)A[F]=x+A[F]+N;a.replaceSelections(A,"around"),A=a.listSelections().slice();for(var F=0;F<A.length;F++)A[F]=E(A[F]);a.setSelections(A)}else T=="both"?(a.replaceSelection(x+N,null),a.triggerElectric(x+N),a.execCommand("goCharLeft")):T=="addFour"&&(a.replaceSelection(x+x+x+x,"before"),a.execCommand("goCharRight"))})}function m(a,o){var c=a.getRange(I(o.line,o.ch-1),I(o.line,o.ch+1));return c.length==2?c:null}function u(a,o){var c=a.getTokenAt(I(o.line,o.ch+1));return/\bstring/.test(c.type)&&c.start==o.ch&&(o.ch==0||!/\bstring/.test(a.getTokenTypeAt(o)))}})},F0VM:function(jt,_e,D){jt.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(jt,_e,D){jt.exports=D.p+"static/nodata.a6b3f948.png"},FWmy:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return Z});function Z(V,I){if(!V)throw new Error(I?`Assertion failed (${I})`:"Assertion Failed")}},Gytx:function(jt,_e){jt.exports=function(Z,V,I,G){var P=I?I.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 L=Object.keys(Z),W=Object.keys(V);if(L.length!==W.length)return!1;for(var k=Object.prototype.hasOwnProperty.bind(V),r=0;r<L.length;r++){var M=L[r];if(!k(M))return!1;var E=Z[M],p=V[M];if(P=I?I.call(G,E,p,M):void 0,P===!1||P===void 0&&E!==p)return!1}return!0}},HmJG:function(jt,_e,D){},I8Z2:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return G}),D.d(_e,"b",function(){return m}),D.d(_e,"c",function(){return a});var Z=D("q1tI"),V=function(){var o=function(c,s){return o=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])},o(c,s)};return function(c,s){o(c,s);function i(){this.constructor=c}c.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)}}(),I=Z.createContext(null),G=function(o){V(c,o);function c(){return o!==null&&o.apply(this,arguments)||this}return c.prototype.render=function(){return Z.createElement(I.Provider,{value:this.props.store},this.props.children)},c}(Z.Component),P=D("Gytx"),L=D.n(P),W=D("2mql"),k=D.n(W),r=function(){var o=function(c,s){return o=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])},o(c,s)};return function(c,s){o(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(o){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)&&(o[n]=c[n])}return o},M.apply(this,arguments)};function E(o){return o.displayName||o.name||"Component"}var p=function(){return{}};function m(o,c){c===void 0&&(c={});var s=!!o,i=o||p;return function(O){var S=function(R){r(T,R);function T(v,b){var f=R.call(this,v,b)||this;return f.unsubscribe=null,f.handleChange=function(){if(!f.unsubscribe)return;var h=i(f.store.getState(),f.props);f.setState({subscribed:h})},f.store=f.context,f.state={subscribed:i(f.store.getState(),v),store:f.store,props:v},f}return T.getDerivedStateFromProps=function(v,b){return o&&o.length===2&&v!==b.props?{subscribed:i(b.store.getState(),v),props:v}:{props:v}},T.prototype.componentDidMount=function(){this.trySubscribe()},T.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},T.prototype.shouldComponentUpdate=function(v,b){return!L()(this.props,v)||!L()(this.state.subscribed,b.subscribed)},T.prototype.trySubscribe=function(){s&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},T.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},T.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}))},T.displayName="Connect("+E(O)+")",T.contextType=I,T}(Z.Component);if(c.forwardRef){var C=Z.forwardRef(function(R,T){return Z.createElement(S,M({},R,{miniStoreForwardedRef:T}))});return k()(C,O)}return k()(S,O)}}var u=function(){return u=Object.assign||function(o){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)&&(o[n]=c[n])}return o},u.apply(this,arguments)};function a(o){var c=o,s=[];function i(S){c=u(u({},c),S);for(var C=0;C<s.length;C++)s[C]()}function n(){return c}function O(S){return s.push(S),function(){var R=s.indexOf(S);s.splice(R,1)}}return{setState:i,getState:n,subscribe:O}}},IBYe:function(jt,_e,D){"use strict";function Z(V){return null}_e.a=Z},J66h:function(jt,_e,D){(function(Z){var V,I;(function(G,P){jt.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,L="2.6.4",W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=function(x){for(var N={},F=0,A=x.length;F<A;F++)N[x.charAt(F)]=F;return N}(W),r=String.fromCharCode,M=function(x){if(x.length<2){var N=x.charCodeAt(0);return N<128?x:N<2048?r(192|N>>>6)+r(128|N&63):r(224|N>>>12&15)+r(128|N>>>6&63)+r(128|N&63)}else{var N=65536+(x.charCodeAt(0)-55296)*1024+(x.charCodeAt(1)-56320);return r(240|N>>>18&7)+r(128|N>>>12&63)+r(128|N>>>6&63)+r(128|N&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,p=function(x){return x.replace(E,M)},m=function(x){var N=[0,2,1][x.length%3],F=x.charCodeAt(0)<<16|(x.length>1?x.charCodeAt(1):0)<<8|(x.length>2?x.charCodeAt(2):0),A=[W.charAt(F>>>18),W.charAt(F>>>12&63),N>=2?"=":W.charAt(F>>>6&63),N>=1?"=":W.charAt(F&63)];return A.join("")},u=G.btoa&&typeof G.btoa=="function"?function(x){return G.btoa(x)}:function(x){if(x.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return x.replace(/[\s\S]{1,3}/g,m)},a=function(x){return u(p(String(x)))},o=function(x){return x.replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,"")},c=function(x,N){return N?o(a(x)):a(x)},s=function(x){return c(x,!0)},i;G.Uint8Array&&(i=function(x,N){for(var F="",A=0,B=x.length;A<B;A+=3){var U=x[A],w=x[A+1],Y=x[A+2],q=U<<16|w<<8|Y;F+=W.charAt(q>>>18)+W.charAt(q>>>12&63)+(typeof w!="undefined"?W.charAt(q>>>6&63):"=")+(typeof Y!="undefined"?W.charAt(q&63):"=")}return N?o(F):F});var n=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(x){switch(x.length){case 4:var N=(7&x.charCodeAt(0))<<18|(63&x.charCodeAt(1))<<12|(63&x.charCodeAt(2))<<6|63&x.charCodeAt(3),F=N-65536;return r((F>>>10)+55296)+r((F&1023)+56320);case 3:return r((15&x.charCodeAt(0))<<12|(63&x.charCodeAt(1))<<6|63&x.charCodeAt(2));default:return r((31&x.charCodeAt(0))<<6|63&x.charCodeAt(1))}},S=function(x){return x.replace(n,O)},C=function(x){var N=x.length,F=N%4,A=(N>0?k[x.charAt(0)]<<18:0)|(N>1?k[x.charAt(1)]<<12:0)|(N>2?k[x.charAt(2)]<<6:0)|(N>3?k[x.charAt(3)]:0),B=[r(A>>>16),r(A>>>8&255),r(A&255)];return B.length-=[0,0,2,1][F],B.join("")},R=G.atob&&typeof G.atob=="function"?function(x){return G.atob(x)}:function(x){return x.replace(/\S{1,4}/g,C)},T=function(x){return R(String(x).replace(/[^A-Za-z0-9\+\/]/g,""))},v=function(x){return S(R(x))},b=function(x){return String(x).replace(/[-_]/g,function(N){return N=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},f=function(x){return v(b(x))},h;G.Uint8Array&&(h=function(x){return Uint8Array.from(T(b(x)),function(N){return N.charCodeAt(0)})});var _=function(){var x=G.Base64;return G.Base64=P,x};if(G.Base64={VERSION:L,atob:T,btoa:u,fromBase64:f,toBase64:c,utob:p,encode:c,encodeURI:s,btou:S,decode:f,noConflict:_,fromUint8Array:i,toUint8Array:h},typeof Object.defineProperty=="function"){var g=function(x){return{value:x,enumerable:!1,writable:!0,configurable:!0}};G.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return f(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(x){return c(this,x)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return c(this,!0)}))}}return G.Meteor&&(Base64=G.Base64),jt.exports?jt.exports.Base64=G.Base64:!(V=[],I=function(){return G.Base64}.apply(_e,V),I!==void 0&&(jt.exports=I)),{Base64:G.Base64}})}).call(this,D("IyRk"))},JYp7:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return Z});var Z;(function(V){function I(n){return n&&typeof n=="object"&&typeof n[Symbol.iterator]=="function"}V.is=I;const G=Object.freeze([]);function P(){return G}V.empty=P;function*L(n){yield n}V.single=L;function W(n){return n||G}V.from=W;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 S of n)if(O(S))return!0;return!1}V.some=M;function E(n,O){for(const S of n)if(O(S))return S;return}V.find=E;function*p(n,O){for(const S of n)O(S)&&(yield S)}V.filter=p;function*m(n,O){let S=0;for(const C of n)yield O(C,S++)}V.map=m;function*u(...n){for(const O of n)for(const S of O)yield S}V.concat=u;function*a(n){for(const O of n)for(const S of O)yield S}V.concatNested=a;function o(n,O,S){let C=S;for(const R of n)C=O(C,R);return C}V.reduce=o;function*c(n,O,S=n.length){for(O<0&&(O+=n.length),S<0?S+=n.length:S>n.length&&(S=n.length);O<S;O++)yield n[O]}V.slice=c;function s(n,O=Number.POSITIVE_INFINITY){const S=[];if(O===0)return[S,n];const C=n[Symbol.iterator]();for(let R=0;R<O;R++){const T=C.next();if(T.done)return[S,V.empty()];S.push(T.value)}return[S,{[Symbol.iterator](){return C}}]}V.consume=s;function i(n,O,S=(C,R)=>C===R){const C=n[Symbol.iterator](),R=O[Symbol.iterator]();for(;;){const T=C.next(),v=R.next();if(T.done!==v.done)return!1;if(T.done)return!0;if(!S(T.value,v.value))return!1}}V.equals=i})(Z||(Z={}))},LSTS:function(jt,_e,D){"use strict";Object.defineProperty(_e,"__esModule",{value:!0});var Z=function(){function p(m,u){for(var a=0;a<u.length;a++){var o=u[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,u,a){return u&&p(m.prototype,u),a&&p(m,a),m}}(),V=D("q1tI"),I=L(V),G=D("17x9"),P=L(G);function L(p){return p&&p.__esModule?p:{default:p}}function W(p,m){var u={};for(var a in p){if(m.indexOf(a)>=0)continue;if(!Object.prototype.hasOwnProperty.call(p,a))continue;u[a]=p[a]}return u}function k(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function r(p,m){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:p}function M(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);p.prototype=Object.create(m&&m.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(p,m):p.__proto__=m)}var E=function(p){M(m,p);function m(u){k(this,m);var a=r(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,u));return a.scrollListener=a.scrollListener.bind(a),a.eventListenerOptions=a.eventListenerOptions.bind(a),a.mousewheelListener=a.mousewheelListener.bind(a),a}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 a=this.getParentElement(this.scrollComponent);a.scrollTop=a.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var a=!1,o={get passive(){a=!0}};try{document.addEventListener("test",null,o),document.removeEventListener("test",null,o)}catch(c){}return a}},{key:"eventListenerOptions",value:function(){var a=this.props.useCapture;return this.isPassiveSupported()&&(a={useCapture:this.props.useCapture,passive:!0}),a}},{key:"setDefaultLoader",value:function(a){this.defaultLoader=a}},{key:"detachMousewheelListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.scrollComponent.parentNode),a.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var a=window;this.props.useWindow===!1&&(a=this.getParentElement(this.scrollComponent)),a.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),a.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(a){var o=this.props.getScrollParent&&this.props.getScrollParent();return o!=null?o:a&&a.parentNode}},{key:"filterProps",value:function(a){return a}},{key:"attachScrollListener",value:function(){var a=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!a)return;var o=window;this.props.useWindow===!1&&(o=a),o.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),o.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),o.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}},{key:"mousewheelListener",value:function(a){a.deltaY===1&&!this.isPassiveSupported()&&a.preventDefault()}},{key:"scrollListener",value:function(){var a=this.scrollComponent,o=window,c=this.getParentElement(a),s=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,n=o.pageYOffset!==void 0?o.pageYOffset:i.scrollTop;this.props.isReverse?s=n:s=this.calculateOffset(a,n)}else this.props.isReverse?s=c.scrollTop:s=a.scrollHeight-c.scrollTop-c.clientHeight;s<Number(this.props.threshold)&&a&&a.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(a,o){return a?this.calculateTopPosition(a)+(a.offsetHeight-o-window.innerHeight):0}},{key:"calculateTopPosition",value:function(a){return a?a.offsetTop+this.calculateTopPosition(a.offsetParent):0}},{key:"render",value:function(){var a=this,o=this.filterProps(this.props),c=o.children,s=o.element,i=o.hasMore,n=o.initialLoad,O=o.isReverse,S=o.loader,C=o.loadMore,R=o.pageStart,T=o.ref,v=o.threshold,b=o.useCapture,f=o.useWindow,h=o.getScrollParent,_=W(o,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);_.ref=function(x){a.scrollComponent=x,T&&T(x)};var g=[c];return i&&(S?O?g.unshift(S):g.push(S):this.defaultLoader&&(O?g.unshift(this.defaultLoader):g.push(this.defaultLoader))),I.default.createElement(s,_,g)}}]),m}(V.Component);E.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},E.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},_e.default=E,jt.exports=_e.default},LdHM:function(jt,_e,D){"use strict";D.d(_e,"b",function(){return n}),D.d(_e,"a",function(){return S});var Z=D("1OyB"),V=D("vuIU"),I=D("Ji7U"),G=D("LK+K"),P=D("q1tI"),L=D("rePB"),W=D("Ff2n"),k=D("ODXe"),r=D("4IlW"),M=D("bX4T"),E=D("YrtM"),p=D("TSYQ"),m=D.n(p),u=D("+nKL"),a=D("8OUc"),o=function(Y,q){var ce=Y.prefixCls,Ee=Y.id,Qe=Y.flattenOptions,Te=Y.childrenAsData,We=Y.values,$e=Y.searchValue,Je=Y.multiple,Ce=Y.defaultActiveFirstOption,X=Y.height,j=Y.itemHeight,K=Y.notFoundContent,Q=Y.open,re=Y.menuItemSelectedIcon,z=Y.virtual,we=Y.onSelect,Ue=Y.onToggleOpen,rt=Y.onActiveValue,le=Y.onScroll,Oe=Y.onMouseEnter,Fe="".concat(ce,"-item"),Ye=Object(E.a)(function(){return Qe},[Q,Qe],function(ee,ne){return ne[0]&&ee[1]!==ne[1]}),Tt=P.useRef(null),Nt=function(ne){ne.preventDefault()},Xt=function(ne){Tt.current&&Tt.current.scrollTo({index:ne})},tt=function(ne){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=Ye.length,ae=0;ae<pe;ae+=1){var ie=(ne+ae*se+pe)%pe,me=Ye[ie],ye=me.group,xe=me.data;if(!ye&&!xe.disabled)return ie}return-1},Zt=P.useState(function(){return tt(0)}),vn=Object(k.a)(Zt,2),ze=vn[0],He=vn[1],vt=function(ne){He(ne);var se=Ye[ne];if(!se){rt(null,-1);return}rt(se.data.value,ne)};P.useEffect(function(){vt(Ce!==!1?tt(0):-1)},[Ye.length,$e]),P.useEffect(function(){var ee=setTimeout(function(){if(!Je&&Q&&We.size===1){var ne=Array.from(We)[0],se=Ye.findIndex(function(pe){var ae=pe.data;return ae.value===ne});vt(se),Xt(se)}});return function(){return clearTimeout(ee)}},[Q]);var Rt=function(ne){ne!==void 0&&we(ne,{selected:!We.has(ne)}),Je||Ue(!1)};if(P.useImperativeHandle(q,function(){return{onKeyDown:function(ne){var se=ne.which;switch(se){case r.a.UP:case r.a.DOWN:{var pe=0;if(se===r.a.UP?pe=-1:se===r.a.DOWN&&(pe=1),pe!==0){var ae=tt(ze+pe,pe);Xt(ae),vt(ae)}break}case r.a.ENTER:{var ie=Ye[ze];ie&&!ie.data.disabled?Rt(ie.data.value):Rt(void 0),Q&&ne.preventDefault();break}case r.a.ESC:Ue(!1)}},onKeyUp:function(){},scrollTo:function(ne){Xt(ne)}}}),Ye.length===0)return P.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat(Fe,"-empty"),onMouseDown:Nt},K);function de(ee){var ne=Ye[ee];if(!ne)return null;var se=ne.data||{},pe=se.value,ae=se.label,ie=se.children,me=Object(M.a)(se,!0),ye=Te?ie:ae;return ne?P.createElement("div",Object.assign({"aria-label":typeof ye=="string"?ye:null},me,{key:ee,role:"option",id:"".concat(Ee,"_list_").concat(ee),"aria-selected":We.has(pe)}),pe):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},de(ze-1),de(ze),de(ze+1)),P.createElement(u.a,{itemKey:"key",ref:Tt,data:Ye,height:X,itemHeight:j,fullHeight:!1,onMouseDown:Nt,onScroll:le,virtual:z,onMouseEnter:Oe},function(ee,ne){var se,pe=ee.group,ae=ee.groupOption,ie=ee.data,me=ie.label,ye=ie.key;if(pe)return P.createElement("div",{className:m()(Fe,"".concat(Fe,"-group"))},me!==void 0?me:ye);var xe=ie.disabled,De=ie.value,ct=ie.title,It=ie.children,un=ie.style,mt=ie.className,Qt=Object(W.a)(ie,["disabled","value","title","children","style","className"]),ht=We.has(De),Et="".concat(Fe,"-option"),it=m()(Fe,Et,mt,(se={},Object(L.a)(se,"".concat(Et,"-grouped"),ae),Object(L.a)(se,"".concat(Et,"-active"),ze===ne&&!xe),Object(L.a)(se,"".concat(Et,"-disabled"),xe),Object(L.a)(se,"".concat(Et,"-selected"),ht),se)),ve=Te?It:me,Me=!re||typeof re=="function"||ht;return P.createElement("div",Object.assign({},Qt,{"aria-selected":ht,className:it,title:ct,onMouseMove:function(){if(ze===ne||xe)return;vt(ne)},onClick:function(){xe||Rt(De)},style:un}),P.createElement("div",{className:"".concat(Et,"-content")},ve||De),P.isValidElement(re)||ht,Me&&P.createElement(a.a,{className:"".concat(Fe,"-option-state"),customizeIcon:re,customizeIconProps:{isSelected:ht}},ht?"\u2713":null))}))},c=P.forwardRef(o);c.displayName="OptionList";var s=c,i=function(){return null};i.isSelectOption=!0;var n=i,O=function(){return null};O.isSelectOptGroup=!0;var S=O,C=D("VTBJ"),R=D("Zm9Q");function T(w){var Y=w.key,q=w.props,ce=q.children,Ee=q.value,Qe=Object(W.a)(q,["children","value"]);return Object(C.a)({key:Y,value:Ee!==void 0?Ee:Y,children:ce},Qe)}function v(w){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(w).map(function(q,ce){if(!P.isValidElement(q)||!q.type)return null;var Ee=q.type.isSelectOptGroup,Qe=q.key,Te=q.props,We=Te.children,$e=Object(W.a)(Te,["children"]);return Y||!Ee?T(q):Object(C.a)(Object(C.a)({key:"__RC_SELECT_GRP__".concat(Qe===null?ce:Qe,"__"),label:Qe},$e),{},{options:v(We)})}).filter(function(q){return q})}var b=D("2Qr1"),f=D("qNPg"),h=D("U8pU"),_=D("Kwbf"),g=D("WKfj");function x(w){var Y=w.mode,q=w.options,ce=w.children,Ee=w.backfill,Qe=w.allowClear,Te=w.placeholder,We=w.getInputElement,$e=w.showSearch,Je=w.onSearch,Ce=w.defaultOpen,X=w.autoFocus,j=w.labelInValue,K=w.value,Q=w.inputValue,re=w.optionLabelProp,z=Y==="multiple"||Y==="tags",we=$e!==void 0?$e:z||Y==="combobox",Ue=q||v(ce);if(Object(_.a)(Y!=="tags"||Ue.every(function(Fe){return!Fe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var rt=Ue.some(function(Fe){return Fe.options?Fe.options.some(function(Ye){return typeof("value"in Ye?Ye.value:Ye.key)=="number"}):typeof("value"in Fe?Fe.value:Fe.key)=="number"});Object(_.a)(!rt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(_.a)(Y!=="combobox"||!re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(_.a)(Y==="combobox"||!Ee,"`backfill` only works with `combobox` mode."),Object(_.a)(Y==="combobox"||!We,"`getInputElement` only work with `combobox` mode."),Object(_.b)(Y!=="combobox"||!We||!Qe||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Je&&!we&&Y!=="combobox"&&Y!=="tags"&&Object(_.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(_.b)(!Ce||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),K!=null){var le=Object(g.d)(K);Object(_.a)(!j||le.every(function(Fe){return Object(h.a)(Fe)==="object"&&("key"in Fe||"value"in Fe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(_.a)(!z||Array.isArray(K),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var Oe=null;Object(R.a)(ce).some(function(Fe){if(!P.isValidElement(Fe)||!Fe.type)return!1;var Ye=Fe.type;if(Ye.isSelectOption)return!1;if(Ye.isSelectOptGroup){var Tt=Object(R.a)(Fe.props.children).every(function(Nt){return!P.isValidElement(Nt)||!Fe.type||Nt.type.isSelectOption?!0:(Oe=Nt.type,!1)});return!Tt}return Oe=Ye,!0}),Oe&&Object(_.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Oe.displayName||Oe.name||Oe,"`.")),Object(_.a)(Q===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=x,F=Object(f.a)({prefixCls:"rc-select",components:{optionList:s},convertChildrenToData:v,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:N,fillOptionsWithMissingValue:b.a}),A=function(w){Object(I.a)(q,w);var Y=Object(G.a)(q);function q(){var ce;return Object(Z.a)(this,q),ce=Y.apply(this,arguments),ce.selectRef=P.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(V.a)(q,[{key:"render",value:function(){return P.createElement(F,Object.assign({ref:this.selectRef},this.props))}}]),q}(P.Component);A.Option=n,A.OptGroup=S;var B=A,U=_e.c=B},M8RZ:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return r});var Z=D("fWQN"),V=D("mtLc"),I=D("yKVA"),G=D("879j"),P=D("q1tI"),L=D.n(P),W=D("i8i4"),k=D.n(W),r=function(M){Object(I.a)(p,M);var E=Object(G.a)(p);function p(m){var u;Object(Z.a)(this,p),u=E.call(this,m);var a=window.document;return u.node=a.createElement("div"),a.body.appendChild(u.node),u}return Object(V.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(W.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(L.a.Component)},MI8n:function(jt,_e,D){"use strict";D.d(_e,"c",function(){return P}),D.d(_e,"b",function(){return r}),D.d(_e,"e",function(){return M}),D.d(_e,"a",function(){return E}),D.d(_e,"d",function(){return p}),D.d(_e,"f",function(){return m});var Z=D("/cxE"),V=D("pmY6"),I=D("24hK"),G=D("5Y4S"),P;(function(u){u.None=()=>V.a.None;function a(x){return(N,F=null,A)=>{let B=!1,U;return U=x(w=>B?void 0:(U?U.dispose():B=!0,N.call(F,w)),null,A),B&&U.dispose(),U}}u.once=a;function o(x,N){return S((F,A=null,B)=>x(U=>F.call(A,N(U)),null,B))}u.map=o;function c(x,N){return S((F,A=null,B)=>x(U=>{N(U),F.call(A,U)},null,B))}u.forEach=c;function s(x,N){return S((F,A=null,B)=>x(U=>N(U)&&F.call(A,U),null,B))}u.filter=s;function i(x){return x}u.signal=i;function n(...x){return(N,F=null,A)=>Object(V.e)(...x.map(B=>B(U=>N.call(F,U),null,A)))}u.any=n;function O(x,N,F){let A=F;return o(x,B=>(A=N(A,B),A))}u.reduce=O;function S(x){let N;const F=new r({onFirstListenerAdd(){N=x(F.fire,F)},onLastListenerRemove(){N.dispose()}});return F.event}function C(x,N,F=100,A=!1,B){let U,w,Y,q=0;const ce=new r({leakWarningThreshold:B,onFirstListenerAdd(){U=x(Ee=>{q++,w=N(w,Ee),A&&!Y&&(ce.fire(w),w=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Qe=w;w=void 0,Y=void 0,(!A||q>1)&&ce.fire(Qe),q=0},F)})},onLastListenerRemove(){U.dispose()}});return ce.event}u.debounce=C;function R(x,N=(F,A)=>F===A){let F=!0,A;return s(x,B=>{const U=F||!N(B,A);return F=!1,A=B,U})}u.latch=R;function T(x,N){return[u.filter(x,N),u.filter(x,F=>!N(F))]}u.split=T;function v(x,N=!1,F=[]){let A=F.slice(),B=x(Y=>{A?A.push(Y):w.fire(Y)});const U=()=>{A&&A.forEach(Y=>w.fire(Y)),A=null},w=new r({onFirstListenerAdd(){B||(B=x(Y=>w.fire(Y)))},onFirstListenerDidAdd(){A&&(N?setTimeout(U):U())},onLastListenerRemove(){B&&B.dispose(),B=null}});return w.event}u.buffer=v;class b{constructor(x){this.event=x}map(x){return new b(o(this.event,x))}forEach(x){return new b(c(this.event,x))}filter(x){return new b(s(this.event,x))}reduce(x,N){return new b(O(this.event,x,N))}latch(){return new b(R(this.event))}debounce(x,N=100,F=!1,A){return new b(C(this.event,x,N,F,A))}on(x,N,F){return this.event(x,N,F)}once(x,N,F){return a(this.event)(x,N,F)}}function f(x){return new b(x)}u.chain=f;function h(x,N,F=A=>A){const A=(...Y)=>w.fire(F(...Y)),B=()=>x.on(N,A),U=()=>x.removeListener(N,A),w=new r({onFirstListenerAdd:B,onLastListenerRemove:U});return w.event}u.fromNodeEventEmitter=h;function _(x,N,F=A=>A){const A=(...Y)=>w.fire(F(...Y)),B=()=>x.addEventListener(N,A),U=()=>x.removeEventListener(N,A),w=new r({onFirstListenerAdd:B,onLastListenerRemove:U});return w.event}u.fromDOMEventEmitter=_;function g(x){return new Promise(N=>a(x)(N))}u.toPromise=g})(P||(P={}));class L{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${L._idPool++}`}start(u){this._stopWatch=new G.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}L._idPool=0;let W=-1;class k{constructor(u,a=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let a=W;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||u<a)return;this._stacks||(this._stacks=new Map);const o=new Error().stack.split(`
`).slice(3).join(`
`),c=this._stacks.get(o)||0;if(this._stacks.set(o,c+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.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 ${u} listeners already. MOST frequent listener (${i}):`),console.warn(s)}return()=>{const s=this._stacks.get(o)||0;this._stacks.set(o,s-1)}}}class r{constructor(u){var a;this._disposed=!1,this._options=u,this._leakageMon=W>0?new k(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new L(this._options._profName):void 0}get event(){return this._event||(this._event=(u,a,o)=>{var c;this._listeners||(this._listeners=new I.a);const s=this._listeners.isEmpty();s&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(a?[u,a]:u);s&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,a);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 S=this._listeners&&!this._listeners.isEmpty();S||this._options.onLastListenerRemove(this)}});return o instanceof V.b?o.add(O):Array.isArray(o)&&o.push(O),O}),this._event}fire(u){var a,o;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new I.a);for(let c of this._listeners)this._deliveryQueue.push([c,u]);for((a=this._perfMon)===null||a===void 0||a.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)}}(o=this._perfMon)===null||o===void 0||o.stop()}}dispose(){var u,a,o,c,s;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(c=(o=this._options)===null||o===void 0?void 0:o.onLastListenerRemove)===null||c===void 0||c.call(o),(s=this._leakageMon)===null||s===void 0||s.dispose())}}class M extends r{constructor(u){super(u);this._isPaused=0,this._eventQueue=new I.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class E extends M{constructor(u){var a;super(u);this._delay=(a=u.delay)!==null&&a!==void 0?a:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class p{constructor(){this.buffers=[]}wrapEvent(u){return(a,o,c)=>u(s=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>a.call(o,s)):a.call(o,s)},void 0,c)}bufferEvents(u){const a=[];this.buffers.push(a);const o=u();return this.buffers.pop(),a.forEach(c=>c()),o}}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(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(jt,_e,D){"use strict";(function(Z,V){D.d(_e,"b",function(){return o}),D.d(_e,"i",function(){return n}),D.d(_e,"f",function(){return O}),D.d(_e,"d",function(){return S}),D.d(_e,"g",function(){return C}),D.d(_e,"h",function(){return R}),D.d(_e,"c",function(){return T}),D.d(_e,"k",function(){return v}),D.d(_e,"j",function(){return b}),D.d(_e,"a",function(){return f}),D.d(_e,"e",function(){return g});var I;const G="en";let P=!1,L=!1,W=!1,k=!1,r=!1,M=!1,E=!1,p,m=G,u,a;const o=typeof self=="object"?self:typeof Z=="object"?Z:{};let c;typeof o.vscode!="undefined"&&typeof o.vscode.process!="undefined"?c=o.vscode.process:typeof V!="undefined"&&(c=V);const s=typeof((I=c==null?void 0:c.versions)===null||I===void 0?void 0:I.electron)=="string"&&c.type==="renderer";if(typeof navigator=="object"&&!s)a=navigator.userAgent,P=a.indexOf("Windows")>=0,L=a.indexOf("Macintosh")>=0,E=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,W=a.indexOf("Linux")>=0,M=!0,p=navigator.language,m=p;else if(typeof c=="object"){P=c.platform==="win32",L=c.platform==="darwin",W=c.platform==="linux",k=W&&!!c.env.SNAP&&!!c.env.SNAP_REVISION,p=G,m=G;const x=c.env.VSCODE_NLS_CONFIG;if(x)try{const N=JSON.parse(x),F=N.availableLanguages["*"];p=N.locale,m=F||G,u=N._translationsConfigFile}catch(N){}r=!0}else console.error("Unable to resolve platform.");let i=0;L?i=1:P?i=3:W&&(i=2);const n=P,O=L,S=W,C=r,R=M,T=E,v=a,b=function(){if(o.setImmediate)return o.setImmediate.bind(o);if(typeof o.postMessage=="function"&&!o.importScripts){let F=[];o.addEventListener("message",B=>{if(B.data&&B.data.vscodeSetImmediateId)for(let U=0,w=F.length;U<w;U++){const Y=F[U];if(Y.id===B.data.vscodeSetImmediateId){F.splice(U,1),Y.callback();return}}});let A=0;return B=>{const U=++A;F.push({id:U,callback:B}),o.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(c==null?void 0:c.nextTick)=="function")return c.nextTick.bind(c);const N=Promise.resolve();return F=>N.then(F)}(),f=L||E?2:P?1:3;let h=!0,_=!1;function g(){if(!_){_=!0;const x=new Uint8Array(2);x[0]=1,x[1]=2;const N=new Uint16Array(x.buffer);h=N[0]===(2<<8)+1}return h}}).call(this,D("IyRk"),D("Q2Ig"))},N0LK:function(jt,_e,D){"use strict";D.d(_e,"C",function(){return Z}),D.d(_e,"v",function(){return I}),D.d(_e,"s",function(){return G}),D.d(_e,"t",function(){return P}),D.d(_e,"U",function(){return L}),D.d(_e,"J",function(){return W}),D.d(_e,"O",function(){return k}),D.d(_e,"p",function(){return r}),D.d(_e,"T",function(){return M}),D.d(_e,"q",function(){return E}),D.d(_e,"N",function(){return p}),D.d(_e,"M",function(){return m}),D.d(_e,"Q",function(){return u}),D.d(_e,"u",function(){return a}),D.d(_e,"x",function(){return o}),D.d(_e,"I",function(){return c}),D.d(_e,"f",function(){return s}),D.d(_e,"h",function(){return i}),D.d(_e,"g",function(){return n}),D.d(_e,"i",function(){return O}),D.d(_e,"G",function(){return S}),D.d(_e,"H",function(){return C}),D.d(_e,"r",function(){return R}),D.d(_e,"R",function(){return T}),D.d(_e,"d",function(){return v}),D.d(_e,"e",function(){return b}),D.d(_e,"E",function(){return f}),D.d(_e,"F",function(){return h}),D.d(_e,"j",function(){return _}),D.d(_e,"z",function(){return g}),D.d(_e,"K",function(){return N}),D.d(_e,"L",function(){return F}),D.d(_e,"m",function(){return B}),D.d(_e,"k",function(){return w}),D.d(_e,"A",function(){return q}),D.d(_e,"a",function(){return ce}),D.d(_e,"n",function(){return Ee}),D.d(_e,"l",function(){return Qe}),D.d(_e,"D",function(){return Te}),D.d(_e,"B",function(){return We}),D.d(_e,"b",function(){return $e}),D.d(_e,"S",function(){return Je}),D.d(_e,"o",function(){return Ce}),D.d(_e,"P",function(){return X}),D.d(_e,"w",function(){return j}),D.d(_e,"c",function(){return K}),D.d(_e,"y",function(){return z});function Z(le){return!le||typeof le!="string"?!0:le.trim().length===0}const V=/{(\d+)}/g;function I(le,...Oe){return Oe.length===0?le:le.replace(V,function(Fe,Ye){const Tt=parseInt(Ye,10);return isNaN(Tt)||Tt<0||Tt>=Oe.length?Fe:Oe[Tt]})}function G(le){return le.replace(/[<>&]/g,function(Oe){switch(Oe){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Oe}})}function P(le){return le.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function L(le,Oe=" "){const Fe=W(le,Oe);return k(Fe,Oe)}function W(le,Oe){if(!le||!Oe)return le;const Fe=Oe.length;if(Fe===0||le.length===0)return le;let Ye=0;for(;le.indexOf(Oe,Ye)===Ye;)Ye=Ye+Fe;return le.substring(Ye)}function k(le,Oe){if(!le||!Oe)return le;const Fe=Oe.length,Ye=le.length;if(Fe===0||Ye===0)return le;let Tt=Ye,Nt=-1;for(;!(Nt=le.lastIndexOf(Oe,Tt-1),Nt===-1||Nt+Fe!==Tt);){if(Nt===0)return"";Tt=Nt}return le.substring(0,Tt)}function r(le){return le.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function M(le){return le.replace(/\*/g,"")}function E(le,Oe,Fe={}){if(!le)throw new Error("Cannot create regex from empty string");Oe||(le=P(le)),Fe.wholeWord&&(/\B/.test(le.charAt(0))||(le="\\b"+le),/\B/.test(le.charAt(le.length-1))||(le=le+"\\b"));let Ye="";return Fe.global&&(Ye+="g"),Fe.matchCase||(Ye+="i"),Fe.multiline&&(Ye+="m"),Fe.unicode&&(Ye+="u"),new RegExp(le,Ye)}function p(le){if(le.source==="^"||le.source==="^$"||le.source==="$"||le.source==="^\\s*$")return!1;const Oe=le.exec("");return!!(Oe&&le.lastIndex===0)}function m(le){return(le.global?"g":"")+(le.ignoreCase?"i":"")+(le.multiline?"m":"")+(le.unicode?"u":"")}function u(le){return le.split(/\r\n|\r|\n/)}function a(le){for(let Oe=0,Fe=le.length;Oe<Fe;Oe++){const Ye=le.charCodeAt(Oe);if(Ye!==32&&Ye!==9)return Oe}return-1}function o(le,Oe=0,Fe=le.length){for(let Ye=Oe;Ye<Fe;Ye++){const Tt=le.charCodeAt(Ye);if(Tt!==32&&Tt!==9)return le.substring(Oe,Ye)}return le.substring(Oe,Fe)}function c(le,Oe=le.length-1){for(let Fe=Oe;Fe>=0;Fe--){const Ye=le.charCodeAt(Fe);if(Ye!==32&&Ye!==9)return Fe}return-1}function s(le,Oe){return le<Oe?-1:le>Oe?1:0}function i(le,Oe,Fe=0,Ye=le.length,Tt=0,Nt=Oe.length){for(;Fe<Ye&&Tt<Nt;Fe++,Tt++){let Zt=le.charCodeAt(Fe),vn=Oe.charCodeAt(Tt);if(Zt<vn)return-1;if(Zt>vn)return 1}const Xt=Ye-Fe,tt=Nt-Tt;return Xt<tt?-1:Xt>tt?1:0}function n(le,Oe){return O(le,Oe,0,le.length,0,Oe.length)}function O(le,Oe,Fe=0,Ye=le.length,Tt=0,Nt=Oe.length){for(;Fe<Ye&&Tt<Nt;Fe++,Tt++){let Zt=le.charCodeAt(Fe),vn=Oe.charCodeAt(Tt);if(Zt===vn)continue;if(Zt>=128||vn>=128)return i(le.toLowerCase(),Oe.toLowerCase(),Fe,Ye,Tt,Nt);S(Zt)&&(Zt-=32),S(vn)&&(vn-=32);const ze=Zt-vn;if(ze===0)continue;return ze}const Xt=Ye-Fe,tt=Nt-Tt;return Xt<tt?-1:Xt>tt?1:0}function S(le){return le>=97&&le<=122}function C(le){return le>=65&&le<=90}function R(le,Oe){return le.length===Oe.length&&O(le,Oe)===0}function T(le,Oe){const Fe=Oe.length;return Oe.length>le.length?!1:O(le,Oe,0,Fe)===0}function v(le,Oe){let Fe,Ye=Math.min(le.length,Oe.length);for(Fe=0;Fe<Ye;Fe++)if(le.charCodeAt(Fe)!==Oe.charCodeAt(Fe))return Fe;return Ye}function b(le,Oe){let Fe,Ye=Math.min(le.length,Oe.length);const Tt=le.length-1,Nt=Oe.length-1;for(Fe=0;Fe<Ye;Fe++)if(le.charCodeAt(Tt-Fe)!==Oe.charCodeAt(Nt-Fe))return Fe;return Ye}function f(le){return 55296<=le&&le<=56319}function h(le){return 56320<=le&&le<=57343}function _(le,Oe){return(le-55296<<10)+(Oe-56320)+65536}function g(le,Oe,Fe){const Ye=le.charCodeAt(Fe);if(f(Ye)&&Fe+1<Oe){const Tt=le.charCodeAt(Fe+1);if(h(Tt))return _(Ye,Tt)}return Ye}function x(le,Oe){const Fe=le.charCodeAt(Oe-1);if(h(Fe)&&Oe>1){const Ye=le.charCodeAt(Oe-2);if(f(Ye))return _(Ye,Fe)}return Fe}function N(le,Oe){const Fe=Q.getInstance(),Ye=Oe,Tt=le.length,Nt=g(le,Tt,Oe);Oe+=Nt>=65536?2:1;let Xt=Fe.getGraphemeBreakType(Nt);for(;Oe<Tt;){const tt=g(le,Tt,Oe),Zt=Fe.getGraphemeBreakType(tt);if(K(Xt,Zt))break;Oe+=tt>=65536?2:1,Xt=Zt}return Oe-Ye}function F(le,Oe){const Fe=Q.getInstance(),Ye=Oe,Tt=x(le,Oe);Oe-=Tt>=65536?2:1;let Nt=Fe.getGraphemeBreakType(Tt);for(;Oe>0;){const Xt=x(le,Oe),tt=Fe.getGraphemeBreakType(Xt);if(K(tt,Nt))break;Oe-=Xt>=65536?2:1,Nt=tt}return Ye-Oe}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 B(le){return A.test(le)}const U=/(?:[\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 w(le){return U.test(le)}const Y=/^[\t\n\r\x20-\x7E]*$/;function q(le){return Y.test(le)}const ce=/[\u2028\u2029]/;function Ee(le){return ce.test(le)}function Qe(le){for(let Oe=0,Fe=le.length;Oe<Fe;Oe++)if(Te(le.charCodeAt(Oe)))return!0;return!1}function Te(le){return le=+le,le>=11904&&le<=55215||le>=63744&&le<=64255||le>=65281&&le<=65374}function We(le){return le>=127462&&le<=127487||le===8986||le===8987||le===9200||le===9203||le>=9728&&le<=10175||le===11088||le===11093||le>=127744&&le<=128591||le>=128640&&le<=128764||le>=128992&&le<=129003||le>=129280&&le<=129535||le>=129648&&le<=129750}const $e=String.fromCharCode(65279);function Je(le){return!!(le&&le.length>0&&le.charCodeAt(0)===65279)}function Ce(le,Oe=!1){return le?(Oe&&(le=le.replace(/\\./g,"")),le.toLowerCase()!==le):!1}function X(le){const Oe=90-65+1;return le=le%(2*Oe),le<Oe?String.fromCharCode(97+le):String.fromCharCode(65+le-Oe)}function j(le){const Oe=Q.getInstance();return Oe.getGraphemeBreakType(le)}function K(le,Oe){return le===0?Oe!==5&&Oe!==7:le===2&&Oe===3?!1:le===4||le===2||le===3||(Oe===4||Oe===2||Oe===3)?!0:le===8&&(Oe===8||Oe===9||Oe===11||Oe===12)||((le===11||le===9)&&(Oe===9||Oe===10)||((le===12||le===10)&&Oe===10||(Oe===5||Oe===13||(Oe===7||(le===1||le===13&&Oe===14)))))?!1:!(le===6&&Oe===6)}class Q{constructor(){this._data=re()}static getInstance(){return Q._INSTANCE||(Q._INSTANCE=new Q),Q._INSTANCE}getGraphemeBreakType(le){if(le<32)return le===10?3:le===13?2:4;if(le<127)return 0;const Oe=this._data,Fe=Oe.length/3;let Ye=1;for(;Ye<=Fe;)if(le<Oe[3*Ye])Ye=2*Ye;else if(le>Oe[3*Ye+1])Ye=2*Ye+1;else return Oe[3*Ye+2];return 0}}Q._INSTANCE=null;function re(){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 z(le,Oe){if(le===0)return 0;const Fe=we(le,Oe);if(Fe!==void 0)return Fe;const Ye=x(Oe,le);return le-=Ue(Ye),le}function we(le,Oe){let Fe=x(Oe,le);for(le-=Ue(Fe);rt(Fe)||Fe===65039||Fe===8419;){if(le===0)return;Fe=x(Oe,le),le-=Ue(Fe)}if(!We(Fe))return;if(le>=0){const Ye=x(Oe,le);Ye===8205&&(le-=Ue(Ye))}return le}function Ue(le){return le>=65536?2:1}function rt(le){return 127995<=le&&le<=127999}},NLgs:function(jt,_e,D){"use strict";D.d(_e,"e",function(){return c}),D.d(_e,"f",function(){return s}),D.d(_e,"d",function(){return n}),D.d(_e,"c",function(){return O}),D.d(_e,"a",function(){return S}),D.d(_e,"b",function(){return C});var Z=D("miYZ"),V=D("tsqr"),I=D("9og8"),G=D("2qtc"),P=D("kLXV"),L=D("WmNS"),W=D.n(L),k=D("q1tI"),r=D.n(k),M=D("9kvl"),E=D("xKgJ"),p=D("1vsH"),m=D("RCxd"),u=D("yTi+"),a=D.n(u),o=D("m3rI"),c=function(T){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(s(T)&&i(v))},s=function(T){return Object(E.p)()?!0:(T({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},i=function(){var T,v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=Object(M.c)()._store.getState(),f=b.user;return(T=f.userInfo)!==null&&T!==void 0&&T.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 T,v=Object(M.c)()._store.getState(),b=v.user;return(T=b.userInfo)!==null&&T!==void 0&&T.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(p.S)("/account/certification")}}),!1)},O=function(){var T;if(Object(E.a)())return!0;var v=Object(M.c)()._store.getState(),b=v.user,f=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:o.a.IMG_SERVER+(f==null||((T=f.setting)===null||T===void 0)?void 0:T.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},S=function(T,v){var b;if(T)return!0;var f=Object(M.c)()._store.getState(),h=f.user,_=f.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:o.a.IMG_SERVER+(_==null||((b=_.setting)===null||b===void 0)?void 0:b.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(p.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},C=function(T){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",b=Object(M.c)()._store.getState(),f=b.shixunsDetail.detail;return(f==null?void 0:f.public)===2||(f==null?void 0:f.public)===1||(f==null?void 0:f.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",(f==null?void 0:f.public)===2?"\u5DF2\u516C\u5F00":(f==null?void 0:f.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:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(f==null?void 0:f.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(I.a)(W.a.mark(function x(){var N;return W.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,T({type:"shixunsDetail/cancelRelease",payload:{id:f==null?void 0:f.identifier}});case 2:N=A.sent,N.status!==401&&(V.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),T({type:"shixunsDetail/getShixunsDetail",payload:{id:f==null?void 0:f.identifier}}),T({type:"practiceSetting/getCommonData",payload:{id:f==null?void 0:f.identifier}}));case 4:case"end":return A.stop()}},x)}));function g(){return _.apply(this,arguments)}return g}()})}}),!0):!1}},Nd3P:function(jt,_e,D){jt.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(jt,_e,D){"use strict";D.d(_e,"a",function(){return L});var Z=D("Kwbf");function V(W,k){var r=new Set;return W.forEach(function(M){k.has(M)||r.add(M)}),r}function I(W){var k=W||{},r=k.disabled,M=k.disableCheckbox,E=k.checkable;return!!(r||M)||E===!1}function G(W,k,r,M){for(var E=new Set(W),p=new Set,m=0;m<=r;m+=1){var u=k.get(m)||new Set;u.forEach(function(s){var i=s.key,n=s.node,O=s.children,S=O===void 0?[]:O;E.has(i)&&!M(n)&&S.filter(function(C){return!M(C.node)}).forEach(function(C){E.add(C.key)})})}for(var a=new Set,o=r;o>=0;o-=1){var c=k.get(o)||new Set;c.forEach(function(s){var i=s.parent,n=s.node;if(M(n)||!s.parent||a.has(s.parent.key))return;if(M(s.parent.node)){a.add(i.key);return}var O=!0,S=!1;(i.children||[]).filter(function(C){return!M(C.node)}).forEach(function(C){var R=C.key,T=E.has(R);O&&!T&&(O=!1),!S&&(T||p.has(R))&&(S=!0)}),O&&E.add(i.key),S&&p.add(i.key),a.add(i.key)})}return{checkedKeys:Array.from(E),halfCheckedKeys:Array.from(V(p,E))}}function P(W,k,r,M,E){for(var p=new Set(W),m=new Set(k),u=0;u<=M;u+=1){var a=r.get(u)||new Set;a.forEach(function(i){var n=i.key,O=i.node,S=i.children,C=S===void 0?[]:S;!p.has(n)&&!m.has(n)&&!E(O)&&C.filter(function(R){return!E(R.node)}).forEach(function(R){p.delete(R.key)})})}m=new Set;for(var o=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(E(O)||!i.parent||o.has(i.parent.key))return;if(E(i.parent.node)){o.add(n.key);return}var S=!0,C=!1;(n.children||[]).filter(function(R){return!E(R.node)}).forEach(function(R){var T=R.key,v=p.has(T);S&&!v&&(S=!1),!C&&(v||m.has(T))&&(C=!0)}),S||p.delete(n.key),C&&m.add(n.key),o.add(n.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(V(m,p))}}function L(W,k,r,M){var E=[],p;M?p=M:p=I;var m=new Set(W.filter(function(c){var s=!!r[c];return s||E.push(c),s})),u=new Map,a=0;Object.keys(r).forEach(function(c){var s=r[c],i=s.level,n=u.get(i);n||(n=new Set,u.set(i,n)),n.add(s),a=Math.max(a,i)}),Object(Z.a)(!E.length,"Tree missing follow keys: ".concat(E.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var o;return k===!0?o=G(m,u,a,p):o=P(m,k.halfCheckedKeys,u,a,p),o}},OH33:function(jt,_e,D){"use strict";D.r(_e);var Z=D("g9YV"),V=D("wCAj"),I=D("Znn+"),G=D("ZTPi"),P=D("5Dmo"),L=D("3S7+"),W=D("sPJy"),k=D("bE4q"),r=D("+L6B"),M=D("2/Rp"),E=D("miYZ"),p=D("tsqr"),m=D("9og8"),u=D("2qtc"),a=D("kLXV"),o=D("tJVT"),c=D("WmNS"),s=D.n(c),i=D("q1tI"),n=D.n(i),O=D("ErOA"),S=D("Ty5D"),C=D("55Ip"),R=D("9kvl"),T=D("jhfD"),v=D("1vsH"),b=D("T2oS"),f=D("W9HT"),h=D("DjyN"),_=D("NUBc"),g=D("k1fw"),x=D("9Bee"),N=function(fn){var Tn=fn.shixunHomeworks,mn=fn.dispatch,er=Object(S.i)();return n.a.createElement(a.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 rr(){var J;return s.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return Re.next=2,mn({type:"shixunHomeworks/deleteReply",payload:{object_id:Tn.actionTabs.selectArr.id,object_type:"journals_for_message"}});case 2:J=Re.sent,J.status===0&&(p.b.success("\u5220\u9664\u6210\u529F"),mn({type:"shixunHomeworks/setActionTabs",payload:{}}),mn({type:"shixunHomeworks/getReplyList",payload:Object(g.a)({},Tn.actionTabs.params)}));case 4:case"end":return Re.stop()}},rr)})),onCancel:function(){mn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement("p",null,"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"))},F=Object(R.a)(function(kn){var fn=kn.shixunHomeworks;return{shixunHomeworks:fn}})(N),A=D("wd/R"),B=D.n(A),U=D("iF7n"),w=D.n(U),Y=D("xKgJ"),q=D("BdwD");B.a.lang("ZH-cn");var ce=["","\u7B80\u5355","\u4E2D\u7B49","\u56F0\u96BE"],Ee=function(fn){var Tn,mn,er=fn.shixunHomeworks,rr=fn.classroomList,J=fn.globalSetting,ge=fn.user,Re=fn.loading,Ae=fn.dispatch,at=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(S.i)()),{},{per_page:10})),Be=Object(o.a)(at,2),nt=Be[0],yt=Be[1],Mt=Object(i.useState)([]),kt=Object(o.a)(Mt,2),Ge=kt[0],xt=kt[1],ot=Object(i.useState)(-1),ut=Object(o.a)(ot,2),bt=ut[0],Dt=ut[1],pt=Object(i.useState)(""),Kt=Object(o.a)(pt,2),nn=Kt[0],wn=Kt[1],In=Object(i.useState)(""),yn=Object(o.a)(In,2),On=yn[0],Cn=yn[1],Ot=rr.detailLeftMenus,rn=Object(S.h)(),Ut=Object(i.useState)({}),wt=Object(o.a)(Ut,2),Rn=wt[0],bn=wt[1],Wt=er.workDetail,dt=er.workList,An=Object(i.useState)("1"),an=Object(o.a)(An,2),Kn=an[0],zt=an[1],En=Object(i.useState)(!1),Ln=Object(o.a)(En,2),cn=Ln[0],dr=Ln[1];Object(i.useEffect)(function(){dt.homework_status&&xn()},[dt]);function xn(){return gn.apply(this,arguments)}function gn(){return gn=Object(m.a)(s.a.mark(function Ct(){var Ze,Lt,At;return s.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return dr(!0),Nn.next=3,Object(O.a)("/api/courses/".concat(nt.coursesId,"/homework_commons/edit_hack_homework.json"),{method:"get",params:Object(g.a)(Object(g.a)({},nt),{},{id:nt.categoryId})});case 3:At=Nn.sent,xt(At),dr(!1),nt.defaultExpandedRowKeys=["".concat(At==null||((Ze=At.data)===null||Ze===void 0||((Lt=Ze[0])===null||Lt===void 0))?void 0:Lt.identifier)],Kn!="2"&&zt(At!=null&&At.description?"1":"2"),yt(Object(g.a)({},nt));case 9:case"end":return Nn.stop()}},Ct)})),gn.apply(this,arguments)}return n.a.createElement("section",{className:w.a.bg},n.a.createElement(f.a,{spinning:cn},n.a.createElement(G.a,{onChange:function(Ze){zt(Ze)},activeKey:Kn},n.a.createElement(G.a.TabPane,{key:1,tab:"\u8BF4\u660E"},n.a.createElement("section",{className:" edu-container",style:{padding:"20px 20px",background:"#fff"}},!(Ge!=null&&Ge.description)&&n.a.createElement(q.a,{customText:"\u6682\u65E0\u8BF4\u660E"}),n.a.createElement(x.a,{value:(Ge==null?void 0:Ge.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"}},nt.defaultExpandedRowKeys&&n.a.createElement(V.a,{dataSource:Ge==null?void 0:Ge.data,rowKey:function(Ze){return Ze==null?void 0:Ze.identifier},pagination:!1,expandable:{expandedRowRender:function(Ze){var Lt,At;return n.a.createElement("div",{style:{padding:"10px 48px",borderRadius:2}},n.a.createElement("p",null,"\u9898\u76EE\uFF1A",Ze==null?void 0:Ze.name),n.a.createElement("p",null,"\u63CF\u8FF0\uFF1A",Ze==null?void 0:Ze.description),n.a.createElement("div",{style:{width:"100%",textAlign:"end"}},Object(Y.c)()&&(Ge==null||((Lt=Ge.homework_status)===null||Lt===void 0)?void 0:Lt.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(M.a,{type:"primary",ghost:!0,onClick:function(){window.open("/problems/".concat(Ze==null?void 0:Ze.identifier,"/edit?type=1")),localStorage.setItem("program_homework",[nt.coursesId,nt.categoryId])}},"\u7F16\u8F91"),Object(Y.c)()&&(Ge==null||((At=Ge.homework_status)===null||At===void 0)?void 0:At.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(M.a,{type:"primary",style:{marginLeft:20},ghost:!0,onClick:function(){a.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Nn=Object(m.a)(s.a.mark(function Qn(){var zn;return s.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return sr.next=2,Object(O.a)("/api/problems/".concat(Ze==null?void 0:Ze.identifier,".json"),{method:"delete"});case 2:zn=sr.sent,(zn==null?void 0:zn.status)===0&&(p.b.info("\u5220\u9664\u6210\u529F"),nt.page=1,xn());case 4:case"end":return sr.stop()}},Qn)}));function Sn(){return Nn.apply(this,arguments)}return Sn}()})}},"\u5220\u9664")))},defaultExpandedRowKeys:nt.defaultExpandedRowKeys},columns:[{title:"\u9898\u76EE",dataIndex:"name",ellipsis:!0,width:"20%",key:"name"},{title:"\u96BE\u5EA6",dataIndex:"difficult",key:"difficult",render:function(Ze,Lt,At){return n.a.createElement("div",null,ce[Ze])}},{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(Ze,Lt,At){return n.a.createElement("div",null,n.a.createElement("a",{href:"/classrooms/".concat(nt.coursesId,"/program_homework/").concat(nt.categoryId,"/").concat(Ze,"/ranking")},"\u6392\u884C"),n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function en(){var Nn;return s.a.wrap(function(Qn){for(;;)switch(Qn.prev=Qn.next){case 0:return Qn.next=2,Object(O.a)("/api/problems/".concat(Lt==null?void 0:Lt.identifier,"/start.json"),{method:"get"});case 2:Nn=Qn.sent,Nn&&(window.open("/myproblems/".concat(Nn==null?void 0:Nn.identifier,"?type=1")),localStorage.setItem("program_homework",[nt.coursesId,nt.categoryId]));case 4:case"end":return Qn.stop()}},en)})),style:{margin:"0px 20px"}},Object(Y.c)()?"\u4F53\u9A8C":"\u8FDB\u5165\u7B54\u9898"))}}]})),console.log("---",["".concat(Ge==null||((Tn=Ge.data)===null||Tn===void 0||((mn=Tn[0])===null||mn===void 0))?void 0:mn.identifier)]),n.a.createElement("aside",{className:"tc mt30 pb30"},n.a.createElement(_.a,{defaultCurrent:1,total:Ge==null?void 0:Ge.count,hideOnSinglePage:!0,showTotal:function(Ze){return n.a.createElement("span",null,"\u5171",Ze,"\u6761")},current:nt.page||1,pageSize:nt.per_page||10,onChange:function(Ze,Lt){nt.page=Ze,nt.per_page=Lt,yt(Object(g.a)({},nt)),xn()}})))))),n.a.createElement(F,null))},Qe=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.classroomList,mn=kn.loading,er=kn.user,rr=kn.globalSetting;return{shixunHomeworks:fn,globalSetting:rr,classroomList:Tn,user:er,loading:mn.effects}})(Ee),Te=D("oBTY"),We=D("giR+"),$e=D("fyUT"),Je=D("7Kak"),Ce=D("9yH6"),X=D("qVdP"),j=D("jsC+"),K=D("5NDa"),Q=D("5rEg"),re=D("14J3"),z=D("BMrR"),we=D("sRBo"),Ue=D("kaz8"),rt=D("jCWc"),le=D("kPKH"),Oe=D("lUTK"),Fe=D("BvKs"),Ye=D("jrin"),Tt=D("y8nQ"),Nt=D("Vl3Y"),Xt=D("8Skl"),tt=D("y3Kf"),Zt=D("Llu2"),vn=D("0NbB"),ze=D("T7RX"),He=D("PpiC"),vt=D("IMoZ"),Rt=function(fn){var Tn=fn.shixunHomeworks,mn=fn.dispatch,er=Object(He.a)(fn,["shixunHomeworks","dispatch"]),rr=Object(S.i)(),J=Object(i.useState)(!0),ge=Object(o.a)(J,2),Re=ge[0],Ae=ge[1],at=Object(i.useState)(!1),Be=Object(o.a)(at,2),nt=Be[0],yt=Be[1],Mt=Nt.a.useForm(),kt=Object(o.a)(Mt,1),Ge=kt[0],xt=function(){var ot=Object(m.a)(s.a.mark(function ut(){var bt,Dt;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return bt=Ge.getFieldValue(),Kt.next=3,Object(O.a)("/api/homework_commons/".concat(rr.categoryId,"/batch_comment.json"),{method:"post",body:{student_work_ids:Object(Te.a)(Tn.actionTabs.selectArrs),cover_all:Re,hidden_comment:bt.hidden_comment,comment:bt.comment}});case 3:Dt=Kt.sent,Dt.status===0&&(p.b.success("\u8BC4\u9605\u6210\u529F"),Ge.resetFields(),mn({type:"shixunHomeworks/setActionTabs",payload:{}}),mn({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},Tn.actionTabs.params)}));case 5:case"end":return Kt.stop()}},ut)}));return function(){return ot.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.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 ot(){var ut;return s.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:ut=Ge.getFieldValue(),JSON.stringify(ut)==="{}"||ut.hidden_comment===""&&ut.comment===""?yt(!0):Tn.workList.partial_comment?mn({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4E00\u952E\u70B9\u8BC4\u786E\u8BA4",selectArrs:Tn.actionTabs.selectArrs,params:Tn.actionTabs.params}}):xt();case 2:case"end":return Dt.stop()}},ot)})),onCancel:function(){mn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Nt.a,{form:Ge,onChange:function(){nt&&yt(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Nt.a.Item,{name:"comment"},n.a.createElement(Q.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(Nt.a.Item,{name:"hidden_comment"},n.a.createElement(Q.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),nt&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")),n.a.createElement(a.a,{centered:!0,title:n.a.createElement("span",null,n.a.createElement(vt.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(){xt()},onCancel:function(){mn({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(Ce.a.Group,{onChange:function(ut){Ae(ut.target.value)},value:Re},n.a.createElement(Ce.a,{value:!0},"\u8986\u76D6\u5DF2\u6709\u70B9\u8BC4"),n.a.createElement(Ce.a,{value:!1},"\u8DF3\u8FC7\u5DF2\u6709\u70B9\u8BC4"))))))},de=Object(R.a)(function(kn){var fn=kn.shixunHomeworks;return{shixunHomeworks:fn}})(Rt),ee=D("XYT7"),ne=D("Nd3P"),se=D.n(ne),pe=function(fn){var Tn,mn,er,rr,J=fn.shixunHomeworks,ge=fn.dispatch,Re=Object(He.a)(fn,["shixunHomeworks","dispatch"]),Ae=Object(S.i)(),at=Object(i.useState)(!1),Be=Object(o.a)(at,2),nt=Be[0],yt=Be[1],Mt=Object(i.useState)((Tn=J.actionTabs.selectArrs)===null||Tn===void 0||((mn=Tn.data)===null||mn===void 0)?void 0:mn.name),kt=Object(o.a)(Mt,2),Ge=kt[0],xt=kt[1],ot=Nt.a.useForm(),ut=Object(o.a)(ot,1),bt=ut[0];Object(i.useEffect)(function(){var pt,Kt,nn,wn,In,yn;J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4"&&bt.setFieldsValue({comment:(pt=J.actionTabs.selectArrs)===null||pt===void 0||((Kt=pt.data)===null||Kt===void 0)?void 0:Kt.work_comment,hidden_comment:(nn=J.actionTabs.selectArrs)===null||nn===void 0||((wn=nn.data)===null||wn===void 0)?void 0:wn.work_comment_hidden}),xt((In=J.actionTabs.selectArrs)===null||In===void 0||((yn=In.data)===null||yn===void 0)?void 0:yn.name)},[J.actionTabs.key]);var Dt=function(){var pt=Object(m.a)(s.a.mark(function Kt(){var nn,wn,In,yn;return s.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return In=bt.getFieldValue(),Cn.next=3,Object(O.a)("/api/student_works/".concat((nn=J.actionTabs.selectArrs)===null||nn===void 0||((wn=nn.data)===null||wn===void 0)?void 0:wn.homeworkId,"/shixun_work_comment.json"),{method:"post",body:{hidden_comment:In.hidden_comment,comment:In.comment}});case 3:if(yn=Cn.sent,!(yn.status===0)){Cn.next=9;break}return p.b.success("\u8BC4\u9605\u6210\u529F"),bt.resetFields(),ge({type:"shixunHomeworks/setActionTabs",payload:{}}),Cn.abrupt("return",ge({type:"shixunHomeworks/getWorkList",payload:Ae}));case 9:case"end":return Cn.stop()}},Kt)}));return function(){return pt.apply(this,arguments)}}();return n.a.createElement(n.a.Fragment,null,n.a.createElement(a.a,{centered:!0,title:(er=J.actionTabs.selectArrs)!==null&&er!==void 0&&(rr=er.data)!==null&&rr!==void 0&&rr.work_comment_hidden?"\u66F4\u6539"+Ge+"\u70B9\u8BC4":Ge+"\u70B9\u8BC4",visible:J.actionTabs.key==="\u66F4\u6539\u70B9\u8BC4",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:Object(m.a)(s.a.mark(function pt(){var Kt;return s.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:Kt=bt.getFieldValue(),JSON.stringify(Kt)==="{}"||Kt.hidden_comment===""&&Kt.comment===""?yt(!0):Dt();case 2:case"end":return wn.stop()}},pt)})),onCancel:function(){ge({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(Nt.a,{form:bt,onChange:function(){nt&&yt(!1)}},n.a.createElement("p",null,"\u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),n.a.createElement(Nt.a.Item,{name:"comment"},n.a.createElement(Q.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(Nt.a.Item,{name:"hidden_comment"},n.a.createElement(Q.a.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u8BC4\u9605\u5185\u5BB9",rows:8}))),nt&&n.a.createElement("p",{className:"c-red"},"\u8BC4\u9605\u5185\u5BB9\u81F3\u5C11\u6709\u4E00\u4E2A\u4E0D\u4E3A\u7A7A")))},ae=Object(R.a)(function(kn){var fn=kn.shixunHomeworks;return{shixunHomeworks:fn}})(pe),ie=function(fn){var Tn=fn.shixunHomeworks,mn=fn.dispatch,er=Object(He.a)(fn,["shixunHomeworks","dispatch"]),rr=Object(S.i)(),J=Object(i.useState)([]),ge=Object(o.a)(J,2),Re=ge[0],Ae=ge[1],at=Object(i.useState)([]),Be=Object(o.a)(at,2),nt=Be[0],yt=Be[1];Object(i.useEffect)(function(){Tn.actionTabs.key==="\u8D28\u91CF\u68C0\u6D4B"&&Mt()},[Tn.actionTabs.key]);function Mt(){return kt.apply(this,arguments)}function kt(){return kt=Object(m.a)(s.a.mark(function xt(){var ot;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(O.a)("/api/homework_commons/".concat(rr.categoryId,"/code_quality_analyses/group_list.json"),{method:"GET",params:{page:1,limit:200}});case 2:ot=bt.sent,Ae(ot);case 4:case"end":return bt.stop()}},xt)})),kt.apply(this,arguments)}var Ge=[{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(a.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 xt(){var ot;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(O.a)("/api/homework_commons/".concat(rr.categoryId,"/code_quality_analyses.json"),{method:"POST",body:{group_ids:nt}});case 2:ot=bt.sent,(ot==null?void 0:ot.status)===0&&(R.d.replace("/classrooms/".concat(rr.coursesId,"/shixun_homework/").concat(rr.categoryId,"/detail?tabs=4")),window.location.reload(),mn({type:"shixunHomeworks/setActionTabs",payload:{}}),yt([]));case 4:case"end":return bt.stop()}},xt)})),onCancel:function(){yt([]),mn({type:"shixunHomeworks/setActionTabs",payload:{}})}},n.a.createElement(V.a,{rowSelection:{type:"checkbox",onChange:function(ot,ut){yt(Object(Te.a)(ot))},selectedRowKeys:nt,getCheckboxProps:function(ot){return{disabled:ot.status==="\u8FDB\u884C\u4E2D"||ot.works_count===0}}},rowKey:function(ot){return ot.key||ot.id},scroll:{y:300},pagination:!1,columns:Ge,dataSource:Re==null?void 0:Re.group_list})))},me=Object(R.a)(function(kn){var fn=kn.shixunHomeworks;return{shixunHomeworks:fn}})(ie),ye=D("Ot1p"),xe=D("mgmH"),De=function(fn){var Tn,mn,er,rr,J,ge,Re,Ae,at,Be=fn.shixunHomeworks,nt=fn.loading,yt=fn.dispatch,Mt=fn.setExportParams,kt=fn.user,Ge=Object(S.i)(),xt=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,order:"work_score",b_order:"desc"}),Ge)),ot=Object(o.a)(xt,2),ut=ot[0],bt=ot[1],Dt=Nt.a.useForm(),pt=Object(o.a)(Dt,1),Kt=pt[0],nn=Object(i.useState)(),wn=Object(o.a)(nn,2),In=wn[0],yn=wn[1],On=Object(i.useState)({}),Cn=Object(o.a)(On,2),Ot=Cn[0],rn=Cn[1],Ut=Object(i.useState)([]),wt=Object(o.a)(Ut,2),Rn=wt[0],bn=wt[1],Wt=Object(i.useState)(!1),dt=Object(o.a)(Wt,2),An=dt[0],an=dt[1],Kn=Object(i.useState)([]),zt=Object(o.a)(Kn,2),En=zt[0],Ln=zt[1],cn=Object(i.useState)(!1),dr=Object(o.a)(cn,2),xn=dr[0],gn=dr[1],Ct=Object(i.useState)(),Ze=Object(o.a)(Ct,2),Lt=Ze[0],At=Ze[1],en=Object(i.useState)(1),Nn=Object(o.a)(en,2),Sn=Nn[0],Qn=Nn[1],zn=Object(i.useState)(),vr=Object(o.a)(zn,2),sr=vr[0],hr=vr[1],Wr=Object(i.useState)(),Ur=Object(o.a)(Wr,2),Br=Ur[0],li=Ur[1],ui=Object(i.useState)(),Se=Object(o.a)(ui,2),je=Se[0],Xe=Se[1],Le=Object(i.useState)(),ue=Object(o.a)(Le,2),be=ue[0],fe=ue[1],Pe=Object(i.useState)(),ke=Object(o.a)(Pe,2),qe=ke[0],Ne=ke[1],st=Object(i.useState)(!1),Pt=Object(o.a)(st,2),$t=Pt[0],sn=Pt[1],Pn=Object(S.h)();Object(i.useEffect)(function(){return Un(!0),function(){rn([]),bn([])}},[ut.coursesId]),Object(i.useEffect)(function(){var ln,Yt=JSON.parse(JSON.stringify(Be.workList));!(Yt!=null&&(ln=Yt.student_works)!==null&&ln!==void 0&&ln.length)&&Yt!==null&&Yt!==void 0&&Yt.id?(Yt.student_works=[Object(g.a)({},Yt)],rn(Yt)):(Yt!=null&&Yt.id&&bn([Object(g.a)(Object(g.a)({},Yt),{number:"\u6211"})]),rn(Object(g.a)({},Yt)))},[Be.workList]);var Un=function(Yt){Mt(Object(g.a)({},ut));var pn=yt({type:"shixunHomeworks/getWorkList",payload:ut});return Yt&&pn.then(function(Ft){var Bt,or,xr;(Ft!=null&&(Bt=Ft.homework_status)!==null&&Bt!==void 0&&Bt.includes("\u8FDB\u884C\u4E2D")||Ft!=null&&(or=Ft.homework_status)!==null&&or!==void 0&&or.includes("\u8865\u4EA4\u4E2D")||Ft!=null&&(xr=Ft.homework_status)!==null&&xr!==void 0&&xr.includes("\u63D0\u4EA4\u4E2D"))&&!Object(Y.t)()&&tr()}),pn};Object(i.useEffect)(function(){ar()},[]);var ar=function(){var ln=Object(m.a)(s.a.mark(function Yt(){var pn;return s.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return Bt.next=2,Object(ee.I)({categoryId:Ge.categoryId});case 2:pn=Bt.sent,yn(pn==null?void 0:pn.update_score);case 4:case"end":return Bt.stop()}},Yt)}));return function(){return ln.apply(this,arguments)}}(),tr=function(){var ln=Object(m.a)(s.a.mark(function Yt(){var pn;return s.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:return yt({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6210\u7EE9\u8BA1\u7B97\u4E2D\uFF0C\u8BF7\u7A0D\u5019..."}}),Bt.next=3,Object(ee.Z)({categoryId:Ge.categoryId});case 3:pn=Bt.sent,yt({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),(pn==null?void 0:pn.status)===0&&(p.b.success(pn==null?void 0:pn.message),Un());case 6:case"end":return Bt.stop()}},Yt)}));return function(){return ln.apply(this,arguments)}}(),fr=function(){ut.page=1;var Yt=Object.assign({},Kt.getFieldValue());delete ut.course_group,delete ut.teacher_comment,Object.keys(Yt).map(function(pn){switch(pn){case"task_status":Yt[pn].includes("all")||!Yt[pn].length?(delete ut.work_status,Kt.setFieldsValue(Object(Ye.a)({},"task_status","all"))):(ut.work_status=Yt[pn],Kt.setFieldsValue(Object(Ye.a)({},"task_status",ut.work_status)));break;case"course_group_info":Yt[pn].includes("all")||!Yt[pn].length?(delete ut.course_group,Kt.setFieldsValue(Object(Ye.a)({},"course_group_info","all"))):(ut.course_group=Yt[pn],Kt.setFieldsValue(Object(Ye.a)({},"course_group_info",ut.course_group)));break;case"teacher_comment":if(Yt[pn].includes("all")||!Yt[pn].length)delete ut.teacher_comment,Kt.setFieldsValue(Object(Ye.a)({},"teacher_comment","all"));else{var Ft;ut.teacher_comment=((Ft=Yt[pn])===null||Ft===void 0?void 0:Ft.length)===1?Number(Yt[pn][0]):"",Kt.setFieldsValue(Object(Ye.a)({},"teacher_comment",Yt[pn]))}break}}),Un()};Object(i.useEffect)(function(){if(document.getElementById("divhe")){var ln=document.getElementById("divhe").scrollHeight;ln>47&&(Ne(47),sn(!0))}},[document.getElementById("divhe")]);var _r=function(Yt,pn){ut.page=Yt,ut.limit=20,Un()};function lr(){Qn(1),hr(""),li(""),Xe(""),fe(""),Ln([])}var pr=[{title:"\u5E8F\u53F7",dataIndex:"number",align:"center",width:50,fixed:"left",ellipsis:{showTitle:!1},render:function(Yt,pn,Ft){return ut.limit*(ut.page-1)+Ft+1}},{title:"\u59D3\u540D",dataIndex:"user_name",align:"center",width:110,fixed:"left",ellipsis:{showTitle:!1},render:function(Yt){return n.a.createElement(L.a,{placement:"bottomLeft",title:Yt},n.a.createElement("span",{className:"current"},Yt))}},!(Ot!=null&&Ot.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:ut.order==="student_id"?ut.b_order==="desc"?"descend":"ascend":null,render:function(Yt){return n.a.createElement(L.a,{placement:"bottomLeft",title:Yt||"--"},n.a.createElement("span",{className:"current"},Yt||"--"))}},{title:"\u5206\u73ED",dataIndex:"group_name",align:"center",width:180,fixed:"left",ellipsis:{showTitle:!1},render:function(Yt,pn){return Yt?n.a.createElement(L.a,{placement:"bottom",title:Yt},n.a.createElement("span",{className:"current"},Yt)):"--"}},{title:"\u4F5C\u4E1A\u72B6\u6001",dataIndex:"work_status",align:"center",width:80,fixed:"left",sorter:!0,ellipsis:{showTitle:!1},showSorterTooltip:!1,sortOrder:ut.order==="work_status"?ut.b_order==="desc"?"descend":"ascend":null,render:function(Yt){return n.a.createElement(v.f,{status:Yt})}},{title:"\u5B8C\u6210\u65F6\u95F4",align:"center",dataIndex:"achieve_time",ellipsis:{showTitle:!1},render:function(Yt,pn){return n.a.createElement(L.a,{placement:"bottomLeft",title:Yt},n.a.createElement("span",{className:"current"},Yt))}},{title:"\u901A\u8FC7\u60C5\u51B5",align:"center",dataIndex:"achieve_info",ellipsis:{showTitle:!1},render:function(Yt,pn){return n.a.createElement("span",null,Yt||"- -")}},{title:"\u6700\u7EC8\u6210\u7EE9",align:"center",dataIndex:"score",ellipsis:{showTitle:!1},render:function(Yt,pn){return n.a.createElement("span",null,Yt||"- -")}},{title:"\u5B8C\u6210\u65F6\u957F",dataIndex:"achieve_time_long",align:"center",render:function(Yt,pn){return Yt&&Yt!="--"?n.a.createElement(L.a,{placement:"bottom",title:Yt},n.a.createElement("span",{className:"current"},Yt)):"--"}},{title:n.a.createElement("span",null,"\u8BC4\u9605\u72B6\u6001"),align:"center",dataIndex:"has_comment",width:90,fixed:"right",ellipsis:!0,render:function(Yt){return Yt?"\u5DF2\u8BC4\u9605":"\u672A\u8BC4\u9605"}},{title:"\u64CD\u4F5C",dataInex:"action",align:"center",width:70,fixed:"right",ellipsis:!0,className:"workListTable",render:function(Yt,pn){return Object(Y.t)()?n.a.createElement("div",null,Object(v.B)(pn==null?void 0:pn.work_status)==="\u672A\u5F00\u542F"?n.a.createElement("span",null,"--"):n.a.createElement(C.a,{target:"_blank",onClick:function(Bt){Bt.stopPropagation()},to:"/classrooms/".concat(ut.coursesId,"/program_homework/").concat(ut.categoryId,"/").concat(pn.id,"/").concat(pn.user_id,"/comment")},"\u67E5\u770B")):n.a.createElement("a",{target:"_blank",onClick:function(Bt){var or;if(Bt.stopPropagation(),(or=kt.userInfo)!==null&&or!==void 0&&or.professional_certification)window.open("/classrooms/".concat(ut.coursesId,"/program_homework/").concat(ut.categoryId,"/").concat(pn.id,"/").concat(pn.user_id,"/comment"),"_blank");else return a.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(ln){return!!ln}),Er=function(){return n.a.createElement(Fe.a,null,n.a.createElement(Fe.a.Item,{onClick:function(){Object(xe.h)(JSON.parse(sessionStorage.all_student_works_params),"shixun_work_list")},key:"1"},"\u5B66\u751F\u6210\u7EE9"),n.a.createElement(Fe.a.Item,{key:"2"},n.a.createElement(C.a,{to:"/classrooms/".concat(ut.coursesId,"/exportlist/shixun_work_list")},"\u5386\u53F2\u5BFC\u51FA")))};return n.a.createElement(n.a.Fragment,null,n.a.createElement("section",{className:"".concat(se.a.wrap," minH500 bg-white pl30 pr30 pt30")},((Tn=Ot.homework_status)===null||Tn===void 0?void 0:Tn.includes("\u672A\u53D1\u5E03"))&&n.a.createElement(q.a,null),!((mn=Ot.homework_status)!==null&&mn!==void 0&&mn.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 ",Ot==null?void 0:Ot.publish_time),n.a.createElement("span",{className:"ml5"},"\u622A\u6B62\u65F6\u95F4 ",Ot==null?void 0:Ot.end_time),n.a.createElement("span",{className:"ml5"},"\u8865\u4EA4\u65F6\u95F4 ",(Ot==null?void 0:Ot.late_time)||"- -")),Object(Y.c)()&&n.a.createElement(n.a.Fragment,null,n.a.createElement(Nt.a,{form:Kt,onChange:fr,initialValues:(er={},Object(Ye.a)(er,"task_status","all"),Object(Ye.a)(er,"course_group_info","all"),Object(Ye.a)(er,"teacher_comment","all"),er)},((rr=Ot.task_status)===null||rr===void 0?void 0:rr.length)>0&&n.a.createElement(Nt.a.Item,{name:"task_status"},n.a.createElement(Ue.a.Group,{value:[],style:{width:"100%"}},n.a.createElement(z.a,null,n.a.createElement(le.a,{className:"font14",flex:"80px"},"\u4F5C\u4E1A\u72B6\u6001:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ue.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1"},Ot.task_status&&Ot.task_status.map(function(ln,Yt){return n.a.createElement(Ue.a,{name:"task_status",value:ln.id},ln.name,"(",ln.count,")")}))))),((J=Ot.course_group_info)===null||J===void 0?void 0:J.length)>0&&n.a.createElement(Nt.a.Item,{name:"course_group_info"},n.a.createElement(Ue.a.Group,{style:{width:"100%"}},n.a.createElement(z.a,null,n.a.createElement(le.a,{className:"font14",flex:"80px"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ue.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1",id:"divhe",style:{height:qe+"px",overflow:"hidden"}},(ge=Ot.course_group_info)===null||ge===void 0?void 0:ge.map(function(ln,Yt){return n.a.createElement(Ue.a,{value:ln.course_group_id},ln.group_group_name,"(",ln.count,")")})),$t&&n.a.createElement("span",{onClick:function(){var Yt=document.getElementById("divhe").scrollHeight;qe>47?Ne(47):Ne(Yt)},style:{color:"rgb(76, 172, 255)",cursor:"pointer",alignItems:"flex-end",display:"flex"}},qe===47?"\u5C55\u5F00":"\u6536\u8D77",qe===47?n.a.createElement(Xt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}):n.a.createElement(tt.a,{style:{marginBottom:"3px",marginLeft:"2px"}}))))),((Re=Ot.teacher_comment)===null||Re===void 0?void 0:Re.length)>0&&n.a.createElement(Nt.a.Item,{name:"teacher_comment"},n.a.createElement(Ue.a.Group,{style:{width:"100%"}},n.a.createElement(z.a,null,n.a.createElement(le.a,{className:"font14",flex:"80px"},"\u8FFD\u52A0\u70B9\u8BC4:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ue.a,{value:"all"},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1"},Ot.teacher_comment&&Ot.teacher_comment.map(function(ln,Yt){return n.a.createElement(Ue.a,{value:String(ln.id)},ln.name,"(",ln.count,")")})))))),n.a.createElement(z.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"},n.a.createElement(z.a,{align:"middle"},n.a.createElement(le.a,null,n.a.createElement(Q.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(Yt){ut.search=Yt,ut.page=1,Un()},style:{width:240}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"ml5"},n.a.createElement("span",{className:"c-red"},Ot.work_count),"\u4E2A\u68C0\u7D22\u7ED3\u679C\uFF08",Ot.work_count,"\u4E2A\u5B66\u751F\uFF09")))),n.a.createElement(le.a,null,Object(Y.c)()&&n.a.createElement(M.a,{className:"ml10",onClick:function(){yt({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",selectArrs:Ot.student_works.map(function(Yt){return Yt.id}),params:ut}})}},n.a.createElement("span",{className:"".concat(se.a.tr1," iconfont icon-daimachazhong")}),"\u4EE3\u7801\u67E5\u91CD"),Object(Y.c)()&&n.a.createElement(M.a,{className:"ml10",onClick:tr},n.a.createElement("i",{className:"iconfont icon-gengxinchengji font14 pr5"}),"\u66F4\u65B0\u6210\u7EE9"),Object(Y.c)()&&n.a.createElement(j.a,{overlay:Er,className:"ml10"},n.a.createElement(M.a,null,n.a.createElement(Zt.a,null),"\u5BFC\u51FA",n.a.createElement(vn.a,null)))))),n.a.createElement(z.a,{style:{justifyContent:"end",marginTop:"5px"}},Object(Y.c)()&&In&&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:nt["shixunHomeworks/getWorkList"],pagination:!1,style:{cursor:"pointer"},onRow:function(Yt){return{onClick:function(Ft){window.open("/classrooms/".concat(ut.coursesId,"/program_homework/").concat(ut.categoryId,"/").concat(Yt.id,"/").concat(Yt.user_id,"/comment"),"_blank")}}},dataSource:Ot.student_works,columns:pr,onChange:function(Yt,pn,Ft){Ft.field&&(ut.order=Ft.field),Ft.order||(ut.b_order="asc"),Ft.order==="ascend"&&(ut.b_order="asc"),Ft.order==="descend"&&(ut.b_order="desc"),Ft.order||(ut.b_order="asc"),Un()}}),n.a.createElement(de,null),n.a.createElement(ae,null),n.a.createElement(ze.a,null)),n.a.createElement(a.a,{title:"\u4E00\u952E\u6253\u56DE\u91CD\u505A",visible:An,centered:!0,destroyOnClose:!0,forceRender:!0,width:700,onOk:Object(m.a)(s.a.mark(function ln(){var Yt,pn;return s.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(!(Sn===2)){Bt.next=13;break}if(!(En.length<=0)){Bt.next=4;break}return p.b.info("\u8BF7\u9009\u62E9\u4F5C\u4E1A\u72B6\u6001"),Bt.abrupt("return");case 4:if(be){Bt.next=7;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Bt.abrupt("return");case 7:return Bt.next=9,Object(O.a)("/api/homework_commons/".concat(ut.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:ut.categoryId,comment:be,status:En}});case 9:Yt=Bt.sent,Yt.status===0&&(At(Yt),an(!1),gn(!0)),Bt.next=32;break;case 13:if(!(je===0||Br===0)){Bt.next=16;break}Bt.next=22;break;case 16:if(je){Bt.next=19;break}return p.b.info("\u6700\u4F4E\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Bt.abrupt("return");case 19:if(Br){Bt.next=22;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u4E3A\u7A7A"),Bt.abrupt("return");case 22:if(!(je>Br)){Bt.next=25;break}return p.b.info("\u6700\u9AD8\u5206\u4E0D\u80FD\u5927\u4E8E\u6700\u4F4E\u5206"),Bt.abrupt("return");case 25:if(be){Bt.next=28;break}return p.b.info("\u8BC4\u8BED\u4E0D\u80FD\u4E3A\u7A7A"),Bt.abrupt("return");case 28:return Bt.next=30,Object(O.a)("/api/homework_commons/".concat(ut.categoryId,"/confirm_redo_modal.json"),{method:"post",body:{id:ut.categoryId,comment:be,min_score:je,max_score:Br}});case 30:pn=Bt.sent,pn.status===0&&(At(pn),an(!1),gn(!0));case 32:case"end":return Bt.stop()}},ln)})),onCancel:function(){an(!1),lr()}},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(Ce.a.Group,{value:Sn,onChange:function(Yt){Qn(Yt.target.value)}},n.a.createElement(Ce.a,{value:1},"\u6309\u6210\u7EE9\u6253\u56DE"),n.a.createElement(Ce.a,{value:2},"\u6309\u4F5C\u4E1A\u72B6\u6001\u6253\u56DE"))),Sn===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($e.a,{min:0,max:100,value:je,onChange:function(Yt){return Xe(Yt)},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($e.a,{min:0,max:100,value:Br,onChange:function(Yt){return li(Yt)},style:{width:"100px"}})),Sn===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(Ue.a.Group,{onChange:function(Yt){Ln(Object(Te.a)(Yt))},style:{width:"100%"}},(Ae=Ot.task_status)===null||Ae===void 0?void 0:Ae.map(function(ln,Yt){return n.a.createElement(Ue.a,{name:"task_status",value:ln.id},ln.name,"(",ln.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(ye.a,{className:se.a.MdEditor,onChange:function(Yt){return fe(Yt)},placeholder:"\u8BF7\u586B\u5199\u8BC4\u8BED"}))))),n.a.createElement(a.a,{visible:xn,title:"\u6253\u56DE\u786E\u8BA4",onOk:Object(m.a)(s.a.mark(function ln(){var Yt,pn;return s.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(!(Sn===2)){Bt.next=7;break}return Bt.next=3,Object(O.a)("/api/homework_commons/".concat(ut.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:ut.categoryId,comment:be,status:En}});case 3:Yt=Bt.sent,Yt.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),lr(),Un(),gn(!1)),Bt.next=11;break;case 7:return Bt.next=9,Object(O.a)("/api/homework_commons/".concat(ut.categoryId,"/batch_redo_modal.json"),{method:"post",body:{id:ut.categoryId,comment:be,min_score:je,max_score:Br}});case 9:pn=Bt.sent,pn.status===0&&(p.b.info("\u6253\u56DE\u6210\u529F"),lr(),Un(),gn(!1));case 11:case"end":return Bt.stop()}},ln)})),onCancel:function(){lr(),gn(!1)}},n.a.createElement("div",{style:{padding:"32px"}},Sn===1&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u6210\u7EE9\u5728",je,"-",Br,"\u7684\u5B66\u751F\u8FDB\u884C\u6253\u56DE\u91CD\u505A\u5417\uFF1F"),Sn===2&&n.a.createElement("span",null,"\u786E\u8BA4\u5C06\u4F5C\u4E1A\u72B6\u6001\u4E3A",((at=Ot.task_status)===null||at===void 0?void 0:at.filter(function(ln){return En==null?void 0:En.includes(ln.id)}).map(function(ln){return ln.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",Lt==null?void 0:Lt.count,"\u540D\u5B66\u751F")))),n.a.createElement(me,null),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(_.a,{showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,onChange:_r,current:ut.page||1,defaultPageSize:20,total:Ot.work_count})))},ct=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading,mn=kn.user;return{shixunHomeworks:fn,loading:Tn.effects,user:mn}})(De),It=D("fOrg"),un=D("+KLJ"),mt=function(fn){var Tn,mn=fn.shixunHomeworks,er=fn.loading,rr=fn.dispatch,J=Object(S.i)(),ge=Object(i.useState)(Object(g.a)(Object(g.a)({},{page:1,limit:20,group_ids:[]}),J)),Re=Object(o.a)(ge,2),Ae=Re[0],at=Re[1],Be=Object(S.h)(),nt=mn.codeReview,yt=Object(i.useState)({}),Mt=Object(o.a)(yt,2),kt=Mt[0],Ge=Mt[1],xt=Nt.a.useForm(),ot=Object(o.a)(xt,1),ut=ot[0];Ae.order="code_rate",Ae.sort="desc",Ae.category=Ae.categoryId,Object(i.useEffect)(function(){bt(),console.log("params",Ae)},[Ae]),Object(i.useEffect)(function(){mn.actionTabs.key==="\u6267\u884C\u4EE3\u7801\u67E5\u91CD"&&bt()},[mn.actionTabs.key]);var bt=function(){var nn=Object(m.a)(s.a.mark(function wn(){var In;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,rr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Ae)});case 2:In=On.sent,In.status===-2&&setTimeout(function(){return bt()},1500);case 4:case"end":return On.stop()}},wn)}));return function(){return nn.apply(this,arguments)}}(),Dt=function(){},pt=function(wn,In){Ae.page=wn,Ae.limit=20,rr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Ae)})},Kt=[{title:"\u5E8F\u53F7",dataIndex:"number",render:function(wn,In,yn){return Ae.limit*(Ae.page-1)+yn+1}},{title:"\u59D3\u540D",dataIndex:"username"},{title:"\u5B66\u53F7",dataIndex:"student_id"},{title:"\u76F8\u4F3C\u5EA6",dataIndex:"code_rate",render:function(wn){return n.a.createElement("span",{className:"c-orange"},wn)}},{title:"\u64CD\u4F5C",dataInex:"action",render:function(wn,In){return n.a.createElement("div",null,n.a.createElement(C.a,{target:"_blank",to:"/classrooms/".concat(Ae.coursesId,"/program_homework/").concat(Ae.categoryId,"/review_detail/").concat(In.user_id)},"\u67E5\u770B"),n.a.createElement("br",null))}}];return n.a.createElement("section",{className:"minH500 bg-white pl30 pr30 pt10"},(nt==null?void 0:nt.status)===-2&&n.a.createElement(un.a,{message:"\u67E5\u91CD\u8FDB\u884C\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026\u2026",className:"mb10 font14",type:"error"}),n.a.createElement(z.a,null,n.a.createElement(le.a,{flex:"1"},n.a.createElement("p",{className:"mt10"},"\u67E5\u91CD\u65F6\u95F4\uFF1A",nt.last_review_time,n.a.createElement(M.a,{ghost:!0,danger:!0,style:{color:"#29BD8B",borderColor:"#29BD8B",marginLeft:10},onClick:function(){rr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u4EE3\u7801\u67E5\u91CD",params:Ae}})}},"\u4EE3\u7801\u67E5\u91CD"))),n.a.createElement(le.a,null,n.a.createElement(Q.a.Search,{allowClear:!0,placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22",onSearch:function(wn){Ae.search=wn,rr({type:"shixunHomeworks/getCodeReview",payload:Ae})},style:{width:200}}),n.a.createElement("span",{className:"ml5 c-red"}))),((Tn=nt.group_info)===null||Tn===void 0?void 0:Tn.length)>0&&n.a.createElement(n.a.Fragment,null,n.a.createElement(z.a,null,n.a.createElement(le.a,{flex:"80px",className:"font14"},"\u5206\u73ED\u60C5\u51B5:"),n.a.createElement(le.a,{flex:"80px"},n.a.createElement(Ue.a,{checked:Ae.group_ids=="",value:"all",onChange:function(wn){delete Ae.group_ids,Ae.group_ids=[],Ae.page=1,at(Object(g.a)({},Ae))}},"\u5168\u90E8")),n.a.createElement(le.a,{flex:"1"},nt.group_info&&nt.group_info.map(function(nn,wn){return n.a.createElement(Ue.a,{style:{marginLeft:0},value:nn.id,checked:Ae.group_ids.includes(nn.id),onChange:function(yn){yn.target.checked?Ae.group_ids.push(nn.id):Ae.group_ids.splice(Ae.group_ids.indexOf(nn.id),1),Ae.page=1,at(Object(g.a)({},Ae))}},nn.name,"(",nn.members_count,")")}))),n.a.createElement(z.a,{className:"font14 c-red mt5"},n.a.createElement(le.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"},nt.copy_reviews_count),"\u4E2A\u7591\u4F3C\u6284\u88AD\u4F5C\u54C1\uFF08",nt.all_reviews_count,"\u4F5C\u54C1\uFF09"),n.a.createElement(V.a,{className:"mt30",loading:er["shixunHomeworks/getCodeReview"],pagination:!1,dataSource:nt.users_reviews,columns:Kt,onChange:function(wn,In,yn){yn.order==="ascend"&&(Ae.b_order="asc"),yn.order==="descend"&&(Ae.b_order="desc"),yn.order||delete Ae.b_order,rr({type:"shixunHomeworks/getCodeReview",payload:Object(g.a)({},Ae)})}}),n.a.createElement("aside",{className:"tc mb50 mt30"},n.a.createElement(_.a,{showSizeChanger:!1,onChange:pt,defaultCurrent:Ae.page||1,current:Ae.page||1,defaultPageSize:20,hideOnSinglePage:!0,total:nt.copy_reviews_count})))},Qt=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn.effects}})(mt),ht=D("OaEy"),Et=D("2fM7"),it=D("iQDF"),ve=D("+eQT"),Me=D("/MfK"),St=D("w5pM"),lt=D("Lyp1"),Gt=D("LvDl"),qt=D("xb3X"),Ve=D.n(qt),et=D("AHFd"),gt=D("eozf"),Ht=ve.a.RangePicker,Vt=Et.a.Option,dn=function(fn){var Tn,mn,er,rr,J,ge,Re,Ae,at,Be,nt=fn.shixunHomeworks,yt=fn.loading,Mt=fn.dispatch,kt=Object(S.i)(),Ge=nt.workSetting,xt=nt.workList,ot=nt.changeData,ut=Object(i.useState)(!0),bt=Object(o.a)(ut,2),Dt=bt[0],pt=bt[1],Kt=Object(i.useState)(!1),nn=Object(o.a)(Kt,2),wn=nn[0],In=nn[1],yn=Object(i.useState)([]),On=Object(o.a)(yn,2),Cn=On[0],Ot=On[1],rn=Object(i.useState)([]),Ut=Object(o.a)(rn,2),wt=Ut[0],Rn=Ut[1],bn=Object(i.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_minus_score:0,penalty_type:et.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}),Wt=Object(o.a)(bn,2),dt=Wt[0],An=Wt[1];Object(i.useEffect)(function(){return an(),function(){Ot([].concat())}},[]);var an=function(){Mt({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},kt)})};Object(i.useEffect)(function(){var Ct;if(!(Ge!=null&&Ge.course_id))return;Object.keys(dt).map(function(Ze){dt[Ze]=Ge[Ze]}),(!dt.allow_late||!dt.unified_late)&&(dt.late_minus_score=20,dt.penalty_type=et.a.Percent),dt.unified_setting||(dt.unified_late=!1,dt.unified_anonymous_comment=!1,dt.unified_anonymous_appeal=!1),Cn=JSON.parse(JSON.stringify(Ge.group_settings.map(function(Ze){return Object(g.a)(Object(g.a)({},Ze),{},{group_name:[Ze.group_name]})}).filter(function(Ze){return Ze.publish_time!==null}))),wt=JSON.parse(JSON.stringify(Ge.allow_late_settings.map(function(Ze){return Object(g.a)(Object(g.a)({},Ze),{},{group_name:[Ze.group_name]})}).filter(function(Ze){return Ze.late_time!==null}))),dt.difficult_settings.length===0&&(dt.difficult_settings=[0,0,0]),An(Object(g.a)({},dt)),Ot(Object(Te.a)(Cn)),((Ct=wt)===null||Ct===void 0?void 0:Ct.length)<=0?Rn([{late_minus_score:20}]):Rn(Object(Te.a)(wt))},[Ge]);var Kn=function(){var Ze,Lt=JSON.parse(JSON.stringify(dt));if(Lt.categoryId=kt.categoryId,dt.unified_setting||(Cn=(Ze=Cn)===null||Ze===void 0?void 0:Ze.map(function(en){var Nn;if(!en.publish_time||!en.end_time)throw p.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(!en.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return en.group_name=typeof(en==null?void 0:en.group_name)=="string"?[en==null?void 0:en.group_name]:en==null?void 0:en.group_name,en.group_id=(Nn=Ge.group_settings)===null||Nn===void 0?void 0:Nn.filter(function(Sn){var Qn;return en==null||((Qn=en.group_name)===null||Qn===void 0)?void 0:Qn.includes(Sn.group_name)}).map(function(Sn){return Sn.group_id||Sn.id}).toString().split(","),en})),Lt.group_settings=Cn,dt.allow_late)if(dt.unified_late){if(dt.late_minus_score===null||dt.late_minus_score===void 0||dt.late_minus_score<0||dt.late_minus_score>100)throw p.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(!dt.late_time)throw p.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 At;wt=(At=wt)===null||At===void 0?void 0:At.map(function(en){var Nn,Sn;if(en.late_minus_score===null||en.late_minus_score===void 0||en.late_minus_score<0||en.late_minus_score>100)throw p.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(!en.late_time)throw p.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(!en.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return en.group_name=typeof(en==null?void 0:en.group_name)=="string"?[en==null?void 0:en.group_name]:en==null?void 0:en.group_name,en.group_id=en==null||((Nn=en.group_name)===null||Nn===void 0||((Sn=Nn.map(function(Qn){var zn,vr,sr=(zn=Ge.group_settings)===null||zn===void 0||((vr=zn.filter(function(hr){return(hr==null?void 0:hr.group_name)===Qn}))===null||vr===void 0)?void 0:vr[0];return sr==null?void 0:sr.group_id}))===null||Sn===void 0))?void 0:Sn.toString().split(","),en}),Lt.allow_late_settings=wt}Lt.send_type===1&&(Lt.difficult_settings=Lt.difficult_settings.map(function(en){return en||0})),zt(Lt)},zt=function(Ze){var Lt;if(Ze.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(Ze!=null&&Ze.work_efficiency&&Ze.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var At={shixun_evaluation:Ze.shixun_evaluation,challenge_settings:Ze.challenge_settings},en=function(){var Nn=Object(m.a)(s.a.mark(function Sn(){var Qn;return s.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return In(!0),vr.next=3,Object(O.a)("/api/homework_commons/".concat(kt.categoryId,"/publish_setting.json"),{method:"post",body:Object(g.a)({},Ze)});case 3:Qn=vr.sent,Qn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),pt(!0),an(),Mt({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},kt)})),In(!1);case 6:case"end":return vr.stop()}},Sn)}));return function(){return Nn.apply(this,arguments)}}();!Object(Gt.isEqual)(ot,At)&&!(xt!=null&&(Lt=xt.homework_status)!==null&&Lt!==void 0&&Lt.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:en}):en()},En=function(Ze,Lt){var At,en=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return Lt?Lt.find(function(Nn){return Nn[en]===Ze}):Ge==null||((At=Ge.group_settings)===null||At===void 0)?void 0:At.find(function(Nn){return Nn.group_id[0]===Ze})},Ln=(Ge==null?void 0:Ge.allow_late)||(Ge==null?void 0:Ge.anonymous_comment),cn=function(Ze){var Lt=En(Ze,Ge==null?void 0:Ge.allow_late_settings,"id"),At=En(Ze,Ge==null?void 0:Ge.anonymous_comment_settings);return(Ge==null?void 0:Ge.allow_late)&&Lt&&(Lt==null?void 0:Lt.late_time)!==null||(Ge==null?void 0:Ge.anonymous_comment)&&At&&(At==null?void 0:At.evaluation_start)!==null},dr=Object(i.useMemo)(function(){var Ct;if(Ge!=null&&Ge.unified_setting){var Ze;return!(xt!=null&&(Ze=xt.homework_status)!==null&&Ze!==void 0&&Ze.includes("\u5DF2\u622A\u6B62"))||(Ge==null?void 0:Ge.allow_late)||(Ge==null?void 0:Ge.anonymous_comment)}var Lt=Ge==null||((Ct=Ge.group_settings)===null||Ct===void 0)?void 0:Ct.some(function(At){return B()(At.end_time)<=B()()});return!Lt||(Ge==null?void 0:Ge.allow_late)||(Ge==null?void 0:Ge.all_group_late)},[Ge,xt]),xn=Ge==null?void 0:Ge.anonymous_comment,gn=function(Ze){if(!Ze)return!1;var Lt=En(Ze,Ge==null?void 0:Ge.anonymous_comment_settings);return(Ge==null?void 0:Ge.anonymous_comment)&&Lt&&(Lt==null?void 0:Lt.evaluation_start)!==null};return n.a.createElement("section",{className:Ve.a.form},n.a.createElement(z.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"},n.a.createElement("div",{className:Ve.a.title},"\u8BD5\u9898\u53D1\u5E03")),n.a.createElement(le.a,null,Object(Y.c)()&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return pt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement("div",{className:"mt10"},n.a.createElement("label",{className:"mr20"},"\u53D1\u5E03\u65B9\u5F0F")," ",n.a.createElement(Ce.a.Group,{disabled:Dt||!(xt!=null&&(Tn=xt.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),value:dt.send_type,onChange:function(Ze){dt.send_type=Ze.target.value,An(Object.assign({},dt))}},n.a.createElement(Ce.a,{value:0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),n.a.createElement(Ce.a,{className:"ml20",value:1},"\u968F\u673A\u62BD\u9898")),dt.send_type===1&&n.a.createElement(z.a,{className:"mt20",style:{marginLeft:94}},n.a.createElement(le.a,null,"\u7B80\u5355\u9898\u6570",n.a.createElement($e.a,{precision:0,disabled:Dt||!(xt!=null&&(mn=xt.homework_status)!==null&&mn!==void 0&&mn.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(dt.difficult_count[0]||0),min:0,max:dt.difficult_count[0]||0,value:dt.difficult_settings[0],onChange:function(Ze){dt.difficult_settings[0]=Ze,An(Object.assign({},dt))},className:"ml10 mr20"})),n.a.createElement(le.a,null,"\u9002\u4E2D\u9898\u6570",n.a.createElement($e.a,{precision:0,disabled:Dt||!(xt!=null&&(er=xt.homework_status)!==null&&er!==void 0&&er.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(dt.difficult_count[1]||0),min:0,max:dt.difficult_count[1]||0,value:dt.difficult_settings[1],onChange:function(Ze){dt.difficult_settings[1]=Ze,An(Object.assign({},dt))},className:"ml10 mr20"})),n.a.createElement(le.a,null,"\u56F0\u96BE\u9898\u6570",n.a.createElement($e.a,{precision:0,disabled:Dt||!(xt!=null&&(rr=xt.homework_status)!==null&&rr!==void 0&&rr.includes("\u672A\u53D1\u5E03")),placeholder:"\u6700\u5927".concat(dt.difficult_count[2]||0),min:0,max:dt.difficult_count[2]||0,value:dt.difficult_settings[2],onChange:function(Ze){dt.difficult_settings[2]=Ze,An(Object.assign({},dt))},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(Ce.a.Group,{disabled:Dt||!(xt!=null&&(J=xt.homework_status)!==null&&J!==void 0&&J.includes("\u672A\u53D1\u5E03")),value:dt.unified_setting,onChange:function(Ze){var Lt;if(!(xt!=null&&(Lt=xt.homework_status)!==null&&Lt!==void 0&&Lt.includes("\u672A\u53D1\u5E03"))){p.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(dt.unified_setting=!dt.unified_setting,dt.unified_setting||(dt.unified_late=!1),An(Object.assign({},dt)),dt.unified_setting===!1&&Cn==""){Ot(Cn.concat({}));return}dt.unified_setting&&(Ot([]),Rn([{late_minus_score:5}]))}},n.a.createElement(Ce.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),n.a.createElement(Ce.a,{className:"ml20",disabled:(Ge==null||((ge=Ge.group_settings)===null||ge===void 0)?void 0:ge.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(Ge==null||((Re=Ge.group_settings)===null||Re===void 0)?void 0:Re.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")),dt.unified_setting&&n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(z.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u53D1\u5E03\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(ve.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(Ze){return Object(gt.b)(Ze,Ge==null?void 0:Ge.course_end_date)},disabledTime:function(Ze){return Object(gt.c)(Ze)},disabled:Dt||!(xt!=null&&(Ae=xt.homework_status)!==null&&Ae!==void 0&&Ae.includes("\u672A\u53D1\u5E03")),value:dt.publish_time?B()(dt.publish_time):"",onChange:function(Ze,Lt){dt.publish_time=Lt,(dt.end_time==""||!dt.end_time)&&dt.unified_setting&&(dt.end_time=B()(Ze).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),An(Object.assign({},dt))}})),n.a.createElement(le.a,null,n.a.createElement("span",{className:"c-grey-c ml10"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u7684\u65F6\u95F4)"))),n.a.createElement(z.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(ve.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:B()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Dt||Ln,disabledDate:function(Ze){return Object(gt.b)(Ze,Ge==null?void 0:Ge.course_end_date,dt.publish_time)},disabledTime:function(Ze){return Object(gt.c)(Ze,dt.publish_time)},value:dt.end_time?B()(dt.end_time):"",onChange:function(Ze,Lt){dt.end_time=Lt,An(Object.assign({},dt))}})),n.a.createElement(le.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)")))),!dt.unified_setting&&((at=Cn)===null||at===void 0?void 0:at.length)>0&&n.a.createElement(z.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(le.a,{span:24},n.a.createElement(z.a,null,n.a.createElement(le.a,{span:10}),n.a.createElement(le.a,{span:10},n.a.createElement(z.a,{className:"c-grey-c ml30"},n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),n.a.createElement(le.a,{span:4}))),Cn&&Cn.map(function(Ct,Ze){var Lt,At,en,Nn,Sn;return n.a.createElement(le.a,{span:24,key:Ze},n.a.createElement(z.a,{gutter:[8,16]},n.a.createElement(le.a,{span:10},n.a.createElement(z.a,{gutter:[8,16]},n.a.createElement(le.a,null,"\u53D1\u5E03\u89C4\u5219 ",Ze+1),n.a.createElement(le.a,{flex:"1",style:{maxWidth:300}},n.a.createElement(Et.a,{disabled:Dt||!(xt!=null&&(Lt=xt.homework_status)!==null&&Lt!==void 0&&Lt.includes("\u672A\u53D1\u5E03"))&&Ct.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Ct.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(zn){Cn[Ze].group_name=zn,Cn[Ze].group_id=Ct.group_id;var vr=Object(Gt.flattenDeep)(Cn.map(function(hr){return hr.group_name})),sr=wt.map(function(hr){var Wr=(hr==null?void 0:hr.group_name)||[];return Object(g.a)(Object(g.a)({},hr),{},{group_name:Object(Gt.remove)(Wr,function(Ur){return vr.includes(Ur)})})});Rn(sr),Ot(Cn.slice())}},Ge.group_settings&&Ge.group_settings.map(function(Qn){if(!Cn.map(function(zn){return zn.group_name}).toString().split(",").includes(String(Qn.group_name)))return n.a.createElement(Vt,{value:Qn.group_name,key:Qn.id},Qn.group_name)}))))),n.a.createElement(le.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Ht,{allowClear:!1,ranges:{\u6B64\u523B:[Ct.publish_time?B()(Ct.publish_time):B()(),B()()]},disabled:Dt||(B()()<=B()((At=En((en=Ct.group_id)===null||en===void 0?void 0:en[0]))===null||At===void 0?void 0:At.publish_time)?!1:[!0,cn((Nn=Ct.group_id)===null||Nn===void 0?void 0:Nn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(zn){return Object(gt.b)(zn,Ge==null?void 0:Ge.course_end_date)},disabledTime:function(zn){return Object(gt.c)(zn)},showTime:{format:"HH:mm",defaultValue:[B()(Object(v.d)(),"HH:mm"),B()(Object(v.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Ct.publish_time&&[B()(Ct.publish_time),Ct.end_time?B()(Ct.end_time):void 0],onChange:function(zn,vr){Cn[Ze].publish_time=vr[0],Cn[Ze].end_time=vr[1],Ot(Object(Te.a)(Cn))}}))),!Dt&&n.a.createElement(le.a,{span:4},Ze>0&&!Ct.id&&n.a.createElement(Me.a,{onClick:function(){Cn=Cn.filter(function(zn,vr){return Ze!==vr}),Ot(Cn.slice()),setTimeout(function(){return Ot(Cn.slice())},10)}}),Cn.length<(Ge==null||((Sn=Ge.group_settings)===null||Sn===void 0)?void 0:Sn.length)&&n.a.createElement(St.a,{className:"c-green ml20",onClick:function(){Ot(Cn.concat({}))}}))))})),n.a.createElement(z.a,{className:"mt30"},n.a.createElement(le.a,null,n.a.createElement(z.a,{align:"middle"},n.a.createElement("h1",{style:{marginBottom:0}},"\u8865\u4EA4\u8BBE\u7F6E"),n.a.createElement(L.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(lt.a,{style:{marginLeft:4,cursor:"pointer"}})))),n.a.createElement(le.a,{span:24,className:"mt10"},n.a.createElement(Ue.a,{checked:dt.allow_late,disabled:Dt||dr,onChange:function(){dt.allow_late=!dt.allow_late,wt==""&&Rn([{late_minus_score:5}]),An(Object.assign({},dt))}},n.a.createElement("span",null,"\u5F00\u542F\u8865\u4EA4")),n.a.createElement(L.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(lt.a,null)))),(dt==null?void 0:dt.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(Ce.a.Group,{disabled:Dt||(Ge==null?void 0:Ge.anonymous_comment)||(Ge==null?void 0:Ge.allow_late),value:dt.unified_late,onChange:function(Ze){dt.unified_late=Ze.target.value,wt==""&&!Ze.target.value&&Rn([{late_minus_score:5}]),An(Object(g.a)({},dt))}},(dt==null?void 0:dt.unified_setting)&&n.a.createElement(Ce.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(Ge==null||((Be=Ge.group_settings)===null||Be===void 0)?void 0:Be.length)&&n.a.createElement(Ce.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),dt!=null&&dt.unified_late?n.a.createElement(n.a.Fragment,null,n.a.createElement(z.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u8865\u4EA4\u6263\u5206:"),n.a.createElement(le.a,{className:"ml5"},n.a.createElement(et.b,{disabled:Dt||xn,value:{type:dt.penalty_type,inputValue:dt.late_minus_score},onChange:function(Ze){An(Object(g.a)(Object(g.a)({},dt),{},{late_minus_score:Ze.inputValue,penalty_type:Ze.type}))}})),n.a.createElement(le.a,{flex:"1",className:"ml5"},n.a.createElement("span",{className:"c-grey-c ml10"},dt.penalty_type===et.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(z.a,{align:"middle",className:"mt25 pl30"},n.a.createElement(le.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),n.a.createElement(le.a,{className:"ml5"},n.a.createElement(ve.a,{allowClear:!1,style:{width:170},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:B()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:Dt||xn,value:dt.late_time?B()(dt.late_time):"",disabledDate:function(Ze){return Object(gt.b)(Ze,Ge==null?void 0:Ge.course_end_date)},disabledTime:function(Ze){return Object(gt.c)(Ze)},onChange:function(Ze,Lt){dt.late_time=Lt,An(Object.assign({},dt))}})),n.a.createElement(le.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)")))):wt.map(function(Ct,Ze){var Lt;return n.a.createElement(le.a,{span:24,key:Ze},n.a.createElement(z.a,{className:"mt25"},n.a.createElement(le.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",Ze+1,"\uFF1A"),n.a.createElement(Et.a,{disabled:Dt||!(xt!=null&&(Lt=xt.homework_status)!==null&&Lt!==void 0&&Lt.includes("\u672A\u53D1\u5E03"))&&Ct.id||(Ge==null?void 0:Ge.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Ct.group_name=="string"?[Ct.group_name]:Ct.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(en){wt[Ze].group_name=en,wt[Ze].group_id=Ct.group_id,Rn(wt.slice())}},Ge.group_settings&&Ge.group_settings.map(function(At){if(dt!=null&&dt.unified_setting&&!wt.map(function(en){return en.group_name}).toString().split(",").includes(String(At.group_name)))return n.a.createElement(Vt,{value:At.group_name,key:At.id},At.group_name);if(Cn.map(function(en){return en.group_name}).toString().split(",").includes(String(At.group_name))&&(!wt.map(function(en){return en.group_name}).toString().split(",").includes(String(At.group_name))&&B()(At.end_time)<=B()()))return n.a.createElement(Vt,{value:At.group_name,key:At.id},At.group_name)}))),n.a.createElement(le.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),n.a.createElement(et.b,{disabled:Dt||gn(Ct.id),value:{type:Ct.penalty_type,inputValue:Ct.late_minus_score},onChange:function(en){wt[Ze].late_minus_score=en.inputValue,wt[Ze].penalty_type=en.type,Rn(Object(Te.a)(wt))}})),n.a.createElement(le.a,{className:"ml20"},n.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),n.a.createElement(ve.a,{disabled:Dt||gn(Ct.id),style:{width:200},showTime:{format:"HH:mm",defaultValue:B()(Object(v.d)(),"HH:mm")},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",disabledDate:function(en){return Object(gt.b)(en,Ge==null?void 0:Ge.course_end_date)},disabledTime:function(en){return Object(gt.c)(en)},format:"YYYY-MM-DD HH:mm",value:Ct!=null&&Ct.late_time?B()(Ct.late_time):void 0,onChange:function(en,Nn){wt[Ze].late_time=Nn,Rn(Object(Te.a)(wt))}})),!Dt&&n.a.createElement(le.a,{className:"ml20"},Ze>0&&!Ct.id&&n.a.createElement(Me.a,{onClick:function(){wt=wt.filter(function(en,Nn){return Ze!==Nn}),Rn(wt.slice()),setTimeout(function(){return Rn(wt.slice())},10)}}),n.a.createElement(St.a,{className:"c-green ml20",onClick:function(){Rn(wt.concat({penalty_type:et.a.Percent,late_minus_score:20}))}}))))})),n.a.createElement("div",{style:{height:100}}),!Dt&&n.a.createElement("div",{className:Ve.a.btns},n.a.createElement(M.a,{type:"primary",loading:wn,onClick:function(){return Kn()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){pt(!0),an()}},"\u53D6\u6D88")))},Zn=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn.effects}})(dn);function Wn(kn,fn){for(var Tn=[],mn=kn;mn<fn;mn++)Tn.push(mn);return Tn}var tn=function(fn){var Tn=new Date,mn=B()(fn).format("HH");if(B()(fn).isSame(B()(Tn),"day")){var er=B()(Tn).format("HH"),rr=B()(Tn).format("mm");return{disabledHours:function(){return Wn(0,24).splice(1,er*1-1)},disabledMinutes:function(){return console.log("\u7981\u6B62\u65F6\u95F4\uFF1A",mn,er),B()(fn).isSame(B()(Tn),"hour")&&mn<=er?Wn(0,60).splice(0,rr):Wn(60,60)}}}else if(B()(fn).isSame(B()(),"day")){var J=B()().format("HH"),ge=B()().format("mm");return{disabledHours:function(){return Wn(0,24).splice(0,J)},disabledMinutes:function(){return mn<=J?Wn(0,ge):Wn(60,60)}}}else return},Hn=ve.a.RangePicker,ir=Et.a.Option,Dn=function(fn){var Tn,mn=fn.shixunHomeworks,er=fn.loading,rr=fn.dispatch,J=Object(S.i)(),ge=Object(S.h)(),Re=mn.workSetting,Ae=mn.workList,at=mn.changeData,Be=Object(i.useState)(!0),nt=Object(o.a)(Be,2),yt=nt[0],Mt=nt[1],kt=Object(i.useState)({}),Ge=Object(o.a)(kt,2),xt=Ge[0],ot=Ge[1],ut=Object(i.useState)(!1),bt=Object(o.a)(ut,2),Dt=bt[0],pt=bt[1],Kt=Nt.a.useForm(),nn=Object(o.a)(Kt,1),wn=nn[0],In=Object(i.useState)([]),yn=Object(o.a)(In,2),On=yn[0],Cn=yn[1],Ot=Object(i.useState)([]),rn=Object(o.a)(Ot,2),Ut=rn[0],wt=rn[1],Rn=Object(i.useState)(!1),bn=Object(o.a)(Rn,2),Wt=bn[0],dt=bn[1],An=Object(i.useState)([]),an=Object(o.a)(An,2),Kn=an[0],zt=an[1],En=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:""}),Ln=Object(o.a)(En,2),cn=Ln[0],dr=Ln[1];Object(i.useEffect)(function(){return xn(),function(){Cn([].concat())}},[]);var xn=function(){rr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},J)})},gn=function(At){return At&&At<B()().startOf("day")};Object(i.useEffect)(function(){var Lt;if(!(Re!=null&&Re.course_id))return;Object.keys(cn).map(function(At){cn[At]=Re[At]}),(!cn.allow_late||!cn.unified_late)&&(cn.late_penalty=5),On=JSON.parse(JSON.stringify(Re.group_settings.map(function(At){return Object(g.a)(Object(g.a)({},At),{},{group_name:[At.group_name]})}).filter(function(At){return At.publish_time!==null}))),Ut=JSON.parse(JSON.stringify(Re.allow_late_settings.map(function(At){return Object(g.a)(Object(g.a)({},At),{},{group_name:[At.group_name]})}).filter(function(At){return At.rank_forbidden_start!==null}))),dr(Object(g.a)({},cn)),Cn(Object(Te.a)(On)),((Lt=Ut)===null||Lt===void 0?void 0:Lt.length)<=0?wt([{}]):wt(Object(Te.a)(Ut))},[Re]),console.log(cn,"data");var Ct=function(){var At,en=JSON.parse(JSON.stringify(cn));if(en.categoryId=J.categoryId,cn.unified_setting||(On=(At=On)===null||At===void 0?void 0:At.map(function(Sn){var Qn;if(!Sn.publish_time||!Sn.end_time)throw p.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(!Sn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Sn.group_name=typeof(Sn==null?void 0:Sn.group_name)=="string"?[Sn==null?void 0:Sn.group_name]:Sn==null?void 0:Sn.group_name,Sn.group_id=(Qn=Re.group_settings)===null||Qn===void 0?void 0:Qn.filter(function(zn){var vr;return Sn==null||((vr=Sn.group_name)===null||vr===void 0)?void 0:vr.includes(zn.group_name)}).map(function(zn){return zn.group_id||zn.id}).toString().split(","),Sn})),en.group_settings=On,cn.rank_forbidden)if(cn.unified_setting){if(!cn.rank_forbidden_start)throw p.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(!cn.rank_forbidden_end)throw p.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(B()(cn.rank_forbidden_end)<B()(cn.rank_forbidden_start))throw p.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 Nn;Ut=(Nn=Ut)===null||Nn===void 0?void 0:Nn.map(function(Sn){var Qn,zn;if(!Sn.rank_forbidden_start)throw p.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(!Sn.rank_forbidden_end)throw p.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(!Sn.group_name)throw p.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return Sn.group_name=typeof(Sn==null?void 0:Sn.group_name)=="string"?[Sn==null?void 0:Sn.group_name]:Sn==null?void 0:Sn.group_name,Sn.group_id=Sn==null||((Qn=Sn.group_name)===null||Qn===void 0||((zn=Qn.map(function(vr){var sr,hr,Wr=(sr=Re.group_settings)===null||sr===void 0||((hr=sr.filter(function(Ur){return(Ur==null?void 0:Ur.group_name)===vr}))===null||hr===void 0)?void 0:hr[0];return Wr==null?void 0:Wr.group_id}))===null||zn===void 0))?void 0:zn.toString().split(","),Sn}),en.group_settingss=Ut}Ze(en)},Ze=function(At){if(console.log(At.total_score,At.eff_score),At.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(At!=null&&At.work_efficiency&&At.eff_score===null){p.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var en={shixun_evaluation:At.shixun_evaluation},Nn=function(){var Sn=Object(m.a)(s.a.mark(function Qn(){var zn;return s.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:return pt(!0),sr.next=3,Object(O.a)("/api/homework_commons/".concat(J.categoryId,"/public_setting.json"),{method:"post",body:Object(g.a)({},At)});case 3:zn=sr.sent,zn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),Mt(!0),xn(),rr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},J)})),pt(!1);case 6:case"end":return sr.stop()}},Qn)}));return function(){return Sn.apply(this,arguments)}}();Nn()};return n.a.createElement("section",{className:Ve.a.form},n.a.createElement(z.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"},n.a.createElement("div",{className:Ve.a.title},"\u516C\u5F00\u8BBE\u7F6E")),n.a.createElement(le.a,null,(Re==null?void 0:Re.can_edit)&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Mt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(z.a,null,n.a.createElement(le.a,{span:24,className:"mt15 mt20"},n.a.createElement(Ue.a,{checked:cn.score_open,disabled:yt,onChange:function(At){cn.score_open=At.target.checked,dr(Object.assign({},cn))}},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(le.a,{span:24,className:"mt15"},n.a.createElement(Ue.a,{checked:cn.open_code,disabled:yt,onChange:function(At){cn.open_code=At.target.checked,dr(Object.assign({},cn))}},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)")),!!cn.open_code&&n.a.createElement(le.a,{span:24,className:"mt10 ml25"},n.a.createElement(Ce.a.Group,{disabled:yt,value:cn.open_code_type,onChange:function(At){cn.open_code_type=At.target.value,dr(Object.assign({},cn))}},n.a.createElement(Ce.a,{value:0},"\u4EFB\u610F\u65F6\u95F4\u67E5\u770B"),n.a.createElement(Ce.a,{style:{marginLeft:60},value:1},"\u7EC3\u4E60\u65F6\u95F4\u7ED3\u675F\u540E"))),n.a.createElement(le.a,{span:24,className:"mt15 mt20"},n.a.createElement(Ue.a,{checked:cn.rank_forbidden,disabled:yt,onChange:function(At){cn.rank_forbidden=At.target.checked,dr(Object.assign({},cn))}},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)")),!!cn.rank_forbidden&&cn.unified_setting&&n.a.createElement(le.a,{span:24,className:"mt10 "},n.a.createElement("div",{style:{marginLeft:50}},n.a.createElement(z.a,{align:"middle",className:"mt25 "},n.a.createElement(le.a,null,"\u5F00\u59CB\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(ve.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:gn,disabledTime:tn,disabled:yt||B()()>B()(Re.rank_forbidden_start),value:cn.rank_forbidden_start?B()(cn.rank_forbidden_start):"",onChange:function(At,en){cn.rank_forbidden_start=en,(cn.end_time==""||!cn.end_time)&&cn.unified_setting&&(cn.end_time=B()(At).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),dr(Object.assign({},cn))}})),n.a.createElement(le.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(z.a,{align:"middle",className:"mt25"},n.a.createElement(le.a,null,"\u622A\u6B62\u65F6\u95F4"),n.a.createElement(le.a,{className:"ml10"},n.a.createElement(ve.a,{style:{width:170},allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:B()(Object(v.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",disabled:yt,disabledDate:gn,value:cn.rank_forbidden_end?B()(cn.rank_forbidden_end):"",onChange:function(At,en){cn.rank_forbidden_end=en,dr(Object.assign({},cn))}})),n.a.createElement(le.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("----",On),!cn.unified_setting&&((Tn=On)===null||Tn===void 0?void 0:Tn.length)>0&&!!cn.rank_forbidden&&n.a.createElement(z.a,{style:{marginTop:30,paddingTop:20,marginLeft:80,borderTop:"1px solid #eee"}},n.a.createElement(le.a,{span:24},n.a.createElement(z.a,null,n.a.createElement(le.a,{span:10}),n.a.createElement(le.a,{span:10},n.a.createElement(z.a,{className:"c-grey-c ml30"},n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u5F00\u59CB\u65F6\u95F4)"),n.a.createElement(le.a,{flex:"1"},"(\u5B66\u751F\u770B\u4E0D\u5230\u6392\u884C\u699C\u7684\u7ED3\u675F\u65F6\u95F4)"))),n.a.createElement(le.a,{span:4}))),Ut.map(function(Lt,At){var en,Nn,Sn,Qn,zn,vr,sr;return n.a.createElement(le.a,{span:24,key:At},n.a.createElement(z.a,{className:"mt25"},n.a.createElement(le.a,{style:{marginLeft:30}},n.a.createElement("span",null,"\u5C01\u699C\u89C4\u5219",At+1,"\uFF1A"),n.a.createElement(Et.a,{disabled:yt||!(Ae!=null&&(en=Ae.homework_status)!==null&&en!==void 0&&en.includes("\u672A\u53D1\u5E03"))&&Lt.id,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(Wr){Ut[At].group_name=Wr,Ut[At].group_id=Lt.group_id,wt(Ut.slice())}},Re.group_settings&&Re.group_settings.map(function(hr){if(cn!=null&&cn.unified_setting&&!Ut.map(function(Wr){return Wr.group_name}).toString().split(",").includes(String(hr.group_name)))return n.a.createElement(ir,{value:hr.group_name,key:hr.id},hr.group_name);if(On.map(function(Wr){return Wr.group_name}).toString().split(",").includes(String(hr.group_name))&&!Ut.map(function(Wr){return Wr.group_name}).toString().split(",").includes(String(hr.group_name)))return n.a.createElement(ir,{value:hr.group_name,key:hr.id},hr.group_name)}))),n.a.createElement(le.a,{span:10},n.a.createElement("div",{className:"ml30"},n.a.createElement(Hn,{allowClear:!1,disabled:yt||(Re!=null&&(Nn=Re.group_settings)!==null&&Nn!==void 0&&(Sn=Nn.filter(function(hr){return hr.id===Lt.id}))!==null&&Sn!==void 0&&(Qn=Sn[0])!==null&&Qn!==void 0&&Qn.rank_forbidden_start?B()()<B()(Re==null||((zn=Re.group_settings)===null||zn===void 0||((vr=zn.filter(function(hr){return hr.id===Lt.id}))===null||vr===void 0||((sr=vr[0])===null||sr===void 0)))?void 0:sr.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:gn,disabledTime:tn,showTime:{format:"HH:mm",defaultValue:[B()(Object(v.d)(),"HH:mm"),B()(Object(v.d)(),"HH:mm")]},format:"YYYY-MM-DD HH:mm",value:Lt.rank_forbidden_start&&[B()(Lt.rank_forbidden_start),Lt.rank_forbidden_end?B()(Lt.rank_forbidden_end):void 0],onChange:function(Wr,Ur){Ut[At].rank_forbidden_start=Ur[0],Ut[At].rank_forbidden_end=Ur[1],wt(Object(Te.a)(Ut))}}))),!yt&&n.a.createElement(le.a,{className:"ml20"},At>0&&!Lt.id&&n.a.createElement(Me.a,{onClick:function(){Ut=Ut.filter(function(Wr,Ur){return At!==Ur}),wt(Ut.slice()),setTimeout(function(){return wt(Ut.slice())},10)}}),n.a.createElement(St.a,{className:"c-green ml20",onClick:function(){wt(Ut.concat({}))}}))))})),!yt&&n.a.createElement("div",{className:Ve.a.btns},n.a.createElement(M.a,{type:"primary",loading:Dt,onClick:function(){return Ct()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){Mt(!0),xn()}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:Wt,onCancel:function(){return dt(!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(Q.a.Search,{onChange:function(At){}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(At,en){zt(At)}},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"}]}))))},Vn=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn.effects}})(Dn),qn=function(fn){var Tn,mn=fn.shixunHomeworks,er=fn.loading,rr=fn.dispatch,J=Object(S.i)(),ge=mn.workSetting,Re=mn.workList,Ae=mn.changeData,at=Object(i.useState)(!0),Be=Object(o.a)(at,2),nt=Be[0],yt=Be[1],Mt=Object(i.useState)(!1),kt=Object(o.a)(Mt,2),Ge=kt[0],xt=kt[1],ot=Object(i.useState)(!1),ut=Object(o.a)(ot,2),bt=ut[0],Dt=ut[1],pt=Nt.a.useForm(),Kt=Object(o.a)(pt,1),nn=Kt[0],wn=Object(i.useState)([]),In=Object(o.a)(wn,2),yn=In[0],On=In[1],Cn=Object(i.useState)([]),Ot=Object(o.a)(Cn,2),rn=Ot[0],Ut=Ot[1],wt=!(Re!=null&&(Tn=Re.homework_status)!==null&&Tn!==void 0&&Tn.includes("\u672A\u53D1\u5E03")),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,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}),bn=Object(o.a)(Rn,2),Wt=bn[0],dt=bn[1];Object(i.useEffect)(function(){return An(),function(){On([].concat())}},[]);var An=function(){rr({type:"shixunHomeworks/getWorkSetting",payload:Object(g.a)({},J)})};Object(i.useEffect)(function(){if(!(ge!=null&&ge.course_id))return;Object.keys(Wt).map(function(En){Wt[En]=ge[En]}),(!Wt.allow_late||!Wt.unified_late)&&(Wt.late_penalty=5),yn=JSON.parse(JSON.stringify(ge.group_settings.map(function(En){return Object(g.a)(Object(g.a)({},En),{},{group_name:[En.group_name]})}).filter(function(En){return En.publish_time!==null}))),rn=JSON.parse(JSON.stringify(ge.allow_late_settings.map(function(En){return Object(g.a)(Object(g.a)({},En),{},{group_name:[En.group_name]})}).filter(function(En){return En.late_time!==null}))),zt(),dt(Object(g.a)({},Wt)),On(Object(Te.a)(yn)),Ut(Object(Te.a)(rn))},[ge]);var an=function(){var Ln=JSON.parse(JSON.stringify(Wt));Kn(Ln)},Kn=function(Ln){if(console.log(Ln.total_score,Ln.eff_score),Ln.total_score===null){p.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}var cn=function(){var dr=Object(m.a)(s.a.mark(function xn(){var gn;return s.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:return xt(!0),Ze.next=3,Object(O.a)("/api/homework_commons/".concat(J.categoryId,"/hack_score_setting.json"),{method:"post",body:Object(g.a)({},Ln)});case 3:gn=Ze.sent,gn.status===0&&(p.b.success("\u66F4\u65B0\u6210\u529F"),yt(!0),An(),rr({type:"shixunHomeworks/getWorkList",payload:Object(g.a)({},J)})),xt(!1);case 6:case"end":return Ze.stop()}},xn)}));return function(){return dr.apply(this,arguments)}}();(Wt==null?void 0:Wt.hack_score_settings)!==(ge==null?void 0:ge.hack_score_settings)&&wt?a.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:cn}):cn()},zt=function(){var Ln,cn=Wt.total_score,dr=(Ln=Wt.hack_settings)===null||Ln===void 0?void 0:Ln.length,xn=0,gn;switch(Wt.hack_score_settings){case 0:var Ct=(cn/dr).toFixed(2);Wt.hack_settings.map(function(zn,vr){xn=vr,zn.hack_score=Ct>0?Ct:0}),gn=(cn-Ct*(dr-1)).toFixed(2),Wt.hack_settings[xn].hack_score=gn>0?gn:0;break;case 1:var Ze=[0,1,3,6],Lt=0,At=Wt.hack_settings.filter(function(zn){return zn.difficult===1}).length*Ze[1],en=Wt.hack_settings.filter(function(zn){return zn.difficult===2}).length*Ze[2],Nn=Wt.hack_settings.filter(function(zn){return zn.difficult===3}).length*Ze[3],Sn=cn/(At+en+Nn);console.log(Sn,2222),Wt.hack_settings.map(function(zn,vr){xn=vr,zn.hack_score=(Ze[zn.difficult]*Sn).toFixed(2),Lt=Lt+Number(zn.hack_score)});var Qn=Wt.hack_settings[xn].hack_score;gn=(cn-Lt+Number(Qn)).toFixed(2),Wt.hack_settings[xn].hack_score=gn>0?gn:0;break}};return n.a.createElement("section",{className:Ve.a.form},n.a.createElement(z.a,{align:"middle"},n.a.createElement(le.a,{flex:"1"}),n.a.createElement(le.a,null,(ge==null?void 0:ge.can_edit)&&n.a.createElement(M.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return yt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E"))),n.a.createElement(z.a,{align:"middle"},n.a.createElement(le.a,null,n.a.createElement("span",null,"\u603B\u5206\u503C"),n.a.createElement($e.a,{min:0,className:"ml10 mr10",style:{width:160},value:Wt.total_score,disabled:nt||wt,onChange:function(Ln){Wt.total_score=Ln,dt(Object.assign({},Wt)),zt()}}),"\xA0\u5206"),n.a.createElement(le.a,{style:{marginLeft:100}},n.a.createElement("span",null,"\u6D4B\u8BC4\u5355\u6B21\u62A5\u9519\u589E\u52A0\u65F6\u957F"),n.a.createElement($e.a,{className:"ml10 mr10",style:{width:160},min:0,value:Wt.punish_time,precision:0,disabled:nt,onChange:function(Ln){Wt.punish_time=Ln,dt(Object.assign({},Wt)),zt()}}),"\xA0\u5206\u949F")),n.a.createElement(z.a,{align:"middle",style:{marginTop:20}},n.a.createElement(le.a,null,n.a.createElement("span",null,"\u8BD5\u9898\u5206\u503C\u8BBE\u7F6E\u89C4\u5219")),n.a.createElement(le.a,{flex:"1"},n.a.createElement(Nt.a.Item,{className:"ml20"},n.a.createElement(Ce.a.Group,{disabled:nt||wt,value:Wt.hack_score_settings,onChange:function(Ln){Wt.hack_score_settings=Ln.target.value,dt(Object.assign({},Wt)),zt()}},n.a.createElement(Ce.a,{value:0},"\u5747\u5206\u6BD4\u4F8B"),n.a.createElement(Ce.a,{className:"ml20 mr20",value:1},"\u96BE\u6613\u5EA6"),n.a.createElement(Ce.a,{value:2},"\u81EA\u5B9A\u4E49\u5206\u503C"))))),n.a.createElement("div",{className:Ve.a.hackList},Wt.hack_settings&&Wt.hack_settings.map(function(En,Ln){return n.a.createElement(z.a,{key:Ln,align:"middle",style:{marginTop:20}},n.a.createElement(le.a,{flex:"1",className:"pr10"},n.a.createElement("strong",null,En.hack_name)),n.a.createElement(le.a,{flex:"150px"},n.a.createElement($e.a,{min:0,step:.1,value:En.hack_score,disabled:nt||Wt.hack_score_settings!==2||wt,onChange:function(dr){Wt.hack_settings[Ln].hack_score=dr;var xn=Wt.hack_settings.reduce(function(gn,Ct){return gn+Number(Ct.hack_score)},0);Wt.total_score=xn.toFixed(2),dt(Object(g.a)({},Wt))}}),n.a.createElement("span",{className:"ml10"},"\u5206")),n.a.createElement(le.a,{style:{lineHeight:"20px"}},En.difficult===1&&n.a.createElement("span",{className:"tag-style-border-small bg-green c-white mr10"},"\u7B80\u5355"),En.difficult===2&&n.a.createElement("span",{className:"tag-style-border-small bg-blue c-white mr10"},"\u9002\u4E2D"),En.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}}),!nt&&n.a.createElement("div",{className:Ve.a.btns},n.a.createElement(M.a,{type:"primary",loading:Ge,onClick:function(){return an()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",ghost:!0,className:"ml20",onClick:function(){yt(!0),An()}},"\u53D6\u6D88")))},Mr=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn.effects}})(qn),Sr=function(fn){var Tn,mn,er=fn.shixunHomeworks,rr=fn.loading,J=fn.dispatch,ge=Object(i.useState)(!0),Re=Object(o.a)(ge,2),Ae=Re[0],at=Re[1],Be=Object(i.useState)(!1),nt=Object(o.a)(Be,2),yt=nt[0],Mt=nt[1],kt=Object(i.useState)([]),Ge=Object(o.a)(kt,2),xt=Ge[0],ot=Ge[1],ut=Object(i.useState)([]),bt=Object(o.a)(ut,2),Dt=bt[0],pt=bt[1],Kt=Object(i.useState)([]),nn=Object(o.a)(Kt,2),wn=nn[0],In=nn[1],yn=Object(i.useState)([]),On=Object(o.a)(yn,2),Cn=On[0],Ot=On[1],rn=Object(S.i)();function Ut(){return wt.apply(this,arguments)}function wt(){return wt=Object(m.a)(s.a.mark(function dt(){var An;return s.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(O.a)("/api/homework_commons/".concat(rn.categoryId,"/homework_common_collaborators.json"),{method:"get"});case 2:An=Kn.sent,pt(An);case 4:case"end":return Kn.stop()}},dt)})),wt.apply(this,arguments)}function Rn(){return bn.apply(this,arguments)}function bn(){return bn=Object(m.a)(s.a.mark(function dt(){var An;return s.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(O.a)("/api/courses/".concat(rn==null?void 0:rn.coursesId,"/teachers"),{method:"get",params:{homework_id:rn.categoryId}});case 2:An=Kn.sent,An==null||An.teacher_list.map(function(zt){zt.key=zt.user_id}),In(An==null?void 0:An.teacher_list),Ot(An==null?void 0:An.teacher_list);case 6:case"end":return Kn.stop()}},dt)})),bn.apply(this,arguments)}Object(i.useEffect)(function(){Ut(),Rn()},[rn]);var Wt=function(){};return n.a.createElement("section",{className:Ve.a.form},n.a.createElement(z.a,null,n.a.createElement(le.a,{flex:"1"},n.a.createElement("span",{style:{fontSize:"16px"}},"\u534F\u4F5C\u8BBE\u7F6E"),(Dt==null?void 0:Dt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",color:"#0152d9",marginLeft:"10px"},onClick:function(){Mt(!0)}},"+\u6DFB\u52A0\u534F\u4F5C\u8005"))),n.a.createElement(z.a,{style:{marginTop:"20px",marginBottom:"20px"}},(Dt==null||((Tn=Dt.data)===null||Tn===void 0)?void 0:Tn.length)<=0&&n.a.createElement(q.a,{customText:"\u8BE5\u4F5C\u4E1A\u6682\u65E0\u534F\u4F5C\u8005"}),Dt==null||((mn=Dt.data)===null||mn===void 0)?void 0:mn.map(function(dt){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"}},dt==null?void 0:dt.real_name),(Dt==null?void 0:Dt.can_edit)&&n.a.createElement("span",{style:{cursor:"pointer",marginLeft:"10px"},onClick:Object(m.a)(s.a.mark(function An(){var an;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(rn.categoryId,"/homework_common_collaborators/delete.json"),{method:"delete",body:{user_id:dt.id}});case 2:an=zt.sent,an.status===0&&(p.b.info("\u5220\u9664\u6210\u529F"),Ut(),Rn());case 4:case"end":return zt.stop()}},An)}))},"X"))})),n.a.createElement(z.a,null,!Ae&&n.a.createElement(le.a,{className:"mb50"},n.a.createElement(M.a,{type:"primary",size:"large",onClick:function(){return Wt()}},"\u63D0\u4EA4"),n.a.createElement(M.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){at(!0)}},"\u53D6\u6D88"))),n.a.createElement(a.a,{title:"\u6DFB\u52A0\u534F\u4F5C\u8005",visible:yt,onCancel:function(){return Mt(!1)},onOk:Object(m.a)(s.a.mark(function dt(){var An;return s.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if(!(xt.length===0)){Kn.next=3;break}return p.b.info("\u8BF7\u9009\u62E9\u534F\u4F5C\u8001\u5E08"),Kn.abrupt("return");case 3:return Kn.next=5,Object(O.a)("/api/homework_commons/".concat(rn.categoryId,"/homework_common_collaborators.json"),{method:"post",body:{user_ids:xt}});case 5:An=Kn.sent,An.status===0&&(p.b.info("\u6DFB\u52A0\u6210\u529F"),ot([]),Ut(),Rn(),Mt(!1));case 7:case"end":return Kn.stop()}},dt)}))},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(Q.a.Search,{onChange:function(An){In(Cn.filter(function(an){return an.name.indexOf(An.target.value)>-1}))}})),n.a.createElement(V.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(An,an){ot(An)},selectedRowKeys:xt,getCheckboxProps:function(An){return{disabled:An.is_collaborator}}},pagination:!1,dataSource:wn,columns:[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u89D2\u8272",dataIndex:"role",key:"role"}]}))))},on=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn.effects}})(Sr),Jn=ve.a.RangePicker,oi=Et.a.Option,xi=function(fn){var Tn=fn.shixunHomeworks,mn=fn.loading,er=fn.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(Zn,null)),n.a.createElement(G.a.TabPane,{tab:"\u8BC4\u5206\u8BBE\u7F6E",key:2},n.a.createElement(Mr,null)),n.a.createElement(G.a.TabPane,{tab:"\u516C\u5F00\u8BBE\u7F6E",key:3},n.a.createElement(Vn,null)),n.a.createElement(G.a.TabPane,{tab:"\u534F\u4F5C\u8BBE\u7F6E",key:4},n.a.createElement(on,null))))},Jr=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn.effects}})(xi),Yr=D("RotF"),Lr=D.n(Yr),Yn=function(fn){var Tn,mn=fn.shixunHomeworks,er=fn.loading,rr=fn.dispatch,J=Object(S.i)(),ge=Object(S.h)(),Re=Object(i.useState)([]),Ae=Object(o.a)(Re,2),at=Ae[0],Be=Ae[1],nt=Object(i.useState)([]),yt=Object(o.a)(nt,2),Mt=yt[0],kt=yt[1],Ge=Object(i.useState)(!0),xt=Object(o.a)(Ge,2),ot=xt[0],ut=xt[1],bt=Object(i.useState)(!1),Dt=Object(o.a)(bt,2),pt=Dt[0],Kt=Dt[1],nn=Object(i.useState)(1),wn=Object(o.a)(nn,2),In=wn[0],yn=wn[1],On=Object(i.useState)([]),Cn=Object(o.a)(On,2),Ot=Cn[0],rn=Cn[1],Ut=Object(i.useState)(!1),wt=Object(o.a)(Ut,2),Rn=wt[0],bn=wt[1],Wt=Object(i.useState)(!1),dt=Object(o.a)(Wt,2),An=dt[0],an=dt[1];Object(i.useEffect)(function(){mn.actionTabs.key==="\u4EE3\u7801\u67E5\u91CD"?(En.resetFields(),Be([]),bn(!0),cn()):bn(!1)},[mn.actionTabs.key]);var Kn=Nt.a.useForm(),zt=Object(o.a)(Kn,1),En=zt[0],Ln=[],cn=function(){var gn=Object(m.a)(s.a.mark(function Ct(){var Ze,Lt,At;return s.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:if(!(ot&&!pt)){Nn.next=11;break}return Kt(!0),yn(In+1),Nn.next=5,Object(ee.x)(Object(g.a)(Object(g.a)({},J),{},{page:In}));case 5:Lt=Nn.sent,At=Object(Te.a)(Lt.group_list),Lt!=null&&Lt.ungroup_list&&At.push({id:Lt==null?void 0:Lt.ungroup_list.id,name:Lt==null?void 0:Lt.ungroup_list.name,works_count:Lt==null?void 0:Lt.ungroup_list.work_count,last_review_time:Lt==null?void 0:Lt.ungroup_list.last_review_time}),Be([].concat(Object(Te.a)(at),Object(Te.a)(At))),Kt(!1),((Ze=Lt.group_list)===null||Ze===void 0?void 0:Ze.length)<10&&ut(!1);case 11:case"end":return Nn.stop()}},Ct)}));return function(){return gn.apply(this,arguments)}}(),dr=function(){rr({type:"shixunHomeworks/setActionTabs",payload:{}}),an(!1),ut(!0),Kt(!1),yn(1),Be([]),En.resetFields()},xn=[{title:"",dataIndex:"id",width:280,render:function(Ct,Ze){return n.a.createElement(Ue.a,{disabled:!(Ze.works_count>1),value:String(Ze.id)},Ze.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(a.a,{centered:!0,title:"\u4EE3\u7801\u67E5\u91CD",keyboard:!1,maskClosable:!1,visible:Rn,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",width:820,bodyStyle:{minHeight:200},onOk:Object(m.a)(s.a.mark(function gn(){var Ct,Ze;return s.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return Ct=En.getFieldValue(),At.next=3,Object(O.a)("/api/homework_commons/".concat(J.categoryId,"/hack_homework_code_repeat.json"),{method:"post",body:{group_ids:Object(Te.a)(Ct.group_ids)}});case 3:if(Ze=At.sent,!(Ze.status===0)){At.next=11;break}return dr(),p.b.success("\u64CD\u4F5C\u6210\u529F"),At.next=9,rr({type:"shixunHomeworks/getWorkList",payload:mn.actionTabs.params});case 9:R.d.push("/classrooms/".concat(J.coursesId,"/program_homework/").concat(J.categoryId,"/detail?tabs=2")),rr({type:"shixunHomeworks/setActionTabs",payload:{key:"\u6267\u884C\u4EE3\u7801\u67E5\u91CD"}});case 11:case"end":return At.stop()}},gn)})),onCancel:dr},mn.codeReviewCourse&&n.a.createElement(Nt.a,{form:En,onChange:function(Ct){rn(Object(g.a)({},En.getFieldValue()))},initialValues:(Tn={},Object(Ye.a)(Tn,"group_ids",Ln),Object(Ye.a)(Tn,"end_time",B()(B()().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:xn})),n.a.createElement(Nt.a.Item,{name:"group_ids"},n.a.createElement(Ue.a.Group,{className:"w100"},n.a.createElement("div",{style:{width:"100%",maxHeight:260,overflow:"auto"}},n.a.createElement(Lr.a,{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(Ct){cn()},hasMore:ot,useWindow:!1},n.a.createElement(V.a,{loading:er.effects["shixunHomeworks/getCodeReviewCourse"],showHeader:!1,columns:xn,dataSource:at,pagination:!1})))))),n.a.createElement(z.a,null,n.a.createElement(le.a,{className:"ml10"},n.a.createElement(Ue.a,{checked:An,onChange:function(Ct){an(Ct.target.checked);var Ze=[];Ct.target.checked&&(Ze=at.filter(function(Lt){return Lt.works_count>1}).map(function(Lt){return Lt.id+""})),En.setFieldsValue(Object(Ye.a)({},"group_ids",Ze))}},"\u5168\u9009"))))},mi=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading;return{shixunHomeworks:fn,loading:Tn}})(Yn),hn=D("nPLb"),ei=D("XpUO"),zr=D("bTeP"),wi=D.n(zr),gi=D("HBuW"),ri=D("NLgs"),Bi=D("m3rI"),Hi=D("+92d"),ii=D.n(Hi),wr=D("wwSX"),Oi=D.n(wr),Ri=D("zlzj"),di=D.n(Ri),_i=D("deN7"),oa=[ii.a,Oi.a,di.a],$i=function(fn){var Tn,mn,er=fn.user,rr=Object(i.useState)(Object(g.a)(Object(g.a)({},Object(S.i)()),{},{page:1,per_page:10,rank_type:2,course_group:Object(Y.t)()?[er.userInfo.course.course_group_id]:[]},Object(S.i)())),J=Object(o.a)(rr,2),ge=J[0],Re=J[1],Ae=Object(i.useState)([]),at=Object(o.a)(Ae,2),Be=at[0],nt=at[1],yt=Object(i.useState)([]),Mt=Object(o.a)(yt,2),kt=Mt[0],Ge=Mt[1],xt=Object(i.useState)([]),ot=Object(o.a)(xt,2),ut=ot[0],bt=ot[1],Dt=Object(i.useState)(!1),pt=Object(o.a)(Dt,2),Kt=pt[0],nn=pt[1],wn=Object(i.useState)([{title:"\u6392\u884C",dataIndex:"rank",width:100,fixed:"left",render:function(Ut,wt,Rn){return Ut<4?n.a.createElement("img",{src:oa[Ut-1]}):Ut}},{title:"\u7528\u6237",dataIndex:"user_name",width:150,fixed:"left",key:"user_name",render:function(Ut,wt,Rn){return n.a.createElement("div",null,n.a.createElement("img",{style:{width:30,height:30,borderRadius:"50%",marginRight:10},src:Bi.a.IMG_SERVER+"/images/"+(wt==null?void 0:wt.image_url)}),Ut)}},{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(Ut){return Ut||"- -"}},{title:"\u901A\u8FC7",dataIndex:"passed_count",width:100,fixed:"left",key:"passed_count"},{title:"\u5F97\u5206",dataIndex:"score",width:100,fixed:"left",key:"score"}]),In=Object(o.a)(wn,2),yn=In[0],On=In[1];Object(i.useEffect)(function(){yn.splice(7);for(var rn=function(bn){var Wt,dt,An,an,Kn={};Kn.title=Be!=null&&Be.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(bn+1)+"\uFF08".concat(Be==null||((Wt=Be.question_data)===null||Wt===void 0||((dt=Wt[bn])===null||dt===void 0))?void 0:dt.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function zt(){var En,Ln,cn;return s.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:return xn.next=2,Object(O.a)("/api/problems/".concat(Be==null||((En=Be.question_data)===null||En===void 0||((Ln=En[bn])===null||Ln===void 0))?void 0:Ln.identifier,"/start.json"),{method:"get"});case 2:cn=xn.sent,cn&&(window.open("/myproblems/".concat(cn==null?void 0:cn.identifier,"?type=1")),localStorage.setItem("program_homework",[ge.coursesId,ge.categoryId]));case 4:case"end":return xn.stop()}},zt)}))},"\u9898\u76EE"+(bn+1)+"\uFF08".concat(Be==null||((An=Be.question_data)===null||An===void 0||((an=An[bn])===null||an===void 0))?void 0:an.question_score,"\uFF09")),Kn.dataIndex="question_data",Kn.width=250,Kn.render=function(zt,En){var Ln,cn,dr,xn,gn;return n.a.createElement("div",null,(zt==null||((Ln=zt[bn])===null||Ln===void 0)?void 0:Ln.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 Ct(){var Ze,Lt,At,en,Nn,Sn,Qn,zn;return s.a.wrap(function(sr){for(;;)switch(sr.prev=sr.next){case 0:if(zt!=null&&(Ze=zt[bn])!==null&&Ze!==void 0&&Ze.open_code){sr.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),sr.abrupt("return");case 3:return sr.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,homework_common_id:ge.categoryId,hack_user_code_id:zt==null||((Lt=zt[bn])===null||Lt===void 0)?void 0:Lt.hack_user_code_id})});case 5:zn=sr.sent,a.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||((At=zt[bn])===null||At===void 0)?void 0:At.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",zt==null||((en=zt[bn])===null||en===void 0)?void 0:en.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",zt==null||((Nn=zt[bn])===null||Nn===void 0)?void 0:Nn.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",zt==null||((Sn=zt[bn])===null||Sn===void 0)?void 0:Sn.score)),content:n.a.createElement(_i.a,{languages:[{language:zt==null||((Qn=zt[bn])===null||Qn===void 0)?void 0:Qn.language,code:zn==null?void 0:zn.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 sr.stop()}},Ct)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(zt==null||((cn=zt[bn])===null||cn===void 0)?void 0:cn.answer_question_time)||"- -"),zt!=null&&(dr=zt[bn])!==null&&dr!==void 0&&dr.submit_count?n.a.createElement(L.a,{title:"".concat((zt==null||((xn=zt[bn])===null||xn===void 0)?void 0:xn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(zt==null||((gn=zt[bn])===null||gn===void 0)?void 0:gn.submit_count)||0):null))},yn.push(Kn)},Ut=0;Ut<(Be==null||((wt=Be.question_data)===null||wt===void 0)?void 0:wt.length);Ut++){var wt;rn(Ut)}On(Object(Te.a)(yn))},[Be==null?void 0:Be.question_data]),Object(i.useEffect)(function(){var rn;er!=null&&(rn=er.userInfo)!==null&&rn!==void 0&&rn.course&&(Object(Y.t)()&&(ge.course_group=Object(Y.t)()?[er.userInfo.course.course_group_id]:[],Re(Object(g.a)({},ge))),Cn(1))},[er==null?void 0:er.userInfo]);function Cn(rn){return Ot.apply(this,arguments)}function Ot(){return Ot=Object(m.a)(s.a.mark(function rn(Ut){var wt,Rn,bn,Wt,dt,An,an;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return nn(!0),zt.next=3,Object(O.a)("/api/courses/rank_list.json",{method:"get",params:Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,rank_type:2,homework_common_id:ge.categoryId})});case 3:if(wt=zt.sent,nt(wt),nn(!1),Object(Y.t)()?(Ut===1&&Ge([wt==null||((Rn=wt.course_group)===null||Rn===void 0||((bn=Rn[0])===null||bn===void 0))?void 0:bn.id]),wt!=null&&wt.my_rank?bt([wt==null?void 0:wt.my_rank].concat(Object(Te.a)(wt==null?void 0:wt.rank_list))):bt(Object(Te.a)(wt==null?void 0:wt.rank_list))):bt(Object(Te.a)(wt==null?void 0:wt.rank_list)),Ut===1){for(Wt={title:n.a.createElement(L.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(wt==null?void 0:wt.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"},yn.push(Wt),dt=function(Ln){var cn,dr,xn,gn,Ct={};Ct.title=wt!=null&&wt.sent_type?n.a.createElement("span",null,"\u9898\u76EE"+(Ln+1)+"\uFF08".concat(wt==null||((cn=wt.question_data)===null||cn===void 0||((dr=cn[Ln])===null||dr===void 0))?void 0:dr.question_score,"\uFF09")):n.a.createElement("a",{onClick:Object(m.a)(s.a.mark(function Ze(){var Lt,At,en;return s.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(O.a)("/api/problems/".concat(wt==null||((Lt=wt.question_data)===null||Lt===void 0||((At=Lt[Ln])===null||At===void 0))?void 0:At.identifier,"/start.json"),{method:"get"});case 2:en=Sn.sent,en&&(window.open("/myproblems/".concat(en==null?void 0:en.identifier,"?type=1")),localStorage.setItem("program_homework",[ge.coursesId,ge.categoryId]));case 4:case"end":return Sn.stop()}},Ze)}))},"\u9898\u76EE"+(Ln+1)+"\uFF08".concat(wt==null||((xn=wt.question_data)===null||xn===void 0||((gn=xn[Ln])===null||gn===void 0))?void 0:gn.question_score,"\uFF09")),Ct.dataIndex="question_data",Ct.width=250,Ct.render=function(Ze,Lt){var At,en,Nn,Sn,Qn;return n.a.createElement("div",null,(Ze==null||((At=Ze[Ln])===null||At===void 0)?void 0:At.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 zn(){var vr,sr,hr,Wr,Ur,Br,li,ui;return s.a.wrap(function(je){for(;;)switch(je.prev=je.next){case 0:if(Ze!=null&&(vr=Ze[Ln])!==null&&vr!==void 0&&vr.open_code){je.next=3;break}return p.b.info("\u6682\u4E0D\u5141\u8BB8\u67E5\u770B\u4EE3\u7801"),je.abrupt("return");case 3:return je.next=5,Object(O.a)("/api/courses/view_code.json",{method:"get",params:Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,homework_common_id:ge.categoryId,hack_user_code_id:Ze==null||((sr=Ze[Ln])===null||sr===void 0)?void 0:sr.hack_user_code_id})});case 5:ui=je.sent,a.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",Ze==null||((hr=Ze[Ln])===null||hr===void 0)?void 0:hr.current_language),n.a.createElement("span",null,"\u8FD0\u884C\u5185\u5B58\uFF1A",Ze==null||((Wr=Ze[Ln])===null||Wr===void 0)?void 0:Wr.memory,"\uFF08KB\uFF09"),n.a.createElement("span",null,"\u8FD0\u884C\u65F6\u957F\uFF1A",Ze==null||((Ur=Ze[Ln])===null||Ur===void 0)?void 0:Ur.run_time,"\uFF08ms\uFF09"),n.a.createElement("span",null,"\u5F97\u5206\uFF1A",Ze==null||((Br=Ze[Ln])===null||Br===void 0)?void 0:Br.score)),content:n.a.createElement(_i.a,{languages:[{language:Ze==null||((li=Ze[Ln])===null||li===void 0)?void 0:li.language,code:ui==null?void 0:ui.code}],v:Ze,shixunWorkReport:"shixunWorkReport",dispatch:"dispatch",autoHeight:!1,language:Ze.language,game_id:Ze.id,diff_code_count:Ze.diff_code_count})});case 7:case"end":return je.stop()}},zn)}))}),n.a.createElement("span",{style:{margin:"0px 10px"}},(Ze==null||((en=Ze[Ln])===null||en===void 0)?void 0:en.answer_question_time)||"- -"),Ze!=null&&(Nn=Ze[Ln])!==null&&Nn!==void 0&&Nn.submit_count?n.a.createElement(L.a,{title:"".concat((Ze==null||((Sn=Ze[Ln])===null||Sn===void 0)?void 0:Sn.submit_count)||0,"\u6B21\u5C1D\u8BD5\u51FA\u9519")},n.a.createElement("span",{style:{color:"red",marginRight:5},className:"iconfont icon-Bug"}),(Ze==null||((Qn=Ze[Ln])===null||Qn===void 0)?void 0:Qn.submit_count)||0):null))},yn.push(Ct)},An=0;An<(wt==null||((an=wt.question_data)===null||an===void 0)?void 0:an.length);An++)dt(An);On(Object(Te.a)(yn))}case 8:case"end":return zt.stop()}},rn)})),Ot.apply(this,arguments)}return console.log("----",yn),n.a.createElement("div",{style:{width:1200,margin:"0px auto"}},(Be==null?void 0:Be.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(Ue.a.Group,{className:wi.a.checkboxgroup,value:kt,onChange:function(Ut){if(ge.type===1)Ge([]),ge.course_group=[],ge.page=1,Re(Object(g.a)({},ge)),Cn();else if(ge.type===2){var wt;Ge(["\u5168\u90E8"].concat()),ge.course_group=Be==null||((wt=Be.course_group)===null||wt===void 0)?void 0:wt.map(function(Rn){return Rn.id}),ge.page=1,Re(Object(g.a)({},ge)),Cn()}else Ge(Object(Te.a)(Ut.filter(function(Rn){return Rn!="\u5168\u90E8"}))),ge.course_group=Ut.filter(function(Rn){return Rn!="\u5168\u90E8"}),ge.page=1,Re(Object(g.a)({},ge)),Cn()}},n.a.createElement(Ue.a,{value:"\u5168\u90E8",onChange:function(Ut){Ut.target.checked?ge.type=2:ge.type=1}},"\u5168\u90E8\u5206\u73ED"),Be==null||((Tn=Be.course_group)===null||Tn===void 0)?void 0:Tn.map(function(rn,Ut){return n.a.createElement(Ue.a,{onChange:function(Rn){ge.type=3},value:rn.id},rn==null?void 0:rn.name)}))),Object(Y.t)()&&n.a.createElement(Ce.a.Group,{onChange:function(Ut){Ut.target.value==="\u5168\u90E8"?(ge.course_group=[],ge.page=1,Re(Object(g.a)({},ge)),Cn()):(ge.course_group=[Ut.target.value],ge.page=1,Re(Object(g.a)({},ge)),Cn())},defaultValue:er.userInfo.course.course_group_id},n.a.createElement(Ce.a,{value:"\u5168\u90E8"},"\u5168\u90E8\u5206\u73ED"),Be==null||((mn=Be.course_group)===null||mn===void 0)?void 0:mn.map(function(rn,Ut){return n.a.createElement(Ce.a,{value:rn.id},rn.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(){a.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(xe.v)(Object(g.a)(Object(g.a)({},ge),{},{id:ge.coursesId,rank_type:2,homework_common_id:ge.categoryId}))}},"\u5BFC\u51FA")),n.a.createElement(f.a,{spinning:Kt},n.a.createElement(V.a,{style:{marginTop:10},pagination:!1,scroll:{x:1200},rowClassName:function(Ut,wt){return wt===0&&Object(Y.t)()&&wi.a.tables},dataSource:ut,columns:yn})),n.a.createElement("div",{style:{width:"100%",textAlign:"center",marginTop:10}},n.a.createElement(_.a,{current:ge.page,pageSize:ge.per_page,total:Be==null?void 0:Be.count,hideOnSinglePage:!0,onChange:function(Ut,wt){ge.page=Ut,ge.per_page=wt,Re(Object(g.a)({},ge)),Cn()}}))))},yr=Object(R.a)(function(kn){var fn=kn.user;return{user:fn}})($i),br=[{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%"}],si=function(fn){var Tn,mn=fn.shixunHomeworks,er=fn.globalSetting,rr=fn.loading,J=fn.dispatch,ge=Object(S.i)(),Re=Object(S.h)(),Ae=Object(S.g)(),at=Object(i.useState)([]),Be=Object(o.a)(at,2),nt=Be[0],yt=Be[1],Mt=Object(i.useState)(Re.query.tabs||"0"),kt=Object(o.a)(Mt,2),Ge=kt[0],xt=kt[1],ot=Object(i.useState)({}),ut=Object(o.a)(ot,2),bt=ut[0],Dt=ut[1],pt=mn.workList,Kt=Object(i.useState)(!1),nn=Object(o.a)(Kt,2),wn=nn[0],In=nn[1],yn;ge.category=Re.query.category_id,ge.order="work_score",ge.b_order="desc";var On=function(Wt){xt(Wt),Wt==="0"&&J({type:"shixunHomeworks/getWorkList",payload:ge})},Cn=function(){a.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 Wt=Object(m.a)(s.a.mark(function An(){var an,Kn,zt;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:return Kn=(an=mn.workList)===null||an===void 0?void 0:an.myshixun_identifier,Ln.next=3,Object(ee.X)({id:Kn});case 3:zt=Ln.sent,zt&&(p.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`),J({type:"shixunHomeworks/getWorkList",payload:bt}));case 5:case"end":return Ln.stop()}},An)}));function dt(){return Wt.apply(this,arguments)}return dt}()})},Ot=function bn(Wt){var dt;Wt=(dt=Wt)!==null&&dt!==void 0&&dt.includes(".json")?Wt:"".concat(Wt,".json"),a.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 An=Object(m.a)(s.a.mark(function Kn(){var zt,En;return s.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(gi.Cb)({url:Wt});case 2:if(zt=cn.sent,zt){cn.next=5;break}return cn.abrupt("return");case 5:return p.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),cn.next=8,Object(gi.E)({id:zt.shixun_identifier});case 8:if(En=cn.sent,!(En!=null&&En.game_identifier)){cn.next=12;break}return Object(v.S)("/tasks/".concat(En.game_identifier,"?coursesId=").concat(ge.coursesId)),cn.abrupt("return");case 12:(En==null?void 0:En.status)===2?bn(En==null?void 0:En.message):(En==null?void 0:En.status)===3&&rn(En==null?void 0:En.message);case 13:case"end":return cn.stop()}},Kn)}));function an(){return An.apply(this,arguments)}return an}()})},rn=function(Wt){a.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",Wt,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},Ut=function(){var bn=Object(m.a)(s.a.mark(function Wt(dt){var An,an;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return dt=(An=dt)!==null&&An!==void 0&&An.includes(".json")?dt:"".concat(dt,".json"),zt.next=3,Object(gi.Cb)({url:dt});case 3:if(an=zt.sent,console.log(an,"execRes"),!(an!=null&&an.game_identifier)){zt.next=8;break}return Object(v.S)("/tasks/".concat(an.game_identifier,"?coursesId=").concat(ge.coursesId)),zt.abrupt("return");case 8:(an==null?void 0:an.status)===-3?Object(v.q)():(an==null?void 0:an.status)===2?Ot(an==null?void 0:an.message):(an==null?void 0:an.status)===3&&rn(an==null?void 0:an.message);case 9:case"end":return zt.stop()}},Wt)}));return function(dt){return bn.apply(this,arguments)}}(),wt=[{name:"\u4F5C\u4E1A\u5217\u8868",id:"0",compontent:n.a.createElement(ct,{setExportParams:Dt}),forceRender:!0},{name:"\u4F5C\u4E1A\u8BE6\u60C5",id:"1",compontent:n.a.createElement(Qe,null)},{name:"\u6392\u884C\u699C",id:"5",compontent:n.a.createElement(yr,null)},{name:"\u4EE3\u7801\u67E5\u91CD",id:"2",compontent:n.a.createElement(Qt,null)},{name:Object(Y.c)()?"\u9AD8\u7EA7\u8BBE\u7F6E":"\u5F97\u5206\u89C4\u5219",id:"3",compontent:n.a.createElement(Jr,null)},{name:n.a.createElement("a",{style:{color:"#b9b8b8"},href:"/classrooms/".concat(ge.coursesId,"/program_homework/").concat(ge.categoryId,"/answer")},"\u89E3\u7B54&\u8BA8\u8BBA"),id:"6",compontent:!1}].filter(function(bn){var Wt;if(Object(Y.t)())return bn.name!=="\u4EE3\u7801\u67E5\u91CD";if(Object(Y.t)()||(pt==null||((Wt=pt.homework_status)===null||Wt===void 0)?void 0:Wt[0])!=="\u5DF2\u622A\u6B62")return bn.name!=="\u8D28\u91CF\u68C0\u6D4B";var dt;return!pt.code_review&&(pt==null||((dt=pt.homework_status)===null||dt===void 0)?void 0:dt[0])!=="\u672A\u53D1\u5E03"?!0:bn.name!=="\u4EE3\u7801\u67E5\u91CD"}).filter(function(bn){return pt.open_code_quality_analysis?!0:bn.name!=="\u8D28\u91CF\u68C0\u6D4B"}),Rn=function(){var Wt,dt,An,an,Kn,zt,En,Ln;return n.a.createElement("aside",{className:wi.a.workListTabButton},Object(Y.t)()&&((Wt=mn.workList)===null||Wt===void 0?void 0:Wt.redo_work)&&n.a.createElement(M.a,{onClick:Cn,type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-dahuizhongzuo3x"})},"\u91CD\u505A"),((dt=mn.workList)===null||dt===void 0?void 0:dt.shixun_status)>1&&((An=mn.workList)===null||An===void 0?void 0:An.time_status)<5&&Object(Y.t)()&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-kaiqizhong"}),onClick:function(){var dr,xn,gn,Ct,Ze,Lt,At;if(!Object(ri.e)(J,!0))return;(dr=mn.workList)!==null&&dr!==void 0&&(xn=dr.task_operation)!==null&&xn!==void 0&&(gn=xn[1])!==null&&gn!==void 0&&gn.includes("/")?Ut((Ct=mn.workList)===null||Ct===void 0||((Ze=Ct.task_operation)===null||Ze===void 0)?void 0:Ze[1]):Object(v.S)("/tasks/".concat((Lt=mn.workList)===null||Lt===void 0||((At=Lt.task_operation)===null||At===void 0)?void 0:At[1]))}},(an=mn.workList)===null||an===void 0||((Kn=an.task_operation)===null||Kn===void 0)?void 0:Kn[0]),((zt=mn.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 dr;Object(v.S)("/classrooms/".concat(ge.coursesId,"/shixun_homework/").concat(ge.categoryId,"/").concat((dr=mn.workList)===null||dr===void 0?void 0:dr.id,"/commitsummary"))}},(En=mn.workList)===null||En===void 0?void 0:En.commit_des),Object(Y.c)()&&(pt==null||((Ln=pt.homework_status)===null||Ln===void 0)?void 0:Ln[0])==="\u672A\u53D1\u5E03"&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-bianji2"}),onClick:function(){Ae.push("/classrooms/".concat(ge.coursesId,"/program_homework/").concat(ge.categoryId,"/edit"))}},"\u7F16\u8F91\u4F5C\u4E1A"),Object(Y.c)()&&pt.publish_immediately&&n.a.createElement(M.a,{type:"primary",icon:n.a.createElement("i",{className:"iconfont icon-yishezhifabushijian1"}),onClick:function(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u53D1\u5E03",selectArrs:[ge.categoryId],selectArrsAll:[pt],params:ge,detail:!0,type:2}})}},"\u7ACB\u5373\u53D1\u5E03"),Object(Y.c)()&&pt.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(){J({type:"classroomList/setActionTabs",payload:{key:"\u7ACB\u5373\u622A\u6B62",params:ge,type:2,detail:!0,selectArrs:[ge.categoryId]}})}},"\u7ACB\u5373\u622A\u6B62"))};return n.a.createElement("section",null,n.a.createElement("div",{className:"edu-container"},pt.homework_name&&n.a.createElement("section",{className:"animated fadeIn"},n.a.createElement("aside",{className:"mt10"},pt.category&&n.a.createElement(k.a,{separator:">"},n.a.createElement(k.a.Item,null,n.a.createElement(C.a,{to:"/classrooms/".concat(pt.course_id,"/program_homework")},pt.course_name)),n.a.createElement(k.a.Item,null,n.a.createElement(C.a,{to:"/classrooms/".concat(pt.course_id,"/program_homework/").concat(pt.category.main?"":pt.category.category_id)},pt.category.category_name)),n.a.createElement(k.a.Item,null,"\u4F5C\u4E1A\u8BE6\u60C5"))),n.a.createElement("aside",{className:[wi.a.title,"mt20"].join(" ")},n.a.createElement(C.a,{to:"/classrooms/".concat(pt.course_id,"/program_homework/").concat(pt.category.main?"":pt.category.category_id)},n.a.createElement(T.a,{className:"font16 c-black"})),n.a.createElement(L.a,{title:pt.homework_name,placement:"bottom"},n.a.createElement("strong",{className:"font20 ml5"},pt.homework_name)),n.a.createElement(v.m,{temporary:!0,status:pt.homework_status}),Object(Y.t)()&&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 bn(){var Wt,dt;return s.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(O.a)("/api/problems/".concat((Wt=mn.workList)===null||Wt===void 0?void 0:Wt.start_identifier,"/start.json"),{method:"get"});case 2:dt=an.sent,dt&&(window.open("/myproblems/".concat(dt==null?void 0:dt.identifier,"?type=1")),localStorage.setItem("program_homework",[ge.coursesId,ge.categoryId]));case 4:case"end":return an.stop()}},bn)})),type:"primary"},(Tn=pt.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(wi.a.workListTabWrap)},n.a.createElement(G.a,{type:"card",defaultActiveKey:Ge,activeKey:Ge,tabBarExtraContent:Rn(),onChange:On},wt.map(function(bn,Wt){return n.a.createElement(G.a.TabPane,{tab:bn.name,key:bn.id,forceRender:bn.forceRender},bn.compontent)})))),n.a.createElement(mi,null),n.a.createElement(hn.a,{courseEndTime:pt==null?void 0:pt.course_end_date}),n.a.createElement(ei.a,{courseEndTime:pt==null?void 0:pt.course_end_date}),n.a.createElement(a.a,{visible:wn,title:"\u89C4\u5219\u8BF4\u660E",width:800,footer:null,onCancel:function(){In(!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:br,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")))},kr=_e.default=Object(R.a)(function(kn){var fn=kn.shixunHomeworks,Tn=kn.loading,mn=kn.globalSetting;return{shixunHomeworks:fn,globalSetting:mn,loading:Tn.effects}})(si)},OLES:function(jt,_e,D){"use strict";var Z=D("U8pU"),V=D("VTBJ"),I=D("Ff2n"),G=D("q1tI"),P=D("uciX"),L=D("7ixt"),W=function(m){var u=m.overlay,a=m.prefixCls,o=m.id,c=m.overlayInnerStyle;return G.createElement("div",{className:"".concat(a,"-inner"),id:o,role:"tooltip",style:c},typeof u=="function"?u():u)},k=W,r=function(m,u){var a=m.overlayClassName,o=m.trigger,c=o===void 0?["hover"]:o,s=m.mouseEnterDelay,i=s===void 0?0:s,n=m.mouseLeaveDelay,O=n===void 0?.1:n,S=m.overlayStyle,C=m.prefixCls,R=C===void 0?"rc-tooltip":C,T=m.children,v=m.onVisibleChange,b=m.afterVisibleChange,f=m.transitionName,h=m.animation,_=m.placement,g=_===void 0?"right":_,x=m.align,N=x===void 0?{}:x,F=m.destroyTooltipOnHide,A=F===void 0?!1:F,B=m.defaultVisible,U=m.getTooltipContainer,w=m.overlayInnerStyle,Y=Object(I.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)(u,function(){return q.current});var ce=Object(V.a)({},Y);"visible"in m&&(ce.popupVisible=m.visible);var Ee=function(){var Je=m.arrowContent,Ce=Je===void 0?null:Je,X=m.overlay,j=m.id;return[G.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},Ce),G.createElement(k,{key:"content",prefixCls:R,id:j,overlay:X,overlayInnerStyle:w})]},Qe=!1,Te=!1;if(typeof A=="boolean")Qe=A;else if(A&&Object(Z.a)(A)==="object"){var We=A.keepParent;Qe=We===!0,Te=We===!1}return G.createElement(P.a,Object.assign({popupClassName:a,prefixCls:R,popup:Ee,action:c,builtinPlacements:L.a,popupPlacement:g,ref:q,popupAlign:N,getPopupContainer:U,onPopupVisibleChange:v,afterPopupVisibleChange:b,popupTransitionName:f,popupAnimation:h,defaultPopupVisible:B,destroyPopupOnHide:Qe,autoDestroy:Te,mouseLeaveDelay:O,popupStyle:S,mouseEnterDelay:i},ce),T)},M=Object(G.forwardRef)(r),E=_e.a=M},OZM5:function(jt,_e,D){"use strict";D.d(_e,"b",function(){return M}),D.d(_e,"a",function(){return E}),D.d(_e,"k",function(){return p}),D.d(_e,"h",function(){return m}),D.d(_e,"i",function(){return u}),D.d(_e,"g",function(){return a}),D.d(_e,"c",function(){return o}),D.d(_e,"d",function(){return c}),D.d(_e,"j",function(){return n}),D.d(_e,"e",function(){return O}),D.d(_e,"f",function(){return S});var Z=D("KQm4"),V=D("U8pU"),I=D("Ff2n"),G=D("q1tI"),P=D.n(G),L=D("Kwbf"),W=D("WaYH"),k=.25,r=2;function M(C,R){var T=C.slice(),v=T.indexOf(R);return v>=0&&T.splice(v,1),T}function E(C,R){var T=C.slice();return T.indexOf(R)===-1&&T.push(R),T}function p(C){return C.split("-")}function m(C,R){return"".concat(C,"-").concat(R)}function u(C){return C&&C.type&&C.type.isTreeNode}function a(C,R){var T=[C],v=R[C];function b(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];f.forEach(function(h){var _=h.key,g=h.children;T.push(_),b(g)})}return b(v.children),T}function o(C,R){var T=C.clientY,v=R.selectHandle.getBoundingClientRect(),b=v.top,f=v.bottom,h=v.height,_=Math.max(h*k,r);return T<=b+_?-1:T>=f-_?1:0}function c(C,R){if(!C)return;var T=R.multiple;return T?C.slice():C.length?[C[0]]:C}var s=function(R){return R};function i(C,R){if(!C)return[];var T=R||{},v=T.processProps,b=v===void 0?s:v,f=Array.isArray(C)?C:[C];return f.map(function(h){var _=h.children,g=Object(I.a)(h,["children"]),x=i(_,R);return P.a.createElement(W.a,Object.assign({},b(g)),x)})}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(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function O(C,R){var T=new Set;function v(b){if(T.has(b))return;var f=R[b];if(!f)return;T.add(b);var h=f.parent,_=f.node;if(_.disabled)return;h&&v(h.key)}return(C||[]).forEach(function(b){v(b)}),Object(Z.a)(T)}function S(C){var R={};return Object.keys(C).forEach(function(T){(T.startsWith("data-")||T.startsWith("aria-"))&&(R[T]=C[T])}),R}},Ot1p:function(jt,_e,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),I=D("rAM+"),G=D("miYZ"),P=D("tsqr"),L=D("9og8"),W=D("tJVT"),k=D("jrin"),r=D("WmNS"),M=D.n(r),E=D("q1tI"),p=D.n(E),m=D("VrN/"),u=D.n(m),a=D("bdgK"),o=D("p77/"),c=D("Bd2K"),s=D("ELLl"),i=D("19Vz"),n=D("lZu9"),O=D("+NIl"),S=D("kSUc"),C=D("9Bee"),R=function(xe){var De=xe.value,ct=De===void 0?"":De,It=xe.className,un=xe.showTextOnly,mt=xe.showLines,Qt=xe.style,ht=Qt===void 0?{}:Qt,Et=Object(E.useMemo)(function(){return""},[ct]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Et}}))},T=D("0Owb"),v=D("dejd"),b=D("C+DQ"),f=D("1vsH"),h=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(xe){var De=xe.onActionCallback,ct=xe.title,It=xe.icon,un=xe.actionName,mt=xe.className,Qt=mt===void 0?"":mt,ht=xe.children;function Et(){De(un)}return p.a.createElement("a",{title:ct,className:Qt,onClick:Et},p.a.createElement("i",{className:"md-iconfont ".concat(It)}),ht)}var x=function(xe){var De=xe.watch,ct=xe.showNullButton,It=xe.onActionCallback,un=xe.fullScreen,mt=xe.insertTemp,Qt=xe.hidetoolBar,ht=xe.uuid,Et=xe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(f.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(f.F)("_educoder_session"),"&key=").concat(ht,"&api=").concat(encodeURIComponent(h.a.PROXY_SERVER)));var it=[].concat(_,[{title:"".concat(De?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(De?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Qt&&it.map(function(ve,Me){return p.a.createElement("li",{key:Me},ve.actionName?p.a.createElement(g,Object(T.a)({},ve,{onActionCallback:It})):p.a.createElement("span",{className:"v-line"}))}),ct?p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:It},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:It},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(g,{icon:"".concat(un?"icon-shrink":"icon-enlarge"),title:un?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:It})))},N=D("M8RZ"),F=D("+L6B"),A=D("2/Rp"),B=D("y8nQ"),U=D("Vl3Y"),w=D("5NDa"),Y=D("5rEg"),q={labelCol:{span:4},wrapperCol:{span:20}},ce=function(xe){var De=xe.callback,ct=xe.onCancel;function It(un){De(un)}return p.a.createElement(U.a,Object(T.a)({},q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:It}),p.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},Ee=D("7ahc"),Qe=D("HmJG"),Te=D("BjJ7"),We=U.a.useForm,$e={width:280,marginRight:10},Je={labelCol:{span:5},wrapperCol:{span:19}},Ce=function(xe){var De=xe.callback,ct=xe.onCancel,It=We(),un=Object(W.a)(It,1),mt=un[0];function Qt(it){De(it)}function ht(it,ve){if(it.status===-1){P.b.error(it.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(it.id),type:ve.type})}function Et(it){var ve=it.target.files[0];j(ve,ht)}return p.a.createElement(U.a,Object(T.a)({form:mt},Je,{className:"upload-image-panel",onFinish:Qt}),p.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:$e})),p.a.createElement(X,{onFileChange:Et}))),p.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(U.a.Item,{style:{textAlign:"right"}},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))};function X(xe){var De=xe.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:De}))}function j(xe,De){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");var ct=new FormData;ct.append("editormd-image-file",xe),ct.append("file_param_name","editormd-image-file"),ct.append("byxhr","true");var It=new window.XMLHttpRequest;It.withCredentials=!0,It.addEventListener("load",function(un){De(JSON.parse(un.target.responseText),xe)},!1),It.addEventListener("error",function(un){console.error(un)},!1),It.open("POST","".concat(Te.a,"/api/attachments.json")),It.send(ct)}var K=D("giR+"),Q=D("fyUT"),re=D("7Kak"),z=D("9yH6"),we=z.a.Group,Ue={margin:"0 8px"},rt=function(xe){var De=xe.callback,ct=xe.onCancel;function It(un){De(un)}return p.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:It},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Ue},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Ue},"\u884C\u6570"),p.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Q.a,null)),p.a.createElement("span",{style:Ue},"\u5217\u6570"),p.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Q.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Ue},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(U.a.Item,{name:"align"},p.a.createElement(we,null,p.a.createElement(z.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(z.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(z.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(z.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(A.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},le=D("ErOA"),Oe=D("7Cbv"),Fe="link",Ye="upload-image",Tt="code-block",Nt="add-table",Xt="------------",tt={default:Xt,left:":".concat(Xt),center:":".concat(Xt,":"),right:"".concat(Xt,":")},Zt=D("9VGf"),vn,ze;function He(){}var vt=0,Rt=1e4,de="\u2581",ee=`
**\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 ne(xe){return/^\d+$/.test(xe)?"".concat(xe,"px"):xe}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=se?"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"],ie=(vn={},Object(k.a)(vn,pe+"-B","bold"),Object(k.a)(vn,pe+"-I","italic"),vn),me=(ze={},Object(k.a)(ze,Fe,"\u6DFB\u52A0\u94FE\u63A5"),Object(k.a)(ze,Tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(k.a)(ze,Ye,"\u6DFB\u52A0\u6587\u4EF6"),Object(k.a)(ze,Nt,"\u6DFB\u52A0\u8868\u683C"),ze),ye=_e.a=function(xe){var De=xe.defaultValue,ct=De===void 0?"":De,It=xe.onChange,un=xe.width,mt=un===void 0?"100%":un,Qt=xe.height,ht=Qt===void 0?400:Qt,Et=xe.miniToolbar,it=Et===void 0?!1:Et,ve=xe.isFocus,Me=ve===void 0?!1:ve,St=xe.watch,lt=xe.insertTemp,Gt=xe.mode,qt=Gt===void 0?"markdown":Gt,Ve=xe.id,et=Ve===void 0?"markdown-editor-id":Ve,gt=xe.showResizeBar,Ht=gt===void 0?!1:gt,Vt=xe.noStorage,dn=Vt===void 0?!1:Vt,Zn=xe.showNullButton,Wn=Zn===void 0?!1:Zn,tn=xe.hidetoolBar,Hn=tn===void 0?!1:tn,ir=xe.fullScreen,Dn=ir===void 0?!1:ir,Vn=xe.onBlur,qn=xe.onCMBeforeChange,Mr=xe.onFullScreen,Sr=xe.className,on=Sr===void 0?"":Sr,Jn=xe.disablePaste,oi=Jn===void 0?!1:Jn,xi=xe.placeholder,Jr=xi===void 0?"":xi,Yr=xe.values,Lr=Yr===void 0?"":Yr,Yn=Object(E.useState)(null),mi=Object(W.a)(Yn,2),hn=mi[0],ei=mi[1],zr=Object(E.useState)(ct),wi=Object(W.a)(zr,2),gi=wi[0],ri=wi[1],Bi=Object(E.useState)(St),Hi=Object(W.a)(Bi,2),ii=Hi[0],wr=Hi[1],Oi=Object(E.useState)(Dn),Ri=Object(W.a)(Oi,2),di=Ri[0],_i=Ri[1],oa=Object(E.useState)(""),$i=Object(W.a)(oa,2),yr=$i[0],br=$i[1],si=Object(E.useState)(0),kr=Object(W.a)(si,2),kn=kr[0],fn=kr[1],Tn=Object(E.useState)(ht),mn=Object(W.a)(Tn,2),er=mn[0],rr=mn[1],J=Object(E.useState)(!1),ge=Object(W.a)(J,2),Re=ge[0],Ae=ge[1],at=Object(E.useRef)(Object(Oe.a)()),Be=Object(E.useRef)(!1),nt=Object(E.useRef)(),yt=Object(E.useRef)(),Mt=Object(E.useRef)(),kt=Object(E.useRef)(),Ge=Object(E.useRef)(),xt=function(){var Ot=Object(L.a)(M.a.mark(function rn(){var Ut,wt;return M.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(le.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:at.current}});case 2:wt=bn.sent,wt!=null&&(Ut=wt.attachments)!==null&&Ut!==void 0&&Ut.length&&(console.log("cm:",hn,yt),wt.attachments.map(function(Wt){Wt.content_type.indexOf("image")>-1?hn.replaceSelection("![,](/api/attachments/".concat(Wt.id,"?type=").concat(Wt.content_type,")")):Wt.content_type.indexOf("video")>-1?hn.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Wt.content_type.indexOf("pdf")>-1?hn.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,'&disposition=inline" target="_blank">').concat(Wt.name,"</a>")):hn.replaceSelection("[".concat(Wt.name,"](").concat(h.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}));case 4:case"end":return bn.stop()}},rn)}));return function(){return Ot.apply(this,arguments)}}();Object(E.useEffect)(function(){ri(Lr),hn==null||hn.setValue(Lr)},[Lr]),Object(E.useEffect)(function(){Mr==null||Mr(di)},[di]),Object(E.useEffect)(function(){if(yt.current){var Ot=u.a.fromTextArea(yt.current,{mode:qt,lineNumbers:!it,lineWrapping:!0,value:ct,autoCloseTags:!0,autoCloseBrackets:!0});Me&&Ot.focus();function rn(Ut,wt){if(oi){wt.preventDefault();return}var Rn=wt.clipboardData;if(Rn){var bn=Rn.types.toString(),Wt=Rn.items;if(bn==="Files"||Rn.types.indexOf("Files")>-1){if(wt.preventDefault(),qt=="stex")return;try{var dt,An=Wt[1];((dt=Wt[0])===null||dt===void 0?void 0:dt.kind)==="file"&&(An=Wt[0]);var an=An.getAsFile(),Kn=an.name.split(".").pop();j(an,function(zt){if(zt.id){var En,Ln,cn;(an==null||((En=an.type)===null||En===void 0)?void 0:En.indexOf("image"))>-1?Ot.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(an==null||((Ln=an.type)===null||Ln===void 0)?void 0:Ln.indexOf("video"))>-1?Ot.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(an==null||((cn=an.type)===null||cn===void 0)?void 0:cn.indexOf("pdf"))>-1?Ot.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):ae.includes(Kn)?Ot.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):Ot.replaceSelection("[".concat(an.name,"](").concat(h.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 Ot.on("paste",rn),Ot.on("dragleave",function(Ut,wt){Mt.current.classList.remove("mouse-hover-md")}),Ot.on("dragover",function(Ut,wt){Mt.current.classList.add("mouse-hover-md")}),Ot.on("drop",function(Ut,wt){Mt.current.classList.add("mouse-hover-md");var Rn;if(Rn=wt.dataTransfer.files,Rn.length>0){wt.preventDefault(),wt.stopPropagation();for(var bn=function(An){var an=Rn[An],Kn=an.name.split(".").pop();j(an,function(zt){if(zt.id){var En,Ln,cn;(an==null||((En=an.type)===null||En===void 0)?void 0:En.indexOf("image"))>-1?Ot.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(an==null||((Ln=an.type)===null||Ln===void 0)?void 0:Ln.indexOf("video"))>-1?Ot.replaceSelection('<video width="100%" controls src="'.concat(h.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(an==null||((cn=an.type)===null||cn===void 0)?void 0:cn.indexOf("pdf"))>-1?Ot.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(an.type,'&disposition=inline" target="_blank">').concat(an.name,"</a>")):ae.includes(Kn)?Ot.replaceSelection('<a href="'.concat(h.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(an.name,"</a>")):Ot.replaceSelection("[".concat(an.name,"](").concat(h.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")})},Wt=0;Wt<Rn.length;Wt++)bn(Wt)}}),ei(Ot),function(){Ot.off("paste",rn)}}},[]);var ot=Object(E.useCallback)(function(){if(Mt.current)try{}catch(Ot){console.log(Ot,"---- to set md editor body height")}},[er,Mt,di]);Object(E.useEffect)(function(){function Ot(){var Ut=new a.default(function(wt){var Rn=Object(I.a)(wt),bn;try{for(Rn.s();!(bn=Rn.n()).done;){var Wt=bn.value;(Wt.target.offsetHeight>0||Wt.target.offsetWidth>0)&&(ot(),hn.setSize("100%","100%"),hn.refresh())}}catch(dt){Rn.e(dt)}finally{Rn.f()}});return Ut.observe(yt.current.parentElement),Ut}if(hn){var rn=Ot();return function(){rn.unobserve(yt.current.parentElement)}}},[hn,ot]),Object(E.useEffect)(function(){if(hn){for(var Ot=[],rn=function(){var Wt=wt[Ut];Rn=Object(W.a)(Wt,2);var dt=Rn[0],An=Rn[1],an=Object(k.a)({},dt,function(){ut(An)});Ot.push(an),hn.addKeyMap(an)},Ut=0,wt=Object.entries(ie);Ut<wt.length;Ut++){var Rn;rn()}return nt.current=setInterval(function(){Be.current&&xt()},4e3),function(){clearInterval(nt.current);var bn=Object(I.a)(Ot),Wt;try{for(bn.s();!(Wt=bn.n()).done;){var dt=Wt.value;hn.removeKeyMap(dt)}}catch(An){bn.e(An)}finally{bn.f()}}}},[hn]),Object(E.useEffect)(function(){Dn!==di&&_i(Dn)},[Dn]),Object(Zt.a)(function(){if(!dn&&kn>0){var Ot=new Date().getTime(),rn=window.sessionStorage.getItem(et);Ot>=kn+Rt&&(!rn||rn!==gi)&&(window.sessionStorage.setItem(et,gi),Ae(!0))}},Rt),Object(E.useEffect)(function(){wr(St)},[hn,St]),Object(E.useEffect)(function(){hn&&(Me&&hn.focus())},[hn,Me]),Object(E.useEffect)(function(){if(ii&&hn){var Ot=hn.getScrollerElement();function rn(Ut){var wt=Ut.target;if(Ge.current){var Rn=wt.scrollTop/wt.scrollHeight;Ge.current.scrollTop=Ge.current.scrollHeight*Rn}}return Ot.addEventListener("scroll",rn),function(){Ot.removeEventListener("scroll",rn)}}},[hn,ii]),Object(E.useEffect)(function(){if(hn&&qn){function Ot(rn,Ut){qn(rn,Ut)}return hn.on("beforeChange",Ot),function(){hn.off("beforeChange",Ot)}}},[hn,qn]),Object(E.useEffect)(function(){if(hn&&Vn){function Ot(){Vn(hn.getValue())}return hn.on("blur",Ot),function(){hn.off("blur",Ot)}}},[hn,Vn]),Object(E.useEffect)(function(){if(hn){function Ot(rn){var Ut=rn.getValue();ri(Ut),fn(new Date().getTime()),rn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),It&&It(Ut)}return hn.on("change",Ot),function(){hn.off("change",Ot)}}},[hn,It]),Object(E.useEffect)(function(){hn&&(ct==null?(hn.setValue(""),ri("")):ct!==hn.getValue()&&(hn.setValue(ct),ri(ct),hn.setCursor(hn.lineCount(),0)))},[hn,ct]);var ut=Object(E.useCallback)(function(Ot){var rn=hn.getCursor(),Ut=hn.getSelection(),wt=Ut.split(`
`);switch(Ot){case"bold":return hn.replaceSelection("**"+Ut+"**"),Ut===""&&hn.setCursor(rn.line,rn.ch+2),hn.focus();case"italic":return hn.replaceSelection("*"+Ut+"*"),Ut===""&&hn.setCursor(rn.line,rn.ch+1),hn.focus();case"code":return hn.replaceSelection("`"+Ut+"`"),Ut===""&&hn.setCursor(rn.line,rn.ch+1),hn.focus();case"inline-latex":return hn.replaceSelection("`$$"+Ut+"$$`"),Ut===""&&hn.setCursor(rn.line,rn.ch+3),hn.focus();case"latex":return hn.replaceSelection("```latex\n"+Ut+"\n```"),hn.setCursor(rn.line+1,Ut.length+1),hn.focus();case"line-break":return hn.replaceSelection(`<br/>
`),hn.focus();case"list-ul":return Ut===""?hn.replaceSelection("- "+Ut):hn.replaceSelection(wt.map(function(Rn){return Rn===""?"":"- ".concat(Rn)}).join(`
`)),hn.focus();case"list-ol":return Ut===""?hn.replaceSelection("1. "+Ut):hn.replaceSelection(wt.map(function(Rn,bn){return Rn===""?"":"".concat(bn+1,". ").concat(Rn)}).join(`
`)),hn.focus();case"add-null-ch":return Ut===""&&hn.setCursor(rn.line,rn.ch+1),hn.replaceSelection(de),hn.focus();case"inster-template-1":return Ut===""&&hn.setCursor(rn.line,rn.ch),hn.replaceSelection(ee),hn.focus();case"eraser":return hn.setValue(""),hn.focus();case"trigger-watch":return wr(!ii),hn.focus();case"trigger-full-screen":return _i(!di),hn.focus();case Fe:br(Fe);return;case Tt:br(Tt);return;case Ye:br(Ye);return;case Nt:br(Nt);return;default:throw new Error}},[hn,ii,di]),bt=Object(E.useCallback)(function(Ot){br("");switch(yr){case Fe:var rn=Ot.title,Ut=Ot.link;return hn.replaceSelection("[".concat(rn,"](").concat(Ut,")")),hn.focus();case Tt:var wt=Ot.language,Rn=Ot.content;return hn.replaceSelection(["```"+wt,Rn,"```"].join(`
`)),hn.focus();case Ye:var bn=Ot.src,Wt=Ot.alt;return Wt?hn.replaceSelection("![ ".concat(Wt," ]( ").concat(bn,' "').concat(Wt,'" )')):hn.replaceSelection("![,](".concat(bn,")")),hn.focus();case Nt:for(var dt=Ot.row,An=Ot.col,an=Ot.align,Kn=`
`,zt=0;zt<dt;zt++){for(var En=[],Ln=[],cn=0;cn<An;cn++)zt===1&&Ln.push(tt[an]),En.push(" ");zt===1&&(Kn+="| ".concat(Ln.join(" | "),` |
`)),Kn+="| ".concat(En.join(An===1?"":" | "),` |
`)}return hn.replaceSelection(Kn+`
`),hn.focus();default:throw new Error}},[hn,yr]),Dt=Object(E.useMemo)(function(){switch(yr){case Fe:return p.a.createElement(ce,{callback:bt,onCancel:pt});case Tt:return p.a.createElement(Ee.b,{callback:bt,onCancel:pt});case Ye:return p.a.createElement(Ce,{callback:bt,onCancel:pt});case Nt:return p.a.createElement(rt,{callback:bt,onCancel:pt});default:return null}},[yr]);function pt(){br("")}Object(E.useEffect)(function(){if(kt.current){var Ot=kt.current,rn=!1,Ut=0;function wt(Wt){rn=!0,Ut=Wt.pageY}function Rn(){rn=!1}function bn(Wt){if(rn){var dt=Wt.pageY-Ut;dt<0&&(dt=0),dt>300&&(dt=300);var An=ht+dt+"px";rr(An)}}return Ot.addEventListener("mousedown",wt),document.addEventListener("mousemove",bn),document.addEventListener("mouseup",Rn),function(){Ot.removeEventListener("mousedown",wt),document.removeEventListener("mousemove",bn),document.removeEventListener("mouseup",Rn)}}},[hn,kt]),Object(E.useEffect)(function(){rr(ht)},[ht]);var Kt=ne(mt),nn=ne(er),wn={width:Kt,height:nn},In=Object(E.useMemo)(function(){if(kn){var Ot=new Date(kn),rn=Ot.getHours(),Ut=Ot.getMinutes(),wt=Ot.getSeconds();return rn=rn<10?"0"+rn:rn,Ut=Ut<10?"0"+Ut:Ut,wt=wt<10?"0"+wt:wt,"".concat(rn,":").concat(Ut,":").concat(wt)}return 0},[kn]);function yn(){window.sessionStorage.removeItem(et),Ae(!1),fn(0)}function On(){Ae(!1),fn(0),hn.setValue(window.sessionStorage.getItem(et))}function Cn(Ot,rn){var Ut=hn.getValue();Ut=Ut.replace(Ot,rn),ri(Ut),hn==null||hn.setValue(Ut)}return p.a.createElement(E.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Mt},p.a.createElement("div",{className:"markdown-editor-container ".concat(on," ").concat(ii?"on-preview":""," ").concat(it?"mini":""," ").concat(di?"full-screen":""),style:wn},p.a.createElement(x,{insertTemp:lt,watch:ii,fullScreen:di,showNullButton:Wn,onActionCallback:ut,hidetoolBar:Hn,uuid:at.current,setOpenPhones:function(){Be.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:yt,placeholder:Jr})),ii?p.a.createElement("div",{ref:Ge,className:"preview-container"},qt==="stex"&&p.a.createElement(R,{value:gi}),qt!=="stex"&&p.a.createElement(C.a,{edit:!0,value:gi,replaces:Cn})):null))),Ht?p.a.createElement("a",{ref:kt,className:"editor-resize"}):null,p.a.createElement(N.a,null,me[yr]?p.a.createElement(V.a,{centered:!0,title:me[yr],visible:!0,onCancel:pt,footer:null,className:"markdown-popup-form"},Dt):null))}},RotF:function(jt,_e,D){jt.exports=D("LSTS")},"SA+Z":function(jt,_e,D){var Z=D("wTVA"),V=D("EbDI"),I=D("ZhPi"),G=D("wkBT");function P(L){return Z(L)||V(L)||I(L)||G()}jt.exports=P,jt.exports.__esModule=!0,jt.exports.default=jt.exports},SJMd:function(jt,_e){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var D,Z,V,I=!1,G,P;window.PR_SHOULD_USE_CONTINUATION=!0;var L,W;(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"],E=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[E,"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=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[E,"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"],a="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",o=[E,"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=[p,u,m,o,c,s,i,n],S=/^(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",T="com",v="typ",b="lit",f="pun",h="pln",_="tag",g="dec",x="src",N="atn",F="atv",A="nocode",B="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(we){for(var Ue=0,rt=!1,le=!1,Oe=0,Fe=we.length;Oe<Fe;++Oe){var Ye=we[Oe];if(Ye.ignoreCase)le=!0;else if(/[a-z]/i.test(Ye.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){rt=!0,le=!1;break}}var Tt={b:8,t:9,n:10,v:11,f:12,r:13};function Nt(ze){var He=ze.charCodeAt(0);if(He!==92)return He;var vt=ze.charAt(1);return He=Tt[vt],He||("0"<=vt&&vt<="7"?parseInt(ze.substring(1),8):vt==="u"||vt==="x"?parseInt(ze.substring(2),16):ze.charCodeAt(1))}function Xt(ze){if(ze<32)return(ze<16?"\\x0":"\\x")+ze.toString(16);var He=String.fromCharCode(ze);return He==="\\"||He==="-"||He==="]"||He==="^"?"\\"+He:He}function tt(ze){var He=ze.substring(1,ze.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")),vt=[],Rt=He[0]==="^",de=["["];Rt&&de.push("^");for(var ee=Rt?1:0,ne=He.length;ee<ne;++ee){var se=He[ee];if(/\\[bdsw]/i.test(se))de.push(se);else{var pe=Nt(se),ae;ee+2<ne&&He[ee+1]==="-"?(ae=Nt(He[ee+2]),ee+=2):ae=pe,vt.push([pe,ae]),ae<65||pe>122||(ae<65||pe>90||vt.push([Math.max(65,pe)|32,Math.min(ae,90)|32]),ae<97||pe>122||vt.push([Math.max(97,pe)&~32,Math.min(ae,122)&~32]))}}vt.sort(function(xe,De){return xe[0]-De[0]||De[1]-xe[1]});for(var ie=[],me=[],ee=0;ee<vt.length;++ee){var ye=vt[ee];ye[0]<=me[1]+1?me[1]=Math.max(me[1],ye[1]):ie.push(me=ye)}for(var ee=0;ee<ie.length;++ee){var ye=ie[ee];de.push(Xt(ye[0])),ye[1]>ye[0]&&(ye[1]+1>ye[0]&&de.push("-"),de.push(Xt(ye[1])))}return de.push("]"),de.join("")}function Zt(ze){for(var He=ze.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")),vt=He.length,Rt=[],de=0,ee=0;de<vt;++de){var ne=He[de];if(ne==="(")++ee;else if(ne.charAt(0)==="\\"){var se=+ne.substring(1);se&&(se<=ee?Rt[se]=-1:He[de]=Xt(se))}}for(var de=1;de<Rt.length;++de)Rt[de]===-1&&(Rt[de]=++Ue);for(var de=0,ee=0;de<vt;++de){var ne=He[de];if(ne==="(")++ee,Rt[ee]||(He[de]="(?:");else if(ne.charAt(0)==="\\"){var se=+ne.substring(1);se&&se<=ee&&(He[de]="\\"+Rt[se])}}for(var de=0;de<vt;++de)He[de]==="^"&&He[de+1]!=="^"&&(He[de]="");if(ze.ignoreCase&&rt)for(var de=0;de<vt;++de){var ne=He[de],pe=ne.charAt(0);ne.length>=2&&pe==="["?He[de]=tt(ne):pe!=="\\"&&(He[de]=ne.replace(/[a-zA-Z]/g,function(me){var ye=me.charCodeAt(0);return"["+String.fromCharCode(ye&~32,ye|32)+"]"}))}return He.join("")}for(var vn=[],Oe=0,Fe=we.length;Oe<Fe;++Oe){var Ye=we[Oe];if(Ye.global||Ye.multiline)throw new Error(""+Ye);vn.push("(?:"+Zt(Ye)+")")}return new RegExp(vn.join("|"),le?"gi":"g")}function w(we,Ue){var rt=/(?:^|\s)nocode(?:\s|$)/,le=[],Oe=0,Fe=[],Ye=0;function Tt(Nt){var Xt=Nt.nodeType;if(Xt==1){if(rt.test(Nt.className))return;for(var tt=Nt.firstChild;tt;tt=tt.nextSibling)Tt(tt);var Zt=Nt.nodeName.toLowerCase();(Zt==="br"||Zt==="li")&&(le[Ye]=`
`,Fe[Ye<<1]=Oe++,Fe[Ye++<<1|1]=Nt)}else if(Xt==3||Xt==4){var vn=Nt.nodeValue;vn.length&&(Ue?vn=vn.replace(/\r\n?/g,`
`):vn=vn.replace(/[ \t\r\n]+/g," "),le[Ye]=vn,Fe[Ye<<1]=Oe,Oe+=vn.length,Fe[Ye++<<1|1]=Nt)}}return Tt(we),{sourceCode:le.join("").replace(/\n$/,""),spans:Fe}}function Y(we,Ue,rt,le,Oe){if(!rt)return;var Fe={sourceNode:we,pre:1,langExtension:null,numberLines:null,sourceCode:rt,spans:null,basePos:Ue,decorations:null};le(Fe),Oe.push.apply(Oe,Fe.decorations)}var q=/\S/;function ce(we){for(var Ue=void 0,rt=we.firstChild;rt;rt=rt.nextSibling){var le=rt.nodeType;Ue=le===1?Ue?we:rt:le===3&&q.test(rt.nodeValue)?we:Ue}return Ue===we?void 0:Ue}function Ee(we,Ue){var rt={},le;(function(){for(var Ye=we.concat(Ue),Tt=[],Nt={},Xt=0,tt=Ye.length;Xt<tt;++Xt){var Zt=Ye[Xt],vn=Zt[3];if(vn)for(var ze=vn.length;--ze>=0;)rt[vn.charAt(ze)]=Zt;var He=Zt[1],vt=""+He;Nt.hasOwnProperty(vt)||(Tt.push(He),Nt[vt]=null)}Tt.push(/[\0-\uffff]/),le=U(Tt)})();var Oe=Ue.length,Fe=function(Ye){for(var Tt=Ye.sourceCode,Nt=Ye.basePos,Xt=Ye.sourceNode,tt=[Nt,h],Zt=0,vn=Tt.match(le)||[],ze={},He=0,vt=vn.length;He<vt;++He){var Rt=vn[He],de=ze[Rt],ee=void 0,ne;if(typeof de=="string")ne=!1;else{var se=rt[Rt.charAt(0)];if(se)ee=Rt.match(se[1]),de=se[0];else{for(var pe=0;pe<Oe;++pe)if(se=Ue[pe],ee=Rt.match(se[1]),ee){de=se[0];break}ee||(de=h)}ne=de.length>=5&&de.substring(0,5)==="lang-",ne&&!(ee&&typeof ee[1]=="string")&&(ne=!1,de=x),ne||(ze[Rt]=de)}var ae=Zt;if(Zt+=Rt.length,!ne)tt.push(Nt+ae,de);else{var ie=ee[1],me=Rt.indexOf(ie),ye=me+ie.length;ee[2]&&(ye=Rt.length-ee[2].length,me=ye-ie.length);var xe=de.substring(5);Y(Xt,Nt+ae,Rt.substring(0,me),Fe,tt),Y(Xt,Nt+ae+me,ie,X(xe,ie),tt),Y(Xt,Nt+ae+ye,Rt.substring(ye),Fe,tt)}}Ye.decorations=tt};return Fe}function Qe(we){var Ue=[],rt=[];we.tripleQuotedStrings?Ue.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):we.multiLineStrings?Ue.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ue.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),we.verbatimStrings&&rt.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var le=we.hashComments;le&&(we.cStyleComments?(le>1?Ue.push([T,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ue.push([T,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),rt.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ue.push([T,/^#[^\r\n]*/,null,"#"])),we.cStyleComments&&(rt.push([T,/^\/\/[^\r\n]*/,null]),rt.push([T,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Oe=we.regexLiterals;if(Oe){var Fe=Oe>1?"":`
\r`,Ye=Fe?".":"[\\S\\s]",Tt="/(?=[^/*"+Fe+"])(?:[^/\\x5B\\x5C"+Fe+"]|\\x5C"+Ye+"|\\x5B(?:[^\\x5C\\x5D"+Fe+"]|\\x5C"+Ye+")*(?:\\x5D|$))+/";rt.push(["lang-regex",RegExp("^"+B+"("+Tt+")")])}var Nt=we.types;Nt&&rt.push([v,Nt]);var Xt=(""+we.keywords).replace(/^ | $/g,"");Xt.length&&rt.push([R,new RegExp("^(?:"+Xt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ue.push([h,/^\s+/,null,` \r
\xA0`]);var tt="^.[^\\s\\w.$@'\"`/\\\\]*";return we.regexLiterals&&(tt+="(?!s*/)"),rt.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[v,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[h,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[h,/^\\[\s\S]?/,null],[f,new RegExp(tt),null]),Ee(Ue,rt)}var Te=Qe({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function We(we,Ue,rt){for(var le=/(?:^|\s)nocode(?:\s|$)/,Oe=/\r\n?|\n/,Fe=we.ownerDocument,Ye=Fe.createElement("li");we.firstChild;)Ye.appendChild(we.firstChild);var Tt=[Ye];function Nt(He){var vt=He.nodeType;if(vt==1&&!le.test(He.className))if(He.nodeName==="br")Xt(He),He.parentNode&&He.parentNode.removeChild(He);else for(var Rt=He.firstChild;Rt;Rt=Rt.nextSibling)Nt(Rt);else if((vt==3||vt==4)&&rt){var de=He.nodeValue,ee=de.match(Oe);if(ee){var ne=de.substring(0,ee.index);He.nodeValue=ne;var se=de.substring(ee.index+ee[0].length);if(se){var pe=He.parentNode;pe.insertBefore(Fe.createTextNode(se),He.nextSibling)}Xt(He),ne||He.parentNode.removeChild(He)}}}function Xt(He){for(;!He.nextSibling;)if(He=He.parentNode,!He)return;function vt(ee,ne){var se=ne?ee.cloneNode(!1):ee,pe=ee.parentNode;if(pe){var ae=vt(pe,1),ie=ee.nextSibling;ae.appendChild(se);for(var me=ie;me;me=ie)ie=me.nextSibling,ae.appendChild(me)}return se}for(var Rt=vt(He.nextSibling,0),de;(de=Rt.parentNode)&&de.nodeType===1;)Rt=de;Tt.push(Rt)}for(var tt=0;tt<Tt.length;++tt)Nt(Tt[tt]);Ue===(Ue|0)&&Tt[0].setAttribute("value",Ue);var Zt=Fe.createElement("ol");Zt.className="linenums";for(var vn=Math.max(0,Ue-1|0)||0,tt=0,ze=Tt.length;tt<ze;++tt)Ye=Tt[tt],Ye.className="L"+(tt+vn)%10,Ye.firstChild||Ye.appendChild(Fe.createTextNode("\xA0")),Zt.appendChild(Ye);we.appendChild(Zt)}function $e(we){var Ue=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ue=Ue&&+Ue[1]<=8;var rt=/\n/g,le=we.sourceCode,Oe=le.length,Fe=0,Ye=we.spans,Tt=Ye.length,Nt=0,Xt=we.decorations,tt=Xt.length,Zt=0;Xt[tt]=Oe;var vn,ze;for(ze=vn=0;ze<tt;)Xt[ze]!==Xt[ze+2]?(Xt[vn++]=Xt[ze++],Xt[vn++]=Xt[ze++]):ze+=2;for(tt=vn,ze=vn=0;ze<tt;){for(var He=Xt[ze],vt=Xt[ze+1],Rt=ze+2;Rt+2<=tt&&Xt[Rt+1]===vt;)Rt+=2;Xt[vn++]=He,Xt[vn++]=vt,ze=Rt}tt=Xt.length=vn;var de=we.sourceNode,ee="";de&&(ee=de.style.display,de.style.display="none");try{for(var ne=null;Nt<Tt;){var se=Ye[Nt],pe=Ye[Nt+2]||Oe,ae=Xt[Zt+2]||Oe,Rt=Math.min(pe,ae),ie=Ye[Nt+1],me;if(ie.nodeType!==1&&(me=le.substring(Fe,Rt))){Ue&&(me=me.replace(rt,"\r")),ie.nodeValue=me;var ye=ie.ownerDocument,xe=ye.createElement("span");xe.className=Xt[Zt+1];var De=ie.parentNode;De.replaceChild(xe,ie),xe.appendChild(ie),Fe<pe&&(Ye[Nt+1]=ie=ye.createTextNode(le.substring(Rt,pe)),De.insertBefore(ie,xe.nextSibling))}Fe=Rt,Fe>=pe&&(Nt+=2),Fe>=ae&&(Zt+=2)}}finally{de&&(de.style.display=ee)}}var Je={};function Ce(we,Ue){for(var rt=Ue.length;--rt>=0;){var le=Ue[rt];Je.hasOwnProperty(le)?k.console&&console.warn("cannot override language handler %s",le):Je[le]=we}}function X(we,Ue){return we&&Je.hasOwnProperty(we)||(we=/^\s*</.test(Ue)?"default-markup":"default-code"),Je[we]}Ce(Te,["default-code"]),Ce(Ee([],[[h,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[T,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[f,/^(?:<[%?]|[%?]>)/],["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"]),Ce(Ee([[h,/^[\s]+/,null,` \r
`],[F,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[_,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[f,/^[=<>\/]+/],["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"]),Ce(Ee([],[[F,/^[\s\S]+/]]),["uq.val"]),Ce(Qe({keywords:p,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),Ce(Qe({keywords:"null,true,false"}),["json"]),Ce(Qe({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),Ce(Qe({keywords:m,cStyleComments:!0}),["java"]),Ce(Qe({keywords:n,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Ce(Qe({keywords:s,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Ce(Qe({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Ce(Qe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Ce(Qe({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Ce(Qe({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Ce(Ee([],[[C,/^[\s\S]+/]]),["regex"]);function j(we){var Ue=we.langExtension;try{var rt=w(we.sourceNode,we.pre),le=rt.sourceCode;we.sourceCode=le,we.spans=rt.spans,we.basePos=0,X(Ue,le)(we),$e(we)}catch(Oe){k.console&&console.log(Oe&&Oe.stack||Oe)}}function K(we,Ue,rt){var le=rt||!1,Oe=Ue||null,Fe=document.createElement("div");Fe.innerHTML="<pre>"+we+"</pre>",Fe=Fe.firstChild,le&&We(Fe,le,!0);var Ye={langExtension:Oe,numberLines:le,sourceNode:Fe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return j(Ye),Fe.innerHTML}function Q(we,Ue){var rt=Ue||document.body,le=rt.ownerDocument||document;function Oe(se){return rt.getElementsByTagName(se)}for(var Fe=[Oe("pre"),Oe("code"),Oe("xmp")],Ye=[],Tt=0;Tt<Fe.length;++Tt)for(var Nt=0,Xt=Fe[Tt].length;Nt<Xt;++Nt)Ye.push(Fe[Tt][Nt]);Fe=null;var tt=Date;tt.now||(tt={now:function(){return+new Date}});var Zt=0,vn=/\blang(?:uage)?-([\w.]+)(?!\S)/,ze=/\bprettyprint\b/,He=/\bprettyprinted\b/,vt=/pre|xmp/i,Rt=/^code$/i,de=/^(?:pre|code|xmp)$/i,ee={};function ne(){for(var se=k.PR_SHOULD_USE_CONTINUATION?tt.now()+250:Infinity;Zt<Ye.length&&tt.now()<se;Zt++){for(var pe=Ye[Zt],ae=ee,ie=pe;ie=ie.previousSibling;){var me=ie.nodeType,ye=(me===7||me===8)&&ie.nodeValue;if(ye?!/^\??prettify\b/.test(ye):me!==3||/\S/.test(ie.nodeValue))break;if(ye){ae={},ye.replace(/\b(\w+)=([\w:.%+-]+)/g,function(St,lt,Gt){ae[lt]=Gt});break}}var xe=pe.className;if((ae!==ee||ze.test(xe))&&!He.test(xe)){for(var De=!1,ct=pe.parentNode;ct;ct=ct.parentNode){var It=ct.tagName;if(de.test(It)&&ct.className&&ze.test(ct.className)){De=!0;break}}if(!De){pe.className+=" prettyprinted";var un=ae.lang;if(!un){un=xe.match(vn);var mt;!un&&(mt=ce(pe))&&Rt.test(mt.tagName)&&(un=mt.className.match(vn)),un&&(un=un[1])}var Qt;if(vt.test(pe.tagName))Qt=1;else{var ht=pe.currentStyle,Et=le.defaultView,it=ht?ht.whiteSpace:Et&&Et.getComputedStyle?Et.getComputedStyle(pe,null).getPropertyValue("white-space"):0;Qt=it&&it.substring(0,3)==="pre"}var ve=ae.linenums;(ve=ve==="true"||+ve)||(ve=xe.match(/\blinenums\b(?::(\d+))?/),ve=ve?ve[1]&&ve[1].length?+ve[1]:!0:!1),ve&&We(pe,ve,Qt);var Me={langExtension:un,sourceNode:pe,numberLines:ve,pre:Qt,sourceCode:null,basePos:null,spans:null,decorations:null};j(Me)}}}Zt<Ye.length?k.setTimeout(ne,250):typeof we=="function"&&we()}ne()}var re=k.PR={createSimpleLexer:Ee,registerLangHandler:Ce,sourceDecorator:Qe,PR_ATTRIB_NAME:N,PR_ATTRIB_VALUE:F,PR_COMMENT:T,PR_DECLARATION:g,PR_KEYWORD:R,PR_LITERAL:b,PR_NOCODE:A,PR_PLAIN:h,PR_PUNCTUATION:f,PR_SOURCE:x,PR_STRING:C,PR_TAG:_,PR_TYPE:v,prettyPrintOne:I?k.prettyPrintOne=K:L=K,prettyPrint:W=I?k.prettyPrint=Q:W=Q},z=k.define;typeof z=="function"&&z.amd&&z("google-code-prettify",[],function(){return re})})()},STEk:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return Ce});/*! *****************************************************************************
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 Z=function(X,j){return(Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(K,Q){K.__proto__=Q}||function(K,Q){for(var re in Q)Object.prototype.hasOwnProperty.call(Q,re)&&(K[re]=Q[re])})(X,j)};function V(X,j){function K(){this.constructor=X}Z(X,j),X.prototype=j===null?Object.create(j):(K.prototype=j.prototype,new K)}function I(X,j,K,Q){return new(K||(K=Promise))(function(re,z){function we(le){try{rt(Q.next(le))}catch(Oe){z(Oe)}}function Ue(le){try{rt(Q.throw(le))}catch(Oe){z(Oe)}}function rt(le){var Oe;le.done?re(le.value):(Oe=le.value,Oe instanceof K?Oe:new K(function(Fe){Fe(Oe)})).then(we,Ue)}rt((Q=Q.apply(X,j||[])).next())})}function G(X,j){var K,Q,re,z,we={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return z={next:Ue(0),throw:Ue(1),return:Ue(2)},typeof Symbol=="function"&&(z[Symbol.iterator]=function(){return this}),z;function Ue(rt){return function(le){return function(Oe){if(K)throw new TypeError("Generator is already executing.");for(;we;)try{if(K=1,Q&&(re=2&Oe[0]?Q.return:Oe[0]?Q.throw||((re=Q.return)&&re.call(Q),0):Q.next)&&!(re=re.call(Q,Oe[1])).done)return re;switch(Q=0,re&&(Oe=[2&Oe[0],re.value]),Oe[0]){case 0:case 1:re=Oe;break;case 4:return we.label++,{value:Oe[1],done:!1};case 5:we.label++,Q=Oe[1],Oe=[0];continue;case 7:Oe=we.ops.pop(),we.trys.pop();continue;default:if(!(re=we.trys,(re=re.length>0&&re[re.length-1])||Oe[0]!==6&&Oe[0]!==2)){we=0;continue}if(Oe[0]===3&&(!re||Oe[1]>re[0]&&Oe[1]<re[3])){we.label=Oe[1];break}if(Oe[0]===6&&we.label<re[1]){we.label=re[1],re=Oe;break}if(re&&we.label<re[2]){we.label=re[2],we.ops.push(Oe);break}re[2]&&we.ops.pop(),we.trys.pop();continue}Oe=j.call(X,we)}catch(Fe){Oe=[6,Fe],Q=0}finally{K=re=0}if(5&Oe[0])throw Oe[1];return{value:Oe[0]?Oe[1]:void 0,done:!0}}([rt,le])}}}function P(){for(var X=0,j=0,K=arguments.length;j<K;j++)X+=arguments[j].length;var Q=Array(X),re=0;for(j=0;j<K;j++)for(var z=arguments[j],we=0,Ue=z.length;we<Ue;we++,re++)Q[re]=z[we];return Q}var L=function(){function X(){}return X.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},X.setAttributes=function(j,K){for(var Q=0,re=K;Q<re.length;Q++){var z=re[Q],we=z[0],Ue=z[1];j.setAttribute(we,Ue)}},X.createRect=function(j,K,Q){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",j.toString()),re.setAttribute("height",K.toString()),Q&&X.setAttributes(re,Q),re},X.createLine=function(j,K,Q,re,z){var we=document.createElementNS("http://www.w3.org/2000/svg","line");return we.setAttribute("x1",j.toString()),we.setAttribute("y1",K.toString()),we.setAttribute("x2",Q.toString()),we.setAttribute("y2",re.toString()),z&&X.setAttributes(we,z),we},X.createPolygon=function(j,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Q.setAttribute("points",j),K&&X.setAttributes(Q,K),Q},X.createCircle=function(j,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","circle");return Q.setAttribute("cx",(j/2).toString()),Q.setAttribute("cy",(j/2).toString()),Q.setAttribute("r",j.toString()),K&&X.setAttributes(Q,K),Q},X.createEllipse=function(j,K,Q){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(j/2).toString()),re.setAttribute("cy",(K/2).toString()),re.setAttribute("rx",(j/2).toString()),re.setAttribute("ry",(K/2).toString()),Q&&X.setAttributes(re,Q),re},X.createGroup=function(j){var K=document.createElementNS("http://www.w3.org/2000/svg","g");return j&&X.setAttributes(K,j),K},X.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},X.createMarker=function(j,K,Q,re,z,we,Ue){var rt=document.createElementNS("http://www.w3.org/2000/svg","marker");return X.setAttributes(rt,[["id",j],["orient",K],["markerWidth",Q.toString()],["markerHeight",re.toString()],["refX",z.toString()],["refY",we.toString()]]),rt.appendChild(Ue),rt},X.createText=function(j){var K=document.createElementNS("http://www.w3.org/2000/svg","text");return K.setAttribute("x","0"),K.setAttribute("y","0"),j&&X.setAttributes(K,j),K},X.createTSpan=function(j,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Q.textContent=j,K&&X.setAttributes(Q,K),Q},X.createImage=function(j){var K=document.createElementNS("http://www.w3.org/2000/svg","image");return j&&X.setAttributes(K,j),K},X.createPoint=function(j,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Q.x=j,Q.y=K,Q},X.createPath=function(j,K){var Q=document.createElementNS("http://www.w3.org/2000/svg","path");return Q.setAttribute("d",j),K&&X.setAttributes(Q,K),Q},X}(),W=function(){function X(){}return X.addKey=function(j){X.key=j},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}(),k=function(){function X(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return X.prototype.rasterize=function(j,K,Q){var re=this;return new Promise(function(z){var we=Q!==void 0?Q:document.createElement("canvas");j===null&&(re.markersOnly=!0,re.naturalSize=!1);var Ue=document.createElementNS("http://www.w3.org/2000/svg","svg");Ue.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ue.setAttribute("width",K.width.baseVal.valueAsString),Ue.setAttribute("height",K.height.baseVal.valueAsString),Ue.setAttribute("viewBox","0 0 "+K.viewBox.baseVal.width.toString()+" "+K.viewBox.baseVal.height.toString()),Ue.innerHTML=K.innerHTML,re.naturalSize===!0?(Ue.width.baseVal.value=j.naturalWidth,Ue.height.baseVal.value=j.naturalHeight):re.width!==void 0&&re.height!==void 0&&(Ue.width.baseVal.value=re.width,Ue.height.baseVal.value=re.height),we.width=Ue.width.baseVal.value,we.height=Ue.height.baseVal.value;var rt=Ue.outerHTML,le=we.getContext("2d");re.markersOnly!==!0&&le.drawImage(j,0,0,we.width,we.height);var Oe=window.URL,Fe=new Image(we.width,we.height);Fe.setAttribute("crossOrigin","anonymous");var Ye=new Blob([rt],{type:"image/svg+xml"}),Tt=Oe.createObjectURL(Ye);Fe.onload=function(){le.drawImage(Fe,0,0),Oe.revokeObjectURL(Tt);var Nt=we.toDataURL(re.imageType,re.imageQuality);z(Nt)},Fe.src=Tt})},X}(),r=function(){},M=function(){function X(j){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+j+"_"}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(j){return this.styleSheet===void 0&&this.addStyleSheet(),j.name=""+this.classNamePrefix+j.localName,this.classes.push(j),this.styleSheet.sheet.insertRule("."+j.name+" {"+j.style+"}",this.styleSheet.sheet.cssRules.length),j},X.prototype.addRule=function(j){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(j),this.styleSheet.sheet.insertRule(j.selector+" {"+j.style+"}",this.styleSheet.sheet.cssRules.length)},X.prototype.addStyleSheet=function(){var j;this.styleSheet=document.createElement("style"),((j=this.styleSheetRoot)!==null&&j!==void 0?j:document.head).appendChild(this.styleSheet),this.addRule(new E("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new E("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new E("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new p("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new p("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},X.prototype.removeStyleSheet=function(){var j;this.styleSheet&&(((j=this.styleSheetRoot)!==null&&j!==void 0?j:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},X}(),E=function(X,j){this.selector=X,this.style=j},p=function(X,j){this.localName=X,this.style=j},m=function(){function X(j,K,Q,re,z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=j,this.displayMode=K,this.markerItems=Q,this.uiStyleSettings=re,this.styles=z,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(j){var K=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=j,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",this.uiContainer.appendChild(Q),this.addActionButton(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(Q,'<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(z){var we=document.createElement("div");we.className=""+K.toolbarButtonStyleClass.name,we.setAttribute("data-type-name",z.typeName),we.innerHTML=z.icon,we.addEventListener("click",function(){K.markerToolbarButtonClicked(we,z)}),K.buttons.push(we),K.markerButtons.push(we)}),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 re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",re.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(re),this.addActionButton(re,'<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(re,'<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(j){this.buttonClickListeners.push(j)},X.prototype.removeButtonClickListener=function(j){this.buttonClickListeners.indexOf(j)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(j),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var j=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var K=0;K<this.markerButtons.length;K++)K<j||K===j&&this.markerButtons.length-1===j?this.markerButtonBlock.appendChild(this.markerButtons[K]):(K===j&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[K]))}},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 j=this;this.buttons.forEach(function(K){K.className=K.className.replace(j.uiStyleSettings.toolbarButtonStyleColorsClassName?j.uiStyleSettings.toolbarButtonStyleColorsClassName:j.toolbarButtonStyleColorsClass.name,"").trim(),K.className=K.className.replace(j.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?j.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:j.toolbarActiveButtonStyleColorsClass.name,"").trim(),K.className+=" "+(j.uiStyleSettings.toolbarButtonStyleColorsClassName?j.uiStyleSettings.toolbarButtonStyleColorsClassName:j.toolbarButtonStyleColorsClass.name)})},X.prototype.addActionButton=function(j,K,Q){var re=this,z=document.createElement("div");switch(z.className=""+this.toolbarButtonStyleClass.name,z.innerHTML=K,z.setAttribute("data-action",Q),z.addEventListener("click",function(){re.actionToolbarButtonClicked(z,Q)}),Q){case"select":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":z.style.fill=this.uiStyleSettings.closeButtonColor}j.appendChild(z),this.buttons.push(z)},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new p("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 p("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new p("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("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 p("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var j=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px;
padding: `+j+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new p("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new E("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new E("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},X.prototype.markerToolbarButtonClicked=function(j,K){this.setActiveButton(j),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Q){return Q("marker",K)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(j,K){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Q){return Q("action",K)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},X.prototype.setActiveButton=function(j){this.resetButtonStyles(),j.className=j.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),j.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(j){var K=this.markerButtons.find(function(Q){return Q.getAttribute("data-type-name")===j});K&&this.setActiveButton(K)},X.prototype.setCurrentMarker=function(j){var K=this;this.currentMarker=j,this.buttons.filter(function(Q){return/delete|notes/.test(Q.getAttribute("data-action"))}).forEach(function(Q){K.currentMarker===void 0?(Q.style.fillOpacity="0.4",Q.style.pointerEvents="none"):(Q.style.fillOpacity="1",Q.style.pointerEvents="all")})},X}(),u=function(){function X(j,K,Q,re){this.panels=[],this.panelButtons=[],this.markerjsContainer=j,this.displayMode=K,this.uiStyleSettings=Q,this.styles=re,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var j;this.toolboxStyleClass=this.styles.addClass(new p("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 p("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var K=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("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 p("toolbox-panel-row_colors",`
background-color: `+((j=this.uiStyleSettings.toolboxBackgroundColor)!==null&&j!==void 0?j:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new p("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*K)+`px;
padding: `+K+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new p("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new E("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new E("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(j){var K;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=j,this.uiContainer.className=this.toolboxStyleClass.name+" "+((K=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(j){var K,Q,re=this;this.panels=j,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((K=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&K!==void 0?K:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Q=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Q!==void 0?Q:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(z){var we;z.uiStyleSettings=re.uiStyleSettings;var Ue=document.createElement("div");Ue.className=re.toolboxButtonStyleClass.name+" "+((we=re.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&we!==void 0?we:re.toolboxButtonStyleColorsClass.name),Ue.innerHTML=z.icon,Ue.title=z.title,Ue.addEventListener("click",function(){re.panelButtonClick(z)}),re.panelButtons.push(Ue),re.buttonRow.appendChild(Ue)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(j){var K=this,Q=-1;if(j!==this.activePanel){Q=this.panels.indexOf(j),this.panelRow.innerHTML="";var re=j.getUi();re.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(re),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=j}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){K.displayMode==="inline"?K.panelRow.style.display="none":K.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(z,we){var Ue,rt;z.className=K.toolboxButtonStyleClass.name+" "+(we===Q?""+((Ue=K.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:K.toolboxActiveButtonStyleColorsClass.name):""+((rt=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&rt!==void 0?rt:K.toolboxButtonStyleColorsClass.name))})},X}(),a=function(X,j){this.title=X,this.icon=j},o=function(X){function j(K,Q,re,z){var we=X.call(this,K,z||'<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 we.colors=[],we.addTransparent=!1,we.colorBoxes=[],we.colors=Q,we.currentColor=re,we.setCurrentColor=we.setCurrentColor.bind(we),we.getColorBox=we.getColorBox.bind(we),we}return V(j,X),j.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.overflow="hidden",Q.style.whiteSpace="nowrap",this.colors.forEach(function(re){var z=K.getColorBox(re);Q.appendChild(z),K.colorBoxes.push(z)}),Q},j.prototype.getColorBox=function(K){var Q=this,re=this.uiStyleSettings.toolbarHeight/4,z=this.uiStyleSettings.toolbarHeight-re,we=document.createElement("div");we.style.display="inline-block",we.style.boxSizing="content-box",we.style.width=z-2+"px",we.style.height=z-2+"px",we.style.padding="1px",we.style.marginRight="2px",we.style.marginBottom="2px",we.style.borderWidth="2px",we.style.borderStyle="solid",we.style.borderRadius=(z+2)/2+"px",we.style.borderColor=K===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",we.addEventListener("click",function(){Q.setCurrentColor(K,we)});var Ue=document.createElement("div");return Ue.style.display="inline-block",Ue.style.width=z-2+"px",Ue.style.height=z-2+"px",Ue.style.backgroundColor=K,Ue.style.borderRadius=z/2+"px",K==="transparent"&&(Ue.style.fill=this.uiStyleSettings.toolboxAccentColor,Ue.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>`),we.appendChild(Ue),we},j.prototype.setCurrentColor=function(K,Q){var re=this;this.currentColor=K,this.colorBoxes.forEach(function(z){z.style.borderColor=z===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(K)},j}(a),c=function(){function X(j,K,Q){this._state="new",this._isSelected=!1,this._container=j,this._overlayContainer=K,this.globalSettings=Q,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(j){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(j,K){},X.prototype.dblClick=function(j,K){},X.prototype.manipulate=function(j){},X.prototype.pointerUp=function(j){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(j){this.container.childNodes.length>0?this.container.insertBefore(j,this.container.childNodes[0]):this.container.appendChild(j)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(j){this._state=j.state,this.notes=j.notes},X.prototype.scale=function(j,K){},X.prototype.colorChanged=function(j){this.onColorChanged&&this.onColorChanged(j),this.stateChanged()},X.prototype.fillColorChanged=function(j){this.onFillColorChanged&&this.onFillColorChanged(j),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var j=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),j.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(j)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),s=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(j){return this.topLeft.ownsTarget(j)?this.topLeft:this.topCenter.ownsTarget(j)?this.topCenter:this.topRight.ownsTarget(j)?this.topRight:this.centerLeft.ownsTarget(j)?this.centerLeft:this.centerRight.ownsTarget(j)?this.centerRight:this.bottomLeft.ownsTarget(j)?this.bottomLeft:this.bottomCenter.ownsTarget(j)?this.bottomCenter:this.bottomRight.ownsTarget(j)?this.bottomRight:void 0},X}(),i=function(){function X(){this.GRIP_SIZE=10,this.visual=L.createGroup(),this.visual.appendChild(L.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(L.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(j){return j===this.visual||j===this.visual.childNodes[0]||j===this.visual.childNodes[1]},X}(),n=function(){function X(){}return X.toITransformMatrix=function(j){return{a:j.a,b:j.b,c:j.c,d:j.d,e:j.e,f:j.f}},X.toSVGMatrix=function(j,K){return j.a=K.a,j.b=K.b,j.c=K.c,j.d=K.d,j.e=K.e,j.f=K.f,j},X}(),O=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.left=0,z.top=0,z.width=0,z.height=0,z.defaultSize={x:50,y:20},z.offsetX=0,z.offsetY=0,z.rotationAngle=0,z.CB_DISTANCE=10,z._suppressMarkerCreateEvent=!1,z.container.transform.baseVal.appendItem(L.createTransform()),z.setupControlBox(),z}return V(j,X),Object.defineProperty(j.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"visual",{get:function(){return this._visual},set:function(K){this._visual=K;var Q=L.createTransform();this._visual.transform.baseVal.appendItem(Q)},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(K){return!!X.prototype.ownsTarget.call(this,K)||!!(this.controlGrips.findGripByVisual(K)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(K))},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.left=K.x,this.top=K.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var re=this.unrotatePoint(K);if(this.manipulationStartX=re.x,this.manipulationStartY=re.y,this.offsetX=re.x-this.left,this.offsetY=re.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Q),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Q)){this.activeGrip=this.rotatorGrip;var z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=z.x-this.width/2,this.top=z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var we=this.container.transform.baseVal.getItem(0);we.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(we,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},j.prototype.pointerUp=function(K){var Q=this.state;X.prototype.pointerUp.call(this,K),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(K),this._state="select",Q==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},j.prototype.moveVisual=function(K){this.visual.style.transform="translate("+K.x+"px, "+K.y+"px)"},j.prototype.manipulate=function(K){var Q=this.unrotatePoint(K);this.state==="creating"?this.resize(K):this.state==="move"?(this.left=this.manipulationStartLeft+(Q.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Q.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Q):this.state==="rotate"&&this.rotate(K)},j.prototype.resize=function(K){var Q=this.manipulationStartLeft,re=this.manipulationStartWidth,z=this.manipulationStartTop,we=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Q=this.manipulationStartLeft+K.x-this.manipulationStartX,re=this.manipulationStartWidth+this.manipulationStartLeft-Q;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:re=this.manipulationStartWidth+K.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:z=this.manipulationStartTop+K.y-this.manipulationStartY,we=this.manipulationStartHeight+this.manipulationStartTop-z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:we=this.manipulationStartHeight+K.y-this.manipulationStartY}re>=0?(this.left=Q,this.width=re):(this.left=Q+re,this.width=-re),we>=0?(this.top=z,this.height=we):(this.top=z+we,this.height=-we),this.setSize()},j.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},j.prototype.rotate=function(K){if(Math.abs(K.x-this.centerX)>.1){var Q=Math.sign(K.x-this.centerX);this.rotationAngle=180*Math.atan((K.y-this.centerY)/(K.x-this.centerX))/Math.PI+90*Q,this.applyRotation()}},j.prototype.applyRotation=function(){var K=this.container.transform.baseVal.getItem(0);K.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(K,0)},j.prototype.rotatePoint=function(K){if(this.rotationAngle===0)return K;var Q=this.container.getCTM(),re=L.createPoint(K.x,K.y);return{x:(re=re.matrixTransform(Q)).x,y:re.y}},j.prototype.unrotatePoint=function(K){if(this.rotationAngle===0)return K;var Q=this.container.getCTM();Q=Q.inverse();var re=L.createPoint(K.x,K.y);return{x:(re=re.matrixTransform(Q)).x,y:re.y}},j.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},j.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},j.prototype.setupControlBox=function(){this.controlBox=L.createGroup();var K=L.createTransform();K.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(K),this.container.appendChild(this.controlBox),this.controlRect=L.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=L.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 s,this.addControlGrips(),this.controlBox.style.display="none"},j.prototype.adjustControlBox=function(){var K=this.controlBox.transform.baseVal.getItem(0);K.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(K,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},j.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()},j.prototype.createGrip=function(){var K=new i;return K.visual.transform.baseVal.appendItem(L.createTransform()),this.controlBox.appendChild(K.visual),K},j.prototype.positionGrips=function(){var K=this.controlGrips.topLeft.GRIP_SIZE,Q=-K/2,re=Q,z=(this.width+this.CB_DISTANCE)/2-K/2,we=(this.height+this.CB_DISTANCE)/2-K/2,Ue=this.height+this.CB_DISTANCE-K/2,rt=this.width+this.CB_DISTANCE-K/2;this.positionGrip(this.controlGrips.topLeft.visual,Q,re),this.positionGrip(this.controlGrips.topCenter.visual,z,re),this.positionGrip(this.controlGrips.topRight.visual,rt,re),this.positionGrip(this.controlGrips.centerLeft.visual,Q,we),this.positionGrip(this.controlGrips.centerRight.visual,rt,we),this.positionGrip(this.controlGrips.bottomLeft.visual,Q,Ue),this.positionGrip(this.controlGrips.bottomCenter.visual,z,Ue),this.positionGrip(this.controlGrips.bottomRight.visual,rt,Ue),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,z,re-3*this.CB_DISTANCE)},j.prototype.positionGrip=function(K,Q,re){var z=K.transform.baseVal.getItem(0);z.setTranslate(Q,re),K.transform.baseVal.replaceItem(z,0)},j.prototype.hideControlBox=function(){this.controlBox.style.display="none"},j.prototype.showControlBox=function(){this.controlBox.style.display=""},j.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:n.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:n.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},X.prototype.getState.call(this))},j.prototype.restoreState=function(K){X.prototype.restoreState.call(this,K);var Q=K;this.left=Q.left,this.top=Q.top,this.width=Q.width,this.height=Q.height,this.rotationAngle=Q.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(n.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Q.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(n.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Q.containerTransformMatrix))},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q);var re=this.rotatePoint({x:this.left,y:this.top}),z=this.unrotatePoint({x:re.x*K,y:re.y*Q});this.left=z.x,this.top=z.y,this.width=this.width*K,this.height=this.height*Q,this.adjustControlBox()},j}(c),S=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.createVisual=z.createVisual.bind(z),z}return V(j,X),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.visual)},j.prototype.createVisual=function(){this.visual=L.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)},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},j.prototype.manipulate=function(K){X.prototype.manipulate.call(this,K)},j.prototype.resize=function(K){X.prototype.resize.call(this,K),this.setSize()},j.prototype.setSize=function(){X.prototype.setSize.call(this),L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},j.prototype.pointerUp=function(K){X.prototype.pointerUp.call(this,K),this.setSize()},j.prototype.setStrokeColor=function(K){this.strokeColor=K,this.visual&&L.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(K),this.stateChanged()},j.prototype.setFillColor=function(K){this.fillColor=K,this.visual&&L.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},j.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.visual&&L.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},j.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.visual&&L.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},j.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))},j.prototype.restoreState=function(K){var Q=K;this.fillColor=Q.fillColor,this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.opacity=Q.opacity,this.createVisual(),X.prototype.restoreState.call(this,K),this.setSize()},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q),this.setSize()},j.title="Rectangle marker",j}(O),C=function(X){function j(K,Q,re,z){var we=X.call(this,K,z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return we.widths=[],we.widthBoxes=[],we.widths=Q,we.currentWidth=re,we.setCurrentWidth=we.setCurrentWidth.bind(we),we}return V(j,X),j.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",this.widths.forEach(function(re){var z=document.createElement("div");z.style.display="flex",z.style.flexGrow="2",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=re===K.currentWidth?K.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){K.setCurrentWidth(re,z)}),Q.appendChild(z);var we=document.createElement("div");we.innerText=re.toString(),we.style.marginRight="5px",z.appendChild(we);var Ue=document.createElement("div");Ue.style.minHeight="20px",Ue.style.flexGrow="2",Ue.style.display="flex",Ue.style.alignItems="center";var rt=document.createElement("hr");rt.style.minWidth="20px",rt.style.border="0px",rt.style.borderTop=re+"px solid "+K.uiStyleSettings.toolboxColor,rt.style.flexGrow="2",Ue.appendChild(rt),z.appendChild(Ue),K.widthBoxes.push(z)}),Q},j.prototype.setCurrentWidth=function(K,Q){var re=this;this.currentWidth=K,this.widthBoxes.forEach(function(z){z.style.borderColor=z===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},j}(a),R=function(X){function j(K,Q,re,z){var we=X.call(this,K,z||'<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 we.styles=[],we.styleBoxes=[],we.styles=Q,we.currentStyle=re,we.setCurrentStyle=we.setCurrentStyle.bind(we),we}return V(j,X),j.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",this.styles.forEach(function(re){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/K.styles.length-5+"%",z.style.borderColor=re===K.currentStyle?K.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){K.setCurrentStyle(re,z)}),Q.appendChild(z);var we=document.createElement("div");we.style.minHeight="20px",we.style.flexGrow="2",we.style.overflow="hidden";var Ue=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+K.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(re!==""?'stroke-dasharray="'+re+'"':"")+` />
</svg>`;we.innerHTML=Ue,z.appendChild(we),K.styleBoxes.push(z)}),Q},j.prototype.setCurrentStyle=function(K,Q){var re=this;this.currentStyle=K,this.styleBoxes.forEach(function(z){z.style.borderColor=z===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},j}(a),T=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.strokeColor=re.defaultColor,z.strokeWidth=re.defaultStrokeWidth,z.strokeDasharray=re.defaultStrokeDasharray,z.strokePanel=new o("Line color",re.defaultColorSet,re.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new C("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return V(j,X),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=X.prototype.getState.call(this);return K.typeName=j.typeName,K},j.typeName="FrameMarker",j.title="Frame marker",j.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',j}(S),v=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},b=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.x1=0,z.y1=0,z.x2=0,z.y2=0,z.defaultLength=50,z.manipulationStartX=0,z.manipulationStartY=0,z.manipulationStartX1=0,z.manipulationStartY1=0,z.manipulationStartX2=0,z.manipulationStartY2=0,z.setupControlBox(),z}return V(j,X),j.prototype.ownsTarget=function(K){return!!X.prototype.ownsTarget.call(this,K)||!(!this.grip1.ownsTarget(K)&&!this.grip2.ownsTarget(K))},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.state==="new"&&(this.x1=K.x,this.y1=K.y,this.x2=K.x,this.y2=K.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Q)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Q)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},j.prototype.pointerUp=function(K){var Q=this.state;X.prototype.pointerUp.call(this,K),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(K),this._state="select",Q==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},j.prototype.adjustVisual=function(){},j.prototype.manipulate=function(K){this.state==="creating"?this.resize(K):this.state==="move"?(this.x1=this.manipulationStartX1+K.x-this.manipulationStartX,this.y1=this.manipulationStartY1+K.y-this.manipulationStartY,this.x2=this.manipulationStartX2+K.x-this.manipulationStartX,this.y2=this.manipulationStartY2+K.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(K)},j.prototype.resize=function(K){switch(this.activeGrip){case this.grip1:this.x1=K.x,this.y1=K.y;break;case this.grip2:case void 0:this.x2=K.x,this.y2=K.y}this.adjustVisual(),this.adjustControlBox()},j.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},j.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},j.prototype.setupControlBox=function(){this.controlBox=L.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},j.prototype.adjustControlBox=function(){this.positionGrips()},j.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},j.prototype.createGrip=function(){var K=new i;return K.visual.transform.baseVal.appendItem(L.createTransform()),this.controlBox.appendChild(K.visual),K},j.prototype.positionGrips=function(){var K=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-K/2,this.y1-K/2),this.positionGrip(this.grip2.visual,this.x2-K/2,this.y2-K/2)},j.prototype.positionGrip=function(K,Q,re){var z=K.transform.baseVal.getItem(0);z.setTranslate(Q,re),K.transform.baseVal.replaceItem(z,0)},j.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},j.prototype.restoreState=function(K){X.prototype.restoreState.call(this,K);var Q=K;this.x1=Q.x1,this.y1=Q.y1,this.x2=Q.x2,this.y2=Q.y2},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q),this.x1=this.x1*K,this.y1=this.y1*Q,this.x2=this.x2*K,this.y2=this.y2*Q,this.adjustVisual(),this.adjustControlBox()},j}(c),f=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.strokeColor=re.defaultColor,z.strokeWidth=re.defaultStrokeWidth,z.strokeDasharray=re.defaultStrokeDasharray,z.strokePanel=new o("Line color",re.defaultColorSet,re.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new C("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return V(j,X),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.selectorLine&&K!==this.visibleLine)},j.prototype.createVisual=function(){this.visual=L.createGroup(),this.selectorLine=L.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=L.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)},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},j.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()),L.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),L.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},j.prototype.setStrokeColor=function(K){this.strokeColor=K,this.adjustVisual(),this.colorChanged(K)},j.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.adjustVisual()},j.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.adjustVisual(),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){X.prototype.restoreState.call(this,K);var Q=K;this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.createVisual(),this.adjustVisual()},j.typeName="LineMarker",j.title="Line marker",j.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',j}(b),h=function(X){function j(K,Q,re,z){var we=X.call(this,K,z||'<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 we.fonts=[],we.fontBoxes=[],we.fonts=Q,we.currentFont=re,we.setCurrentFont=we.setCurrentFont.bind(we),we}return V(j,X),j.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.overflow="hidden",Q.style.flexGrow="2",this.fonts.forEach(function(re){var z=document.createElement("div");z.style.display="inline-block",z.style.alignItems="center",z.style.justifyContent="space-between",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.overflow="hidden",z.style.maxWidth=100/K.fonts.length-5+"%",z.style.borderColor=re===K.currentFont?K.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){K.setCurrentFont(re,z)}),Q.appendChild(z);var we=document.createElement("div");we.style.display="flex",we.style.minHeight="20px",we.style.flexGrow="2",we.style.fontFamily=re,we.style.overflow="hidden";var Ue=document.createElement("div");Ue.style.whiteSpace="nowrap",Ue.style.overflow="hidden",Ue.style.textOverflow="ellipsis",Ue.innerHTML="The quick brown fox jumps over the lazy dog",we.appendChild(Ue),z.appendChild(we),K.fontBoxes.push(z)}),Q},j.prototype.setCurrentFont=function(K,Q){var re=this;this.currentFont=K,this.fontBoxes.forEach(function(z){z.style.borderColor=z===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},j}(a),_=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.color="transparent",z.padding=5,z.DEFAULT_TEXT="your text here",z.text=z.DEFAULT_TEXT,z.isMoved=!1,z.color=re.defaultColor,z.fontFamily=re.defaultFontFamily,z.defaultSize={x:100,y:30},z.setColor=z.setColor.bind(z),z.setFont=z.setFont.bind(z),z.renderText=z.renderText.bind(z),z.sizeText=z.sizeText.bind(z),z.textEditDivClicked=z.textEditDivClicked.bind(z),z.showTextEditor=z.showTextEditor.bind(z),z.setSize=z.setSize.bind(z),z.positionTextEditor=z.positionTextEditor.bind(z),z.colorPanel=new o("Color",re.defaultColorSet,re.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.fontFamilyPanel=new h("Font",re.defaultFontFamilies,re.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z}return V(j,X),j.prototype.ownsTarget=function(K){if(X.prototype.ownsTarget.call(this,K)||K===this.visual||K===this.textElement||K===this.bgRectangle)return!0;var Q=!1;return this.textElement.childNodes.forEach(function(re){re===K&&(Q=!0)}),Q},j.prototype.createVisual=function(){this.visual=L.createGroup(),this.bgRectangle=L.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=L.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(L.createTransform()),this.textElement.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.isMoved=!1,this.pointerDownPoint=K,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},j.prototype.renderText=function(){var K=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Q){K.textElement.appendChild(L.createTSpan(Q.trim()===""?" ":Q.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},j.prototype.getTextScale=function(){var K=this.textElement.getBBox(),Q=1;if(K.width>0&&K.height>0){var re=(1*this.width-this.width*this.padding*2/100)/K.width,z=(1*this.height-this.height*this.padding*2/100)/K.height;Q=Math.min(re,z)}return Q},j.prototype.getTextPosition=function(K){var Q=this.textElement.getBBox(),re=0,z=0;return Q.width>0&&Q.height>0&&(re=(this.width-Q.width*K)/2,z=this.height/2-Q.height*K/2),{x:re,y:z}},j.prototype.sizeText=function(){var K=this.textElement.getBBox(),Q=this.getTextScale(),re=this.getTextPosition(Q);re.y-=K.y*Q,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+re.x+"px, "+re.y+"px) scale("+Q+", "+Q+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(re.x,re.y),this.textElement.transform.baseVal.getItem(1).setScale(Q,Q))},j.prototype.manipulate=function(K){X.prototype.manipulate.call(this,K),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(K.x-this.pointerDownPoint.x)>5||Math.abs(K.y-this.pointerDownPoint.y)>5)},j.prototype.resize=function(K){X.prototype.resize.call(this,K),this.isMoved=!0,this.setSize(),this.sizeText()},j.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},j.prototype.pointerUp=function(K){var Q=this.state;Q==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,K),this.setSize(),(Q==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},j.prototype.showTextEditor=function(){var K=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Q){Q.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Q=Number.parseFloat(K.textEditor.style.fontSize);K.textEditor.clientWidth>=Number.parseInt(K.textEditor.style.maxWidth)&&Q>.9;)Q-=.1,K.textEditor.style.fontSize=Math.max(Q,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Q){Q.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Q){if(Q.clipboardData){var re=Q.clipboardData.getData("text"),z=window.getSelection();if(!z.rangeCount)return!1;z.deleteFromDocument(),z.getRangeAt(0).insertNode(document.createTextNode(re)),Q.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){K.textEditDivClicked(K.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},j.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var K=this.getTextScale(),Q=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),re=this.textElement.getBBox(),z={x:re.width*K,y:re.height*K};Q.x-=z.x/2,Q.y-=z.y/2,this.textEditor.style.top=Q.y+"px",this.textEditor.style.left=Q.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Q.x+"px",this.textEditor.style.fontSize=Math.max(16*K,12)+"px",this.textElement.style.display="none"}},j.prototype.textEditDivClicked=function(K){this.text=K.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},j.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},j.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},j.prototype.dblClick=function(K,Q){X.prototype.dblClick.call(this,K,Q),this.showTextEditor()},j.prototype.setColor=function(K){this.textElement&&L.setAttributes(this.textElement,[["fill",K]]),this.color=K,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(K)},j.prototype.setFont=function(K){this.textElement&&L.setAttributes(this.textElement,[["font-family",K]]),this.fontFamily=K,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},j.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},j.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){var Q=K;this.color=Q.color,this.fontFamily=Q.fontFamily,this.padding=Q.padding,this.text=Q.text,this.createVisual(),X.prototype.restoreState.call(this,K),this.setSize()},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q),this.setSize(),this.sizeText(),this.positionTextEditor()},j.typeName="TextMarker",j.title="Text marker",j.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>',j}(O),g=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.color="transparent",z.lineWidth=3,z.drawing=!1,z.pixelRatio=1,z.color=re.defaultColor,z.lineWidth=re.defaultStrokeWidth,z.pixelRatio=re.freehandPixelRatio,z.setColor=z.setColor.bind(z),z.addCanvas=z.addCanvas.bind(z),z.finishCreation=z.finishCreation.bind(z),z.setLineWidth=z.setLineWidth.bind(z),z.colorPanel=new o("Color",re.defaultColorSet,re.defaultColor),z.colorPanel.onColorChanged=z.setColor,z.lineWidthPanel=new C("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),z.lineWidthPanel.onWidthChanged=z.setLineWidth,z}return V(j,X),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.drawingImage)},j.prototype.createVisual=function(){this.visual=L.createGroup(),this.drawingImage=L.createImage(),this.visual.appendChild(this.drawingImage);var K=L.createTransform();this.visual.transform.baseVal.appendItem(K),this.addMarkerVisualToContainer(this.visual)},j.prototype.pointerDown=function(K,Q){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(K.x,K.y),this.drawing=!0):X.prototype.pointerDown.call(this,K,Q)},j.prototype.manipulate=function(K){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(K.x,K.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,K)},j.prototype.resize=function(K){X.prototype.resize.call(this,K),L.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},j.prototype.pointerUp=function(K){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,K)},j.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)},j.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},j.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},j.prototype.finishCreation=function(){for(var K=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Q=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],re=Q[0],z=Q[1],we=Q[2],Ue=Q[3],rt=!1,le=0;le<this.canvasElement.height;le++)for(var Oe=0;Oe<this.canvasElement.width;Oe++)K.data[le*this.canvasElement.width*4+4*Oe+3]>0&&(rt=!0,le<z&&(z=le),Oe<re&&(re=Oe),le>Ue&&(Ue=le),Oe>we&&(we=Oe));if(rt){this.left=re/this.pixelRatio,this.top=z/this.pixelRatio,this.width=(we-re)/this.pixelRatio,this.height=(Ue-z)/this.pixelRatio;var Fe=document.createElement("canvas");Fe.width=we-re,Fe.height=Ue-z,Fe.getContext("2d").putImageData(this.canvasContext.getImageData(re,z,we-re,Ue-z),0,0),this.drawingImgUrl=Fe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},j.prototype.setDrawingImage=function(){L.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),L.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},j.prototype.setColor=function(K){this.color=K,this.colorChanged(K)},j.prototype.setLineWidth=function(K){this.lineWidth=K},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){this.createVisual(),X.prototype.restoreState.call(this,K),this.drawingImgUrl=K.drawingImgUrl,this.setDrawingImage()},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q),this.setDrawingImage()},j.typeName="FreehandMarker",j.title="Freehand marker",j.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>',j}(O),x=function(X){function j(K,Q,re){var z=X.call(this,K,re||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return z.typeBoxes=[],z.currentType=Q,z.setCurrentType=z.setCurrentType.bind(z),z}return V(j,X),j.prototype.getUi=function(){var K=this,Q=document.createElement("div");Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2";for(var re=function(Ue){var rt="both";switch(Ue){case 0:rt="both";break;case 1:rt="start";break;case 2:rt="end";break;case 3:rt="none"}var le=document.createElement("div");if(le.style.display="flex",le.style.flexGrow="2",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=rt===z.currentType?z.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){K.setCurrentType(rt,le)}),Q.appendChild(le),rt==="both"||rt==="start"){var Oe=document.createElement("div");Oe.style.display="flex",Oe.style.alignItems="center",Oe.style.minHeight="20px",Oe.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Oe.style.marginLeft="5px",le.appendChild(Oe)}var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.style.flexGrow="2";var Ye=document.createElement("hr");if(Ye.style.minWidth="20px",Ye.style.border="0px",Ye.style.borderTop="3px solid "+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee"),Ye.style.flexGrow="2",Fe.appendChild(Ye),le.appendChild(Fe),rt==="both"||rt==="end"){var Tt=document.createElement("div");Tt.style.display="flex",Tt.style.alignItems="center",Tt.style.minHeight="20px",Tt.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="`+(z.uiStyleSettings!==void 0?z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Tt.style.marginRight="5px",le.appendChild(Tt)}z.typeBoxes.push(le)},z=this,we=0;we<4;we++)re(we);return Q},j.prototype.setCurrentType=function(K,Q){var re=this;this.currentType=K,this.typeBoxes.forEach(function(z){z.style.borderColor=z===Q?re.uiStyleSettings!==void 0?re.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},j}(a),N=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.arrowType="end",z.arrowBaseHeight=10,z.arrowBaseWidth=10,z.getArrowPoints=z.getArrowPoints.bind(z),z.setArrowType=z.setArrowType.bind(z),z.arrowTypePanel=new x("Arrow type","end"),z.arrowTypePanel.onArrowTypeChanged=z.setArrowType,z}return V(j,X),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.arrow1&&K!==this.arrow2)},j.prototype.getArrowPoints=function(K,Q){var re=this.arrowBaseWidth+2*this.strokeWidth,z=this.arrowBaseHeight+2*this.strokeWidth;return K-re/2+","+(Q+z/2)+" "+K+","+(Q-z/2)+" "+(K+re/2)+","+(Q+z/2)},j.prototype.createTips=function(){this.arrow1=L.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=L.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(L.createTransform()),this.visual.appendChild(this.arrow2)},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.state==="creating"&&this.createTips()},j.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",L.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),L.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var K=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Q=this.arrow1.transform.baseVal.getItem(0);Q.setRotate(K,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Q,0);var re=this.arrow2.transform.baseVal.getItem(0);re.setRotate(K+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(re,0)}},j.prototype.setArrowType=function(K){this.arrowType=K,this.adjustVisual(),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){X.prototype.restoreState.call(this,K);var Q=K;this.arrowType=Q.arrowType,this.createTips(),this.adjustVisual()},j.typeName="ArrowMarker",j.title="Arrow marker",j.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',j}(f),F=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.fillColor=re.defaultFillColor,z.strokeWidth=0,z.fillPanel=new o("Color",re.defaultColorSet,re.defaultFillColor),z.fillPanel.onColorChanged=z.setFillColor,z}return V(j,X),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=X.prototype.getState.call(this);return K.typeName=j.typeName,K},j.typeName="CoverMarker",j.title="Cover marker",j.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',j}(S),A=function(X){function j(K,Q,re,z){var we=X.call(this,K,z||'<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 we.opacities=[],we.opacityBoxes=[],we.opacities=Q,we.currentOpacity=re,we.setCurrentOpacity=we.setCurrentOpacity.bind(we),we}return V(j,X),j.prototype.getUi=function(){var K=this,Q=document.createElement("div");return Q.style.display="flex",Q.style.overflow="hidden",Q.style.flexGrow="2",Q.style.justifyContent="space-between",this.opacities.forEach(function(re){var z=document.createElement("div");z.style.display="flex",z.style.alignItems="center",z.style.justifyContent="center",z.style.padding="5px",z.style.borderWidth="2px",z.style.borderStyle="solid",z.style.borderColor=re===K.currentOpacity?K.uiStyleSettings.toolboxAccentColor:"transparent",z.addEventListener("click",function(){K.setCurrentOpacity(re,z)}),Q.appendChild(z);var we=document.createElement("div");we.innerText=100*re+"%",z.appendChild(we),K.opacityBoxes.push(z)}),Q},j.prototype.setCurrentOpacity=function(K,Q){var re=this;this.currentOpacity=K,this.opacityBoxes.forEach(function(z){z.style.borderColor=z===Q?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},j}(a),B=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.setOpacity=z.setOpacity.bind(z),z.fillColor=re.defaultHighlightColor,z.strokeWidth=0,z.opacity=re.defaultHighlightOpacity,z.fillPanel=new o("Color",re.defaultColorSet,z.fillColor),z.fillPanel.onColorChanged=z.setFillColor,z.opacityPanel=new A("Opacity",re.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return V(j,X),j.prototype.setOpacity=function(K){this.opacity=K,this.visual&&L.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=X.prototype.getState.call(this);return K.typeName=j.typeName,K},j.typeName="HighlightMarker",j.title="Highlight marker",j.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>',j}(F),U='<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>',w=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.bgColor="transparent",z.tipPosition={x:0,y:0},z.tipBase1Position={x:0,y:0},z.tipBase2Position={x:0,y:0},z.tipMoving=!1,z.color=re.defaultStrokeColor,z.bgColor=re.defaultFillColor,z.fontFamily=re.defaultFontFamily,z.defaultSize={x:100,y:30},z.setBgColor=z.setBgColor.bind(z),z.getTipPoints=z.getTipPoints.bind(z),z.positionTip=z.positionTip.bind(z),z.setTipPoints=z.setTipPoints.bind(z),z.colorPanel=new o("Text color",re.defaultColorSet,z.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>'),z.colorPanel.onColorChanged=z.setColor,z.bgColorPanel=new o("Fill color",re.defaultColorSet,z.bgColor,U),z.bgColorPanel.onColorChanged=z.setBgColor,z.fontFamilyPanel=new h("Font",re.defaultFontFamilies,re.defaultFontFamily),z.fontFamilyPanel.onFontChanged=z.setFont,z.tipGrip=new i,z.tipGrip.visual.transform.baseVal.appendItem(L.createTransform()),z.controlBox.appendChild(z.tipGrip.visual),z}return V(j,X),j.prototype.ownsTarget=function(K){return X.prototype.ownsTarget.call(this,K)||this.tipGrip.ownsTarget(K)||this.tip===K},j.prototype.createTip=function(){L.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=L.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},j.prototype.pointerDown=function(K,Q){this.state==="new"&&X.prototype.pointerDown.call(this,K,Q),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Q)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):X.prototype.pointerDown.call(this,K,Q)},j.prototype.pointerUp=function(K){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,K);else{var Q=this.state==="creating";X.prototype.pointerUp.call(this,K),this.setTipPoints(Q),this.positionTip()}},j.prototype.manipulate=function(K){if(this.tipMoving){var Q=this.unrotatePoint(K);this.tipPosition={x:Q.x-this.manipulationStartLeft,y:Q.y-this.manipulationStartTop},this.positionTip()}else X.prototype.manipulate.call(this,K)},j.prototype.setBgColor=function(K){this.bgRectangle&&this.tip&&(L.setAttributes(this.bgRectangle,[["fill",K]]),L.setAttributes(this.tip,[["fill",K]])),this.bgColor=K,this.fillColorChanged(K)},j.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},j.prototype.setTipPoints=function(K){K===void 0&&(K=!1);var Q=Math.min(this.height/2,15),re=this.height/5;K&&(this.tipPosition={x:Q+re/2,y:this.height+20});var z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:Q,y:0},this.tipBase2Position={x:Q+re,y:0}):(this.tipBase1Position={x:0,y:Q},this.tipBase2Position={x:0,y:Q+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Q-re,y:0},this.tipBase2Position={x:this.width-Q,y:0}):(this.tipBase1Position={x:this.width,y:Q},this.tipBase2Position={x:this.width,y:Q+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Q-re,y:this.height},this.tipBase2Position={x:this.width-Q,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Q-re},this.tipBase2Position={x:this.width,y:this.height-Q}):z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(re=this.width/5,Q=Math.min(this.width/2,15),this.tipBase1Position={x:Q,y:this.height},this.tipBase2Position={x:Q+re,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Q},this.tipBase2Position={x:0,y:this.height-Q-re})},j.prototype.resize=function(K){X.prototype.resize.call(this,K),this.positionTip()},j.prototype.positionTip=function(){L.setAttributes(this.tip,[["points",this.getTipPoints()]]);var K=this.tipGrip.visual.transform.baseVal.getItem(0);K.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(K,0)},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.positionTip(),X.prototype.select.call(this)},j.prototype.getState=function(){var K=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){var Q=K;this.bgColor=Q.bgColor,this.tipPosition=Q.tipPosition,X.prototype.restoreState.call(this,K),this.createTip(),this.setTipPoints()},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q),this.tipPosition={x:this.tipPosition.x*K,y:this.tipPosition.y*Q},this.positionTip()},j.typeName="CalloutMarker",j.title="Callout marker",j.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>',j}(_),Y=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.fillColor="transparent",z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.opacity=1,z.strokeColor=re.defaultColor,z.strokeWidth=re.defaultStrokeWidth,z.strokeDasharray=re.defaultStrokeDasharray,z.fillColor=re.defaultFillColor,z.setStrokeColor=z.setStrokeColor.bind(z),z.setFillColor=z.setFillColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.setOpacity=z.setOpacity.bind(z),z.createVisual=z.createVisual.bind(z),z.strokePanel=new o("Line color",P(re.defaultColorSet,["transparent"]),re.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.fillPanel=new o("Fill color",P(re.defaultColorSet,["transparent"]),z.fillColor,U),z.fillPanel.onColorChanged=z.setFillColor,z.strokeWidthPanel=new C("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z.opacityPanel=new A("Opacity",re.defaultOpacitySteps,z.opacity),z.opacityPanel.onOpacityChanged=z.setOpacity,z}return V(j,X),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.visual)},j.prototype.createVisual=function(){this.visual=L.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)},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.state==="new"&&(this.createVisual(),this.moveVisual(K),this._state="creating")},j.prototype.manipulate=function(K){X.prototype.manipulate.call(this,K)},j.prototype.resize=function(K){X.prototype.resize.call(this,K),this.setSize()},j.prototype.setSize=function(){X.prototype.setSize.call(this),L.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},j.prototype.pointerUp=function(K){X.prototype.pointerUp.call(this,K),this.setSize()},j.prototype.setStrokeColor=function(K){this.strokeColor=K,this.visual&&L.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(K),this.stateChanged()},j.prototype.setFillColor=function(K){this.fillColor=K,this.visual&&L.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(K),this.stateChanged()},j.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.visual&&L.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},j.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.visual&&L.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},j.prototype.setOpacity=function(K){this.opacity=K,this.visual&&L.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){var Q=K;this.fillColor=Q.fillColor,this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.opacity=Q.opacity,this.createVisual(),X.prototype.restoreState.call(this,K),this.setSize()},j.prototype.scale=function(K,Q){X.prototype.scale.call(this,K,Q),this.setSize()},j.typeName="EllipseMarker",j.title="Ellipse marker",j.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>',j}(O),q=function(X){function j(K,Q,re){return X.call(this,K,Q,re)||this}return V(j,X),Object.defineProperty(j.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.tip1&&K!==this.tip2)},j.prototype.createTips=function(){this.tip1=L.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(L.createTransform()),this.visual.appendChild(this.tip1),this.tip2=L.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(L.createTransform()),this.visual.appendChild(this.tip2)},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.state==="creating"&&this.createTips()},j.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(L.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()]]),L.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 K=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Q=this.tip1.transform.baseVal.getItem(0);Q.setRotate(K,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Q,0);var re=this.tip2.transform.baseVal.getItem(0);re.setRotate(K+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(re,0)}},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=X.prototype.getState.call(this);return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){X.prototype.restoreState.call(this,K),this.createTips(),this.adjustVisual()},j.typeName="MeasurementMarker",j.title="Measurement marker",j.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>',j}(f),ce=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.strokePanel.colors=re.defaultColorSet,z.fillColor="transparent",z}return V(j,X),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=X.prototype.getState.call(this);return K.typeName=j.typeName,K},j.typeName="EllipseFrameMarker",j.title="Ellipse frame marker",j.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>',j}(Y),Ee=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(j){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(j)||(this.undoStack.push(j),JSON.stringify(this.lastRedoStep)!==JSON.stringify(j)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(j){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=j)},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 j=this.undoStack.pop();return j!==void 0&&this.redoStack.push(j),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}(),Qe=function(X){function j(K,Q,re){var z=X.call(this,K,Q,re)||this;return z.strokeColor="transparent",z.strokeWidth=0,z.strokeDasharray="",z.curveX=0,z.curveY=0,z.manipulationStartCurveX=0,z.manipulationStartCurveY=0,z.setStrokeColor=z.setStrokeColor.bind(z),z.setStrokeWidth=z.setStrokeWidth.bind(z),z.setStrokeDasharray=z.setStrokeDasharray.bind(z),z.positionGrips=z.positionGrips.bind(z),z.addControlGrips=z.addControlGrips.bind(z),z.adjustVisual=z.adjustVisual.bind(z),z.setupControlBox=z.setupControlBox.bind(z),z.resize=z.resize.bind(z),z.strokeColor=re.defaultColor,z.strokeWidth=re.defaultStrokeWidth,z.strokeDasharray=re.defaultStrokeDasharray,z.strokePanel=new o("Line color",re.defaultColorSet,re.defaultColor),z.strokePanel.onColorChanged=z.setStrokeColor,z.strokeWidthPanel=new C("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),z.strokeWidthPanel.onWidthChanged=z.setStrokeWidth,z.strokeStylePanel=new R("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),z.strokeStylePanel.onStyleChanged=z.setStrokeDasharray,z}return V(j,X),j.prototype.ownsTarget=function(K){return!(!X.prototype.ownsTarget.call(this,K)&&K!==this.visual&&K!==this.selectorCurve&&K!==this.visibleCurve&&!this.curveGrip.ownsTarget(K))},j.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},j.prototype.createVisual=function(){this.visual=L.createGroup(),this.selectorCurve=L.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=L.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)},j.prototype.pointerDown=function(K,Q){X.prototype.pointerDown.call(this,K,Q),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=K.x,this.curveY=K.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Q)&&(this.activeGrip=this.curveGrip,this._state="resize")},j.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),L.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),L.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),L.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},j.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=L.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=L.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)},j.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},j.prototype.positionGrips=function(){X.prototype.positionGrips.call(this);var K=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-K/2,this.curveY-K/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},j.prototype.manipulate=function(K){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+K.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+K.y-this.manipulationStartY),X.prototype.manipulate.call(this,K)},j.prototype.resize=function(K){this.activeGrip===this.curveGrip&&(this.curveX=K.x,this.curveY=K.y),X.prototype.resize.call(this,K),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},j.prototype.setStrokeColor=function(K){this.strokeColor=K,this.adjustVisual(),this.colorChanged(K)},j.prototype.setStrokeWidth=function(K){this.strokeWidth=K,this.adjustVisual()},j.prototype.setStrokeDasharray=function(K){this.strokeDasharray=K,this.adjustVisual()},j.prototype.scale=function(K,Q){this.curveX=this.curveX*K,this.curveY=this.curveY*Q,X.prototype.scale.call(this,K,Q)},Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),j.prototype.getState=function(){var K=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return K.typeName=j.typeName,K},j.prototype.restoreState=function(K){X.prototype.restoreState.call(this,K);var Q=K;this.strokeColor=Q.strokeColor,this.strokeWidth=Q.strokeWidth,this.strokeDasharray=Q.strokeDasharray,this.curveX=Q.curveX,this.curveY=Q.curveY,this.createVisual(),this.adjustVisual()},j.typeName="CurveMarker",j.title="Curve marker",j.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>',j}(b),Te=function(){function X(j,K){K===void 0&&(K=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=j,this.cancelable=K}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),We=function(X){function j(K,Q,re){var z=X.call(this,K,!1)||this;return z.dataUrl=Q,z.state=re,z}return V(j,X),j}(Te),$e=function(X){function j(K,Q,re){re===void 0&&(re=!1);var z=X.call(this,K,re)||this;return z.marker=Q,z}return V(j,X),j}(Te),Je=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(j,K){this[j].push(K)},X.prototype.removeEventListener=function(j,K){var Q=this[j].indexOf(K);Q>-1&&this[j].splice(Q,1)},X}(),Ce=function(){function X(j){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new v,this._isOpen=!1,this.undoRedoManager=new Ee,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 Je,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new M(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=j,this.targetRoot=document.body,this.width=j.clientWidth,this.height=j.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[T,g,N,_,ce,Y,B,w,q,F,f,Qe]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[T,g,N,_,Y,B,w]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[T,g,N,_,B]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(j){var K=this;this._availableMarkerTypes.splice(0),j.forEach(function(Q){if(typeof Q=="string"){var re=K.ALL_MARKER_TYPES.find(function(z){return z.typeName===Q});re!==void 0&&K._availableMarkerTypes.push(re)}else K._availableMarkerTypes.push(Q)})},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(j){this._zoomLevel=j,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(),W.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var j=this;this.styles.styleSheetRoot===void 0&&r.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=r.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(K){return K(new Te(j))})},X.prototype.render=function(){return I(this,void 0,void 0,function(){var j;return G(this,function(K){switch(K.label){case 0:return this.setCurrentMarker(),(j=new k).naturalSize=this.renderAtNaturalSize,j.imageType=this.renderImageType,j.imageQuality=this.renderImageQuality,j.markersOnly=this.renderMarkersOnly,j.width=this.renderWidth,j.height=this.renderHeight,[4,j.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return K.sent(),[4,j.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,K.sent()]}})})},X.prototype.close=function(j){var K=this;if(j===void 0&&(j=!1),this.isOpen){var Q=!1;j||this.eventListeners.beforeclose.forEach(function(re){var z=new Te(K,!0);re(z),z.defaultPrevented&&(Q=!0)}),Q||(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(re){return re(new Te(K))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var j,K=[],Q=0;Q<arguments.length;Q++)K[Q]=arguments[Q];(j=this._availableMarkerTypes).push.apply(j,K)},X.prototype.addRenderEventListener=function(j){this.addEventListener("render",function(K){j(K.dataUrl,K.state)})},X.prototype.removeRenderEventListener=function(j){},X.prototype.addCloseEventListener=function(j){this.addEventListener("close",function(){j()})},X.prototype.removeCloseEventListener=function(j){},X.prototype.setupResizeObserver=function(){var j=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){j.resize(j.target.clientWidth,j.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return j.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},X.prototype.onPopupTargetResize=function(){var j=1*this.target.clientWidth/this.target.clientHeight,K=this.editorCanvas.clientWidth/j>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*j:this.editorCanvas.clientWidth,Q=K<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/j;this.resize(K,Q)},X.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},X.prototype.resize=function(j,K){this._isResizing=!0;var Q=j/this.imageWidth,re=K/this.imageHeight;this.imageWidth=Math.round(j),this.imageHeight=Math.round(K),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(Q,re),this._isResizing=!1},X.prototype.scaleMarkers=function(j,K){var Q,re=this;this._currentMarker&&this._currentMarker instanceof _?this._currentMarker.scale(j,K):(Q=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(z){z!==re._currentMarker&&z.scale(j,K)}),Q!==void 0&&this.setCurrentMarker(Q)},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 j=this.editingTarget.getBoundingClientRect(),K=this.editorCanvas.getBoundingClientRect();this.left=j.left-K.left,this.top=j.top-K.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 j,K=[],Q=0;Q<arguments.length;Q++)K[Q]=arguments[Q];this.defs=L.createDefs(),this.addDefsToImage(),(j=this.defs).append.apply(j,K)},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 j=document.createElement("a");j.href="https://markerjs.com/",j.target="_blank",j.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>',j.title="Powered by marker.js",j.style.display="grid",j.style.alignItems="center",j.style.justifyItems="center",j.style.padding="3px",j.style.width="20px",j.style.height="20px",this.logoUI.appendChild(j),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 j=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=j+"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 m(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 u(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(j){this.markerImage.removeChild(j.container),this.markers.indexOf(j)>-1&&this.markers.splice(this.markers.indexOf(j),1),j.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(j,K){if(j==="marker"&&K!==void 0)this.createNewMarker(K);else if(j==="action")switch(K){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},X.prototype.deleteSelectedMarker=function(){var j=this;if(this._currentMarker!==void 0){var K=!1;if(this.eventListeners.markerbeforedelete.forEach(function(re){var z=new $e(j,j._currentMarker,!0);re(z),z.defaultPrevented&&(K=!0)}),!K){var Q=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(re){return re(new $e(j,Q))})}}},X.prototype.clear=function(){var j=this,K=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(we){var Ue=new $e(j,void 0,!0);we(Ue),Ue.defaultPrevented&&(K=!0)}),!K)){this.setCurrentMarker();for(var Q=function(we){var Ue=re.markers[we];re.setCurrentMarker(re.markers[we]),re._currentMarker.dispose(),re.markerImage.removeChild(re._currentMarker.container),re.markers.splice(re.markers.indexOf(re._currentMarker),1),re.eventListeners.markerdelete.forEach(function(rt){return rt(new $e(j,Ue))})},re=this,z=this.markers.length-1;z>=0;z--)Q(z);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var j;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=(j=this._currentMarker.notes)!==null&&j!==void 0?j:"",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 j=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var K=this.getState(),Q=this.undoRedoManager.getLastUndoStep();if(!Q||Q.width===K.width&&Q.height===K.height){var re=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(K),re<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(z){return z(new Te(j))})}else this.undoRedoManager.replaceLastUndoStep(K),this.eventListeners.statechange.forEach(function(z){return z(new Te(j))})}},X.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},X.prototype.undoStep=function(){var j=this,K=this.undoRedoManager.undo();K!==void 0&&(this.restoreState(K),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Q){return Q(new Te(j))}))},X.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},X.prototype.redoStep=function(){var j=this,K=this.undoRedoManager.redo();K!==void 0&&(this.restoreState(K),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Q){return Q(new Te(j))}))},X.prototype.stepZoom=function(){var j=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=j<this.zoomSteps.length-1?this.zoomSteps[j+1]:this.zoomSteps[0]},X.prototype.panTo=function(j){this.contentDiv.scrollBy({left:this.prevPanPoint.x-j.x,top:this.prevPanPoint.y-j.y}),this.prevPanPoint=j},X.prototype.startRenderAndClose=function(){return I(this,void 0,void 0,function(){var j,K,Q=this;return G(this,function(re){switch(re.label){case 0:return[4,this.render()];case 1:return j=re.sent(),K=this.getState(),this.eventListeners.render.forEach(function(z){return z(new We(Q,j,K))}),this.close(!0),[2]}})})},X.prototype.getState=function(j){j===!0&&this.setCurrentMarker();var K={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Q){return K.markers.push(Q.getState())}),K},X.prototype.restoreState=function(j){var K=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);j.markers.forEach(function(Q){var re=K._availableMarkerTypes.find(function(we){return we.typeName===Q.typeName});if(re!==void 0){var z=K.addNewMarker(re);z.restoreState(Q),K.markers.push(z)}}),j.width&&j.height&&(j.width!==this.imageWidth||j.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/j.width,this.imageHeight/j.height),this.eventListeners.restorestate.forEach(function(Q){return Q(new Te(K))})},X.prototype.addNewMarker=function(j){var K=L.createGroup();return this.markerImage.appendChild(K),new j(K,this.overlayContainer,this.settings)},X.prototype.createNewMarker=function(j){var K,Q=this;(K=typeof j=="string"?this._availableMarkerTypes.find(function(re){return re.typeName===j}):j)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(K),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(K.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(re){return re(new $e(Q,Q._currentMarker))}))},X.prototype.markerCreated=function(j){var K=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(j),this.setCurrentMarker(j),j instanceof g&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(g):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Q){return Q(new $e(K,K._currentMarker))})},X.prototype.colorChanged=function(j){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=j,this.settings.defaultStrokeColor=j)},X.prototype.fillColorChanged=function(j){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=j)},X.prototype.markerStateChanged=function(j){var K=this;this.eventListeners.markerchange.forEach(function(Q){return Q(new $e(K,j))})},X.prototype.setCurrentMarker=function(j){var K=this;this._currentMarker!==j&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Q){return Q(new $e(K,K._currentMarker))})),this._currentMarker=j,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(Q){return Q(new $e(K,K._currentMarker))}))},X.prototype.onPointerDown=function(j){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||j.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var K=this.markers.find(function(Q){return Q.ownsTarget(j.target)});K!==void 0?(this.setCurrentMarker(K),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(j.clientX,j.clientY),j.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:j.clientX,y:j.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(j.clientX,j.clientY))},X.prototype.onDblClick=function(j){if(this._isFocused||this.focus(),this.mode==="select"){var K=this.markers.find(function(Q){return Q.ownsTarget(j.target)});K!==void 0&&K!==this._currentMarker&&this.setCurrentMarker(K),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(j.clientX,j.clientY),j.target):this.setCurrentMarker()}},X.prototype.onPointerMove=function(j){this.touchPoints!==1&&j.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||j.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(j.clientX,j.clientY)):this.zoomLevel>1&&this.panTo({x:j.clientX,y:j.clientY}))},X.prototype.onPointerUp=function(j){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(j.clientX,j.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(j){this._currentMarker===void 0||this.notesArea!==void 0||j.key!=="Delete"&&j.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(j,K){var Q=this.markerImage.getBoundingClientRect();return{x:(j-Q.left)/this.zoomLevel,y:(K-Q.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var j=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=j+"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(j){W.addKey(j)},X.prototype.addEventListener=function(j,K){this.eventListeners.addEventListener(j,K)},X.prototype.removeEventListener=function(j,K){this.eventListeners.removeEventListener(j,K)},X.prototype.renderState=function(j){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(j),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var j=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(K){return K(new Te(j))}))},X.prototype.blur=function(){var j=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(K){return K(new Te(j))}))},X.instanceCounter=0,X}()},T7RX:function(jt,_e,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),I=D("k1fw"),G=D("miYZ"),P=D("tsqr"),L=D("9og8"),W=D("PpiC"),k=D("WmNS"),r=D.n(k),M=D("q1tI"),E=D.n(M),p=D("ErOA"),m=D("Ty5D"),u=D("9kvl"),a=function(c){var s=c.shixunHomeworks,i=c.dispatch,n=Object(W.a)(c,["shixunHomeworks","dispatch"]),O=Object(m.i)();return E.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(L.a)(r.a.mark(function S(){var C;return r.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,Object(p.a)("/api/myshixuns/".concat(s.actionTabs.selectArrs.myshixun_identifier,"/reset_my_game.json"),{method:"GET",params:{course_id:O.coursesId}});case 2:C=T.sent,C.shixun_identifier&&(P.b.success("\u64CD\u4F5C\u6210\u529F"),i({type:"shixunHomeworks/setActionTabs",payload:{}}),i({type:"shixunHomeworks/getWorkList",payload:Object(I.a)({},s.actionTabs.params)}));case 4:case"end":return T.stop()}},S)})),onCancel:function(){i({type:"shixunHomeworks/setActionTabs",payload:{}})}},E.a.createElement("p",null,"\u8BE5\u4F5C\u4E1A\u5C06\u88AB\u6253\u56DE\u91CD\u505A\uFF0C\u5B66\u751F\u5B9E\u8BAD\u8BB0\u5F55\u5C06\u88AB\u6E05\u7A7A!"),E.a.createElement("p",null,"\u786E\u5B9A\u6253\u56DE?"))};_e.a=Object(u.a)(function(o){var c=o.shixunHomeworks;return{shixunHomeworks:c}})(a)},T8No:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return W}),D.d(_e,"e",function(){return k}),D.d(_e,"c",function(){return f}),D.d(_e,"b",function(){return h}),D.d(_e,"d",function(){return _}),D.d(_e,"f",function(){return N});var Z=D("MNsG"),V=D("N0LK"),I=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 L=Object.prototype.hasOwnProperty;class W{static has(A){return p.create(A)}static equals(A,B){return m.create(A,B)}static regex(A,B){return C.create(A,B)}static not(A){return c.create(A)}static and(...A){return v.create(A,null)}static or(...A){return b.create(A,null,!0)}static deserialize(A,B=!1){return A?this._deserializeOrExpression(A,B):void 0}static _deserializeOrExpression(A,B){let U=A.split("||");return b.create(U.map(w=>this._deserializeAndExpression(w,B)),null,!0)}static _deserializeAndExpression(A,B){let U=A.split("&&");return v.create(U.map(w=>this._deserializeOne(w,B)),null)}static _deserializeOne(A,B){if(A=A.trim(),A.indexOf("!=")>=0){let U=A.split("!=");return o.create(U[0].trim(),this._deserializeValue(U[1],B))}if(A.indexOf("==")>=0){let U=A.split("==");return m.create(U[0].trim(),this._deserializeValue(U[1],B))}if(A.indexOf("=~")>=0){let U=A.split("=~");return C.create(U[0].trim(),this._deserializeRegexValue(U[1],B))}if(A.indexOf(" in ")>=0){let U=A.split(" in ");return u.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(A)){const U=A.split(">=");return n.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(A)){const U=A.split(">");return i.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(A)){const U=A.split("<=");return S.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(A)){const U=A.split("<");return O.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(A)?c.create(A.substr(1).trim()):p.create(A)}static _deserializeValue(A,B){if(A=A.trim(),A==="true")return!0;if(A==="false")return!1;let U=/^'([^']*)'$/.exec(A);return U?U[1].trim():A}static _deserializeRegexValue(A,B){if(Object(V.C)(A)){if(B)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=A.indexOf("/"),w=A.lastIndexOf("/");if(U===w||U<0){if(B)throw new Error(`bad regexp-value '${A}', missing /-enclosure`);return console.warn(`bad regexp-value '${A}', missing /-enclosure`),null}let Y=A.slice(U+1,w),q=A[w+1]==="i"?"i":"";try{return new RegExp(Y,q)}catch(ce){if(B)throw new Error(`bad regexp-value '${A}', parse error: ${ce}`);return console.warn(`bad regexp-value '${A}', parse error: ${ce}`),null}}}function k(A,B){const U=A?A.substituteConstants():void 0,w=B?B.substituteConstants():void 0;return!U&&!w?!0:!U||!w?!1:U.equals(w)}function r(A,B){return A.cmp(B)}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 E.INSTANCE}}M.INSTANCE=new M;class E{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}}E.INSTANCE=new E;class p{constructor(A,B){this.key=A,this.negated=B,this.type=2}static create(A,B=null){const U=P.get(A);return typeof U=="boolean"?U?E.INSTANCE:M.INSTANCE:new p(A,B)}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?E.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,B,U){this.key=A,this.value=B,this.negated=U,this.type=4}static create(A,B,U=null){if(typeof B=="boolean")return B?p.create(A,U):c.create(A,U);const w=P.get(A);if(typeof w=="boolean"){const Y=w?"true":"false";return B===Y?E.INSTANCE:M.INSTANCE}return new m(A,B,U)}cmp(A){return A.type!==this.type?this.type-A.type:x(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 B=A?"true":"false";return this.value===B?E.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=o.create(this.key,this.value,this)),this.negated}}class u{constructor(A,B){this.key=A,this.valueKey=B,this.type=10,this.negated=null}static create(A,B){return new u(A,B)}cmp(A){return A.type!==this.type?this.type-A.type:x(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 B=A.getValue(this.valueKey),U=A.getValue(this.key);return Array.isArray(B)?B.indexOf(U)>=0:typeof U=="string"&&typeof B=="object"&&B!==null?L.call(B,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(A){this._actual=A,this.type=11}static create(A){return new a(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 o{constructor(A,B,U){this.key=A,this.value=B,this.negated=U,this.type=5}static create(A,B,U=null){if(typeof B=="boolean")return B?c.create(A,U):p.create(A,U);const w=P.get(A);if(typeof w=="boolean"){const Y=w?"true":"false";return B===Y?M.INSTANCE:E.INSTANCE}return new o(A,B,U)}cmp(A){return A.type!==this.type?this.type-A.type:x(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 B=A?"true":"false";return this.value===B?M.INSTANCE:E.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,B){this.key=A,this.negated=B,this.type=3}static create(A,B=null){const U=P.get(A);return typeof U=="boolean"?U?M.INSTANCE:E.INSTANCE:new c(A,B)}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:E.INSTANCE:this}evaluate(A){return!A.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function s(A,B){if(typeof A=="string"){const U=parseFloat(A);isNaN(U)||(A=U)}return typeof A=="string"||typeof A=="number"?B(A):M.INSTANCE}class i{constructor(A,B,U){this.key=A,this.value=B,this.negated=U,this.type=12}static create(A,B,U=null){return s(B,w=>new i(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:x(this.key,this.value,A.key,A.value)}equals(A){return A.type===this.type?this.key===A.key&&this.value===A.value:!1}substituteConstants(){return this}evaluate(A){return typeof this.value=="string"?!1:parseFloat(A.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=S.create(this.key,this.value,this)),this.negated}}class n{constructor(A,B,U){this.key=A,this.value=B,this.negated=U,this.type=13}static create(A,B,U=null){return s(B,w=>new n(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:x(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,B,U){this.key=A,this.value=B,this.negated=U,this.type=14}static create(A,B,U=null){return s(B,w=>new O(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:x(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 S{constructor(A,B,U){this.key=A,this.value=B,this.negated=U,this.type=15}static create(A,B,U=null){return s(B,w=>new S(A,w,U))}cmp(A){return A.type!==this.type?this.type-A.type:x(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,B){this.key=A,this.regexp=B,this.type=7,this.negated=null}static create(A,B){return new C(A,B)}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 B=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return B<U?-1:B>U?1:0}equals(A){if(A.type===this.type){const B=this.regexp?this.regexp.source:"",U=A.regexp?A.regexp.source:"";return this.key===A.key&&B===U}return!1}substituteConstants(){return this}evaluate(A){let B=A.getValue(this.key);return this.regexp?this.regexp.test(B):!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 T(A){let B=null;for(let U=0,w=A.length;U<w;U++){const Y=A[U].substituteConstants();if(A[U]!==Y&&B===null){B=[];for(let q=0;q<U;q++)B[q]=A[q]}B!==null&&(B[U]=Y)}return B===null?A:B}class v{constructor(A,B){this.expr=A,this.negated=B,this.type=6}static create(A,B){return v._normalizeArr(A,B)}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 B=0,U=this.expr.length;B<U;B++){const w=r(this.expr[B],A.expr[B]);if(w!==0)return w}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let B=0,U=this.expr.length;B<U;B++)if(!this.expr[B].equals(A.expr[B]))return!1;return!0}return!1}substituteConstants(){const A=T(this.expr);return A===this.expr?this:v.create(A,this.negated)}evaluate(A){for(let B=0,U=this.expr.length;B<U;B++)if(!this.expr[B].evaluate(A))return!1;return!0}static _normalizeArr(A,B){const U=[];let w=!1;for(const Y of A){if(!Y)continue;if(Y.type===1){w=!0;continue}if(Y.type===0)return M.INSTANCE;if(Y.type===6){U.push(...Y.expr);continue}U.push(Y)}if(U.length===0&&w)return E.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(r);for(let Y=1;Y<U.length;Y++)U[Y-1].equals(U[Y])&&(U.splice(Y,1),Y--);if(U.length===1)return U[0];for(;U.length>1;){const Y=U[U.length-1];if(Y.type!==9)break;U.pop();const q=U.pop(),ce=U.length===0,Ee=b.create(Y.expr.map(Qe=>v.create([Qe,q],null)),null,ce);Ee&&(U.push(Ee),U.sort(r))}return U.length===1?U[0]:new v(U,B)}serialize(){return this.expr.map(A=>A.serialize()).join(" && ")}keys(){const A=[];for(let B of this.expr)A.push(...B.keys());return A}negate(){if(!this.negated){const A=[];for(let B of this.expr)A.push(B.negate());this.negated=b.create(A,this,!0)}return this.negated}}class b{constructor(A,B){this.expr=A,this.negated=B,this.type=9}static create(A,B,U){return b._normalizeArr(A,B,U)}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 B=0,U=this.expr.length;B<U;B++){const w=r(this.expr[B],A.expr[B]);if(w!==0)return w}return 0}equals(A){if(A.type===this.type){if(this.expr.length!==A.expr.length)return!1;for(let B=0,U=this.expr.length;B<U;B++)if(!this.expr[B].equals(A.expr[B]))return!1;return!0}return!1}substituteConstants(){const A=T(this.expr);return A===this.expr?this:b.create(A,this.negated,!1)}evaluate(A){for(let B=0,U=this.expr.length;B<U;B++)if(this.expr[B].evaluate(A))return!0;return!1}static _normalizeArr(A,B,U){let w=[],Y=!1;if(A){for(let q=0,ce=A.length;q<ce;q++){const Ee=A[q];if(!Ee)continue;if(Ee.type===0){Y=!0;continue}if(Ee.type===1)return E.INSTANCE;if(Ee.type===9){w=w.concat(Ee.expr);continue}w.push(Ee)}if(w.length===0&&Y)return M.INSTANCE;w.sort(r)}if(w.length===0)return;if(w.length===1)return w[0];for(let q=1;q<w.length;q++)w[q-1].equals(w[q])&&(w.splice(q,1),q--);if(w.length===1)return w[0];if(U){for(let q=0;q<w.length;q++)for(let ce=q+1;ce<w.length;ce++)N(w[q],w[ce])&&(w.splice(ce,1),ce--);if(w.length===1)return w[0]}return new b(w,B)}serialize(){return this.expr.map(A=>A.serialize()).join(" || ")}keys(){const A=[];for(let B of this.expr)A.push(...B.keys());return A}negate(){if(!this.negated){let A=[];for(let B of this.expr)A.push(B.negate());for(;A.length>1;){const B=A.shift(),U=A.shift(),w=[];for(const q of F(B))for(const ce of F(U))w.push(v.create([q,ce],null));const Y=A.length===0;A.unshift(b.create(w,null,Y))}this.negated=A[0]}return this.negated}}class f extends p{constructor(A,B,U){super(A,null);this._defaultValue=B,typeof U=="object"?f._info.push(Object.assign(Object.assign({},U),{key:A})):U!==!0&&f._info.push({key:A,description:U,type:B!=null?typeof B:void 0})}static all(){return f._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)}}f._info=[];const h=Object(I.c)("contextKeyService"),_="setContext";function g(A,B){return A<B?-1:A>B?1:0}function x(A,B,U,w){return A<U?-1:A>U?1:B<w?-1:B>w?1:0}function N(A,B){if(B.type===6&&A.type!==9&&A.type!==6){for(const Y of B.expr)if(A.equals(Y))return!0}const U=A.negate(),w=F(U).concat(F(B));w.sort(r);for(let Y=0;Y<w.length;Y++){const q=w[Y],ce=q.negate();for(let Ee=Y+1;Ee<w.length;Ee++){const Qe=w[Ee];if(ce.equals(Qe))return!0}}return!1}function F(A){return A.type===9?A.expr:[A]}},TXwP:function(jt,_e,D){var Z,V;(function(){var I;(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 u=this.__items.length-1;u>=0;u--)if(this.__items[u].match(m))return!0;return!1},M.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||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 u=m.lastIndexOf(`
`);u!==-1?this.__character_count=m.length-u: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 E(m,u){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)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}E.prototype.get_indent_size=function(m,u){var a=this.__base_string_length;return u=u||0,m<0&&(a=0),a+=m*this.__indent_size,a+=u,a},E.prototype.get_indent_string=function(m,u){var a=this.__base_string;return u=u||0,m<0&&(m=0,a=""),u+=m*this.__indent_size,this.__ensure_cache(u),a+=this.__cache[u],a},E.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var m=this.__cache.length,u=0,a="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,a=new Array(u+1).join(this.__indent_string)),m&&(a+=new Array(m+1).join(" ")),this.__cache.push(a)};function p(m,u){this.__indent_cache=new E(m,u),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()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===`
`&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return m!==`
`&&(a=a.replace(/[\n]/g,m)),a},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u<m.newlines;u++)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},p.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()},p.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(" "))},p.prototype.remove_indent=function(m){for(var u=this.__lines.length;m<u;)this.__lines[m]._remove_indent(),m++;this.current_line._remove_wrap_indent()},p.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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,u){for(var a=this.__lines.length-2;a>=0;){var o=this.__lines[a];if(o.is_empty())break;if(o.item(0).indexOf(m)!==0&&o.item(-1)!==u){this.__lines.splice(a+1,0,new M(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},r.exports.Output=p},,,,function(r){function M(m,u){this.raw_options=E(m,u),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}M.prototype._get_array=function(m,u){var a=this.raw_options[m],o=u||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(o=a.concat()):typeof a=="string"&&(o=a.split(/[^a-zA-Z0-9_\/\-]+/)),o},M.prototype._get_boolean=function(m,u){var a=this.raw_options[m],o=a===void 0?!!u:!!a;return o},M.prototype._get_characters=function(m,u){var a=this.raw_options[m],o=u||"";return typeof a=="string"&&(o=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),o},M.prototype._get_number=function(m,u){var a=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var o=parseInt(a,10);return isNaN(o)&&(o=u),o},M.prototype._get_selection=function(m,u,a){var o=this._get_selection_list(m,u,a);if(o.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o[0]},M.prototype._get_selection_list=function(m,u,a){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[u[0]],!this._is_valid_selection(a,u))throw new Error("Invalid Default Value!");var o=this._get_array(m,a);if(!this._is_valid_selection(o,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values:
`+u+`
You passed in: '`+this.raw_options[m]+"'");return o},M.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(a){return u.indexOf(a)===-1})};function E(m,u){var a={};m=p(m);var o;for(o in m)o!==u&&(a[o]=m[o]);if(u&&m[u])for(o in m[u])a[o]=m[u][o];return a}function p(m){var u={},a;for(a in m){var o=a.replace(/-/g,"_");u[o]=m[a]}return u}r.exports.Options=M,r.exports.normalizeOpts=p,r.exports.mergeOpts=E},,function(r){var M=RegExp.prototype.hasOwnProperty("sticky");function E(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},E.prototype.peek=function(p){var m=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(m=this.__input.charAt(p)),m},E.prototype.__match=function(p,m){p.lastIndex=m;var u=p.exec(this.__input);return u&&!(M&&p.sticky)&&(u.index!==m&&(u=null)),u},E.prototype.test=function(p,m){return m=m||0,m+=this.__position,m>=0&&m<this.__input_length?!!this.__match(p,m):!1},E.prototype.testChar=function(p,m){var u=this.peek(m);return p.lastIndex=0,u!==null&&p.test(u)},E.prototype.match=function(p){var m=this.__match(p,this.__position);return m?this.__position+=m[0].length:m=null,m},E.prototype.read=function(p,m,u){var a="",o;return p&&(o=this.match(p),o&&(a+=o[0])),m&&(o||!p)&&(a+=this.readUntil(m,u)),a},E.prototype.readUntil=function(p,m){var u="",a=this.__position;p.lastIndex=this.__position;var o=p.exec(this.__input);return o?(a=o.index,m&&(a+=o[0].length)):a=this.__input_length,u=this.__input.substring(this.__position,a),this.__position=a,u},E.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},E.prototype.get_regexp=function(p,m){var u=null,a="g";return m&&M&&(a="y"),typeof p=="string"&&p!==""?u=new RegExp(p,a):p&&(u=new RegExp(p.source,a)),u},E.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(p){var m=this.__position,u=this.readUntilAfter(p);return this.__position=m,u},E.prototype.lookBack=function(p){var m=this.__position-1;return m>=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},r.exports.InputScanner=E},,,,,function(r){function M(E,p){E=typeof E=="string"?E:E.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+p,"g")}M.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(E);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(E);return p},M.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=M},,function(r,M,E){var p=E(16).Beautifier,m=E(17).Options;function u(a,o){var c=new p(a,o);return c.beautify()}r.exports=u,r.exports.defaultOptions=function(){return new m}},function(r,M,E){var p=E(17).Options,m=E(2).Output,u=E(8).InputScanner,a=E(13).Directives,o=new a(/\/\*/,/\*\//),c=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=/\s/,n=/(?:\s|\n)+/g,O=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function C(R,T){this._source_text=R||"",this._options=new p(T),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 T="";for(this._ch=this._input.next();this._ch;){if(T+=this._ch,this._ch==="\\")T+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return T},C.prototype.eatWhitespace=function(R){for(var T=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 T},C.prototype.foundNestedPseudoClass=function(){for(var R=0,T=1,v=this._input.peek(T);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;T++,v=this._input.peek(T)}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,T=this._options.eol;T==="auto"&&(T=`
`,R&&c.test(R||"")&&(T=R.match(c)[0])),R=R.replace(s,`
`);var v=R.match(/^[\t ]*/)[0];this._output=new m(this._options,v),this._input=new u(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,f=!1,h=!1,_=!1,g=!1,x=!1,N=!1,F=this._ch,A=!1,B,U,w;B=this._input.read(n),U=B!=="",w=F,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),F=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=o.get_directives(Y);q&&q.ignore==="start"&&(Y+=o.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(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ce=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ce.match(/[ :]$/)&&(ce=this.eatString(": ").replace(/\s$/,""),this.print_string(ce),this._output.space_before_token=!0),ce=ce.replace(/\s$/,""),ce==="extend"?g=!0:ce==="import"&&(x=!0),ce in this.NESTED_AT_RULE?(this._nestedLevel+=1,ce in this.CONDITIONAL_GROUP_RULE&&(_=!0)):!f&&b===0&&ce.indexOf(":")!==-1&&(h=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")h&&(h=!1,this.outdent()),_?(_=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&(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)):(w==="("?this._output.space_before_token=!1:w!==","&&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(),w==="{"&&this._output.trim(!0),x=!1,g=!1,h&&(this.outdent(),h=!1),this.print_string(this._ch),f=!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 Ee=0;Ee<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;Ee++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[Ee])){A=!0;break}(f||_)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&b===0?(this.print_string(":"),h||(h=!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 Qe=w==='"'||w==="'";this.preserveSingleSpace(Qe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,b===0?(h&&(this.outdent(),h=!1),g=!1,x=!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(),b++,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(")")),b&&(b--,this.outdent()));else{var Te=!1;this._input.lookBack("with")&&(Te=!0),this.preserveSingleSpace(U||Te),this.print_string(this._ch),h&&w==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),N=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),N&&this._input.peek()===";"&&this._options.selector_separator_newline&&(N=!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&&(!h||N)&&b===0&&!x&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!h&&b===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&i.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),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 We=w==='"'||w==="'";this.preserveSingleSpace(We||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var $e=this._output.get_code(T);return $e},r.exports.Beautifier=C},function(r,M,E){var p=E(6).Options;function m(u){p.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var c=0;c<o.length;c++)o[c]!=="expand"?this.brace_style="collapse":this.brace_style=o[c]}m.prototype=new p,r.exports.Options=m}],L={};function W(r){var M=L[r];if(M!==void 0)return M.exports;var E=L[r]={exports:{}};return P[r](E,E.exports,W),E.exports}var k=W(15);I=k})();var G=I;!(Z=[],V=function(){return{css_beautify:G}}.apply(_e,Z),V!==void 0&&(jt.exports=V))})()},Vhoy:function(jt,_e,D){"use strict";D.d(_e,"d",function(){return G}),D.d(_e,"e",function(){return P}),D.d(_e,"c",function(){return L}),D.d(_e,"b",function(){return W}),D.d(_e,"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 I=new V,G=I;function P(r,M){return new W(r,M)}function L(r){return r?r.replace(/\$\((.*?)\)/g,(M,E)=>` ${E} `).trim():""}class W{constructor(r,M,E){this.id=r,this.definition=M,this.description=E,I.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 E(u){if(u instanceof W)return["codicon","codicon-"+u.id];const a=M.exec(u.id);if(!a)return E(W.error);let[,o,c]=a;const s=["codicon","codicon-"+o];return c&&s.push("codicon-modifier-"+c.substr(1)),s}r.asClassNameArray=E;function p(u){return E(u).join(" ")}r.asClassName=p;function m(u){return"."+E(u).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"})}(W||(W={}))},"VrN/":function(jt,_e,D){(function(Z,V){jt.exports=V()})(this,function(){"use strict";var Z=navigator.userAgent,V=navigator.platform,I=/gecko\/\d/i.test(Z),G=/MSIE \d/.test(Z),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Z),L=/Edge\/(\d+)/.exec(Z),W=G||P||L,k=W&&(G?document.documentMode||6:+(L||P)[1]),r=!L&&/WebKit\//.test(Z),M=r&&/Qt\/\d+\.\d+/.test(Z),E=!L&&/Chrome\//.test(Z),p=/Opera\//.test(Z),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Z),a=/PhantomJS/.test(Z),o=!L&&/AppleWebKit/.test(Z)&&/Mobile\/\w+/.test(Z),c=/Android/.test(Z),s=o||c||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Z),i=o||/Mac/.test(V),n=/\bCrOS\b/.test(Z),O=/win/i.test(V),S=p&&Z.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(p=!1,r=!0);var C=i&&(M||p&&(S==null||S<12.11)),R=I||W&&k>=9;function T(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var v=function(e,t){var d=e.className,l=T(t).exec(d);if(l){var y=d.slice(l.index+l[0].length);e.className=d.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function f(e,t){return b(e).appendChild(t)}function h(e,t,d,l){var y=document.createElement(e);if(d&&(y.className=d),l&&(y.style.cssText=l),typeof t=="string")y.appendChild(document.createTextNode(t));else if(t)for(var H=0;H<t.length;++H)y.appendChild(t[H]);return y}function _(e,t,d,l){var y=h(e,t,d,l);return y.setAttribute("role","presentation"),y}var g;document.createRange?g=function(e,t,d,l){var y=document.createRange();return y.setEnd(l||e,d),y.setStart(e,t),y}:g=function(e,t,d){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",d),l.moveStart("character",t),l};function x(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 N(){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 F(e,t){var d=e.className;T(t).test(d)||(e.className+=(d?" ":"")+t)}function A(e,t){for(var d=e.split(" "),l=0;l<d.length;l++)d[l]&&!T(d[l]).test(t)&&(t+=" "+d[l]);return t}var B=function(e){e.select()};o?B=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:W&&(B=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function w(e,t,d){t||(t={});for(var l in e)e.hasOwnProperty(l)&&(d!==!1||!t.hasOwnProperty(l))&&(t[l]=e[l]);return t}function Y(e,t,d,l,y){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var H=l||0,$=y||0;;){var te=e.indexOf(" ",H);if(te<0||te>=t)return $+(t-H);$+=te-H,$+=d-$%d,H=te+1}}var q=function(){this.id=null,this.f=null,this.time=0,this.handler=U(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 ce(e,t){for(var d=0;d<e.length;++d)if(e[d]==t)return d;return-1}var Ee=50,Qe={toString:function(){return"CodeMirror.Pass"}},Te={scroll:!1},We={origin:"*mouse"},$e={origin:"+move"};function Je(e,t,d){for(var l=0,y=0;;){var H=e.indexOf(" ",l);H==-1&&(H=e.length);var $=H-l;if(H==e.length||y+$>=t)return l+Math.min($,t-y);if(y+=H-l,y+=d-y%d,l=H+1,y>=t)return l}}var Ce=[""];function X(e){for(;Ce.length<=e;)Ce.push(j(Ce)+" ");return Ce[e]}function j(e){return e[e.length-1]}function K(e,t){for(var d=[],l=0;l<e.length;l++)d[l]=t(e[l],l);return d}function Q(e,t,d){for(var l=0,y=d(t);l<e.length&&d(e[l])<=y;)l++;e.splice(l,0,t)}function re(){}function z(e,t){var d;return Object.create?d=Object.create(e):(re.prototype=e,d=new re),t&&w(t,d),d}var we=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ue(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||we.test(e))}function rt(e,t){return t?t.source.indexOf("\\w")>-1&&Ue(e)?!0:t.test(e):Ue(e)}function le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Oe=/[\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 Fe(e){return e.charCodeAt(0)>=768&&Oe.test(e)}function Ye(e,t,d){for(;(d<0?t>0:t<e.length)&&Fe(e.charAt(t));)t+=d;return t}function Tt(e,t,d){for(var l=t>d?-1:1;;){if(t==d)return t;var y=(t+d)/2,H=l<0?Math.ceil(y):Math.floor(y);if(H==t)return e(H)?t:d;e(H)?d=H:t=H+l}}function Nt(e,t,d,l){if(!e)return l(t,d,"ltr",0);for(var y=!1,H=0;H<e.length;++H){var $=e[H];($.from<d&&$.to>t||t==d&&$.to==t)&&(l(Math.max($.from,t),Math.min($.to,d),$.level==1?"rtl":"ltr",H),y=!0)}y||l(t,d,"ltr")}var Xt=null;function tt(e,t,d){var l;Xt=null;for(var y=0;y<e.length;++y){var H=e[y];if(H.from<t&&H.to>t)return y;H.to==t&&(H.from!=H.to&&d=="before"?l=y:Xt=y),H.from==t&&(H.from!=H.to&&d!="before"?l=y:Xt=y)}return l!=null?l:Xt}var Zt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(he){return he<=247?e.charAt(he):1424<=he&&he<=1524?"R":1536<=he&&he<=1785?t.charAt(he-1536):1774<=he&&he<=2220?"r":8192<=he&&he<=8203?"w":he==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,H=/[LRr]/,$=/[Lb1n]/,te=/[1n]/;function oe(he,Ie,Ke){this.level=he,this.from=Ie,this.to=Ke}return function(he,Ie){var Ke=Ie=="ltr"?"L":"R";if(he.length==0||Ie=="ltr"&&!l.test(he))return!1;for(var _t=he.length,ft=[],Jt=0;Jt<_t;++Jt)ft.push(d(he.charCodeAt(Jt)));for(var _n=0,Mn=Ke;_n<_t;++_n){var jn=ft[_n];jn=="m"?ft[_n]=Mn:Mn=jn}for(var Gn=0,Fn=Ke;Gn<_t;++Gn){var $n=ft[Gn];$n=="1"&&Fn=="r"?ft[Gn]="n":H.test($n)&&(Fn=$n,$n=="r"&&(ft[Gn]="R"))}for(var mr=1,cr=ft[0];mr<_t-1;++mr){var Ar=ft[mr];Ar=="+"&&cr=="1"&&ft[mr+1]=="1"?ft[mr]="1":Ar==","&&cr==ft[mr+1]&&(cr=="1"||cr=="n")&&(ft[mr]=cr),cr=Ar}for(var ni=0;ni<_t;++ni){var ji=ft[ni];if(ji==",")ft[ni]="N";else if(ji=="%"){var vi=void 0;for(vi=ni+1;vi<_t&&ft[vi]=="%";++vi);for(var aa=ni&&ft[ni-1]=="!"||vi<_t&&ft[vi]=="1"?"1":"N",ta=ni;ta<vi;++ta)ft[ta]=aa;ni=vi-1}}for(var Li=0,na=Ke;Li<_t;++Li){var Gi=ft[Li];na=="L"&&Gi=="1"?ft[Li]="L":H.test(Gi)&&(na=Gi)}for(var ki=0;ki<_t;++ki)if(y.test(ft[ki])){var Pi=void 0;for(Pi=ki+1;Pi<_t&&y.test(ft[Pi]);++Pi);for(var Ei=(ki?ft[ki-1]:Ke)=="L",ra=(Pi<_t?ft[Pi]:Ke)=="L",So=Ei==ra?Ei?"L":"R":Ke,to=ki;to<Pi;++to)ft[to]=So;ki=Pi-1}for(var Vi=[],Pa,Fi=0;Fi<_t;)if($.test(ft[Fi])){var ms=Fi;for(++Fi;Fi<_t&&$.test(ft[Fi]);++Fi);Vi.push(new oe(0,ms,Fi))}else{var Ga=Fi,lo=Vi.length,uo=Ie=="rtl"?1:0;for(++Fi;Fi<_t&&ft[Fi]!="L";++Fi);for(var Xi=Ga;Xi<Fi;)if(te.test(ft[Xi])){Ga<Xi&&(Vi.splice(lo,0,new oe(1,Ga,Xi)),lo+=uo);var Oo=Xi;for(++Xi;Xi<Fi&&te.test(ft[Xi]);++Xi);Vi.splice(lo,0,new oe(2,Oo,Xi)),lo+=uo,Ga=Xi}else++Xi;Ga<Fi&&Vi.splice(lo,0,new oe(1,Ga,Fi))}return Ie=="ltr"&&(Vi[0].level==1&&(Pa=he.match(/^\s+/))&&(Vi[0].from=Pa[0].length,Vi.unshift(new oe(0,0,Pa[0].length))),j(Vi).level==1&&(Pa=he.match(/\s+$/))&&(j(Vi).to-=Pa[0].length,Vi.push(new oe(0,_t-Pa[0].length,_t)))),Ie=="rtl"?Vi.reverse():Vi}}();function vn(e,t){var d=e.order;return d==null&&(d=e.order=Zt(e.text,t)),d}var ze=[],He=function(e,t,d){if(e.addEventListener)e.addEventListener(t,d,!1);else if(e.attachEvent)e.attachEvent("on"+t,d);else{var l=e._handlers||(e._handlers={});l[t]=(l[t]||ze).concat(d)}};function vt(e,t){return e._handlers&&e._handlers[t]||ze}function Rt(e,t,d){if(e.removeEventListener)e.removeEventListener(t,d,!1);else if(e.detachEvent)e.detachEvent("on"+t,d);else{var l=e._handlers,y=l&&l[t];if(y){var H=ce(y,d);H>-1&&(l[t]=y.slice(0,H).concat(y.slice(H+1)))}}}function de(e,t){var d=vt(e,t);if(!d.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<d.length;++y)d[y].apply(null,l)}function ee(e,t,d){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),de(e,d||t.type,e,t),me(t)||t.codemirrorIgnore}function ne(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var d=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<t.length;++l)ce(d,t[l])==-1&&d.push(t[l])}function se(e,t){return vt(e,t).length>0}function pe(e){e.prototype.on=function(t,d){He(this,t,d)},e.prototype.off=function(t,d){Rt(this,t,d)}}function ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function me(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ye(e){ae(e),ie(e)}function xe(e){return e.target||e.srcElement}function De(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 ct=function(){if(W&&k<9)return!1;var e=h("div");return"draggable"in e||"dragDrop"in e}(),It;function un(e){if(It==null){var t=h("span","\u200B");f(e,h("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(It=t.offsetWidth<=1&&t.offsetHeight>2&&!(W&&k<8))}var d=It?h("span","\u200B"):h("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var mt;function Qt(e){if(mt!=null)return mt;var t=f(e,document.createTextNode("A\u062EA")),d=g(t,0,1).getBoundingClientRect(),l=g(t,1,2).getBoundingClientRect();return b(e),!d||d.left==d.right?!1:mt=l.right-d.right<3}var ht=`
b`.split(/\n/).length!=3?function(e){for(var t=0,d=[],l=e.length;t<=l;){var y=e.indexOf(`
`,t);y==-1&&(y=e.length);var H=e.slice(t,e.charAt(y-1)=="\r"?y-1:y),$=H.indexOf("\r");$!=-1?(d.push(H.slice(0,$)),t+=$+1):(d.push(H),t=y+1)}return d}:function(e){return e.split(/\r\n?|\n/)},Et=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},it=function(){var e=h("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ve=null;function Me(e){if(ve!=null)return ve;var t=f(e,h("span","x")),d=t.getBoundingClientRect(),l=g(t,0,1).getBoundingClientRect();return ve=Math.abs(d.left-l.left)>1}var St={},lt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),St[e]=t}function qt(e,t){lt[e]=t}function Ve(e){if(typeof e=="string"&&lt.hasOwnProperty(e))e=lt[e];else if(e&&typeof e.name=="string"&&lt.hasOwnProperty(e.name)){var t=lt[e.name];typeof t=="string"&&(t={name:t}),e=z(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function et(e,t){t=Ve(t);var d=St[t.name];if(!d)return et(e,"text/plain");var l=d(e,t);if(gt.hasOwnProperty(t.name)){var y=gt[t.name];for(var H in y){if(!y.hasOwnProperty(H))continue;l.hasOwnProperty(H)&&(l["_"+H]=l[H]),l[H]=y[H]}}if(l.name=t.name,t.helperType&&(l.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)l[$]=t.modeProps[$];return l}var gt={};function Ht(e,t){var d=gt.hasOwnProperty(e)?gt[e]:gt[e]={};w(t,d)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var d={};for(var l in t){var y=t[l];y instanceof Array&&(y=y.concat([])),d[l]=y}return d}function dn(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 Zn(e,t,d){return e.startState?e.startState(t,d):!0}var Wn=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};Wn.prototype.eol=function(){return this.pos>=this.string.length},Wn.prototype.sol=function(){return this.pos==this.lineStart},Wn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Wn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Wn.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},Wn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Wn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Wn.prototype.skipToEnd=function(){this.pos=this.string.length},Wn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Wn.prototype.backUp=function(e){this.pos-=e},Wn.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)},Wn.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Wn.prototype.match=function(e,t,d){if(typeof e=="string"){var l=function($){return d?$.toLowerCase():$},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return t!==!1&&(this.pos+=e.length),!0}else{var H=this.string.slice(this.pos).match(e);return H&&H.index>0?null:(H&&t!==!1&&(this.pos+=H[0].length),H)}},Wn.prototype.current=function(){return this.string.slice(this.start,this.pos)},Wn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Wn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Wn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function tn(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 l=0;;++l){var y=d.children[l],H=y.chunkSize();if(t<H){d=y;break}t-=H}return d.lines[t]}function Hn(e,t,d){var l=[],y=t.line;return e.iter(t.line,d.line+1,function(H){var $=H.text;y==d.line&&($=$.slice(0,d.ch)),y==t.line&&($=$.slice(t.ch)),l.push($),++y}),l}function ir(e,t,d){var l=[];return e.iter(t,d,function(y){l.push(y.text)}),l}function Dn(e,t){var d=t-e.height;if(d)for(var l=e;l;l=l.parent)l.height+=d}function Vn(e){if(e.parent==null)return null;for(var t=e.parent,d=ce(t.lines,e),l=t.parent;l;t=l,l=l.parent)for(var y=0;!(l.children[y]==t);++y)d+=l.children[y].chunkSize();return d+t.first}function qn(e,t){var d=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],H=y.height;if(t<H){e=y;continue e}t-=H,d+=y.chunkSize()}return d}while(!e.lines);for(var $=0;$<e.lines.length;++$){var te=e.lines[$],oe=te.height;if(t<oe)break;t-=oe}return d+$}function Mr(e,t){return t>=e.first&&t<e.first+e.size}function Sr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function on(e,t,d){if(d===void 0&&(d=null),!(this instanceof on))return new on(e,t,d);this.line=e,this.ch=t,this.sticky=d}function Jn(e,t){return e.line-t.line||e.ch-t.ch}function oi(e,t){return e.sticky==t.sticky&&Jn(e,t)==0}function xi(e){return on(e.line,e.ch)}function Jr(e,t){return Jn(e,t)<0?t:e}function Yr(e,t){return Jn(e,t)<0?e:t}function Lr(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Yn(e,t){if(t.line<e.first)return on(e.first,0);var d=e.first+e.size-1;return t.line>d?on(d,tn(e,d).text.length):mi(t,tn(e,t.line).text.length)}function mi(e,t){var d=e.ch;return d==null||d>t?on(e.line,t):d<0?on(e.line,0):e}function hn(e,t){for(var d=[],l=0;l<t.length;l++)d[l]=Yn(e,t[l]);return d}var ei=function(e,t){this.state=e,this.lookAhead=t},zr=function(e,t,d,l){this.state=t,this.doc=e,this.line=d,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};zr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},zr.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}},zr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},zr.fromSaved=function(e,t,d){return t instanceof ei?new zr(e,Vt(e.mode,t.state),d,t.lookAhead):new zr(e,Vt(e.mode,t),d)},zr.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ei(t,this.maxLookAhead):t};function wi(e,t,d,l){var y=[e.state.modeGen],H={};di(e,t.text,e.doc.mode,d,function(he,Ie){return y.push(he,Ie)},H,l);for(var $=d.state,te=function(he){d.baseTokens=y;var Ie=e.state.overlays[he],Ke=1,_t=0;d.state=!0,di(e,t.text,Ie.mode,d,function(ft,Jt){for(var _n=Ke;_t<ft;){var Mn=y[Ke];Mn>ft&&y.splice(Ke,1,ft,y[Ke+1],Mn),Ke+=2,_t=Math.min(ft,Mn)}if(!Jt)return;if(Ie.opaque)y.splice(_n,Ke-_n,ft,"overlay "+Jt),Ke=_n+2;else for(;_n<Ke;_n+=2){var jn=y[_n+1];y[_n+1]=(jn?jn+" ":"")+"overlay "+Jt}},H),d.state=$,d.baseTokens=null,d.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)te(oe);return{styles:y,classes:H.bgClass||H.textClass?H:null}}function gi(e,t,d){if(!t.styles||t.styles[0]!=e.state.modeGen){var l=ri(e,Vn(t)),y=t.text.length>e.options.maxHighlightLength&&Vt(e.doc.mode,l.state),H=wi(e,t,l);y&&(l.state=y),t.stateAfter=l.save(!y),t.styles=H.styles,H.classes?t.styleClasses=H.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 ri(e,t,d){var l=e.doc,y=e.display;if(!l.mode.startState)return new zr(l,!0,t);var H=_i(e,t,d),$=H>l.first&&tn(l,H-1).stateAfter,te=$?zr.fromSaved(l,$,H):new zr(l,Zn(l.mode),H);return l.iter(H,t,function(oe){Bi(e,oe.text,te);var he=te.line;oe.stateAfter=he==t-1||he%5==0||he>=y.viewFrom&&he<y.viewTo?te.save():null,te.nextLine()}),d&&(l.modeFrontier=te.line),te}function Bi(e,t,d,l){var y=e.doc.mode,H=new Wn(t,e.options.tabSize,d);for(H.start=H.pos=l||0,t==""&&Hi(y,d.state);!H.eol();)ii(y,H,d.state),H.start=H.pos}function Hi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var d=dn(e,t);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function ii(e,t,d,l){for(var y=0;y<10;y++){l&&(l[0]=dn(e,d).mode);var H=e.token(t,d);if(t.pos>t.start)return H}throw new Error("Mode "+e.name+" failed to advance stream.")}var wr=function(e,t,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=d};function Oi(e,t,d,l){var y=e.doc,H=y.mode,$;t=Yn(y,t);var te=tn(y,t.line),oe=ri(e,t.line,d),he=new Wn(te.text,e.options.tabSize,oe),Ie;for(l&&(Ie=[]);(l||he.pos<t.ch)&&!he.eol();)he.start=he.pos,$=ii(H,he,oe.state),l&&Ie.push(new wr(he,$,Vt(y.mode,oe.state)));return l?Ie:new wr(he,$,oe.state)}function Ri(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 l=d[1]?"bgClass":"textClass";t[l]==null?t[l]=d[2]:new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)").test(t[l])||(t[l]+=" "+d[2])}return e}function di(e,t,d,l,y,H,$){var te=d.flattenSpans;te==null&&(te=e.options.flattenSpans);var oe=0,he=null,Ie=new Wn(t,e.options.tabSize,l),Ke,_t=e.options.addModeClass&&[null];for(t==""&&Ri(Hi(d,l.state),H);!Ie.eol();){if(Ie.pos>e.options.maxHighlightLength?(te=!1,$&&Bi(e,t,l,Ie.pos),Ie.pos=t.length,Ke=null):Ke=Ri(ii(d,Ie,l.state,_t),H),_t){var ft=_t[0].name;ft&&(Ke="m-"+(Ke?ft+" "+Ke:ft))}if(!te||he!=Ke){for(;oe<Ie.start;)oe=Math.min(Ie.start,oe+5e3),y(oe,he);he=Ke}Ie.start=Ie.pos}for(;oe<Ie.pos;){var Jt=Math.min(Ie.pos,oe+5e3);y(Jt,he),oe=Jt}}function _i(e,t,d){for(var l,y,H=e.doc,$=d?-1:t-(e.doc.mode.innerMode?1e3:100),te=t;te>$;--te){if(te<=H.first)return H.first;var oe=tn(H,te-1),he=oe.stateAfter;if(he&&(!d||te+(he instanceof ei?he.lookAhead:0)<=H.modeFrontier))return te;var Ie=Y(oe.text,null,e.options.tabSize);(y==null||l>Ie)&&(y=te-1,l=Ie)}return y}function oa(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var d=e.first,l=t-1;l>d;l--){var y=tn(e,l).stateAfter;if(y&&(!(y instanceof ei)||l+y.lookAhead<t)){d=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var $i=!1,yr=!1;function br(){$i=!0}function si(){yr=!0}function kr(e,t,d){this.marker=e,this.from=t,this.to=d}function kn(e,t){if(e)for(var d=0;d<e.length;++d){var l=e[d];if(l.marker==t)return l}}function fn(e,t){for(var d,l=0;l<e.length;++l)e[l]!=t&&(d||(d=[])).push(e[l]);return d}function Tn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function mn(e,t,d){var l;if(e)for(var y=0;y<e.length;++y){var H=e[y],$=H.marker,te=H.from==null||($.inclusiveLeft?H.from<=t:H.from<t);if(te||H.from==t&&$.type=="bookmark"&&(!d||!H.marker.insertLeft)){var oe=H.to==null||($.inclusiveRight?H.to>=t:H.to>t);(l||(l=[])).push(new kr($,H.from,oe?null:H.to))}}return l}function er(e,t,d){var l;if(e)for(var y=0;y<e.length;++y){var H=e[y],$=H.marker,te=H.to==null||($.inclusiveRight?H.to>=t:H.to>t);if(te||H.from==t&&$.type=="bookmark"&&(!d||H.marker.insertLeft)){var oe=H.from==null||($.inclusiveLeft?H.from<=t:H.from<t);(l||(l=[])).push(new kr($,oe?null:H.from-t,H.to==null?null:H.to-t))}}return l}function rr(e,t){if(t.full)return null;var d=Mr(e,t.from.line)&&tn(e,t.from.line).markedSpans,l=Mr(e,t.to.line)&&tn(e,t.to.line).markedSpans;if(!d&&!l)return null;var y=t.from.ch,H=t.to.ch,$=Jn(t.from,t.to)==0,te=mn(d,y,$),oe=er(l,H,$),he=t.text.length==1,Ie=j(t.text).length+(he?y:0);if(te)for(var Ke=0;Ke<te.length;++Ke){var _t=te[Ke];if(_t.to==null){var ft=kn(oe,_t.marker);ft?he&&(_t.to=ft.to==null?null:ft.to+Ie):_t.to=y}}if(oe)for(var Jt=0;Jt<oe.length;++Jt){var _n=oe[Jt];if(_n.to!=null&&(_n.to+=Ie),_n.from==null){var Mn=kn(te,_n.marker);Mn||(_n.from=Ie,he&&(te||(te=[])).push(_n))}else _n.from+=Ie,he&&(te||(te=[])).push(_n)}te&&(te=J(te)),oe&&oe!=te&&(oe=J(oe));var jn=[te];if(!he){var Gn=t.text.length-2,Fn;if(Gn>0&&te)for(var $n=0;$n<te.length;++$n)te[$n].to==null&&(Fn||(Fn=[])).push(new kr(te[$n].marker,null,null));for(var mr=0;mr<Gn;++mr)jn.push(Fn);jn.push(oe)}return jn}function J(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 ge(e,t,d){var l=null;if(e.iter(t.line,d.line+1,function(ft){if(ft.markedSpans)for(var Jt=0;Jt<ft.markedSpans.length;++Jt){var _n=ft.markedSpans[Jt].marker;_n.readOnly&&(!l||ce(l,_n)==-1)&&(l||(l=[])).push(_n)}}),!l)return null;for(var y=[{from:t,to:d}],H=0;H<l.length;++H)for(var $=l[H],te=$.find(0),oe=0;oe<y.length;++oe){var he=y[oe];if(Jn(he.to,te.from)<0||Jn(he.from,te.to)>0)continue;var Ie=[oe,1],Ke=Jn(he.from,te.from),_t=Jn(he.to,te.to);(Ke<0||!$.inclusiveLeft&&!Ke)&&Ie.push({from:he.from,to:te.from}),(_t>0||!$.inclusiveRight&&!_t)&&Ie.push({from:te.to,to:he.to}),y.splice.apply(y,Ie),oe+=Ie.length-3}return y}function Re(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 Ae(e,t){if(!t)return;for(var d=0;d<t.length;++d)t[d].marker.attachLine(e);e.markedSpans=t}function at(e){return e.inclusiveLeft?-1:0}function Be(e){return e.inclusiveRight?1:0}function nt(e,t){var d=e.lines.length-t.lines.length;if(d!=0)return d;var l=e.find(),y=t.find(),H=Jn(l.from,y.from)||at(e)-at(t);if(H)return-H;var $=Jn(l.to,y.to)||Be(e)-Be(t);return $||t.id-e.id}function yt(e,t){var d=yr&&e.markedSpans,l;if(d)for(var y=void 0,H=0;H<d.length;++H)y=d[H],y.marker.collapsed&&(t?y.from:y.to)==null&&(!l||nt(l,y.marker)<0)&&(l=y.marker);return l}function Mt(e){return yt(e,!0)}function kt(e){return yt(e,!1)}function Ge(e,t){var d=yr&&e.markedSpans,l;if(d)for(var y=0;y<d.length;++y){var H=d[y];H.marker.collapsed&&(H.from==null||H.from<t)&&(H.to==null||H.to>t)&&(!l||nt(l,H.marker)<0)&&(l=H.marker)}return l}function xt(e,t,d,l,y){var H=tn(e,t),$=yr&&H.markedSpans;if($)for(var te=0;te<$.length;++te){var oe=$[te];if(!oe.marker.collapsed)continue;var he=oe.marker.find(0),Ie=Jn(he.from,d)||at(oe.marker)-at(y),Ke=Jn(he.to,l)||Be(oe.marker)-Be(y);if(Ie>=0&&Ke<=0||Ie<=0&&Ke>=0)continue;if(Ie<=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?Jn(he.to,d)>=0:Jn(he.to,d)>0)||Ie>=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?Jn(he.from,l)<=0:Jn(he.from,l)<0))return!0}}function ot(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function ut(e){for(var t;t=kt(e);)e=t.find(1,!0).line;return e}function bt(e){for(var t,d;t=kt(e);)e=t.find(1,!0).line,(d||(d=[])).push(e);return d}function Dt(e,t){var d=tn(e,t),l=ot(d);return d==l?t:Vn(l)}function pt(e,t){if(t>e.lastLine())return t;var d=tn(e,t),l;if(!Kt(e,d))return t;for(;l=kt(d);)d=l.find(1,!0).line;return Vn(d)+1}function Kt(e,t){var d=yr&&t.markedSpans;if(d)for(var l=void 0,y=0;y<d.length;++y){if(l=d[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&nn(e,t,l))return!0}}function nn(e,t,d){if(d.to==null){var l=d.marker.find(1,!0);return nn(e,l.line,kn(l.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==t.text.length)return!0;for(var y=void 0,H=0;H<t.markedSpans.length;++H)if(y=t.markedSpans[H],y.marker.collapsed&&!y.marker.widgetNode&&y.from==d.to&&(y.to==null||y.to!=d.from)&&(y.marker.inclusiveLeft||d.marker.inclusiveRight)&&nn(e,t,y))return!0}function wn(e){e=ot(e);for(var t=0,d=e.parent,l=0;l<d.lines.length;++l){var y=d.lines[l];if(y==e)break;t+=y.height}for(var H=d.parent;H;d=H,H=d.parent)for(var $=0;$<H.children.length;++$){var te=H.children[$];if(te==d)break;t+=te.height}return t}function In(e){if(e.height==0)return 0;for(var t=e.text.length,d,l=e;d=Mt(l);){var y=d.find(0,!0);l=y.from.line,t+=y.from.ch-y.to.ch}for(l=e;d=kt(l);){var H=d.find(0,!0);t-=l.text.length-H.from.ch,l=H.to.line,t+=l.text.length-H.to.ch}return t}function yn(e){var t=e.display,d=e.doc;t.maxLine=tn(d,d.first),t.maxLineLength=In(t.maxLine),t.maxLineChanged=!0,d.iter(function(l){var y=In(l);y>t.maxLineLength&&(t.maxLineLength=y,t.maxLine=l)})}var On=function(e,t,d){this.text=e,Ae(this,t),this.height=d?d(this):1};On.prototype.lineNo=function(){return Vn(this)},pe(On);function Cn(e,t,d,l){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Re(e),Ae(e,d);var y=l?l(e):1;y!=e.height&&Dn(e,y)}function Ot(e){e.parent=null,Re(e)}var rn={},Ut={};function wt(e,t){if(!e||/^\s*$/.test(e))return null;var d=t.addModeClass?Ut:rn;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function Rn(e,t){var d=_("span",null,null,r?"padding-right: .1px":null),l={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 H=y?t.rest[y-1]:t.line,$=void 0;l.pos=0,l.addToken=Wt,Qt(e.display.measure)&&($=vn(H,e.doc.direction))&&(l.addToken=An(l.addToken,$)),l.map=[];var te=t!=e.display.externalMeasured&&Vn(H);Kn(H,l,gi(e,H,te)),H.styleClasses&&(H.styleClasses.bgClass&&(l.bgClass=A(H.styleClasses.bgClass,l.bgClass||"")),H.styleClasses.textClass&&(l.textClass=A(H.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(un(e.display.measure))),y==0?(t.measure.map=l.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(l.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(r){var oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return de(e,"renderLine",e,t.line,l.pre),l.pre.className&&(l.textClass=A(l.pre.className,l.textClass||"")),l}function bn(e){var t=h("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Wt(e,t,d,l,y,H,$){if(!t)return;var te=e.splitSpaces?dt(t,e.trailingSpace):t,oe=e.cm.state.specialChars,he=!1,Ie;if(!oe.test(t))e.col+=t.length,Ie=document.createTextNode(te),e.map.push(e.pos,e.pos+t.length,Ie),W&&k<9&&(he=!0),e.pos+=t.length;else{Ie=document.createDocumentFragment();for(var Ke=0;;){oe.lastIndex=Ke;var _t=oe.exec(t),ft=_t?_t.index-Ke:t.length-Ke;if(ft){var Jt=document.createTextNode(te.slice(Ke,Ke+ft));W&&k<9?Ie.appendChild(h("span",[Jt])):Ie.appendChild(Jt),e.map.push(e.pos,e.pos+ft,Jt),e.col+=ft,e.pos+=ft}if(!_t)break;Ke+=ft+1;var _n=void 0;if(_t[0]==" "){var Mn=e.cm.options.tabSize,jn=Mn-e.col%Mn;_n=Ie.appendChild(h("span",X(jn),"cm-tab")),_n.setAttribute("role","presentation"),_n.setAttribute("cm-text"," "),e.col+=jn}else _t[0]=="\r"||_t[0]==`
`?(_n=Ie.appendChild(h("span",_t[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_n.setAttribute("cm-text",_t[0]),e.col+=1):(_n=e.cm.options.specialCharPlaceholder(_t[0]),_n.setAttribute("cm-text",_t[0]),W&&k<9?Ie.appendChild(h("span",[_n])):Ie.appendChild(_n),e.col+=1);e.map.push(e.pos,e.pos+1,_n),e.pos++}}if(e.trailingSpace=te.charCodeAt(t.length-1)==32,d||l||y||he||H||$){var Gn=d||"";l&&(Gn+=l),y&&(Gn+=y);var Fn=h("span",[Ie],Gn,H);if($)for(var $n in $)$.hasOwnProperty($n)&&$n!="style"&&$n!="class"&&Fn.setAttribute($n,$[$n]);return e.content.appendChild(Fn)}e.content.appendChild(Ie)}function dt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var d=t,l="",y=0;y<e.length;y++){var H=e.charAt(y);H==" "&&d&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(H="\xA0"),l+=H,d=H==" "}return l}function An(e,t){return function(d,l,y,H,$,te,oe){y=y?y+" cm-force-border":"cm-force-border";for(var he=d.pos,Ie=he+l.length;;){for(var Ke=void 0,_t=0;_t<t.length&&!(Ke=t[_t],Ke.to>he&&Ke.from<=he);_t++);if(Ke.to>=Ie)return e(d,l,y,H,$,te,oe);e(d,l.slice(0,Ke.to-he),y,H,null,te,oe),H=null,l=l.slice(Ke.to-he),he=Ke.to}}}function an(e,t,d,l){var y=!l&&d.widgetNode;y&&e.map.push(e.pos,e.pos+t,y),!l&&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 Kn(e,t,d){var l=e.markedSpans,y=e.text,H=0;if(!l){for(var $=1;$<d.length;$+=2)t.addToken(t,y.slice(H,H=d[$]),wt(d[$+1],t.cm.options));return}for(var te=y.length,oe=0,he=1,Ie="",Ke,_t,ft=0,Jt,_n,Mn,jn,Gn;;){if(ft==oe){Jt=_n=Mn=_t="",Gn=null,jn=null,ft=Infinity;for(var Fn=[],$n=void 0,mr=0;mr<l.length;++mr){var cr=l[mr],Ar=cr.marker;if(Ar.type=="bookmark"&&cr.from==oe&&Ar.widgetNode)Fn.push(Ar);else if(cr.from<=oe&&(cr.to==null||cr.to>oe||Ar.collapsed&&cr.to==oe&&cr.from==oe)){if(cr.to!=null&&cr.to!=oe&&ft>cr.to&&(ft=cr.to,_n=""),Ar.className&&(Jt+=" "+Ar.className),Ar.css&&(_t=(_t?_t+";":"")+Ar.css),Ar.startStyle&&cr.from==oe&&(Mn+=" "+Ar.startStyle),Ar.endStyle&&cr.to==ft&&($n||($n=[])).push(Ar.endStyle,cr.to),Ar.title&&((Gn||(Gn={})).title=Ar.title),Ar.attributes)for(var ni in Ar.attributes)(Gn||(Gn={}))[ni]=Ar.attributes[ni];Ar.collapsed&&(!jn||nt(jn.marker,Ar)<0)&&(jn=cr)}else cr.from>oe&&ft>cr.from&&(ft=cr.from)}if($n)for(var ji=0;ji<$n.length;ji+=2)$n[ji+1]==ft&&(_n+=" "+$n[ji]);if(!jn||jn.from==oe)for(var vi=0;vi<Fn.length;++vi)an(t,0,Fn[vi]);if(jn&&(jn.from||0)==oe){if(an(t,(jn.to==null?te+1:jn.to)-oe,jn.marker,jn.from==null),jn.to==null)return;jn.to==oe&&(jn=!1)}}if(oe>=te)break;for(var aa=Math.min(te,ft);;){if(Ie){var ta=oe+Ie.length;if(!jn){var Li=ta>aa?Ie.slice(0,aa-oe):Ie;t.addToken(t,Li,Ke?Ke+Jt:Jt,Mn,oe+Li.length==ft?_n:"",_t,Gn)}if(ta>=aa){Ie=Ie.slice(aa-oe),oe=aa;break}oe=ta,Mn=""}Ie=y.slice(H,H=d[he++]),Ke=wt(d[he++],t.cm.options)}}}function zt(e,t,d){this.line=t,this.rest=bt(t),this.size=this.rest?Vn(j(this.rest))-d+1:1,this.node=this.text=null,this.hidden=Kt(e,t)}function En(e,t,d){for(var l=[],y,H=t;H<d;H=y){var $=new zt(e.doc,tn(e.doc,H),H);y=H+$.size,l.push($)}return l}var Ln=null;function cn(e){Ln?Ln.ops.push(e):e.ownsGroup=Ln={ops:[e],delayedCallbacks:[]}}function dr(e){var t=e.delayedCallbacks,d=0;do{for(;d<t.length;d++)t[d].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(d<t.length)}function xn(e,t){var d=e.ownsGroup;if(!d)return;try{dr(d)}finally{Ln=null,t(d)}}var gn=null;function Ct(e,t){var d=vt(e,t);if(!d.length)return;var l=Array.prototype.slice.call(arguments,2),y;Ln?y=Ln.delayedCallbacks:gn?y=gn:(y=gn=[],setTimeout(Ze,0));for(var H=function(te){y.push(function(){return d[te].apply(null,l)})},$=0;$<d.length;++$)H($)}function Ze(){var e=gn;gn=null;for(var t=0;t<e.length;++t)e[t]()}function Lt(e,t,d,l){for(var y=0;y<t.changes.length;y++){var H=t.changes[y];H=="text"?Sn(e,t):H=="gutter"?zn(e,t,d,l):H=="class"?Qn(e,t):H=="widget"&&vr(e,t,l)}t.changes=null}function At(e){return e.node==e.text&&(e.node=h("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),W&&k<8&&(e.node.style.zIndex=2)),e.node}function en(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 l=At(t);t.background=l.insertBefore(h("div",null,d),l.firstChild),e.display.input.setUneditable(t.background)}}function Nn(e,t){var d=e.display.externalMeasured;return d&&d.line==t.line?(e.display.externalMeasured=null,t.measure=d.measure,d.built):Rn(e,t)}function Sn(e,t){var d=t.text.className,l=Nn(e,t);t.text==t.node&&(t.node=l.pre),t.text.parentNode.replaceChild(l.pre,t.text),t.text=l.pre,l.bgClass!=t.bgClass||l.textClass!=t.textClass?(t.bgClass=l.bgClass,t.textClass=l.textClass,Qn(e,t)):d&&(t.text.className=d)}function Qn(e,t){en(e,t),t.line.wrapClass?At(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 zn(e,t,d,l){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=At(t);t.gutterBackground=h("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),y.insertBefore(t.gutterBackground,t.text)}var H=t.line.gutterMarkers;if(e.options.lineNumbers||H){var $=At(t),te=t.gutter=h("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(te),$.insertBefore(te,t.text),t.line.gutterClass&&(te.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!H||!H["CodeMirror-linenumbers"])&&(t.lineNumber=te.appendChild(h("div",Sr(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),H)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var he=e.display.gutterSpecs[oe].className,Ie=H.hasOwnProperty(he)&&H[he];Ie&&te.appendChild(h("div",[Ie],"CodeMirror-gutter-elt","left: "+l.gutterLeft[he]+"px; width: "+l.gutterWidth[he]+"px"))}}}function vr(e,t,d){t.alignable&&(t.alignable=null);for(var l=T("CodeMirror-linewidget"),y=t.node.firstChild,H=void 0;y;y=H)H=y.nextSibling,l.test(y.className)&&t.node.removeChild(y);hr(e,t,d)}function sr(e,t,d,l){var y=Nn(e,t);return t.text=t.node=y.pre,y.bgClass&&(t.bgClass=y.bgClass),y.textClass&&(t.textClass=y.textClass),Qn(e,t),zn(e,t,d,l),hr(e,t,l),t.node}function hr(e,t,d){if(Wr(e,t.line,t,d,!0),t.rest)for(var l=0;l<t.rest.length;l++)Wr(e,t.rest[l],t,d,!1)}function Wr(e,t,d,l,y){if(!t.widgets)return;for(var H=At(d),$=0,te=t.widgets;$<te.length;++$){var oe=te[$],he=h("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||he.setAttribute("cm-ignore-events","true"),Ur(oe,he,d,l),e.display.input.setUneditable(he),y&&oe.above?H.insertBefore(he,d.gutter||d.text):H.appendChild(he),Ct(oe,"redraw")}}function Ur(e,t,d,l){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(t);var y=l.wrapperWidth;t.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,t.style.paddingLeft=l.gutterTotalWidth+"px"),t.style.width=y+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-l.gutterTotalWidth+"px"))}function Br(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(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;"),f(t.display.measure,h("div",[e.node],null,d))}return e.height=e.node.parentNode.offsetHeight}function li(e,t){for(var d=xe(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 ui(e){return e.lineSpace.offsetTop}function Se(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function je(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=f(e.measure,h("pre","x","CodeMirror-line-like")),d=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,l={left:parseInt(d.paddingLeft),right:parseInt(d.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Xe(e){return Ee-e.display.nativeBarWidth}function Le(e){return e.display.scroller.clientWidth-Xe(e)-e.display.barWidth}function ue(e){return e.display.scroller.clientHeight-Xe(e)-e.display.barHeight}function be(e,t,d){var l=e.options.lineWrapping,y=l&&Le(e);if(!t.measure.heights||l&&t.measure.width!=y){var H=t.measure.heights=[];if(l){t.measure.width=y;for(var $=t.text.firstChild.getClientRects(),te=0;te<$.length-1;te++){var oe=$[te],he=$[te+1];Math.abs(oe.bottom-he.bottom)>2&&H.push((oe.bottom+he.top)/2-d.top)}}H.push(d.bottom-d.top)}}function fe(e,t,d){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==t)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(Vn(e.rest[y])>d)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function Pe(e,t){t=ot(t);var d=Vn(t),l=e.display.externalMeasured=new zt(e.doc,t,d);l.lineN=d;var y=l.built=Rn(e,l);return l.text=y.pre,f(e.display.lineMeasure,y.pre),l}function ke(e,t,d,l){return st(e,Ne(e,t),d,l)}function qe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Qr(e,t)];var d=e.display.externalMeasured;if(d&&t>=d.lineN&&t<d.lineN+d.size)return d}function Ne(e,t){var d=Vn(t),l=qe(e,d);l&&!l.text?l=null:l&&l.changes&&(Lt(e,l,d,ur(e)),e.curOp.forceUpdate=!0),l||(l=Pe(e,t));var y=fe(l,t,d);return{line:t,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function st(e,t,d,l,y){t.before&&(d=-1);var H=d+(l||""),$;return t.cache.hasOwnProperty(H)?$=t.cache[H]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(be(e,t.view,t.rect),t.hasHeights=!0),$=Pn(e,t,d,l),$.bogus||(t.cache[H]=$)),{left:$.left,right:$.right,top:y?$.rtop:$.top,bottom:y?$.rbottom:$.bottom}}var Pt={left:0,right:0,top:0,bottom:0};function $t(e,t,d){for(var l,y,H,$,te,oe,he=0;he<e.length;he+=3)if(te=e[he],oe=e[he+1],t<te?(y=0,H=1,$="left"):t<oe?(y=t-te,H=y+1):(he==e.length-3||t==oe&&e[he+3]>t)&&(H=oe-te,y=H-1,t>=oe&&($="right")),y!=null){if(l=e[he+2],te==oe&&d==(l.insertLeft?"left":"right")&&($=d),d=="left"&&y==0)for(;he&&e[he-2]==e[he-3]&&e[he-1].insertLeft;)l=e[(he-=3)+2],$="left";if(d=="right"&&y==oe-te)for(;he<e.length-3&&e[he+3]==e[he+4]&&!e[he+5].insertLeft;)l=e[(he+=3)+2],$="right";break}return{node:l,start:y,end:H,collapse:$,coverStart:te,coverEnd:oe}}function sn(e,t){var d=Pt;if(t=="left")for(var l=0;l<e.length&&!((d=e[l]).left!=d.right);l++);else for(var y=e.length-1;y>=0&&!((d=e[y]).left!=d.right);y--);return d}function Pn(e,t,d,l){var y=$t(t.map,d,l),H=y.node,$=y.start,te=y.end,oe=y.collapse,he;if(H.nodeType==3){for(var Ie=0;Ie<4;Ie++){for(;$&&Fe(t.line.text.charAt(y.coverStart+$));)--$;for(;y.coverStart+te<y.coverEnd&&Fe(t.line.text.charAt(y.coverStart+te));)++te;if(W&&k<9&&$==0&&te==y.coverEnd-y.coverStart?he=H.parentNode.getBoundingClientRect():he=sn(g(H,$,te).getClientRects(),l),he.left||he.right||$==0)break;te=$,$=$-1,oe="right"}W&&k<11&&(he=Un(e.display.measure,he))}else{$>0&&(oe=l="right");var Ke;e.options.lineWrapping&&(Ke=H.getClientRects()).length>1?he=Ke[l=="right"?Ke.length-1:0]:he=H.getBoundingClientRect()}if(W&&k<9&&!$&&(!he||!he.left&&!he.right)){var _t=H.parentNode.getClientRects()[0];_t?he={left:_t.left,right:_t.left+Dr(e.display),top:_t.top,bottom:_t.bottom}:he=Pt}for(var ft=he.top-t.rect.top,Jt=he.bottom-t.rect.top,_n=(ft+Jt)/2,Mn=t.view.measure.heights,jn=0;jn<Mn.length-1&&!(_n<Mn[jn]);jn++);var Gn=jn?Mn[jn-1]:0,Fn=Mn[jn],$n={left:(oe=="right"?he.right:he.left)-t.rect.left,right:(oe=="left"?he.left:he.right)-t.rect.left,top:Gn,bottom:Fn};return!he.left&&!he.right&&($n.bogus=!0),e.options.singleCursorHeightPerLine||($n.rtop=ft,$n.rbottom=Jt),$n}function Un(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Me(e))return t;var d=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*d,right:t.right*d,top:t.top*l,bottom:t.bottom*l}}function ar(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 tr(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ar(e.display.view[t])}function fr(e){tr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function _r(){return E&&c?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function lr(){return E&&c?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pr(e){var t=0;if(e.widgets)for(var d=0;d<e.widgets.length;++d)e.widgets[d].above&&(t+=Br(e.widgets[d]));return t}function Er(e,t,d,l,y){if(!y){var H=pr(t);d.top+=H,d.bottom+=H}if(l=="line")return d;l||(l="local");var $=wn(t);if(l=="local"?$+=ui(e.display):$-=e.display.viewOffset,l=="page"||l=="window"){var te=e.display.lineSpace.getBoundingClientRect();$+=te.top+(l=="window"?0:lr());var oe=te.left+(l=="window"?0:_r());d.left+=oe,d.right+=oe}return d.top+=$,d.bottom+=$,d}function ln(e,t,d){if(d=="div")return t;var l=t.left,y=t.top;if(d=="page")l-=_r(),y-=lr();else if(d=="local"||!d){var H=e.display.sizer.getBoundingClientRect();l+=H.left,y+=H.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:l-$.left,top:y-$.top}}function Yt(e,t,d,l,y){return l||(l=tn(e.doc,t.line)),Er(e,l,ke(e,l,t.ch,y),d)}function pn(e,t,d,l,y,H){l=l||tn(e.doc,t.line),y||(y=Ne(e,l));function $(Jt,_n){var Mn=st(e,y,Jt,_n?"right":"left",H);return _n?Mn.left=Mn.right:Mn.right=Mn.left,Er(e,l,Mn,d)}var te=vn(l,e.doc.direction),oe=t.ch,he=t.sticky;if(oe>=l.text.length?(oe=l.text.length,he="before"):oe<=0&&(oe=0,he="after"),!te)return $(he=="before"?oe-1:oe,he=="before");function Ie(Jt,_n,Mn){var jn=te[_n],Gn=jn.level==1;return $(Mn?Jt-1:Jt,Gn!=Mn)}var Ke=tt(te,oe,he),_t=Xt,ft=Ie(oe,Ke,he=="before");return _t!=null&&(ft.other=Ie(oe,_t,he!="before")),ft}function Ft(e,t){var d=0;t=Yn(e.doc,t),e.options.lineWrapping||(d=Dr(e.display)*t.ch);var l=tn(e.doc,t.line),y=wn(l)+ui(e.display);return{left:d,right:d,top:y,bottom:y+l.height}}function Bt(e,t,d,l,y){var H=on(e,t,d);return H.xRel=y,l&&(H.outside=l),H}function or(e,t,d){var l=e.doc;if(d+=e.display.viewOffset,d<0)return Bt(l.first,0,null,-1,-1);var y=qn(l,d),H=l.first+l.size-1;if(y>H)return Bt(l.first+l.size-1,tn(l,H).text.length,null,1,1);t<0&&(t=0);for(var $=tn(l,y);;){var te=Xr(e,$,y,t,d),oe=Ge($,te.ch+(te.xRel>0||te.outside>0?1:0));if(!oe)return te;var he=oe.find(1);if(he.line==y)return he;$=tn(l,y=he.line)}}function xr(e,t,d,l){l-=pr(t);var y=t.text.length,H=Tt(function($){return st(e,d,$-1).bottom<=l},y,0);return y=Tt(function($){return st(e,d,$).top>l},H,y),{begin:H,end:y}}function Xn(e,t,d,l){d||(d=Ne(e,t));var y=Er(e,t,st(e,d,l),"line").top;return xr(e,t,d,y)}function Or(e,t,d,l){return e.bottom<=d?!1:e.top>d?!0:(l?e.left:e.right)>t}function Xr(e,t,d,l,y){y-=wn(t);var H=Ne(e,t),$=pr(t),te=0,oe=t.text.length,he=!0,Ie=vn(t,e.doc.direction);if(Ie){var Ke=(e.options.lineWrapping?jr:Rr)(e,t,d,H,Ie,l,y);he=Ke.level!=1,te=he?Ke.from:Ke.to-1,oe=he?Ke.to:Ke.from-1}var _t=null,ft=null,Jt=Tt(function(mr){var cr=st(e,H,mr);return cr.top+=$,cr.bottom+=$,Or(cr,l,y,!1)?(cr.top<=y&&cr.left<=l&&(_t=mr,ft=cr),!0):!1},te,oe),_n,Mn,jn=!1;if(ft){var Gn=l-ft.left<ft.right-l,Fn=Gn==he;Jt=_t+(Fn?0:1),Mn=Fn?"after":"before",_n=Gn?ft.left:ft.right}else{!he&&(Jt==oe||Jt==te)&&Jt++,Mn=Jt==0?"after":Jt==t.text.length?"before":st(e,H,Jt-(he?1:0)).bottom+$<=y==he?"after":"before";var $n=pn(e,on(d,Jt,Mn),"line",t,H);_n=$n.left,jn=y<$n.top?-1:y>=$n.bottom?1:0}return Jt=Ye(t.text,Jt,1),Bt(d,Jt,Mn,jn,l-_n)}function Rr(e,t,d,l,y,H,$){var te=Tt(function(Ke){var _t=y[Ke],ft=_t.level!=1;return Or(pn(e,on(d,ft?_t.to:_t.from,ft?"before":"after"),"line",t,l),H,$,!0)},0,y.length-1),oe=y[te];if(te>0){var he=oe.level!=1,Ie=pn(e,on(d,he?oe.from:oe.to,he?"after":"before"),"line",t,l);Or(Ie,H,$,!0)&&Ie.top>$&&(oe=y[te-1])}return oe}function jr(e,t,d,l,y,H,$){var te=xr(e,t,l,$),oe=te.begin,he=te.end;/\s/.test(t.text.charAt(he-1))&&he--;for(var Ie=null,Ke=null,_t=0;_t<y.length;_t++){var ft=y[_t];if(ft.from>=he||ft.to<=oe)continue;var Jt=ft.level!=1,_n=st(e,l,Jt?Math.min(he,ft.to)-1:Math.max(oe,ft.from)).right,Mn=_n<H?H-_n+1e9:_n-H;(!Ie||Ke>Mn)&&(Ie=ft,Ke=Mn)}return Ie||(Ie=y[y.length-1]),Ie.from<oe&&(Ie={from:oe,to:Ie.to,level:Ie.level}),Ie.to>he&&(Ie={from:Ie.from,to:he,level:Ie.level}),Ie}var Ir;function Pr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ir==null){Ir=h("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(h("br"));Ir.appendChild(document.createTextNode("x"))}f(e.measure,Ir);var d=Ir.offsetHeight/50;return d>3&&(e.cachedTextHeight=d),b(e.measure),d||1}function Dr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=h("span","xxxxxxxxxx"),d=h("pre",[t],"CodeMirror-line-like");f(e.measure,d);var l=t.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function ur(e){for(var t=e.display,d={},l={},y=t.gutters.clientLeft,H=t.gutters.firstChild,$=0;H;H=H.nextSibling,++$){var te=e.display.gutterSpecs[$].className;d[te]=H.offsetLeft+H.clientLeft+y,l[te]=H.clientWidth}return{fixedPos:ci(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:d,gutterWidth:l,wrapperWidth:t.wrapper.clientWidth}}function ci(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ji(e){var t=Pr(e.display),d=e.options.lineWrapping,l=d&&Math.max(5,e.display.scroller.clientWidth/Dr(e.display)-3);return function(y){if(Kt(e.doc,y))return 0;var H=0;if(y.widgets)for(var $=0;$<y.widgets.length;$++)y.widgets[$].height&&(H+=y.widgets[$].height);return d?H+(Math.ceil(y.text.length/l)||1)*t:H+t}}function Ii(e){var t=e.doc,d=Ji(e);t.iter(function(l){var y=d(l);y!=l.height&&Dn(l,y)})}function Ci(e,t,d,l){var y=e.display;if(!d&&xe(t).getAttribute("cm-not-content")=="true")return null;var H,$,te=y.lineSpace.getBoundingClientRect();try{H=t.clientX-te.left,$=t.clientY-te.top}catch(Ke){return null}var oe=or(e,H,$),he;if(l&&oe.xRel>0&&(he=tn(e.doc,oe.line).text).length==oe.ch){var Ie=Y(he,he.length,e.options.tabSize)-he.length;oe=on(oe.line,Math.max(0,Math.round((H-je(e.display).left)/Dr(e.display))-Ie))}return oe}function Qr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var d=e.display.view,l=0;l<d.length;l++)if(t-=d[l].size,t<0)return l}function Kr(e,t,d,l){t==null&&(t=e.doc.first),d==null&&(d=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&d<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>t)&&(y.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=y.viewTo)yr&&Dt(e.doc,t)<y.viewTo&&Zr(e);else if(d<=y.viewFrom)yr&&pt(e.doc,d+l)>y.viewFrom?Zr(e):(y.viewFrom+=l,y.viewTo+=l);else if(t<=y.viewFrom&&d>=y.viewTo)Zr(e);else if(t<=y.viewFrom){var H=Ni(e,d,d+l,1);H?(y.view=y.view.slice(H.index),y.viewFrom=H.lineN,y.viewTo+=l):Zr(e)}else if(d>=y.viewTo){var $=Ni(e,t,t,-1);$?(y.view=y.view.slice(0,$.index),y.viewTo=$.lineN):Zr(e)}else{var te=Ni(e,t,t,-1),oe=Ni(e,d,d+l,1);te&&oe?(y.view=y.view.slice(0,te.index).concat(En(e,te.lineN,oe.lineN)).concat(y.view.slice(oe.index)),y.viewTo+=l):Zr(e)}var he=y.externalMeasured;he&&(d<he.lineN?he.lineN+=l:t<he.lineN+he.size&&(y.externalMeasured=null))}function Vr(e,t,d){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&t>=y.lineN&&t<y.lineN+y.size&&(l.externalMeasured=null),t<l.viewFrom||t>=l.viewTo)return;var H=l.view[Qr(e,t)];if(H.node==null)return;var $=H.changes||(H.changes=[]);ce($,d)==-1&&$.push(d)}function Zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ni(e,t,d,l){var y=Qr(e,t),H,$=e.display.view;if(!yr||d==e.doc.first+e.doc.size)return{index:y,lineN:d};for(var te=e.display.viewFrom,oe=0;oe<y;oe++)te+=$[oe].size;if(te!=t){if(l>0){if(y==$.length-1)return null;H=te+$[y].size-t,y++}else H=te-t;t+=H,d+=H}for(;Dt(e.doc,d)!=d;){if(y==(l<0?0:$.length-1))return null;d+=l*$[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:d}}function ha(e,t,d){var l=e.display,y=l.view;y.length==0||t>=l.viewTo||d<=l.viewFrom?(l.view=En(e,t,d),l.viewFrom=t):(l.viewFrom>t?l.view=En(e,t,l.viewFrom).concat(l.view):l.viewFrom<t&&(l.view=l.view.slice(Qr(e,t))),l.viewFrom=t,l.viewTo<d?l.view=l.view.concat(En(e,l.viewTo,d)):l.viewTo>d&&(l.view=l.view.slice(0,Qr(e,d)))),l.viewTo=d}function sa(e){for(var t=e.display.view,d=0,l=0;l<t.length;l++){var y=t[l];!y.hidden&&(!y.node||y.changes)&&++d}return d}function Gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Qi(e,t){t===void 0&&(t=!0);for(var d=e.doc,l={},y=l.cursors=document.createDocumentFragment(),H=l.selection=document.createDocumentFragment(),$=0;$<d.sel.ranges.length;$++){if(!t&&$==d.sel.primIndex)continue;var te=d.sel.ranges[$];if(te.from().line>=e.display.viewTo||te.to().line<e.display.viewFrom)continue;var oe=te.empty();(oe||e.options.showCursorWhenSelecting)&&Zi(e,te.head,y),oe||Hr(e,te,H)}return l}function Zi(e,t,d){var l=pn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),y=d.appendChild(h("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var H=d.appendChild(h("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));H.style.display="",H.style.left=l.other.left+"px",H.style.top=l.other.top+"px",H.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function $r(e,t){return e.top-t.top||e.left-t.left}function Hr(e,t,d){var l=e.display,y=e.doc,H=document.createDocumentFragment(),$=je(e.display),te=$.left,oe=Math.max(l.sizerWidth,Le(e)-l.sizer.offsetLeft)-$.right,he=y.direction=="ltr";function Ie(Fn,$n,mr,cr){$n<0&&($n=0),$n=Math.round($n),cr=Math.round(cr),H.appendChild(h("div",null,"CodeMirror-selected","position: absolute; left: "+Fn+`px;
top: `+$n+"px; width: "+(mr==null?oe-Fn:mr)+`px;
height: `+(cr-$n)+"px"))}function Ke(Fn,$n,mr){var cr=tn(y,Fn),Ar=cr.text.length,ni,ji;function vi(Li,na){return Yt(e,on(Fn,Li),"div",cr,na)}function aa(Li,na,Gi){var ki=Xn(e,cr,null,Li),Pi=na=="ltr"==(Gi=="after")?"left":"right",Ei=Gi=="after"?ki.begin:ki.end-(/\s/.test(cr.text.charAt(ki.end-1))?2:1);return vi(Ei,Pi)[Pi]}var ta=vn(cr,y.direction);return Nt(ta,$n||0,mr==null?Ar:mr,function(Li,na,Gi,ki){var Pi=Gi=="ltr",Ei=vi(Li,Pi?"left":"right"),ra=vi(na-1,Pi?"right":"left"),So=$n==null&&Li==0,to=mr==null&&na==Ar,Vi=ki==0,Pa=!ta||ki==ta.length-1;if(ra.top-Ei.top<=3){var Fi=(he?So:to)&&Vi,ms=(he?to:So)&&Pa,Ga=Fi?te:(Pi?Ei:ra).left,lo=ms?oe:(Pi?ra:Ei).right;Ie(Ga,Ei.top,lo-Ga,Ei.bottom)}else{var uo,Xi,Oo,gs;Pi?(uo=he&&So&&Vi?te:Ei.left,Xi=he?oe:aa(Li,Gi,"before"),Oo=he?te:aa(na,Gi,"after"),gs=he&&to&&Pa?oe:ra.right):(uo=he?aa(Li,Gi,"before"):te,Xi=!he&&So&&Vi?oe:Ei.right,Oo=!he&&to&&Pa?te:ra.left,gs=he?aa(na,Gi,"after"):oe),Ie(uo,Ei.top,Xi-uo,Ei.bottom),Ei.bottom<ra.top&&Ie(te,Ei.bottom,null,ra.top),Ie(Oo,ra.top,gs-Oo,ra.bottom)}(!ni||$r(Ei,ni)<0)&&(ni=Ei),$r(ra,ni)<0&&(ni=ra),(!ji||$r(Ei,ji)<0)&&(ji=Ei),$r(ra,ji)<0&&(ji=ra)}),{start:ni,end:ji}}var _t=t.from(),ft=t.to();if(_t.line==ft.line)Ke(_t.line,_t.ch,ft.ch);else{var Jt=tn(y,_t.line),_n=tn(y,ft.line),Mn=ot(Jt)==ot(_n),jn=Ke(_t.line,_t.ch,Mn?Jt.text.length+1:null).end,Gn=Ke(ft.line,Mn?0:null,ft.ch).start;Mn&&(jn.top<Gn.top-2?(Ie(jn.right,jn.top,null,jn.bottom),Ie(te,Gn.top,Gn.left,Gn.bottom)):Ie(jn.right,jn.top,Gn.left-jn.right,jn.bottom)),jn.bottom<Gn.top&&Ie(te,jn.bottom,null,Gn.top)}d.appendChild(H)}function yi(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||(de(e,"focus",e,t),e.state.focused=!0,F(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()),yi(e)}function Ca(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(de(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,l=0;l<t.view.length;l++){var y=t.view[l],H=e.options.lineWrapping,$=void 0,te=0;if(y.hidden)continue;if(W&&k<8){var oe=y.node.offsetTop+y.node.offsetHeight;$=oe-d,d=oe}else{var he=y.node.getBoundingClientRect();$=he.bottom-he.top,!H&&y.text.firstChild&&(te=y.text.firstChild.getBoundingClientRect().right-he.left-1)}var Ie=y.line.height-$;if((Ie>.005||Ie<-.005)&&(Dn(y.line,$),Sa(y.line),y.rest))for(var Ke=0;Ke<y.rest.length;Ke++)Sa(y.rest[Ke]);if(te>e.display.sizerWidth){var _t=Math.ceil(te/Dr(e.display));_t>e.display.maxLineLength&&(e.display.maxLineLength=_t,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],l=d.node.parentNode;l&&(d.height=l.offsetHeight)}}function ka(e,t,d){var l=d&&d.top!=null?Math.max(0,d.top):e.scroller.scrollTop;l=Math.floor(l-ui(e));var y=d&&d.bottom!=null?d.bottom:l+e.wrapper.clientHeight,H=qn(t,l),$=qn(t,y);if(d&&d.ensure){var te=d.ensure.from.line,oe=d.ensure.to.line;te<H?(H=te,$=qn(t,wn(tn(t,te))+e.wrapper.clientHeight)):Math.min(oe,t.lastLine())>=$&&(H=qn(t,wn(tn(t,oe))-e.wrapper.clientHeight),$=oe)}return{from:H,to:Math.max($,H+1)}}function co(e,t){if(ee(e,"scrollCursorIntoView"))return;var d=e.display,l=d.sizer.getBoundingClientRect(),y=null;if(t.top+l.top<0?y=!0:t.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!a){var H=h("div","\u200B",null,`position: absolute;
top: `+(t.top-d.viewOffset-ui(e.display))+`px;
height: `+(t.bottom-t.top+Xe(e)+d.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(H),H.scrollIntoView(y),e.display.lineSpace.removeChild(H)}}function Ro(e,t,d,l){l==null&&(l=0);var y;!e.options.lineWrapping&&t==d&&(t=t.ch?on(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,d=t.sticky=="before"?on(t.line,t.ch+1,"before"):t);for(var H=0;H<5;H++){var $=!1,te=pn(e,t),oe=!d||d==t?te:pn(e,d);y={left:Math.min(te.left,oe.left),top:Math.min(te.top,oe.top)-l,right:Math.max(te.left,oe.left),bottom:Math.max(te.bottom,oe.bottom)+l};var he=Oa(e,y),Ie=e.doc.scrollTop,Ke=e.doc.scrollLeft;if(he.scrollTop!=null&&(Da(e,he.scrollTop),Math.abs(e.doc.scrollTop-Ie)>1&&($=!0)),he.scrollLeft!=null&&(Mi(e,he.scrollLeft),Math.abs(e.doc.scrollLeft-Ke)>1&&($=!0)),!$)break}return y}function za(e,t){var d=Oa(e,t);d.scrollTop!=null&&Da(e,d.scrollTop),d.scrollLeft!=null&&Mi(e,d.scrollLeft)}function Oa(e,t){var d=e.display,l=Pr(e.display);t.top<0&&(t.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,H=ue(e),$={};t.bottom-t.top>H&&(t.bottom=t.top+H);var te=e.doc.height+Se(d),oe=t.top<l,he=t.bottom>te-l;if(t.top<y)$.scrollTop=oe?0:t.top;else if(t.bottom>y+H){var Ie=Math.min(t.top,(he?te:t.bottom)-H);Ie!=y&&($.scrollTop=Ie)}var Ke=e.options.fixedGutter?0:d.gutters.offsetWidth,_t=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-Ke,ft=Le(e)-d.gutters.offsetWidth,Jt=t.right-t.left>ft;return Jt&&(t.right=t.left+ft),t.left<10?$.scrollLeft=0:t.left<_t?$.scrollLeft=Math.max(0,t.left+Ke-(Jt?0:10)):t.right>ft+_t-3&&($.scrollLeft=t.right+(Jt?0:10)-ft),$}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=Ft(e,t.from),l=Ft(e,t.to);Aa(e,d,l,t.margin)}}function Aa(e,t,d,l){var y=Oa(e,{left:Math.min(t.left,d.left),top:Math.min(t.top,d.top)-l,right:Math.max(t.right,d.right),bottom:Math.max(t.bottom,d.bottom)+l});Ra(e,y.scrollLeft,y.scrollTop)}function Da(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;I||Ua(e,{top:t}),ya(e,t,!0),I&&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 Mi(e,t,d,l){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)&&!l)return;e.doc.scrollLeft=t,Tr(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,l=Math.round(e.doc.height+Se(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:l,scrollHeight:l+Xe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:d}}var pa=function(e,t,d){this.cm=d;var l=this.vert=h("div",[h("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=h("div",[h("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),He(l,"scroll",function(){l.clientHeight&&t(l.scrollTop,"vertical")}),He(y,"scroll",function(){y.clientWidth&&t(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,W&&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,l=e.nativeBarWidth;if(d){this.vert.style.display="block",this.vert.style.bottom=t?l+"px":"0";var y=e.viewHeight-(t?l: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?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var H=e.viewWidth-e.barLeft-(d?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+H)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:d?l:0,bottom:t?l: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&&!u?"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 l(){var y=e.getBoundingClientRect(),H=d=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);H!=e?e.style.pointerEvents="none":t.set(1e3,l)}t.set(1e3,l)},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,l=e.display.barHeight;Xa(e,t);for(var y=0;y<4&&d!=e.display.barWidth||l!=e.display.barHeight;y++)d!=e.display.barWidth&&e.options.lineWrapping&&Ta(e),Xa(e,fa(e)),d=e.display.barWidth,l=e.display.barHeight}function Xa(e,t){var d=e.display,l=d.scrollbars.update(t);d.sizer.style.paddingRight=(d.barWidth=l.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=l.bottom)+"px",d.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=l.bottom+"px",d.scrollbarFiller.style.width=l.right+"px"):d.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=l.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),He(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"?Mi(e,t):Da(e,t)},e),e.display.scrollbars.addClass&&F(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},cn(e.curOp)}function Ea(e){var t=e.curOp;t&&xn(t,function(d){for(var l=0;l<d.ops.length;l++)d.ops[l].cm.curOp=null;ro(d)})}function ro(e){for(var t=e.ops,d=0;d<t.length;d++)Ao(t[d]);for(var l=0;l<t.length;l++)Do(t[l]);for(var y=0;y<t.length;y++)fo(t[y]);for(var H=0;H<t.length;H++)io(t[H]);for(var $=0;$<t.length;$++)po(t[$])}function Ao(e){var t=e.cm,d=t.display;ao(t),e.updateMaxLine&&yn(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 qi(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=ke(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+Xe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-Le(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&&Mi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var d=e.focus&&e.focus==N();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,d),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ma(t,e.barMeasure),e.updatedDisplay&&Fr(t,e.barMeasure),e.selectionChanged&&yi(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,l=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&&Mi(t,e.scrollLeft,!0,!0),e.scrollToPos){var y=Ro(t,Yn(l,e.scrollToPos.from),Yn(l,e.scrollToPos.to),e.scrollToPos.margin);co(t,y)}var H=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(H)for(var te=0;te<H.length;++te)H[te].lines.length||de(H[te],"hide");if($)for(var oe=0;oe<$.length;++oe)$[oe].lines.length&&de($[oe],"unhide");d.wrapper.offsetHeight&&(l.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&de(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Wi(e,t){if(e.curOp)return t();ua(e);try{return t()}finally{Ea(e)}}function hi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ua(e);try{return t.apply(e,arguments)}finally{Ea(e)}}}function Ai(e){return function(){if(this.curOp)return e.apply(this,arguments);ua(this);try{return e.apply(this,arguments)}finally{Ea(this)}}}function fi(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,U(mo,e))}function mo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,l=ri(e,t.highlightFrontier),y=[];t.iter(l.line,Math.min(t.first+t.size,e.display.viewTo+500),function(H){if(l.line>=e.display.viewFrom){var $=H.styles,te=H.text.length>e.options.maxHighlightLength?Vt(t.mode,l.state):null,oe=wi(e,H,l,!0);te&&(l.state=te),H.styles=oe.styles;var he=H.styleClasses,Ie=oe.classes;Ie?H.styleClasses=Ie:he&&(H.styleClasses=null);for(var Ke=!$||$.length!=H.styles.length||he!=Ie&&(!he||!Ie||he.bgClass!=Ie.bgClass||he.textClass!=Ie.textClass),_t=0;!Ke&&_t<$.length;++_t)Ke=$[_t]!=H.styles[_t];Ke&&y.push(l.line),H.stateAfter=l.save(),l.nextLine()}else H.text.length<=e.options.maxHighlightLength&&Bi(e,H.text,l),H.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>d)return Na(e,e.options.workDelay),!0}),t.highlightFrontier=l.line,t.modeFrontier=Math.max(t.modeFrontier,l.line),y.length&&Wi(e,function(){for(var H=0;H<y.length;H++)Vr(e,y[H],"text")})}var qi=function(e,t,d){var l=e.display;this.viewport=t,this.visible=ka(l,e.doc,t),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=Le(e),this.force=d,this.dims=ur(e),this.events=[]};qi.prototype.signal=function(e,t){se(e,t)&&this.events.push(arguments)},qi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)de.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=Xe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Xe(e)+"px",t.scrollbarsClipped=!0)}function oo(e){if(e.hasFocus())return null;var t=N();if(!t||!x(e.display.lineDiv,t))return null;var d={activeElt:t};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&x(e.display.lineDiv,l.anchorNode)&&(d.anchorNode=l.anchorNode,d.anchorOffset=l.anchorOffset,d.focusNode=l.focusNode,d.focusOffset=l.focusOffset)}return d}function so(e){if(!e||!e.activeElt||e.activeElt==N())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(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,l=e.doc;if(t.editorIsHidden)return Zr(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;ai(e)&&(Zr(e),t.dims=ur(e));var y=l.first+l.size,H=Math.max(t.visible.from-e.options.viewportMargin,l.first),$=Math.min(y,t.visible.to+e.options.viewportMargin);d.viewFrom<H&&H-d.viewFrom<20&&(H=Math.max(l.first,d.viewFrom)),d.viewTo>$&&d.viewTo-$<20&&($=Math.min(y,d.viewTo)),yr&&(H=Dt(e.doc,H),$=pt(e.doc,$));var te=H!=d.viewFrom||$!=d.viewTo||d.lastWrapHeight!=t.wrapperHeight||d.lastWrapWidth!=t.wrapperWidth;ha(e,H,$),d.viewOffset=wn(tn(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var oe=sa(e);if(!te&&oe==0&&!t.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var he=oo(e);return oe>4&&(d.lineDiv.style.display="none"),go(e,d.updateLineNumbers,t.dims),oe>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,so(he),b(d.cursorDiv),b(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,te&&(d.lastWrapHeight=t.wrapperHeight,d.lastWrapWidth=t.wrapperWidth,Na(e,400)),d.updateLineNumbers=null,!0}function Qa(e,t){for(var d=t.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||t.oldDisplayWidth==Le(e)){if(d&&d.top!=null&&(d={top:Math.min(e.doc.height+Se(e.display)-ue(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 l&&(t.visible=ka(e.display,e.doc,d));if(!xa(e,t))break;Ta(e);var y=fa(e);Gr(e),ma(e,y),Fr(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 qi(e,t);if(xa(e,d)){Ta(e),Qa(e,d);var l=fa(e);Gr(e),ma(e,l),Fr(e,l),d.finish()}}function go(e,t,d){var l=e.display,y=e.options.lineNumbers,H=l.lineDiv,$=H.firstChild;function te(Jt){var _n=Jt.nextSibling;return r&&i&&e.display.currentWheelTarget==Jt?Jt.style.display="none":Jt.parentNode.removeChild(Jt),_n}for(var oe=l.view,he=l.viewFrom,Ie=0;Ie<oe.length;Ie++){var Ke=oe[Ie];if(!Ke.hidden)if(!Ke.node||Ke.node.parentNode!=H){var _t=sr(e,Ke,he,d);H.insertBefore(_t,$)}else{for(;$!=Ke.node;)$=te($);var ft=y&&t!=null&&t<=he&&Ke.lineNumber;Ke.changes&&(ce(Ke.changes,"gutter")>-1&&(ft=!1),Lt(e,Ke,he,d)),ft&&(b(Ke.lineNumber),Ke.lineNumber.appendChild(document.createTextNode(Sr(e.options,he)))),$=Ke.node.nextSibling}he+=Ke.size}for(;$;)$=te($)}function Za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Fr(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+Xe(e)+"px"}function Tr(e){var t=e.display,d=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var l=ci(t)-t.scroller.scrollLeft+e.doc.scrollLeft,y=t.gutters.offsetWidth,H=l+"px",$=0;$<d.length;$++)if(!d[$].hidden){e.options.fixedGutter&&(d[$].gutter&&(d[$].gutter.style.left=H),d[$].gutterBackground&&(d[$].gutterBackground.style.left=H));var te=d[$].alignable;if(te)for(var oe=0;oe<te.length;oe++)te[oe].style.left=H}e.options.fixedGutter&&(t.gutters.style.left=l+y+"px")}function ai(e){if(!e.options.lineNumbers)return!1;var t=e.doc,d=Sr(e.options,t.first+t.size-1),l=e.display;if(d.length!=l.lineNumChars){var y=l.measure.appendChild(h("div",[h("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),H=y.firstChild.offsetWidth,$=y.offsetWidth-H;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(H,l.lineGutter.offsetWidth-$)+1,l.lineNumWidth=l.lineNumInnerWidth+$,l.lineNumChars=l.lineNumInnerWidth?d.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Za(e.display),!0}return!1}function Ui(e,t){for(var d=[],l=!1,y=0;y<e.length;y++){var H=e[y],$=null;if(typeof H!="string"&&($=H.style,H=H.className),H=="CodeMirror-linenumbers")if(t)l=!0;else continue;d.push({className:H,style:$})}return t&&!l&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function La(e){var t=e.gutters,d=e.gutterSpecs;b(t),e.lineGutter=null;for(var l=0;l<d.length;++l){var y=d[l],H=y.className,$=y.style,te=t.appendChild(h("div",null,"CodeMirror-gutter "+H));$&&(te.style.cssText=$),H=="CodeMirror-linenumbers"&&(e.lineGutter=te,te.style.width=(e.lineNumWidth||1)+"px")}t.style.display=d.length?"":"none",Za(e)}function ca(e){La(e.display),Kr(e),Tr(e)}function ja(e,t,d,l){var y=this;this.input=d,y.scrollbarFiller=h("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=h("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=_("div",null,"CodeMirror-code"),y.selectionDiv=h("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=h("div",null,"CodeMirror-cursors"),y.measure=h("div",null,"CodeMirror-measure"),y.lineMeasure=h("div",null,"CodeMirror-measure"),y.lineSpace=_("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var H=_("div",[y.lineSpace],"CodeMirror-lines");y.mover=h("div",[H],null,"position: relative"),y.sizer=h("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=h("div",null,null,"position: absolute; height: "+Ee+"px; width: 1px;"),y.gutters=h("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=h("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=h("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),W&&k<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!r&&!(I&&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=Ui(l.gutters,l.lineNumbers),La(y),d.init(y)}var da=0,bi=null;W?bi=-.53:I?bi=15:E?bi=-.7:m&&(bi=-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*=bi,t.y*=bi,t}function Ha(e,t){var d=Fa(t),l=d.x,y=d.y,H=e.display,$=H.scroller,te=$.scrollWidth>$.clientWidth,oe=$.scrollHeight>$.clientHeight;if(!(l&&te||y&&oe))return;if(y&&i&&r){e:for(var he=t.target,Ie=H.view;he!=$;he=he.parentNode)for(var Ke=0;Ke<Ie.length;Ke++)if(Ie[Ke].node==he){e.display.currentWheelTarget=he;break e}}if(l&&!I&&!p&&bi!=null){y&&oe&&Da(e,Math.max(0,$.scrollTop+y*bi)),Mi(e,Math.max(0,$.scrollLeft+l*bi)),(!y||y&&oe)&&ae(t),H.wheelStartX=null;return}if(y&&bi!=null){var _t=y*bi,ft=e.doc.scrollTop,Jt=ft+H.wrapper.clientHeight;_t<0?ft=Math.max(0,ft+_t-50):Jt=Math.min(e.doc.height,Jt+_t+50),Ua(e,{top:ft,bottom:Jt})}da<20&&(H.wheelStartX==null?(H.wheelStartX=$.scrollLeft,H.wheelStartY=$.scrollTop,H.wheelDX=l,H.wheelDY=y,setTimeout(function(){if(H.wheelStartX==null)return;var _n=$.scrollLeft-H.wheelStartX,Mn=$.scrollTop-H.wheelStartY,jn=Mn&&H.wheelDY&&Mn/H.wheelDY||_n&&H.wheelDX&&_n/H.wheelDX;if(H.wheelStartX=H.wheelStartY=null,!jn)return;bi=(bi*da+jn)/(da+1),++da},200)):(H.wheelDX+=l,H.wheelDY+=y))}var Ki=function(e,t){this.ranges=e,this.primIndex=t};Ki.prototype.primary=function(){return this.ranges[this.primIndex]},Ki.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],l=e.ranges[t];if(!oi(d.anchor,l.anchor)||!oi(d.head,l.head))return!1}return!0},Ki.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Nr(xi(this.ranges[t].anchor),xi(this.ranges[t].head));return new Ki(e,this.primIndex)},Ki.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ki.prototype.contains=function(e,t){t||(t=e);for(var d=0;d<this.ranges.length;d++){var l=this.ranges[d];if(Jn(t,l.from())>=0&&Jn(e,l.to())<=0)return d}return-1};var Nr=function(e,t){this.anchor=e,this.head=t};Nr.prototype.from=function(){return Yr(this.anchor,this.head)},Nr.prototype.to=function(){return Jr(this.anchor,this.head)},Nr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function gr(e,t,d){var l=e&&e.options.selectionsMayTouch,y=t[d];t.sort(function(_t,ft){return Jn(_t.from(),ft.from())}),d=ce(t,y);for(var H=1;H<t.length;H++){var $=t[H],te=t[H-1],oe=Jn(te.to(),$.from());if(l&&!$.empty()?oe>0:oe>=0){var he=Yr(te.from(),$.from()),Ie=Jr(te.to(),$.to()),Ke=te.empty()?$.from()==$.head:te.from()==te.head;H<=d&&--d,t.splice(--H,2,new Nr(Ke?Ie:he,Ke?he:Ie))}}return new Ki(t,d)}function Bn(e,t){return new Ki([new Nr(e,t||e)],0)}function nr(e){return e.text?on(e.from.line+e.text.length-1,j(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Cr(e,t){if(Jn(e,t.from)<0)return e;if(Jn(e,t.to)<=0)return nr(t);var d=e.line+t.text.length-(t.to.line-t.from.line)-1,l=e.ch;return e.line==t.to.line&&(l+=nr(t).ch-t.to.ch),on(d,l)}function ti(e,t){for(var d=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];d.push(new Nr(Cr(y.anchor,t),Cr(y.head,t)))}return gr(e.cm,d,e.sel.primIndex)}function ga(e,t,d){return e.line==t.line?on(d.line,e.ch-t.ch+d.ch):on(d.line+(e.line-t.line),e.ch)}function ia(e,t,d){for(var l=[],y=on(e.first,0),H=y,$=0;$<t.length;$++){var te=t[$],oe=ga(te.from,y,H),he=ga(nr(te),y,H);if(y=te.to,H=he,d=="around"){var Ie=e.sel.ranges[$],Ke=Jn(Ie.head,Ie.anchor)<0;l[$]=new Nr(Ke?he:oe,Ke?oe:he)}else l[$]=new Nr(oe,oe)}return new Ki(l,e.sel.primIndex)}function Di(e){e.doc.mode=et(e.options,e.doc.modeOption),Yi(e)}function Yi(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&&Kr(e)}function va(e,t){return t.from.ch==0&&t.to.ch==0&&j(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wa(e,t,d,l){function y(Gn){return d?d[Gn]:null}function H(Gn,Fn,$n){Cn(Gn,Fn,$n,l),Ct(Gn,"change",Gn,t)}function $(Gn,Fn){for(var $n=[],mr=Gn;mr<Fn;++mr)$n.push(new On(he[mr],y(mr),l));return $n}var te=t.from,oe=t.to,he=t.text,Ie=tn(e,te.line),Ke=tn(e,oe.line),_t=j(he),ft=y(he.length-1),Jt=oe.line-te.line;if(t.full)e.insert(0,$(0,he.length)),e.remove(he.length,e.size-he.length);else if(va(e,t)){var _n=$(0,he.length-1);H(Ke,Ke.text,ft),Jt&&e.remove(te.line,Jt),_n.length&&e.insert(te.line,_n)}else if(Ie==Ke)if(he.length==1)H(Ie,Ie.text.slice(0,te.ch)+_t+Ie.text.slice(oe.ch),ft);else{var Mn=$(1,he.length-1);Mn.push(new On(_t+Ie.text.slice(oe.ch),ft,l)),H(Ie,Ie.text.slice(0,te.ch)+he[0],y(0)),e.insert(te.line+1,Mn)}else if(he.length==1)H(Ie,Ie.text.slice(0,te.ch)+he[0]+Ke.text.slice(oe.ch),y(0)),e.remove(te.line+1,Jt);else{H(Ie,Ie.text.slice(0,te.ch)+he[0],y(0)),H(Ke,_t+Ke.text.slice(oe.ch),ft);var jn=$(1,he.length-1);Jt>1&&e.remove(te.line+1,Jt-1),e.insert(te.line+1,jn)}Ct(e,"change",e,t)}function Ti(e,t,d){function l(y,H,$){if(y.linked)for(var te=0;te<y.linked.length;++te){var oe=y.linked[te];if(oe.doc==H)continue;var he=$&&oe.sharedHist;if(d&&!he)continue;t(oe.doc,he),l(oe.doc,y,he)}}l(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,Ii(e),Di(e),_s(e),e.options.lineWrapping||yn(e),e.options.mode=t.modeOption,Kr(e)}function _s(e){(e.doc.direction=="rtl"?F:v)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Wi(e,function(){_s(e),Kr(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:xi(t.from),to:nr(t),text:Hn(e,t.from,t.to)};return Es(e,d,t.from.line,t.to.line+1),Ti(e,function(l){return Es(l,d,t.from.line,t.to.line+1)},!0),d}function ys(e){for(;e.length;){var t=j(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),j(e.done);if(e.done.length&&!j(e.done).ranges)return j(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),j(e.done)}function bs(e,t,d,l){var y=e.history;y.undone.length=0;var H=+new Date,$,te;if((y.lastOp==l||y.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&y.lastModTime>H-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(y,y.lastOp==l)))te=j($.changes),Jn(t.from,t.to)==0&&Jn(t.from,te.to)==0?te.to=nr(t):$.changes.push(rs(e,t));else{var oe=j(y.done);for((!oe||!oe.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=H,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=t.origin,te||de(e,"historyAdded")}function ml(e,t,d,l){var y=t.charAt(0);return y=="*"||y=="+"&&d.ranges.length==l.ranges.length&&d.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,d,l){var y=e.history,H=l&&l.origin;d==y.lastSelOp||H&&y.lastSelOrigin==H&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==H||ml(e,H,j(y.done),t))?y.done[y.done.length-1]=t:zo(t,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=H,y.lastSelOp=d,l&&l.clearRedo!==!1&&ys(y.undone)}function zo(e,t){var d=j(t);d&&d.ranges&&d.equals(e)||t.push(e)}function Es(e,t,d,l){var y=t["spans_"+e.id],H=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,l),function($){$.markedSpans&&((y||(y=t["spans_"+e.id]={}))[H]=$.markedSpans),++H})}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 l=[],y=0;y<t.text.length;++y)l.push(vl(d[y]));return l}function xs(e,t){var d=_l(e,t),l=rr(e,t);if(!d)return l;if(!l)return d;for(var y=0;y<d.length;++y){var H=d[y],$=l[y];if(H&&$){e:for(var te=0;te<$.length;++te){for(var oe=$[te],he=0;he<H.length;++he)if(H[he].marker==oe.marker)continue e;H.push(oe)}}else $&&(d[y]=$)}return d}function vo(e,t,d){for(var l=[],y=0;y<e.length;++y){var H=e[y];if(H.ranges){l.push(d?Ki.prototype.deepCopy.call(H):H);continue}var $=H.changes,te=[];l.push({changes:te});for(var oe=0;oe<$.length;++oe){var he=$[oe],Ie=void 0;if(te.push({from:he.from,to:he.to,text:he.text}),t)for(var Ke in he)(Ie=Ke.match(/^spans_(\d+)$/))&&(ce(t,Number(Ie[1]))>-1&&(j(te)[Ke]=he[Ke],delete he[Ke]))}}return l}function is(e,t,d,l){if(l){var y=e.anchor;if(d){var H=Jn(t,y)<0;H!=Jn(d,y)<0?(y=t,t=d):H!=Jn(t,d)<0&&(t=d)}return new Nr(y,t)}else return new Nr(d||t,t)}function Vo(e,t,d,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),zi(e,new Ki([is(e.sel.primary(),t,d,y)],0),l)}function ws(e,t,d){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),H=0;H<e.sel.ranges.length;H++)l[H]=is(e.sel.ranges[H],t[H],null,y);var $=gr(e.cm,l,e.sel.primIndex);zi(e,$,d)}function as(e,t,d,l){var y=e.sel.ranges.slice(0);y[t]=d,zi(e,gr(e.cm,y,e.sel.primIndex),l)}function Cs(e,t,d,l){zi(e,Bn(t,d),l)}function yl(e,t,d){var l={ranges:t.ranges,update:function(y){this.ranges=[];for(var H=0;H<y.length;H++)this.ranges[H]=new Nr(Yn(e,y[H].anchor),Yn(e,y[H].head))},origin:d&&d.origin};return de(e,"beforeSelectionChange",e,l),e.cm&&de(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=t.ranges?gr(e.cm,l.ranges,l.ranges.length-1):t}function Ts(e,t,d){var l=e.history.done,y=j(l);y&&y.ranges?(l[l.length-1]=t,Yo(e,t,d)):zi(e,t,d)}function zi(e,t,d){Yo(e,t,d),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,d)}function Yo(e,t,d){(se(e,"beforeSelectionChange")||e.cm&&se(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,d));var l=d&&d.bias||(Jn(t.primary().head,e.sel.primary().head)<0?-1:1);Ss(e,Rs(e,t,l,!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,ne(e.cm)),Ct(e,"cursorActivity",e)}function Os(e){Ss(e,Rs(e,e.sel,null,!1))}function Rs(e,t,d,l){for(var y,H=0;H<t.ranges.length;H++){var $=t.ranges[H],te=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[H],oe=Xo(e,$.anchor,te&&te.anchor,d,l),he=Xo(e,$.head,te&&te.head,d,l);(y||oe!=$.anchor||he!=$.head)&&(y||(y=t.ranges.slice(0,H)),y[H]=new Nr(oe,he))}return y?gr(e.cm,y,t.primIndex):t}function _o(e,t,d,l,y){var H=tn(e,t.line);if(H.markedSpans)for(var $=0;$<H.markedSpans.length;++$){var te=H.markedSpans[$],oe=te.marker,he="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,Ie="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((te.from==null||(he?te.from<=t.ch:te.from<t.ch))&&(te.to==null||(Ie?te.to>=t.ch:te.to>t.ch))){if(y&&(de(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(H.markedSpans){--$;continue}else break;if(!oe.atomic)continue;if(d){var Ke=oe.find(l<0?1:-1),_t=void 0;if((l<0?Ie:he)&&(Ke=As(e,Ke,-l,Ke&&Ke.line==t.line?H:null)),Ke&&Ke.line==t.line&&(_t=Jn(Ke,d))&&(l<0?_t<0:_t>0))return _o(e,Ke,t,l,y)}var ft=oe.find(l<0?-1:1);return(l<0?he:Ie)&&(ft=As(e,ft,l,ft.line==t.line?H:null)),ft?_o(e,ft,t,l,y):null}}return t}function Xo(e,t,d,l,y){var H=l||1,$=_o(e,t,d,H,y)||!y&&_o(e,t,d,H,!0)||_o(e,t,d,-H,y)||!y&&_o(e,t,d,-H,!0);return $||(e.cantEdit=!0,on(e.first,0))}function As(e,t,d,l){return d<0&&t.ch==0?t.line>e.first?Yn(e,on(t.line-1)):null:d>0&&t.ch==(l||tn(e,t.line)).text.length?t.line<e.first+e.size-1?on(t.line+1,0):null:new on(t.line,t.ch+d)}function Ds(e){e.setSelection(on(e.firstLine(),0),on(e.lastLine()),Te)}function Ls(e,t,d){var l={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return l.canceled=!0}};return d&&(l.update=function(y,H,$,te){y&&(l.from=Yn(e,y)),H&&(l.to=Yn(e,H)),$&&(l.text=$),te!==void 0&&(l.origin=te)}),de(e,"beforeChange",e,l),e.cm&&de(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function yo(e,t,d){if(e.cm){if(!e.cm.curOp)return hi(e.cm,yo)(e,t,d);if(e.cm.state.suppressEdits)return}if((se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"))&&(t=Ls(e,t,!0),!t))return;var l=$i&&!d&&ge(e,t.from,t.to);if(l)for(var y=l.length-1;y>=0;--y)Ps(e,{from:l[y].from,to:l[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]==""&&Jn(t.from,t.to)==0)return;var d=ti(e,t);bs(e,t,d,e.cm?e.cm.curOp.id:NaN),Lo(e,t,d,rr(e,t));var l=[];Ti(e,function(y,H){!H&&ce(l,y.history)==-1&&(Ns(y.history,t),l.push(y.history)),Lo(y,t,null,rr(y,t))})}function $o(e,t,d){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!d)return;for(var y=e.history,H,$=e.sel,te=t=="undo"?y.done:y.undone,oe=t=="undo"?y.undone:y.done,he=0;he<te.length&&!(H=te[he],d?H.ranges&&!H.equals(e.sel):!H.ranges);he++);if(he==te.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(H=te.pop(),H.ranges){if(zo(H,oe),d&&!H.equals(e.sel)){zi(e,H,{clearRedo:!1});return}$=H}else if(l){te.push(H);return}else break;var Ie=[];zo($,oe),oe.push({changes:Ie,generation:y.generation}),y.generation=H.generation||++y.maxGeneration;for(var Ke=se(e,"beforeChange")||e.cm&&se(e.cm,"beforeChange"),_t=function(_n){var Mn=H.changes[_n];if(Mn.origin=t,Ke&&!Ls(e,Mn,!1))return te.length=0,{};Ie.push(rs(e,Mn));var jn=_n?ti(e,Mn):j(te);Lo(e,Mn,jn,xs(e,Mn)),!_n&&e.cm&&e.cm.scrollIntoView({from:Mn.from,to:nr(Mn)});var Gn=[];Ti(e,function(Fn,$n){!$n&&ce(Gn,Fn.history)==-1&&(Ns(Fn.history,Mn),Gn.push(Fn.history)),Lo(Fn,Mn,null,xs(Fn,Mn))})},ft=H.changes.length-1;ft>=0;--ft){var Jt=_t(ft);if(Jt)return Jt.v}}function Ms(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ki(K(e.sel.ranges,function(y){return new Nr(on(y.anchor.line+t,y.anchor.ch),on(y.head.line+t,y.head.ch))}),e.sel.primIndex),e.cm){Kr(e.cm,e.first,e.first-t,t);for(var d=e.cm.display,l=d.viewFrom;l<d.viewTo;l++)Vr(e.cm,l,"gutter")}}function Lo(e,t,d,l){if(e.cm&&!e.cm.curOp)return hi(e.cm,Lo)(e,t,d,l);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:on(e.first,0),to:on(t.to.line+y,t.to.ch),text:[j(t.text)],origin:t.origin}}var H=e.lastLine();t.to.line>H&&(t={from:t.from,to:on(H,tn(e,H).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Hn(e,t.from,t.to),d||(d=ti(e,t)),e.cm?bl(e.cm,t,l):Wa(e,t,l),Yo(e,d,Te),e.cantEdit&&Xo(e,on(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,d){var l=e.doc,y=e.display,H=t.from,$=t.to,te=!1,oe=H.line;e.options.lineWrapping||(oe=Vn(ot(tn(l,H.line))),l.iter(oe,$.line+1,function(ft){if(ft==y.maxLine)return te=!0,!0})),l.sel.contains(t.from,t.to)>-1&&ne(e),Wa(l,t,d,Ji(e)),e.options.lineWrapping||(l.iter(oe,H.line+t.text.length,function(ft){var Jt=In(ft);Jt>y.maxLineLength&&(y.maxLine=ft,y.maxLineLength=Jt,y.maxLineChanged=!0,te=!1)}),te&&(e.curOp.updateMaxLine=!0)),oa(l,H.line),Na(e,400);var he=t.text.length-($.line-H.line)-1;t.full?Kr(e):H.line==$.line&&t.text.length==1&&!va(e.doc,t)?Vr(e,H.line,"text"):Kr(e,H.line,$.line+1,he);var Ie=se(e,"changes"),Ke=se(e,"change");if(Ke||Ie){var _t={from:H,to:$,text:t.text,removed:t.removed,origin:t.origin};Ke&&Ct(e,"change",e,_t),Ie&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(_t)}e.display.selForContextMenu=null}function bo(e,t,d,l,y){var H;l||(l=d),Jn(l,d)<0&&(H=[l,d],d=H[0],l=H[1]),typeof t=="string"&&(t=e.splitLines(t)),yo(e,{from:d,to:l,text:t,origin:y})}function ks(e,t,d,l){d<e.line?e.line+=l:t<e.line&&(e.line=t,e.ch=0)}function Is(e,t,d,l){for(var y=0;y<e.length;++y){var H=e[y],$=!0;if(H.ranges){H.copied||(H=e[y]=H.deepCopy(),H.copied=!0);for(var te=0;te<H.ranges.length;te++)ks(H.ranges[te].anchor,t,d,l),ks(H.ranges[te].head,t,d,l);continue}for(var oe=0;oe<H.changes.length;++oe){var he=H.changes[oe];if(d<he.from.line)he.from=on(he.from.line+l,he.from.ch),he.to=on(he.to.line+l,he.to.ch);else if(t<=he.to.line){$=!1;break}}$||(e.splice(0,y+1),y=0)}}function Ns(e,t){var d=t.from.line,l=t.to.line,y=t.text.length-(l-d)-1;Is(e.done,d,l,y),Is(e.undone,d,l,y)}function Po(e,t,d,l){var y=t,H=t;return typeof t=="number"?H=tn(e,Lr(e,t)):y=Vn(t),y==null?null:(l(H,y)&&e.cm&&Vr(e.cm,y,d),H)}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,l=e+t;d<l;++d){var y=this.lines[d];this.height-=y.height,Ot(y),Ct(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 l=0;l<t.length;++l)t[l].parent=this},iterN:function(e,t,d){for(var l=e+t;e<l;++e)if(d(this.lines[e]))return!0}};function ko(e){this.children=e;for(var t=0,d=0,l=0;l<e.length;++l){var y=e[l];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 l=this.children[d],y=l.chunkSize();if(e<y){var H=Math.min(t,y-e),$=l.height;if(l.removeInner(e,H),this.height-=$-l.height,y==H&&(this.children.splice(d--,1),l.parent=null),(t-=H)==0)break;e=0}else e-=y}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Mo))){var te=[];this.collapse(te),this.children=[new Mo(te)],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 l=0;l<this.children.length;++l){var y=this.children[l],H=y.chunkSize();if(e<=H){if(y.insertInner(e,t,d),y.lines&&y.lines.length>50){for(var $=y.lines.length%25+25,te=$;te<y.lines.length;){var oe=new Mo(y.lines.slice(te,te+=25));y.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}y.lines=y.lines.slice(0,$),this.maybeSpill()}break}e-=H}},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=ce(e.parent.children,e);e.parent.children.splice(y+1,0,d)}else{var l=new ko(e.children);l.parent=e,e.children=[l,d],e=l}d.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,d){for(var l=0;l<this.children.length;++l){var y=this.children[l],H=y.chunkSize();if(e<H){var $=Math.min(t,H-e);if(y.iterN(e,$,d))return!0;if((t-=$)==0)break;e=0}else e-=H}}};var Io=function(e,t,d){if(d)for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);this.doc=e,this.node=t};Io.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,d=this.line,l=Vn(d);if(l==null||!t)return;for(var y=0;y<t.length;++y)t[y]==this&&t.splice(y--,1);t.length||(d.widgets=null);var H=Br(this);Dn(d,Math.max(0,d.height-H)),e&&(Wi(e,function(){Us(e,d,-H),Vr(e,l,"widget")}),Ct(e,"lineWidgetCleared",e,this,l))},Io.prototype.changed=function(){var e=this,t=this.height,d=this.doc.cm,l=this.line;this.height=null;var y=Br(this)-t;if(!y)return;Kt(this.doc,l)||Dn(l,l.height+y),d&&Wi(d,function(){d.curOp.forceUpdate=!0,Us(d,l,y),Ct(d,"lineWidgetChanged",d,e,Vn(l))})},pe(Io);function Us(e,t,d){wn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Va(e,d)}function El(e,t,d,l){var y=new Io(e,d,l),H=e.cm;return H&&y.noHScroll&&(H.display.alignWidgets=!0),Po(e,t,"widget",function($){var te=$.widgets||($.widgets=[]);if(y.insertAt==null?te.push(y):te.splice(Math.min(te.length-1,Math.max(0,y.insertAt)),0,y),y.line=$,H&&!Kt(e,$)){var oe=wn($)<e.scrollTop;Dn($,$.height+Br(y)),oe&&Va(H,y.height),H.curOp.forceUpdate=!0}return!0}),H&&Ct(H,"lineWidgetAdded",H,y,typeof t=="number"?t:Vn(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),se(this,"clear")){var d=this.find();d&&Ct(this,"clear",d.from,d.to)}for(var l=null,y=null,H=0;H<this.lines.length;++H){var $=this.lines[H],te=kn($.markedSpans,this);e&&!this.collapsed?Vr(e,Vn($),"text"):e&&(te.to!=null&&(y=Vn($)),te.from!=null&&(l=Vn($))),$.markedSpans=fn($.markedSpans,te),te.from==null&&this.collapsed&&!Kt(this.doc,$)&&e&&Dn($,Pr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var he=ot(this.lines[oe]),Ie=In(he);Ie>e.display.maxLineLength&&(e.display.maxLine=he,e.display.maxLineLength=Ie,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&Kr(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Ct(e,"markerCleared",e,this,l,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,l,y=0;y<this.lines.length;++y){var H=this.lines[y],$=kn(H.markedSpans,this);if($.from!=null&&(d=on(t?H:Vn(H),$.from),e==-1))return d;if($.to!=null&&(l=on(t?H:Vn(H),$.to),e==1))return l}return d&&{from:d,to:l}},qa.prototype.changed=function(){var e=this,t=this.find(-1,!0),d=this,l=this.doc.cm;if(!t||!l)return;Wi(l,function(){var y=t.line,H=Vn(t.line),$=qe(l,H);if($&&(ar($),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Kt(d.doc,y)&&d.height!=null){var te=d.height;d.height=null;var oe=Br(d)-te;oe&&Dn(y,y.height+oe)}Ct(l,"markerChanged",l,e)})},qa.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},qa.prototype.detachLine=function(e){if(this.lines.splice(ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},pe(qa);function Eo(e,t,d,l,y){if(l&&l.shared)return xl(e,t,d,l,y);if(e.cm&&!e.cm.curOp)return hi(e.cm,Eo)(e,t,d,l,y);var H=new qa(e,y),$=Jn(t,d);if(l&&w(l,H,!1),$>0||$==0&&H.clearWhenEmpty!==!1)return H;if(H.replacedWith&&(H.collapsed=!0,H.widgetNode=_("span",[H.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||H.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(H.widgetNode.insertLeft=!0)),H.collapsed){if(xt(e,t.line,t,d,H)||t.line!=d.line&&xt(e,d.line,t,d,H))throw new Error("Inserting collapsed marker partially overlapping an existing one");si()}H.addToHistory&&bs(e,{from:t,to:d,origin:"markText"},e.sel,NaN);var te=t.line,oe=e.cm,he;if(e.iter(te,d.line+1,function(Ke){oe&&H.collapsed&&!oe.options.lineWrapping&&ot(Ke)==oe.display.maxLine&&(he=!0),H.collapsed&&te!=t.line&&Dn(Ke,0),Tn(Ke,new kr(H,te==t.line?t.ch:null,te==d.line?d.ch:null)),++te}),H.collapsed&&e.iter(t.line,d.line+1,function(Ke){Kt(e,Ke)&&Dn(Ke,0)}),H.clearOnEnter&&He(H,"beforeCursorEnter",function(){return H.clear()}),H.readOnly&&(br(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),H.collapsed&&(H.id=++js,H.atomic=!0),oe){if(he&&(oe.curOp.updateMaxLine=!0),H.collapsed)Kr(oe,t.line,d.line+1);else if(H.className||H.startStyle||H.endStyle||H.css||H.attributes||H.title)for(var Ie=t.line;Ie<=d.line;Ie++)Vr(oe,Ie,"text");H.atomic&&Os(oe.doc),Ct(oe,"markerAdded",oe,H)}return H}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();Ct(this,"clear")},No.prototype.find=function(e,t){return this.primary.find(e,t)},pe(No);function xl(e,t,d,l,y){l=w(l),l.shared=!1;var H=[Eo(e,t,d,l,y)],$=H[0],te=l.widgetNode;return Ti(e,function(oe){te&&(l.widgetNode=te.cloneNode(!0)),H.push(Eo(oe,Yn(oe,t),Yn(oe,d),l,y));for(var he=0;he<oe.linked.length;++he)if(oe.linked[he].isParent)return;$=j(H)}),new No(H,$)}function Fs(e){return e.findMarks(on(e.first,0),e.clipPos(on(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var d=0;d<t.length;d++){var l=t[d],y=l.find(),H=e.clipPos(y.from),$=e.clipPos(y.to);if(Jn(H,$)){var te=Eo(e,H,$,l.primary,l.primary.type);l.markers.push(te),te.parent=l}}}function Cl(e){for(var t=function(l){var y=e[l],H=[y.primary.doc];Ti(y.primary.doc,function(oe){return H.push(oe)});for(var $=0;$<y.markers.length;$++){var te=y.markers[$];ce(H,te.doc)==-1&&(te.parent=null,y.markers.splice($--,1))}},d=0;d<e.length;d++)t(d)}var Tl=0,ea=function(e,t,d,l,y){if(!(this instanceof ea))return new ea(e,t,d,l,y);d==null&&(d=0),ko.call(this,[new Mo([new On("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var H=on(d,0);this.sel=Bn(H),this.history=new Go(null),this.id=++Tl,this.modeOption=t,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Wa(this,{from:H,to:H,text:e}),zi(this,Bn(H),Te)};ea.prototype=z(ko.prototype,{constructor:ea,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,l=0;l<t.length;++l)d+=t[l].height;this.insertInner(e-this.first,t,d)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ir(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:fi(function(e){var t=on(this.first,0),d=this.first+this.size-1;yo(this,{from:t,to:on(d,tn(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Ra(this.cm,0,0),zi(this,Bn(t),Te)}),replaceRange:function(e,t,d,l){t=Yn(this,t),d=d?Yn(this,d):t,bo(this,e,t,d,l)},getRange:function(e,t,d){var l=Hn(this,Yn(this,e),Yn(this,t));return d===!1?l:l.join(d||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Mr(this,e))return tn(this,e)},getLineNumber:function(e){return Vn(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=tn(this,e)),ot(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Yn(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:fi(function(e,t,d){Cs(this,Yn(this,typeof e=="number"?on(e,t||0):e),null,d)}),setSelection:fi(function(e,t,d){Cs(this,Yn(this,e),Yn(this,t||e),d)}),extendSelection:fi(function(e,t,d){Vo(this,Yn(this,e),t&&Yn(this,t),d)}),extendSelections:fi(function(e,t){ws(this,hn(this,e),t)}),extendSelectionsBy:fi(function(e,t){var d=K(this.sel.ranges,e);ws(this,hn(this,d),t)}),setSelections:fi(function(e,t,d){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new Nr(Yn(this,e[y].anchor),Yn(this,e[y].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),zi(this,gr(this.cm,l,t),d)}),addSelection:fi(function(e,t,d){var l=this.sel.ranges.slice(0);l.push(new Nr(Yn(this,e),Yn(this,t||e))),zi(this,gr(this.cm,l,l.length-1),d)}),getSelection:function(e){for(var t=this.sel.ranges,d,l=0;l<t.length;l++){var y=Hn(this,t[l].from(),t[l].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,l=0;l<d.length;l++){var y=Hn(this,d[l].from(),d[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),t[l]=y}return t},replaceSelection:function(e,t,d){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,t,d||"+input")},replaceSelections:fi(function(e,t,d){for(var l=[],y=this.sel,H=0;H<y.ranges.length;H++){var $=y.ranges[H];l[H]={from:$.from(),to:$.to(),text:this.splitLines(e[H]),origin:d}}for(var te=t&&t!="end"&&ia(this,l,t),oe=l.length-1;oe>=0;oe--)yo(this,l[oe]);te?Ts(this,te):this.cm&&_a(this.cm)}),undo:fi(function(){$o(this,"undo")}),redo:fi(function(){$o(this,"redo")}),undoSelection:fi(function(){$o(this,"undo",!0)}),redoSelection:fi(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,l=0;l<e.done.length;l++)e.done[l].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),Ti(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:fi(function(e,t,d){return Po(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[t]=d,!d&&le(y)&&(l.gutterMarkers=null),!0})}),clearGutter:fi(function(e){var t=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[e]&&Po(t,d,"gutter",function(){return d.gutterMarkers[e]=null,le(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Mr(this,e))return null;if(t=e,e=tn(this,e),!e)return null}else if(t=Vn(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:fi(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=d;else{if(T(d).test(l[y]))return!1;l[y]+=" "+d}return!0})}),removeLineClass:fi(function(e,t,d){return Po(this,e,t=="gutter"?"gutter":"class",function(l){var y=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",H=l[y];if(H)if(d==null)l[y]=null;else{var $=H.match(T(d));if(!$)return!1;var te=$.index+$[0].length;l[y]=H.slice(0,$.index)+(!$.index||te==H.length?"":" ")+H.slice(te)||null}else return!1;return!0})}),addLineWidget:fi(function(e,t,d){return El(this,e,t,d)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,d){return Eo(this,Yn(this,e),Yn(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=Yn(this,e),Eo(this,e,e,d,"bookmark")},findMarksAt:function(e){e=Yn(this,e);var t=[],d=tn(this,e.line).markedSpans;if(d)for(var l=0;l<d.length;++l){var y=d[l];(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=Yn(this,e),t=Yn(this,t);var l=[],y=e.line;return this.iter(e.line,t.line+1,function(H){var $=H.markedSpans;if($)for(var te=0;te<$.length;te++){var oe=$[te];!(oe.to!=null&&y==e.line&&e.ch>=oe.to||oe.from==null&&y!=e.line||oe.from!=null&&y==t.line&&oe.from>=t.ch)&&(!d||d(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(t){var d=t.markedSpans;if(d)for(var l=0;l<d.length;++l)d[l].from!=null&&e.push(d[l].marker)}),e},posFromIndex:function(e){var t,d=this.first,l=this.lineSeparator().length;return this.iter(function(y){var H=y.text.length+l;if(H>e)return t=e,!0;e-=H,++d}),Yn(this,on(d,t))},indexFromPos:function(e){e=Yn(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(l){t+=l.text.length+d}),t},copy:function(e){var t=new ea(ir(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 l=new ea(ir(this,t,d),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(l,Fs(this)),l},unlinkDoc:function(e){if(e instanceof pi&&(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 l=[e.id];Ti(e,function(y){return l.push(y.id)},!0),e.history=new Go(null),e.history.done=vo(this.history.done,l),e.history.undone=vo(this.history.undone,l)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ht(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:fi(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)})}),ea.prototype.eachLine=ea.prototype.iter;var Bs=0;function Sl(e){var t=this;if(Hs(t),ee(t,e)||li(t.display,e))return;ae(e),W&&(Bs=+new Date);var d=Ci(t,e,!0),l=e.dataTransfer.files;if(!d||t.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,H=Array(y),$=0,te=function(){++$==y&&hi(t,function(){d=Yn(t.doc,d);var ft={from:d,to:d,text:t.doc.splitLines(H.filter(function(Jt){return Jt!=null}).join(t.doc.lineSeparator())),origin:"paste"};yo(t.doc,ft),Ts(t.doc,Bn(Yn(t.doc,d),Yn(t.doc,nr(ft))))})()},oe=function(ft,Jt){if(t.options.allowDropFileTypes&&ce(t.options.allowDropFileTypes,ft.type)==-1){te();return}var _n=new FileReader;_n.onerror=function(){return te()},_n.onload=function(){var Mn=_n.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Mn)){te();return}H[Jt]=Mn,te()},_n.readAsText(ft)},he=0;he<l.length;he++)oe(l[he],he);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 Ie=e.dataTransfer.getData("Text");if(Ie){var Ke;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ke=t.listSelections()),Yo(t.doc,Bn(d,d)),Ke)for(var _t=0;_t<Ke.length;++_t)bo(t.doc,"",Ke[_t].anchor,Ke[_t].head,"drag");t.replaceSelection(Ie,"around","paste"),t.display.input.focus()}}catch(ft){}}}function Ol(e,t){if(W&&(!e.state.draggingText||+new Date-Bs<100)){ye(t);return}if(ee(e,t)||li(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!m){var d=h("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),t.dataTransfer.setDragImage(d,0,0),p&&d.parentNode.removeChild(d)}}function Rl(e,t){var d=Ci(e,t);if(!d)return;var l=document.createDocumentFragment();Zi(e,d,l),e.display.dragCursor||(e.display.dragCursor=h("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),f(e.display.dragCursor,l)}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=[],l=0;l<t.length;l++){var y=t[l].CodeMirror;y&&d.push(y)}d.length&&d[0].operation(function(){for(var H=0;H<d.length;H++)e(d[H])})}var Ks=!1;function Al(){if(Ks)return;Dl(),Ks=!0}function Dl(){var e;He(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Ll)},100))}),He(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,l,y,H,$=0;$<t.length-1;$++){var te=t[$];if(/^(cmd|meta|m)$/i.test(te))H=!0;else if(/^a(lt)?$/i.test(te))d=!0;else if(/^(c|ctrl|control)$/i.test(te))l=!0;else if(/^s(hift)?$/i.test(te))y=!0;else throw new Error("Unrecognized modifier name: "+te)}return d&&(e="Alt-"+e),l&&(e="Ctrl-"+e),H&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function Ml(e){var t={};for(var d in e)if(e.hasOwnProperty(d)){var l=e[d];if(/^(name|fallthrough|(de|at)tach)$/.test(d))continue;if(l=="..."){delete e[d];continue}for(var y=K(d.split(" "),Pl),H=0;H<y.length;H++){var $=void 0,te=void 0;H==y.length-1?(te=y.join(" "),$=l):(te=y.slice(0,H+1).join(" "),$="...");var oe=t[te];if(!oe)t[te]=$;else if(oe!=$)throw new Error("Inconsistent bindings for "+te)}delete e[d]}for(var he in t)e[he]=t[he];return e}function xo(e,t,d,l){t=Qo(t);var y=t.call?t.call(e,l):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,l);for(var H=0;H<t.fallthrough.length;H++){var $=xo(e,t.fallthrough[H],d,l);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 l=e;return t.altKey&&l!="Alt"&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!d&&t.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function Vs(e,t){if(p&&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,l=[],y=0;y<d.length;y++){for(var H=t(d[y]);l.length&&Jn(H.from,j(l).to)<=0;){var $=l.pop();if(Jn($.from,H.from)<0){H.from=$.from;break}}l.push(H)}Wi(e,function(){for(var te=l.length-1;te>=0;te--)bo(e.doc,"",l[te].from,l[te].to,"+delete");_a(e)})}function os(e,t,d){var l=Ye(e.text,t+d,d);return l<0||l>e.text.length?null:l}function ss(e,t,d){var l=os(e,t.ch,d);return l==null?null:new on(t.line,l,d<0?"after":"before")}function ls(e,t,d,l,y){if(e){t.doc.direction=="rtl"&&(y=-y);var H=vn(d,t.doc.direction);if(H){var $=y<0?j(H):H[0],te=y<0==($.level==1),oe=te?"after":"before",he;if($.level>0||t.doc.direction=="rtl"){var Ie=Ne(t,d);he=y<0?d.text.length-1:0;var Ke=st(t,Ie,he).top;he=Tt(function(_t){return st(t,Ie,_t).top==Ke},y<0==($.level==1)?$.from:$.to-1,he),oe=="before"&&(he=os(d,he,1))}else he=y<0?$.to:$.from;return new on(l,he,oe)}}return new on(l,y<0?d.text.length:0,y<0?"before":"after")}function kl(e,t,d,l){var y=vn(t,e.doc.direction);if(!y)return ss(t,d,l);d.ch>=t.text.length?(d.ch=t.text.length,d.sticky="before"):d.ch<=0&&(d.ch=0,d.sticky="after");var H=tt(y,d.ch,d.sticky),$=y[H];if(e.doc.direction=="ltr"&&$.level%2==0&&(l>0?$.to>d.ch:$.from<d.ch))return ss(t,d,l);var te=function(jn,Gn){return os(t,jn instanceof on?jn.ch:jn,Gn)},oe,he=function(jn){return e.options.lineWrapping?(oe=oe||Ne(e,t),Xn(e,t,oe,jn)):{begin:0,end:t.text.length}},Ie=he(d.sticky=="before"?te(d,-1):d.ch);if(e.doc.direction=="rtl"||$.level==1){var Ke=$.level==1==l<0,_t=te(d,Ke?1:-1);if(_t!=null&&(Ke?_t<=$.to&&_t<=Ie.end:_t>=$.from&&_t>=Ie.begin)){var ft=Ke?"before":"after";return new on(d.line,_t,ft)}}var Jt=function(jn,Gn,Fn){for(var $n=function(ni,ji){return ji?new on(d.line,te(ni,1),"before"):new on(d.line,ni,"after")};jn>=0&&jn<y.length;jn+=Gn){var mr=y[jn],cr=Gn>0==(mr.level!=1),Ar=cr?Fn.begin:te(Fn.end,-1);if(mr.from<=Ar&&Ar<mr.to)return $n(Ar,cr);if(Ar=cr?mr.from:te(mr.to,-1),Fn.begin<=Ar&&Ar<Fn.end)return $n(Ar,cr)}},_n=Jt(H+l,l,Ie);if(_n)return _n;var Mn=l>0?Ie.end:te(Ie.begin,-1);return Mn!=null&&!(l>0&&Mn==t.text.length)&&(_n=Jt(l>0?0:y.length-1,l,he(Mn)),_n)?_n:null}var Fo={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Te)},killLine:function(e){return wo(e,function(t){if(t.empty()){var d=tn(e.doc,t.head.line).text.length;return t.head.ch==d&&t.head.line<e.lastLine()?{from:t.head,to:on(t.head.line+1,0)}:{from:t.head,to:on(t.head.line,d)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return wo(e,function(t){return{from:on(t.from().line,0),to:Yn(e.doc,on(t.to().line+1,0))}})},delLineLeft:function(e){return wo(e,function(t){return{from:on(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return{from:l,to:t.from()}})},delWrappedLineRight:function(e){return wo(e,function(t){var d=e.charCoords(t.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div");return{from:t.from(),to:l}})},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(on(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(on(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")},$e)},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")},$e)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var d=e.cursorCoords(t.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return l.ch<e.getLine(l.line).search(/\S/)?Xs(e,t.head):l},$e)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],d=e.listSelections(),l=e.options.tabSize,y=0;y<d.length;y++){var H=d[y].from(),$=Y(e.getLine(H.line),H.ch,l);t.push(X(l-$%l))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Wi(e,function(){for(var t=e.listSelections(),d=[],l=0;l<t.length;l++){if(!t[l].empty())continue;var y=t[l].head,H=tn(e.doc,y.line).text;if(H){if(y.ch==H.length&&(y=new on(y.line,y.ch-1)),y.ch>0)y=new on(y.line,y.ch+1),e.replaceRange(H.charAt(y.ch-1)+H.charAt(y.ch-2),on(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var $=tn(e.doc,y.line-1).text;$&&(y=new on(y.line,1),e.replaceRange(H.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),on(y.line-1,$.length-1),y,"+transpose"))}}d.push(new Nr(y,y))}e.setSelections(d)})},newlineAndIndent:function(e){return Wi(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 l=0;l<t.length;l++)e.indentLine(t[l].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=tn(e.doc,t),l=ot(d);return l!=d&&(t=Vn(l)),ls(!0,e,l,t,1)}function Il(e,t){var d=tn(e.doc,t),l=ut(d);return l!=d&&(t=Vn(l)),ls(!0,e,d,t,-1)}function Xs(e,t){var d=Ys(e,t.line),l=tn(e.doc,d.line),y=vn(l,e.doc.direction);if(!y||y[0].level==0){var H=Math.max(d.ch,l.text.search(/\S/)),$=t.line==d.line&&t.ch<=H&&t.ch;return on(d.line,$?0:H,d.sticky)}return d}function Zo(e,t,d){if(typeof t=="string"&&(t=Fo[t],!t))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),y=t(e)!=Qe}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Nl(e,t,d){for(var l=0;l<e.state.keyMaps.length;l++){var y=xo(t,e.state.keyMaps[l],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,l){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,l))return!0}return $s(e,t,d,l)}function $s(e,t,d,l){var y=Nl(e,t,l);return y=="multi"&&(e.state.keySeq=t),y=="handled"&&Ct(e,"keyHandled",e,t,d),(y=="handled"||y=="multi")&&(ae(d),yi(e)),!!y}function Js(e,t){var d=Vs(t,!0);return d?t.shiftKey&&!e.state.keySeq?Bo(e,"Shift-"+d,t,function(l){return Zo(e,l,!0)})||Bo(e,d,t,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return Zo(e,l)}):Bo(e,d,t,function(l){return Zo(e,l)}):!1}function jl(e,t,d){return Bo(e,"'"+d+"'",t,function(l){return Zo(e,l,!0)})}var us=null;function Qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=N(),ee(t,e))return;W&&k<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;t.display.shift=d==16||e.shiftKey;var l=Js(t,e);p&&(us=l?d:null,!l&&d==88&&!it&&(i?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),I&&!i&&!l&&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;F(t,"CodeMirror-crosshair");function d(l){(l.keyCode==18||!l.altKey)&&(v(t,"CodeMirror-crosshair"),Rt(document,"keyup",d),Rt(document,"mouseover",d))}He(document,"keyup",d),He(document,"mouseover",d)}function Zs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ee(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(li(t.display,e)||ee(t,e)||e.ctrlKey&&!e.altKey||i&&e.metaKey)return;var d=e.keyCode,l=e.charCode;if(p&&d==us){us=null,ae(e);return}if(p&&(!e.which||e.which<10)&&Js(t,e))return;var y=String.fromCharCode(l==null?d:l);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&&Jn(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(ee(t,e)||d.activeTouch&&d.input.supportsTouch())return;if(d.input.ensurePolled(),d.shift=e.shiftKey,li(d,e)){r||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100));return}if(ds(t,e))return;var l=Ci(t,e),y=De(e),H=l?Hl(l,y):"single";if(window.focus(),y==1&&t.state.selectingText&&t.state.selectingText(e),l&&Wl(t,y,l,H,e))return;y==1?l?Gl(t,l,H,e):xe(e)==d.scroller&&ae(e):y==2?(l&&Vo(t.doc,l),setTimeout(function(){return d.input.focus()},20)):y==3&&(R?t.display.input.onContextMenu(e):no(t))}function Wl(e,t,d,l,y){var H="Click";return l=="double"?H="Double"+H:l=="triple"&&(H="Triple"+H),H=(t==1?"Left":t==2?"Middle":"Right")+H,Bo(e,zs(H,y),y,function($){if(typeof $=="string"&&($=Fo[$]),!$)return!1;var te=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),te=$(e,d)!=Qe}finally{e.state.suppressEdits=!1}return te})}function Kl(e,t,d){var l=e.getOption("configureMouse"),y=l?l(e,t,d):{};if(y.unit==null){var H=n?d.shiftKey&&d.metaKey:d.altKey;y.unit=H?"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,l){W?setTimeout(U(Ma,e),0):e.curOp.focus=N();var y=Kl(e,d,l),H=e.doc.sel,$;e.options.dragDrop&&ct&&!e.isReadOnly()&&d=="single"&&($=H.contains(t))>-1&&(Jn(($=H.ranges[$]).from(),t)<0||t.xRel>0)&&(Jn($.to(),t)>0||t.xRel<0)?zl(e,l,t,y):Vl(e,l,t,y)}function zl(e,t,d,l){var y=e.display,H=!1,$=hi(e,function(he){r&&(y.scroller.draggable=!1),e.state.draggingText=!1,Rt(y.wrapper.ownerDocument,"mouseup",$),Rt(y.wrapper.ownerDocument,"mousemove",te),Rt(y.scroller,"dragstart",oe),Rt(y.scroller,"drop",$),H||(ae(he),l.addNew||Vo(e.doc,d,null,null,l.extend),r&&!m||W&&k==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),te=function(he){H=H||Math.abs(t.clientX-he.clientX)+Math.abs(t.clientY-he.clientY)>=10},oe=function(){return H=!0};r&&(y.scroller.draggable=!0),e.state.draggingText=$,$.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),He(y.wrapper.ownerDocument,"mouseup",$),He(y.wrapper.ownerDocument,"mousemove",te),He(y.scroller,"dragstart",oe),He(y.scroller,"drop",$),no(e),setTimeout(function(){return y.input.focus()},20)}function tl(e,t,d){if(d=="char")return new Nr(t,t);if(d=="word")return e.findWordAt(t);if(d=="line")return new Nr(on(t.line,0),Yn(e.doc,on(t.line+1,0)));var l=d(e,t);return new Nr(l.from,l.to)}function Vl(e,t,d,l){var y=e.display,H=e.doc;ae(t);var $,te,oe=H.sel,he=oe.ranges;if(l.addNew&&!l.extend?(te=H.sel.contains(d),te>-1?$=he[te]:$=new Nr(d,d)):($=H.sel.primary(),te=H.sel.primIndex),l.unit=="rectangle")l.addNew||($=new Nr(d,d)),d=Ci(e,t,!0,!0),te=-1;else{var Ie=tl(e,d,l.unit);l.extend?$=is($,Ie.anchor,Ie.head,l.extend):$=Ie}l.addNew?te==-1?(te=he.length,zi(H,gr(e,he.concat([$]),te),{scroll:!1,origin:"*mouse"})):he.length>1&&he[te].empty()&&l.unit=="char"&&!l.extend?(zi(H,gr(e,he.slice(0,te).concat(he.slice(te+1)),0),{scroll:!1,origin:"*mouse"}),oe=H.sel):as(H,te,$,We):(te=0,zi(H,new Ki([$],0),We),oe=H.sel);var Ke=d;function _t(Fn){if(Jn(Ke,Fn)==0)return;if(Ke=Fn,l.unit=="rectangle"){for(var $n=[],mr=e.options.tabSize,cr=Y(tn(H,d.line).text,d.ch,mr),Ar=Y(tn(H,Fn.line).text,Fn.ch,mr),ni=Math.min(cr,Ar),ji=Math.max(cr,Ar),vi=Math.min(d.line,Fn.line),aa=Math.min(e.lastLine(),Math.max(d.line,Fn.line));vi<=aa;vi++){var ta=tn(H,vi).text,Li=Je(ta,ni,mr);ni==ji?$n.push(new Nr(on(vi,Li),on(vi,Li))):ta.length>Li&&$n.push(new Nr(on(vi,Li),on(vi,Je(ta,ji,mr))))}$n.length||$n.push(new Nr(d,d)),zi(H,gr(e,oe.ranges.slice(0,te).concat($n),te),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Fn)}else{var na=$,Gi=tl(e,Fn,l.unit),ki=na.anchor,Pi;Jn(Gi.anchor,ki)>0?(Pi=Gi.head,ki=Yr(na.from(),Gi.anchor)):(Pi=Gi.anchor,ki=Jr(na.to(),Gi.head));var Ei=oe.ranges.slice(0);Ei[te]=Yl(e,new Nr(Yn(H,ki),Pi)),zi(H,gr(e,Ei,te),We)}}var ft=y.wrapper.getBoundingClientRect(),Jt=0;function _n(Fn){var $n=++Jt,mr=Ci(e,Fn,!0,l.unit=="rectangle");if(!mr)return;if(Jn(mr,Ke)!=0){e.curOp.focus=N(),_t(mr);var cr=ka(y,H);(mr.line>=cr.to||mr.line<cr.from)&&setTimeout(hi(e,function(){Jt==$n&&_n(Fn)}),150)}else{var Ar=Fn.clientY<ft.top?-20:Fn.clientY>ft.bottom?20:0;Ar&&setTimeout(hi(e,function(){if(Jt!=$n)return;y.scroller.scrollTop+=Ar,_n(Fn)}),50)}}function Mn(Fn){e.state.selectingText=!1,Jt=Infinity,Fn&&(ae(Fn),y.input.focus()),Rt(y.wrapper.ownerDocument,"mousemove",jn),Rt(y.wrapper.ownerDocument,"mouseup",Gn),H.history.lastSelOrigin=null}var jn=hi(e,function(Fn){Fn.buttons===0||!De(Fn)?Mn(Fn):_n(Fn)}),Gn=hi(e,Mn);e.state.selectingText=Gn,He(y.wrapper.ownerDocument,"mousemove",jn),He(y.wrapper.ownerDocument,"mouseup",Gn)}function Yl(e,t){var d=t.anchor,l=t.head,y=tn(e.doc,d.line);if(Jn(d,l)==0&&d.sticky==l.sticky)return t;var H=vn(y);if(!H)return t;var $=tt(H,d.ch,d.sticky),te=H[$];if(te.from!=d.ch&&te.to!=d.ch)return t;var oe=$+(te.from==d.ch==(te.level!=1)?0:1);if(oe==0||oe==H.length)return t;var he;if(l.line!=d.line)he=(l.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ie=tt(H,l.ch,l.sticky),Ke=Ie-$||(l.ch-d.ch)*(te.level==1?-1:1);Ie==oe-1||Ie==oe?he=Ke<0:he=Ke>0}var _t=H[oe+(he?-1:0)],ft=he==(_t.level==1),Jt=ft?_t.from:_t.to,_n=ft?"after":"before";return d.ch==Jt&&d.sticky==_n?t:new Nr(new on(d.line,Jt,_n),l)}function nl(e,t,d,l){var y,H;if(t.touches)y=t.touches[0].clientX,H=t.touches[0].clientY;else try{y=t.clientX,H=t.clientY}catch(_t){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ae(t);var $=e.display,te=$.lineDiv.getBoundingClientRect();if(H>te.bottom||!se(e,d))return me(t);H-=te.top-$.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var he=$.gutters.childNodes[oe];if(he&&he.getBoundingClientRect().right>=y){var Ie=qn(e.doc,H),Ke=e.display.gutterSpecs[oe];return de(e,d,e,Ie,Ke.className,t),me(t)}}}function ds(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(li(e.display,t)||Xl(e,t))return;if(ee(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Xl(e,t){return se(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-"),fr(e)}var Co={toString:function(){return"CodeMirror.Init"}},al={},qo={};function $l(e){var t=e.optionHandlers;function d(l,y,H,$){e.defaults[l]=y,H&&(t[l]=$?function(te,oe,he){he!=Co&&H(te,oe,he)}:H)}e.defineOption=d,e.Init=Co,d("value","",function(l,y){return l.setValue(y)},!0),d("mode",null,function(l,y){l.doc.modeOption=y,Di(l)},!0),d("indentUnit",2,Di,!0),d("indentWithTabs",!1),d("smartIndent",!0),d("tabSize",4,function(l){Yi(l),fr(l),Kr(l)},!0),d("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var H=[],$=l.doc.first;l.doc.iter(function(oe){for(var he=0;;){var Ie=oe.text.indexOf(y,he);if(Ie==-1)break;he=Ie+y.length,H.push(on($,Ie))}$++});for(var te=H.length-1;te>=0;te--)bo(l.doc,y,H[te],on(H[te].line,H[te].ch+y.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,H){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),H!=Co&&l.refresh()}),d("specialCharPlaceholder",bn,function(l){return l.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(l,y){return l.getInputField().spellcheck=y},!0),d("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),d("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),d("rtlMoveVisually",!O),d("wholeLineUpdateBefore",!0),d("theme","default",function(l){il(l),ca(l)},!0),d("keyMap","default",function(l,y,H){var $=Qo(y),te=H!=Co&&Qo(H);te&&te.detach&&te.detach(l,$),$.attach&&$.attach(l,te||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,Ql,!0),d("gutters",[],function(l,y){l.display.gutterSpecs=Ui(y,l.options.lineNumbers),ca(l)},!0),d("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?ci(l.display)+"px":"0",l.refresh()},!0),d("coverGutterNextToScrollbar",!1,function(l){return ma(l)},!0),d("scrollbarStyle","native",function(l){Ja(l),ma(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),d("lineNumbers",!1,function(l,y){l.display.gutterSpecs=Ui(l.options.gutters,y),ca(l)},!0),d("firstLineNumber",1,ca,!0),d("lineNumberFormatter",function(l){return l},ca,!0),d("showCursorWhenSelecting",!1,Gr,!0),d("resetSelectionOnContextMenu",!0),d("lineWiseCopyCut",!0),d("pasteLinesPerSelection",!0),d("selectionsMayTouch",!1),d("readOnly",!1,function(l,y){y=="nocursor"&&(Ca(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),d("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),d("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),d("dragDrop",!0,Jl),d("allowDropFileTypes",null),d("cursorBlinkRate",530),d("cursorScrollMargin",0),d("cursorHeight",1,Gr,!0),d("singleCursorHeightPerLine",!0,Gr,!0),d("workTime",100),d("workDelay",100),d("flattenSpans",!0,Yi,!0),d("addModeClass",!1,Yi,!0),d("pollInterval",100),d("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),d("historyEventDelay",1250),d("viewportMargin",10,function(l){return l.refresh()},!0),d("maxHighlightLength",1e4,Yi,!0),d("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),d("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),d("autofocus",null),d("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),d("phrases",null)}function Jl(e,t,d){var l=d&&d!=Co;if(!t!=!l){var y=e.display.dragFunctions,H=t?He:Rt;H(e.display.scroller,"dragstart",y.start),H(e.display.scroller,"dragenter",y.enter),H(e.display.scroller,"dragover",y.over),H(e.display.scroller,"dragleave",y.leave),H(e.display.scroller,"drop",y.drop)}}function Ql(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(v(e.display.wrapper,"CodeMirror-wrap"),yn(e)),Ii(e),Kr(e),fr(e),setTimeout(function(){return ma(e)},100)}function pi(e,t){var d=this;if(!(this instanceof pi))return new pi(e,t);this.options=t=t?w(t):{},w(al,t,!1);var l=t.value;typeof l=="string"?l=new ea(l,t.mode,null,t.lineSeparator,t.direction):t.mode&&(l.modeOption=t.mode),this.doc=l;var y=new pi.inputStyles[t.inputStyle](this),H=this.display=new ja(e,l,y,t);H.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&&H.input.focus(),W&&k<11&&setTimeout(function(){return d.display.input.reset(!0)},20),Zl(this),Al(),ua(this),this.curOp.forceUpdate=!0,vs(this,l),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);ai(this),t.finishInit&&t.finishInit(this);for(var te=0;te<hs.length;++te)hs[te](this);Ea(this),r&&t.lineWrapping&&getComputedStyle(H.lineDiv).textRendering=="optimizelegibility"&&(H.lineDiv.style.textRendering="auto")}pi.defaults=al,pi.optionHandlers=qo;function Zl(e){var t=e.display;He(t.scroller,"mousedown",hi(e,el)),W&&k<11?He(t.scroller,"dblclick",hi(e,function(oe){if(ee(e,oe))return;var he=Ci(e,oe);if(!he||ds(e,oe)||li(e.display,oe))return;ae(oe);var Ie=e.findWordAt(he);Vo(e.doc,Ie.anchor,Ie.head)})):He(t.scroller,"dblclick",function(oe){return ee(e,oe)||ae(oe)}),He(t.scroller,"contextmenu",function(oe){return rl(e,oe)}),He(t.input.getField(),"contextmenu",function(oe){t.scroller.contains(oe.target)||rl(e,oe)});var d,l={end:0};function y(){t.activeTouch&&(d=setTimeout(function(){return t.activeTouch=null},1e3),l=t.activeTouch,l.end=+new Date)}function H(oe){if(oe.touches.length!=1)return!1;var he=oe.touches[0];return he.radiusX<=1&&he.radiusY<=1}function $(oe,he){if(he.left==null)return!0;var Ie=he.left-oe.left,Ke=he.top-oe.top;return Ie*Ie+Ke*Ke>20*20}He(t.scroller,"touchstart",function(oe){if(!ee(e,oe)&&!H(oe)&&!ds(e,oe)){t.input.ensurePolled(),clearTimeout(d);var he=+new Date;t.activeTouch={start:he,moved:!1,prev:he-l.end<=300?l:null},oe.touches.length==1&&(t.activeTouch.left=oe.touches[0].pageX,t.activeTouch.top=oe.touches[0].pageY)}}),He(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),He(t.scroller,"touchend",function(oe){var he=t.activeTouch;if(he&&!li(t,oe)&&he.left!=null&&!he.moved&&new Date-he.start<300){var Ie=e.coordsChar(t.activeTouch,"page"),Ke;!he.prev||$(he,he.prev)?Ke=new Nr(Ie,Ie):!he.prev.prev||$(he,he.prev.prev)?Ke=e.findWordAt(Ie):Ke=new Nr(on(Ie.line,0),Yn(e.doc,on(Ie.line+1,0))),e.setSelection(Ke.anchor,Ke.head),e.focus(),ae(oe)}y()}),He(t.scroller,"touchcancel",y),He(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Da(e,t.scroller.scrollTop),Mi(e,t.scroller.scrollLeft,!0),de(e,"scroll",e))}),He(t.scroller,"mousewheel",function(oe){return Ha(e,oe)}),He(t.scroller,"DOMMouseScroll",function(oe){return Ha(e,oe)}),He(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(oe){ee(e,oe)||ye(oe)},over:function(oe){ee(e,oe)||(Rl(e,oe),ye(oe))},start:function(oe){return Ol(e,oe)},drop:hi(e,Sl),leave:function(oe){ee(e,oe)||Hs(e)}};var te=t.input.getField();He(te,"keyup",function(oe){return Zs.call(e,oe)}),He(te,"keydown",hi(e,Qs)),He(te,"keypress",hi(e,qs)),He(te,"focus",function(oe){return la(e,oe)}),He(te,"blur",function(oe){return Ca(e,oe)})}var hs=[];pi.defineInitHook=function(e){return hs.push(e)};function Ko(e,t,d,l){var y=e.doc,H;d==null&&(d="add"),d=="smart"&&(y.mode.indent?H=ri(e,t).state:d="prev");var $=e.options.tabSize,te=tn(y,t),oe=Y(te.text,null,$);te.stateAfter&&(te.stateAfter=null);var he=te.text.match(/^\s*/)[0],Ie;if(!l&&!/\S/.test(te.text))Ie=0,d="not";else if(d=="smart"&&(Ie=y.mode.indent(H,te.text.slice(he.length),te.text),Ie==Qe||Ie>150)){if(!l)return;d="prev"}d=="prev"?t>y.first?Ie=Y(tn(y,t-1).text,null,$):Ie=0:d=="add"?Ie=oe+e.options.indentUnit:d=="subtract"?Ie=oe-e.options.indentUnit:typeof d=="number"&&(Ie=oe+d),Ie=Math.max(0,Ie);var Ke="",_t=0;if(e.options.indentWithTabs)for(var ft=Math.floor(Ie/$);ft;--ft)_t+=$,Ke+=" ";if(_t<Ie&&(Ke+=X(Ie-_t)),Ke!=he)return bo(y,Ke,on(t,0),on(t,he.length),"+input"),te.stateAfter=null,!0;for(var Jt=0;Jt<y.sel.ranges.length;Jt++){var _n=y.sel.ranges[Jt];if(_n.head.line==t&&_n.head.ch<he.length){var Mn=on(t,he.length);as(y,Jt,new Nr(Mn,Mn));break}}}var wa=null;function es(e){wa=e}function fs(e,t,d,l,y){var H=e.doc;e.display.shift=!1,l||(l=H.sel);var $=+new Date-200,te=y=="paste"||e.state.pasteIncoming>$,oe=ht(t),he=null;if(te&&l.ranges.length>1)if(wa&&wa.text.join(`
`)==t){if(l.ranges.length%wa.text.length==0){he=[];for(var Ie=0;Ie<wa.text.length;Ie++)he.push(H.splitLines(wa.text[Ie]))}}else oe.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(he=K(oe,function(jn){return[jn]}));for(var Ke=e.curOp.updateInput,_t=l.ranges.length-1;_t>=0;_t--){var ft=l.ranges[_t],Jt=ft.from(),_n=ft.to();ft.empty()&&(d&&d>0?Jt=on(Jt.line,Jt.ch-d):e.state.overwrite&&!te?_n=on(_n.line,Math.min(tn(H,_n.line).text.length,_n.ch+j(oe).length)):te&&wa&&wa.lineWise&&wa.text.join(`
`)==oe.join(`
`)&&(Jt=_n=on(Jt.line,0)));var Mn={from:Jt,to:_n,text:he?he[_t%he.length]:oe,origin:y||(te?"paste":e.state.cutIncoming>$?"cut":"+input")};yo(e.doc,Mn),Ct(e,"inputRead",e,Mn)}t&&!te&&sl(e,t),_a(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ke),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&&Wi(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,l=d.ranges.length-1;l>=0;l--){var y=d.ranges[l];if(y.head.ch>100||l&&d.ranges[l-1].head.line==y.head.line)continue;var H=e.getModeAt(y.head),$=!1;if(H.electricChars){for(var te=0;te<H.electricChars.length;te++)if(t.indexOf(H.electricChars.charAt(te))>-1){$=Ko(e,y.head.line,"smart");break}}else H.electricInput&&(H.electricInput.test(tn(e.doc,y.head.line).text.slice(0,y.head.ch))&&($=Ko(e,y.head.line,"smart")));$&&Ct(e,"electricInput",e,y.head.line)}}function ll(e){for(var t=[],d=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,H={anchor:on(y,0),head:on(y+1,0)};d.push(H),t.push(e.getRange(H.anchor,H.head))}return{text:t,ranges:d}}function ul(e,t,d,l){e.setAttribute("autocorrect",d?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=h("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=h("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),o&&(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(l,y){var H=this.options,$=H[l];if(H[l]==y&&l!="mode")return;H[l]=y,t.hasOwnProperty(l)&&hi(this,t[l])(this,y,$),de(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](Qo(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,H=0;H<y.length;++H)if(y[H]==l||y[H].name==l)return y.splice(H,1),!0},addOverlay:Ai(function(l,y){var H=l.token?l:e.getMode(this.options,l);if(H.startState)throw new Error("Overlays may not be stateful.");Q(this.state.overlays,{mode:H,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function($){return $.priority}),this.state.modeGen++,Kr(this)}),removeOverlay:Ai(function(l){for(var y=this.state.overlays,H=0;H<y.length;++H){var $=y[H].modeSpec;if($==l||typeof l=="string"&&$.name==l){y.splice(H,1),this.state.modeGen++,Kr(this);return}}}),indentLine:Ai(function(l,y,H){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),Mr(this.doc,l)&&Ko(this,l,y,H)}),indentSelection:Ai(function(l){for(var y=this.doc.sel.ranges,H=-1,$=0;$<y.length;$++){var te=y[$];if(te.empty())te.head.line>H&&(Ko(this,te.head.line,l,!0),H=te.head.line,$==this.doc.sel.primIndex&&_a(this));else{var oe=te.from(),he=te.to(),Ie=Math.max(H,oe.line);H=Math.min(this.lastLine(),he.line-(he.ch?0:1))+1;for(var Ke=Ie;Ke<H;++Ke)Ko(this,Ke,l);var _t=this.doc.sel.ranges;oe.ch==0&&y.length==_t.length&&_t[$].from().ch>0&&as(this.doc,$,new Nr(oe,_t[$].to()),Te)}}}),getTokenAt:function(l,y){return Oi(this,l,y)},getLineTokens:function(l,y){return Oi(this,on(l),y,!0)},getTokenTypeAt:function(l){l=Yn(this.doc,l);var y=gi(this,tn(this.doc,l.line)),H=0,$=(y.length-1)/2,te=l.ch,oe;if(te==0)oe=y[2];else for(;;){var he=H+$>>1;if((he?y[he*2-1]:0)>=te)$=he;else if(y[he*2+1]<te)H=he+1;else{oe=y[he*2+2];break}}var Ie=oe?oe.indexOf("overlay "):-1;return Ie<0?oe:Ie==0?null:oe.slice(0,Ie-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var H=[];if(!d.hasOwnProperty(y))return H;var $=d[y],te=this.getModeAt(l);if(typeof te[y]=="string")$[te[y]]&&H.push($[te[y]]);else if(te[y])for(var oe=0;oe<te[y].length;oe++){var he=$[te[y][oe]];he&&H.push(he)}else te.helperType&&$[te.helperType]?H.push($[te.helperType]):$[te.name]&&H.push($[te.name]);for(var Ie=0;Ie<$._global.length;Ie++){var Ke=$._global[Ie];Ke.pred(te,this)&&ce(H,Ke.val)==-1&&H.push(Ke.val)}return H},getStateAfter:function(l,y){var H=this.doc;return l=Lr(H,l==null?H.first+H.size-1:l),ri(this,l+1,y).state},cursorCoords:function(l,y){var H,$=this.doc.sel.primary();return l==null?H=$.head:typeof l=="object"?H=Yn(this.doc,l):H=l?$.from():$.to(),pn(this,H,y||"page")},charCoords:function(l,y){return Yt(this,Yn(this.doc,l),y||"page")},coordsChar:function(l,y){return l=ln(this,l,y||"page"),or(this,l.left,l.top)},lineAtHeight:function(l,y){return l=ln(this,{top:l,left:0},y||"page").top,qn(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,H){var $=!1,te;if(typeof l=="number"){var oe=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>oe&&(l=oe,$=!0),te=tn(this.doc,l)}else te=l;return Er(this,te,{top:0,left:0},y||"page",H||$).top+($?this.doc.height-wn(te):0)},defaultTextHeight:function(){return Pr(this.display)},defaultCharWidth:function(){return Dr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,H,$,te){var oe=this.display;l=pn(this,Yn(this.doc,l));var he=l.bottom,Ie=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),oe.sizer.appendChild(y),$=="over")he=l.top;else if($=="above"||$=="near"){var Ke=Math.max(oe.wrapper.clientHeight,this.doc.height),_t=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);($=="above"||l.bottom+y.offsetHeight>Ke)&&l.top>y.offsetHeight?he=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=Ke&&(he=l.bottom),Ie+y.offsetWidth>_t&&(Ie=_t-y.offsetWidth)}y.style.top=he+"px",y.style.left=y.style.right="",te=="right"?(Ie=oe.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(te=="left"?Ie=0:te=="middle"&&(Ie=(oe.sizer.clientWidth-y.offsetWidth)/2),y.style.left=Ie+"px"),H&&za(this,{left:Ie,top:he,right:Ie+y.offsetWidth,bottom:he+y.offsetHeight})},triggerOnKeyDown:Ai(Qs),triggerOnKeyPress:Ai(qs),triggerOnKeyUp:Zs,triggerOnMouseDown:Ai(el),execCommand:function(l){if(Fo.hasOwnProperty(l))return Fo[l].call(null,this)},triggerElectric:Ai(function(l){sl(this,l)}),findPosH:function(l,y,H,$){var te=1;y<0&&(te=-1,y=-y);for(var oe=Yn(this.doc,l),he=0;he<y&&!(oe=ps(this.doc,oe,te,H,$),oe.hitSide);++he);return oe},moveH:Ai(function(l,y){var H=this;this.extendSelectionsBy(function($){return H.display.shift||H.doc.extend||$.empty()?ps(H.doc,$.head,l,y,H.options.rtlMoveVisually):l<0?$.from():$.to()},$e)}),deleteH:Ai(function(l,y){var H=this.doc.sel,$=this.doc;H.somethingSelected()?$.replaceSelection("",null,"+delete"):wo(this,function(te){var oe=ps($,te.head,l,y,!1);return l<0?{from:oe,to:te.head}:{from:te.head,to:oe}})}),findPosV:function(l,y,H,$){var te=1,oe=$;y<0&&(te=-1,y=-y);for(var he=Yn(this.doc,l),Ie=0;Ie<y;++Ie){var Ke=pn(this,he,"div");if(oe==null?oe=Ke.left:Ke.left=oe,he=dl(this,Ke,te,H),he.hitSide)break}return he},moveV:Ai(function(l,y){var H=this,$=this.doc,te=[],oe=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Ie){if(oe)return l<0?Ie.from():Ie.to();var Ke=pn(H,Ie.head,"div");Ie.goalColumn!=null&&(Ke.left=Ie.goalColumn),te.push(Ke.left);var _t=dl(H,Ke,l,y);return y=="page"&&Ie==$.sel.primary()&&Va(H,Yt(H,_t,"div").top-Ke.top),_t},$e),te.length)for(var he=0;he<$.sel.ranges.length;he++)$.sel.ranges[he].goalColumn=te[he]}),findWordAt:function(l){var y=this.doc,H=tn(y,l.line).text,$=l.ch,te=l.ch;if(H){var oe=this.getHelper(l,"wordChars");(l.sticky=="before"||te==H.length)&&$?--$:++te;for(var he=H.charAt($),Ie=rt(he,oe)?function(Ke){return rt(Ke,oe)}:/\s/.test(he)?function(Ke){return/\s/.test(Ke)}:function(Ke){return!/\s/.test(Ke)&&!rt(Ke)};$>0&&Ie(H.charAt($-1));)--$;for(;te<H.length&&Ie(H.charAt(te));)++te}return new Nr(on(l.line,$),on(l.line,te))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):v(this.display.cursorDiv,"CodeMirror-overwrite"),de(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==N()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ai(function(l,y){Ra(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Xe(this)-this.display.barHeight,width:l.scrollWidth-Xe(this)-this.display.barWidth,clientHeight:ue(this),clientWidth:Le(this)}},scrollIntoView:Ai(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:on(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?ho(this,l):Aa(this,l.from,l.to,l.margin)}),setSize:Ai(function(l,y){var H=this,$=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};l!=null&&(this.display.wrapper.style.width=$(l)),y!=null&&(this.display.wrapper.style.height=$(y)),this.options.lineWrapping&&tr(this);var te=this.display.viewFrom;this.doc.iter(te,this.display.viewTo,function(oe){if(oe.widgets){for(var he=0;he<oe.widgets.length;he++)if(oe.widgets[he].noHScroll){Vr(H,te,"widget");break}}++te}),this.curOp.forceUpdate=!0,de(this,"refresh",this)}),operation:function(l){return Wi(this,l)},startOperation:function(){return ua(this)},endOperation:function(){return Ea(this)},refresh:Ai(function(){var l=this.display.cachedTextHeight;Kr(this),this.curOp.forceUpdate=!0,fr(this),Ra(this,this.doc.scrollLeft,this.doc.scrollTop),Za(this.display),(l==null||Math.abs(l-Pr(this.display))>.5||this.options.lineWrapping)&&Ii(this),de(this,"refresh",this)}),swapDoc:Ai(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,l),fr(this),this.display.input.reset(),Ra(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Ct(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},pe(e),e.registerHelper=function(l,y,H){d.hasOwnProperty(l)||(d[l]=e[l]={_global:[]}),d[l][y]=H},e.registerGlobalHelper=function(l,y,H,$){e.registerHelper(l,y,$),d[l]._global.push({pred:H,val:$})}}function ps(e,t,d,l,y){var H=t,$=d,te=tn(e,t.line),oe=y&&e.direction=="rtl"?-d:d;function he(){var Gn=t.line+oe;return Gn<e.first||Gn>=e.first+e.size?!1:(t=new on(Gn,t.ch,t.sticky),te=tn(e,Gn))}function Ie(Gn){var Fn;if(l=="codepoint"){var $n=te.text.charCodeAt(t.ch+(l>0?0:-1));isNaN($n)?Fn=null:Fn=new on(t.line,Math.max(0,Math.min(te.text.length,t.ch+d*($n>=55296&&$n<56320?2:1))),-d)}else y?Fn=kl(e.cm,te,t,d):Fn=ss(te,t,d);if(Fn==null)if(!Gn&&he())t=ls(y,e.cm,te,t.line,oe);else return!1;else t=Fn;return!0}if(l=="char"||l=="codepoint")Ie();else if(l=="column")Ie(!0);else if(l=="word"||l=="group")for(var Ke=null,_t=l=="group",ft=e.cm&&e.cm.getHelper(t,"wordChars"),Jt=!0;!(d<0&&!Ie(!Jt));Jt=!1){var _n=te.text.charAt(t.ch)||`
`,Mn=rt(_n,ft)?"w":_t&&_n==`
`?"n":!_t||/\s/.test(_n)?null:"p";if(_t&&!Jt&&!Mn&&(Mn="s"),Ke&&Ke!=Mn){d<0&&(d=1,Ie(),t.sticky="after");break}if(Mn&&(Ke=Mn),d>0&&!Ie(!Jt))break}var jn=Xo(e,t,H,$,!0);return oi(H,jn)&&(jn.hitSide=!0),jn}function dl(e,t,d,l){var y=e.doc,H=t.left,$;if(l=="page"){var te=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(te-.5*Pr(e.display),3);$=(d>0?t.bottom:t.top)+d*oe}else l=="line"&&($=d>0?t.bottom+3:t.top-3);for(var he;!(he=or(e,H,$),!he.outside);){if(d<0?$<=0:$>=y.height){he.hitSide=!0;break}$+=d*5}return he}var qr=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};qr.prototype.init=function(e){var t=this,d=this,l=d.cm,y=d.div=e.lineDiv;ul(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function H(te){for(var oe=te.target;oe;oe=oe.parentNode){if(oe==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}He(y,"paste",function(te){if(!H(te)||ee(l,te)||ol(te,l))return;k<=11&&setTimeout(hi(l,function(){return t.updateFromDOM()}),20)}),He(y,"compositionstart",function(te){t.composing={data:te.data,done:!1}}),He(y,"compositionupdate",function(te){t.composing||(t.composing={data:te.data,done:!1})}),He(y,"compositionend",function(te){t.composing&&(te.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),He(y,"touchstart",function(){return d.forceCompositionEnd()}),He(y,"input",function(){t.composing||t.readFromDOMSoon()});function $(te){if(!H(te)||ee(l,te))return;if(l.somethingSelected())es({lineWise:!1,text:l.getSelections()}),te.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var oe=ll(l);es({lineWise:!0,text:oe.text}),te.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,Te),l.replaceSelection("",null,"cut")})}else return;if(te.clipboardData){te.clipboardData.clearData();var he=wa.text.join(`
`);if(te.clipboardData.setData("Text",he),te.clipboardData.getData("Text")==he){te.preventDefault();return}}var Ie=cl(),Ke=Ie.firstChild;l.display.lineSpace.insertBefore(Ie,l.display.lineSpace.firstChild),Ke.value=wa.text.join(`
`);var _t=document.activeElement;B(Ke),setTimeout(function(){l.display.lineSpace.removeChild(Ie),_t.focus(),_t==y&&d.showPrimarySelection()},50)}He(y,"copy",$),He(y,"cut",$)},qr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},qr.prototype.prepareSelection=function(){var e=Qi(this.cm,!1);return e.focus=document.activeElement==this.div,e},qr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},qr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,d=t.doc.sel.primary(),l=d.from(),y=d.to();if(t.display.viewTo==t.display.viewFrom||l.line>=t.display.viewTo||y.line<t.display.viewFrom){e.removeAllRanges();return}var H=ts(t,e.anchorNode,e.anchorOffset),$=ts(t,e.focusNode,e.focusOffset);if(H&&!H.bad&&$&&!$.bad&&Jn(Yr(H,$),l)==0&&Jn(Jr(H,$),y)==0)return;var te=t.display.view,oe=l.line>=t.display.viewFrom&&hl(t,l)||{node:te[0].measure.map[2],offset:0},he=y.line<t.display.viewTo&&hl(t,y);if(!he){var Ie=te[te.length-1].measure,Ke=Ie.maps?Ie.maps[Ie.maps.length-1]:Ie.map;he={node:Ke[Ke.length-1],offset:Ke[Ke.length-2]-Ke[Ke.length-3]}}if(!oe||!he){e.removeAllRanges();return}var _t=e.rangeCount&&e.getRangeAt(0),ft;try{ft=g(oe.node,oe.offset,he.offset,he.node)}catch(Jt){}ft&&(!I&&t.state.focused?(e.collapse(oe.node,oe.offset),ft.collapsed||(e.removeAllRanges(),e.addRange(ft))):(e.removeAllRanges(),e.addRange(ft)),_t&&e.anchorNode==null?e.addRange(_t):I&&this.startGracePeriod()),this.rememberSelection()},qr.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)},qr.prototype.showMultipleSelections=function(e){f(this.cm.display.cursorDiv,e.cursors),f(this.cm.display.selectionDiv,e.selection)},qr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},qr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},qr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},qr.prototype.blur=function(){this.div.blur()},qr.prototype.getField=function(){return this.div},qr.prototype.supportsTouch=function(){return!0},qr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Wi(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)},qr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},qr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(c&&E&&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),l=ts(t,e.focusNode,e.focusOffset);d&&l&&Wi(t,function(){zi(t.doc,Bn(d,l),Te),(d.bad||l.bad)&&(t.curOp.selectionChanged=!0)})},qr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,d=e.doc.sel.primary(),l=d.from(),y=d.to();if(l.ch==0&&l.line>e.firstLine()&&(l=on(l.line-1,tn(e.doc,l.line-1).length)),y.ch==tn(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=on(y.line+1,0)),l.line<t.viewFrom||y.line>t.viewTo-1)return!1;var H,$,te;l.line==t.viewFrom||(H=Qr(e,l.line))==0?($=Vn(t.view[0].line),te=t.view[0].node):($=Vn(t.view[H].line),te=t.view[H-1].node.nextSibling);var oe=Qr(e,y.line),he,Ie;if(oe==t.view.length-1?(he=t.viewTo-1,Ie=t.lineDiv.lastChild):(he=Vn(t.view[oe+1].line)-1,Ie=t.view[oe+1].node.previousSibling),!te)return!1;for(var Ke=e.doc.splitLines(tu(e,te,Ie,$,he)),_t=Hn(e.doc,on($,0),on(he,tn(e.doc,he).text.length));Ke.length>1&&_t.length>1;)if(j(Ke)==j(_t))Ke.pop(),_t.pop(),he--;else if(Ke[0]==_t[0])Ke.shift(),_t.shift(),$++;else break;for(var ft=0,Jt=0,_n=Ke[0],Mn=_t[0],jn=Math.min(_n.length,Mn.length);ft<jn&&_n.charCodeAt(ft)==Mn.charCodeAt(ft);)++ft;for(var Gn=j(Ke),Fn=j(_t),$n=Math.min(Gn.length-(Ke.length==1?ft:0),Fn.length-(_t.length==1?ft:0));Jt<$n&&Gn.charCodeAt(Gn.length-Jt-1)==Fn.charCodeAt(Fn.length-Jt-1);)++Jt;if(Ke.length==1&&_t.length==1&&$==l.line)for(;ft&&ft>l.ch&&Gn.charCodeAt(Gn.length-Jt-1)==Fn.charCodeAt(Fn.length-Jt-1);)ft--,Jt++;Ke[Ke.length-1]=Gn.slice(0,Gn.length-Jt).replace(/^\u200b+/,""),Ke[0]=Ke[0].slice(ft).replace(/\u200b+$/,"");var mr=on($,ft),cr=on(he,_t.length?j(_t).length-Jt:0);if(Ke.length>1||Ke[0]||Jn(mr,cr))return bo(e.doc,Ke,mr,cr,"+input"),!0},qr.prototype.ensurePolled=function(){this.forceCompositionEnd()},qr.prototype.reset=function(){this.forceCompositionEnd()},qr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},qr.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)},qr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Wi(this.cm,function(){return Kr(e.cm)})},qr.prototype.setUneditable=function(e){e.contentEditable="false"},qr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||hi(this.cm,fs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},qr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},qr.prototype.onContextMenu=function(){},qr.prototype.resetPosition=function(){},qr.prototype.needsContentAttribute=!0;function hl(e,t){var d=qe(e,t.line);if(!d||d.hidden)return null;var l=tn(e.doc,t.line),y=fe(d,l,t.line),H=vn(l,e.doc.direction),$="left";if(H){var te=tt(H,t.ch);$=te%2?"right":"left"}var oe=$t(y.map,t.ch,$);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function To(e,t){return t&&(e.bad=!0),e}function tu(e,t,d,l,y){var H="",$=!1,te=e.doc.lineSeparator(),oe=!1;function he(ft){return function(Jt){return Jt.id==ft}}function Ie(){$&&(H+=te,oe&&(H+=te),$=oe=!1)}function Ke(ft){ft&&(Ie(),H+=ft)}function _t(ft){if(ft.nodeType==1){var Jt=ft.getAttribute("cm-text");if(Jt){Ke(Jt);return}var _n=ft.getAttribute("cm-marker"),Mn;if(_n){var jn=e.findMarks(on(l,0),on(y+1,0),he(+_n));jn.length&&(Mn=jn[0].find(0))&&Ke(Hn(e.doc,Mn.from,Mn.to).join(te));return}if(ft.getAttribute("contenteditable")=="false")return;var Gn=/^(pre|div|p|li|table|br)$/i.test(ft.nodeName);if(!/^br$/i.test(ft.nodeName)&&ft.textContent.length==0)return;Gn&&Ie();for(var Fn=0;Fn<ft.childNodes.length;Fn++)_t(ft.childNodes[Fn]);/^(pre|p)$/i.test(ft.nodeName)&&(oe=!0),Gn&&($=!0)}else ft.nodeType==3&&Ke(ft.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(_t(t),t==d);)t=t.nextSibling,oe=!1;return H}function ts(e,t,d){var l;if(t==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[d],!l)return To(e.clipPos(on(e.display.viewTo-1)),!0);t=null,d=0}else for(l=t;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var H=e.display.view[y];if(H.node==l)return nu(H,t,d)}}function nu(e,t,d){var l=e.text.firstChild,y=!1;if(!t||!x(l,t))return To(on(Vn(e.line),0),!0);if(t==l&&(y=!0,t=l.childNodes[d],d=0,!t)){var H=e.rest?j(e.rest):e.line;return To(on(Vn(H),H.text.length),y)}var $=t.nodeType==3?t:null,te=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,d&&(d=$.nodeValue.length));te.parentNode!=l;)te=te.parentNode;var oe=e.measure,he=oe.maps;function Ie(Mn,jn,Gn){for(var Fn=-1;Fn<(he?he.length:0);Fn++)for(var $n=Fn<0?oe.map:he[Fn],mr=0;mr<$n.length;mr+=3){var cr=$n[mr+2];if(cr==Mn||cr==jn){var Ar=Vn(Fn<0?e.line:e.rest[Fn]),ni=$n[mr]+Gn;return(Gn<0||cr!=Mn)&&(ni=$n[mr+(Gn?1:0)]),on(Ar,ni)}}}var Ke=Ie($,te,d);if(Ke)return To(Ke,y);for(var _t=te.nextSibling,ft=$?$.nodeValue.length-d:0;_t;_t=_t.nextSibling){if(Ke=Ie(_t,_t.firstChild,0),Ke)return To(on(Ke.line,Ke.ch-ft),y);ft+=_t.textContent.length}for(var Jt=te.previousSibling,_n=d;Jt;Jt=Jt.previousSibling){if(Ke=Ie(Jt,Jt.firstChild,-1),Ke)return To(on(Ke.line,Ke.ch+_n),y);_n+=Jt.textContent.length}}var Si=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new q,this.hasSelection=!1,this.composing=null};Si.prototype.init=function(e){var t=this,d=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),o&&(y.style.width="0px"),He(y,"input",function(){W&&k>=9&&t.hasSelection&&(t.hasSelection=null),d.poll()}),He(y,"paste",function($){if(ee(l,$)||ol($,l))return;l.state.pasteIncoming=+new Date,d.fastPoll()});function H($){if(ee(l,$))return;if(l.somethingSelected())es({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var te=ll(l);es({lineWise:!0,text:te.text}),$.type=="cut"?l.setSelections(te.ranges,null,Te):(d.prevInput="",y.value=te.text.join(`
`),B(y))}else return;$.type=="cut"&&(l.state.cutIncoming=+new Date)}He(y,"cut",H),He(y,"copy",H),He(e.scroller,"paste",function($){if(li(e,$)||ee(l,$))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,d.focus();return}var te=new Event("paste");te.clipboardData=$.clipboardData,y.dispatchEvent(te)}),He(e.lineSpace,"selectstart",function($){li(e,$)||ae($)}),He(y,"compositionstart",function(){var $=l.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:$,range:l.markText($,l.getCursor("to"),{className:"CodeMirror-composing"})}}),He(y,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},Si.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},Si.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Si.prototype.prepareSelection=function(){var e=this.cm,t=e.display,d=e.doc,l=Qi(e);if(e.options.moveInputWithCursor){var y=pn(e,d.sel.primary().head,"div"),H=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,y.top+$.top-H.top)),l.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,y.left+$.left-H.left))}return l},Si.prototype.showSelection=function(e){var t=this.cm,d=t.display;f(d.cursorDiv,e.cursors),f(d.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Si.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&&B(this.textarea),W&&k>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",W&&k>=9&&(this.hasSelection=null))},Si.prototype.getField=function(){return this.textarea},Si.prototype.supportsTouch=function(){return!1},Si.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!s||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},Si.prototype.blur=function(){this.textarea.blur()},Si.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Si.prototype.receivedFocus=function(){this.slowPoll()},Si.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()})},Si.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function d(){var l=t.poll();!l&&!e?(e=!0,t.polling.set(60,d)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,d)},Si.prototype.poll=function(){var e=this,t=this.cm,d=this.textarea,l=this.prevInput;if(this.contextMenuPending||!t.state.focused||Et(d)&&!l&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var y=d.value;if(y==l&&!t.somethingSelected())return!1;if(W&&k>=9&&this.hasSelection===y||i&&/[\uf700-\uf7ff]/.test(y))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var H=y.charCodeAt(0);if(H==8203&&!l&&(l="\u200B"),H==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,te=Math.min(l.length,y.length);$<te&&l.charCodeAt($)==y.charCodeAt($);)++$;return Wi(t,function(){fs(t,y.slice($),l.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},Si.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Si.prototype.onKeyPress=function(){W&&k>=9&&(this.hasSelection=null),this.fastPoll()},Si.prototype.onContextMenu=function(e){var t=this,d=t.cm,l=d.display,y=t.textarea;t.contextMenuPending&&t.contextMenuPending();var H=Ci(d,e),$=l.scroller.scrollTop;if(!H||p)return;var te=d.options.resetSelectionOnContextMenu;te&&d.doc.sel.contains(H)==-1&&hi(d,zi)(d.doc,Bn(H),Te);var oe=y.style.cssText,he=t.wrapper.style.cssText,Ie=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Ie.top-5)+"px; left: "+(e.clientX-Ie.left-5)+`px;
z-index: 1000; background: `+(W?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ke;r&&(Ke=window.scrollY),l.input.focus(),r&&window.scrollTo(null,Ke),l.input.reset(),d.somethingSelected()||(y.value=t.prevInput=" "),t.contextMenuPending=ft,l.selForContextMenu=d.doc.sel,clearTimeout(l.detectingSelectAll);function _t(){if(y.selectionStart!=null){var _n=d.somethingSelected(),Mn="\u200B"+(_n?y.value:"");y.value="\u21DA",y.value=Mn,t.prevInput=_n?"":"\u200B",y.selectionStart=1,y.selectionEnd=Mn.length,l.selForContextMenu=d.doc.sel}}function ft(){if(t.contextMenuPending!=ft)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=he,y.style.cssText=oe,W&&k<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=$),y.selectionStart!=null){(!W||W&&k<9)&&_t();var _n=0,Mn=function(){l.selForContextMenu==d.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&t.prevInput=="\u200B"?hi(d,Ds)(d):_n++<10?l.detectingSelectAll=setTimeout(Mn,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(Mn,200)}}if(W&&k>=9&&_t(),R){ye(e);var Jt=function(){Rt(window,"mouseup",Jt),setTimeout(ft,20)};He(window,"mouseup",Jt)}else setTimeout(ft,50)},Si.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Si.prototype.setUneditable=function(){},Si.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?w(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=N();t.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function l(){e.value=te.getValue()}var y;if(e.form&&(He(e.form,"submit",l),!t.leaveSubmitMethodAlone)){var H=e.form;y=H.submit;try{var $=H.submit=function(){l(),H.submit=y,H.submit(),H.submit=$}}catch(oe){}}t.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(Rt(e.form,"submit",l),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var te=pi(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},t);return te}function iu(e){e.off=Rt,e.on=He,e.wheelEventPixels=Ba,e.Doc=ea,e.splitLines=ht,e.countColumn=Y,e.findColumn=Je,e.isWordChar=Ue,e.Pass=Qe,e.signal=de,e.Line=On,e.changeEnd=nr,e.scrollbarModel=$a,e.Pos=on,e.cmpPos=Jn,e.modes=St,e.mimeModes=lt,e.resolveMode=Ve,e.getMode=et,e.modeExtensions=gt,e.extendMode=Ht,e.copyState=Vt,e.startState=Zn,e.innerMode=dn,e.commands=Fo,e.keyMap=Ka,e.keyName=Vs,e.isModifierKey=Gs,e.lookupKey=xo,e.normalizeKeyMap=Ml,e.StringStream=Wn,e.SharedTextMarker=No,e.TextMarker=qa,e.LineWidget=Io,e.e_preventDefault=ae,e.e_stopPropagation=ie,e.e_stop=ye,e.addClass=F,e.contains=x,e.rmClass=v,e.keyNames=eo}$l(pi),ql(pi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ns in ea.prototype)ea.prototype.hasOwnProperty(ns)&&ce(au,ns)<0&&(pi.prototype[ns]=function(e){return function(){return e.apply(this.doc,arguments)}}(ea.prototype[ns]));return pe(ea),pi.inputStyles={textarea:Si,contenteditable:qr},pi.defineMode=function(e){!pi.defaults.mode&&e!="null"&&(pi.defaults.mode=e),Gt.apply(this,arguments)},pi.defineMIME=qt,pi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),pi.defineMIME("text/plain","null"),pi.defineExtension=function(e,t){pi.prototype[e]=t},pi.defineDocExtension=function(e,t){ea.prototype[e]=t},pi.fromTextArea=ru,iu(pi),pi.version="5.58.2",pi})},WaYH:function(jt,_e,D){"use strict";var Z=D("rePB"),V=D("Ff2n"),I=D("VTBJ"),G=D("1OyB"),P=D("vuIU"),L=D("JX7q"),W=D("Ji7U"),k=D("LK+K"),r=D("q1tI"),M=D("TSYQ"),E=D.n(M),p=D("sboe"),m=D("OZM5"),u=function(R){var T=R.prefixCls,v=R.level,b=R.isStart,f=R.isEnd;if(!v)return null;for(var h="".concat(T,"-indent-unit"),_=[],g=0;g<v;g+=1){var x;_.push(r.createElement("span",{key:g,className:E()(h,(x={},Object(Z.a)(x,"".concat(h,"-start"),b[g+1]),Object(Z.a)(x,"".concat(h,"-end"),f[g+1]),Object(Z.a)(x,"".concat(h,"-end-first-level"),!g&&f[0]),x))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(T,"-indent")},_)},a=u,o=D("815F"),c="open",s="close",i="---",n=function(C){Object(W.a)(T,C);var R=Object(k.a)(T);function T(){var v;return Object(G.a)(this,T),v=R.apply(this,arguments),v.state={dragNodeHighlight:!1},v.onSelectorClick=function(b){var f=v.props.context.onNodeClick;f(b,Object(o.b)(v.props)),v.isSelectable()?v.onSelect(b):v.onCheck(b)},v.onSelectorDoubleClick=function(b){var f=v.props.context.onNodeDoubleClick;f(b,Object(o.b)(v.props))},v.onSelect=function(b){if(v.isDisabled())return;var f=v.props.context.onNodeSelect;b.preventDefault(),f(b,Object(o.b)(v.props))},v.onCheck=function(b){if(v.isDisabled())return;var f=v.props,h=f.disableCheckbox,_=f.checked,g=v.props.context.onNodeCheck;if(!v.isCheckable()||h)return;b.preventDefault();var x=!_;g(b,Object(o.b)(v.props),x)},v.onMouseEnter=function(b){var f=v.props.context.onNodeMouseEnter;f(b,Object(o.b)(v.props))},v.onMouseLeave=function(b){var f=v.props.context.onNodeMouseLeave;f(b,Object(o.b)(v.props))},v.onContextMenu=function(b){var f=v.props.context.onNodeContextMenu;f(b,Object(o.b)(v.props))},v.onDragStart=function(b){var f=v.props.context.onNodeDragStart;b.stopPropagation(),v.setState({dragNodeHighlight:!0}),f(b,Object(L.a)(v));try{b.dataTransfer.setData("text/plain","")}catch(h){}},v.onDragEnter=function(b){var f=v.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),f(b,Object(L.a)(v))},v.onDragOver=function(b){var f=v.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),f(b,Object(L.a)(v))},v.onDragLeave=function(b){var f=v.props.context.onNodeDragLeave;b.stopPropagation(),f(b,Object(L.a)(v))},v.onDragEnd=function(b){var f=v.props.context.onNodeDragEnd;b.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(b,Object(L.a)(v))},v.onDrop=function(b){var f=v.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),v.setState({dragNodeHighlight:!1}),f(b,Object(L.a)(v))},v.onExpand=function(b){var f=v.props.context.onNodeExpand;f(b,Object(o.b)(v.props))},v.setSelectHandle=function(b){v.selectHandle=b},v.getNodeState=function(){var b=v.props.expanded;return v.isLeaf()?null:b?c:s},v.hasChildren=function(){var b=v.props.eventKey,f=v.props.context.keyEntities,h=f[b]||{},_=h.children;return!!(_||[]).length},v.isLeaf=function(){var b=v.props,f=b.isLeaf,h=b.loaded,_=v.props.context.loadData,g=v.hasChildren();return f===!1?!1:f||!_&&!g||_&&h&&!g},v.isDisabled=function(){var b=v.props.disabled,f=v.props.context.disabled;return!!(f||b)},v.isCheckable=function(){var b=v.props.checkable,f=v.props.context.checkable;return!f||b===!1?!1:f},v.syncLoadData=function(b){var f=b.expanded,h=b.loading,_=b.loaded,g=v.props.context,x=g.loadData,N=g.onNodeLoad;if(h)return;x&&f&&!v.isLeaf()&&(!v.hasChildren()&&!_&&N(Object(o.b)(v.props)))},v.renderSwitcher=function(){var b=v.props,f=b.expanded,h=b.switcherIcon,_=v.props.context,g=_.prefixCls,x=_.switcherIcon,N=h||x;if(v.isLeaf())return r.createElement("span",{className:E()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof N=="function"?N(Object(I.a)(Object(I.a)({},v.props),{},{isLeaf:!0})):N);var F=E()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(f?c:s));return r.createElement("span",{onClick:v.onExpand,className:F},typeof N=="function"?N(Object(I.a)(Object(I.a)({},v.props),{},{isLeaf:!1})):N)},v.renderCheckbox=function(){var b=v.props,f=b.checked,h=b.halfChecked,_=b.disableCheckbox,g=v.props.context.prefixCls,x=v.isDisabled(),N=v.isCheckable();if(!N)return null;var F=typeof N!="boolean"?N:null;return r.createElement("span",{className:E()("".concat(g,"-checkbox"),f&&"".concat(g,"-checkbox-checked"),!f&&h&&"".concat(g,"-checkbox-indeterminate"),(x||_)&&"".concat(g,"-checkbox-disabled")),onClick:v.onCheck},F)},v.renderIcon=function(){var b=v.props.loading,f=v.props.context.prefixCls;return r.createElement("span",{className:E()("".concat(f,"-iconEle"),"".concat(f,"-icon__").concat(v.getNodeState()||"docu"),b&&"".concat(f,"-icon_loading"))})},v.renderSelector=function(){var b=v.state.dragNodeHighlight,f=v.props,h=f.title,_=f.selected,g=f.icon,x=f.loading,N=f.data,F=v.props.context,A=F.prefixCls,B=F.showIcon,U=F.icon,w=F.draggable,Y=F.loadData,q=F.titleRender,ce=v.isDisabled(),Ee="".concat(A,"-node-content-wrapper"),Qe;if(B){var Te=g||U;Qe=Te?r.createElement("span",{className:E()("".concat(A,"-iconEle"),"".concat(A,"-icon__customize"))},typeof Te=="function"?Te(v.props):Te):v.renderIcon()}else Y&&x&&(Qe=v.renderIcon());var We;typeof h=="function"?We=h(N):q?We=q(N):We=h;var $e=r.createElement("span",{className:"".concat(A,"-title")},We);return r.createElement("span",{ref:v.setSelectHandle,title:typeof h=="string"?h:"",className:E()("".concat(Ee),"".concat(Ee,"-").concat(v.getNodeState()||"normal"),!ce&&(_||b)&&"".concat(A,"-node-selected"),!ce&&w&&"draggable"),draggable:!ce&&w||void 0,"aria-grabbed":!ce&&w||void 0,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,onContextMenu:v.onContextMenu,onClick:v.onSelectorClick,onDoubleClick:v.onSelectorDoubleClick,onDragStart:w?v.onDragStart:void 0},Qe,$e)},v}return Object(P.a)(T,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,f=this.props.context.selectable;return typeof b=="boolean"?b:f}},{key:"render",value:function(){var b,f=this.props,h=f.eventKey,_=f.className,g=f.style,x=f.dragOver,N=f.dragOverGapTop,F=f.dragOverGapBottom,A=f.isLeaf,B=f.isStart,U=f.isEnd,w=f.expanded,Y=f.selected,q=f.checked,ce=f.halfChecked,Ee=f.loading,Qe=f.domRef,Te=f.active,We=f.onMouseMove,$e=Object(V.a)(f,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Je=this.props.context,Ce=Je.prefixCls,X=Je.filterTreeNode,j=Je.draggable,K=Je.keyEntities,Q=this.isDisabled(),re=Object(m.f)($e),z=K[h]||{},we=z.level,Ue=U[U.length-1];return r.createElement("div",Object.assign({ref:Qe,className:E()(_,"".concat(Ce,"-treenode"),(b={},Object(Z.a)(b,"".concat(Ce,"-treenode-disabled"),Q),Object(Z.a)(b,"".concat(Ce,"-treenode-switcher-").concat(w?"open":"close"),!A),Object(Z.a)(b,"".concat(Ce,"-treenode-checkbox-checked"),q),Object(Z.a)(b,"".concat(Ce,"-treenode-checkbox-indeterminate"),ce),Object(Z.a)(b,"".concat(Ce,"-treenode-selected"),Y),Object(Z.a)(b,"".concat(Ce,"-treenode-loading"),Ee),Object(Z.a)(b,"".concat(Ce,"-treenode-active"),Te),Object(Z.a)(b,"".concat(Ce,"-treenode-leaf-last"),Ue),Object(Z.a)(b,"drag-over",!Q&&x),Object(Z.a)(b,"drag-over-gap-top",!Q&&N),Object(Z.a)(b,"drag-over-gap-bottom",!Q&&F),Object(Z.a)(b,"filter-node",X&&X(Object(o.b)(this.props))),b)),style:g,onDragEnter:j?this.onDragEnter:void 0,onDragOver:j?this.onDragOver:void 0,onDragLeave:j?this.onDragLeave:void 0,onDrop:j?this.onDrop:void 0,onDragEnd:j?this.onDragEnd:void 0,onMouseMove:We},re),r.createElement(a,{prefixCls:Ce,level:we,isStart:B,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),T}(r.Component),O=function(R){return r.createElement(p.a.Consumer,null,function(T){return r.createElement(n,Object.assign({},R,{context:T}))})};O.displayName="TreeNode",O.defaultProps={title:i},O.isTreeNode=1;var S=_e.a=O},XpUO:function(jt,_e,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),I=D("sRBo"),G=D("kaz8"),P=D("jCWc"),L=D("kPKH"),W=D("iQDF"),k=D("+eQT"),r=D("giR+"),M=D("fyUT"),E=D("14J3"),p=D("BMrR"),m=D("7Kak"),u=D("9yH6"),a=D("miYZ"),o=D("tsqr"),c=D("jrin"),s=D("9og8"),i=D("k1fw"),n=D("oBTY"),O=D("y8nQ"),S=D("Vl3Y"),C=D("tJVT"),R=D("PpiC"),T=D("WmNS"),v=D.n(T),b=D("q1tI"),f=D.n(b),h=D("wd/R"),_=D.n(h),g=D("ErOA"),x=D("xKgJ"),N=D("1vsH"),F=D("Ty5D"),A=D("9kvl"),B=D("4wi7"),U=D("oUNq"),w=D("eozf"),Y=function(ce){var Ee,Qe,Te,We,$e,Je,Ce,X,j,K,Q,re,z,we,Ue,rt,le,Oe,Fe,Ye,Tt,Nt,Xt,tt,Zt,vn,ze,He,vt,Rt,de,ee,ne,se,pe,ae,ie,me,ye,xe=ce.classroomList,De=ce.dispatch,ct=ce.courseEndTime,It=Object(R.a)(ce,["classroomList","dispatch","courseEndTime"]),un=Object(F.i)(),mt=S.a.useForm(),Qt=Object(C.a)(mt,1),ht=Qt[0],Et=Object(b.useState)(1),it=Object(C.a)(Et,2),ve=it[0],Me=it[1],St=Object(b.useState)([]),lt=Object(C.a)(St,2),Gt=lt[0],qt=lt[1],Ve=Object(b.useState)(0),et=Object(C.a)(Ve,2),gt=et[0],Ht=et[1],Vt=Object(b.useState)(2e3),dn=Object(C.a)(Vt,2),Zn=dn[0],Wn=dn[1],tn=Object(b.useState)(!0),Hn=Object(C.a)(tn,2),ir=Hn[0],Dn=Hn[1],Vn=Object(b.useState)(!1),qn=Object(C.a)(Vn,2),Mr=qn[0],Sr=qn[1],on=Object(b.useState)(!1),Jn=Object(C.a)(on,2),oi=Jn[0],xi=Jn[1],Jr=Object(b.useState)([]),Yr=Object(C.a)(Jr,2),Lr=Yr[0],Yn=Yr[1],mi=Object(b.useState)(!0),hn=Object(C.a)(mi,2),ei=hn[0],zr=hn[1],wi=Object(b.useState)(!((Ee=xe.actionTabs)!==null&&Ee!==void 0&&(Qe=Ee.selectArrsAll)!==null&&Qe!==void 0&&(Te=Qe[0])!==null&&Te!==void 0&&Te.send_type)),gi=Object(C.a)(wi,2),ri=gi[0],Bi=gi[1],Hi=Object(b.useState)([0,0,0]),ii=Object(C.a)(Hi,2),wr=ii[0],Oi=ii[1];Object(b.useEffect)(function(){if(xe.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03"){var yr,br,si,kr,kn,fn;if((yr=xe.actionTabs)!==null&&yr!==void 0&&(br=yr.selectArrsAll)!==null&&br!==void 0&&(si=br[0])!==null&&si!==void 0&&si.can_publish){var rr,J,ge;Oi(Object(n.a)((rr=xe.actionTabs)===null||rr===void 0||((J=rr.selectArrsAll)===null||J===void 0||((ge=J[0])===null||ge===void 0))?void 0:ge.difficult_count))}else{var Tn,mn,er;Oi(Object(n.a)((Tn=xe.actionTabs)===null||Tn===void 0||((mn=Tn.selectArrsAll)===null||mn===void 0||((er=mn[0])===null||er===void 0))?void 0:er.difficult_settings))}if(Bi(!((kr=xe.actionTabs)!==null&&kr!==void 0&&(kn=kr.selectArrsAll)!==null&&kn!==void 0&&(fn=kn[0])!==null&&fn!==void 0&&fn.send_type)),Ri(),xe.actionTabs.type===2){var Re,Ae=(Re=xe.actionTabs.selectArrsAll)===null||Re===void 0?void 0:Re[0];zr(Ae.unified_setting)}}},[xe.actionTabs]),Object(b.useEffect)(function(){if(Mr){if(oi)return;De({type:"classroomList/setActionTabs",payload:{}}),Object(x.c)()?(De({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},xe.actionTabs.params),{},{type:1})}),De({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},un)})):De({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},xe.actionTabs.params)})}},[Mr]);var Ri=function(){var yr=Object(s.a)(v.a.mark(function br(si){var kr,kn;return v.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return Dn(!0),Tn.next=3,Object(U.D)(Object(i.a)(Object(i.a)({},un),{},{page:si||ve,limit:2e4,homework_id:xe.actionTabs.type===1?"":xe.actionTabs.selectArrs[0]}));case 3:kr=Tn.sent,kr==null||kr.course_groups.map(function(mn,er){mn.key=mn.id,mn.title=mn.name,mn.disabled=mn.is_published}),kr&&(qt(Object(n.a)(kr==null?void 0:kr.course_groups)),Ht(kr==null?void 0:kr.course_groups_count),Dn(!1),si||ht.setFieldsValue((kn={},Object(c.a)(kn,"publish_time",_()(_()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),Object(c.a)(kn,"end_time",_()(_()(new Date(Object(N.b)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))),kn)));case 6:case"end":return Tn.stop()}},br)}));return function(si){return yr.apply(this,arguments)}}(),di=function(){Object(x.c)()?xe.actionTabs.detail?(De({type:"shixunHomeworks/setActionTabs",payload:{}}),De({type:"shixunHomeworks/getWorkList",payload:Object(i.a)({},un)}),De({type:"shixunHomeworks/getWorkSetting",payload:Object(i.a)({},un)})):De({type:"classroomList/getClassroomTeacherCommonList",payload:Object(i.a)(Object(i.a)({},xe.actionTabs.params),{},{type:5})}):De({type:"classroomList/getClassroomCommonList",payload:Object(i.a)({},xe.actionTabs.params)})},_i=function(){var yr=Object(s.a)(v.a.mark(function br(){var si,kr,kn,fn;return v.a.wrap(function(mn){for(;;)switch(mn.prev=mn.next){case 0:if(kr=Object(i.a)({},ht.getFieldsValue()),!(kr.end_time<=kr.publish_time)){mn.next=4;break}return o.b.info("\u622A\u6B62\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u6216\u7B49\u4E8E\u53D1\u5E03\u65F6\u95F4"),mn.abrupt("return");case 4:if(!((Lr==null?void 0:Lr.length)<=0&&!ei&&Gt.length>0)){mn.next=7;break}return o.b.info("\u53D1\u5E03\u73ED\u7EA7\u4E0D\u80FD\u4E3A\u7A7A"),mn.abrupt("return");case 7:if(!(wr.reduce(function(er,rr){return er+rr})===0&&!ri)){mn.next=10;break}return o.b.info("\u7B80\u5355\u9002\u4E2D\u56F0\u96BE\u9898\u6570\u76F8\u52A0\u4E0D\u80FD\u4E3A0"),mn.abrupt("return");case 10:return kn={homework_ids:Object(n.a)(xe.actionTabs.selectArrs),group_ids:Lr.length>0?Lr.map(function(er){return er.id}):(si=xe.detailCommonHomeworksList)===null||si===void 0?void 0:si.course_groups,end_time:_()(kr.end_time).format("YYYY-MM-DD HH:mm"),publish_time:_()(kr.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:wr==null?void 0:wr.map(function(er){return er}),send_type:ri?"0":"1",unified_setting:!Lr.length},mn.next=13,Object(g.a)("/api/courses/".concat(un.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:Object(i.a)({},kn)});case 13:fn=mn.sent,fn.status===0&&(Object(N.db)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u53D1\u5E03"]),o.b.success("\u53D1\u5E03\u6210\u529F"),De({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),It.onCallback&&It.onCallback(),di(),localStorage.getItem("Noviceguide")==="0"||De({type:"shixunHomeworks/setActionTabs",payload:{key:"\u5E95\u90E8\u5F39\u7A97",type:13,text:f.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 mn.stop()}},br)}));return function(){return yr.apply(this,arguments)}}(),oa=function(){Me(1),qt([]),Yn([])},$i=gt>ve*Zn;return f.a.createElement(V.a,{width:600,centered:!0,title:"\u53D1\u5E03\u4F5C\u4E1A",visible:xe.actionTabs.key==="\u7ACB\u5373\u53D1\u5E03",okText:"\u53D1\u5E03\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u53D1\u5E03",onOk:_i,onCancel:function(){oa(),di(),De({type:"classroomList/setActionTabs",payload:{}})}},f.a.createElement("p",{className:"tc"},"\u5B66\u751F\u5C06\u7ACB\u5373\u6536\u5230\u4F5C\u4E1A",f.a.createElement("br",null),'\u672C\u64CD\u4F5C\u53EA\u5BF9"\u672A\u53D1\u5E03"\u7684\u4F5C\u4E1A\u6709\u6548'),Gt&&f.a.createElement(S.a,{form:ht},f.a.createElement("div",{style:{paddingLeft:0}},xe.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u8BD5\u9898\u53D1\u9001:"),f.a.createElement(u.a.Group,{value:ri,disabled:!((We=xe.actionTabs)!==null&&We!==void 0&&($e=We.selectArrsAll)!==null&&$e!==void 0&&(Je=$e[0])!==null&&Je!==void 0&&Je.can_publish),onChange:function(br){Bi(br.target.value)}},f.a.createElement(u.a,{value:!0},"\u5168\u90E8\u56FA\u5B9A\u8BD5\u9898"),f.a.createElement(u.a,{className:"ml20",value:!1},"\u968F\u673A\u62BD\u53D6"))),!ri&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{style:{marginRight:65}}),f.a.createElement("span",null,"\u7B80\u5355\u9898\u6570"," ",f.a.createElement(M.a,{value:wr[0],onChange:function(br){wr[0]=br,Oi(Object(n.a)(wr))},min:0,disabled:!((Ce=xe.actionTabs)!==null&&Ce!==void 0&&(X=Ce.selectArrsAll)!==null&&X!==void 0&&(j=X[0])!==null&&j!==void 0&&j.can_publish),placeholder:"\u6700\u5927".concat((K=xe.actionTabs)===null||K===void 0||((Q=K.selectArrsAll)===null||Q===void 0||((re=Q[0])===null||re===void 0||((z=re.difficult_count)===null||z===void 0)))?void 0:z[0]),max:(we=xe.actionTabs)===null||we===void 0||((Ue=we.selectArrsAll)===null||Ue===void 0||((rt=Ue[0])===null||rt===void 0||((le=rt.difficult_count)===null||le===void 0)))?void 0:le[0],style:{width:60}})),f.a.createElement("span",{style:{margin:"0px 40px"}},"\u9002\u4E2D\u9898\u6570"," ",f.a.createElement(M.a,{value:wr[1],onChange:function(br){wr[1]=br,Oi(Object(n.a)(wr))},min:0,disabled:!((Oe=xe.actionTabs)!==null&&Oe!==void 0&&(Fe=Oe.selectArrsAll)!==null&&Fe!==void 0&&(Ye=Fe[0])!==null&&Ye!==void 0&&Ye.can_publish),max:(Tt=xe.actionTabs)===null||Tt===void 0||((Nt=Tt.selectArrsAll)===null||Nt===void 0||((Xt=Nt[0])===null||Xt===void 0||((tt=Xt.difficult_count)===null||tt===void 0)))?void 0:tt[1],placeholder:"\u6700\u5927".concat((Zt=xe.actionTabs)===null||Zt===void 0||((vn=Zt.selectArrsAll)===null||vn===void 0||((ze=vn[0])===null||ze===void 0||((He=ze.difficult_count)===null||He===void 0)))?void 0:He[1]),style:{width:60}})),f.a.createElement("span",null,"\u56F0\u96BE\u9898\u6570"," ",f.a.createElement(M.a,{value:wr[2],onChange:function(br){wr[2]=br,Oi(Object(n.a)(wr))},min:0,disabled:!((vt=xe.actionTabs)!==null&&vt!==void 0&&(Rt=vt.selectArrsAll)!==null&&Rt!==void 0&&(de=Rt[0])!==null&&de!==void 0&&de.can_publish),placeholder:"\u6700\u5927".concat((ee=xe.actionTabs)===null||ee===void 0||((ne=ee.selectArrsAll)===null||ne===void 0||((se=ne[0])===null||se===void 0||((pe=se.difficult_count)===null||pe===void 0)))?void 0:pe[2]),max:(ae=xe.actionTabs)===null||ae===void 0||((ie=ae.selectArrsAll)===null||ie===void 0||((me=ie[0])===null||me===void 0||((ye=me.difficult_count)===null||ye===void 0)))?void 0:ye[2],style:{width:60}}))),f.a.createElement(p.a,{className:"mt30",align:"middle"},f.a.createElement(L.a,null,f.a.createElement(S.a.Item,{name:"publish_time",label:"\u53D1\u5E03\u65F6\u95F4"},f.a.createElement(k.a,{style:{width:155,marginRight:"25px"},getPopupContainer:function(br){return br.parentNode},disabledDate:function(br){return Object(w.b)(br,ct)},disabledTime:function(br){return Object(w.c)(br)},placeholder:"\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(N.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),f.a.createElement(L.a,{className:"ml20"},f.a.createElement(S.a.Item,{name:"end_time",label:"\u622A\u6B62\u65F6\u95F4"},f.a.createElement(k.a,{style:{width:170},getPopupContainer:function(br){return br.parentNode},placeholder:"\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:_()(Object(N.d)(),"HH:mm")},disabledDate:function(br){return Object(w.b)(br,ct,ht.getFieldValue("publish_time"))},disabledTime:function(br){return Object(w.c)(br,ht.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})))),xe.actionTabs.type===2&&f.a.createElement(p.a,{style:{marginBottom:"10px"}},f.a.createElement("span",{className:"mr5"},"\u53D1\u5E03\u8BBE\u7F6E:"),f.a.createElement(u.a.Group,{value:ei,onChange:function(br){zr(br.target.value),Yn([])}},f.a.createElement(u.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),f.a.createElement(u.a,{className:"ml20",disabled:Gt.length<=0,value:!1},"\u5206\u73ED\u53D1\u5E03"))),Gt.length<=0&&xe.actionTabs.type===2&&f.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"')),(xe.actionTabs.type===1||!ei)&&Gt.length>0&&f.a.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"}},f.a.createElement("span",{style:{flex:1}},f.a.createElement(G.a,{checked:Lr.length===Gt.length,onChange:function(br){Lr.length===Gt.length?Yn([]):Yn(Gt.filter(function(si){return!si.is_published}))}},"\u5168\u9009")," "),f.a.createElement("span",{style:{width:16}}),f.a.createElement("span",{style:{flex:1}},"\u5DF2\u9009\u62E9",Lr.length||0,"\u4E2A\u5206\u73ED")),(xe.actionTabs.type===1||!ei)&&Gt.length>0&&f.a.createElement(B.a,{data:Gt,selectedRowKeys:Lr,setSelectedRowKeys:Yn})))};_e.a=Object(A.a)(function(q){var ce=q.classroomList;return{classroomList:ce}})(Y)},Y1PL:function(jt,_e,D){"use strict";D.r(_e),D.d(_e,"ResizableTextArea",function(){return ce});var Z=D("wx14"),V=D("1OyB"),I=D("vuIU"),G=D("Ji7U"),P=D("LK+K"),L=D("q1tI"),W=D("VTBJ"),k=D("rePB"),r=D("Zm9Q"),M=D("Kwbf"),E=D("c+Xe"),p=D("m+aA"),m=D("bdgK"),u=new Map;function a(Te){Te.forEach(function(We){var $e,Je=We.target;($e=u.get(Je))===null||$e===void 0||$e.forEach(function(Ce){return Ce(Je)})})}var o=new m.default(a),c=null,s=null;function i(Te,We){u.has(Te)||(u.set(Te,new Set),o.observe(Te)),u.get(Te).add(We)}function n(Te,We){u.has(Te)&&(u.get(Te).delete(We),u.get(Te).size||(o.unobserve(Te),u.delete(Te)))}var O=function(Te){Object(G.a)($e,Te);var We=Object(P.a)($e);function $e(){return Object(V.a)(this,$e),We.apply(this,arguments)}return Object(I.a)($e,[{key:"render",value:function(){return this.props.children}}]),$e}(L.Component),S=L.createContext(null);function C(Te){var We=Te.children,$e=Te.onBatchResize,Je=L.useRef(0),Ce=L.useRef([]),X=L.useContext(S),j=L.useCallback(function(K,Q,re){Je.current+=1;var z=Je.current;Ce.current.push({size:K,element:Q,data:re}),Promise.resolve().then(function(){z===Je.current&&($e==null||$e(Ce.current),Ce.current=[])}),X==null||X(K,Q,re)},[$e,X]);return L.createElement(S.Provider,{value:j},We)}function R(Te){var We=Te.children,$e=Te.disabled,Je=L.useRef(null),Ce=L.useRef(null),X=L.useContext(S),j=L.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),K=L.isValidElement(We)&&Object(E.c)(We),Q=K?We.ref:null,re=L.useMemo(function(){return Object(E.a)(Q,Je)},[Q,Je]),z=L.useRef(Te);z.current=Te;var we=L.useCallback(function(Ue){var rt=z.current,le=rt.onResize,Oe=rt.data,Fe=Ue.getBoundingClientRect(),Ye=Fe.width,Tt=Fe.height,Nt=Ue.offsetWidth,Xt=Ue.offsetHeight,tt=Math.floor(Ye),Zt=Math.floor(Tt);if(j.current.width!==tt||j.current.height!==Zt||j.current.offsetWidth!==Nt||j.current.offsetHeight!==Xt){var vn={width:tt,height:Zt,offsetWidth:Nt,offsetHeight:Xt};j.current=vn;var ze=Nt===Math.round(Ye)?Ye:Nt,He=Xt===Math.round(Tt)?Tt:Xt,vt=Object(W.a)(Object(W.a)({},vn),{},{offsetWidth:ze,offsetHeight:He});X==null||X(vt,Ue,Oe),le&&Promise.resolve().then(function(){le(vt,Ue)})}},[]);return L.useEffect(function(){var Ue=Object(p.a)(Je.current)||Object(p.a)(Ce.current);return Ue&&!$e&&i(Ue,we),function(){return n(Ue,we)}},[Je.current,$e]),L.createElement(O,{ref:Ce},K?L.cloneElement(We,{ref:re}):We)}var T="rc-observer-key";function v(Te){var We=Te.children,$e=Object(r.a)(We);return $e.map(function(Je,Ce){var X=(Je==null?void 0:Je.key)||"".concat(T,"-").concat(Ce);return L.createElement(R,Object(Z.a)({},Te,{key:X}),Je)})}v.Collection=C;var b=v,f=D("bT9E"),h=D("TSYQ"),_=D.n(h),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
`,x=["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"],N={},F;function A(Te){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$e=Te.getAttribute("id")||Te.getAttribute("data-reactid")||Te.getAttribute("name");if(We&&N[$e])return N[$e];var Je=window.getComputedStyle(Te),Ce=Je.getPropertyValue("box-sizing")||Je.getPropertyValue("-moz-box-sizing")||Je.getPropertyValue("-webkit-box-sizing"),X=parseFloat(Je.getPropertyValue("padding-bottom"))+parseFloat(Je.getPropertyValue("padding-top")),j=parseFloat(Je.getPropertyValue("border-bottom-width"))+parseFloat(Je.getPropertyValue("border-top-width")),K=x.map(function(re){return"".concat(re,":").concat(Je.getPropertyValue(re))}).join(";"),Q={sizingStyle:K,paddingSize:X,borderSize:j,boxSizing:Ce};return We&&$e&&(N[$e]=Q),Q}function B(Te){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Je=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),document.body.appendChild(F)),Te.getAttribute("wrap")?F.setAttribute("wrap",Te.getAttribute("wrap")):F.removeAttribute("wrap");var Ce=A(Te,We),X=Ce.paddingSize,j=Ce.borderSize,K=Ce.boxSizing,Q=Ce.sizingStyle;F.setAttribute("style","".concat(Q,";").concat(g)),F.value=Te.value||Te.placeholder||"";var re=Number.MIN_SAFE_INTEGER,z=Number.MAX_SAFE_INTEGER,we=F.scrollHeight,Ue;if(K==="border-box"?we+=j:K==="content-box"&&(we-=X),$e!==null||Je!==null){F.value=" ";var rt=F.scrollHeight-X;$e!==null&&(re=rt*$e,K==="border-box"&&(re=re+X+j),we=Math.max(re,we)),Je!==null&&(z=rt*Je,K==="border-box"&&(z=z+X+j),Ue=we>z?"":"hidden",we=Math.min(z,we))}return{height:we,minHeight:re,maxHeight:z,overflowY:Ue,resize:"none"}}var U=D("Gytx"),w=D.n(U),Y;(function(Te){Te[Te.NONE=0]="NONE",Te[Te.RESIZING=1]="RESIZING",Te[Te.RESIZED=2]="RESIZED"})(Y||(Y={}));var q=function(Te){Object(G.a)($e,Te);var We=Object(P.a)($e);function $e(Je){var Ce;return Object(V.a)(this,$e),Ce=We.call(this,Je),Ce.nextFrameActionId=void 0,Ce.resizeFrameId=void 0,Ce.textArea=void 0,Ce.saveTextArea=function(X){Ce.textArea=X},Ce.handleResize=function(X){var j=Ce.state.resizeStatus,K=Ce.props,Q=K.autoSize,re=K.onResize;if(j!==Y.NONE)return;typeof re=="function"&&re(X),Q&&Ce.resizeOnNextFrame()},Ce.resizeOnNextFrame=function(){cancelAnimationFrame(Ce.nextFrameActionId),Ce.nextFrameActionId=requestAnimationFrame(Ce.resizeTextarea)},Ce.resizeTextarea=function(){var X=Ce.props.autoSize;if(!X||!Ce.textArea)return;var j=X.minRows,K=X.maxRows,Q=B(Ce.textArea,!1,j,K);Ce.setState({textareaStyles:Q,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(Ce.resizeFrameId),Ce.resizeFrameId=requestAnimationFrame(function(){Ce.setState({resizeStatus:Y.RESIZED},function(){Ce.resizeFrameId=requestAnimationFrame(function(){Ce.setState({resizeStatus:Y.NONE}),Ce.fixFirefoxAutoScroll()})})})})},Ce.renderTextArea=function(){var X=Ce.props,j=X.prefixCls,K=j===void 0?"rc-textarea":j,Q=X.autoSize,re=X.onResize,z=X.className,we=X.disabled,Ue=Ce.state,rt=Ue.textareaStyles,le=Ue.resizeStatus,Oe=Object(f.a)(Ce.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Fe=_()(K,z,Object(k.a)({},"".concat(K,"-disabled"),we));"value"in Oe&&(Oe.value=Oe.value||"");var Ye=Object(W.a)(Object(W.a)(Object(W.a)({},Ce.props.style),rt),le===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return L.createElement(b,{onResize:Ce.handleResize,disabled:!(Q||re)},L.createElement("textarea",Object(Z.a)({},Oe,{className:Fe,style:Ye,ref:Ce.saveTextArea})))},Ce.state={textareaStyles:{},resizeStatus:Y.NONE},Ce}return Object(I.a)($e,[{key:"componentDidUpdate",value:function(Ce){(Ce.value!==this.props.value||!w()(Ce.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 Ce=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(Ce,X)}}catch(j){}}},{key:"render",value:function(){return this.renderTextArea()}}]),$e}(L.Component),ce=q,Ee=function(Te){Object(G.a)($e,Te);var We=Object(P.a)($e);function $e(Je){var Ce;Object(V.a)(this,$e),Ce=We.call(this,Je),Ce.resizableTextArea=void 0,Ce.focus=function(){Ce.resizableTextArea.textArea.focus()},Ce.saveTextArea=function(j){Ce.resizableTextArea=j},Ce.handleChange=function(j){var K=Ce.props.onChange;Ce.setValue(j.target.value,function(){Ce.resizableTextArea.resizeTextarea()}),K&&K(j)},Ce.handleKeyDown=function(j){var K=Ce.props,Q=K.onPressEnter,re=K.onKeyDown;j.keyCode===13&&Q&&Q(j),re&&re(j)};var X=typeof Je.value=="undefined"||Je.value===null?Je.defaultValue:Je.value;return Ce.state={value:X},Ce}return Object(I.a)($e,[{key:"setValue",value:function(Ce,X){"value"in this.props||this.setState({value:Ce},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return L.createElement(ce,Object(Z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Ce){return"value"in Ce?{value:Ce.value}:null}}]),$e}(L.Component),Qe=_e.default=Ee},ZW9T:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return U});var Z=D("k1fw"),V=D("oBTY"),I=D("miYZ"),G=D("tsqr"),P=D("rAM+"),L=D("tJVT"),W=D("PpiC"),k=D("q1tI"),r=D.n(k),M=D("bdgK"),E=D("9og8"),p=D("WmNS"),m=D.n(p),u={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},a={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"]},o={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(ce){return{label:ce,kind:Y.languages.CompletionItemKind.Keyword,insertText:ce}})},S=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 ce=n.tables[Y];return ce?ce.map(function(Ee){return{label:Ee,kind:q.languages.CompletionItemKind.Field,insertText:Ee}}):[]};function R(w,Y,q,ce,Ee){var Qe=Y.getWordUntilPosition(q),Te={startLineNumber:q.lineNumber,endLineNumber:q.lineNumber,startColumn:Qe.startColumn,endColumn:Qe.endColumn},We=ce.map(function($e){return{label:$e,kind:w.languages.CompletionItemKind.Keyword,insertText:$e,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Te}});return Ee.map(function($e){We.push(Object(Z.a)(Object(Z.a)({},$e),{},{range:Te}))}),We}var T=function(w){n.languages.map(function(Ee){return w.languages.registerDocumentFormattingEditProvider(Ee,{provideDocumentFormattingEdits:function(Te,We,$e){return Object(E.a)(m.a.mark(function Je(){var Ce;return m.a.wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return Ce=i()(Te.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}),j.abrupt("return",[{range:Te.getFullModelRange(),text:Ce}]);case 2:case"end":return j.stop()}},Je)}))()}}),Ee});var Y=o.quickKey.map(function(Ee){return{label:Ee.label,kind:w.languages.CompletionItemKind.Method,insertText:Ee.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),q=c.quickKey.map(function(Ee){return{label:Ee.label,kind:w.languages.CompletionItemKind.Method,insertText:Ee.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ce=a.quickKey.map(function(Ee){return{label:Ee.label,kind:w.languages.CompletionItemKind.Method,insertText:Ee.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet}});w.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Qe,Te){var We=Qe.getWordUntilPosition(Te),$e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Je=Qe.getLineContent(Te.lineNumber).substring(We.startColumn-2,We.endColumn);return{suggestions:[].concat(Object(V.a)(o.keywords.map(function(Ce){return{label:Ce,kind:w.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}})),Object(V.a)(o.quickKey.map(function(Ce){return{label:Ce.label,kind:w.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Je.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}})))}}}),w.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Qe,Te){var We=Qe.getWordUntilPosition(Te),$e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn};return{suggestions:Object(V.a)(u.keywords.map(function(Je){return{label:Je,kind:w.languages.CompletionItemKind.Function,documentation:Je,insertText:Je,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}}))}}}),w.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Qe,Te){var We=Qe.getWordUntilPosition(Te),$e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Je=Qe.getLineContent(Te.lineNumber).substring(We.startColumn-2,We.endColumn);return{suggestions:[].concat(Object(V.a)(a.keywords.map(function(Ce){return{label:Ce,kind:w.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}})),Object(V.a)(a.quickKey.map(function(Ce){return{label:Ce.label,kind:w.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Je.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}})))}}}),w.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Qe,Te){var We=Qe.getWordUntilPosition(Te),$e={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:We.startColumn,endColumn:We.endColumn},Je=Qe.getLineContent(Te.lineNumber).substring(We.startColumn-2,We.endColumn);return{suggestions:[].concat(Object(V.a)(c.keywords.map(function(Ce){return{label:Ce,kind:w.languages.CompletionItemKind.Function,documentation:Ce,insertText:Ce,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}})),Object(V.a)(c.quickKey.map(function(Ce){return{label:Ce.label,kind:w.languages.CompletionItemKind.Function,documentation:Ce.content,insertText:Je.startsWith("#")?Ce.content.replace(/#/,""):Ce.content,insertTextRules:w.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:$e}})))}}})},v="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=D("fjLI"),f=D("LvDl"),h=D("+ua5");function _(w){return/^\d+$/.test(w)?"".concat(w,"px"):w}function g(){}var x=!1,N={"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 F(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=w;if(Array.isArray(w)){for(var q=0;q<w.length;q++){var ce=N[w[q]];if(ce)return ce}return Y[0]}return N[Y]||Y}var A=null,B=_e.b=function(w){var Y=w.width,q=Y===void 0?"100%":Y,ce=w.height,Ee=ce===void 0?"100%":ce,Qe=w.value,Te=w.language,We=Te===void 0?"javascript":Te,$e=w.style,Je=$e===void 0?{}:$e,Ce=w.options,X=Ce===void 0?{}:Ce,j=w.overrideServices,K=j===void 0?{}:j,Q=w.theme,re=Q===void 0?"vs-dark":Q,z=w.onEditBlur,we=w.onSave,Ue=w.autoHeight,rt=Ue===void 0?!1:Ue,le=w.forbidCopy,Oe=le===void 0?!1:le,Fe=w.onChange,Ye=Fe===void 0?g:Fe,Tt=w.editorDidMount,Nt=Tt===void 0?g:Tt,Xt=w.onFocus,tt=Xt===void 0?g:Xt,Zt=w.filename,vn=Zt===void 0?"educoder.txt":Zt,ze=w.errorLine,He=w.errorContent,vt=He===void 0?"":He,Rt=Object(W.a)(w,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),de=Object(k.useRef)(),ee=Object(k.useRef)({}),ne=Object(k.useRef)(),se=Object(k.useRef)(),pe=Object(k.useRef)(!1),ae=Object(k.useRef)(),ie=Object(k.useState)(!1),me=Object(L.a)(ie,2),ye=me[0],xe=me[1];function De(){var gt;return de.current&&(gt=new M.default(function(Ht){var Vt=Object(P.a)(Ht),dn;try{for(Vt.s();!(dn=Vt.n()).done;){var Zn=dn.value;(Zn.target.offsetHeight>0||Zn.target.offsetWidth>0)&&ee.current.instance.layout()}}catch(Wn){Vt.e(Wn)}finally{Vt.f()}}),gt.observe(de.current)),gt}function ct(){G.b.warn(decodeURIComponent(v))}var It=function(){var Ht=ee.current.instance;if(Qe!=null&&Ht&&ye){var Vt=Ht.getModel();Vt&&Qe!==Vt.getValue()&&(x=!0,Vt.setValue(Qe),Ht.layout(),x=!1)}};Object(k.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){It()},500)},[Qe,ye,ee.current]),Object(k.useEffect)(function(){if(ze&&ee.current&&ee.current.instance){var gt=ee.current.instance;gt.changeViewZones(function(Vt){var dn=document.createElement("div");dn.style.padding="10px 20px",dn.style.width="calc(100% - 20px)",dn.className="my-error-line-wrp",dn.innerHTML=vt,Vt.addZone({afterLineNumber:ze||11,heightInLines:3,domNode:dn})});var Ht={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}};gt.addOverlayWidget(Ht),gt.revealPositionInCenter({lineNumber:20,column:1})}},[ze,ee.current,ye]);function un(){var gt=ee.current.instance;if(gt){var Ht=gt.getSelection(),Vt=ee.current.pastePos||{},dn=new A.Range(Vt.startLineNumber||Ht.endLineNumber,Vt.startColumn||Ht.endColumn,Vt.endLineNumber||Ht.endLineNumber,Vt.endColumn||Ht.endColumn);setTimeout(function(){gt.executeEdits("",[{range:dn,text:""}])},300)}}function mt(gt){(window.navigator.platform.match("Mac")?gt.metaKey:gt.ctrlKey)&&gt.keyCode==83&&(gt.preventDefault(),we())}var Qt=function(){if(rt&&ee.current.instance){var Ht=ee.current.instance.getContentHeight();Ve(Ht<Ee?Ee:Ht)}else Ve(Ee)};function ht(gt){var Ht=document.createEvent("MouseEvents");Ht.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),gt.dispatchEvent(Ht)}function Et(gt,Ht){var Vt=window.URL||window.webkitURL||window,dn=new Blob([Ht]),Zn=document.createElementNS("http://www.w3.org/1999/xhtml","a");Zn.href=Vt.createObjectURL(dn),Zn.download=gt,ht(Zn)}Object(k.useEffect)(function(){Qt()},[Qt]),Object(k.useEffect)(function(){de.current&&!ye&&Promise.all([D.e(18),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(gt){try{A=gt,ee.current.instance=A.editor.create(de.current,{value:Qe,language:F(We),theme:re,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},K);var Ht=ee.current.instance,Vt=b.d._menuItems,dn=Object(V.a)(Vt).find(function(ir){return ir[0]._debugName=="EditorContext"}),Zn=dn[1],Wn=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],tn=function(Dn,Vn){var qn=Dn._first;do{var Mr,Sr,on=Vn.includes((Mr=qn.element)===null||Mr===void 0||((Sr=Mr.command)===null||Sr===void 0)?void 0:Sr.id);on&&Dn._remove(qn)}while(qn=qn.next)};if(Nt(Ht,A),setTimeout(function(){Qt(),ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Et(vn||"educoder.txt",Ht.getValue())}}),Ht.getDomNode().addEventListener("input",function(){ne.current.autoFormat&&Ht.getAction("editor.action.formatDocument").run()})},500),ee.current.subscription=Ht.onDidChangeModelContent(function(ir){pe.current?clearTimeout(ae.current):(Qt(),Ye(Ht.getValue(),ir)),ae.current=setTimeout(function(){pe.current=!1},500)}),window.Monaco||T(A,F(We)),Oe&&(tn(Zn,Wn),de.current.classList.add("noCopyPaste"),Ht.onKeyDown(function(ir){var Dn=ir.keyCode,Vn=ir.ctrlKey,qn=ir.metaKey;(Dn===33||Dn===52)&&(qn||Vn)&&(ct(),ir.preventDefault())})),window.Monaco=A,z&&Ht.onDidBlurEditorWidget(function(){z(Ht.getValue())}),tt&&Ht.onDidFocusEditorText(function(){tt(Ht.getValue())}),Oe){Ht.addCommand(A.KeyMod.CtrlCmd|A.KeyCode.KEY_V,function(){return ct(),null}),Ht.onDidPaste(function(ir){ee.current.pastePos=ir});try{window.addEventListener("paste",un)}catch(ir){}}var Hn=De();return xe(!0),function(){var ir=ee.current.instance;ir.dispose();var Dn=ir.getModel();Dn&&Dn.dispose(),ee.current.subscription&&ee.current.subscription.dispose(),Oe&&window.removeEventListener("paste",un),Hn.unobserve(de.current)}}catch(ir){}})},[]),Object(k.useEffect)(function(){var gt=ee.current.instance;if(gt&&ye)return document.addEventListener("keydown",mt,!1),function(){document.removeEventListener("keydown",mt)}},[we,ye]),Object(k.useEffect)(function(){var gt=ee.current.instance;if(gt&&ye){var Ht=F(We);A.editor.setModelLanguage(gt.getModel(),Ht),console.log("language:",We,gt.getModel(),Ht)}},[We,ye]),Object(k.useEffect)(function(){var gt=ee.current.instance;gt&&ye&&A.editor.setTheme(re)},[re,ye]),Object(k.useEffect)(function(){var gt=ee.current.instance;ne.current=X,gt&&ye&&(gt.updateOptions(Object(Z.a)({},X)),setTimeout(function(){gt.getModel().updateOptions(Object(Z.a)({},X))},200))},[JSON.stringify(X),ye]),Object(k.useEffect)(function(){var gt=ee.current.instance;gt&&ye&&gt.layout()},[q,Ee,ye]);var it=Object(k.useState)(_(q)),ve=Object(L.a)(it,2),Me=ve[0],St=ve[1],lt=Object(k.useState)(_(Ee)),Gt=Object(L.a)(lt,2),qt=Gt[0],Ve=Gt[1],et=Object(Z.a)(Object(Z.a)({},Je),{},{width:Me,height:qt});return r.a.createElement("div",{className:"my-monaco-editor",ref:de,style:et})};function U(w){var Y=w.width,q=Y===void 0?"100%":Y,ce=w.height,Ee=ce===void 0?"100%":ce,Qe=w.original,Te=w.modified,We=w.language,$e=w.options,Je=$e===void 0?{}:$e,Ce=Object(k.useRef)(),X=Object(k.useState)(null),j=Object(L.a)(X,2),K=j[0],Q=j[1];function re(rt){var le;return Ce.current&&(le=new M.default(function(Oe){var Fe=Object(P.a)(Oe),Ye;try{for(Fe.s();!(Ye=Fe.n()).done;){var Tt=Ye.value;(Tt.target.offsetHeight>0||Tt.target.offsetWidth>0)&&rt.layout()}}catch(Nt){Fe.e(Nt)}finally{Fe.f()}}),le.observe(Ce.current)),le}Object(k.useEffect)(function(){Ce.current&&Promise.all([D.e(18),D.e(29)]).then(D.t.bind(null,"M/lh",7)).then(function(rt){A=rt;var le=A.editor.createDiffEditor(Ce.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},Je),{},{wordWrap:!0}));Q(le);var Oe=re(le);return function(){le.dispose();var Fe=le.getModel();Fe&&Fe.dispose(),Oe.unobserve(Ce.current)}})},[]),Object(k.useEffect)(function(){K&&K.setModel({original:A.editor.createModel(Qe,We),modified:A.editor.createModel(Te,We)})},[Qe,Te,We,K]);var z=_(q),we=_(Ee),Ue={width:z,height:we};return r.a.createElement("div",{className:"my-diff-editor",ref:Ce,style:Ue})}},bT9E:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return V});var Z=D("VTBJ");function V(I,G){var P=Object(Z.a)({},I);return Array.isArray(G)&&G.forEach(function(L){delete P[L]}),P}},bTeP:function(jt,_e,D){jt.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(jt,_e,D){"use strict";var Z=D("q1tI"),V=D.n(Z),I=Z.createContext(null);_e.a=I},c5Ni:function(jt,_e,D){},deN7:function(jt,_e,D){"use strict";var Z=D("/zsF"),V=D("PArb"),I=D("14J3"),G=D("BMrR"),P=D("jCWc"),L=D("kPKH"),W=D("+L6B"),k=D("2/Rp"),r=D("miYZ"),M=D("tsqr"),E=D("9og8"),p=D("giR+"),m=D("fyUT"),u=D("2qtc"),a=D("kLXV"),o=D("7Kak"),c=D("9yH6"),s=D("tJVT"),i=D("k1fw"),n=D("OaEy"),O=D("2fM7"),S=D("WmNS"),C=D.n(S),R=D("q1tI"),T=D.n(R),v=D("ZW9T"),b=D("F0VM"),f=D.n(b),h=D("xKgJ"),_=D("J66h"),g=D.n(_),x=D("ErOA"),N=D("Ty5D"),F=D("9Bee"),A=D("XYT7"),B=D("RCxd"),U=D("/MfK"),w=O.a.Option,Y={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1},q;(function(Ee){Ee[Ee.SET_PATH=0]="SET_PATH",Ee[Ee.GET_PASSED_CONTENT=1]="GET_PASSED_CONTENT"})(q||(q={}));function ce(Ee,Qe){switch(Qe.type){case q.SET_PATH:return Object(i.a)(Object(i.a)({},Ee),{},{selectedPath:Qe.payload});case q.GET_PASSED_CONTENT:return Object(i.a)(Object(i.a)({},Ee),{},{passedContent:Qe.payload});default:throw new Error}}_e.a=function(Ee){var Qe=Ee.language,Te=Ee.dispatch,We=Ee.shixunWorkReport,$e=Ee.v,Je=Ee.languages,Ce=Ee.onPathChange,X=Ee.autoHeight,j=Ee.diff_code_count,K=Ee.data,Q=Object(R.useState)(Je==null?void 0:Je[0]),re=Object(s.a)(Q,2),z=re[0],we=re[1],Ue=We!="shixunWorkReport"&&Object(N.i)();return Object(R.useEffect)(function(){we(Je==null?void 0:Je[0])},[]),Object(R.useEffect)(function(){var rt;we(Je==null||((rt=Je.filter(function(le){return le.language===(z==null?void 0:z.language)}))===null||rt===void 0)?void 0:rt[0])},[Je]),T.a.createElement(T.a.Fragment,null,T.a.createElement("h2",null," ",T.a.createElement("span",null,T.a.createElement("span",null,"\u6700\u540E\u901A\u5173\u7684\u4EE3\u7801"),(Je==null?void 0:Je.length)>1&&T.a.createElement(c.a.Group,{defaultValue:Qe,style:{marginLeft:10},onChange:function(le){var Oe;we(Je==null||((Oe=Je.filter(function(Fe){return Fe.language===le.target.value}))===null||Oe===void 0)?void 0:Oe[0])}},Je==null?void 0:Je.map(function(rt){return T.a.createElement(c.a,{value:rt==null?void 0:rt.language},rt==null?void 0:rt.language)}))),Object(h.c)()&&We!="shixunWorkReport"&&T.a.createElement("span",null,T.a.createElement("span",null,"\u5F97\u5206 ",z==null?void 0:z.score,"/",z==null?void 0:z.total_score),T.a.createElement(k.a,{style:{margin:"0px 10px"},onClick:function(){var le=z==null?void 0:z.score;a.a.confirm({title:"\u8C03\u5206",content:T.a.createElement("div",null,T.a.createElement("p",null,"\u5F97\u5206\uFF1A",z==null?void 0:z.score,"/",z==null?void 0:z.total_score),T.a.createElement("p",null,"\u8C03\u5206\uFF1A",T.a.createElement(m.a,{min:0,max:z==null?void 0:z.total_score,defaultValue:z==null?void 0:z.score,onChange:function(Fe){le=Fe}}))),okText:"\u786E\u8BA4",onOk:function(){var Oe=Object(E.a)(C.a.mark(function Ye(){var Tt;return C.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,Object(x.a)("/api/courses/".concat(Ue==null?void 0:Ue.coursesId,"/homework_commons/update_hack_score"),{method:"put",body:{course_id:Ue==null?void 0:Ue.coursesId,hack_user_code_id:z==null?void 0:z.hack_user_id,score:le}});case 2:Tt=Xt.sent,Tt.status===0&&(M.b.success("\u8C03\u5206\u6210\u529F"),Te({type:"shixunHomeworks/setActionTabs",payload:{}}),Te({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},Ue)}));case 4:case"end":return Xt.stop()}},Ye)}));function Fe(){return Oe.apply(this,arguments)}return Fe}(),cancelText:"\u53D6\u6D88"})},type:"primary"},"\u8C03\u5206"),Object(h.c)()&&We!="shixunWorkReport"&&T.a.createElement(k.a,{onClick:function(){Te({type:"shixunHomeworks/setActionTabs",payload:{key:"\u66F4\u6539\u70B9\u8BC4",selectArrs:{myshixun_identifier:We.user_id,type:"1",language:z==null?void 0:z.language,v:$e,data:Object(i.a)({},We)}}})}},"\u70B9\u8BC4\u4EE3\u7801"))),T.a.createElement(v.b,{height:300,language:z==null?void 0:z.language,value:_.Base64.decode(z==null?void 0:z.code),autoHeight:X,theme:"default",options:Y}),((z==null?void 0:z.comment)||(z==null?void 0:z.hidden_comment))&&T.a.createElement("div",null,T.a.createElement(G.a,{align:"middle",style:{borderTop:"1px solid #eee"}},T.a.createElement(L.a,{flex:1},T.a.createElement("h1",{className:f.a.title},"\u70B9\u8BC4\u5185\u5BB9")),T.a.createElement(L.a,{className:"pr30"},Object(h.c)()&&T.a.createElement(k.a,{onClick:Object(E.a)(C.a.mark(function rt(){return C.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:a.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",icon:T.a.createElement(B.a,null),content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",onOk:function(){return Object(E.a)(C.a.mark(function Ye(){var Tt;return C.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return Xt.next=2,Object(A.m)({comment_id:z==null?void 0:z.comment_id,homeworkId:Ue.homeworkId,type:"hack"});case 2:Tt=Xt.sent,Tt.status===0&&(M.b.success("\u5220\u9664\u6210\u529F"),Te({type:"shixunHomeworks/getShixunWorkReports",payload:Object(i.a)({},Ue)}));case 4:case"end":return Xt.stop()}},Ye)}))()}});case 1:case"end":return Oe.stop()}},rt)}))},T.a.createElement(U.a,null),"\u5220\u9664"))),T.a.createElement(V.a,{style:{margin:0}}),(z==null?void 0:z.comment)&&T.a.createElement("aside",{className:"pl30 pr30 mt20"},T.a.createElement("span",{className:"c-light-black font12"},"# \u5B66\u751F\u548C\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),T.a.createElement("br",null),T.a.createElement(F.a,{value:z==null?void 0:z.comment})),(z==null?void 0:z.hidden_comment)&&T.a.createElement("aside",{className:"pl30 pr30 mt20"},T.a.createElement("span",{className:"c-light-black font12"},"# \u4EC5\u8BFE\u5802\u8001\u5E08\u53EF\u89C1"),T.a.createElement("br",null),T.a.createElement(F.a,{value:z==null?void 0:z.hidden_comment}))))}},dejd:function(jt,_e,D){},dmUQ:function(jt,_e,D){"use strict";var Z=D("Ff2n"),V=D("rePB"),I=D("1OyB"),G=D("vuIU"),P=D("Ji7U"),L=D("md7G"),W=D("foSv"),k=D("q1tI"),r=D.n(k),M=D("TSYQ"),E=D.n(M),p=D("4IlW");function m(f,h){var _=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable})),_.push.apply(_,g)}return _}function u(f){for(var h=1;h<arguments.length;h++){var _=arguments[h]!=null?arguments[h]:{};h%2?m(Object(_),!0).forEach(function(g){Object(V.a)(f,g,_[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(_)):m(Object(_)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(_,g))})}return f}function a(f){var h=o();return function(){var g=Object(W.a)(f),x;if(h){var N=Object(W.a)(this).constructor;x=Reflect.construct(g,arguments,N)}else x=g.apply(this,arguments);return Object(L.a)(this,x)}}function o(){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(f){return!1}}function c(){}function s(f){f.preventDefault()}var i=function(h){return h.replace(/[^\w.-]+/g,"")},n=200,O=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,C=function(h){return h!=null},R=function(h,_){return _===h||typeof _=="number"&&typeof h=="number"&&isNaN(_)&&isNaN(h)},T=function(f){Object(P.a)(_,f);var h=a(_);function _(g){var x;Object(I.a)(this,_),x=h.call(this,g),x.onKeyDown=function(A){var B=x.props,U=B.onKeyDown,w=B.onPressEnter;if(A.keyCode===p.a.UP){var Y=x.getRatio(A);x.up(A,Y,null),x.stop()}else if(A.keyCode===p.a.DOWN){var q=x.getRatio(A);x.down(A,q,null),x.stop()}else A.keyCode===p.a.ENTER&&w&&w(A);if(x.recordCursorPosition(),x.lastKeyCode=A.keyCode,U){for(var ce=arguments.length,Ee=new Array(ce>1?ce-1:0),Qe=1;Qe<ce;Qe++)Ee[Qe-1]=arguments[Qe];U.apply(void 0,[A].concat(Ee))}},x.onKeyUp=function(A){var B=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),B){for(var U=arguments.length,w=new Array(U>1?U-1:0),Y=1;Y<U;Y++)w[Y-1]=arguments[Y];B.apply(void 0,[A].concat(w))}},x.onChange=function(A){var B=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(A)),x.setState({inputValue:x.rawInput}),B(x.toNumber(x.rawInput))},x.onMouseUp=function(){var A=x.props.onMouseUp;x.recordCursorPosition(),A&&A.apply(void 0,arguments)},x.onFocus=function(){var A;x.setState({focused:!0}),(A=x.props).onFocus.apply(A,arguments)},x.onBlur=function(){var A=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var B=x.getCurrentValidValue(x.state.inputValue),U=x.setValue(B,c);if(A){var w=x.input.value,Y=x.getInputDisplayValue({focus:!1,value:U});x.input.value=Y&&Number(Y),A.apply(void 0,arguments),x.input.value=w}},x.getRatio=function(A){var B=1;return A.metaKey||A.ctrlKey?B=.1:A.shiftKey&&(B=10),B},x.getFullNum=function(A){return isNaN(A)?A:/e/i.test(String(A))?Number(A).toFixed(18).replace(/\.?0+$/,""):A},x.getPrecision=function(A){if(C(x.props.precision))return x.props.precision;var B=String(A);if(B.indexOf("e-")>=0)return parseInt(B.slice(B.indexOf("e-")+2),10);var U=0;return B.indexOf(".")>=0&&(U=B.length-B.indexOf(".")-1),U},x.getInputDisplayValue=function(A){var B=A||x.state,U=B.focused,w=B.inputValue,Y=B.value,q;U?q=w:q=x.toPrecisionAsStep(Y),q==null&&(q="");var ce=x.formatWrapper(q);return C(x.props.decimalSeparator)&&(ce=ce.toString().replace(".",x.props.decimalSeparator)),ce},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(A){}},x.restoreByAfter=function(A){if(A===void 0)return!1;var B=x.input.value,U=B.lastIndexOf(A);if(U===-1)return!1;var w=x.cursorBefore.length;return x.lastKeyCode===p.a.DELETE&&x.cursorBefore.charAt(w-1)===A[0]?(x.fixCaret(w,w),!0):U+A.length===B.length?(x.fixCaret(U,U),!0):!1},x.partRestoreByAfter=function(A){return A===void 0?!1:Array.prototype.some.call(A,function(B,U){var w=A.substring(U);return x.restoreByAfter(w)})},x.isNotCompleteNumber=function(A){return isNaN(A)||A===""||A===null||A&&A.toString().indexOf(".")===A.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(A,B,U){x.pressingUpOrDown=!0,x.step("down",A,B,U)},x.up=function(A,B,U){x.pressingUpOrDown=!0,x.step("up",A,B,U)},x.saveInput=function(A){x.input=A};var N=g.value;N===void 0&&(N=g.defaultValue),x.state={focused:g.autoFocus};var F=x.getValidValue(x.toNumber(N));return x.state=u(u({},x.state),{},{inputValue:x.toPrecisionAsStep(F),value:F}),x}return Object(G.a)(_,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var N=this.props,F=N.value,A=N.onChange,B=N.max,U=N.min,w=this.state.focused;if(x){if(!R(x.value,F)||!R(x.max,B)||!R(x.min,U)){var Y=w?F:this.getValidValue(F),q;this.pressingUpOrDown?q=Y:this.inputting?q=this.rawInput:q=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:q})}var ce="value"in this.props?F:this.state.value;"max"in this.props&&x.max!==B&&typeof ce=="number"&&ce>B&&A&&A(B),"min"in this.props&&x.min!==U&&typeof ce=="number"&&ce<U&&A&&A(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?Ee=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(Ee=this.cursorStart):Ee=this.input.value.length,this.fixCaret(Ee,Ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Qe){}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(x){var N=x;return N===""?N="":this.isNotCompleteNumber(parseFloat(N))?N=this.state.value:N=this.getValidValue(N),this.toNumber(N)}},{key:"getValueFromEvent",value:function(x){var N=x.target.value.trim().replace(/。/g,".");return C(this.props.decimalSeparator)&&(N=N.replace(this.props.decimalSeparator,".")),N}},{key:"getValidValue",value:function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,A=parseFloat(x);return isNaN(A)?x:(A<N&&(A=N),A>F&&(A=F),A)}},{key:"setValue",value:function(x,N){var F=this.props.precision,A=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),B=this.state.value,U=B===void 0?null:B,w=this.state.inputValue,Y=w===void 0?null:w,q=typeof A=="number"?A.toFixed(F):"".concat(A),ce=A!==U||q!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},N)):this.setState({value:A,inputValue:this.toPrecisionAsStep(x)},N),ce&&this.props.onChange(A),A}},{key:"getMaxPrecision",value:function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.props,A=F.precision,B=F.step;if(C(A))return A;var U=this.getPrecision(N),w=this.getPrecision(B),Y=this.getPrecision(x);return x?Math.max(Y,U+w):U+w}},{key:"getPrecisionFactor",value:function(x){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,F=this.getMaxPrecision(x,N);return Math.pow(10,F)}},{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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var N=Math.abs(this.getMaxPrecision(x));return isNaN(N)?x.toString():Number(x).toFixed(N)}},{key:"toNumber",value:function(x){var N=this.props.precision,F=this.state.focused,A=x&&x.length>16&&F;return this.isNotCompleteNumber(x)||A?x:C(N)?Math.round(x*Math.pow(10,N))/Math.pow(10,N):Number(x)}},{key:"upStep",value:function(x,N){var F=this.props.step,A=this.getPrecisionFactor(x,N),B=Math.abs(this.getMaxPrecision(x,N)),U=((A*x+A*F*N)/A).toFixed(B);return this.toNumber(U)}},{key:"downStep",value:function(x,N){var F=this.props.step,A=this.getPrecisionFactor(x,N),B=Math.abs(this.getMaxPrecision(x,N)),U=((A*x-A*F*N)/A).toFixed(B);return this.toNumber(U)}},{key:"step",value:function(x,N){var F=this,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,B=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var U=this.props;if(U.disabled)return;var w=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(w))return;var Y=this["".concat(x,"Step")](w,A),q=Y>U.max||Y<U.min;if(Y>U.max?Y=U.max:Y<U.min&&(Y=U.min),this.setValue(Y,null),this.setState({focused:!0},function(){F.pressingUpOrDown=!1}),q)return;this.autoStepTimer=setTimeout(function(){F[x](N,A,!0)},B?n:O)}},{key:"fixCaret",value:function(x,N){if(x===void 0||N===void 0||!this.input||!this.input.value)return;try{var F=this.input.selectionStart,A=this.input.selectionEnd;(x!==F||N!==A)&&this.input.setSelectionRange(x,N)}catch(B){}}},{key:"render",value:function(){var x,N=this.props,F=N.prefixCls,A=N.disabled,B=N.readOnly,U=N.useTouch,w=N.autoComplete,Y=N.upHandler,q=N.downHandler,ce=N.className,Ee=N.max,Qe=N.min,Te=N.style,We=N.title,$e=N.onMouseEnter,Je=N.onMouseLeave,Ce=N.onMouseOver,X=N.onMouseOut,j=N.required,K=N.onClick,Q=N.tabIndex,re=N.type,z=N.placeholder,we=N.id,Ue=N.inputMode,rt=N.pattern,le=N.step,Oe=N.maxLength,Fe=N.autoFocus,Ye=N.name,Tt=N.onPaste,Nt=N.onInput,Xt=Object(Z.a)(N,["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"]),tt=this.state,Zt=tt.value,vn=tt.focused,ze=E()(F,(x={},Object(V.a)(x,ce,!!ce),Object(V.a)(x,"".concat(F,"-disabled"),A),Object(V.a)(x,"".concat(F,"-focused"),vn),x)),He={};Object.keys(Xt).forEach(function(ye){(ye.substr(0,5)==="data-"||ye.substr(0,5)==="aria-"||ye==="role")&&(He[ye]=Xt[ye])});var vt=!B&&!A,Rt=this.getInputDisplayValue(null),de=(Zt||Zt===0)&&(isNaN(Zt)||Number(Zt)>=Ee),ee=(Zt||Zt===0)&&(isNaN(Zt)||Number(Zt)<=Qe),ne=de||A||B,se=ee||A||B,pe=E()("".concat(F,"-handler"),"".concat(F,"-handler-up"),Object(V.a)({},"".concat(F,"-handler-up-disabled"),ne)),ae=E()("".concat(F,"-handler"),"".concat(F,"-handler-down"),Object(V.a)({},"".concat(F,"-handler-down-disabled"),se)),ie=U?{onTouchStart:ne?c:this.up,onTouchEnd:this.stop}:{onMouseDown:ne?c:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},me=U?{onTouchStart:se?c:this.down,onTouchEnd:this.stop}:{onMouseDown:se?c:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:ze,style:Te,title:We,onMouseEnter:$e,onMouseLeave:Je,onMouseOver:Ce,onMouseOut:X,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(F,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":ne,className:pe}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-up-inner"),onClick:s})),r.a.createElement("span",Object.assign({unselectable:"on"},me,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:ae}),q||r.a.createElement("span",{unselectable:"on",className:"".concat(F,"-handler-down-inner"),onClick:s}))),r.a.createElement("div",{className:"".concat(F,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Qe,"aria-valuemax":Ee,"aria-valuenow":Zt,required:j,type:re,placeholder:z,onPaste:Tt,onClick:K,onMouseUp:this.onMouseUp,className:"".concat(F,"-input"),tabIndex:Q,autoComplete:w,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:c,onKeyUp:vt?this.onKeyUp:c,autoFocus:Fe,maxLength:Oe,readOnly:B,disabled:A,max:Ee,min:Qe,step:le,name:Ye,title:We,id:we,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Rt),pattern:rt,inputMode:Ue,onInput:Nt},He))))}}]),_}(r.a.Component);T.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:c,onKeyDown:c,onPressEnter:c,onFocus:c,onBlur:c,parser:i,required:!1,autoComplete:"off"};var v=T,b=_e.a=v},eozf:function(jt,_e,D){"use strict";D.d(_e,"b",function(){return Je}),D.d(_e,"c",function(){return Ce});var Z=D("sRBo"),V=D("kaz8"),I=D("5Dmo"),G=D("3S7+"),P=D("/zsF"),L=D("PArb"),W=D("7Kak"),k=D("9yH6"),r=D("14J3"),M=D("BMrR"),E=D("+L6B"),p=D("2/Rp"),m=D("jCWc"),u=D("kPKH"),a=D("2qtc"),o=D("kLXV"),c=D("9og8"),s=D("miYZ"),i=D("tsqr"),n=D("oBTY"),O=D("k1fw"),S=D("tJVT"),C=D("OaEy"),R=D("2fM7"),T=D("iQDF"),v=D("+eQT"),b=D("WmNS"),f=D.n(b),h=D("q1tI"),_=D.n(h),g=D("/MfK"),x=D("w5pM"),N=D("Lyp1"),F=D("wd/R"),A=D.n(F),B=D("xKgJ"),U=D("ErOA"),w=D("LvDl"),Y=D.n(w),q=D("1vsH"),ce=D("zetH"),Ee=D.n(ce),Qe=D("Ty5D"),Te=D("9kvl"),We=D("AHFd");function $e(Q,re){for(var z=[],we=Q;we<re;we++)z.push(we);return z}var Je=function(re,z,we){var Ue=re<A()().startOf("day"),rt=re>A()(z).endOf("day"),le=re<A()(we).startOf("day");return z?we?A()()<=A()(we)?le||rt:Ue||rt:re&&Ue||rt:we&&A()()<=A()(we)?le:Ue},Ce=function(re,z){var we=parseInt(A()(re).format("HH")),Ue=parseInt(A()().format("HH")),rt=parseInt(A()().format("mm"));if(!re)return{disabledHours:function(){return $e(0,Ue)},disabledMinutes:function(){return $e(0,rt)}};if(z){var le=parseInt(A()(z).format("HH")),Oe=parseInt(A()(z).format("mm"));return A()(re).isSame(A()(z),"day")?{disabledHours:function(){return $e(0,le)},disabledMinutes:function(){return we<=le?$e(0,Oe):[]}}:void 0}return A()(re).isSame(A()(),"day")?{disabledHours:function(){return $e(0,Ue)},disabledMinutes:function(){return A()(re).isSame(A()(),"hour")&&we<=Ue?$e(0,rt):[]}}:void 0},X=v.a.RangePicker,j=R.a.Option,K=function(re){var z,we,Ue,rt,le,Oe,Fe,Ye=re.shixunHomeworks,Tt=re.loading,Nt=re.dispatch,Xt=Object(Qe.i)(),tt=Ye.workSetting,Zt=Ye.workList,vn=Ye.changeData,ze=Object(h.useState)(!0),He=Object(S.a)(ze,2),vt=He[0],Rt=He[1],de=Object(h.useState)(!1),ee=Object(S.a)(de,2),ne=ee[0],se=ee[1],pe=Object(h.useState)([]),ae=Object(S.a)(pe,2),ie=ae[0],me=ae[1],ye=Object(h.useState)([]),xe=Object(S.a)(ye,2),De=xe[0],ct=xe[1],It=Object(h.useState)({unified_setting:!1,publish_time:"",end_time:"",allow_late:!1,unified_late:!0,late_time:"",late_penalty:0,penalty_type:We.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}),un=Object(S.a)(It,2),mt=un[0],Qt=un[1];Object(h.useEffect)(function(){return ht(),function(){me([].concat())}},[]);var ht=function(){Nt({type:"shixunHomeworks/getWorkSetting",payload:Object(O.a)({},Xt)})};Object(h.useEffect)(function(){var Ve;if(!(tt!=null&&tt.course_id))return;Object.keys(mt).map(function(et){mt[et]=tt[et]}),(!mt.allow_late||!mt.unified_late)&&(mt.late_penalty=20,mt.penalty_type=We.a.Percent),mt.unified_setting||(mt.unified_late=!1,mt.unified_anonymous_comment=!1,mt.unified_anonymous_appeal=!1),ie=JSON.parse(JSON.stringify(tt.group_settings.map(function(et){return Object(O.a)(Object(O.a)({},et),{},{group_name:[et.group_name]})}).filter(function(et){return et.publish_time!==null}))),De=JSON.parse(JSON.stringify(tt.allow_late_settings.map(function(et){return Object(O.a)(Object(O.a)({},et),{},{group_name:[et.group_name]})}).filter(function(et){return et.late_time!==null}))),Qt(Object(O.a)({},mt)),me(Object(n.a)(ie)),((Ve=De)===null||Ve===void 0?void 0:Ve.length)<=0?ct([{penalty_type:We.a.Percent,late_penalty:20}]):ct(Object(n.a)(De))},[tt]);var Et=function(){var et,gt,Ht=JSON.parse(JSON.stringify(mt));if(Ht.challenge_settings.filter(function(dn){return!dn.hide}),Ht.categoryId=Xt.categoryId,(et=Ht.challenge_settings)!==null&&et!==void 0&&et.every(function(dn){return!dn.checked})){i.b.warn("\u5173\u5361\u4E0D\u80FD\u5168\u90E8\u8BBE\u7F6E\u4E3A\u53EF\u4E0D\u505A");return}if(mt.unified_setting||(ie=(gt=ie)===null||gt===void 0?void 0:gt.map(function(dn){var Zn;if(!dn.publish_time||!dn.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(!dn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return dn.group_name=typeof(dn==null?void 0:dn.group_name)=="string"?[dn==null?void 0:dn.group_name]:dn==null?void 0:dn.group_name,dn.group_id=(Zn=tt.group_settings)===null||Zn===void 0?void 0:Zn.filter(function(Wn){var tn;return dn==null||((tn=dn.group_name)===null||tn===void 0)?void 0:tn.includes(Wn.group_name)}).map(function(Wn){return Wn.group_id||Wn.id}).toString().split(","),dn})),Ht.group_settings=ie,mt.allow_late)if(mt.unified_late){if(mt.late_penalty===null||mt.late_penalty===void 0||mt.late_penalty<0||mt.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(!mt.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 Vt;De=(Vt=De)===null||Vt===void 0?void 0:Vt.map(function(dn){var Zn,Wn;if(dn.late_penalty===null||dn.late_penalty===void 0||dn.late_penalty<0||dn.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(!dn.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(!dn.group_name)throw i.b.error("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0"),new String("\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0");return dn.group_name=typeof(dn==null?void 0:dn.group_name)=="string"?[dn==null?void 0:dn.group_name]:dn==null?void 0:dn.group_name,dn.group_id=dn==null||((Zn=dn.group_name)===null||Zn===void 0||((Wn=Zn.map(function(tn){var Hn,ir,Dn=(Hn=tt.group_settings)===null||Hn===void 0||((ir=Hn.filter(function(Vn){return(Vn==null?void 0:Vn.group_name)===tn}))===null||ir===void 0)?void 0:ir[0];return Dn==null?void 0:Dn.group_id}))===null||Wn===void 0))?void 0:Wn.toString().split(","),dn}),Ht.allow_late_settings=De}it(Ht)},it=function(et){var gt,Ht;if(et.total_score===null){i.b.warn("\u603B\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A");return}if(et!=null&&et.work_efficiency&&et.eff_score===null){i.b.warn("\u6548\u7387\u5206\u4E0D\u80FD\u4E3A\u7A7A");return}var Vt=et.challenge_settings.reduce(function(Wn,tn){return Wn+Number(tn.challenge_score)},0);if((Vt==null?void 0:Vt.toFixed(10))!==((gt=et.total_score-et.eff_score)===null||gt===void 0?void 0:gt.toFixed(10))){i.b.warn("\u6548\u7387\u5206\u52A0\u5173\u5361\u4EFB\u52A1\u603B\u5206\u5FC5\u987B\u7B49\u4E8E\u603B\u5206\u503C\uFF1A".concat(et.total_score,"\u5206"));return}var dn={shixun_evaluation:et.shixun_evaluation,challenge_settings:et.challenge_settings},Zn=function(){var Wn=Object(c.a)(f.a.mark(function tn(){var Hn;return f.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:return se(!0),Dn.next=3,Object(U.a)("/api/homework_commons/".concat(Xt.categoryId,"/publish_setting.json"),{method:"post",body:Object(O.a)({},et)});case 3:Hn=Dn.sent,Hn.status===0&&(i.b.success("\u66F4\u65B0\u6210\u529F"),Rt(!0),ht(),Nt({type:"shixunHomeworks/getWorkList",payload:Object(O.a)({},Xt)})),se(!1);case 6:case"end":return Dn.stop()}},tn)}));return function(){return Wn.apply(this,arguments)}}();!Object(w.isEqual)(vn,dn)&&!(Zt!=null&&(Ht=Zt.homework_status)!==null&&Ht!==void 0&&Ht.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:Zn}):Zn()},ve=function(et,gt){var Ht,Vt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"group_id";return gt?gt.find(function(dn){return dn[Vt]===et}):tt==null||((Ht=tt.group_settings)===null||Ht===void 0)?void 0:Ht.find(function(dn){return dn.group_id[0]===et})},Me=(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment),St=function(et){var gt=ve(et,tt==null?void 0:tt.allow_late_settings,"id"),Ht=ve(et,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.allow_late)&&gt&&(gt==null?void 0:gt.late_time)!==null||(tt==null?void 0:tt.anonymous_comment)&&Ht&&(Ht==null?void 0:Ht.evaluation_start)!==null},lt=Object(h.useMemo)(function(){var Ve;if(tt!=null&&tt.unified_setting){var et;return!(Zt!=null&&(et=Zt.homework_status)!==null&&et!==void 0&&et.includes("\u5DF2\u622A\u6B62"))||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.anonymous_comment)}var gt=tt==null||((Ve=tt.group_settings)===null||Ve===void 0)?void 0:Ve.some(function(Ht){return A()(Ht.end_time)<=A()()});return!gt||(tt==null?void 0:tt.allow_late)||(tt==null?void 0:tt.all_group_late)},[tt,Zt]),Gt=tt==null?void 0:tt.anonymous_comment,qt=function(et){if(!et)return!1;var gt=ve(et,tt==null?void 0:tt.anonymous_comment_settings);return(tt==null?void 0:tt.anonymous_comment)&&gt&&(gt==null?void 0:gt.evaluation_start)!==null};return _.a.createElement("section",{className:[Ee.a.form," bg-white pl30 pr30 pt10"].join(" ")},_.a.createElement(M.a,null,_.a.createElement(u.a,{span:24},_.a.createElement(M.a,{align:"middle"},_.a.createElement(u.a,{flex:"1"}),_.a.createElement(u.a,null,Object(B.c)()&&vt&&_.a.createElement(p.a,{type:"primary",size:"middle",ghost:!0,onClick:function(){return Rt(!1)}},"\u7F16\u8F91\u8BBE\u7F6E")))),_.a.createElement("div",null,_.a.createElement("label",null,"\u53D1\u5E03\u65B9\u5F0F\uFF1A")," ",_.a.createElement(k.a.Group,{disabled:vt||!(Zt!=null&&(z=Zt.homework_status)!==null&&z!==void 0&&z.includes("\u672A\u53D1\u5E03")),value:mt.unified_setting,onChange:function(et){var gt;if(!(Zt!=null&&(gt=Zt.homework_status)!==null&&gt!==void 0&&gt.includes("\u672A\u53D1\u5E03"))){i.b.error("\u5DF2\u53D1\u5E03\uFF0C\u4E0D\u80FD\u518D\u4FEE\u6539\u7EDF\u4E00\u8BBE\u7F6E");return}if(mt.unified_setting=!mt.unified_setting,mt.unified_setting||(mt.unified_late=!1),Qt(Object.assign({},mt)),mt.unified_setting===!1&&ie==""){me(ie.concat({}));return}mt.unified_setting&&(me([]),ct([{late_penalty:5}]))}},_.a.createElement(k.a,{value:!0},"\u7EDF\u4E00\u53D1\u5E03"),_.a.createElement(k.a,{disabled:(tt==null||((we=tt.group_settings)===null||we===void 0)?void 0:we.length)===0,value:!1},"\u5206\u73ED\u53D1\u5E03")),(tt==null||((Ue=tt.group_settings)===null||Ue===void 0)?void 0:Ue.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"))),mt.unified_setting&&_.a.createElement("div",null,_.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(u.a,null,"\u53D1\u5E03\u65F6\u95F4:"),_.a.createElement(u.a,{className:"ml5"},_.a.createElement(v.a,{disabled:vt||!(Zt!=null&&(rt=Zt.homework_status)!==null&&rt!==void 0&&rt.includes("\u672A\u53D1\u5E03")||Zt!=null&&(le=Zt.homework_status)!==null&&le!==void 0&&le.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(et){return Je(et,tt==null?void 0:tt.course_end_date)},disabledTime:function(et){return Ce(et)},value:mt.publish_time?A()(mt.publish_time):"",onChange:function(et,gt){mt.publish_time=gt,(mt.end_time==""||!mt.end_time)&&mt.unified_setting&&(mt.end_time=A()(et).add(1,"month").format("YYYY-MM-DD HH:mm:ss")),Qt(Object.assign({},mt))}})),_.a.createElement(u.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(u.a,null,"\u622A\u6B62\u65F6\u95F4:"),_.a.createElement(u.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:vt||Me,disabledDate:function(et){return Je(et,tt==null?void 0:tt.course_end_date,mt.publish_time)},disabledTime:function(et){return Ce(et,mt.publish_time)},value:mt.end_time?A()(mt.end_time):"",onChange:function(et,gt){mt.end_time=gt,Qt(Object.assign({},mt))}})),_.a.createElement(u.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)")))),!mt.unified_setting&&((Oe=ie)===null||Oe===void 0?void 0:Oe.length)>0&&_.a.createElement(M.a,{style:{marginTop:30,paddingTop:40,marginLeft:40,borderTop:"1px solid #eee"}},_.a.createElement(u.a,{span:24},_.a.createElement(M.a,null,_.a.createElement(u.a,{span:10}),_.a.createElement(u.a,{span:10},_.a.createElement(M.a,{className:"c-grey-c ml30"},_.a.createElement(u.a,{flex:"1"},"(\u5B66\u751F\u6536\u5230\u4F5C\u4E1A\u65F6\u95F4)"),_.a.createElement(u.a,{flex:"1"},"(\u5B66\u751F\u201C\u6309\u65F6\u201D\u63D0\u4EA4\u4F5C\u54C1\u65F6\u95F4\u622A\u70B9)"))),_.a.createElement(u.a,{span:4}))),ie&&ie.map(function(Ve,et){var gt,Ht,Vt,dn,Zn;return _.a.createElement(u.a,{span:24,key:et},_.a.createElement(M.a,{gutter:[8,16]},_.a.createElement(u.a,{span:10},_.a.createElement(M.a,{gutter:[8,16]},_.a.createElement(u.a,null,"\u53D1\u5E03\u89C4\u5219 ",et+1),_.a.createElement(u.a,{flex:"1",style:{maxWidth:300}},_.a.createElement(R.a,{disabled:vt||!(Zt!=null&&(gt=Zt.homework_status)!==null&&gt!==void 0&&gt.includes("\u672A\u53D1\u5E03"))&&Ve.id,className:"ml20",mode:"multiple",style:{width:"100%"},value:Ve.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(tn){ie[et].group_name=tn,ie[et].group_id=Ve.group_id;var Hn=Object(w.flattenDeep)(ie.map(function(Dn){return Dn.group_name})),ir=De.map(function(Dn){var Vn=(Dn==null?void 0:Dn.group_name)||[];return Object(O.a)(Object(O.a)({},Dn),{},{group_name:Object(w.remove)(Vn,function(qn){return Hn.includes(qn)})})});ct(ir),me(ie.slice())}},tt.group_settings&&tt.group_settings.map(function(Wn){var tn=ie.map(function(Hn){return Hn.group_name}).flat();if(!tn.includes(Wn.group_name))return _.a.createElement(j,{value:Wn.group_name,key:Wn.id},Wn.group_name)}))))),_.a.createElement(u.a,{span:10},_.a.createElement("div",{className:"ml30"},_.a.createElement(X,{ranges:{\u6B64\u523B:[Ve.publish_time?A()(Ve.publish_time):A()(),A()()]},allowClear:!1,disabled:vt||(A()()<=A()((Ht=ve((Vt=Ve.group_id)===null||Vt===void 0?void 0:Vt[0]))===null||Ht===void 0?void 0:Ht.publish_time)?!1:[!0,St((dn=Ve.group_id)===null||dn===void 0?void 0:dn[0])]),style:{width:400},placeholder:["\u8BF7\u9009\u62E9\u53D1\u5E03\u65F6\u95F4","\u8BF7\u9009\u62E9\u622A\u6B62\u65F6\u95F4"],disabledDate:function(tn){return Je(tn,tt==null?void 0:tt.course_end_date)},disabledTime:function(tn){return Ce(tn)},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:Ve.publish_time&&[A()(Ve.publish_time),Ve.end_time?A()(Ve.end_time):void 0],onChange:function(tn,Hn){ie[et].publish_time=Hn[0],ie[et].end_time=Hn[1],me(Object(n.a)(ie))}}))),!vt&&_.a.createElement(u.a,{span:4},et>0&&!Ve.id&&_.a.createElement(g.a,{onClick:function(){ie=ie.filter(function(tn,Hn){return et!==Hn}),me(ie.slice()),setTimeout(function(){return me(ie.slice())},10)}}),ie.length<(tt==null||((Zn=tt.group_settings)===null||Zn===void 0)?void 0:Zn.length)&&_.a.createElement(x.a,{className:"c-green ml20",onClick:function(){me(ie.concat({}))}}))))})),_.a.createElement(L.a,null),_.a.createElement(M.a,null,_.a.createElement(u.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(N.a,{style:{marginLeft:4,cursor:"pointer"}}))),_.a.createElement(u.a,{span:24,className:"mt15 pl30"},_.a.createElement(V.a,{checked:mt.allow_late,disabled:vt||lt,onChange:function(){mt.allow_late=!mt.allow_late,De==""&&ct([{late_penalty:5}]),Qt(Object.assign({},mt))}},_.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(N.a,null)))),(mt==null?void 0:mt.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:vt||(tt==null?void 0:tt.anonymous_comment)||(tt==null?void 0:tt.allow_late),value:mt.unified_late,onChange:function(et){mt.unified_late=et.target.value,De==""&&!et.target.value&&ct([{penalty_type:We.a.Percent,late_penalty:20}]),Qt(Object(O.a)({},mt))}},(mt==null?void 0:mt.unified_setting)&&_.a.createElement(k.a,{value:!0}," \u7EDF\u4E00\u8865\u4EA4 "),(tt==null||((Fe=tt.group_settings)===null||Fe===void 0)?void 0:Fe.length)>0&&_.a.createElement(k.a,{value:!1}," \u5206\u73ED\u8865\u4EA4 "))),mt!=null&&mt.unified_late?_.a.createElement(_.a.Fragment,null,_.a.createElement(M.a,{align:"middle",className:"mt25 pl30"},_.a.createElement(u.a,null,"\u8865\u4EA4\u6263\u5206:"),_.a.createElement(u.a,{className:"ml5"},_.a.createElement(We.b,{disabled:vt||Gt,value:{type:mt.penalty_type,inputValue:mt.late_penalty},onChange:function(et){Qt(Object(O.a)(Object(O.a)({},mt),{},{late_penalty:et.inputValue,penalty_type:et.type}))}})),_.a.createElement(u.a,{flex:"1",className:"ml5"},_.a.createElement("span",{className:"c-grey-c ml10"},mt.penalty_type===We.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(u.a,null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4:"),_.a.createElement(u.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:vt||Gt,value:mt.late_time?A()(mt.late_time):"",disabledDate:function(et){return Je(et,tt==null?void 0:tt.course_end_date)},onChange:function(et,gt){mt.late_time=gt,Qt(Object.assign({},mt))}})),_.a.createElement(u.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)")))):De.map(function(Ve,et){var gt;return _.a.createElement(u.a,{span:24,key:et},_.a.createElement(M.a,{className:"mt25"},_.a.createElement(u.a,{style:{marginLeft:30}},_.a.createElement("span",null,"\u8865\u4EA4\u89C4\u5219",et+1,"\uFF1A"),_.a.createElement(R.a,{disabled:vt||!(Zt!=null&&(gt=Zt.homework_status)!==null&&gt!==void 0&&gt.includes("\u672A\u53D1\u5E03"))&&Ve.id||(tt==null?void 0:tt.anonymous_comment),mode:"multiple",style:{width:306},value:typeof Ve.group_name=="string"?[Ve.group_name]:Ve.group_name,placeholder:"\u8BF7\u9009\u62E9\u5206\u73ED\u540D\u79F0",onChange:function(Vt){De[et].group_name=Vt,De[et].group_id=Ve.group_id,ct(De.slice())}},tt.group_settings&&tt.group_settings.map(function(Ht){var Vt=De.map(function(Zn){return Zn.group_name}).flat(),dn=ie.map(function(Zn){return Zn.group_name}).flat();if(mt!=null&&mt.unified_setting){if(!Vt.includes(Ht.group_name))return _.a.createElement(j,{value:Ht.group_name,key:Ht.id},Ht.group_name)}else if(dn.includes(Ht.group_name)&&(!Vt.includes(Ht.group_name)&&A()(Ht.end_time)<=A()()))return _.a.createElement(j,{value:Ht.group_name,key:Ht.id},Ht.group_name)}))),_.a.createElement(u.a,{className:"ml20"},_.a.createElement("span",null,"\u8865\u4EA4\u6263\u5206\uFF1A"),_.a.createElement(We.b,{disabled:vt||qt(Ve.id),value:{type:Ve.penalty_type,inputValue:Ve.late_penalty},onChange:function(Vt){De[et].late_penalty=Vt.inputValue,De[et].penalty_type=Vt.type,ct(Object(n.a)(De))}})),_.a.createElement(u.a,{className:"ml20"},_.a.createElement("span",null,"\u8865\u4EA4\u622A\u6B62\u65F6\u95F4\uFF1A"),_.a.createElement(v.a,{disabled:vt||qt(Ve.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(Vt){return Je(Vt,tt==null?void 0:tt.course_end_date)},format:"YYYY-MM-DD HH:mm",value:Ve!=null&&Ve.late_time?A()(Ve.late_time):void 0,onChange:function(Vt,dn){De[et].late_time=dn,ct(Object(n.a)(De))}})),!vt&&_.a.createElement(u.a,{className:"ml20"},et>0&&!Ve.id&&_.a.createElement(g.a,{onClick:function(){De=De.filter(function(Vt,dn){return et!==dn}),ct(De.slice()),setTimeout(function(){return ct(De.slice())},10)}}),_.a.createElement(x.a,{className:"c-green ml20",onClick:function(){ct(De.concat({penalty_type:We.a.Percent,late_minus_score:20}))}}))))})),_.a.createElement(L.a,null),!vt&&_.a.createElement(u.a,{className:"mb50"},_.a.createElement(p.a,{type:"primary",size:"large",style:{marginTop:"40px"},loading:ne,onClick:function(){return Et()}},"\u63D0\u4EA4"),_.a.createElement(p.a,{type:"primary",size:"large",ghost:!0,className:"ml20",onClick:function(){Rt(!0),ht()}},"\u53D6\u6D88")))};_e.a=Object(Te.a)(function(Q){var re=Q.shixunHomeworks,z=Q.loading;return{shixunHomeworks:re,loading:z.effects}})(K)},fjLI:function(jt,_e,D){"use strict";D.d(_e,"f",function(){return m}),D.d(_e,"b",function(){return u}),D.d(_e,"a",function(){return a}),D.d(_e,"d",function(){return o}),D.d(_e,"e",function(){return c}),D.d(_e,"c",function(){return s});var Z=D("8HAY"),V=D("Vhoy"),I=D("MI8n"),G=D("JYp7"),P=D("pmY6"),L=D("24hK"),W=D("nnTU"),k=D("T8No"),r=D("Cg/j"),M=D("t9D7"),E=function(i,n,O,S){var C=arguments.length,R=C<3?n:S===null?S=Object.getOwnPropertyDescriptor(n,O):S,T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(i,n,O,S);else for(var v=i.length-1;v>=0;v--)(T=i[v])&&(R=(C<3?T(R):C>3?T(n,O,R):T(n,O))||R);return C>3&&R&&Object.defineProperty(n,O,R),R},p=function(i,n){return function(O,S){n(O,S,i)}};function m(i){return i.command!==void 0}class u{constructor(i){this.id=u._idPool++,this._debugName=i}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const a=Object(r.c)("menuService"),o=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new I.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===u.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 L.a;for(const{id:S,item:C}of i){let R=this._menuItems.get(S);R||(R=new L.a,this._menuItems.set(S,R)),O.push(R.push(C)),n.add(S)}return this._onDidChangeMenu.fire(n),Object(P.i)(()=>{if(O.size>0){for(let S of O)S();this._onDidChangeMenu.fire(n),O.clear()}})}getMenuItems(i){let n;return this._menuItems.has(i)?n=[...this._menuItems.get(i)]:n=[],i===u.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,S)=>{n.has(S)||i.push({command:O})})}};class c extends Z.e{constructor(i,n,O,S){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=S}get actions(){const i=[],n=this._menuService.createMenu(this.item.submenu,this._contextKeyService),O=n.getActions(this._options);n.dispose();for(const[,S]of O)S.length>0&&(i.push(...S),i.push(new Z.d));return i.length&&i.pop(),i}}let s=class i{constructor(n,O,S,C,R){var T,v;if(this._commandService=R,this.id=n.id,this.label=(S==null?void 0:S.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:(T=n.tooltip)===null||T===void 0?void 0:T.value)!==null&&v!==void 0?v:"",this.enabled=!n.precondition||C.contextMatchesRules(n.precondition),this.checked=void 0,n.toggled){const b=n.toggled.condition?n.toggled:{condition:n.toggled};this.checked=C.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=n,this.alt=O?new i(O,void 0,S,C,R):void 0,this._options=S,M.d.isThemeIcon(n.icon)&&(this.class=V.a.asClassName(n.icon))}dispose(){}run(...n){var O,S;let C=[];return((O=this._options)===null||O===void 0?void 0:O.arg)&&(C=[...C,this._options.arg]),((S=this._options)===null||S===void 0?void 0:S.shouldForwardArgs)&&(C=[...C,...n]),this._commandService.executeCommand(this.id,...C)}};s=E([p(3,k.b),p(4,W.b)],s)},fyJ8:function(jt,_e,D){"use strict";var Z=D("rePB"),V=D("VTBJ"),I=D("Ff2n"),G=D("U8pU"),P=D("q1tI"),L=D.n(P),W=D("TSYQ"),k=D.n(W),r=D("c+Xe"),M=D("sR1s");function E(o){return o&&Object(G.a)(o)==="object"&&!Array.isArray(o)&&!P.isValidElement(o)}function p(o){return typeof o=="string"?!0:Object(r.c)(o)}function m(o,c){var s,i=o.prefixCls,n=o.className,O=o.record,S=o.index,C=o.dataIndex,R=o.render,T=o.children,v=o.component,b=v===void 0?"td":v,f=o.colSpan,h=o.rowSpan,_=o.fixLeft,g=o.fixRight,x=o.firstFixLeft,N=o.lastFixLeft,F=o.firstFixRight,A=o.lastFixRight,B=o.appendNode,U=o.additionalProps,w=U===void 0?{}:U,Y=o.ellipsis,q=o.align,ce=o.rowType,Ee=o.isSticky,Qe="".concat(i,"-cell"),Te,We;if(T)We=T;else{var $e=Object(M.b)(O,C);if(We=$e,R){var Je=R($e,O,S);E(Je)?(We=Je.children,Te=Je.props):We=Je}}Object(G.a)(We)==="object"&&!Array.isArray(We)&&!P.isValidElement(We)&&(We=null),Y&&(N||F)&&(We=P.createElement("span",{className:"".concat(Qe,"-content")},We));var Ce=Te||{},X=Ce.colSpan,j=Ce.rowSpan,K=Ce.style,Q=Ce.className,re=Object(I.a)(Ce,["colSpan","rowSpan","style","className"]),z=X!==void 0?X:f,we=j!==void 0?j:h;if(z===0||we===0)return null;var Ue={},rt=typeof _=="number",le=typeof g=="number";rt&&(Ue.position="sticky",Ue.left=_),le&&(Ue.position="sticky",Ue.right=g);var Oe={};q&&(Oe.textAlign=q);var Fe,Ye=Y===!0?{showTitle:!0}:Y;Ye&&(Ye.showTitle||ce==="header")&&(typeof We=="string"||typeof We=="number"?Fe=We.toString():P.isValidElement(We)&&typeof We.props.children=="string"&&(Fe=We.props.children));var Tt=Object(V.a)(Object(V.a)(Object(V.a)({title:Fe},re),w),{},{colSpan:z&&z!==1?z:null,rowSpan:we&&we!==1?we:null,className:k()(Qe,n,(s={},Object(Z.a)(s,"".concat(Qe,"-fix-left"),rt),Object(Z.a)(s,"".concat(Qe,"-fix-left-first"),x),Object(Z.a)(s,"".concat(Qe,"-fix-left-last"),N),Object(Z.a)(s,"".concat(Qe,"-fix-right"),le),Object(Z.a)(s,"".concat(Qe,"-fix-right-first"),F),Object(Z.a)(s,"".concat(Qe,"-fix-right-last"),A),Object(Z.a)(s,"".concat(Qe,"-ellipsis"),Y),Object(Z.a)(s,"".concat(Qe,"-with-append"),B),Object(Z.a)(s,"".concat(Qe,"-fix-sticky"),(rt||le)&&Ee),s),w.className,Q),style:Object(V.a)(Object(V.a)(Object(V.a)(Object(V.a)({},w.style),Oe),Ue),K),ref:p(b)?c:null});return P.createElement(b,Object.assign({},Tt),B,We)}var u=P.forwardRef(m);u.displayName="Cell";var a=P.memo(u,function(o,c){return c.shouldCellUpdate?!c.shouldCellUpdate(c.record,o.record):!1});_e.a=a},hW8S:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return G}),D.d(_e,"c",function(){return P}),D.d(_e,"b",function(){return L});var Z=D("VTBJ"),V=D("Ff2n"),I=D("Kwbf"),G="RC_TABLE_INTERNAL_COL_DEFINE";function P(W){var k=W.expandable,r=Object(V.a)(W,["expandable"]);return"expandable"in W?Object(Z.a)(Object(Z.a)({},r),k):r}function L(W){return Object.keys(W).reduce(function(k,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(k[r]=W[r]),k},{})}},iF7n:function(jt,_e,D){jt.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(jt,_e,D){"use strict";D.d(_e,"a",function(){return G});var Z=D("FWmy"),V=D("746U");class I{constructor(){this.data=new Map}add(P,L){Z.a(V.l(P)),Z.a(V.k(L)),Z.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,L)}as(P){return this.data.get(P)||null}}const G=new I},k3GJ:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return sr});var Z=D("rePB"),V=D("ODXe"),I=D("Ff2n"),G=D("VTBJ"),P=D("q1tI"),L=D("TSYQ"),W=D.n(L),k=D("Zm9Q"),r=D("6cGi"),M=D("KQm4"),E=D("xEkU"),p=D.n(E),m=D("t23M");function u(Se){var je=Object(P.useRef)(),Xe=Object(P.useRef)(!1);function Le(){for(var ue=arguments.length,be=new Array(ue),fe=0;fe<ue;fe++)be[fe]=arguments[fe];Xe.current||(p.a.cancel(je.current),je.current=p()(function(){Se.apply(void 0,be)}))}return Object(P.useEffect)(function(){return function(){Xe.current=!0,p.a.cancel(je.current)}},[]),Le}function a(Se){var je=Object(P.useRef)([]),Xe=Object(P.useState)({}),Le=Object(V.a)(Xe,2),ue=Le[1],be=Object(P.useRef)(typeof Se=="function"?Se():Se),fe=u(function(){var ke=be.current;je.current.forEach(function(qe){ke=qe(ke)}),je.current=[],be.current=ke,ue({})});function Pe(ke){je.current.push(ke),fe()}return[be.current,Pe]}var o=D("4IlW");function c(Se,je){var Xe,Le=Se.prefixCls,ue=Se.id,be=Se.active,fe=Se.rtl,Pe=Se.tab,ke=Pe.key,qe=Pe.tab,Ne=Pe.disabled,st=Pe.closeIcon,Pt=Se.tabBarGutter,$t=Se.tabPosition,sn=Se.closable,Pn=Se.renderWrapper,Un=Se.removeAriaLabel,ar=Se.editable,tr=Se.onClick,fr=Se.onRemove,_r=Se.onFocus,lr="".concat(Le,"-tab");P.useEffect(function(){return fr},[]);var pr={};$t==="top"||$t==="bottom"?pr[fe?"marginLeft":"marginRight"]=Pt:pr.marginBottom=Pt;var Er=ar&&sn!==!1&&!Ne;function ln(Ft){if(Ne)return;tr(Ft)}function Yt(Ft){Ft.preventDefault(),Ft.stopPropagation(),ar.onEdit("remove",{key:ke,event:Ft})}var pn=P.createElement("div",{key:ke,ref:je,className:W()(lr,(Xe={},Object(Z.a)(Xe,"".concat(lr,"-with-remove"),Er),Object(Z.a)(Xe,"".concat(lr,"-active"),be),Object(Z.a)(Xe,"".concat(lr,"-disabled"),Ne),Xe)),style:pr,onClick:ln},P.createElement("div",{role:"tab","aria-selected":be,id:ue&&"".concat(ue,"-tab-").concat(ke),className:"".concat(lr,"-btn"),"aria-controls":ue&&"".concat(ue,"-panel-").concat(ke),"aria-disabled":Ne,tabIndex:Ne?null:0,onClick:function(Bt){Bt.stopPropagation(),ln(Bt)},onKeyDown:function(Bt){[o.a.SPACE,o.a.ENTER].includes(Bt.which)&&(Bt.preventDefault(),ln(Bt))},onFocus:_r},qe),Er&&P.createElement("button",{type:"button","aria-label":Un||"remove",tabIndex:0,className:"".concat(lr,"-remove"),onClick:function(Bt){Bt.stopPropagation(),Yt(Bt)}},st||ar.removeIcon||"\xD7"));return Pn&&(pn=Pn(pn)),pn}var s=P.forwardRef(c),i={width:0,height:0,left:0,top:0};function n(Se,je,Xe){return Object(P.useMemo)(function(){for(var Le,ue=new Map,be=je.get((Le=Se[0])===null||Le===void 0?void 0:Le.key)||i,fe=be.left+be.width,Pe=0;Pe<Se.length;Pe+=1){var ke=Se[Pe].key,qe=je.get(ke);if(!qe){var Ne;qe=je.get((Ne=Se[Pe-1])===null||Ne===void 0?void 0:Ne.key)||i}var st=ue.get(ke)||Object(G.a)({},qe);st.right=fe-st.left-st.width,ue.set(ke,st)}return ue},[Se.map(function(Le){return Le.key}).join("_"),je,Xe])}var O={width:0,height:0,left:0,top:0,right:0};function S(Se,je,Xe,Le,ue){var be=ue.tabs,fe=ue.tabPosition,Pe=ue.rtl,ke,qe,Ne;["top","bottom"].includes(fe)?(ke="width",qe=Pe?"right":"left",Ne=Math.abs(je.left)):(ke="height",qe="top",Ne=-je.top);var st=je[ke],Pt=Xe[ke],$t=Le[ke],sn=st;return Pt+$t>st&&(sn=st-$t),Object(P.useMemo)(function(){if(!be.length)return[0,0];for(var Pn=be.length,Un=Pn,ar=0;ar<Pn;ar+=1){var tr=Se.get(be[ar].key)||O;if(tr[qe]+tr[ke]>Ne+sn){Un=ar-1;break}}for(var fr=0,_r=Pn-1;_r>=0;_r-=1){var lr=Se.get(be[_r].key)||O;if(lr[qe]<Ne){fr=_r+1;break}}return[fr,Un]},[Se,Ne,sn,fe,be.map(function(Pn){return Pn.key}).join("_"),Pe])}var C=D("wx14"),R=D("1OyB"),T=D("vuIU"),v=D("JX7q"),b=D("Ji7U"),f=D("LK+K"),h=D("I8Z2"),_=D("bT9E"),g=D("2GS6"),x=D("Gytx"),N=D.n(x),F=D("U8pU"),A=/iPhone/i,B=/iPod/i,U=/iPad/i,w=/\bAndroid(?:.+)Mobile\b/i,Y=/Android/i,q=/\bAndroid(?:.+)SD4930UR\b/i,ce=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,Ee=/Windows Phone/i,Qe=/\bWindows(?:.+)ARM\b/i,Te=/BlackBerry/i,We=/BB10/i,$e=/Opera Mini/i,Je=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ce=/Mobile(?:.+)Firefox\b/i;function X(Se,je){return Se.test(je)}function j(Se){var je=Se||(typeof navigator!="undefined"?navigator.userAgent:""),Xe=(je||"").split("[FBAN");if(typeof Xe[1]!="undefined"){var Le=Xe,ue=Object(V.a)(Le,1);je=ue[0]}if(Xe=je.split("Twitter"),typeof Xe[1]!="undefined"){var be=Xe,fe=Object(V.a)(be,1);je=fe[0]}var Pe={apple:{phone:X(A,je)&&!X(Ee,je),ipod:X(B,je),tablet:!X(A,je)&&X(U,je)&&!X(Ee,je),device:(X(A,je)||X(B,je)||X(U,je))&&!X(Ee,je)},amazon:{phone:X(q,je),tablet:!X(q,je)&&X(ce,je),device:X(q,je)||X(ce,je)},android:{phone:!X(Ee,je)&&X(q,je)||!X(Ee,je)&&X(w,je),tablet:!X(Ee,je)&&!X(q,je)&&!X(w,je)&&(X(ce,je)||X(Y,je)),device:!X(Ee,je)&&(X(q,je)||X(ce,je)||X(w,je)||X(Y,je))||X(/\bokhttp\b/i,je)},windows:{phone:X(Ee,je),tablet:X(Qe,je),device:X(Ee,je)||X(Qe,je)},other:{blackberry:X(Te,je),blackberry10:X(We,je),opera:X($e,je),firefox:X(Ce,je),chrome:X(Je,je),device:X(Te,je)||X(We,je)||X($e,je)||X(Ce,je)||X(Je,je)},any:null,phone:null,tablet:null};return Pe.any=Pe.apple.device||Pe.android.device||Pe.windows.device||Pe.other.device,Pe.phone=Pe.apple.phone||Pe.android.phone||Pe.windows.phone,Pe.tablet=Pe.apple.tablet||Pe.android.tablet||Pe.windows.tablet,Pe}var K=Object(G.a)(Object(G.a)({},j()),{},{isMobile:j}),Q=K;function re(){}function z(Se,je,Xe){var Le=je||"";return Se.key||"".concat(Le,"item_").concat(Xe)}function we(Se){return"".concat(Se,"-menu-")}function Ue(Se,je){var Xe=-1;P.Children.forEach(Se,function(Le){Xe+=1,Le&&Le.type&&Le.type.isMenuItemGroup?P.Children.forEach(Le.props.children,function(ue){Xe+=1,je(ue,Xe)}):je(Le,Xe)})}function rt(Se,je,Xe){if(!Se||Xe.find)return;P.Children.forEach(Se,function(Le){if(Le){var ue=Le.type;if(!ue||!(ue.isSubMenu||ue.isMenuItem||ue.isMenuItemGroup))return;je.indexOf(Le.key)!==-1?Xe.find=!0:Le.props.children&&rt(Le.props.children,je,Xe)}})}var le=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Oe=function(je){var Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=je&&typeof je.getBoundingClientRect=="function"&&je.getBoundingClientRect().width;if(Le){if(Xe){var ue=getComputedStyle(je),be=ue.marginLeft,fe=ue.marginRight;Le+=+be.replace("px","")+ +fe.replace("px","")}Le=+Le.toFixed(6)}return Le||0},Fe=function(je,Xe,Le){je&&Object(F.a)(je.style)==="object"&&(je.style[Xe]=Le)},Ye=function(){return Q.any},Tt=D("bdgK"),Nt=D("i8i4"),Xt=D.n(Nt),tt=D("wgJM"),Zt=D("l4aY"),vn=D("m+aA"),ze=D("c+Xe"),He=D("zT1h"),vt=D("QC+M");function Rt(Se,je,Xe){return Xe?Se[0]===je[0]:Se[0]===je[0]&&Se[1]===je[1]}function de(Se,je,Xe){var Le=Se[je]||{};return Object(G.a)(Object(G.a)({},Le),Xe)}function ee(Se,je,Xe,Le){for(var ue=Xe.points,be=Object.keys(Se),fe=0;fe<be.length;fe+=1){var Pe=be[fe];if(Rt(Se[Pe].points,ue,Le))return"".concat(je,"-placement-").concat(Pe)}return""}var ne=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Se=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(Se)||/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(Se==null?void 0:Se.substr(0,4)))},se=D("MNnm");function pe(Se,je){var Xe={};return Xe[Se.toLowerCase()]=je.toLowerCase(),Xe["Webkit".concat(Se)]="webkit".concat(je),Xe["Moz".concat(Se)]="moz".concat(je),Xe["ms".concat(Se)]="MS".concat(je),Xe["O".concat(Se)]="o".concat(je.toLowerCase()),Xe}function ae(Se,je){var Xe={animationend:pe("Animation","AnimationEnd"),transitionend:pe("Transition","TransitionEnd")};return Se&&("AnimationEvent"in je||delete Xe.animationend.animation,"TransitionEvent"in je||delete Xe.transitionend.transition),Xe}var ie=ae(Object(se.a)(),typeof window!="undefined"?window:{}),me={};if(Object(se.a)()){var ye=document.createElement("div");me=ye.style}var xe={};function De(Se){if(xe[Se])return xe[Se];var je=ie[Se];if(je)for(var Xe=Object.keys(je),Le=Xe.length,ue=0;ue<Le;ue+=1){var be=Xe[ue];if(Object.prototype.hasOwnProperty.call(je,be)&&be in me)return xe[Se]=je[be],xe[Se]}return""}var ct=De("animationend"),It=De("transitionend"),un=!!(ct&&It),mt=ct||"animationend",Qt=It||"transitionend";function ht(Se,je){if(!Se)return null;if(Object(F.a)(Se)==="object"){var Xe=je.replace(/-\w/g,function(Le){return Le[1].toUpperCase()});return Se[Xe]}return"".concat(Se,"-").concat(je)}var Et="none",it="appear",ve="enter",Me="leave",St="none",lt="prepare",Gt="start",qt="active",Ve="end";function et(Se){var je=Object(P.useRef)(!1),Xe=Object(P.useState)(Se),Le=Object(V.a)(Xe,2),ue=Le[0],be=Le[1];function fe(Pe){je.current||be(Pe)}return Object(P.useEffect)(function(){return function(){je.current=!0}},[]),[ue,fe]}var gt=Object(se.a)()?P.useLayoutEffect:P.useEffect,Ht=gt,Vt=function(){var Se=P.useRef(null);function je(){tt.a.cancel(Se.current)}function Xe(Le){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;je();var be=Object(tt.a)(function(){ue<=1?Le({isCanceled:function(){return be!==Se.current}}):Xe(Le,ue-1)});Se.current=be}return P.useEffect(function(){return function(){je()}},[]),[Xe,je]},dn=[lt,Gt,qt,Ve],Zn=!1,Wn=!0;function tn(Se){return Se===qt||Se===Ve}var Hn=function(Se,je){var Xe=P.useState(St),Le=Object(V.a)(Xe,2),ue=Le[0],be=Le[1],fe=Vt(),Pe=Object(V.a)(fe,2),ke=Pe[0],qe=Pe[1];function Ne(){be(lt)}return Ht(function(){if(ue!==St&&ue!==Ve){var st=dn.indexOf(ue),Pt=dn[st+1],$t=je(ue);$t===Zn?be(Pt):ke(function(sn){function Pn(){if(sn.isCanceled())return;be(Pt)}$t===!0?Pn():Promise.resolve($t).then(Pn)})}},[Se,ue]),P.useEffect(function(){return function(){qe()}},[]),[Ne,ue]},ir=function(Se){var je=Object(P.useRef)(),Xe=Object(P.useRef)(Se);Xe.current=Se;var Le=P.useCallback(function(fe){Xe.current(fe)},[]);function ue(fe){fe&&(fe.removeEventListener(Qt,Le),fe.removeEventListener(mt,Le))}function be(fe){je.current&&je.current!==fe&&ue(je.current),fe&&fe!==je.current&&(fe.addEventListener(Qt,Le),fe.addEventListener(mt,Le),je.current=fe)}return P.useEffect(function(){return function(){ue(je.current)}},[]),[be,ue]};function Dn(Se,je,Xe,Le){var ue=Le.motionEnter,be=ue===void 0?!0:ue,fe=Le.motionAppear,Pe=fe===void 0?!0:fe,ke=Le.motionLeave,qe=ke===void 0?!0:ke,Ne=Le.motionDeadline,st=Le.motionLeaveImmediately,Pt=Le.onAppearPrepare,$t=Le.onEnterPrepare,sn=Le.onLeavePrepare,Pn=Le.onAppearStart,Un=Le.onEnterStart,ar=Le.onLeaveStart,tr=Le.onAppearActive,fr=Le.onEnterActive,_r=Le.onLeaveActive,lr=Le.onAppearEnd,pr=Le.onEnterEnd,Er=Le.onLeaveEnd,ln=Le.onVisibleChanged,Yt=et(),pn=Object(V.a)(Yt,2),Ft=pn[0],Bt=pn[1],or=et(Et),xr=Object(V.a)(or,2),Xn=xr[0],Or=xr[1],Xr=et(null),Rr=Object(V.a)(Xr,2),jr=Rr[0],Ir=Rr[1],Pr=Object(P.useRef)(!1),Dr=Object(P.useRef)(null),ur=Object(P.useRef)(!1),ci=Object(P.useRef)(null);function Ji(){var $r=Xe();return $r||ci.current}var Ii=Object(P.useRef)(!1);function Ci($r){var Hr=Ji();if($r&&!$r.deadline&&$r.target!==Hr)return;var yi;Xn===it&&Ii.current?yi=lr==null?void 0:lr(Hr,$r):Xn===ve&&Ii.current?yi=pr==null?void 0:pr(Hr,$r):Xn===Me&&Ii.current&&(yi=Er==null?void 0:Er(Hr,$r)),yi!==!1&&!ur.current&&(Or(Et),Ir(null))}var Qr=ir(Ci),Kr=Object(V.a)(Qr,1),Vr=Kr[0],Zr=P.useMemo(function(){var $r,Hr,yi;switch(Xn){case"appear":return $r={},Object(Z.a)($r,lt,Pt),Object(Z.a)($r,Gt,Pn),Object(Z.a)($r,qt,tr),$r;case"enter":return Hr={},Object(Z.a)(Hr,lt,$t),Object(Z.a)(Hr,Gt,Un),Object(Z.a)(Hr,qt,fr),Hr;case"leave":return yi={},Object(Z.a)(yi,lt,sn),Object(Z.a)(yi,Gt,ar),Object(Z.a)(yi,qt,_r),yi;default:return{}}},[Xn]),Ni=Hn(Xn,function($r){if($r===lt){var Hr=Zr[lt];return Hr?Hr(Ji()):Zn}if(Gr in Zr){var yi;Ir(((yi=Zr[Gr])===null||yi===void 0?void 0:yi.call(Zr,Ji(),null))||null)}return Gr===qt&&(Vr(Ji()),Ne>0&&(clearTimeout(Dr.current),Dr.current=setTimeout(function(){Ci({deadline:!0})},Ne))),Wn}),ha=Object(V.a)(Ni,2),sa=ha[0],Gr=ha[1],Qi=tn(Gr);Ii.current=Qi,Ht(function(){Bt(je);var $r=Pr.current;if(Pr.current=!0,!Se)return;var Hr;!$r&&je&&Pe&&(Hr=it),$r&&je&&be&&(Hr=ve),($r&&!je&&qe||!$r&&st&&!je&&qe)&&(Hr=Me),Hr&&(Or(Hr),sa())},[je]),Object(P.useEffect)(function(){(Xn===it&&!Pe||Xn===ve&&!be||Xn===Me&&!qe)&&Or(Et)},[Pe,be,qe]),Object(P.useEffect)(function(){return function(){clearTimeout(Dr.current),ur.current=!0}},[]),Object(P.useEffect)(function(){Ft!==void 0&&Xn===Et&&(ln==null||ln(Ft))},[Ft,Xn]);var Zi=jr;return Zr[lt]&&Gr===Gt&&(Zi=Object(G.a)({transition:"none"},Zi)),[Xn,Gr,Zi,Ft!=null?Ft:je]}var Vn=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(){return Object(R.a)(this,Xe),je.apply(this,arguments)}return Object(T.a)(Xe,[{key:"render",value:function(){return this.props.children}}]),Xe}(P.Component),qn=Vn;function Mr(Se){var je=Se;Object(F.a)(Se)==="object"&&(je=Se.transitionSupport);function Xe(ue){return!!(ue.motionName&&je)}var Le=P.forwardRef(function(ue,be){var fe=ue.visible,Pe=fe===void 0?!0:fe,ke=ue.removeOnLeave,qe=ke===void 0?!0:ke,Ne=ue.forceRender,st=ue.children,Pt=ue.motionName,$t=ue.leavedClassName,sn=ue.eventProps,Pn=Xe(ue),Un=Object(P.useRef)(),ar=Object(P.useRef)();function tr(){try{return Object(vn.a)(Un.current||ar.current)}catch(Or){return null}}var fr=Dn(Pn,Pe,tr,ue),_r=Object(V.a)(fr,4),lr=_r[0],pr=_r[1],Er=_r[2],ln=_r[3],Yt=P.useRef(ln);ln&&(Yt.current=!0);var pn=Object(P.useRef)(be);pn.current=be;var Ft=P.useCallback(function(Or){Un.current=Or,Object(ze.b)(pn.current,Or)},[]),Bt,or=Object(G.a)(Object(G.a)({},sn),{},{visible:Pe});if(!st)Bt=null;else if(lr===Et||!Xe(ue))ln?Bt=st(Object(G.a)({},or),Ft):!qe&&Yt.current?Bt=st(Object(G.a)(Object(G.a)({},or),{},{className:$t}),Ft):Ne?Bt=st(Object(G.a)(Object(G.a)({},or),{},{style:{display:"none"}}),Ft):Bt=null;else{var xr,Xn;pr===lt?Xn="prepare":tn(pr)?Xn="active":pr===Gt&&(Xn="start"),Bt=st(Object(G.a)(Object(G.a)({},or),{},{className:W()(ht(Pt,lr),(xr={},Object(Z.a)(xr,ht(Pt,"".concat(lr,"-").concat(Xn)),Xn),Object(Z.a)(xr,Pt,typeof Pt=="string"),xr)),style:Er}),Ft)}return P.createElement(qn,{ref:ar},Bt)});return Le.displayName="CSSMotion",Le}var Sr=Mr(un),on="add",Jn="keep",oi="remove",xi="removed";function Jr(Se){var je;return Se&&Object(F.a)(Se)==="object"&&"key"in Se?je=Se:je={key:Se},Object(G.a)(Object(G.a)({},je),{},{key:String(je.key)})}function Yr(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Se.map(Jr)}function Lr(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Xe=[],Le=0,ue=je.length,be=Yr(Se),fe=Yr(je);be.forEach(function(qe){for(var Ne=!1,st=Le;st<ue;st+=1){var Pt=fe[st];if(Pt.key===qe.key){Le<st&&(Xe=Xe.concat(fe.slice(Le,st).map(function($t){return Object(G.a)(Object(G.a)({},$t),{},{status:on})})),Le=st),Xe.push(Object(G.a)(Object(G.a)({},Pt),{},{status:Jn})),Le+=1,Ne=!0;break}}Ne||Xe.push(Object(G.a)(Object(G.a)({},qe),{},{status:oi}))}),Le<ue&&(Xe=Xe.concat(fe.slice(Le).map(function(qe){return Object(G.a)(Object(G.a)({},qe),{},{status:on})})));var Pe={};Xe.forEach(function(qe){var Ne=qe.key;Pe[Ne]=(Pe[Ne]||0)+1});var ke=Object.keys(Pe).filter(function(qe){return Pe[qe]>1});return ke.forEach(function(qe){Xe=Xe.filter(function(Ne){var st=Ne.key,Pt=Ne.status;return st!==qe||Pt!==oi}),Xe.forEach(function(Ne){Ne.key===qe&&(Ne.status=Jn)})}),Xe}var Yn=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function mi(Se){var je=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Sr,Xe=function(Le){Object(b.a)(be,Le);var ue=Object(f.a)(be);function be(){var fe;return Object(R.a)(this,be),fe=ue.apply(this,arguments),fe.state={keyEntities:[]},fe.removeKey=function(Pe){fe.setState(function(ke){var qe=ke.keyEntities;return{keyEntities:qe.map(function(Ne){return Ne.key!==Pe?Ne:Object(G.a)(Object(G.a)({},Ne),{},{status:xi})})}})},fe}return Object(T.a)(be,[{key:"render",value:function(){var Pe=this,ke=this.state.keyEntities,qe=this.props,Ne=qe.component,st=qe.children,Pt=qe.onVisibleChanged,$t=Object(I.a)(qe,["component","children","onVisibleChanged"]),sn=Ne||P.Fragment,Pn={};return Yn.forEach(function(Un){Pn[Un]=$t[Un],delete $t[Un]}),delete $t.keys,P.createElement(sn,$t,ke.map(function(Un){var ar=Un.status,tr=Object(I.a)(Un,["status"]),fr=ar===on||ar===Jn;return P.createElement(je,Object(C.a)({},Pn,{key:tr.key,visible:fr,eventProps:tr,onVisibleChanged:function(lr){Pt==null||Pt(lr,{key:tr.key}),lr||Pe.removeKey(tr.key)}}),st)}))}}],[{key:"getDerivedStateFromProps",value:function(Pe,ke){var qe=Pe.keys,Ne=ke.keyEntities,st=Yr(qe),Pt=Lr(Ne,st);return{keyEntities:Pt.filter(function($t){var sn=Ne.find(function(Pn){var Un=Pn.key;return $t.key===Un});return!(sn&&sn.status===xi&&$t.status===oi)})}}}]),be}(P.Component);return Xe.defaultProps={component:"div"},Xe}var hn=mi(un),ei=Sr;function zr(Se){var je=Se.prefixCls,Xe=Se.motion,Le=Se.animation,ue=Se.transitionName;return Xe||(Le?{motionName:"".concat(je,"-").concat(Le)}:ue?{motionName:ue}:null)}function wi(Se){var je=Se.prefixCls,Xe=Se.visible,Le=Se.zIndex,ue=Se.mask,be=Se.maskMotion,fe=Se.maskAnimation,Pe=Se.maskTransitionName;if(!ue)return null;var ke={};return(be||Pe||fe)&&(ke=Object(G.a)({motionAppear:!0},zr({motion:be,prefixCls:je,transitionName:Pe,animation:fe}))),P.createElement(ei,Object(C.a)({},ke,{visible:Xe,removeOnLeave:!0}),function(qe){var Ne=qe.className;return P.createElement("div",{style:{zIndex:Le},className:W()("".concat(je,"-mask"),Ne)})})}var gi=D("9mu1"),ri=D("o0o1"),Bi=D.n(ri),Hi=D("HaE+"),ii=["measure","align",null,"motion"],wr=function(Se,je){var Xe=Object(P.useState)(null),Le=Object(V.a)(Xe,2),ue=Le[0],be=Le[1],fe=Object(P.useRef)(),Pe=Object(P.useRef)(!1);function ke(st){Pe.current||be(st)}function qe(){tt.a.cancel(fe.current)}function Ne(st){qe(),fe.current=Object(tt.a)(function(){ke(function(Pt){switch(ue){case"align":return"motion";case"motion":return"stable";default:}return Pt}),st==null||st()})}return Object(P.useEffect)(function(){ke("measure")},[Se]),Object(P.useEffect)(function(){switch(ue){case"measure":je();break;default:}ue&&(fe.current=Object(tt.a)(Object(Hi.a)(Bi.a.mark(function st(){var Pt,$t;return Bi.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:Pt=ii.indexOf(ue),$t=ii[Pt+1],$t&&Pt!==-1&&ke($t);case 3:case"end":return Pn.stop()}},st)}))))},[ue]),Object(P.useEffect)(function(){return function(){Pe.current=!0,qe()}},[]),[ue,Ne]},Oi=function(Se){var je=P.useState({width:0,height:0}),Xe=Object(V.a)(je,2),Le=Xe[0],ue=Xe[1];function be(Pe){ue({width:Pe.offsetWidth,height:Pe.offsetHeight})}var fe=P.useMemo(function(){var Pe={};if(Se){var ke=Le.width,qe=Le.height;Se.indexOf("height")!==-1&&qe?Pe.height=qe:Se.indexOf("minHeight")!==-1&&qe&&(Pe.minHeight=qe),Se.indexOf("width")!==-1&&ke?Pe.width=ke:Se.indexOf("minWidth")!==-1&&ke&&(Pe.minWidth=ke)}return Pe},[Se,Le]);return[fe,be]},Ri=P.forwardRef(function(Se,je){var Xe=Se.visible,Le=Se.prefixCls,ue=Se.className,be=Se.style,fe=Se.children,Pe=Se.zIndex,ke=Se.stretch,qe=Se.destroyPopupOnHide,Ne=Se.forceRender,st=Se.align,Pt=Se.point,$t=Se.getRootDomNode,sn=Se.getClassNameFromAlign,Pn=Se.onAlign,Un=Se.onMouseEnter,ar=Se.onMouseLeave,tr=Se.onMouseDown,fr=Se.onTouchStart,_r=Object(P.useRef)(),lr=Object(P.useRef)(),pr=Object(P.useState)(),Er=Object(V.a)(pr,2),ln=Er[0],Yt=Er[1],pn=Oi(ke),Ft=Object(V.a)(pn,2),Bt=Ft[0],or=Ft[1];function xr(){ke&&or($t())}var Xn=wr(Xe,xr),Or=Object(V.a)(Xn,2),Xr=Or[0],Rr=Or[1],jr=Object(P.useRef)();function Ir(){return Pt||$t}function Pr(){var Qr;(Qr=_r.current)===null||Qr===void 0||Qr.forceAlign()}function Dr(Qr,Kr){var Vr=sn(Kr);ln!==Vr&&Yt(Vr),Xr==="align"&&(ln!==Vr?Promise.resolve().then(function(){Pr()}):Rr(function(){var Zr;(Zr=jr.current)===null||Zr===void 0||Zr.call(jr)}),Pn==null||Pn(Qr,Kr))}var ur=Object(G.a)({},zr(Se));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Qr){var Kr=ur[Qr];ur[Qr]=function(Vr,Zr){return Rr(),Kr==null?void 0:Kr(Vr,Zr)}});function ci(){return new Promise(function(Qr){jr.current=Qr})}P.useEffect(function(){!ur.motionName&&Xr==="motion"&&Rr()},[ur.motionName,Xr]),P.useImperativeHandle(je,function(){return{forceAlign:Pr,getElement:function(){return lr.current}}});var Ji=Object(G.a)(Object(G.a)({},Bt),{},{zIndex:Pe,opacity:Xr==="motion"||Xr==="stable"||!Xe?void 0:0,pointerEvents:Xr==="stable"?void 0:"none"},be),Ii=!0;(st==null?void 0:st.points)&&(Xr==="align"||Xr==="stable")&&(Ii=!1);var Ci=fe;return P.Children.count(fe)>1&&(Ci=P.createElement("div",{className:"".concat(Le,"-content")},fe)),P.createElement(ei,Object(C.a)({visible:Xe,ref:lr,leavedClassName:"".concat(Le,"-hidden")},ur,{onAppearPrepare:ci,onEnterPrepare:ci,removeOnLeave:qe,forceRender:Ne}),function(Qr,Kr){var Vr=Qr.className,Zr=Qr.style,Ni=W()(Le,ue,ln,Vr);return P.createElement(gi.a,{target:Ir(),key:"popup",ref:_r,monitorWindowResize:!0,disabled:Ii,align:st,onAlign:Dr},P.createElement("div",{ref:Kr,className:Ni,onMouseEnter:Un,onMouseLeave:ar,onMouseDownCapture:tr,onTouchStartCapture:fr,style:Object(G.a)(Object(G.a)({},Zr),Ji)},Ci))})});Ri.displayName="PopupInner";var di=Ri,_i=P.forwardRef(function(Se,je){var Xe=Se.prefixCls,Le=Se.visible,ue=Se.zIndex,be=Se.children,fe=Se.mobile;fe=fe===void 0?{}:fe;var Pe=fe.popupClassName,ke=fe.popupStyle,qe=fe.popupMotion,Ne=qe===void 0?{}:qe,st=fe.popupRender,Pt=P.useRef();P.useImperativeHandle(je,function(){return{forceAlign:function(){},getElement:function(){return Pt.current}}});var $t=Object(G.a)({zIndex:ue},ke),sn=be;return P.Children.count(be)>1&&(sn=P.createElement("div",{className:"".concat(Xe,"-content")},be)),st&&(sn=st(sn)),P.createElement(ei,Object(C.a)({visible:Le,ref:Pt,removeOnLeave:!0},Ne),function(Pn,Un){var ar=Pn.className,tr=Pn.style,fr=W()(Xe,Pe,ar);return P.createElement("div",{ref:Un,className:fr,style:Object(G.a)(Object(G.a)({},tr),$t)},sn)})});_i.displayName="MobilePopupInner";var oa=_i,$i=["visible","mobile"],yr=P.forwardRef(function(Se,je){var Xe=Se.visible,Le=Se.mobile,ue=Object(I.a)(Se,$i),be=Object(P.useState)(Xe),fe=Object(V.a)(be,2),Pe=fe[0],ke=fe[1],qe=Object(P.useState)(!1),Ne=Object(V.a)(qe,2),st=Ne[0],Pt=Ne[1],$t=Object(G.a)(Object(G.a)({},ue),{},{visible:Pe});Object(P.useEffect)(function(){ke(Xe),Xe&&Le&&Pt(ne())},[Xe,Le]);var sn=st?P.createElement(oa,Object(C.a)({},$t,{mobile:Le,ref:je})):P.createElement(di,Object(C.a)({},$t,{ref:je}));return P.createElement("div",null,P.createElement(wi,$t),sn)});yr.displayName="Popup";var br=yr,si=P.createContext(null),kr=si;function kn(){}function fn(){return""}function Tn(Se){return Se?Se.ownerDocument:window.document}var mn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function er(Se){var je=function(Xe){Object(b.a)(ue,Xe);var Le=Object(f.a)(ue);function ue(be){var fe;Object(R.a)(this,ue),fe=Le.call(this,be),fe.popupRef=P.createRef(),fe.triggerRef=P.createRef(),fe.attachId=void 0,fe.clickOutsideHandler=void 0,fe.touchOutsideHandler=void 0,fe.contextMenuOutsideHandler1=void 0,fe.contextMenuOutsideHandler2=void 0,fe.mouseDownTimeout=void 0,fe.focusTime=void 0,fe.preClickTime=void 0,fe.preTouchTime=void 0,fe.delayTimer=void 0,fe.hasPopupMouseDown=void 0,fe.onMouseEnter=function(ke){var qe=fe.props.mouseEnterDelay;fe.fireEvents("onMouseEnter",ke),fe.delaySetPopupVisible(!0,qe,qe?null:ke)},fe.onMouseMove=function(ke){fe.fireEvents("onMouseMove",ke),fe.setPoint(ke)},fe.onMouseLeave=function(ke){fe.fireEvents("onMouseLeave",ke),fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onPopupMouseEnter=function(){fe.clearDelayTimer()},fe.onPopupMouseLeave=function(ke){var qe;if(ke.relatedTarget&&!ke.relatedTarget.setTimeout&&Object(Zt.a)((qe=fe.popupRef.current)===null||qe===void 0?void 0:qe.getElement(),ke.relatedTarget))return;fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onFocus=function(ke){fe.fireEvents("onFocus",ke),fe.clearDelayTimer(),fe.isFocusToShow()&&(fe.focusTime=Date.now(),fe.delaySetPopupVisible(!0,fe.props.focusDelay))},fe.onMouseDown=function(ke){fe.fireEvents("onMouseDown",ke),fe.preClickTime=Date.now()},fe.onTouchStart=function(ke){fe.fireEvents("onTouchStart",ke),fe.preTouchTime=Date.now()},fe.onBlur=function(ke){fe.fireEvents("onBlur",ke),fe.clearDelayTimer(),fe.isBlurToHide()&&fe.delaySetPopupVisible(!1,fe.props.blurDelay)},fe.onContextMenu=function(ke){ke.preventDefault(),fe.fireEvents("onContextMenu",ke),fe.setPopupVisible(!0,ke)},fe.onContextMenuClose=function(){fe.isContextMenuToShow()&&fe.close()},fe.onClick=function(ke){if(fe.fireEvents("onClick",ke),fe.focusTime){var qe;if(fe.preClickTime&&fe.preTouchTime?qe=Math.min(fe.preClickTime,fe.preTouchTime):fe.preClickTime?qe=fe.preClickTime:fe.preTouchTime&&(qe=fe.preTouchTime),Math.abs(qe-fe.focusTime)<20)return;fe.focusTime=0}fe.preClickTime=0,fe.preTouchTime=0,fe.isClickToShow()&&(fe.isClickToHide()||fe.isBlurToHide())&&ke&&ke.preventDefault&&ke.preventDefault();var Ne=!fe.state.popupVisible;(fe.isClickToHide()&&!Ne||Ne&&fe.isClickToShow())&&fe.setPopupVisible(!fe.state.popupVisible,ke)},fe.onPopupMouseDown=function(){if(fe.hasPopupMouseDown=!0,clearTimeout(fe.mouseDownTimeout),fe.mouseDownTimeout=window.setTimeout(function(){fe.hasPopupMouseDown=!1},0),fe.context){var ke;(ke=fe.context).onPopupMouseDown.apply(ke,arguments)}},fe.onDocumentClick=function(ke){if(fe.props.mask&&!fe.props.maskClosable)return;var qe=ke.target,Ne=fe.getRootDomNode(),st=fe.getPopupDomNode();(!Object(Zt.a)(Ne,qe)||fe.isContextMenuOnly())&&!Object(Zt.a)(st,qe)&&!fe.hasPopupMouseDown&&fe.close()},fe.getRootDomNode=function(){var ke=fe.props.getTriggerDOMNode;if(ke)return ke(fe.triggerRef.current);try{var qe=Object(vn.a)(fe.triggerRef.current);if(qe)return qe}catch(Ne){}return Xt.a.findDOMNode(Object(v.a)(fe))},fe.getPopupClassNameFromAlign=function(ke){var qe=[],Ne=fe.props,st=Ne.popupPlacement,Pt=Ne.builtinPlacements,$t=Ne.prefixCls,sn=Ne.alignPoint,Pn=Ne.getPopupClassNameFromAlign;return st&&Pt&&qe.push(ee(Pt,$t,ke,sn)),Pn&&qe.push(Pn(ke)),qe.join(" ")},fe.getComponent=function(){var ke=fe.props,qe=ke.prefixCls,Ne=ke.destroyPopupOnHide,st=ke.popupClassName,Pt=ke.onPopupAlign,$t=ke.popupMotion,sn=ke.popupAnimation,Pn=ke.popupTransitionName,Un=ke.popupStyle,ar=ke.mask,tr=ke.maskAnimation,fr=ke.maskTransitionName,_r=ke.maskMotion,lr=ke.zIndex,pr=ke.popup,Er=ke.stretch,ln=ke.alignPoint,Yt=ke.mobile,pn=ke.forceRender,Ft=fe.state,Bt=Ft.popupVisible,or=Ft.point,xr=fe.getPopupAlign(),Xn={};return fe.isMouseEnterToShow()&&(Xn.onMouseEnter=fe.onPopupMouseEnter),fe.isMouseLeaveToHide()&&(Xn.onMouseLeave=fe.onPopupMouseLeave),Xn.onMouseDown=fe.onPopupMouseDown,Xn.onTouchStart=fe.onPopupMouseDown,P.createElement(br,Object(C.a)({prefixCls:qe,destroyPopupOnHide:Ne,visible:Bt,point:ln&&or,className:st,align:xr,onAlign:Pt,animation:sn,getClassNameFromAlign:fe.getPopupClassNameFromAlign},Xn,{stretch:Er,getRootDomNode:fe.getRootDomNode,style:Un,mask:ar,zIndex:lr,transitionName:Pn,maskAnimation:tr,maskTransitionName:fr,maskMotion:_r,ref:fe.popupRef,motion:$t,mobile:Yt,forceRender:pn}),typeof pr=="function"?pr():pr)},fe.attachParent=function(ke){tt.a.cancel(fe.attachId);var qe=fe.props,Ne=qe.getPopupContainer,st=qe.getDocument,Pt=fe.getRootDomNode(),$t;Ne?(Pt||Ne.length===0)&&($t=Ne(Pt)):$t=st(fe.getRootDomNode()).body,$t?$t.appendChild(ke):fe.attachId=Object(tt.a)(function(){fe.attachParent(ke)})},fe.getContainer=function(){var ke=fe.props.getDocument,qe=ke(fe.getRootDomNode()).createElement("div");return qe.style.position="absolute",qe.style.top="0",qe.style.left="0",qe.style.width="100%",fe.attachParent(qe),qe},fe.setPoint=function(ke){var qe=fe.props.alignPoint;if(!qe||!ke)return;fe.setState({point:{pageX:ke.pageX,pageY:ke.pageY}})},fe.handlePortalUpdate=function(){fe.state.prevPopupVisible!==fe.state.popupVisible&&fe.props.afterPopupVisibleChange(fe.state.popupVisible)},fe.triggerContextValue={onPopupMouseDown:fe.onPopupMouseDown};var Pe;return"popupVisible"in be?Pe=!!be.popupVisible:Pe=!!be.defaultPopupVisible,fe.state={prevPopupVisible:Pe,popupVisible:Pe},mn.forEach(function(ke){fe["fire".concat(ke)]=function(qe){fe.fireEvents(ke,qe)}}),fe}return Object(T.a)(ue,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var fe=this.props,Pe=this.state;if(Pe.popupVisible){var ke;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ke=fe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(He.a)(ke,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ke=ke||fe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(He.a)(ke,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ke=ke||fe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(He.a)(ke,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(He.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),tt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var fe;return((fe=this.popupRef.current)===null||fe===void 0?void 0:fe.getElement())||null}},{key:"getPopupAlign",value:function(){var fe=this.props,Pe=fe.popupPlacement,ke=fe.popupAlign,qe=fe.builtinPlacements;return Pe&&qe?de(qe,Pe,ke):ke}},{key:"setPopupVisible",value:function(fe,Pe){var ke=this.props.alignPoint,qe=this.state.popupVisible;this.clearDelayTimer(),qe!==fe&&("popupVisible"in this.props||this.setState({popupVisible:fe,prevPopupVisible:qe}),this.props.onPopupVisibleChange(fe)),ke&&Pe&&fe&&this.setPoint(Pe)}},{key:"delaySetPopupVisible",value:function(fe,Pe,ke){var qe=this,Ne=Pe*1e3;if(this.clearDelayTimer(),Ne){var st=ke?{pageX:ke.pageX,pageY:ke.pageY}:null;this.delayTimer=window.setTimeout(function(){qe.setPopupVisible(fe,st),qe.clearDelayTimer()},Ne)}else this.setPopupVisible(fe,ke)}},{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(fe){var Pe=this.props.children.props,ke=this.props;return Pe[fe]&&ke[fe]?this["fire".concat(fe)]:Pe[fe]||ke[fe]}},{key:"isClickToShow",value:function(){var fe=this.props,Pe=fe.action,ke=fe.showAction;return Pe.indexOf("click")!==-1||ke.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var fe=this.props.action;return fe==="contextMenu"||fe.length===1&&fe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var fe=this.props,Pe=fe.action,ke=fe.showAction;return Pe.indexOf("contextMenu")!==-1||ke.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var fe=this.props,Pe=fe.action,ke=fe.hideAction;return Pe.indexOf("click")!==-1||ke.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var fe=this.props,Pe=fe.action,ke=fe.showAction;return Pe.indexOf("hover")!==-1||ke.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var fe=this.props,Pe=fe.action,ke=fe.hideAction;return Pe.indexOf("hover")!==-1||ke.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var fe=this.props,Pe=fe.action,ke=fe.showAction;return Pe.indexOf("focus")!==-1||ke.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var fe=this.props,Pe=fe.action,ke=fe.hideAction;return Pe.indexOf("focus")!==-1||ke.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var fe;(fe=this.popupRef.current)===null||fe===void 0||fe.forceAlign()}}},{key:"fireEvents",value:function(fe,Pe){var ke=this.props.children.props[fe];ke&&ke(Pe);var qe=this.props[fe];qe&&qe(Pe)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var fe=this.state.popupVisible,Pe=this.props,ke=Pe.children,qe=Pe.forceRender,Ne=Pe.alignPoint,st=Pe.className,Pt=Pe.autoDestroy,$t=P.Children.only(ke),sn={key:"trigger"};this.isContextMenuToShow()?sn.onContextMenu=this.onContextMenu:sn.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(sn.onClick=this.onClick,sn.onMouseDown=this.onMouseDown,sn.onTouchStart=this.onTouchStart):(sn.onClick=this.createTwoChains("onClick"),sn.onMouseDown=this.createTwoChains("onMouseDown"),sn.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(sn.onMouseEnter=this.onMouseEnter,Ne&&(sn.onMouseMove=this.onMouseMove)):sn.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?sn.onMouseLeave=this.onMouseLeave:sn.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(sn.onFocus=this.onFocus,sn.onBlur=this.onBlur):(sn.onFocus=this.createTwoChains("onFocus"),sn.onBlur=this.createTwoChains("onBlur"));var Pn=W()($t&&$t.props&&$t.props.className,st);Pn&&(sn.className=Pn);var Un=Object(G.a)({},sn);Object(ze.c)($t)&&(Un.ref=Object(ze.a)(this.triggerRef,$t.ref));var ar=P.cloneElement($t,Un),tr;return(fe||this.popupRef.current||qe)&&(tr=P.createElement(Se,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!fe&&Pt&&(tr=null),P.createElement(kr.Provider,{value:this.triggerContextValue},ar,tr)}}],[{key:"getDerivedStateFromProps",value:function(fe,Pe){var ke=fe.popupVisible,qe={};return ke!==void 0&&Pe.popupVisible!==ke&&(qe.popupVisible=ke,qe.prevPopupVisible=Pe.popupVisible),qe}}]),ue}(P.Component);return je.contextType=kr,je.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:fn,getDocument:Tn,onPopupVisibleChange:kn,afterPopupVisibleChange:kn,onPopupAlign:kn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},je}var rr=er(vt.a),J={adjustX:1,adjustY:1},ge={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Re={topLeft:{points:["bl","tl"],overflow:J,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:J,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:J,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:J,offset:[4,0]}},Ae=ge,at=0,Be={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},nt=function(je,Xe,Le){var ue=we(Xe),be=je.getState();je.setState({defaultActiveFirst:Object(G.a)(Object(G.a)({},be.defaultActiveFirst),{},Object(Z.a)({},ue,Le))})},yt=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(Le){var ue;Object(R.a)(this,Xe),ue=je.call(this,Le),ue.onDestroy=function(Ne){ue.props.onDestroy(Ne)},ue.onKeyDown=function(Ne){var st=Ne.keyCode,Pt=ue.menuInstance,$t=ue.props.store,sn=ue.getVisible();if(st===o.a.ENTER)return ue.onTitleClick(Ne),nt($t,ue.props.eventKey,!0),!0;if(st===o.a.RIGHT)return sn?Pt.onKeyDown(Ne):(ue.triggerOpenChange(!0),nt($t,ue.props.eventKey,!0)),!0;if(st===o.a.LEFT){var Pn;if(sn)Pn=Pt.onKeyDown(Ne);else return;return Pn||(ue.triggerOpenChange(!1),Pn=!0),Pn}return sn&&(st===o.a.UP||st===o.a.DOWN)?Pt.onKeyDown(Ne):void 0},ue.onOpenChange=function(Ne){ue.props.onOpenChange(Ne)},ue.onPopupVisibleChange=function(Ne){ue.triggerOpenChange(Ne,Ne?"mouseenter":"mouseleave")},ue.onMouseEnter=function(Ne){var st=ue.props,Pt=st.eventKey,$t=st.onMouseEnter,sn=st.store;nt(sn,ue.props.eventKey,!1),$t({key:Pt,domEvent:Ne})},ue.onMouseLeave=function(Ne){var st=ue.props,Pt=st.parentMenu,$t=st.eventKey,sn=st.onMouseLeave;Pt.subMenuInstance=Object(v.a)(ue),sn({key:$t,domEvent:Ne})},ue.onTitleMouseEnter=function(Ne){var st=ue.props,Pt=st.eventKey,$t=st.onItemHover,sn=st.onTitleMouseEnter;$t({key:Pt,hover:!0}),sn({key:Pt,domEvent:Ne})},ue.onTitleMouseLeave=function(Ne){var st=ue.props,Pt=st.parentMenu,$t=st.eventKey,sn=st.onItemHover,Pn=st.onTitleMouseLeave;Pt.subMenuInstance=Object(v.a)(ue),sn({key:$t,hover:!1}),Pn({key:$t,domEvent:Ne})},ue.onTitleClick=function(Ne){var st=Object(v.a)(ue),Pt=st.props;if(Pt.onTitleClick({key:Pt.eventKey,domEvent:Ne}),Pt.triggerSubMenuAction==="hover")return;ue.triggerOpenChange(!ue.getVisible(),"click"),nt(Pt.store,ue.props.eventKey,!1)},ue.onSubMenuClick=function(Ne){typeof ue.props.onClick=="function"&&ue.props.onClick(ue.addKeyPath(Ne))},ue.onSelect=function(Ne){ue.props.onSelect(Ne)},ue.onDeselect=function(Ne){ue.props.onDeselect(Ne)},ue.getPrefixCls=function(){return"".concat(ue.props.rootPrefixCls,"-submenu")},ue.getActiveClassName=function(){return"".concat(ue.getPrefixCls(),"-active")},ue.getDisabledClassName=function(){return"".concat(ue.getPrefixCls(),"-disabled")},ue.getSelectedClassName=function(){return"".concat(ue.getPrefixCls(),"-selected")},ue.getOpenClassName=function(){return"".concat(ue.props.rootPrefixCls,"-submenu-open")},ue.getVisible=function(){return ue.state.isOpen},ue.getMode=function(){return ue.state.mode},ue.saveMenuInstance=function(Ne){ue.menuInstance=Ne},ue.addKeyPath=function(Ne){return Object(G.a)(Object(G.a)({},Ne),{},{keyPath:(Ne.keyPath||[]).concat(ue.props.eventKey)})},ue.triggerOpenChange=function(Ne,st){var Pt=ue.props.eventKey,$t=function(){ue.onOpenChange({key:Pt,item:Object(v.a)(ue),trigger:st,open:Ne})};st==="mouseenter"?ue.mouseenterTimeout=setTimeout(function(){$t()},0):$t()},ue.isChildrenSelected=function(){var Ne={find:!1};return rt(ue.props.children,ue.props.selectedKeys,Ne),Ne.find},ue.isInlineMode=function(){return ue.getMode()==="inline"},ue.adjustWidth=function(){if(!ue.subMenuTitle||!ue.menuInstance)return;var Ne=Nt.findDOMNode(ue.menuInstance);if(Ne.offsetWidth>=ue.subMenuTitle.offsetWidth)return;Ne.style.minWidth="".concat(ue.subMenuTitle.offsetWidth,"px")},ue.saveSubMenuTitle=function(Ne){ue.subMenuTitle=Ne},ue.getBaseProps=function(){var Ne=Object(v.a)(ue),st=Ne.props,Pt=ue.getMode();return{mode:Pt==="horizontal"?"vertical":Pt,visible:ue.getVisible(),level:st.level+1,inlineIndent:st.inlineIndent,focusable:!1,onClick:ue.onSubMenuClick,onSelect:ue.onSelect,onDeselect:ue.onDeselect,onDestroy:ue.onDestroy,selectedKeys:st.selectedKeys,eventKey:"".concat(st.eventKey,"-menu-"),openKeys:st.openKeys,motion:st.motion,onOpenChange:ue.onOpenChange,subMenuOpenDelay:st.subMenuOpenDelay,parentMenu:Object(v.a)(ue),subMenuCloseDelay:st.subMenuCloseDelay,forceSubMenuRender:st.forceSubMenuRender,triggerSubMenuAction:st.triggerSubMenuAction,builtinPlacements:st.builtinPlacements,defaultActiveFirst:st.store.getState().defaultActiveFirst[we(st.eventKey)],multiple:st.multiple,prefixCls:st.rootPrefixCls,id:ue.internalMenuId,manualRef:ue.saveMenuInstance,itemIcon:st.itemIcon,expandIcon:st.expandIcon,direction:st.direction}},ue.getMotion=function(Ne,st){var Pt=Object(v.a)(ue),$t=Pt.haveRendered,sn=ue.props,Pn=sn.motion,Un=sn.rootPrefixCls,ar=Object(G.a)(Object(G.a)({},Pn),{},{leavedClassName:"".concat(Un,"-hidden"),removeOnLeave:!1,motionAppear:$t||!st||Ne!=="inline"});return ar};var be=Le.store,fe=Le.eventKey,Pe=be.getState(),ke=Pe.defaultActiveFirst;ue.isRootMenu=!1;var qe=!1;return ke&&(qe=ke[fe]),nt(be,fe,qe),ue.state={mode:Le.mode,isOpen:Le.isOpen},ue}return Object(T.a)(Xe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ue=this,be=this.props,fe=be.mode,Pe=be.parentMenu,ke=be.manualRef,qe=be.isOpen,Ne=function(){ue.setState({mode:fe,isOpen:qe})},st=qe!==this.state.isOpen,Pt=fe!==this.state.mode;if((Pt||st)&&(tt.a.cancel(this.updateStateRaf),Pt?this.updateStateRaf=Object(tt.a)(Ne):Ne()),ke&&ke(this),fe!=="horizontal"||!(Pe==null?void 0:Pe.isRootMenu)||!qe)return;this.minWidthTimeout=setTimeout(function(){return ue.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ue=this.props,be=ue.onDestroy,fe=ue.eventKey;be&&be(fe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),tt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ue,be){var fe=this.getBaseProps();return P.createElement(yn,Object(C.a)({},fe,{id:this.internalMenuId,className:ue,style:be}),this.props.children)}},{key:"renderChildren",value:function(){var ue=this,be=this.getBaseProps(),fe=be.mode,Pe=be.visible,ke=be.forceSubMenuRender,qe=be.direction,Ne=this.getMotion(fe,Pe);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Pe||ke,!this.haveOpened)return P.createElement("div",null);var st=W()("".concat(be.prefixCls,"-sub"),Object(Z.a)({},"".concat(be.prefixCls,"-rtl"),qe==="rtl"));return this.isInlineMode()?P.createElement(ei,Object(C.a)({visible:be.visible,forceRender:ke},Ne),function(Pt){var $t=Pt.className,sn=Pt.style,Pn=W()(st,$t);return ue.renderPopupMenu(Pn,sn)}):this.renderPopupMenu(st)}},{key:"render",value:function(){var ue,be,fe,Pe=Object(G.a)({},this.props),ke=this.getVisible(),qe=this.getPrefixCls(),Ne=this.isInlineMode(),st=this.getMode(),Pt=W()(qe,"".concat(qe,"-").concat(st),(ue={},Object(Z.a)(ue,Pe.className,!!Pe.className),Object(Z.a)(ue,this.getOpenClassName(),ke),Object(Z.a)(ue,this.getActiveClassName(),Pe.active||ke&&!Ne),Object(Z.a)(ue,this.getDisabledClassName(),Pe.disabled),Object(Z.a)(ue,this.getSelectedClassName(),this.isChildrenSelected()),ue));this.internalMenuId||(Pe.eventKey?this.internalMenuId="".concat(Pe.eventKey,"$Menu"):(at+=1,this.internalMenuId="$__$".concat(at,"$Menu")));var $t={},sn={},Pn={};Pe.disabled||($t={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},sn={onClick:this.onTitleClick},Pn={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Un={},ar=Pe.direction,tr=ar==="rtl";Ne&&(tr?Un.paddingRight=Pe.inlineIndent*Pe.level:Un.paddingLeft=Pe.inlineIndent*Pe.level);var fr={};this.getVisible()&&(fr={"aria-owns":this.internalMenuId});var _r=null;st!=="horizontal"&&(_r=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(_r=P.createElement(this.props.expandIcon,Object(G.a)({},this.props))));var lr=P.createElement("div",Object(C.a)({ref:this.saveSubMenuTitle,style:Un,className:"".concat(qe,"-title"),role:"button"},Pn,sn,{"aria-expanded":ke},fr,{"aria-haspopup":"true",title:typeof Pe.title=="string"?Pe.title:void 0}),Pe.title,_r||P.createElement("i",{className:"".concat(qe,"-arrow")})),pr=this.renderChildren(),Er=((be=Pe.parentMenu)===null||be===void 0?void 0:be.isRootMenu)?Pe.parentMenu.props.getPopupContainer:function(Ir){return Ir.parentNode},ln=Be[st],Yt=Pe.popupOffset?{offset:Pe.popupOffset}:{},pn=W()((fe={},Object(Z.a)(fe,Pe.popupClassName,Pe.popupClassName&&!Ne),Object(Z.a)(fe,"".concat(qe,"-rtl"),tr),fe)),Ft=Pe.disabled,Bt=Pe.triggerSubMenuAction,or=Pe.subMenuOpenDelay,xr=Pe.forceSubMenuRender,Xn=Pe.subMenuCloseDelay,Or=Pe.builtinPlacements;le.forEach(function(Ir){return delete Pe[Ir]}),delete Pe.onClick;var Xr=tr?Object(G.a)(Object(G.a)({},Re),Or):Object(G.a)(Object(G.a)({},ge),Or);delete Pe.direction;var Rr=this.getBaseProps(),jr=Ne?null:this.getMotion(Rr.mode,Rr.visible);return P.createElement("li",Object(C.a)({},Pe,$t,{className:Pt,role:"menuitem"}),P.createElement(rr,{prefixCls:qe,popupClassName:W()("".concat(qe,"-popup"),pn),getPopupContainer:Er,builtinPlacements:Xr,popupPlacement:ln,popupVisible:Ne?!1:ke,popupAlign:Yt,popup:Ne?null:pr,action:Ft||Ne?[]:[Bt],mouseEnterDelay:or,mouseLeaveDelay:Xn,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:xr,popupMotion:jr},lr),Ne?pr:null)}}]),Xe}(P.Component);yt.defaultProps={onMouseEnter:re,onMouseLeave:re,onTitleMouseEnter:re,onTitleMouseLeave:re,onTitleClick:re,manualRef:re,mode:"vertical",title:""};var Mt=Object(h.b)(function(Se,je){var Xe=Se.openKeys,Le=Se.activeKey,ue=Se.selectedKeys,be=je.eventKey,fe=je.subMenuKey;return{isOpen:Xe.indexOf(be)>-1,active:Le[fe]===be,selectedKeys:ue}})(yt);Mt.isSubMenu=!0;var kt=Mt,Ge="menuitem-overflowed",xt=.5,ot=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(){var Le;return Object(R.a)(this,Xe),Le=je.apply(this,arguments),Le.resizeObserver=null,Le.mutationObserver=null,Le.originalTotalWidth=0,Le.overflowedItems=[],Le.menuItemSizes=[],Le.cancelFrameId=null,Le.state={lastVisibleIndex:void 0},Le.childRef=P.createRef(),Le.getMenuItemNodes=function(){var ue=Le.props.prefixCls,be=Le.childRef.current;return be?[].slice.call(be.children).filter(function(fe){return fe.className.split(" ").indexOf("".concat(ue,"-overflowed-submenu"))<0}):[]},Le.getOverflowedSubMenuItem=function(ue,be,fe){var Pe=Le.props,ke=Pe.overflowedIndicator,qe=Pe.level,Ne=Pe.mode,st=Pe.prefixCls,Pt=Pe.theme;if(qe!==1||Ne!=="horizontal")return null;var $t=Le.props.children[0],sn=$t.props,Pn=sn.children,Un=sn.title,ar=sn.style,tr=Object(I.a)(sn,["children","title","style"]),fr=Object(G.a)({},ar),_r="".concat(ue,"-overflowed-indicator"),lr="".concat(ue,"-overflowed-indicator");be.length===0&&fe!==!0?fr=Object(G.a)(Object(G.a)({},fr),{},{display:"none"}):fe&&(fr=Object(G.a)(Object(G.a)({},fr),{},{visibility:"hidden",position:"absolute"}),_r="".concat(_r,"-placeholder"),lr="".concat(lr,"-placeholder"));var pr=Pt?"".concat(st,"-").concat(Pt):"",Er={};return le.forEach(function(ln){tr[ln]!==void 0&&(Er[ln]=tr[ln])}),P.createElement(kt,Object(C.a)({title:ke,className:"".concat(st,"-overflowed-submenu"),popupClassName:pr},Er,{key:_r,eventKey:lr,disabled:!1,style:fr}),be)},Le.setChildrenWidthAndResize=function(){if(Le.props.mode!=="horizontal")return;var ue=Le.childRef.current;if(!ue)return;var be=ue.children;if(!be||be.length===0)return;var fe=ue.children[be.length-1];Fe(fe,"display","inline-block");var Pe=Le.getMenuItemNodes(),ke=Pe.filter(function(qe){return qe.className.split(" ").indexOf(Ge)>=0});ke.forEach(function(qe){Fe(qe,"display","inline-block")}),Le.menuItemSizes=Pe.map(function(qe){return Oe(qe,!0)}),ke.forEach(function(qe){Fe(qe,"display","none")}),Le.overflowedIndicatorWidth=Oe(ue.children[ue.children.length-1],!0),Le.originalTotalWidth=Le.menuItemSizes.reduce(function(qe,Ne){return qe+Ne},0),Le.handleResize(),Fe(fe,"display","none")},Le.handleResize=function(){if(Le.props.mode!=="horizontal")return;var ue=Le.childRef.current;if(!ue)return;var be=Oe(ue);Le.overflowedItems=[];var fe=0,Pe;Le.originalTotalWidth>be+xt&&(Pe=-1,Le.menuItemSizes.forEach(function(ke){fe+=ke,fe+Le.overflowedIndicatorWidth<=be&&(Pe+=1)})),Le.setState({lastVisibleIndex:Pe})},Le}return Object(T.a)(Xe,[{key:"componentDidMount",value:function(){var ue=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var be=this.childRef.current;if(!be)return;this.resizeObserver=new Tt.default(function(fe){fe.forEach(function(){var Pe=ue.cancelFrameId;cancelAnimationFrame(Pe),ue.cancelFrameId=requestAnimationFrame(ue.setChildrenWidthAndResize)})}),[].slice.call(be.children).concat(be).forEach(function(fe){ue.resizeObserver.observe(fe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ue.resizeObserver.disconnect(),[].slice.call(be.children).concat(be).forEach(function(fe){ue.resizeObserver.observe(fe)}),ue.setChildrenWidthAndResize()}),this.mutationObserver.observe(be,{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(ue){var be=this,fe=this.state.lastVisibleIndex;return(ue||[]).reduce(function(Pe,ke,qe){var Ne=ke;if(be.props.mode==="horizontal"){var st=be.getOverflowedSubMenuItem(ke.props.eventKey,[]);fe!==void 0&&be.props.className.indexOf("".concat(be.props.prefixCls,"-root"))!==-1&&(qe>fe&&(Ne=P.cloneElement(ke,{style:{display:"none"},eventKey:"".concat(ke.props.eventKey,"-hidden"),className:"".concat(Ge)})),qe===fe+1&&(be.overflowedItems=ue.slice(fe+1).map(function($t){return P.cloneElement($t,{key:$t.props.eventKey,mode:"vertical-left"})}),st=be.getOverflowedSubMenuItem(ke.props.eventKey,be.overflowedItems)));var Pt=[].concat(Object(M.a)(Pe),[st,Ne]);return qe===ue.length-1&&Pt.push(be.getOverflowedSubMenuItem(ke.props.eventKey,[],!0)),Pt}return[].concat(Object(M.a)(Pe),[Ne])},[])}},{key:"render",value:function(){var ue=this.props,be=ue.visible,fe=ue.prefixCls,Pe=ue.overflowedIndicator,ke=ue.mode,qe=ue.level,Ne=ue.tag,st=ue.children,Pt=ue.theme,$t=Object(I.a)(ue,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),sn=Ne;return P.createElement(sn,Object(C.a)({ref:this.childRef},$t),this.renderChildren(st))}}]),Xe}(P.Component);ot.defaultProps={tag:"div",className:""};var ut=ot;function bt(Se){return Se.length?Se.every(function(je){return!!je.props.disabled}):!0}function Dt(Se,je,Xe){var Le=Se.getState();Se.setState({activeKey:Object(G.a)(Object(G.a)({},Le.activeKey),{},Object(Z.a)({},je,Xe))})}function pt(Se){return Se.eventKey||"0-menu-"}function Kt(Se,je){var Xe=je,Le=Se.children,ue=Se.eventKey;if(Xe){var be;if(Ue(Le,function(fe,Pe){fe&&fe.props&&!fe.props.disabled&&Xe===z(fe,ue,Pe)&&(be=!0)}),be)return Xe}return Xe=null,Se.defaultActiveFirst&&Ue(Le,function(fe,Pe){!Xe&&fe&&!fe.props.disabled&&(Xe=z(fe,ue,Pe))}),Xe}function nn(Se){if(!Se)return;var je=this.instanceArray.indexOf(Se);je!==-1?this.instanceArray[je]=Se:this.instanceArray.push(Se)}var wn=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(Le){var ue;return Object(R.a)(this,Xe),ue=je.call(this,Le),ue.onKeyDown=function(be,fe){var Pe=be.keyCode,ke;if(ue.getFlatInstanceArray().forEach(function(Ne){Ne&&Ne.props.active&&Ne.onKeyDown&&(ke=Ne.onKeyDown(be))}),ke)return 1;var qe=null;return(Pe===o.a.UP||Pe===o.a.DOWN)&&(qe=ue.step(Pe===o.a.UP?-1:1)),qe?(be.preventDefault(),Dt(ue.props.store,pt(ue.props),qe.props.eventKey),typeof fe=="function"&&fe(qe),1):void 0},ue.onItemHover=function(be){var fe=be.key,Pe=be.hover;Dt(ue.props.store,pt(ue.props),Pe?fe:null)},ue.onDeselect=function(be){ue.props.onDeselect(be)},ue.onSelect=function(be){ue.props.onSelect(be)},ue.onClick=function(be){ue.props.onClick(be)},ue.onOpenChange=function(be){ue.props.onOpenChange(be)},ue.onDestroy=function(be){ue.props.onDestroy(be)},ue.getFlatInstanceArray=function(){return ue.instanceArray},ue.step=function(be){var fe=ue.getFlatInstanceArray(),Pe=ue.props.store.getState().activeKey[pt(ue.props)],ke=fe.length;if(!ke)return null;be<0&&(fe=fe.concat().reverse());var qe=-1;if(fe.every(function($t,sn){return $t&&$t.props.eventKey===Pe?(qe=sn,!1):!0}),!ue.props.defaultActiveFirst&&qe!==-1&&bt(fe.slice(qe,ke-1)))return;var Ne=(qe+1)%ke,st=Ne;do{var Pt=fe[st];if(!Pt||Pt.props.disabled)st=(st+1)%ke;else return Pt}while(st!==Ne);return null},ue.renderCommonMenuItem=function(be,fe,Pe){var ke=ue.props.store.getState(),qe=Object(v.a)(ue),Ne=qe.props,st=z(be,Ne.eventKey,fe),Pt=be.props;if(!Pt||typeof be.type=="string")return be;var $t=st===ke.activeKey,sn=Object(G.a)(Object(G.a)({mode:Pt.mode||Ne.mode,level:Ne.level,inlineIndent:Ne.inlineIndent,renderMenuItem:ue.renderMenuItem,rootPrefixCls:Ne.prefixCls,index:fe,parentMenu:Ne.parentMenu,manualRef:Pt.disabled?void 0:Object(g.a)(be.ref,nn.bind(Object(v.a)(ue))),eventKey:st,active:!Pt.disabled&&$t,multiple:Ne.multiple,onClick:function(Un){(Pt.onClick||re)(Un),ue.onClick(Un)},onItemHover:ue.onItemHover,motion:Ne.motion,subMenuOpenDelay:Ne.subMenuOpenDelay,subMenuCloseDelay:Ne.subMenuCloseDelay,forceSubMenuRender:Ne.forceSubMenuRender,onOpenChange:ue.onOpenChange,onDeselect:ue.onDeselect,onSelect:ue.onSelect,builtinPlacements:Ne.builtinPlacements,itemIcon:Pt.itemIcon||ue.props.itemIcon,expandIcon:Pt.expandIcon||ue.props.expandIcon},Pe),{},{direction:Ne.direction});return(Ne.mode==="inline"||Ye())&&(sn.triggerSubMenuAction="click"),P.cloneElement(be,Object(G.a)(Object(G.a)({},sn),{},{key:st||fe}))},ue.renderMenuItem=function(be,fe,Pe){if(!be)return null;var ke=ue.props.store.getState(),qe={openKeys:ke.openKeys,selectedKeys:ke.selectedKeys,triggerSubMenuAction:ue.props.triggerSubMenuAction,subMenuKey:Pe};return ue.renderCommonMenuItem(be,fe,qe)},Le.store.setState({activeKey:Object(G.a)(Object(G.a)({},Le.store.getState().activeKey),{},Object(Z.a)({},Le.eventKey,Kt(Le,Le.activeKey)))}),ue.instanceArray=[],ue}return Object(T.a)(Xe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ue){return this.props.visible||ue.visible||this.props.className!==ue.className||!N()(this.props.style,ue.style)}},{key:"componentDidUpdate",value:function(ue){var be=this.props,fe="activeKey"in be?be.activeKey:be.store.getState().activeKey[pt(be)],Pe=Kt(be,fe);if(Pe!==fe)Dt(be.store,pt(be),Pe);else if("activeKey"in ue){var ke=Kt(ue,ue.activeKey);Pe!==ke&&Dt(be.store,pt(be),Pe)}}},{key:"render",value:function(){var ue=this,be=Object(C.a)({},this.props);this.instanceArray=[];var fe=W()(be.prefixCls,be.className,"".concat(be.prefixCls,"-").concat(be.mode)),Pe={className:fe,role:be.role||"menu"};be.id&&(Pe.id=be.id),be.focusable&&(Pe.tabIndex=0,Pe.onKeyDown=this.onKeyDown);var ke=be.prefixCls,qe=be.eventKey,Ne=be.visible,st=be.level,Pt=be.mode,$t=be.overflowedIndicator,sn=be.theme;return le.forEach(function(Pn){return delete be[Pn]}),delete be.onClick,P.createElement(ut,Object(C.a)({},be,{prefixCls:ke,mode:Pt,tag:"ul",level:st,theme:sn,visible:Ne,overflowedIndicator:$t},Pe),Object(k.a)(be.children).map(function(Pn,Un){return ue.renderMenuItem(Pn,Un,qe||"0-menu-")}))}}]),Xe}(P.Component);wn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:re};var In=Object(h.b)()(wn),yn=In,On=D("Kwbf");function Cn(Se,je,Xe){var Le=Se.prefixCls,ue=Se.motion,be=Se.defaultMotions,fe=be===void 0?{}:be,Pe=Se.openAnimation,ke=Se.openTransitionName,qe=je.switchingModeFromInline;if(ue)return ue;if(Object(F.a)(Pe)==="object"&&Pe)Object(On.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Pe=="string")return{motionName:"".concat(Le,"-open-").concat(Pe)};if(ke)return{motionName:ke};var Ne=fe[Xe];return Ne||(qe?null:fe.other)}var Ot=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(Le){var ue;Object(R.a)(this,Xe),ue=je.call(this,Le),ue.onSelect=function(Pe){var ke=Object(v.a)(ue),qe=ke.props;if(qe.selectable){var Ne=ue.store.getState(),st=Ne.selectedKeys,Pt=Pe.key;qe.multiple?st=st.concat([Pt]):st=[Pt],"selectedKeys"in qe||ue.store.setState({selectedKeys:st}),qe.onSelect(Object(G.a)(Object(G.a)({},Pe),{},{selectedKeys:st}))}},ue.onClick=function(Pe){var ke=ue.getRealMenuMode(),qe=Object(v.a)(ue),Ne=qe.store,st=qe.props.onOpenChange;ke!=="inline"&&!("openKeys"in ue.props)&&(Ne.setState({openKeys:[]}),st([])),ue.props.onClick(Pe)},ue.onKeyDown=function(Pe,ke){ue.innerMenu.getWrappedInstance().onKeyDown(Pe,ke)},ue.onOpenChange=function(Pe){var ke=Object(v.a)(ue),qe=ke.props,Ne=ue.store.getState().openKeys.concat(),st=!1,Pt=function(sn){var Pn=!1;if(sn.open)Pn=Ne.indexOf(sn.key)===-1,Pn&&Ne.push(sn.key);else{var Un=Ne.indexOf(sn.key);Pn=Un!==-1,Pn&&Ne.splice(Un,1)}st=st||Pn};Array.isArray(Pe)?Pe.forEach(Pt):Pt(Pe),st&&("openKeys"in ue.props||ue.store.setState({openKeys:Ne}),qe.onOpenChange(Ne))},ue.onDeselect=function(Pe){var ke=Object(v.a)(ue),qe=ke.props;if(qe.selectable){var Ne=ue.store.getState().selectedKeys.concat(),st=Pe.key,Pt=Ne.indexOf(st);Pt!==-1&&Ne.splice(Pt,1),"selectedKeys"in qe||ue.store.setState({selectedKeys:Ne}),qe.onDeselect(Object(G.a)(Object(G.a)({},Pe),{},{selectedKeys:Ne}))}},ue.onMouseEnter=function(Pe){ue.restoreModeVerticalFromInline();var ke=ue.props.onMouseEnter;ke&&ke(Pe)},ue.onTransitionEnd=function(Pe){var ke=Pe.propertyName==="width"&&Pe.target===Pe.currentTarget,qe=Pe.target.className,Ne=Object.prototype.toString.call(qe)==="[object SVGAnimatedString]"?qe.animVal:qe,st=Pe.propertyName==="font-size"&&Ne.indexOf("anticon")>=0;(ke||st)&&ue.restoreModeVerticalFromInline()},ue.setInnerMenu=function(Pe){ue.innerMenu=Pe},ue.isRootMenu=!0;var be=Le.defaultSelectedKeys,fe=Le.defaultOpenKeys;return"selectedKeys"in Le&&(be=Le.selectedKeys||[]),"openKeys"in Le&&(fe=Le.openKeys||[]),ue.store=Object(h.c)({selectedKeys:be,openKeys:fe,activeKey:{"0-menu-":Kt(Le,Le.activeKey)}}),ue.state={switchingModeFromInline:!1,prevProps:Le,inlineOpenKeys:[],store:ue.store},ue}return Object(T.a)(Xe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ue){var be=this.props,fe=be.siderCollapsed,Pe=be.inlineCollapsed,ke=be.onOpenChange;(!ue.inlineCollapsed&&Pe||!ue.siderCollapsed&&fe)&&ke([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ue=this.props.collapsedWidth,be=this.store,fe=this.prevOpenKeys,Pe=this.getInlineCollapsed()&&(ue===0||ue==="0"||ue==="0px");Pe?(this.prevOpenKeys=be.getState().openKeys.concat(),this.store.setState({openKeys:[]})):fe&&(this.store.setState({openKeys:fe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ue=this.props.mode,be=this.state.switchingModeFromInline,fe=this.getInlineCollapsed();return be&&fe?"inline":fe?"vertical":ue}},{key:"getInlineCollapsed",value:function(){var ue=this.props,be=ue.inlineCollapsed,fe=ue.siderCollapsed;return fe!==void 0?fe:be}},{key:"restoreModeVerticalFromInline",value:function(){var ue=this.state.switchingModeFromInline;ue&&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 ue=Object(G.a)({},Object(_.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),be=this.getRealMenuMode();return ue.className+=" ".concat(ue.prefixCls,"-root"),ue.direction==="rtl"&&(ue.className+=" ".concat(ue.prefixCls,"-rtl")),ue=Object(G.a)(Object(G.a)({},ue),{},{mode:be,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Cn(this.props,this.state,be)}),delete ue.openAnimation,delete ue.openTransitionName,P.createElement(h.a,{store:this.store},P.createElement(yn,Object(C.a)({},ue,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ue,be){var fe=be.prevProps,Pe=be.store,ke=Pe.getState(),qe={},Ne={prevProps:ue};return fe.mode==="inline"&&ue.mode!=="inline"&&(Ne.switchingModeFromInline=!0),"openKeys"in ue?qe.openKeys=ue.openKeys||[]:((ue.inlineCollapsed&&!fe.inlineCollapsed||ue.siderCollapsed&&!fe.siderCollapsed)&&(Ne.switchingModeFromInline=!0,Ne.inlineOpenKeys=ke.openKeys,qe.openKeys=[]),(!ue.inlineCollapsed&&fe.inlineCollapsed||!ue.siderCollapsed&&fe.siderCollapsed)&&(qe.openKeys=be.inlineOpenKeys,Ne.inlineOpenKeys=[])),Object.keys(qe).length&&Pe.setState(qe),Ne}}]),Xe}(P.Component);Ot.defaultProps={selectable:!0,onClick:re,onSelect:re,onOpenChange:re,onDeselect:re,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 rn=Ot,Ut=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(){var Le;return Object(R.a)(this,Xe),Le=je.apply(this,arguments),Le.onKeyDown=function(ue){var be=ue.keyCode;return be===o.a.ENTER?(Le.onClick(ue),!0):void 0},Le.onMouseLeave=function(ue){var be=Le.props,fe=be.eventKey,Pe=be.onItemHover,ke=be.onMouseLeave;Pe({key:fe,hover:!1}),ke({key:fe,domEvent:ue})},Le.onMouseEnter=function(ue){var be=Le.props,fe=be.eventKey,Pe=be.onItemHover,ke=be.onMouseEnter;Pe({key:fe,hover:!0}),ke({key:fe,domEvent:ue})},Le.onClick=function(ue){var be=Le.props,fe=be.eventKey,Pe=be.multiple,ke=be.onClick,qe=be.onSelect,Ne=be.onDeselect,st=be.isSelected,Pt={key:fe,keyPath:[fe],item:Object(v.a)(Le),domEvent:ue};ke(Pt),Pe?st?Ne(Pt):qe(Pt):st||qe(Pt)},Le.saveNode=function(ue){Le.node=ue},Le}return Object(T.a)(Xe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ue=this.props;ue.onDestroy&&ue.onDestroy(ue.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 ue,be=Object(G.a)({},this.props),fe=W()(this.getPrefixCls(),be.className,(ue={},Object(Z.a)(ue,this.getActiveClassName(),!be.disabled&&be.active),Object(Z.a)(ue,this.getSelectedClassName(),be.isSelected),Object(Z.a)(ue,this.getDisabledClassName(),be.disabled),ue)),Pe=Object(G.a)(Object(G.a)({},be.attribute),{},{title:typeof be.title=="string"?be.title:void 0,className:fe,role:be.role||"menuitem","aria-disabled":be.disabled});be.role==="option"?Pe=Object(G.a)(Object(G.a)({},Pe),{},{role:"option","aria-selected":be.isSelected}):(be.role===null||be.role==="none")&&(Pe.role="none");var ke={onClick:be.disabled?null:this.onClick,onMouseLeave:be.disabled?null:this.onMouseLeave,onMouseEnter:be.disabled?null:this.onMouseEnter},qe=Object(G.a)({},be.style);be.mode==="inline"&&(be.direction==="rtl"?qe.paddingRight=be.inlineIndent*be.level:qe.paddingLeft=be.inlineIndent*be.level),le.forEach(function(st){return delete be[st]}),delete be.direction;var Ne=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ne=P.createElement(this.props.itemIcon,this.props)),P.createElement("li",Object(C.a)({},Object(_.a)(be,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Pe,ke,{style:qe,ref:this.saveNode}),be.children,Ne)}}]),Xe}(P.Component);Ut.isMenuItem=!0,Ut.defaultProps={onSelect:re,onMouseEnter:re,onMouseLeave:re,manualRef:re};var wt=Object(h.b)(function(Se,je){var Xe=Se.activeKey,Le=Se.selectedKeys,ue=je.eventKey,be=je.subMenuKey;return{active:Xe[be]===ue,isSelected:Array.isArray(Le)?Le.indexOf(ue)!==-1:Le===ue}})(Ut),Rn=wt,bn=function(Se){Object(b.a)(Xe,Se);var je=Object(f.a)(Xe);function Xe(){var Le;return Object(R.a)(this,Xe),Le=je.apply(this,arguments),Le.renderInnerMenuItem=function(ue){var be=Le.props,fe=be.renderMenuItem,Pe=be.index;return fe(ue,Pe,Le.props.subMenuKey)},Le}return Object(T.a)(Xe,[{key:"render",value:function(){var ue=Object(C.a)({},this.props),be=ue.className,fe=be===void 0?"":be,Pe=ue.rootPrefixCls,ke="".concat(Pe,"-item-group-title"),qe="".concat(Pe,"-item-group-list"),Ne=ue.title,st=ue.children;return le.forEach(function(Pt){return delete ue[Pt]}),delete ue.direction,P.createElement("li",Object(C.a)({},ue,{onClick:function($t){return $t.stopPropagation()},className:"".concat(fe," ").concat(Pe,"-item-group")}),P.createElement("div",{className:ke,title:typeof Ne=="string"?Ne:void 0},Ne),P.createElement("ul",{className:qe},P.Children.map(st,this.renderInnerMenuItem)))}}]),Xe}(P.Component);bn.isMenuItemGroup=!0,bn.defaultProps={disabled:!0};var Wt=bn,dt=function(je){var Xe=je.className,Le=je.rootPrefixCls,ue=je.style;return P.createElement("li",{className:"".concat(Xe," ").concat(Le,"-item-divider"),style:ue})};dt.defaultProps={disabled:!0,className:"",style:{}};var An=dt,an=rn,Kn=D("eDIo");function zt(Se,je){var Xe=Se.prefixCls,Le=Se.editable,ue=Se.locale,be=Se.style;return!Le||Le.showAdd===!1?null:P.createElement("button",{ref:je,type:"button",className:"".concat(Xe,"-nav-add"),style:be,"aria-label":(ue==null?void 0:ue.addAriaLabel)||"Add tab",onClick:function(Pe){Le.onEdit("add",{event:Pe})}},Le.addIcon||"+")}var En=P.forwardRef(zt);function Ln(Se,je){var Xe=Se.prefixCls,Le=Se.id,ue=Se.tabs,be=Se.locale,fe=Se.mobile,Pe=Se.moreIcon,ke=Pe===void 0?"More":Pe,qe=Se.moreTransitionName,Ne=Se.style,st=Se.className,Pt=Se.editable,$t=Se.tabBarGutter,sn=Se.rtl,Pn=Se.onTabClick,Un=Object(P.useState)(!1),ar=Object(V.a)(Un,2),tr=ar[0],fr=ar[1],_r=Object(P.useState)(null),lr=Object(V.a)(_r,2),pr=lr[0],Er=lr[1],ln="".concat(Le,"-more-popup"),Yt="".concat(Xe,"-dropdown"),pn=pr!==null?"".concat(ln,"-").concat(pr):null,Ft=be==null?void 0:be.dropdownAriaLabel,Bt=P.createElement(an,{onClick:function(jr){var Ir=jr.key,Pr=jr.domEvent;Pn(Ir,Pr),fr(!1)},id:ln,tabIndex:-1,role:"listbox","aria-activedescendant":pn,selectedKeys:[pr],"aria-label":Ft!==void 0?Ft:"expanded dropdown"},ue.map(function(Rr){return P.createElement(Rn,{key:Rr.key,id:"".concat(ln,"-").concat(Rr.key),role:"option","aria-controls":Le&&"".concat(Le,"-panel-").concat(Rr.key),disabled:Rr.disabled},Rr.tab)}));function or(Rr){for(var jr=ue.filter(function(ci){return!ci.disabled}),Ir=jr.findIndex(function(ci){return ci.key===pr})||0,Pr=jr.length,Dr=0;Dr<Pr;Dr+=1){Ir=(Ir+Rr+Pr)%Pr;var ur=jr[Ir];if(!ur.disabled){Er(ur.key);return}}}function xr(Rr){var jr=Rr.which;if(!tr){[o.a.DOWN,o.a.SPACE,o.a.ENTER].includes(jr)&&(fr(!0),Rr.preventDefault());return}switch(jr){case o.a.UP:or(-1),Rr.preventDefault();break;case o.a.DOWN:or(1),Rr.preventDefault();break;case o.a.ESC:fr(!1);break;case o.a.SPACE:case o.a.ENTER:pr!==null&&Pn(pr,Rr);break}}Object(P.useEffect)(function(){var Rr=document.getElementById(pn);Rr&&Rr.scrollIntoView&&Rr.scrollIntoView(!1)},[pr]),Object(P.useEffect)(function(){tr||Er(null)},[tr]);var Xn=Object(Z.a)({},sn?"marginLeft":"marginRight",$t);ue.length||(Xn.visibility="hidden",Xn.order=1);var Or=W()(Object(Z.a)({},"".concat(Yt,"-rtl"),sn)),Xr=fe?null:P.createElement(Kn.a,{prefixCls:Yt,overlay:Bt,trigger:["hover"],visible:tr,transitionName:qe,onVisibleChange:fr,overlayClassName:Or,mouseEnterDelay:.1,mouseLeaveDelay:.1},P.createElement("button",{type:"button",className:"".concat(Xe,"-nav-more"),style:Xn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":ln,id:"".concat(Le,"-more"),"aria-expanded":tr,onKeyDown:xr},ke));return P.createElement("div",{className:W()("".concat(Xe,"-nav-operations"),st),style:Ne,ref:je},Xr,P.createElement(En,{prefixCls:Xe,locale:be,editable:Pt}))}var cn=P.forwardRef(Ln),dr=Object(P.createContext)(null),xn=.1,gn=.01,Ct=20,Ze=Math.pow(.995,Ct);function Lt(){var Se=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(Se)||/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(Se.substr(0,4)))}function At(Se,je){var Xe=Object(P.useState)(),Le=Object(V.a)(Xe,2),ue=Le[0],be=Le[1],fe=Object(P.useState)(0),Pe=Object(V.a)(fe,2),ke=Pe[0],qe=Pe[1],Ne=Object(P.useState)(0),st=Object(V.a)(Ne,2),Pt=st[0],$t=st[1],sn=Object(P.useState)(),Pn=Object(V.a)(sn,2),Un=Pn[0],ar=Pn[1],tr=Object(P.useRef)();function fr(Ft){var Bt=Ft.touches[0],or=Bt.screenX,xr=Bt.screenY;be({x:or,y:xr}),window.clearInterval(tr.current)}function _r(Ft){if(!ue)return;Ft.preventDefault();var Bt=Ft.touches[0],or=Bt.screenX,xr=Bt.screenY;be({x:or,y:xr});var Xn=or-ue.x,Or=xr-ue.y;je(Xn,Or);var Xr=Date.now();qe(Xr),$t(Xr-ke),ar({x:Xn,y:Or})}function lr(){if(!ue)return;if(be(null),ar(null),Un){var Ft=Un.x/Pt,Bt=Un.y/Pt,or=Math.abs(Ft),xr=Math.abs(Bt);if(Math.max(or,xr)<xn)return;var Xn=Ft,Or=Bt;tr.current=window.setInterval(function(){if(Math.abs(Xn)<gn&&Math.abs(Or)<gn){window.clearInterval(tr.current);return}Xn*=Ze,Or*=Ze,je(Xn*Ct,Or*Ct)},Ct)}}var pr=Object(P.useRef)(0),Er=Object(P.useRef)(!1),ln=Object(P.useRef)();function Yt(Ft){var Bt=Ft.deltaX,or=Ft.deltaY,xr=0,Xn=Math.abs(Bt),Or=Math.abs(or);Xn===Or?xr=ln.current==="x"?Bt:or:Xn>Or?(xr=Bt,ln.current="x"):(xr=or,ln.current="y");var Xr=Date.now();Xr-pr.current>100&&(Er.current=!1),(je(-xr,-xr)||Er.current)&&(Ft.preventDefault(),Er.current=!0),pr.current=Xr}var pn=Object(P.useRef)(null);pn.current={onTouchStart:fr,onTouchMove:_r,onTouchEnd:lr,onWheel:Yt},P.useEffect(function(){function Ft(Xn){pn.current.onTouchStart(Xn)}function Bt(Xn){pn.current.onTouchMove(Xn)}function or(Xn){pn.current.onTouchEnd(Xn)}function xr(Xn){pn.current.onWheel(Xn)}return document.addEventListener("touchmove",Bt,{passive:!1}),document.addEventListener("touchend",or,{passive:!1}),Se.current.addEventListener("touchstart",Ft,{passive:!1}),Se.current.addEventListener("wheel",xr),function(){document.removeEventListener("touchmove",Bt),document.removeEventListener("touchend",or)}},[])}function en(){var Se=Object(P.useRef)(new Map);function je(Le){return Se.current.has(Le)||Se.current.set(Le,P.createRef()),Se.current.get(Le)}function Xe(Le){Se.current.delete(Le)}return[je,Xe]}function Nn(Se,je){var Xe=P.useRef(Se),Le=P.useState({}),ue=Object(V.a)(Le,2),be=ue[1];function fe(Pe){var ke=typeof Pe=="function"?Pe(Xe.current):Pe;ke!==Xe.current&&je(ke,Xe.current),Xe.current=ke,be({})}return[Xe.current,fe]}var Sn=function(je){var Xe=je.position,Le=je.prefixCls,ue=je.extra;if(!ue)return null;var be,fe=ue;return Xe==="right"&&(be=fe.right||!fe.left&&fe||null),Xe==="left"&&(be=fe.left||null),be?P.createElement("div",{className:"".concat(Le,"-extra-content")},be):null};function Qn(Se,je){var Xe,Le=P.useContext(dr),ue=Le.prefixCls,be=Le.tabs,fe=Se.className,Pe=Se.style,ke=Se.id,qe=Se.animated,Ne=Se.activeKey,st=Se.rtl,Pt=Se.extra,$t=Se.editable,sn=Se.locale,Pn=Se.tabPosition,Un=Se.tabBarGutter,ar=Se.children,tr=Se.onTabClick,fr=Se.onTabScroll,_r=Object(P.useRef)(),lr=Object(P.useRef)(),pr=Object(P.useRef)(),Er=Object(P.useRef)(),ln=en(),Yt=Object(V.a)(ln,2),pn=Yt[0],Ft=Yt[1],Bt=Pn==="top"||Pn==="bottom",or=Nn(0,function(Fr,Tr){Bt&&fr&&fr({direction:Fr>Tr?"left":"right"})}),xr=Object(V.a)(or,2),Xn=xr[0],Or=xr[1],Xr=Nn(0,function(Fr,Tr){!Bt&&fr&&fr({direction:Fr>Tr?"top":"bottom"})}),Rr=Object(V.a)(Xr,2),jr=Rr[0],Ir=Rr[1],Pr=Object(P.useState)(0),Dr=Object(V.a)(Pr,2),ur=Dr[0],ci=Dr[1],Ji=Object(P.useState)(0),Ii=Object(V.a)(Ji,2),Ci=Ii[0],Qr=Ii[1],Kr=Object(P.useState)(0),Vr=Object(V.a)(Kr,2),Zr=Vr[0],Ni=Vr[1],ha=Object(P.useState)(0),sa=Object(V.a)(ha,2),Gr=sa[0],Qi=sa[1],Zi=Object(P.useState)(null),$r=Object(V.a)(Zi,2),Hr=$r[0],yi=$r[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=a(new Map),Ra=Object(V.a)(_a,2),ho=Ra[0],Ya=Ra[1],Aa=n(be,ho,ur),Da="".concat(ue,"-nav-operations-hidden"),ya=0,Mi=0;Bt?st?(ya=0,Mi=Math.max(0,ur-Hr)):(ya=Math.min(0,Hr-ur),Mi=0):(ya=Math.min(0,la-Ci),Mi=0);function fa(Fr){return Fr<ya?[ya,!1]:Fr>Mi?[Mi,!1]:[Fr,!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)}At(_r,function(Fr,Tr){var ai=!1;function Ui(La,ca){La(function(ja){var da=fa(ja+ca),bi=Object(V.a)(da,2),Fa=bi[0],Ba=bi[1];return ai=Ba,Fa})}if(Bt){if(Hr>=ur)return ai;Ui(Or,Fr)}else{if(la>=Ci)return ai;Ui(Ir,Tr)}return Ia(),Ja(),ai}),Object(P.useEffect)(function(){return Ia(),Xa&&(pa.current=window.setTimeout(function(){$a(0)},100)),Ia},[Xa]);function ua(){var Fr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ne,Tr=Aa.get(Fr);if(!Tr)return;if(Bt){var ai=Xn;st?Tr.right<Xn?ai=Tr.right:Tr.right+Tr.width>Xn+Hr&&(ai=Tr.right+Tr.width-Hr):Tr.left<-Xn?ai=-Tr.left:Tr.left+Tr.width>-Xn+Hr&&(ai=-(Tr.left+Tr.width-Hr)),Ir(0),Or(fa(ai)[0])}else{var Ui=jr;Tr.top<-jr?Ui=-Tr.top:Tr.top+Tr.height>-jr+la&&(Ui=-(Tr.top+Tr.height-la)),Or(0),Ir(fa(Ui)[0])}}var Ea=S(Aa,{width:Hr,height:la,left:Xn,top:jr},{width:Zr,height:Gr},{width:ka,height:Oa},Object(G.a)(Object(G.a)({},Se),{},{tabs:be})),ro=Object(V.a)(Ea,2),Ao=ro[0],Do=ro[1],fo=be.map(function(Fr){var Tr=Fr.key;return P.createElement(s,{id:ke,prefixCls:ue,key:Tr,rtl:st,tab:Fr,closable:Fr.closable,editable:$t,active:Tr===Ne,tabPosition:Pn,tabBarGutter:Un,renderWrapper:ar,removeAriaLabel:sn==null?void 0:sn.removeAriaLabel,ref:pn(Tr),onClick:function(Ui){tr(Tr,Ui)},onRemove:function(){Ft(Tr)},onFocus:function(){ua(Tr),Ja(),st||(_r.current.scrollLeft=0),_r.current.scrollTop=0}})}),io=u(function(){var Fr,Tr,ai,Ui,La,ca,ja,da,bi,Fa=((Fr=_r.current)===null||Fr===void 0?void 0:Fr.offsetWidth)||0,Ba=((Tr=_r.current)===null||Tr===void 0?void 0:Tr.offsetHeight)||0,Ha=((ai=Er.current)===null||ai===void 0?void 0:ai.offsetWidth)||0,Ki=((Ui=Er.current)===null||Ui===void 0?void 0:Ui.offsetHeight)||0,Nr=((La=pr.current)===null||La===void 0?void 0:La.offsetWidth)||0,gr=((ca=pr.current)===null||ca===void 0?void 0:ca.offsetHeight)||0;yi(Fa),Ca(Ba),co(Ha),Va(Ki);var Bn=(((ja=lr.current)===null||ja===void 0?void 0:ja.offsetWidth)||0)-Ha,nr=(((da=lr.current)===null||da===void 0?void 0:da.offsetHeight)||0)-Ki;ci(Bn),Qr(nr);var Cr=(bi=pr.current)===null||bi===void 0?void 0:bi.className.includes(Da);Ni(Bn-(Cr?0:Nr)),Qi(nr-(Cr?0:gr)),Ya(function(){var ti=new Map;return be.forEach(function(ga){var ia=ga.key,Di=pn(ia).current;Di&&ti.set(ia,{width:Di.offsetWidth,height:Di.offsetHeight,left:Di.offsetLeft,top:Di.offsetTop})}),ti})}),po=be.slice(0,Ao),Wi=be.slice(Do+1),hi=[].concat(Object(M.a)(po),Object(M.a)(Wi)),Ai=Object(P.useState)(),fi=Object(V.a)(Ai,2),Na=fi[0],mo=fi[1],qi=Aa.get(Ne),ao=Object(P.useRef)();function oo(){p.a.cancel(ao.current)}Object(P.useEffect)(function(){var Fr={};return qi&&(Bt?(st?Fr.right=qi.right:Fr.left=qi.left,Fr.width=qi.width):(Fr.top=qi.top,Fr.height=qi.height)),oo(),ao.current=p()(function(){mo(Fr)}),oo},[qi,Bt,st]),Object(P.useEffect)(function(){ua()},[Ne,qi,Aa,Bt]),Object(P.useEffect)(function(){io()},[st,Un,Ne,be.map(function(Fr){return Fr.key}).join("_")]);var so=!!hi.length,xa="".concat(ue,"-nav-wrap"),Qa,Ua,go,Za;return Bt?st?(Ua=Xn>0,Qa=Xn+Hr<ur):(Qa=Xn<0,Ua=-Xn+Hr<ur):(go=jr<0,Za=-jr+la<Ci),P.createElement("div",{ref:je,role:"tablist",className:W()("".concat(ue,"-nav"),fe),style:Pe,onKeyDown:function(){Ja()}},P.createElement(Sn,{position:"left",extra:Pt,prefixCls:ue}),P.createElement(m.a,{onResize:io},P.createElement("div",{className:W()(xa,(Xe={},Object(Z.a)(Xe,"".concat(xa,"-ping-left"),Qa),Object(Z.a)(Xe,"".concat(xa,"-ping-right"),Ua),Object(Z.a)(Xe,"".concat(xa,"-ping-top"),go),Object(Z.a)(Xe,"".concat(xa,"-ping-bottom"),Za),Xe)),ref:_r},P.createElement(m.a,{onResize:io},P.createElement("div",{ref:lr,className:"".concat(ue,"-nav-list"),style:{transform:"translate(".concat(Xn,"px, ").concat(jr,"px)"),transition:Xa?"none":void 0}},fo,P.createElement(En,{ref:Er,prefixCls:ue,locale:sn,editable:$t,style:{visibility:so?"hidden":null}}),P.createElement("div",{className:W()("".concat(ue,"-ink-bar"),Object(Z.a)({},"".concat(ue,"-ink-bar-animated"),qe.inkBar)),style:Na}))))),P.createElement(cn,Object.assign({},Se,{ref:pr,prefixCls:ue,tabs:hi,className:!so&&Da})),P.createElement(Sn,{position:"right",extra:Pt,prefixCls:ue}))}var zn=P.forwardRef(Qn);function vr(Se){var je=Se.id,Xe=Se.activeKey,Le=Se.animated,ue=Se.tabPosition,be=Se.rtl,fe=Se.destroyInactiveTabPane,Pe=P.useContext(dr),ke=Pe.prefixCls,qe=Pe.tabs,Ne=Le.tabPane,st=qe.findIndex(function(Pt){return Pt.key===Xe});return P.createElement("div",{className:W()("".concat(ke,"-content-holder"))},P.createElement("div",{className:W()("".concat(ke,"-content"),"".concat(ke,"-content-").concat(ue),Object(Z.a)({},"".concat(ke,"-content-animated"),Ne)),style:st&&Ne?Object(Z.a)({},be?"marginRight":"marginLeft","-".concat(st,"00%")):null},qe.map(function(Pt){return P.cloneElement(Pt.node,{key:Pt.key,prefixCls:ke,tabKey:Pt.key,id:je,animated:Ne,active:Pt.key===Xe,destroyInactiveTabPane:fe})})))}function sr(Se){var je=Se.prefixCls,Xe=Se.forceRender,Le=Se.className,ue=Se.style,be=Se.id,fe=Se.active,Pe=Se.animated,ke=Se.destroyInactiveTabPane,qe=Se.tabKey,Ne=Se.children,st=P.useState(Xe),Pt=Object(V.a)(st,2),$t=Pt[0],sn=Pt[1];P.useEffect(function(){fe?sn(!0):ke&&sn(!1)},[fe,ke]);var Pn={};return fe||(Pe?(Pn.visibility="hidden",Pn.height=0,Pn.overflowY="hidden"):Pn.display="none"),P.createElement("div",{id:be&&"".concat(be,"-panel-").concat(qe),role:"tabpanel",tabIndex:fe?0:-1,"aria-labelledby":be&&"".concat(be,"-tab-").concat(qe),"aria-hidden":!fe,style:Object(G.a)(Object(G.a)({},Pn),ue),className:W()("".concat(je,"-tabpane"),fe&&"".concat(je,"-tabpane-active"),Le)},(fe||$t||Xe)&&Ne)}var hr=0;function Wr(Se){return Object(k.a)(Se).map(function(je){if(P.isValidElement(je)){var Xe=je.key!==void 0?String(je.key):void 0;return Object(G.a)(Object(G.a)({key:Xe},je.props),{},{node:je})}return null}).filter(function(je){return je})}function Ur(Se,je){var Xe,Le=Se.id,ue=Se.prefixCls,be=ue===void 0?"rc-tabs":ue,fe=Se.className,Pe=Se.children,ke=Se.direction,qe=Se.activeKey,Ne=Se.defaultActiveKey,st=Se.editable,Pt=Se.animated,$t=Se.tabPosition,sn=$t===void 0?"top":$t,Pn=Se.tabBarGutter,Un=Se.tabBarStyle,ar=Se.tabBarExtraContent,tr=Se.locale,fr=Se.moreIcon,_r=Se.moreTransitionName,lr=Se.destroyInactiveTabPane,pr=Se.renderTabBar,Er=Se.onChange,ln=Se.onTabClick,Yt=Se.onTabScroll,pn=Object(I.a)(Se,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Ft=Wr(Pe),Bt=ke==="rtl",or;Pt===!1?or={inkBar:!1,tabPane:!1}:or=Object(G.a)({inkBar:!0,tabPane:!1},Pt!==!0?Pt:null);var xr=Object(P.useState)(!1),Xn=Object(V.a)(xr,2),Or=Xn[0],Xr=Xn[1];Object(P.useEffect)(function(){Xr(Lt())},[]);var Rr=Object(r.a)(function(){var Gr;return(Gr=Ft[0])===null||Gr===void 0?void 0:Gr.key},{value:qe,defaultValue:Ne}),jr=Object(V.a)(Rr,2),Ir=jr[0],Pr=jr[1],Dr=Object(P.useState)(function(){return Ft.findIndex(function(Gr){return Gr.key===Ir})}),ur=Object(V.a)(Dr,2),ci=ur[0],Ji=ur[1];Object(P.useEffect)(function(){var Gr=Ft.findIndex(function(Zi){return Zi.key===Ir});if(Gr===-1){var Qi;Gr=Math.max(0,Math.min(ci,Ft.length-1)),Pr((Qi=Ft[Gr])===null||Qi===void 0?void 0:Qi.key)}Ji(Gr)},[Ft.map(function(Gr){return Gr.key}).join("_"),Ir,ci]);var Ii=Object(r.a)(null,{value:Le}),Ci=Object(V.a)(Ii,2),Qr=Ci[0],Kr=Ci[1],Vr=sn;Or&&!["left","right"].includes(sn)&&(Vr="top"),Object(P.useEffect)(function(){Le||(Kr("rc-tabs-".concat(hr)),hr+=1)},[]);function Zr(Gr,Qi){ln==null||ln(Gr,Qi),Pr(Gr),Er==null||Er(Gr)}var Ni={id:Qr,activeKey:Ir,animated:or,tabPosition:Vr,rtl:Bt,mobile:Or},ha,sa=Object(G.a)(Object(G.a)({},Ni),{},{editable:st,locale:tr,moreIcon:fr,moreTransitionName:_r,tabBarGutter:Pn,onTabClick:Zr,onTabScroll:Yt,extra:ar,style:Un,panes:Pe});return pr?ha=pr(sa,zn):ha=P.createElement(zn,Object.assign({},sa)),P.createElement(dr.Provider,{value:{tabs:Ft,prefixCls:be}},P.createElement("div",Object.assign({ref:je,id:Le,className:W()(be,"".concat(be,"-").concat(Vr),(Xe={},Object(Z.a)(Xe,"".concat(be,"-mobile"),Or),Object(Z.a)(Xe,"".concat(be,"-editable"),st),Object(Z.a)(Xe,"".concat(be,"-rtl"),Bt),Xe),fe)},pn),ha,P.createElement(vr,Object.assign({destroyInactiveTabPane:lr},Ni,{animated:or}))))}var Br=P.forwardRef(Ur);Br.TabPane=sr;var li=Br,ui=_e.b=li},kSUc:function(jt,_e,D){},lZu9:function(jt,_e,D){(function(Z){Z(D("VrN/"),D("1eCo"),D("8EBN"))})(function(Z){"use strict";Z.defineMode("markdown",function(V,I){var G=Z.getMode(V,"text/html"),P=G.name=="null";function L(U){if(Z.findModeByName){var w=Z.findModeByName(U);w&&(U=w.mime||w.mimes[0])}var Y=Z.getMode(V,U);return Y.name=="null"?null:Y}I.highlightFormatting===void 0&&(I.highlightFormatting=!1),I.maxBlockquoteDepth===void 0&&(I.maxBlockquoteDepth=0),I.taskLists===void 0&&(I.taskLists=!1),I.strikethrough===void 0&&(I.strikethrough=!1),I.emoji===void 0&&(I.emoji=!1),I.fencedCodeBlockHighlighting===void 0&&(I.fencedCodeBlockHighlighting=!0),I.fencedCodeBlockDefaultMode===void 0&&(I.fencedCodeBlockDefaultMode="text/plain"),I.xml===void 0&&(I.xml=!0),I.tokenTypeOverrides===void 0&&(I.tokenTypeOverrides={});var W={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 W)W.hasOwnProperty(k)&&I.tokenTypeOverrides[k]&&(W[k]=I.tokenTypeOverrides[k]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,E=/^\[(x| )\](?=\s)/i,p=I.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,o=/^\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(U,w,Y){return w.f=w.inline=Y,Y(U,w)}function n(U,w,Y){return w.f=w.block=Y,Y(U,w)}function O(U){return!U||!/\S/.test(U.string)}function S(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==R){var w=P;if(!w){var Y=Z.innerMode(G,U.htmlState);w=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}w&&(U.f=f,U.block=C,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function C(U,w){var Y=U.column()===w.indentation,q=O(w.prevLine.stream),ce=w.indentedCode,Ee=w.prevLine.hr,Qe=w.list!==!1,Te=(w.listStack[w.listStack.length-1]||0)+3;w.indentedCode=!1;var We=w.indentation;if(w.indentationDiff===null&&(w.indentationDiff=w.indentation,Qe)){for(w.list=null;We<w.listStack[w.listStack.length-1];)w.listStack.pop(),w.listStack.length?w.indentation=w.listStack[w.listStack.length-1]:w.list=!1;w.list!==!1&&(w.indentationDiff=We-w.listStack[w.listStack.length-1])}var $e=!q&&!Ee&&!w.prevLine.header&&(!Qe||!ce)&&!w.prevLine.fencedCodeEnd,Je=(w.list===!1||Ee||q)&&w.indentation<=Te&&U.match(r),Ce=null;if(w.indentationDiff>=4&&(ce||w.prevLine.fencedCodeEnd||w.prevLine.header||q))return U.skipToEnd(),w.indentedCode=!0,W.code;if(U.eatSpace())return null;if(Y&&w.indentation<=Te&&(Ce=U.match(p))&&Ce[1].length<=6)return w.quote=0,w.header=Ce[1].length,w.thisLine.header=!0,I.highlightFormatting&&(w.formatting="header"),w.f=w.inline,v(w);if(w.indentation<=Te&&U.eat(">"))return w.quote=Y?1:w.quote+1,I.highlightFormatting&&(w.formatting="quote"),U.eatSpace(),v(w);if(!Je&&!w.setext&&Y&&w.indentation<=Te&&(Ce=U.match(M))){var X=Ce[1]?"ol":"ul";return w.indentation=We+U.current().length,w.list=!0,w.quote=0,w.listStack.push(w.indentation),w.em=!1,w.strong=!1,w.code=!1,w.strikethrough=!1,I.taskLists&&U.match(E,!1)&&(w.taskList=!0),w.f=w.inline,I.highlightFormatting&&(w.formatting=["list","list-"+X]),v(w)}else{if(Y&&w.indentation<=Te&&(Ce=U.match(a,!0)))return w.quote=0,w.fencedEndRE=new RegExp(Ce[1]+"+ *$"),w.localMode=I.fencedCodeBlockHighlighting&&L(Ce[2]||I.fencedCodeBlockDefaultMode),w.localMode&&(w.localState=Z.startState(w.localMode)),w.f=w.block=T,I.highlightFormatting&&(w.formatting="code-block"),w.code=-1,v(w);if(w.setext||(!$e||!Qe)&&!w.quote&&w.list===!1&&!w.code&&!Je&&!o.test(U.string)&&(Ce=U.lookAhead(1))&&(Ce=Ce.match(m)))return w.setext?(w.header=w.setext,w.setext=0,U.skipToEnd(),I.highlightFormatting&&(w.formatting="header")):(w.header=Ce[0].charAt(0)=="="?1:2,w.setext=w.header),w.thisLine.header=!0,w.f=w.inline,v(w);if(Je)return U.skipToEnd(),w.hr=!0,w.thisLine.hr=!0,W.hr;if(U.peek()==="[")return i(U,w,N)}return i(U,w,w.inline)}function R(U,w){var Y=G.token(U,w.htmlState);if(!P){var q=Z.innerMode(G,w.htmlState);(q.mode.name=="xml"&&q.state.tagStart===null&&!q.state.context&&q.state.tokenize.isInText||w.md_inside&&U.current().indexOf(">")>-1)&&(w.f=f,w.block=C,w.htmlState=null)}return Y}function T(U,w){var Y=w.listStack[w.listStack.length-1]||0,q=w.indentation<Y,ce=Y+3;if(w.fencedEndRE&&w.indentation<=ce&&(q||U.match(w.fencedEndRE))){I.highlightFormatting&&(w.formatting="code-block");var Ee;return q||(Ee=v(w)),w.localMode=w.localState=null,w.block=C,w.f=f,w.fencedEndRE=null,w.code=0,w.thisLine.fencedCodeEnd=!0,q?n(U,w,w.block):Ee}else return w.localMode?w.localMode.token(U,w.localState):(U.skipToEnd(),W.code)}function v(U){var w=[];if(U.formatting){w.push(W.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var Y=0;Y<U.formatting.length;Y++)w.push(W.formatting+"-"+U.formatting[Y]),U.formatting[Y]==="header"&&w.push(W.formatting+"-"+U.formatting[Y]+"-"+U.header),U.formatting[Y]==="quote"&&(!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?w.push(W.formatting+"-"+U.formatting[Y]+"-"+U.quote):w.push("error"))}if(U.taskOpen)return w.push("meta"),w.length?w.join(" "):null;if(U.taskClosed)return w.push("property"),w.length?w.join(" "):null;if(U.linkHref?w.push(W.linkHref,"url"):(U.strong&&w.push(W.strong),U.em&&w.push(W.em),U.strikethrough&&w.push(W.strikethrough),U.emoji&&w.push(W.emoji),U.linkText&&w.push(W.linkText),U.code&&w.push(W.code),U.image&&w.push(W.image),U.imageAltText&&w.push(W.imageAltText,"link"),U.imageMarker&&w.push(W.imageMarker)),U.header&&w.push(W.header,W.header+"-"+U.header),U.quote&&(w.push(W.quote),!I.maxBlockquoteDepth||I.maxBlockquoteDepth>=U.quote?w.push(W.quote+"-"+U.quote):w.push(W.quote+"-"+I.maxBlockquoteDepth)),U.list!==!1){var q=(U.listStack.length-1)%3;q?q===1?w.push(W.list2):w.push(W.list3):w.push(W.list1)}return U.trailingSpaceNewLine?w.push("trailing-space-new-line"):U.trailingSpace&&w.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),w.length?w.join(" "):null}function b(U,w){return U.match(u,!0)?v(w):void 0}function f(U,w){var Y=w.text(U,w);if(typeof Y!="undefined")return Y;if(w.list)return w.list=null,v(w);if(w.taskList){var q=U.match(E,!0)[1]===" ";return q?w.taskOpen=!0:w.taskClosed=!0,I.highlightFormatting&&(w.formatting="task"),w.taskList=!1,v(w)}if(w.taskOpen=!1,w.taskClosed=!1,w.header&&U.match(/^#+$/,!0))return I.highlightFormatting&&(w.formatting="header"),v(w);var ce=U.next();if(w.linkTitle){w.linkTitle=!1;var Ee=ce;ce==="("&&(Ee=")"),Ee=(Ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Qe="^\\s*(?:[^"+Ee+"\\\\]+|\\\\\\\\|\\\\.)"+Ee;if(U.match(new RegExp(Qe),!0))return W.linkHref}if(ce==="`"){var Te=w.formatting;I.highlightFormatting&&(w.formatting="code"),U.eatWhile("`");var We=U.current().length;if(w.code==0&&(!w.quote||We==1))return w.code=We,v(w);if(We==w.code){var $e=v(w);return w.code=0,$e}else return w.formatting=Te,v(w)}else if(w.code)return v(w);if(ce==="\\"&&(U.next(),I.highlightFormatting)){var Je=v(w),Ce=W.formatting+"-escape";return Je?Je+" "+Ce:Ce}if(ce==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return w.imageMarker=!0,w.image=!0,I.highlightFormatting&&(w.formatting="image"),v(w);if(ce==="["&&w.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return w.imageMarker=!1,w.imageAltText=!0,I.highlightFormatting&&(w.formatting="image"),v(w);if(ce==="]"&&w.imageAltText){I.highlightFormatting&&(w.formatting="image");var Je=v(w);return w.imageAltText=!1,w.image=!1,w.inline=w.f=_,Je}if(ce==="["&&!w.image)return w.linkText&&U.match(/^.*?\]/)||(w.linkText=!0,I.highlightFormatting&&(w.formatting="link")),v(w);if(ce==="]"&&w.linkText){I.highlightFormatting&&(w.formatting="link");var Je=v(w);return w.linkText=!1,w.inline=w.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?_:f,Je}if(ce==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,I.highlightFormatting&&(w.formatting="link");var Je=v(w);return Je?Je+=" ":Je="",Je+W.linkInline}if(ce==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=h,I.highlightFormatting&&(w.formatting="link");var Je=v(w);return Je?Je+=" ":Je="",Je+W.linkEmail}if(I.xml&&ce==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var X=U.string.indexOf(">",U.pos);if(X!=-1){var j=U.string.substring(U.start,X);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(j)&&(w.md_inside=!0)}return U.backUp(1),w.htmlState=Z.startState(G),n(U,w,R)}if(I.xml&&ce==="<"&&U.match(/^\/\w*?>/))return w.md_inside=!1,"tag";if(ce==="*"||ce==="_"){for(var K=1,Q=U.pos==1?" ":U.string.charAt(U.pos-2);K<3&&U.eat(ce);)K++;var re=U.peek()||" ",z=!/\s/.test(re)&&(!c.test(re)||/\s/.test(Q)||c.test(Q)),we=!/\s/.test(Q)&&(!c.test(Q)||/\s/.test(re)||c.test(re)),Ue=null,rt=null;if(K%2&&(!w.em&&z&&(ce==="*"||!we||c.test(Q))?Ue=!0:w.em==ce&&we&&(ce==="*"||!z||c.test(re))&&(Ue=!1)),K>1&&(!w.strong&&z&&(ce==="*"||!we||c.test(Q))?rt=!0:w.strong==ce&&we&&(ce==="*"||!z||c.test(re))&&(rt=!1)),rt!=null||Ue!=null){I.highlightFormatting&&(w.formatting=Ue==null?"strong":rt==null?"em":"strong em"),Ue===!0&&(w.em=ce),rt===!0&&(w.strong=ce);var $e=v(w);return Ue===!1&&(w.em=!1),rt===!1&&(w.strong=!1),$e}}else if(ce===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return v(w);U.backUp(1)}if(I.strikethrough){if(ce==="~"&&U.eatWhile(ce)){if(w.strikethrough){I.highlightFormatting&&(w.formatting="strikethrough");var $e=v(w);return w.strikethrough=!1,$e}else if(U.match(/^[^\s]/,!1))return w.strikethrough=!0,I.highlightFormatting&&(w.formatting="strikethrough"),v(w)}else if(ce===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return v(w);U.backUp(2)}}if(I.emoji&&ce===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){w.emoji=!0,I.highlightFormatting&&(w.formatting="emoji");var le=v(w);return w.emoji=!1,le}return ce===" "&&(U.match(/^ +$/,!1)?w.trailingSpace++:w.trailingSpace&&(w.trailingSpaceNewLine=!0)),v(w)}function h(U,w){var Y=U.next();if(Y===">"){w.f=w.inline=f,I.highlightFormatting&&(w.formatting="link");var q=v(w);return q?q+=" ":q="",q+W.linkInline}return U.match(/^[^>]+/,!0),W.linkInline}function _(U,w){if(U.eatSpace())return null;var Y=U.next();return Y==="("||Y==="["?(w.f=w.inline=x(Y==="("?")":"]"),I.highlightFormatting&&(w.formatting="link-string"),w.linkHref=!0,v(w)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(U){return function(w,Y){var q=w.next();if(q===U){Y.f=Y.inline=f,I.highlightFormatting&&(Y.formatting="link-string");var ce=v(Y);return Y.linkHref=!1,ce}return w.match(g[U]),Y.linkHref=!0,v(Y)}}function N(U,w){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(w.f=F,U.next(),I.highlightFormatting&&(w.formatting="link"),w.linkText=!0,v(w)):i(U,w,f)}function F(U,w){if(U.match(/^\]:/,!0)){w.f=w.inline=A,I.highlightFormatting&&(w.formatting="link");var Y=v(w);return w.linkText=!1,Y}return U.match(/^([^\]\\]|\\.)+/,!0),W.linkText}function A(U,w){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?w.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),w.f=w.inline=f,W.linkHref+" url")}var B={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:f,text:b,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&Z.copyState(G,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?Z.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,w){if(w.formatting=!1,U!=w.thisLine.stream){if(w.header=0,w.hr=!1,U.match(/^\s*$/,!0))return S(w),null;if(w.prevLine=w.thisLine,w.thisLine={stream:U},w.taskList=!1,w.trailingSpace=0,w.trailingSpaceNewLine=!1,!w.localState&&(w.f=w.block,w.f!=R)){var Y=U.match(/^\s*/,!0)[0].replace(/\t/g,s).length;if(w.indentation=Y,w.indentationDiff=null,Y>0)return null}}return w.f(U,w)},innerMode:function(U){return U.block==R?{state:U.htmlState,mode:G}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:B}},indent:function(U,w,Y){return U.block==R&&G.indent?G.indent(U.htmlState,w,Y):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,w,Y):Z.Pass},blankLine:S,getType:v,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return B},"xml"),Z.defineMIME("text/markdown","markdown"),Z.defineMIME("text/x-markdown","markdown")})},mgmH:function(jt,_e,D){"use strict";D.d(_e,"d",function(){return m}),D.d(_e,"b",function(){return u}),D.d(_e,"e",function(){return a}),D.d(_e,"c",function(){return o}),D.d(_e,"n",function(){return c}),D.d(_e,"g",function(){return s}),D.d(_e,"h",function(){return i}),D.d(_e,"j",function(){return O}),D.d(_e,"a",function(){return S}),D.d(_e,"l",function(){return C}),D.d(_e,"f",function(){return R}),D.d(_e,"k",function(){return T}),D.d(_e,"m",function(){return v}),D.d(_e,"i",function(){return b}),D.d(_e,"o",function(){return f}),D.d(_e,"t",function(){return h}),D.d(_e,"s",function(){return _}),D.d(_e,"p",function(){return g}),D.d(_e,"q",function(){return x}),D.d(_e,"r",function(){return N}),D.d(_e,"v",function(){return F}),D.d(_e,"u",function(){return A});var Z=D("miYZ"),V=D("tsqr"),I=D("k1fw"),G=D("9og8"),P=D("WmNS"),L=D.n(P),W=D("oUNq"),k=D("9kvl"),r=D("1vsH"),M=D("m3rI"),E=function(){Object(k.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(k.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},m=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return E(),ce.next=3,Object(W.t)(Object(I.a)({},w));case 3:if(Y=ce.sent,!(Y.status===0)){ce.next=7;break}return ce.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/courses/".concat(w.coursesId,"/export_couser_info.json"),query:w}));case 7:p();case 8:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),u=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(W.r)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_member_act_score")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.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(w.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),a=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(W.u)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_score")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.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(w.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),o=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(W.s)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.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(w.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),c=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(W.z)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_exercise_and_other")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.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(w.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),s=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(W.v)(Object(I.a)({},w));case 2:if(Y=ce.sent,!(Y.status===0)){ce.next=8;break}V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.coursesId,"/exportlist/course_total_homework")),ce.next=13;break;case 8:if(!(Y.status===-2)){ce.next=12;break}return ce.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(w.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),i=function(){var B=Object(G.a)(L.a.mark(function U(w,Y){var q;return L.a.wrap(function(Ee){for(;;)switch(Ee.prev=Ee.next){case 0:return Ee.next=2,Object(W.x)(Object(I.a)({},w));case 2:q=Ee.sent,q.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.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(w.coursesId,"/exportlist/").concat(Y)));case 4:case"end":return Ee.stop()}},U)}));return function(w,Y){return B.apply(this,arguments)}}(),n=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return E(),ce.next=3,Object(W.w)(Object(I.a)({},w));case 3:if(Y=ce.sent,!(Y.status===0)){ce.next=7;break}return ce.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/homework_commons/".concat(w.categoryId,"/works_list.zip"),query:w}));case 7:p();case 8:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),O=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return E(),ce.next=3,Object(W.A)(Object(I.a)({},w));case 3:if(Y=ce.sent,!(Y.status===0)){ce.next=7;break}return ce.next=7,Object(r.w)("",Object(r.Y)({url:M.a.API_SERVER+"/api/polls/".concat(w.categoryId,"/commit_result.xlsx"),query:w}));case 7:p();case 8:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),S=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w.coursesId,"/attendances/export_xlsx_data.xlsx"),query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),C=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w.coursesId,"/video_study_statics.xlsx"),query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),R=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w.coursesId,"/export_course_students_info.xlsx"),query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),T=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),v=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),b=function(){var B=Object(G.a)(L.a.mark(function U(w){var Y;return L.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(W.y)(Object(I.a)({},w));case 2:Y=ce.sent,Y.status===0?(V.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),k.d.push("/classrooms/".concat(w.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(w.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ce.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),f=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w.id,".xlsx"),query:w}));case 3:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),h=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),_=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w==null?void 0:w.ec_year_id,"/ec_training_objectives.xlsx"),query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),g=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(r.v)(w==null?void 0:w.name,Object(r.Y)({url:M.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),x=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w==null?void 0:w.ec_year_id,"/ec_courses.xlsx"),query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),N=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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(w==null?void 0:w.ec_year_id,"/ec_graduation_requirements.xlsx"),query:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),F=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}(),A=function(){var B=Object(G.a)(L.a.mark(function U(w){return L.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:w}));case 2:case"end":return q.stop()}},U)}));return function(w){return B.apply(this,arguments)}}()},n6Qo:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return k});var Z=D("q1tI"),V=D("biw7"),I=D("fyJ8");function G(r){var M=r.className,E=r.index,p=r.children,m=r.colSpan,u=r.rowSpan,a=Z.useContext(V.a),o=a.prefixCls,c=a.fixedInfoList,s=c[E];return Z.createElement(I.a,Object.assign({className:M,index:E,component:"td",prefixCls:o,record:null,dataIndex:null,render:function(){return{children:p,props:{colSpan:m,rowSpan:u}}}},s))}function P(r){return Z.createElement("tr",Object.assign({},r))}function L(r){var M=r.children,E=Z.useContext(V.a),p=E.prefixCls;return Z.createElement("tfoot",{className:"".concat(p,"-summary")},M)}var W=_e.b=L,k={Cell:G,Row:P}},nEHx:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return Z});var Z;(function(V){V.DARK="dark",V.LIGHT="light",V.HIGH_CONTRAST="hc"})(Z||(Z={}))},nPLb:function(jt,_e,D){"use strict";var Z=D("2qtc"),V=D("kLXV"),I=D("g9YV"),G=D("wCAj"),P=D("5NDa"),L=D("5rEg"),W=D("14J3"),k=D("BMrR"),r=D("iQDF"),M=D("+eQT"),E=D("miYZ"),p=D("tsqr"),m=D("jrin"),u=D("oBTY"),a=D("k1fw"),o=D("9og8"),c=D("y8nQ"),s=D("Vl3Y"),i=D("tJVT"),n=D("PpiC"),O=D("WmNS"),S=D.n(O),C=D("q1tI"),R=D.n(C),T=D("wd/R"),v=D.n(T),b=D("ErOA"),f=D("1vsH"),h=D("Ty5D"),_=D("9kvl"),g=D("oUNq"),x=D("xKgJ"),N=D("eozf"),F=function(B){var U=B.classroomList,w=B.dispatch,Y=B.courseEndTime,q=Object(n.a)(B,["classroomList","dispatch","courseEndTime"]),ce=Object(h.i)(),Ee=s.a.useForm(),Qe=Object(i.a)(Ee,1),Te=Qe[0],We=Object(C.useState)(1),$e=Object(i.a)(We,2),Je=$e[0],Ce=$e[1],X=Object(C.useState)([]),j=Object(i.a)(X,2),K=j[0],Q=j[1],re=Object(C.useState)(0),z=Object(i.a)(re,2),we=z[0],Ue=z[1],rt=Object(C.useState)(2e4),le=Object(i.a)(rt,2),Oe=le[0],Fe=le[1],Ye=Object(C.useState)(!0),Tt=Object(i.a)(Ye,2),Nt=Tt[0],Xt=Tt[1],tt=Object(C.useState)(),Zt=Object(i.a)(tt,2),vn=Zt[0],ze=Zt[1],He=Object(C.useState)([]),vt=Object(i.a)(He,2),Rt=vt[0],de=vt[1];ce.id=ce.coursesId,Object(C.useEffect)(function(){U.actionTabs.key==="\u7ACB\u5373\u622A\u6B62"?ee():(de([]),Q([]))},[U.actionTabs.key]);var ee=function(){var ae=Object(o.a)(S.a.mark(function ie(me){var ye,xe,De;return S.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return Xt(!0),It.next=3,Object(g.D)(Object(a.a)(Object(a.a)({},ce),{},{page:me||Je,limit:Oe,homework_id:U.actionTabs.type===1?"":U.actionTabs.selectArrs[0],end_homework_action:!0}));case 3:ye=It.sent,ye==null||ye.course_groups.map(function(un){un.key=un.id}),ye&&(Q([].concat(Object(u.a)(K),Object(u.a)(ye==null?void 0:ye.course_groups))),Ue(ye==null?void 0:ye.group_count),ze(ye==null?void 0:ye.course_groups),Xt(!1),me||Te.setFieldsValue((De={},Object(m.a)(De,"group_ids",ye==null||((xe=ye.course_groups)===null||xe===void 0)?void 0:xe.map(function(un){return String(un.id)})),Object(m.a)(De,"end_time",v()(v()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),De)));case 6:case"end":return It.stop()}},ie)}));return function(me){return ae.apply(this,arguments)}}(),ne=function(){var ae=Object(o.a)(S.a.mark(function ie(){var me,ye,xe,De;return S.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(me=Object(a.a)({},Te.getFieldsValue()),console.log("----",me.group_ids),!(vn!=null&&vn.length&&!(Rt!=null&&Rt.length))){It.next=5;break}return p.b.warning("\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u73ED\u7EA7"),It.abrupt("return");case 5:return It.next=7,Object(b.a)("/api/courses/".concat(ce.id,"/homework_commons/end_with_homework_list_position.json"),{method:"post",body:{homework_ids:Object(u.a)(U.actionTabs.selectArrs),group_ids:(Rt==null?void 0:Rt.length)>0?Rt:[],unified_setting:!(K!=null&&K.length),end_time:v()(me.end_time).format("YYYY-MM-DD HH:mm")}});case 7:ye=It.sent,ye.status===0&&(se(),Object(f.db)(["\u6559\u5B66\u8BFE\u5802","\u56FE\u6587\u4F5C\u4E1A","\u7ACB\u5373\u622A\u6B62"]),p.b.success("\u64CD\u4F5C\u6210\u529F"),w({type:"classroomList/setActionTabs",payload:{key:"\u6E05\u9664\u9009\u62E9\u6570\u636E"}}),q.onCallback&&q.onCallback(),Object(x.c)()?(w({type:"classroomList/setActionTabs",payload:{}}),(U==null||((xe=U.actionTabs)===null||xe===void 0||((De=xe.selectArrsAll)===null||De===void 0))?void 0:De.length)>0?w({type:"classroomList/getClassroomTeacherCommonList",payload:Object(a.a)(Object(a.a)({},U.actionTabs.params),{},{type:5})}):w({type:"shixunHomeworks/getWorkList",payload:Object(a.a)({},ce)})):w({type:"classroomList/getClassroomCommonList",payload:Object(a.a)({},U.actionTabs.params)}));case 9:case"end":return It.stop()}},ie)}));return function(){return ae.apply(this,arguments)}}(),se=function(){Ce(1),Q([])},pe=U.detailCommonHomeworksList;return R.a.createElement(V.a,{centered:!0,title:"\u622A\u6B62\u4F5C\u4E1A",visible:U.actionTabs.key==="\u7ACB\u5373\u622A\u6B62",okText:"\u622A\u6B62\u4F5C\u4E1A",cancelText:"\u6682\u4E0D\u622A\u6B62",onOk:ne,onCancel:function(){se(),w({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'),K&&R.a.createElement(s.a,{form:Te},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(ie){return ie.parentNode},disabledDate:function(ie){return Object(N.b)(ie,Y)},disabledTime:function(ie){return Object(N.c)(ie)},placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",showTime:{format:"HH:mm",defaultValue:v()(Object(f.d)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1}))),(vn==null?void 0:vn.length)>0&&R.a.createElement(k.a,null,R.a.createElement("span",{className:"mr5"},"\u9009\u62E9\u73ED\u7EA7:"),R.a.createElement(L.a.Search,{style:{width:"300px"},onChange:function(ie){Q(vn.filter(function(me){return me.name.indexOf(ie.target.value)>-1}))}})),(K==null?void 0:K.length)>0&&U.actionTabs.type===1&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ie,me){de(ie)}},rowKey:"id",pagination:!1,dataSource:K,columns:[{title:"\u73ED\u7EA7",dataIndex:"name",key:"name"}]}),(K==null?void 0:K.length)>0&&U.actionTabs.type===2&&R.a.createElement(G.a,{style:{marginTop:"10px",height:"300px",overflow:"auto"},rowSelection:{type:"checkbox",onChange:function(ie,me){de(ie)}},rowKey:"id",pagination:!1,dataSource:K,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"}]})))};_e.a=Object(_.a)(function(A){var B=A.classroomList;return{classroomList:B}})(F)},nnTU:function(jt,_e,D){"use strict";D.d(_e,"b",function(){return W}),D.d(_e,"a",function(){return k});var Z=D("MI8n"),V=D("JYp7"),I=D("pmY6"),G=D("24hK"),P=D("746U"),L=D("Cg/j");const W=Object(L.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 a=[];for(let c of r.description.args)a.push(c.constraint);const o=r.handler;r.handler=function(c,...s){return Object(P.o)(s,a),o(c,...s)}}const{id:E}=r;let p=this._commands.get(E);p||(p=new G.a,this._commands.set(E,p));let m=p.unshift(r),u=Object(I.i)(()=>{m();const a=this._commands.get(E);(a==null?void 0:a.isEmpty())&&this._commands.delete(E)});return this._onDidRegisterCommand.fire(E),u}registerCommandAlias(r,M){return k.registerCommand(r,(E,...p)=>E.get(W).executeCommand(M,...p))}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 E=this.getCommand(M);E&&r.set(M,E)}return r}};k.registerCommand("noop",()=>{})},oOBs:function(jt,_e,D){jt.exports={leftdiv:"leftdiv___1FhsT",listClass:"listClass___1Y2ac",spantitle:"spantitle___1pL39",rightdiv:"rightdiv___3ZICD"}},ogmK:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return er});var Z=D("1OyB"),V=D("vuIU"),I=D("Ji7U"),G=D("LK+K"),P=D("rePB"),L=D("VTBJ"),W=D("ODXe"),k=D("q1tI"),r=D("TSYQ"),M=D.n(r),E=D("Kwbf"),p=D("6cGi"),m=D("U8pU"),u=D("4IlW"),a=k.createContext({}),o=a,c={visibility:"hidden"};function s(J){var ge=J.prefixCls,Re=J.prevIcon,Ae=Re===void 0?"\u2039":Re,at=J.nextIcon,Be=at===void 0?"\u203A":at,nt=J.superPrevIcon,yt=nt===void 0?"\xAB":nt,Mt=J.superNextIcon,kt=Mt===void 0?"\xBB":Mt,Ge=J.onSuperPrev,xt=J.onSuperNext,ot=J.onPrev,ut=J.onNext,bt=J.children,Dt=k.useContext(o),pt=Dt.hideNextBtn,Kt=Dt.hidePrevBtn;return k.createElement("div",{className:ge},Ge&&k.createElement("button",{type:"button",onClick:Ge,tabIndex:-1,className:"".concat(ge,"-super-prev-btn"),style:Kt?c:{}},yt),ot&&k.createElement("button",{type:"button",onClick:ot,tabIndex:-1,className:"".concat(ge,"-prev-btn"),style:Kt?c:{}},Ae),k.createElement("div",{className:"".concat(ge,"-view")},bt),ut&&k.createElement("button",{type:"button",onClick:ut,tabIndex:-1,className:"".concat(ge,"-next-btn"),style:pt?c:{}},Be),xt&&k.createElement("button",{type:"button",onClick:xt,tabIndex:-1,className:"".concat(ge,"-super-next-btn"),style:pt?c:{}},kt))}var i=s;function n(J){var ge=k.useContext(o),Re=ge.hideHeader;if(Re)return null;var Ae=J.prefixCls,at=J.generateConfig,Be=J.locale,nt=J.value,yt=J.format,Mt="".concat(Ae,"-header");return k.createElement(i,{prefixCls:Mt},nt?at.locale.format(Be.locale,nt,yt):"\xA0")}var O=n,S=D("YrtM"),C=D("KQm4"),R=new Map;function T(J,ge,Re){if(R.get(J)&&cancelAnimationFrame(R.get(J)),Re<=0){R.set(J,requestAnimationFrame(function(){J.scrollTop=ge}));return}var Ae=ge-J.scrollTop,at=Ae/Re*10;R.set(J,requestAnimationFrame(function(){J.scrollTop+=at,J.scrollTop!==ge&&T(J,ge,Re-10)}))}function v(J,ge){var Re=ge.onLeftRight,Ae=ge.onCtrlLeftRight,at=ge.onUpDown,Be=ge.onPageUpDown,nt=ge.onEnter,yt=J.which,Mt=J.ctrlKey,kt=J.metaKey;switch(yt){case u.a.LEFT:if(Mt||kt){if(Ae)return Ae(-1),!0}else if(Re)return Re(-1),!0;break;case u.a.RIGHT:if(Mt||kt){if(Ae)return Ae(1),!0}else if(Re)return Re(1),!0;break;case u.a.UP:if(at)return at(-1),!0;break;case u.a.DOWN:if(at)return at(1),!0;break;case u.a.PAGE_UP:if(Be)return Be(-1),!0;break;case u.a.PAGE_DOWN:if(Be)return Be(1),!0;break;case u.a.ENTER:if(nt)return nt(),!0;break}return!1}function b(J,ge,Re,Ae){var at=J;if(!at)switch(ge){case"time":at=Ae?"hh:mm:ss a":"HH:mm:ss";break;case"week":at="gggg-wo";break;case"month":at="YYYY-MM";break;case"quarter":at="YYYY-[Q]Q";break;case"year":at="YYYY";break;default:at=Re?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return at}function f(J,ge){var Re=J==="time"?8:10;return Math.max(Re,ge.length)+2}var h=null,_=new Set;function g(J){return!h&&typeof window!="undefined"&&window.addEventListener&&(h=function(Re){Object(C.a)(_).forEach(function(Ae){Ae(Re)})},window.addEventListener("mousedown",h)),_.add(J),function(){_.delete(J),_.size===0&&(window.removeEventListener("mousedown",h),h=null)}}var x=function(ge){return ge==="month"||ge==="date"?"year":ge},N=function(ge){return ge==="date"?"month":ge},F=function(ge){return ge==="month"||ge==="date"?"quarter":ge},A=function(ge){return ge==="date"?"week":ge},B={year:x,month:N,quarter:F,week:A,time:null,date:null};function U(J,ge){return J.some(function(Re){return Re&&Re.contains(ge)})}function w(J){var ge=J.prefixCls,Re=J.units,Ae=J.onSelect,at=J.value,Be=J.active,nt=J.hideDisabledOptions,yt="".concat(ge,"-cell"),Mt=k.useContext(o),kt=Mt.open,Ge=k.useRef(null),xt=k.useRef(new Map);return k.useLayoutEffect(function(){var ot=xt.current.get(at);ot&&kt!==!1&&T(Ge.current,ot.offsetTop,120)},[at]),k.useLayoutEffect(function(){if(kt){var ot=xt.current.get(at);ot&&T(Ge.current,ot.offsetTop,0)}},[kt]),k.createElement("ul",{className:M()("".concat(ge,"-column"),Object(P.a)({},"".concat(ge,"-column-active"),Be)),ref:Ge,style:{position:"relative"}},Re.map(function(ot){var ut;return nt&&ot.disabled?null:k.createElement("li",{key:ot.value,ref:function(Dt){xt.current.set(ot.value,Dt)},className:M()(yt,(ut={},Object(P.a)(ut,"".concat(yt,"-disabled"),ot.disabled),Object(P.a)(ut,"".concat(yt,"-selected"),at===ot.value),ut)),onClick:function(){if(ot.disabled)return;Ae(ot.value)}},k.createElement("div",{className:"".concat(yt,"-inner")},ot.label))}))}var Y=w;function q(J,ge){for(var Re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",Ae=String(J);Ae.length<ge;)Ae="".concat(Re).concat(J);return Ae}var ce=function(){for(var ge=arguments.length,Re=new Array(ge),Ae=0;Ae<ge;Ae++)Re[Ae]=arguments[Ae];return Re};function Ee(J){return J==null?[]:Array.isArray(J)?J:[J]}function Qe(J){var ge={};return Object.keys(J).forEach(function(Re){(Re.substr(0,5)==="data-"||Re.substr(0,5)==="aria-"||Re==="role"||Re==="name")&&Re.substr(0,7)!=="data-__"&&(ge[Re]=J[Re])}),ge}function Te(J,ge){return J?J[ge]:null}function We(J,ge,Re){var Ae=[Te(J,0),Te(J,1)];return Ae[Re]=typeof ge=="function"?ge(Ae[Re]):ge,!Ae[0]&&!Ae[1]?null:Ae}function $e(J,ge,Re,Ae,at){var Be=J.setHour(ge,Re);return Be=J.setMinute(Be,Ae),Be=J.setSecond(Be,at),Be}function Je(J,ge,Re,Ae,at,Be){var nt=Math.floor(J/Ae)*Ae;if(nt<J)return[nt,60-at,60-Be];var yt=Math.floor(ge/at)*at;if(yt<ge)return[nt,yt,60-Be];var Mt=Math.floor(Re/Be)*Be;return[nt,yt,Mt]}function Ce(J,ge){if(J.length!==ge.length)return!0;for(var Re=0;Re<J.length;Re+=1)if(J[Re].disabled!==ge[Re].disabled)return!0;return!1}function X(J,ge,Re,Ae){for(var at=[],Be=J;Be<=ge;Be+=Re)at.push({label:q(Be,2),value:Be,disabled:(Ae||[]).includes(Be)});return at}function j(J){var ge=J.generateConfig,Re=J.prefixCls,Ae=J.operationRef,at=J.activeColumnIndex,Be=J.value,nt=J.showHour,yt=J.showMinute,Mt=J.showSecond,kt=J.use12Hours,Ge=J.hourStep,xt=Ge===void 0?1:Ge,ot=J.minuteStep,ut=ot===void 0?1:ot,bt=J.secondStep,Dt=bt===void 0?1:bt,pt=J.disabledHours,Kt=J.disabledMinutes,nn=J.disabledSeconds,wn=J.hideDisabledOptions,In=J.onSelect,yn=[],On="".concat(Re,"-content"),Cn="".concat(Re,"-time-panel"),Ot,rn=Be?ge.getHour(Be):-1,Ut=Be?ge.getMinute(Be):-1,wt=Be?ge.getSecond(Be):-1,Rn=function(gn,Ct,Ze,Lt){var At=Be||ge.getNow(),en=Math.max(0,Ct),Nn=Math.max(0,Ze),Sn=Math.max(0,Lt);return At=$e(ge,At,!kt||!gn?en:en+12,Nn,Sn),At},bn=X(0,23,xt,pt&&pt()),Wt=Object(S.a)(function(){return bn},bn,Ce);kt&&(Ot=rn>=12,rn%=12);var dt=k.useMemo(function(){if(!kt)return[!1,!1];var xn=[!0,!0];return Wt.forEach(function(gn){var Ct=gn.disabled,Ze=gn.value;if(Ct)return;Ze>=12?xn[1]=!1:xn[0]=!1}),xn},[kt,Wt]),An=Object(W.a)(dt,2),an=An[0],Kn=An[1],zt=k.useMemo(function(){return kt?Wt.filter(Ot?function(xn){return xn.value>=12}:function(xn){return xn.value<12}).map(function(xn){var gn=xn.value%12,Ct=gn===0?"12":q(gn,2);return Object(L.a)(Object(L.a)({},xn),{},{label:Ct,value:gn})}):Wt},[kt,Wt]),En=X(0,59,ut,Kt&&Kt(rn)),Ln=X(0,59,Dt,nn&&nn(rn,Ut));Ae.current={onUpDown:function(gn){var Ct=yn[at];if(Ct)for(var Ze=Ct.units.findIndex(function(Nn){return Nn.value===Ct.value}),Lt=Ct.units.length,At=1;At<Lt;At+=1){var en=Ct.units[(Ze+gn*At+Lt)%Lt];if(en.disabled!==!0){Ct.onSelect(en.value);break}}}};function cn(xn,gn,Ct,Ze,Lt){xn!==!1&&yn.push({node:k.cloneElement(gn,{prefixCls:Cn,value:Ct,active:at===yn.length,onSelect:Lt,units:Ze,hideDisabledOptions:wn}),onSelect:Lt,value:Ct,units:Ze})}cn(nt,k.createElement(Y,{key:"hour"}),rn,zt,function(xn){In(Rn(Ot,xn,Ut,wt),"mouse")}),cn(yt,k.createElement(Y,{key:"minute"}),Ut,En,function(xn){In(Rn(Ot,rn,xn,wt),"mouse")}),cn(Mt,k.createElement(Y,{key:"second"}),wt,Ln,function(xn){In(Rn(Ot,rn,Ut,xn),"mouse")});var dr=-1;return typeof Ot=="boolean"&&(dr=Ot?1:0),cn(kt===!0,k.createElement(Y,{key:"12hours"}),dr,[{label:"AM",value:0,disabled:an},{label:"PM",value:1,disabled:Kn}],function(xn){In(Rn(!!xn,rn,Ut,wt),"mouse")}),k.createElement("div",{className:On},yn.map(function(xn){var gn=xn.node;return gn}))}var K=j,Q=function(ge){return ge.filter(function(Re){return Re!==!1}).length};function re(J){var ge=J.generateConfig,Re=J.format,Ae=Re===void 0?"HH:mm:ss":Re,at=J.prefixCls,Be=J.active,nt=J.operationRef,yt=J.showHour,Mt=J.showMinute,kt=J.showSecond,Ge=J.use12Hours,xt=Ge===void 0?!1:Ge,ot=J.onSelect,ut=J.value,bt="".concat(at,"-time-panel"),Dt=k.useRef(),pt=k.useState(-1),Kt=Object(W.a)(pt,2),nn=Kt[0],wn=Kt[1],In=Q([yt,Mt,kt,xt]);return nt.current={onKeyDown:function(On){return v(On,{onLeftRight:function(Ot){wn((nn+Ot+In)%In)},onUpDown:function(Ot){nn===-1?wn(0):Dt.current&&Dt.current.onUpDown(Ot)},onEnter:function(){ot(ut||ge.getNow(),"key"),wn(-1)}})},onBlur:function(){wn(-1)}},k.createElement("div",{className:M()(bt,Object(P.a)({},"".concat(bt,"-active"),Be))},k.createElement(O,Object.assign({},J,{format:Ae,prefixCls:at})),k.createElement(K,Object.assign({},J,{prefixCls:at,activeColumnIndex:nn,operationRef:Dt})))}var z=re,we=7;function Ue(J,ge){return!J&&!ge?!0:!J||!ge?!1:void 0}function rt(J,ge,Re){var Ae=Ue(ge,Re);if(typeof Ae=="boolean")return Ae;var at=Math.floor(J.getYear(ge)/10),Be=Math.floor(J.getYear(Re)/10);return at===Be}function le(J,ge,Re){var Ae=Ue(ge,Re);return typeof Ae=="boolean"?Ae:J.getYear(ge)===J.getYear(Re)}function Oe(J,ge){var Re=Math.floor(J.getMonth(ge)/3);return Re+1}function Fe(J,ge,Re){var Ae=Ue(ge,Re);return typeof Ae=="boolean"?Ae:le(J,ge,Re)&&Oe(J,ge)===Oe(J,Re)}function Ye(J,ge,Re){var Ae=Ue(ge,Re);return typeof Ae=="boolean"?Ae:le(J,ge,Re)&&J.getMonth(ge)===J.getMonth(Re)}function Tt(J,ge,Re){var Ae=Ue(ge,Re);return typeof Ae=="boolean"?Ae:J.getYear(ge)===J.getYear(Re)&&J.getMonth(ge)===J.getMonth(Re)&&J.getDate(ge)===J.getDate(Re)}function Nt(J,ge,Re){var Ae=Ue(ge,Re);return typeof Ae=="boolean"?Ae:J.getHour(ge)===J.getHour(Re)&&J.getMinute(ge)===J.getMinute(Re)&&J.getSecond(ge)===J.getSecond(Re)}function Xt(J,ge,Re,Ae){var at=Ue(Re,Ae);return typeof at=="boolean"?at:J.locale.getWeek(ge,Re)===J.locale.getWeek(ge,Ae)}function tt(J,ge,Re){return Tt(J,ge,Re)&&Nt(J,ge,Re)}function Zt(J,ge,Re,Ae){return!ge||!Re||!Ae?!1:!Tt(J,ge,Ae)&&!Tt(J,Re,Ae)&&J.isAfter(Ae,ge)&&J.isAfter(Re,Ae)}function vn(J,ge,Re){var Ae=ge.locale.getWeekFirstDay(J),at=ge.setDate(Re,1),Be=ge.getWeekDay(at),nt=ge.addDate(at,Ae-Be);return ge.getMonth(nt)===ge.getMonth(Re)&&ge.getDate(nt)>1&&(nt=ge.addDate(nt,-7)),nt}function ze(J,ge,Re){var Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(ge){case"year":return Re.addYear(J,Ae*10);case"quarter":case"month":return Re.addYear(J,Ae);default:return Re.addMonth(J,Ae)}}var He=k.createContext({}),vt=He;function Rt(J){var ge=J.cellPrefixCls,Re=J.generateConfig,Ae=J.rangedValue,at=J.hoverRangedValue,Be=J.isInView,nt=J.isSameCell,yt=J.offsetCell,Mt=J.today,kt=J.value;function Ge(xt){var ot,ut=yt(xt,-1),bt=yt(xt,1),Dt=Te(Ae,0),pt=Te(Ae,1),Kt=Te(at,0),nn=Te(at,1),wn=Zt(Re,Kt,nn,xt);function In(Ut){return nt(Dt,Ut)}function yn(Ut){return nt(pt,Ut)}var On=nt(Kt,xt),Cn=nt(nn,xt),Ot=(wn||Cn)&&(!Be(ut)||yn(ut)),rn=(wn||On)&&(!Be(bt)||In(bt));return ot={},Object(P.a)(ot,"".concat(ge,"-in-view"),Be(xt)),Object(P.a)(ot,"".concat(ge,"-in-range"),Zt(Re,Dt,pt,xt)),Object(P.a)(ot,"".concat(ge,"-range-start"),In(xt)),Object(P.a)(ot,"".concat(ge,"-range-end"),yn(xt)),Object(P.a)(ot,"".concat(ge,"-range-start-single"),In(xt)&&!pt),Object(P.a)(ot,"".concat(ge,"-range-end-single"),yn(xt)&&!Dt),Object(P.a)(ot,"".concat(ge,"-range-start-near-hover"),In(xt)&&(nt(ut,Kt)||Zt(Re,Kt,nn,ut))),Object(P.a)(ot,"".concat(ge,"-range-end-near-hover"),yn(xt)&&(nt(bt,nn)||Zt(Re,Kt,nn,bt))),Object(P.a)(ot,"".concat(ge,"-range-hover"),wn),Object(P.a)(ot,"".concat(ge,"-range-hover-start"),On),Object(P.a)(ot,"".concat(ge,"-range-hover-end"),Cn),Object(P.a)(ot,"".concat(ge,"-range-hover-edge-start"),Ot),Object(P.a)(ot,"".concat(ge,"-range-hover-edge-end"),rn),Object(P.a)(ot,"".concat(ge,"-range-hover-edge-start-near-range"),Ot&&nt(ut,pt)),Object(P.a)(ot,"".concat(ge,"-range-hover-edge-end-near-range"),rn&&nt(bt,Dt)),Object(P.a)(ot,"".concat(ge,"-today"),nt(Mt,xt)),Object(P.a)(ot,"".concat(ge,"-selected"),nt(kt,xt)),ot}return Ge}function de(J){for(var ge=J.prefixCls,Re=J.disabledDate,Ae=J.onSelect,at=J.rowNum,Be=J.colNum,nt=J.prefixColumn,yt=J.rowClassName,Mt=J.baseDate,kt=J.getCellClassName,Ge=J.getCellText,xt=J.getCellNode,ot=J.getCellDate,ut=J.titleCell,bt=J.headerCells,Dt=k.useContext(o),pt=Dt.onDateMouseEnter,Kt=Dt.onDateMouseLeave,nn="".concat(ge,"-cell"),wn=[],In=0;In<at;In+=1){for(var yn=[],On=void 0,Cn=function(Ut){var wt=In*Be+Ut,Rn=ot(Mt,wt),bn=Re&&Re(Rn);Ut===0&&(On=Rn,nt&&yn.push(nt(On))),yn.push(k.createElement("td",{key:Ut,title:ut&&ut(Rn),className:M()(nn,Object(L.a)(Object(P.a)({},"".concat(nn,"-disabled"),bn),kt(Rn))),onClick:function(){bn||Ae(Rn)},onMouseEnter:function(){!bn&&pt&&pt(Rn)},onMouseLeave:function(){!bn&&Kt&&Kt(Rn)}},xt?xt(Rn):k.createElement("div",{className:"".concat(nn,"-inner")},Ge(Rn))))},Ot=0;Ot<Be;Ot+=1)Cn(Ot);wn.push(k.createElement("tr",{key:In,className:yt&&yt(On)},yn))}return k.createElement("div",{className:"".concat(ge,"-body")},k.createElement("table",{className:"".concat(ge,"-content")},bt&&k.createElement("thead",null,k.createElement("tr",null,bt)),k.createElement("tbody",null,wn)))}function ee(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.prefixColumn,at=J.locale,Be=J.rowCount,nt=J.viewDate,yt=J.value,Mt=J.dateRender,kt=k.useContext(vt),Ge=kt.rangedValue,xt=kt.hoverRangedValue,ot=vn(at.locale,Re,nt),ut="".concat(ge,"-cell"),bt=Re.locale.getWeekFirstDay(at.locale),Dt=Re.getNow(),pt=[],Kt=at.shortWeekDays||(Re.locale.getShortWeekDays?Re.locale.getShortWeekDays(at.locale):[]);Ae&&pt.push(k.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var nn=0;nn<we;nn+=1)pt.push(k.createElement("th",{key:nn},Kt[(nn+bt)%we]));var wn=Rt({cellPrefixCls:ut,today:Dt,value:yt,generateConfig:Re,rangedValue:Ae?null:Ge,hoverRangedValue:Ae?null:xt,isSameCell:function(On,Cn){return Tt(Re,On,Cn)},isInView:function(On){return Ye(Re,On,nt)},offsetCell:function(On,Cn){return Re.addDate(On,Cn)}}),In=Mt?function(yn){return Mt(yn,Dt)}:void 0;return k.createElement(de,Object.assign({},J,{rowNum:Be,colNum:we,baseDate:ot,getCellNode:In,getCellText:Re.getDate,getCellClassName:wn,getCellDate:Re.addDate,titleCell:function(On){return Re.locale.format(at.locale,On,"YYYY-MM-DD")},headerCells:pt}))}var ne=ee;function se(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.locale,at=J.viewDate,Be=J.onNextMonth,nt=J.onPrevMonth,yt=J.onNextYear,Mt=J.onPrevYear,kt=J.onYearClick,Ge=J.onMonthClick,xt=k.useContext(o),ot=xt.hideHeader;if(ot)return null;var ut="".concat(ge,"-header"),bt=Ae.shortMonths||(Re.locale.getShortMonths?Re.locale.getShortMonths(Ae.locale):[]),Dt=Re.getMonth(at),pt=k.createElement("button",{type:"button",key:"year",onClick:kt,tabIndex:-1,className:"".concat(ge,"-year-btn")},Re.locale.format(Ae.locale,at,Ae.yearFormat)),Kt=k.createElement("button",{type:"button",key:"month",onClick:Ge,tabIndex:-1,className:"".concat(ge,"-month-btn")},Ae.monthFormat?Re.locale.format(Ae.locale,at,Ae.monthFormat):bt[Dt]),nn=Ae.monthBeforeYear?[Kt,pt]:[pt,Kt];return k.createElement(i,Object.assign({},J,{prefixCls:ut,onSuperPrev:Mt,onPrev:nt,onNext:Be,onSuperNext:yt}),nn)}var pe=se,ae=6;function ie(J){var ge=J.prefixCls,Re=J.panelName,Ae=Re===void 0?"date":Re,at=J.keyboardConfig,Be=J.active,nt=J.operationRef,yt=J.generateConfig,Mt=J.value,kt=J.viewDate,Ge=J.onViewDateChange,xt=J.onPanelChange,ot=J.onSelect,ut="".concat(ge,"-").concat(Ae,"-panel");nt.current={onKeyDown:function(Kt){return v(Kt,Object(L.a)({onLeftRight:function(wn){ot(yt.addDate(Mt||kt,wn),"key")},onCtrlLeftRight:function(wn){ot(yt.addYear(Mt||kt,wn),"key")},onUpDown:function(wn){ot(yt.addDate(Mt||kt,wn*we),"key")},onPageUpDown:function(wn){ot(yt.addMonth(Mt||kt,wn),"key")}},at))}};var bt=function(Kt){var nn=yt.addYear(kt,Kt);Ge(nn),xt(null,nn)},Dt=function(Kt){var nn=yt.addMonth(kt,Kt);Ge(nn),xt(null,nn)};return k.createElement("div",{className:M()(ut,Object(P.a)({},"".concat(ut,"-active"),Be))},k.createElement(pe,Object.assign({},J,{prefixCls:ge,value:Mt,viewDate:kt,onPrevYear:function(){bt(-1)},onNextYear:function(){bt(1)},onPrevMonth:function(){Dt(-1)},onNextMonth:function(){Dt(1)},onMonthClick:function(){xt("month",kt)},onYearClick:function(){xt("year",kt)}})),k.createElement(ne,Object.assign({},J,{onSelect:function(Kt){return ot(Kt,"mouse")},prefixCls:ge,value:Mt,viewDate:kt,rowCount:ae})))}var me=ie;function ye(J,ge,Re){if(!Re)return ge;var Ae=ge;return Ae=J.setHour(Ae,J.getHour(Re)),Ae=J.setMinute(Ae,J.getMinute(Re)),Ae=J.setSecond(Ae,J.getSecond(Re)),Ae}var xe=ce("date","time");function De(J){var ge=J.prefixCls,Re=J.operationRef,Ae=J.generateConfig,at=J.value,Be=J.defaultValue,nt=J.disabledTime,yt=J.showTime,Mt=J.onSelect,kt="".concat(ge,"-datetime-panel"),Ge=k.useState(null),xt=Object(W.a)(Ge,2),ot=xt[0],ut=xt[1],bt=k.useRef({}),Dt=k.useRef({}),pt=Object(m.a)(yt)==="object"?Object(L.a)({},yt):{};function Kt(yn){var On=xe.indexOf(ot)+yn,Cn=xe[On]||null;return Cn}var nn=function(On){Dt.current.onBlur&&Dt.current.onBlur(On),ut(null)};Re.current={onKeyDown:function(On){if(On.which===u.a.TAB){var Cn=Kt(On.shiftKey?-1:1);return ut(Cn),Cn&&On.preventDefault(),!0}if(ot){var Ot=ot==="date"?bt:Dt;return Ot.current&&Ot.current.onKeyDown&&Ot.current.onKeyDown(On),!0}return[u.a.LEFT,u.a.RIGHT,u.a.UP,u.a.DOWN].includes(On.which)?(ut("date"),!0):!1},onBlur:nn,onClose:nn};var wn=function(On,Cn){var Ot=On;Cn==="date"&&!at&&pt.defaultValue?(Ot=Ae.setHour(Ot,Ae.getHour(pt.defaultValue)),Ot=Ae.setMinute(Ot,Ae.getMinute(pt.defaultValue)),Ot=Ae.setSecond(Ot,Ae.getSecond(pt.defaultValue))):Cn==="time"&&!at&&Be&&(Ot=Ae.setYear(Ot,Ae.getYear(Be)),Ot=Ae.setMonth(Ot,Ae.getMonth(Be)),Ot=Ae.setDate(Ot,Ae.getDate(Be))),Mt&&Mt(Ot,"mouse")},In=nt?nt(at||null):{};return k.createElement("div",{className:M()(kt,Object(P.a)({},"".concat(kt,"-active"),ot))},k.createElement(me,Object.assign({},J,{operationRef:bt,active:ot==="date",onSelect:function(On){wn(ye(Ae,On,yt&&Object(m.a)(yt)==="object"?yt.defaultValue:null),"date")}})),k.createElement(z,Object.assign({},J,{format:void 0},pt,In,{defaultValue:void 0,operationRef:Dt,active:ot==="time",onSelect:function(On){wn(On,"time")}})))}var ct=De;function It(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.locale,at=J.value,Be="".concat(ge,"-cell"),nt=function(Ge){return k.createElement("td",{key:"week",className:M()(Be,"".concat(Be,"-week"))},Re.locale.getWeek(Ae.locale,Ge))},yt="".concat(ge,"-week-panel-row"),Mt=function(Ge){return M()(yt,Object(P.a)({},"".concat(yt,"-selected"),Xt(Re,Ae.locale,at,Ge)))};return k.createElement(me,Object.assign({},J,{panelName:"week",prefixColumn:nt,rowClassName:Mt,keyboardConfig:{onLeftRight:null}}))}var un=It;function mt(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.locale,at=J.viewDate,Be=J.onNextYear,nt=J.onPrevYear,yt=J.onYearClick,Mt=k.useContext(o),kt=Mt.hideHeader;if(kt)return null;var Ge="".concat(ge,"-header");return k.createElement(i,Object.assign({},J,{prefixCls:Ge,onSuperPrev:nt,onSuperNext:Be}),k.createElement("button",{type:"button",onClick:yt,className:"".concat(ge,"-year-btn")},Re.locale.format(Ae.locale,at,Ae.yearFormat)))}var Qt=mt,ht=3,Et=4;function it(J){var ge=J.prefixCls,Re=J.locale,Ae=J.value,at=J.viewDate,Be=J.generateConfig,nt=J.monthCellRender,yt=k.useContext(vt),Mt=yt.rangedValue,kt=yt.hoverRangedValue,Ge="".concat(ge,"-cell"),xt=Rt({cellPrefixCls:Ge,value:Ae,generateConfig:Be,rangedValue:Mt,hoverRangedValue:kt,isSameCell:function(pt,Kt){return Ye(Be,pt,Kt)},isInView:function(){return!0},offsetCell:function(pt,Kt){return Be.addMonth(pt,Kt)}}),ot=Re.shortMonths||(Be.locale.getShortMonths?Be.locale.getShortMonths(Re.locale):[]),ut=Be.setMonth(at,0),bt=nt?function(Dt){return nt(Dt,Re)}:void 0;return k.createElement(de,Object.assign({},J,{rowNum:Et,colNum:ht,baseDate:ut,getCellNode:bt,getCellText:function(pt){return Re.monthFormat?Be.locale.format(Re.locale,pt,Re.monthFormat):ot[Be.getMonth(pt)]},getCellClassName:xt,getCellDate:Be.addMonth,titleCell:function(pt){return Be.locale.format(Re.locale,pt,"YYYY-MM")}}))}var ve=it;function Me(J){var ge=J.prefixCls,Re=J.operationRef,Ae=J.onViewDateChange,at=J.generateConfig,Be=J.value,nt=J.viewDate,yt=J.onPanelChange,Mt=J.onSelect,kt="".concat(ge,"-month-panel");Re.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(bt){Mt(at.addMonth(Be||nt,bt),"key")},onCtrlLeftRight:function(bt){Mt(at.addYear(Be||nt,bt),"key")},onUpDown:function(bt){Mt(at.addMonth(Be||nt,bt*ht),"key")},onEnter:function(){yt("date",Be||nt)}})}};var Ge=function(ot){var ut=at.addYear(nt,ot);Ae(ut),yt(null,ut)};return k.createElement("div",{className:kt},k.createElement(Qt,Object.assign({},J,{prefixCls:ge,onPrevYear:function(){Ge(-1)},onNextYear:function(){Ge(1)},onYearClick:function(){yt("year",nt)}})),k.createElement(ve,Object.assign({},J,{prefixCls:ge,onSelect:function(ot){Mt(ot,"mouse"),yt("date",ot)}})))}var St=Me;function lt(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.locale,at=J.viewDate,Be=J.onNextYear,nt=J.onPrevYear,yt=J.onYearClick,Mt=k.useContext(o),kt=Mt.hideHeader;if(kt)return null;var Ge="".concat(ge,"-header");return k.createElement(i,Object.assign({},J,{prefixCls:Ge,onSuperPrev:nt,onSuperNext:Be}),k.createElement("button",{type:"button",onClick:yt,className:"".concat(ge,"-year-btn")},Re.locale.format(Ae.locale,at,Ae.yearFormat)))}var Gt=lt,qt=4,Ve=1;function et(J){var ge=J.prefixCls,Re=J.locale,Ae=J.value,at=J.viewDate,Be=J.generateConfig,nt=k.useContext(vt),yt=nt.rangedValue,Mt=nt.hoverRangedValue,kt="".concat(ge,"-cell"),Ge=Rt({cellPrefixCls:kt,value:Ae,generateConfig:Be,rangedValue:yt,hoverRangedValue:Mt,isSameCell:function(ut,bt){return Fe(Be,ut,bt)},isInView:function(){return!0},offsetCell:function(ut,bt){return Be.addMonth(ut,bt*3)}}),xt=Be.setDate(Be.setMonth(at,0),1);return k.createElement(de,Object.assign({},J,{rowNum:Ve,colNum:qt,baseDate:xt,getCellText:function(ut){return Be.locale.format(Re.locale,ut,Re.quarterFormat||"[Q]Q")},getCellClassName:Ge,getCellDate:function(ut,bt){return Be.addMonth(ut,bt*3)},titleCell:function(ut){return Be.locale.format(Re.locale,ut,"YYYY-[Q]Q")}}))}var gt=et;function Ht(J){var ge=J.prefixCls,Re=J.operationRef,Ae=J.onViewDateChange,at=J.generateConfig,Be=J.value,nt=J.viewDate,yt=J.onPanelChange,Mt=J.onSelect,kt="".concat(ge,"-quarter-panel");Re.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(bt){Mt(at.addMonth(Be||nt,bt*3),"key")},onCtrlLeftRight:function(bt){Mt(at.addYear(Be||nt,bt),"key")},onUpDown:function(bt){Mt(at.addYear(Be||nt,bt),"key")}})}};var Ge=function(ot){var ut=at.addYear(nt,ot);Ae(ut),yt(null,ut)};return k.createElement("div",{className:kt},k.createElement(Gt,Object.assign({},J,{prefixCls:ge,onPrevYear:function(){Ge(-1)},onNextYear:function(){Ge(1)},onYearClick:function(){yt("year",nt)}})),k.createElement(gt,Object.assign({},J,{prefixCls:ge,onSelect:function(ot){Mt(ot,"mouse")}})))}var Vt=Ht;function dn(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.viewDate,at=J.onPrevDecade,Be=J.onNextDecade,nt=J.onDecadeClick,yt=k.useContext(o),Mt=yt.hideHeader;if(Mt)return null;var kt="".concat(ge,"-header"),Ge=Re.getYear(Ae),xt=Math.floor(Ge/Dn)*Dn,ot=xt+Dn-1;return k.createElement(i,Object.assign({},J,{prefixCls:kt,onSuperPrev:at,onSuperNext:Be}),k.createElement("button",{type:"button",onClick:nt,className:"".concat(ge,"-decade-btn")},xt,"-",ot))}var Zn=dn,Wn=3,tn=4;function Hn(J){var ge=J.prefixCls,Re=J.value,Ae=J.viewDate,at=J.locale,Be=J.generateConfig,nt=k.useContext(vt),yt=nt.rangedValue,Mt=nt.hoverRangedValue,kt="".concat(ge,"-cell"),Ge=Be.getYear(Ae),xt=Math.floor(Ge/Dn)*Dn,ot=xt+Dn-1,ut=Be.setYear(Ae,xt-Math.ceil((Wn*tn-Dn)/2)),bt=function(Kt){var nn=Be.getYear(Kt);return xt<=nn&&nn<=ot},Dt=Rt({cellPrefixCls:kt,value:Re,generateConfig:Be,rangedValue:yt,hoverRangedValue:Mt,isSameCell:function(Kt,nn){return le(Be,Kt,nn)},isInView:bt,offsetCell:function(Kt,nn){return Be.addYear(Kt,nn)}});return k.createElement(de,Object.assign({},J,{rowNum:tn,colNum:Wn,baseDate:ut,getCellText:Be.getYear,getCellClassName:Dt,getCellDate:Be.addYear,titleCell:function(Kt){return Be.locale.format(at.locale,Kt,"YYYY")}}))}var ir=Hn,Dn=10;function Vn(J){var ge=J.prefixCls,Re=J.operationRef,Ae=J.onViewDateChange,at=J.generateConfig,Be=J.value,nt=J.viewDate,yt=J.sourceMode,Mt=J.onSelect,kt=J.onPanelChange,Ge="".concat(ge,"-year-panel");Re.current={onKeyDown:function(ut){return v(ut,{onLeftRight:function(Dt){Mt(at.addYear(Be||nt,Dt),"key")},onCtrlLeftRight:function(Dt){Mt(at.addYear(Be||nt,Dt*Dn),"key")},onUpDown:function(Dt){Mt(at.addYear(Be||nt,Dt*Wn),"key")},onEnter:function(){kt(yt==="date"?"date":"month",Be||nt)}})}};var xt=function(ut){var bt=at.addYear(nt,ut*10);Ae(bt),kt(null,bt)};return k.createElement("div",{className:Ge},k.createElement(Zn,Object.assign({},J,{prefixCls:ge,onPrevDecade:function(){xt(-1)},onNextDecade:function(){xt(1)},onDecadeClick:function(){kt("decade",nt)}})),k.createElement(ir,Object.assign({},J,{prefixCls:ge,onSelect:function(ut){kt(yt==="date"?"date":"month",ut),Mt(ut,"mouse")}})))}var qn=Vn;function Mr(J){var ge=J.prefixCls,Re=J.generateConfig,Ae=J.viewDate,at=J.onPrevDecades,Be=J.onNextDecades,nt=k.useContext(o),yt=nt.hideHeader;if(yt)return null;var Mt="".concat(ge,"-header"),kt=Re.getYear(Ae),Ge=Math.floor(kt/Yr)*Yr,xt=Ge+Yr-1;return k.createElement(i,Object.assign({},J,{prefixCls:Mt,onSuperPrev:at,onSuperNext:Be}),Ge,"-",xt)}var Sr=Mr,on=3,Jn=4;function oi(J){var ge=Jr-1,Re=J.prefixCls,Ae=J.viewDate,at=J.generateConfig,Be=J.disabledDate,nt="".concat(Re,"-cell"),yt=at.getYear(Ae),Mt=Math.floor(yt/Jr)*Jr,kt=Math.floor(yt/Yr)*Yr,Ge=kt+Yr-1,xt=at.setYear(Ae,kt-Math.ceil((on*Jn*Jr-Yr)/2)),ot=function(bt){var Dt,pt=Be&&Be(bt),Kt=at.getYear(bt),nn=Kt+ge;return Dt={},Object(P.a)(Dt,"".concat(nt,"-disabled"),pt),Object(P.a)(Dt,"".concat(nt,"-in-view"),kt<=Kt&&nn<=Ge),Object(P.a)(Dt,"".concat(nt,"-selected"),Kt===Mt),Dt};return k.createElement(de,Object.assign({},J,{rowNum:Jn,colNum:on,baseDate:xt,getCellText:function(bt){var Dt=at.getYear(bt);return"".concat(Dt,"-").concat(Dt+ge)},getCellClassName:ot,getCellDate:function(bt,Dt){return at.addYear(bt,Dt*Jr)}}))}var xi=oi,Jr=10,Yr=Jr*10;function Lr(J){var ge=J.prefixCls,Re=J.onViewDateChange,Ae=J.generateConfig,at=J.viewDate,Be=J.operationRef,nt=J.onSelect,yt=J.onPanelChange,Mt="".concat(ge,"-decade-panel");Be.current={onKeyDown:function(ot){return v(ot,{onLeftRight:function(bt){nt(Ae.addYear(at,bt*Jr),"key")},onCtrlLeftRight:function(bt){nt(Ae.addYear(at,bt*Yr),"key")},onUpDown:function(bt){nt(Ae.addYear(at,bt*Jr*on),"key")},onEnter:function(){yt("year",at)}})}};var kt=function(ot){var ut=Ae.addYear(at,ot*Yr);Re(ut),yt(null,ut)},Ge=function(ot){nt(ot,"mouse"),yt("year",ot)};return k.createElement("div",{className:Mt},k.createElement(Sr,Object.assign({},J,{prefixCls:ge,onPrevDecades:function(){kt(-1)},onNextDecades:function(){kt(1)}})),k.createElement(xi,Object.assign({},J,{prefixCls:ge,onSelect:Ge})))}var Yn=Lr;function mi(J,ge,Re){return Re?k.createElement("div",{className:"".concat(J,"-footer-extra")},Re(ge)):null}function hn(J){var ge=J.prefixCls,Re=J.rangeList,Ae=Re===void 0?[]:Re,at=J.components,Be=at===void 0?{}:at,nt=J.needConfirmButton,yt=J.onNow,Mt=J.onOk,kt=J.okDisabled,Ge=J.showNow,xt=J.locale,ot,ut;if(Ae.length){var bt=Be.rangeItem||"span";ot=k.createElement(k.Fragment,null,Ae.map(function(pt){var Kt=pt.label,nn=pt.onClick,wn=pt.onMouseEnter,In=pt.onMouseLeave;return k.createElement("li",{key:Kt,className:"".concat(ge,"-preset")},k.createElement(bt,{onClick:nn,onMouseEnter:wn,onMouseLeave:In},Kt))}))}if(nt){var Dt=Be.button||"button";yt&&!ot&&Ge!==!1&&(ot=k.createElement("li",{className:"".concat(ge,"-now")},k.createElement("a",{className:"".concat(ge,"-now-btn"),onClick:yt},xt.now))),ut=nt&&k.createElement("li",{className:"".concat(ge,"-ok")},k.createElement(Dt,{disabled:kt,onClick:Mt},xt.ok))}return!ot&&!ut?null:k.createElement("ul",{className:"".concat(ge,"-ranges")},ot,ut)}function ei(J){var ge,Re=J.prefixCls,Ae=Re===void 0?"rc-picker":Re,at=J.className,Be=J.style,nt=J.locale,yt=J.generateConfig,Mt=J.value,kt=J.defaultValue,Ge=J.pickerValue,xt=J.defaultPickerValue,ot=J.disabledDate,ut=J.mode,bt=J.picker,Dt=bt===void 0?"date":bt,pt=J.tabIndex,Kt=pt===void 0?0:pt,nn=J.showNow,wn=J.showTime,In=J.showToday,yn=J.renderExtraFooter,On=J.hideHeader,Cn=J.onSelect,Ot=J.onChange,rn=J.onPanelChange,Ut=J.onMouseDown,wt=J.onPickerValueChange,Rn=J.onOk,bn=J.components,Wt=J.direction,dt=J.hourStep,An=dt===void 0?1:dt,an=J.minuteStep,Kn=an===void 0?1:an,zt=J.secondStep,En=zt===void 0?1:zt,Ln=Dt==="date"&&!!wn||Dt==="time",cn=24%An===0,dr=60%Kn===0,xn=60%En===0,gn=k.useContext(o),Ct=gn.operationRef,Ze=gn.panelRef,Lt=gn.onSelect,At=gn.hideRanges,en=gn.defaultOpenValue,Nn=k.useContext(vt),Sn=Nn.inRange,Qn=Nn.panelPosition,zn=Nn.rangedValue,vr=Nn.hoverRangedValue,sr=k.useRef({}),hr=k.useRef(!0),Wr=Object(p.a)(null,{value:Mt,defaultValue:kt,postState:function(Ft){return!Ft&&en&&Dt==="time"?en:Ft}}),Ur=Object(W.a)(Wr,2),Br=Ur[0],li=Ur[1],ui=Object(p.a)(null,{value:Ge,defaultValue:xt||Br,postState:function(Ft){return Ft||yt.getNow()}}),Se=Object(W.a)(ui,2),je=Se[0],Xe=Se[1],Le=function(Ft){Xe(Ft),wt&&wt(Ft)},ue=function(Ft){var Bt=B[Dt];return Bt?Bt(Ft):Ft},be=Object(p.a)(function(){return Dt==="time"?"time":ue("date")},{value:ut}),fe=Object(W.a)(be,2),Pe=fe[0],ke=fe[1];k.useEffect(function(){ke(Dt)},[Dt]);var qe=k.useState(function(){return Pe}),Ne=Object(W.a)(qe,2),st=Ne[0],Pt=Ne[1],$t=function(Ft,Bt){var or=ue(Ft||Pe);Pt(Pe),ke(or),rn&&(Pe!==or||tt(yt,je,je))&&rn(Bt,or)},sn=function(Ft,Bt){var or=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Pe===Dt||or)&&(li(Ft),Cn&&Cn(Ft),Lt&&Lt(Ft,Bt),Ot&&!tt(yt,Ft,Br)&&Ot(Ft))},Pn=function(Ft){return sr.current&&sr.current.onKeyDown?([u.a.LEFT,u.a.RIGHT,u.a.UP,u.a.DOWN,u.a.PAGE_UP,u.a.PAGE_DOWN,u.a.ENTER].includes(Ft.which)&&Ft.preventDefault(),sr.current.onKeyDown(Ft)):(Object(E.a)(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1)},Un=function(Ft){sr.current&&sr.current.onBlur&&sr.current.onBlur(Ft)};Ct&&Qn!=="right"&&(Ct.current={onKeyDown:Pn,onClose:function(){sr.current&&sr.current.onClose&&sr.current.onClose()}}),k.useEffect(function(){Mt&&!hr.current&&Xe(Mt)},[Mt]),k.useEffect(function(){hr.current=!1},[]);var ar,tr=Object(L.a)(Object(L.a)({},J),{},{operationRef:sr,prefixCls:Ae,viewDate:je,value:Br,onViewDateChange:Le,sourceMode:st,onPanelChange:$t,disabledDate:Pe!=="decade"?ot:void 0});delete tr.onChange,delete tr.onSelect;switch(Pe){case"decade":ar=k.createElement(Yn,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}));break;case"year":ar=k.createElement(qn,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}));break;case"month":ar=k.createElement(St,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}));break;case"quarter":ar=k.createElement(Vt,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}));break;case"week":ar=k.createElement(un,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}));break;case"time":delete tr.showTime,ar=k.createElement(z,Object.assign({},tr,Object(m.a)(wn)==="object"?wn:null,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}));break;default:wn?ar=k.createElement(ct,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}})):ar=k.createElement(me,Object.assign({},tr,{onSelect:function(Ft,Bt){Le(Ft),sn(Ft,Bt)}}))}var fr,_r,lr=function(){var Ft=yt.getNow(),Bt=Je(yt.getHour(Ft),yt.getMinute(Ft),yt.getSecond(Ft),cn?An:1,dr?Kn:1,xn?En:1),or=$e(yt,Ft,Bt[0],Bt[1],Bt[2]);sn(or,"submit")};At||(fr=mi(Ae,Pe,yn),_r=hn({prefixCls:Ae,components:bn,needConfirmButton:Ln,okDisabled:!Br||ot&&ot(Br),locale:nt,showNow:nn,onNow:Ln&&lr,onOk:function(){Br&&(sn(Br,"submit",!0),Rn&&Rn(Br))}}));var pr;if(In&&Pe==="date"&&Dt==="date"&&!wn){var Er=yt.getNow(),ln="".concat(Ae,"-today-btn"),Yt=ot&&ot(Er);pr=k.createElement("a",{className:M()(ln,Yt&&"".concat(ln,"-disabled")),"aria-disabled":Yt,onClick:function(){Yt||sn(Er,"mouse",!0)}},nt.today)}return k.createElement(o.Provider,{value:Object(L.a)(Object(L.a)({},gn),{},{hideHeader:"hideHeader"in J?On:gn.hideHeader,hidePrevBtn:Sn&&Qn==="right",hideNextBtn:Sn&&Qn==="left"})},k.createElement("div",{tabIndex:Kt,className:M()("".concat(Ae,"-panel"),at,(ge={},Object(P.a)(ge,"".concat(Ae,"-panel-has-range"),zn&&zn[0]&&zn[1]),Object(P.a)(ge,"".concat(Ae,"-panel-has-range-hover"),vr&&vr[0]&&vr[1]),Object(P.a)(ge,"".concat(Ae,"-panel-rtl"),Wt==="rtl"),ge)),style:Be,onKeyDown:Pn,onBlur:Un,onMouseDown:Ut,ref:Ze},ar,fr||_r||pr?k.createElement("div",{className:"".concat(Ae,"-footer")},fr,_r,pr):null))}var zr=ei,wi=D("uciX"),gi={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 ri(J){var ge,Re=J.prefixCls,Ae=J.popupElement,at=J.popupStyle,Be=J.visible,nt=J.dropdownClassName,yt=J.dropdownAlign,Mt=J.transitionName,kt=J.getPopupContainer,Ge=J.children,xt=J.range,ot=J.popupPlacement,ut=J.direction,bt="".concat(Re,"-dropdown"),Dt=function(){return ot!==void 0?ot:ut==="rtl"?"bottomRight":"bottomLeft"};return k.createElement(wi.a,{showAction:[],hideAction:[],popupPlacement:Dt(),builtinPlacements:gi,prefixCls:bt,popupTransitionName:Mt,popup:Ae,popupAlign:yt,popupVisible:Be,popupClassName:M()(nt,(ge={},Object(P.a)(ge,"".concat(bt,"-range"),xt),Object(P.a)(ge,"".concat(bt,"-rtl"),ut==="rtl"),ge)),popupStyle:at,getPopupContainer:kt},Ge)}var Bi=ri;function Hi(J){var ge=J.open,Re=J.value,Ae=J.isClickOutside,at=J.triggerOpen,Be=J.forwardKeyDown,nt=J.blurToCancel,yt=J.onSubmit,Mt=J.onCancel,kt=J.onFocus,Ge=J.onBlur,xt=Object(k.useState)(!1),ot=Object(W.a)(xt,2),ut=ot[0],bt=ot[1],Dt=Object(k.useState)(!1),pt=Object(W.a)(Dt,2),Kt=pt[0],nn=pt[1],wn=Object(k.useRef)(!1),In=Object(k.useRef)(!1),yn={onMouseDown:function(){bt(!0),at(!0)},onKeyDown:function(Cn){switch(Cn.which){case u.a.ENTER:{ge?yt()!==!1&&bt(!0):at(!0),Cn.preventDefault();return}case u.a.TAB:{ut&&ge&&!Cn.shiftKey?(bt(!1),Cn.preventDefault()):!ut&&ge&&(!Be(Cn)&&Cn.shiftKey&&(bt(!0),Cn.preventDefault()));return}case u.a.ESC:{bt(!0),Mt();return}}!ge&&![u.a.SHIFT].includes(Cn.which)?at(!0):ut||Be(Cn)},onFocus:function(Cn){bt(!0),nn(!0),kt&&kt(Cn)},onBlur:function(Cn){if(wn.current||!Ae(document.activeElement)){wn.current=!1;return}nt?setTimeout(function(){Ae(document.activeElement)&&Mt()},0):ge&&(at(!1),In.current&&yt()),nn(!1),Ge&&Ge(Cn)}};return Object(k.useEffect)(function(){In.current=!1},[ge]),Object(k.useEffect)(function(){In.current=!0},[Re]),Object(k.useEffect)(function(){return g(function(On){var Cn=On.target;ge&&(Ae(Cn)?Kt||at(!1):(wn.current=!0,requestAnimationFrame(function(){wn.current=!1})))})}),[yn,{focused:Kt,typing:ut}]}function ii(J){var ge=J.valueTexts,Re=J.onTextChange,Ae=k.useState(""),at=Object(W.a)(Ae,2),Be=at[0],nt=at[1],yt=k.useRef([]);yt.current=ge;function Mt(Ge){nt(Ge),Re(Ge)}function kt(){nt(yt.current[0])}return k.useEffect(function(){ge.every(function(Ge){return Ge!==Be})&&kt()},[ge.join("||")]),[Be,Mt,kt]}var wr=D("Gytx"),Oi=D.n(wr);function Ri(J,ge){var Re=ge.formatList,Ae=ge.generateConfig,at=ge.locale;return Object(S.a)(function(){if(!J)return[[""],""];for(var Be="",nt=[],yt=0;yt<Re.length;yt+=1){var Mt=Re[yt],kt=Ae.locale.format(at.locale,J,Mt);nt.push(kt),yt===0&&(Be=kt)}return[nt,Be]},[J,Re],function(Be,nt){return Be[0]!==nt[0]||!Oi()(Be[1],nt[1])})}function di(J,ge){var Re=ge.formatList,Ae=ge.generateConfig,at=ge.locale,Be=Object(k.useState)(null),nt=Object(W.a)(Be,2),yt=nt[0],Mt=nt[1],kt=Object(k.useRef)(null);function Ge(pt){var Kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(kt.current),Kt){Mt(pt);return}kt.current=requestAnimationFrame(function(){Mt(pt)})}var xt=Ri(yt,{formatList:Re,generateConfig:Ae,locale:at}),ot=Object(W.a)(xt,2),ut=ot[1];function bt(pt){Ge(pt)}function Dt(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ge(null,pt)}return Object(k.useEffect)(function(){Dt(!0)},[J]),Object(k.useEffect)(function(){return function(){return cancelAnimationFrame(kt.current)}},[]),[ut,bt,Dt]}function _i(J){var ge,Re=J.prefixCls,Ae=Re===void 0?"rc-picker":Re,at=J.id,Be=J.tabIndex,nt=J.style,yt=J.className,Mt=J.dropdownClassName,kt=J.dropdownAlign,Ge=J.popupStyle,xt=J.transitionName,ot=J.generateConfig,ut=J.locale,bt=J.inputReadOnly,Dt=J.allowClear,pt=J.autoFocus,Kt=J.showTime,nn=J.picker,wn=nn===void 0?"date":nn,In=J.format,yn=J.use12Hours,On=J.value,Cn=J.defaultValue,Ot=J.open,rn=J.defaultOpen,Ut=J.defaultOpenValue,wt=J.suffixIcon,Rn=J.clearIcon,bn=J.disabled,Wt=J.disabledDate,dt=J.placeholder,An=J.getPopupContainer,an=J.pickerRef,Kn=J.panelRender,zt=J.onChange,En=J.onOpenChange,Ln=J.onFocus,cn=J.onBlur,dr=J.onMouseDown,xn=J.onMouseUp,gn=J.onMouseEnter,Ct=J.onMouseLeave,Ze=J.onContextMenu,Lt=J.onClick,At=J.direction,en=J.autoComplete,Nn=en===void 0?"off":en,Sn=k.useRef(null),Qn=wn==="date"&&!!Kt||wn==="time",zn=Ee(b(In,wn,Kt,yn)),vr=k.useRef(null),sr=k.useRef(null),hr=Object(p.a)(null,{value:On,defaultValue:Cn}),Wr=Object(W.a)(hr,2),Ur=Wr[0],Br=Wr[1],li=k.useState(Ur),ui=Object(W.a)(li,2),Se=ui[0],je=ui[1],Xe=k.useRef(null),Le=Object(p.a)(!1,{value:Ot,defaultValue:rn,postState:function(ur){return bn?!1:ur},onChange:function(ur){En&&En(ur),!ur&&Xe.current&&Xe.current.onClose&&Xe.current.onClose()}}),ue=Object(W.a)(Le,2),be=ue[0],fe=ue[1],Pe=Ri(Se,{formatList:zn,generateConfig:ot,locale:ut}),ke=Object(W.a)(Pe,2),qe=ke[0],Ne=ke[1],st=ii({valueTexts:qe,onTextChange:function(ur){var ci=ot.locale.parse(ut.locale,ur,zn);ci&&(!Wt||!Wt(ci))&&je(ci)}}),Pt=Object(W.a)(st,3),$t=Pt[0],sn=Pt[1],Pn=Pt[2],Un=function(ur){je(ur),Br(ur),zt&&!tt(ot,Ur,ur)&&zt(ur,ur?ot.locale.format(ut.locale,ur,zn[0]):"")},ar=function(ur){if(bn&&ur)return;fe(ur)},tr=function(ur){return be&&Xe.current&&Xe.current.onKeyDown?Xe.current.onKeyDown(ur):(Object(E.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},fr=function(){xn&&xn.apply(void 0,arguments),Sn.current&&(Sn.current.focus(),ar(!0))},_r=Hi({blurToCancel:Qn,open:be,value:$t,triggerOpen:ar,forwardKeyDown:tr,isClickOutside:function(ur){return!U([vr.current,sr.current],ur)},onSubmit:function(){return Wt&&Wt(Se)?!1:(Un(Se),ar(!1),Pn(),!0)},onCancel:function(){ar(!1),je(Ur),Pn()},onFocus:Ln,onBlur:cn}),lr=Object(W.a)(_r,2),pr=lr[0],Er=lr[1],ln=Er.focused,Yt=Er.typing;k.useEffect(function(){be||(je(Ur),!qe.length||qe[0]===""?sn(""):Ne!==$t&&Pn())},[be,qe]),k.useEffect(function(){be||Pn()},[wn]),k.useEffect(function(){je(Ur)},[Ur]),an&&(an.current={focus:function(){Sn.current&&Sn.current.focus()},blur:function(){Sn.current&&Sn.current.blur()}});var pn=Object(L.a)(Object(L.a)({},J),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0}),Ft=k.createElement(zr,Object.assign({},pn,{generateConfig:ot,className:M()(Object(P.a)({},"".concat(Ae,"-panel-focused"),!Yt)),value:Se,locale:ut,tabIndex:-1,onChange:je,direction:At}));Kn&&(Ft=Kn(Ft));var Bt=k.createElement("div",{className:"".concat(Ae,"-panel-container"),onMouseDown:function(ur){ur.preventDefault()}},Ft),or;wt&&(or=k.createElement("span",{className:"".concat(Ae,"-suffix")},wt));var xr;Dt&&Ur&&!bn&&(xr=k.createElement("span",{onMouseDown:function(ur){ur.preventDefault(),ur.stopPropagation()},onMouseUp:function(ur){ur.preventDefault(),ur.stopPropagation(),Un(null),ar(!1)},className:"".concat(Ae,"-clear")},Rn||k.createElement("span",{className:"".concat(Ae,"-clear-btn")})));var Xn=function(ur,ci){(ci==="submit"||ci!=="key"&&!Qn)&&(Un(ur),ar(!1))},Or=At==="rtl"?"bottomRight":"bottomLeft",Xr=di($t,{formatList:zn,generateConfig:ot,locale:ut}),Rr=Object(W.a)(Xr,3),jr=Rr[0],Ir=Rr[1],Pr=Rr[2];return k.createElement(o.Provider,{value:{operationRef:Xe,hideHeader:wn==="time",panelRef:vr,onSelect:Xn,open:be,defaultOpenValue:Ut,onDateMouseEnter:Ir,onDateMouseLeave:Pr}},k.createElement(Bi,{visible:be,popupElement:Bt,popupStyle:Ge,prefixCls:Ae,dropdownClassName:Mt,dropdownAlign:kt,getPopupContainer:An,transitionName:xt,popupPlacement:Or,direction:At},k.createElement("div",{className:M()(Ae,yt,(ge={},Object(P.a)(ge,"".concat(Ae,"-disabled"),bn),Object(P.a)(ge,"".concat(Ae,"-focused"),ln),Object(P.a)(ge,"".concat(Ae,"-rtl"),At==="rtl"),ge)),style:nt,onMouseDown:dr,onMouseUp:fr,onMouseEnter:gn,onMouseLeave:Ct,onContextMenu:Ze,onClick:Lt},k.createElement("div",{className:M()("".concat(Ae,"-input"),Object(P.a)({},"".concat(Ae,"-input-placeholder"),!!jr)),ref:sr},k.createElement("input",Object.assign({id:at,tabIndex:Be,disabled:bn,readOnly:bt||!Yt,value:jr||$t,onChange:function(ur){sn(ur.target.value)},autoFocus:pt,placeholder:dt,ref:Sn,title:$t},pr,{size:f(wn,zn[0])},Qe(J),{autoComplete:Nn})),or,xr))))}var oa=function(J){Object(I.a)(Re,J);var ge=Object(G.a)(Re);function Re(){var Ae;return Object(Z.a)(this,Re),Ae=ge.apply(this,arguments),Ae.pickerRef=k.createRef(),Ae.focus=function(){Ae.pickerRef.current&&Ae.pickerRef.current.focus()},Ae.blur=function(){Ae.pickerRef.current&&Ae.pickerRef.current.blur()},Ae}return Object(V.a)(Re,[{key:"render",value:function(){return k.createElement(_i,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Re}(k.Component),$i=oa;function yr(J,ge,Re){var Ae=J.picker,at=J.locale,Be=J.selectedValue,nt=J.disabledDate,yt=J.disabled,Mt=J.generateConfig,kt=Te(Be,0),Ge=Te(Be,1);function xt(pt){var Kt=Mt.getYear(pt),nn=Mt.locale.getWeek(at.locale,pt);return Kt*100+nn}function ot(pt){var Kt=Mt.getYear(pt),nn=Mt.getMonth(pt);return Kt*100+nn}function ut(pt){var Kt=Mt.getYear(pt),nn=Oe(Mt,pt);return Kt*10+nn}var bt=k.useCallback(function(pt){if(nt&&nt(pt))return!0;if(yt[1]&&Ge)return!Tt(Mt,pt,Ge)&&Mt.isAfter(pt,Ge);if(ge&&Ge)switch(Ae){case"quarter":return ut(pt)>ut(Ge);case"month":return ot(pt)>ot(Ge);case"week":return xt(pt)>xt(Ge);default:return!Tt(Mt,pt,Ge)&&Mt.isAfter(pt,Ge)}return!1},[nt,yt[1],Ge,ge]),Dt=k.useCallback(function(pt){if(nt&&nt(pt))return!0;if(yt[0]&&kt)return!Tt(Mt,pt,Ge)&&Mt.isAfter(kt,pt);if(Re&&kt)switch(Ae){case"quarter":return ut(pt)<ut(kt);case"month":return ot(pt)<ot(kt);case"week":return xt(pt)<xt(kt);default:return!Tt(Mt,pt,kt)&&Mt.isAfter(kt,pt)}return!1},[nt,yt[0],kt,Re]);return[bt,Dt]}function br(J,ge,Re,Ae){var at=ze(J,Re,Ae,1);function Be(nt){return nt(J,ge)?"same":nt(at,ge)?"closing":"far"}switch(Re){case"year":return Be(function(nt,yt){return rt(Ae,nt,yt)});case"quarter":case"month":return Be(function(nt,yt){return le(Ae,nt,yt)});default:return Be(function(nt,yt){return Ye(Ae,nt,yt)})}}function si(J,ge,Re,Ae){var at=Te(J,0),Be=Te(J,1);if(ge===0)return at;if(at&&Be){var nt=br(at,Be,Re,Ae);switch(nt){case"same":return at;case"closing":return at;default:return ze(Be,Re,Ae,-1)}}return at}function kr(J){var ge=J.values,Re=J.picker,Ae=J.defaultDates,at=J.generateConfig,Be=k.useState(function(){return[Te(Ae,0),Te(Ae,1)]}),nt=Object(W.a)(Be,2),yt=nt[0],Mt=nt[1],kt=k.useState(null),Ge=Object(W.a)(kt,2),xt=Ge[0],ot=Ge[1],ut=Te(ge,0),bt=Te(ge,1);function Dt(Kt){return yt[Kt]?yt[Kt]:Te(xt,Kt)||si(ge,Kt,Re,at)||ut||bt||at.getNow()}function pt(Kt,nn){if(Kt){var wn=We(xt,Kt,nn);Mt(We(yt,null,nn)||[null,null]);var In=(nn+1)%2;Te(ge,In)||(wn=We(wn,Kt,In)),ot(wn)}else(ut||bt)&&ot(null)}return[Dt,pt]}function kn(J,ge){return J&&J[0]&&J[1]&&ge.isAfter(J[0],J[1])?[J[1],J[0]]:J}function fn(J,ge,Re,Ae){return J||Ae&&Ae[ge]?!0:!!Re[(ge+1)%2]}function Tn(J){var ge,Re,Ae,at=J.prefixCls,Be=at===void 0?"rc-picker":at,nt=J.id,yt=J.style,Mt=J.className,kt=J.popupStyle,Ge=J.dropdownClassName,xt=J.transitionName,ot=J.dropdownAlign,ut=J.getPopupContainer,bt=J.generateConfig,Dt=J.locale,pt=J.placeholder,Kt=J.autoFocus,nn=J.disabled,wn=J.format,In=J.picker,yn=In===void 0?"date":In,On=J.showTime,Cn=J.use12Hours,Ot=J.separator,rn=Ot===void 0?"~":Ot,Ut=J.value,wt=J.defaultValue,Rn=J.defaultPickerValue,bn=J.open,Wt=J.defaultOpen,dt=J.disabledDate,An=J.disabledTime,an=J.dateRender,Kn=J.panelRender,zt=J.ranges,En=J.allowEmpty,Ln=J.allowClear,cn=J.suffixIcon,dr=J.clearIcon,xn=J.pickerRef,gn=J.inputReadOnly,Ct=J.mode,Ze=J.renderExtraFooter,Lt=J.onChange,At=J.onOpenChange,en=J.onPanelChange,Nn=J.onCalendarChange,Sn=J.onFocus,Qn=J.onBlur,zn=J.onOk,vr=J.components,sr=J.order,hr=J.direction,Wr=J.activePickerIndex,Ur=J.autoComplete,Br=Ur===void 0?"off":Ur,li=yn==="date"&&!!On||yn==="time",ui=Object(k.useRef)({}),Se=Object(k.useRef)(null),je=Object(k.useRef)(null),Xe=Object(k.useRef)(null),Le=Object(k.useRef)(null),ue=Object(k.useRef)(null),be=Object(k.useRef)(null),fe=Object(k.useRef)(null),Pe=Ee(b(wn,yn,On,Cn)),ke=Object(p.a)(0,{value:Wr}),qe=Object(W.a)(ke,2),Ne=qe[0],st=qe[1],Pt=Object(k.useRef)(null),$t=k.useMemo(function(){return Array.isArray(nn)?nn:[nn||!1,nn||!1]},[nn]),sn=Object(p.a)(null,{value:Ut,defaultValue:wt,postState:function(Bn){return yn==="time"&&!sr?Bn:kn(Bn,bt)}}),Pn=Object(W.a)(sn,2),Un=Pn[0],ar=Pn[1],tr=kr({values:Un,picker:yn,defaultDates:Rn,generateConfig:bt}),fr=Object(W.a)(tr,2),_r=fr[0],lr=fr[1],pr=Object(p.a)(Un,{postState:function(Bn){var nr=Bn;if($t[0]&&$t[1])return nr;for(var Cr=0;Cr<2;Cr+=1)$t[Cr]&&!Te(nr,Cr)&&!Te(En,Cr)&&(nr=We(nr,bt.getNow(),Cr));return nr}}),Er=Object(W.a)(pr,2),ln=Er[0],Yt=Er[1],pn=Object(p.a)([yn,yn],{value:Ct}),Ft=Object(W.a)(pn,2),Bt=Ft[0],or=Ft[1];Object(k.useEffect)(function(){or([yn,yn])},[yn]);var xr=function(Bn,nr){or(Bn),en&&en(nr,Bn)},Xn=yr({picker:yn,selectedValue:ln,locale:Dt,disabled:$t,disabledDate:dt,generateConfig:bt},ui.current[1],ui.current[0]),Or=Object(W.a)(Xn,2),Xr=Or[0],Rr=Or[1],jr=Object(p.a)(!1,{value:bn,defaultValue:Wt,postState:function(Bn){return $t[Ne]?!1:Bn},onChange:function(Bn){At&&At(Bn),!Bn&&Pt.current&&Pt.current.onClose&&Pt.current.onClose()}}),Ir=Object(W.a)(jr,2),Pr=Ir[0],Dr=Ir[1],ur=Pr&&Ne===0,ci=Pr&&Ne===1,Ji=Object(k.useState)(0),Ii=Object(W.a)(Ji,2),Ci=Ii[0],Qr=Ii[1];Object(k.useEffect)(function(){!Pr&&Se.current&&Qr(Se.current.offsetWidth)},[Pr]);var Kr=k.useRef();function Vr(gr,Bn){if(gr)clearTimeout(Kr.current),ui.current[Bn]=!0,st(Bn),Dr(gr),Pr||lr(null,Bn);else if(Ne===Bn){Dr(gr);var nr=ui.current;Kr.current=setTimeout(function(){nr===ui.current&&(ui.current={})})}}function Zr(gr){Vr(!0,gr),setTimeout(function(){var Bn=[be,fe][gr];Bn.current&&Bn.current.focus()},0)}function Ni(gr,Bn){var nr=gr,Cr=Te(nr,0),ti=Te(nr,1);Cr&&ti&&bt.isAfter(Cr,ti)&&(yn==="week"&&!Xt(bt,Dt.locale,Cr,ti)||yn==="quarter"&&!Fe(bt,Cr,ti)||yn!=="week"&&yn!=="quarter"&&yn!=="time"&&!Tt(bt,Cr,ti)?(Bn===0?(nr=[Cr,null],ti=null):(Cr=null,nr=[null,ti]),ui.current=Object(P.a)({},Bn,!0)):(yn!=="time"||sr!==!1)&&(nr=kn(nr,bt))),Yt(nr);var ga=nr&&nr[0]?bt.locale.format(Dt.locale,nr[0],Pe[0]):"",ia=nr&&nr[1]?bt.locale.format(Dt.locale,nr[1],Pe[0]):"";if(Nn){var Di={range:Bn===0?"start":"end"};Nn(nr,[ga,ia],Di)}var Yi=fn(Cr,0,$t,En),va=fn(ti,1,$t,En),Wa=nr===null||Yi&&va;Wa&&(ar(nr),Lt&&(!tt(bt,Te(Un,0),Cr)||!tt(bt,Te(Un,1),ti))&&Lt(nr,[ga,ia]));var Ti=null;Bn===0&&!$t[1]?Ti=1:Bn===1&&!$t[0]&&(Ti=0),Ti!==null&&Ti!==Ne&&(!ui.current[Ti]||!Te(nr,Ti))&&Te(nr,Bn)?Zr(Ti):Vr(!1,Bn)}var ha=function(Bn){return Pr&&Pt.current&&Pt.current.onKeyDown?Pt.current.onKeyDown(Bn):(Object(E.a)(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},sa={formatList:Pe,generateConfig:bt,locale:Dt},Gr=Ri(Te(ln,0),sa),Qi=Object(W.a)(Gr,2),Zi=Qi[0],$r=Qi[1],Hr=Ri(Te(ln,1),sa),yi=Object(W.a)(Hr,2),Ma=yi[0],no=yi[1],la=function(Bn,nr){var Cr=bt.locale.parse(Dt.locale,Bn,Pe),ti=nr===0?Xr:Rr;Cr&&!ti(Cr)&&(Yt(We(ln,Cr,nr)),lr(Cr,nr))},Ca=ii({valueTexts:Zi,onTextChange:function(Bn){return la(Bn,0)}}),Ta=Object(W.a)(Ca,3),Sa=Ta[0],ka=Ta[1],co=Ta[2],Ro=ii({valueTexts:Ma,onTextChange:function(Bn){return la(Bn,1)}}),za=Object(W.a)(Ro,3),Oa=za[0],Va=za[1],_a=za[2],Ra=Object(k.useState)(null),ho=Object(W.a)(Ra,2),Ya=ho[0],Aa=ho[1],Da=Object(k.useState)(null),ya=Object(W.a)(Da,2),Mi=ya[0],fa=ya[1],pa=di(Sa,{formatList:Pe,generateConfig:bt,locale:Dt}),ba=Object(W.a)(pa,3),ma=ba[0],Xa=ba[1],$a=ba[2],Ja=di(Oa,{formatList:Pe,generateConfig:bt,locale:Dt}),Ia=Object(W.a)(Ja,3),ua=Ia[0],Ea=Ia[1],ro=Ia[2],Ao=function(Bn){fa(We(ln,Bn,Ne)),Ne===0?Xa(Bn):Ea(Bn)},Do=function(){fa(We(ln,null,Ne)),Ne===0?$a():ro()},fo=function(Bn,nr){return{blurToCancel:li,forwardKeyDown:ha,onBlur:Qn,isClickOutside:function(ti){return!U([je.current,Xe.current,Le.current],ti)},onFocus:function(ti){st(Bn),Sn&&Sn(ti)},triggerOpen:function(ti){Vr(ti,Bn)},onSubmit:function(){Ni(ln,Bn),nr()},onCancel:function(){Vr(!1,Bn),Yt(Un),nr()}}},io=Hi(Object(L.a)(Object(L.a)({},fo(0,co)),{},{open:ur,value:Sa})),po=Object(W.a)(io,2),Wi=po[0],hi=po[1],Ai=hi.focused,fi=hi.typing,Na=Hi(Object(L.a)(Object(L.a)({},fo(1,_a)),{},{open:ci,value:Oa})),mo=Object(W.a)(Na,2),qi=mo[0],ao=mo[1],oo=ao.focused,so=ao.typing,xa=function(Bn){!Pr&&!be.current.contains(Bn.target)&&!fe.current.contains(Bn.target)&&($t[0]?$t[1]||Zr(1):Zr(0))},Qa=function(Bn){Pr&&(Ai||oo)&&!be.current.contains(Bn.target)&&!fe.current.contains(Bn.target)&&Bn.preventDefault()},Ua=Un&&Un[0]?bt.locale.format(Dt.locale,Un[0],"YYYYMMDDHHmmss"):"",go=Un&&Un[1]?bt.locale.format(Dt.locale,Un[1],"YYYYMMDDHHmmss"):"";Object(k.useEffect)(function(){Pr||(Yt(Un),!Zi.length||Zi[0]===""?ka(""):$r!==Sa&&co(),!Ma.length||Ma[0]===""?Va(""):no!==Oa&&_a())},[Pr,Zi,Ma]),Object(k.useEffect)(function(){Yt(Un)},[Ua,go]),xn&&(xn.current={focus:function(){be.current&&be.current.focus()},blur:function(){be.current&&be.current.blur(),fe.current&&fe.current.blur()}});var Za=Object.keys(zt||{}),Fr=Za.map(function(gr){var Bn=zt[gr],nr=typeof Bn=="function"?Bn():Bn;return{label:gr,onClick:function(){Ni(nr,null),Vr(!1,Ne)},onMouseEnter:function(){Aa(nr)},onMouseLeave:function(){Aa(null)}}});function Tr(){var gr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nr=null;Pr&&Mi&&Mi[0]&&Mi[1]&&bt.isAfter(Mi[1],Mi[0])&&(nr=Mi);var Cr=On;if(On&&Object(m.a)(On)==="object"&&On.defaultValue){var ti=On.defaultValue;Cr=Object(L.a)(Object(L.a)({},On),{},{defaultValue:Te(ti,Ne)||void 0})}var ga=null;return an&&(ga=function(Di,Yi){return an(Di,Yi,{range:Ne?"end":"start"})}),k.createElement(vt.Provider,{value:{inRange:!0,panelPosition:gr,rangedValue:Ya||ln,hoverRangedValue:nr}},k.createElement(zr,Object.assign({},J,Bn,{dateRender:ga,showTime:Cr,mode:Bt[Ne],generateConfig:bt,style:void 0,direction:hr,disabledDate:Ne===0?Xr:Rr,disabledTime:function(Di){return An?An(Di,Ne===0?"start":"end"):!1},className:M()(Object(P.a)({},"".concat(Be,"-panel-focused"),Ne===0?!fi:!so)),value:Te(ln,Ne),locale:Dt,tabIndex:-1,onPanelChange:function(Di,Yi){xr(We(Bt,Yi,Ne),We(ln,Di,Ne));var va=Di;gr==="right"&&Bt[Ne]===Yi&&(va=ze(va,Yi,bt,-1)),lr(va,Ne)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:void 0,defaultPickerValue:void 0})))}var ai=0,Ui=0;Ne&&Xe.current&&ue.current&&je.current&&(ai=Xe.current.offsetWidth+ue.current.offsetWidth,je.current.offsetWidth&&ai>je.current.offsetWidth&&(Ui=ai));var La=hr==="rtl"?{right:ai}:{left:ai};function ca(){var gr,Bn=mi(Be,Bt[Ne],Ze),nr=hn({prefixCls:Be,components:vr,needConfirmButton:li,okDisabled:!Te(ln,Ne)||dt&&dt(ln[Ne]),locale:Dt,rangeList:Fr,onOk:function(){Te(ln,Ne)&&(Ni(ln,Ne),zn&&zn(ln))}});if(yn!=="time"&&!On){var Cr=_r(Ne),ti=ze(Cr,yn,bt),ga=Bt[Ne],ia=ga===yn,Di=Tr(ia?"left":!1,{pickerValue:Cr,onPickerValueChange:function(Ti){lr(Ti,Ne)}}),Yi=Tr("right",{pickerValue:ti,onPickerValueChange:function(Ti){lr(ze(Ti,yn,bt,-1),Ne)}});hr==="rtl"?gr=k.createElement(k.Fragment,null,Yi,ia&&Di):gr=k.createElement(k.Fragment,null,Di,ia&&Yi)}else gr=Tr();var va=k.createElement(k.Fragment,null,k.createElement("div",{className:"".concat(Be,"-panels")},gr),(Bn||nr)&&k.createElement("div",{className:"".concat(Be,"-footer")},Bn,nr));return Kn&&(va=Kn(va)),k.createElement("div",{className:"".concat(Be,"-panel-container"),style:{marginLeft:Ui},ref:je,onMouseDown:function(Ti){Ti.preventDefault()}},va)}var ja=k.createElement("div",{className:M()("".concat(Be,"-range-wrapper"),"".concat(Be,"-").concat(yn,"-range-wrapper")),style:{minWidth:Ci}},k.createElement("div",{className:"".concat(Be,"-range-arrow"),style:La}),ca()),da;cn&&(da=k.createElement("span",{className:"".concat(Be,"-suffix")},cn));var bi;Ln&&(Te(Un,0)&&!$t[0]||Te(Un,1)&&!$t[1])&&(bi=k.createElement("span",{onMouseDown:function(Bn){Bn.preventDefault(),Bn.stopPropagation()},onMouseUp:function(Bn){Bn.preventDefault(),Bn.stopPropagation();var nr=Un;$t[0]||(nr=We(nr,null,0)),$t[1]||(nr=We(nr,null,1)),Ni(nr,null),Vr(!1,Ne)},className:"".concat(Be,"-clear")},dr||k.createElement("span",{className:"".concat(Be,"-clear-btn")})));var Fa={size:f(yn,Pe[0])},Ba=0,Ha=0;Xe.current&&Le.current&&ue.current&&(Ne===0?Ha=Xe.current.offsetWidth:(Ba=ai,Ha=Le.current.offsetWidth));var Ki=hr==="rtl"?{right:Ba}:{left:Ba},Nr=function(Bn,nr){var Cr=We(ln,Bn,Ne);nr==="submit"||nr!=="key"&&!li?(Ni(Cr,Ne),Ne===0?$a():ro()):Yt(Cr)};return k.createElement(o.Provider,{value:{operationRef:Pt,hideHeader:yn==="time",onDateMouseEnter:Ao,onDateMouseLeave:Do,hideRanges:!0,onSelect:Nr,open:Pr}},k.createElement(Bi,{visible:Pr,popupElement:ja,popupStyle:kt,prefixCls:Be,dropdownClassName:Ge,dropdownAlign:ot,getPopupContainer:ut,transitionName:xt,range:!0,direction:hr},k.createElement("div",Object.assign({ref:Se,className:M()(Be,"".concat(Be,"-range"),Mt,(ge={},Object(P.a)(ge,"".concat(Be,"-disabled"),$t[0]&&$t[1]),Object(P.a)(ge,"".concat(Be,"-focused"),Ne===0?Ai:oo),Object(P.a)(ge,"".concat(Be,"-rtl"),hr==="rtl"),ge)),style:yt,onClick:xa,onMouseDown:Qa},Qe(J)),k.createElement("div",{className:M()("".concat(Be,"-input"),(Re={},Object(P.a)(Re,"".concat(Be,"-input-active"),Ne===0),Object(P.a)(Re,"".concat(Be,"-input-placeholder"),!!ma),Re)),ref:Xe},k.createElement("input",Object.assign({id:nt,disabled:$t[0],readOnly:gn||!fi,value:ma||Sa,onChange:function(Bn){ka(Bn.target.value)},autoFocus:Kt,placeholder:Te(pt,0)||"",ref:be},Wi,Fa,{autoComplete:Br}))),k.createElement("div",{className:"".concat(Be,"-range-separator"),ref:ue},rn),k.createElement("div",{className:M()("".concat(Be,"-input"),(Ae={},Object(P.a)(Ae,"".concat(Be,"-input-active"),Ne===1),Object(P.a)(Ae,"".concat(Be,"-input-placeholder"),!!ua),Ae)),ref:Le},k.createElement("input",Object.assign({disabled:$t[1],readOnly:gn||!so,value:ua||Oa,onChange:function(Bn){Va(Bn.target.value)},placeholder:Te(pt,1)||"",ref:fe},qi,Fa,{autoComplete:Br}))),k.createElement("div",{className:"".concat(Be,"-active-bar"),style:Object(L.a)(Object(L.a)({},Ki),{},{width:Ha,position:"absolute"})}),da,bi)))}var mn=function(J){Object(I.a)(Re,J);var ge=Object(G.a)(Re);function Re(){var Ae;return Object(Z.a)(this,Re),Ae=ge.apply(this,arguments),Ae.pickerRef=k.createRef(),Ae.focus=function(){Ae.pickerRef.current&&Ae.pickerRef.current.focus()},Ae.blur=function(){Ae.pickerRef.current&&Ae.pickerRef.current.blur()},Ae}return Object(V.a)(Re,[{key:"render",value:function(){return k.createElement(Tn,Object.assign({},this.props,{pickerRef:this.pickerRef}))}}]),Re}(k.Component),er=mn,rr=_e.b=$i},osHv:function(jt,_e,D){(function(Z){Z(D("VrN/"))})(function(Z){"use strict";var V=Z.Pos;function I(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",L=new RegExp("<(/?)(["+G+"]["+P+"]*)","g");function W(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 E(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 p(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}L.lastIndex=s,c.ch=s;var i=L.exec(c.text);if(i&&i.index==s)return i}}function m(c){for(;;){L.lastIndex=c.ch;var s=L.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 u(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 a(c,s){for(var i=[];;){var n=m(c),O,S=c.line,C=c.ch-(n?n[0].length:0);if(!n||!(O=E(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(S,C),to:V(c.line,c.ch)}}else i.push(n[2])}}function o(c,s){for(var i=[];;){var n=u(c);if(!n)return;if(n=="selfClose"){p(c);continue}var O=c.line,S=c.ch,C=p(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,S)}}}}Z.registerHelper("fold","xml",function(c,s){for(var i=new W(c,s.line,0);;){var n=m(i);if(!n||i.line!=s.line)return;var O=E(i);if(!O)return;if(!n[1]&&O!="selfClose"){var S=V(i.line,i.ch),C=a(i,n[2]);return C&&I(C.from,S)>0?{from:S,to:C.from}:null}}}),Z.findMatchingTag=function(c,s,i){var n=new W(c,s.line,s.ch,i);if(n.text.indexOf(">")==-1&&n.text.indexOf("<")==-1)return;var O=E(n),S=O&&V(n.line,n.ch),C=O&&p(n);if(!O||!C||I(n,s)>0)return;var R={from:V(n.line,n.ch),to:S,tag:C[2]};return O=="selfClose"?{open:R,close:null,at:"open"}:C[1]?{open:o(n,C[2]),close:R,at:"close"}:(n=new W(c,S.line,S.ch,i),{open:R,close:a(n,C[2]),at:"open"})},Z.findEnclosingTag=function(c,s,i,n){for(var O=new W(c,s.line,s.ch,i);;){var S=o(O,n);if(!S)break;var C=new W(c,s.line,s.ch,i),R=a(C,S.tag);if(R)return{open:S,close:R}}},Z.scanForClosingTag=function(c,s,i,n){var O=new W(c,s.line,s.ch,n?{from:0,to:n}:null);return a(O,i)}})},p5ED:function(jt,_e,D){"use strict";var Z=D("+L6B"),V=D("2/Rp"),I=D("5Dmo"),G=D("3S7+"),P=D("k1fw"),L=D("9og8"),W=D("tJVT"),k=D("WmNS"),r=D.n(k),M=D("q1tI"),E=D.n(M),p=D("vHTk"),m=D.n(p),u=D("yEEn"),a=D("ZW9T"),o=D("1vsH"),c=D("V0Rq"),s=D("m3rI");_e.a=function(i){var n,O,S,C,R,T,v,b=i.editOffice,f=b===void 0?"view":b,h=i.data,_=i.theme,g=i.type,x=i.filename,N=i.monacoEditor,F=i.className,A=i.style,B=i.close,U=i.onClose,w=i.hasMask,Y=i.disabledDownload,q=Object(M.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ce=Object(W.a)(q,2),Ee=ce[0],Qe=ce[1],Te=Object(M.useState)(""),We=Object(W.a)(Te,2),$e=We[0],Je=We[1],Ce=Object(M.useState)(),X=Object(W.a)(Ce,2),j=X[0],K=X[1],Q=window.ENV==="build"?"/react/build":"",re=s.a.PROXY_SERVER||location.origin,z,we=1024*1024,Ue=10*we,rt=Object(M.useRef)();(n=h)!==null&&n!==void 0&&n.startsWith("/api")&&g!=="txt"&&(h=(s.a.API_SERVER||location.origin)+h),g==="office"&&(z=Object(o.T)(h).filesize,z>Ue&&(g="other")),x&&N&&(N.filename=x),Object(M.useEffect)(function(){var Ye,Tt,Nt=(Ye=document.cookie)===null||Ye===void 0||((Tt=Ye.replace(/\s/g,""))===null||Tt===void 0)?void 0:Tt.split(";");Nt==null||Nt.map(function(Xt){var tt=Xt.split("=");tt[0]==="_educoder_session"&&Je(tt[1])})},[]),Object(M.useEffect)(function(){g==="office"&&le()},[g,h]);var le=function(){var Ye=Object(L.a)(r.a.mark(function Tt(){var Nt,Xt,tt;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return console.log("data:",h),Nt=h,h.startsWith("http")||(Nt=location.origin+Nt),Xt=new URL(Nt).pathname.split("/").pop(),vn.next=6,Object(c.V)({attachment_id:Xt});case 6:tt=vn.sent,K(tt);case 8:case"end":return vn.stop()}},Tt)}));return function(){return Ye.apply(this,arguments)}}(),Oe=function(){if(h.startsWith("http")||h.startsWith("blob:")){Fe();return}Object(o.z)(x||"educoder",h,x)},Fe=function(){Object(o.x)(x||"educoder",decodeURIComponent(h))};return E.a.createElement("div",{style:Object(P.a)({},A||{}),className:"".concat(w&&m.a.bgBlack," ").concat(g?m.a.wrp:"hide")},B&&E.a.createElement("div",{className:m.a.close,ref:rt},!Y&&E.a.createElement(G.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return rt.current}},E.a.createElement("span",{onClick:Fe},E.a.createElement("i",{className:"icon-quxiaozhiding"}))),E.a.createElement(G.a,{title:"\u5173\u95ED",getPopupContainer:function(){return rt.current}},E.a.createElement("span",{className:"",onClick:U},E.a.createElement("i",{className:"icon-guanbi1"})))),E.a.createElement("div",{className:"".concat(m.a[F]," ").concat(F," ").concat(m.a.monaco," ").concat(g==="txt"?"show":"hide")},g==="txt"&&E.a.createElement(a.b,N)),g==="audio"&&E.a.createElement("audio",{src:"".concat(((O=h)===null||O===void 0?void 0:O.indexOf("http://"))>-1||((S=h)===null||S===void 0?void 0:S.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(h),autoPlay:!0}),g==="video"&&E.a.createElement(E.a.Fragment,null,((C=h)===null||C===void 0?void 0:C.indexOf("http"))>-1?E.a.createElement("video",{controls:!0,src:"".concat(h),autoPlay:!0}):E.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(h),autoPlay:!0})),g==="office"&&j&&E.a.createElement("iframe",{src:"".concat(Q,"/office.html?key=").concat(j.key,"&url=").concat(re+j.url,"&callbackUrl=").concat(re+j.callbackUrl,"&fileType=").concat(j.fileType,"&title=").concat(j.title,"&model=").concat(f,"&officeServer=").concat(s.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),g==="html"&&E.a.createElement("iframe",{src:h+"&disposition=inline"}),g==="pdf"&&E.a.createElement("iframe",{src:"".concat(Q,"/js/pdfview/index.html?url=").concat(h,"&disabledDownload=").concat(!!Y)}),g==="image"&&E.a.createElement("img",{src:"".concat(((R=h)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((T=h)===null||T===void 0?void 0:T.indexOf("https://"))>-1||(v=h)!==null&&v!==void 0&&v.startsWith("/api")?"":"data:image/png;base64,").concat(h)}),g==="other"&&E.a.createElement("div",null,E.a.createElement(V.a,{type:"primary",size:"large",onClick:Oe},E.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),g==="download"&&E.a.createElement(V.a,{type:"primary",size:"large",onClick:Oe},E.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(jt,_e,D){},pmY6:function(jt,_e,D){"use strict";D.d(_e,"h",function(){return M}),D.d(_e,"g",function(){return p}),D.d(_e,"f",function(){return m}),D.d(_e,"e",function(){return u}),D.d(_e,"i",function(){return a}),D.d(_e,"b",function(){return o}),D.d(_e,"a",function(){return c}),D.d(_e,"d",function(){return s}),D.d(_e,"c",function(){return i});var Z=D("C/vA"),V=D("JYp7");const I=!1;let G=null;function P(n){G=n}if(I){const n="__is_disposable_tracked__";P(new class{trackDisposable(O){const S=new Error("Potentially leaked disposable").stack;setTimeout(()=>{O[n]||console.log(S)},3e3)}setParent(O,S){if(O&&O!==c.None)try{O[n]=!0}catch(C){}}markAsDisposed(O){if(O&&O!==c.None)try{O[n]=!0}catch(S){}}markAsSingleton(O){}})}function L(n){return G==null||G.trackDisposable(n),n}function W(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 S of n)G.setParent(S,O)}function M(n){return G==null||G.markAsSingleton(n),n}class E extends Error{constructor(n){super(`Encountered errors while disposing of store. Errors: [${n.join(", ")}]`);this.errors=n}}function p(n){return typeof n.dispose=="function"&&n.dispose.length===0}function m(n){if(V.a.is(n)){let O=[];for(const S of n)if(S)try{S.dispose()}catch(C){O.push(C)}if(O.length===1)throw O[0];if(O.length>1)throw new E(O);return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function u(...n){const O=a(()=>m(n));return r(n,O),O}function a(n){const O=L({dispose:Object(Z.a)(()=>{W(O),n()})});return O}class o{constructor(){this._toDispose=new Set,this._isDisposed=!1,L(this)}dispose(){if(this._isDisposed)return;W(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?o.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}}o.DISABLE_DISPOSED_WARNING=!1;class c{constructor(){this._store=new o,L(this),k(this._store,this)}dispose(){W(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,L(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,W(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(jt,_e,D){var Z,V;(function(){var I;(function(){"use strict";var W=[,,function(E){function p(a){this.__parent=a,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=[]}p.prototype.clone_empty=function(){var a=new p(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},p.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},p.prototype.has_match=function(a){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(a))return!0;return!1},p.prototype.set_indent=function(a,o){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(a){this.__items.push(a);var o=a.lastIndexOf(`
`);o!==-1?this.__character_count=a.length-o:this.__character_count+=a.length},p.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function m(a,o){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),o=o||"",a.indent_level>0&&(o=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(a,o){var c=this.__base_string_length;return o=o||0,a<0&&(c=0),c+=a*this.__indent_size,c+=o,c},m.prototype.get_indent_string=function(a,o){var c=this.__base_string;return o=o||0,a<0&&(a=0,c=""),o+=a*this.__indent_size,this.__ensure_cache(o),c+=this.__cache[o],c},m.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var a=this.__cache.length,o=0,c="";this.__indent_size&&a>=this.__indent_size&&(o=Math.floor(a/this.__indent_size),a-=o*this.__indent_size,c=new Array(o+1).join(this.__indent_string)),a&&(c+=new Array(a+1).join(" ")),this.__cache.push(c)};function u(a,o){this.__indent_cache=new m(a,o),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(a,o){return this.__indent_cache.get_indent_string(a,o)},u.prototype.get_indent_size=function(a,o){return this.__indent_cache.get_indent_size(a,o)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(a){this.trim(!0);var o=this.current_line.pop();o&&(o[o.length-1]===`
`&&(o=o.replace(/\n+$/g,"")),this.current_line.push(o)),this._end_with_newline&&this.__add_outputline();var c=this.__lines.join(`
`);return a!==`
`&&(c=c.replace(/[\n]/g,a)),c},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(a,o){return a=a||0,o=o||0,this.next_line.set_indent(a,o),this.__lines.length>1?(this.current_line.set_indent(a,o),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(a){for(var o=0;o<a.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},u.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},u.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(" "))},u.prototype.remove_indent=function(a){for(var o=this.__lines.length;a<o;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},u.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(a,o){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(a)!==0&&s.item(-1)!==o){this.__lines.splice(c+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},E.exports.Output=u},function(E){function p(m,u,a,o){this.type=m,this.text=u,this.comments_before=null,this.newlines=a||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}E.exports.Token=p},,,function(E){function p(a,o){this.raw_options=m(a,o),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(a,o){var c=this.raw_options[a],s=o||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},p.prototype._get_boolean=function(a,o){var c=this.raw_options[a],s=c===void 0?!!o:!!c;return s},p.prototype._get_characters=function(a,o){var c=this.raw_options[a],s=o||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},p.prototype._get_number=function(a,o){var c=this.raw_options[a];o=parseInt(o,10),isNaN(o)&&(o=0);var s=parseInt(c,10);return isNaN(s)&&(s=o),s},p.prototype._get_selection=function(a,o,c){var s=this._get_selection_list(a,o,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[a]+"'");return s[0]},p.prototype._get_selection_list=function(a,o,c){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[o[0]],!this._is_valid_selection(c,o))throw new Error("Invalid Default Value!");var s=this._get_array(a,c);if(!this._is_valid_selection(s,o))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[a]+"'");return s},p.prototype._is_valid_selection=function(a,o){return a.length&&o.length&&!a.some(function(c){return o.indexOf(c)===-1})};function m(a,o){var c={};a=u(a);var s;for(s in a)s!==o&&(c[s]=a[s]);if(o&&a[o])for(s in a[o])c[s]=a[o][s];return c}function u(a){var o={},c;for(c in a){var s=c.replace(/-/g,"_");o[s]=a[c]}return o}E.exports.Options=p,E.exports.normalizeOpts=u,E.exports.mergeOpts=m},,function(E){var p=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",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 u=null;return this.hasNext()&&(u=this.__input.charAt(this.__position),this.__position+=1),u},m.prototype.peek=function(u){var a=null;return u=u||0,u+=this.__position,u>=0&&u<this.__input_length&&(a=this.__input.charAt(u)),a},m.prototype.__match=function(u,a){u.lastIndex=a;var o=u.exec(this.__input);return o&&!(p&&u.sticky)&&(o.index!==a&&(o=null)),o},m.prototype.test=function(u,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(u,a):!1},m.prototype.testChar=function(u,a){var o=this.peek(a);return u.lastIndex=0,o!==null&&u.test(o)},m.prototype.match=function(u){var a=this.__match(u,this.__position);return a?this.__position+=a[0].length:a=null,a},m.prototype.read=function(u,a,o){var c="",s;return u&&(s=this.match(u),s&&(c+=s[0])),a&&(s||!u)&&(c+=this.readUntil(a,o)),c},m.prototype.readUntil=function(u,a){var o="",c=this.__position;u.lastIndex=this.__position;var s=u.exec(this.__input);return s?(c=s.index,a&&(c+=s[0].length)):c=this.__input_length,o=this.__input.substring(this.__position,c),this.__position=c,o},m.prototype.readUntilAfter=function(u){return this.readUntil(u,!0)},m.prototype.get_regexp=function(u,a){var o=null,c="g";return a&&p&&(c="y"),typeof u=="string"&&u!==""?o=new RegExp(u,c):u&&(o=new RegExp(u.source,c)),o},m.prototype.get_literal_regexp=function(u){return RegExp(u.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(u){var a=this.__position,o=this.readUntilAfter(u);return this.__position=a,o},m.prototype.lookBack=function(u){var a=this.__position-1;return a>=u.length&&this.__input.substring(a-u.length,a).toLowerCase()===u},E.exports.InputScanner=m},function(E,p,m){var u=m(8).InputScanner,a=m(3).Token,o=m(10).TokenStream,c=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(n,O){this._input=new u(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 o,this._reset();for(var n,O=new a(s.START,""),S=null,C=[],R=new o;O.type!==s.EOF;){for(n=this._get_next_token(O,S);this._is_comment(n);)R.add(n),n=this._get_next_token(O,S);R.isEmpty()||(n.comments_before=R,R=new o),n.parent=S,this._is_opening(n)?(C.push(S),S=n):S&&this._is_closing(n,S)&&(n.opened=S,S.closed=n,S=C.pop(),n.parent=S),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 S=this._input.read(/.+/g);return S?this._create_token(s.RAW,S):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 S=new a(n,O,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},E.exports.Tokenizer=i,E.exports.TOKEN=s},function(E){function p(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},p.prototype.peek=function(m){var u=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(u=this.__tokens[m]),u},p.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},E.exports.TokenStream=p},function(E,p,m){var u=m(12).Pattern;function a(o,c){u.call(this,o,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new u,a.prototype.__set_whitespace_patterns=function(o,c){o+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var o=this._input.read(this._match_pattern);if(o===" ")this.whitespace_before_token=" ";else if(o){var c=this.__split(this._newline_regexp,o);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return o},a.prototype.matching=function(o,c){var s=this._create();return s.__set_whitespace_patterns(o,c),s._update(),s},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(o,c){o.lastIndex=0;for(var s=0,i=[],n=o.exec(c);n;)i.push(c.substring(s,n.index)),s=n.index+n[0].length,n=o.exec(c);return s<c.length?i.push(c.substring(s,c.length)):i.push(""),i},E.exports.WhitespacePattern=a},function(E){function p(m,u){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,u&&(this._starting_pattern=this._input.get_regexp(u._starting_pattern,!0),this._match_pattern=this._input.get_regexp(u._match_pattern,!0),this._until_pattern=this._input.get_regexp(u._until_pattern),this._until_after=u._until_after)}p.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},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(m){var u=this._create();return u._until_after=!0,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.until=function(m){var u=this._create();return u._until_after=!1,u._until_pattern=this._input.get_regexp(m),u._update(),u},p.prototype.starting_with=function(m){var u=this._create();return u._starting_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype.matching=function(m){var u=this._create();return u._match_pattern=this._input.get_regexp(m,!0),u._update(),u},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},E.exports.Pattern=p},function(E){function p(m,u){m=typeof m=="string"?m:m.source,u=typeof u=="string"?u:u.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+u,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+u,"g")}p.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var u={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(m);a;)u[a[1]]=a[2],a=this.__directive_pattern.exec(m);return u},p.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},E.exports.Directives=p},function(E,p,m){var u=m(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(c,s){u.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),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 u(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}/)}}o.prototype=new u,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(c){var s=this._create();return s._disabled[c]=!0,s._update(),s},o.prototype.read_options=function(c){var s=this._create();for(var i in a)s._disabled[i]=c.templating.indexOf(i)===-1;return s._update(),s},o.prototype.exclude=function(c){var s=this._create();return s._excluded[c]=!0,s._update(),s},o.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},o.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("|")+")")},o.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},E.exports.TemplatablePattern=o},,,,function(E,p,m){var u=m(19).Beautifier,a=m(20).Options;function o(c,s,i,n){var O=new u(c,s,i,n);return O.beautify()}E.exports=o,E.exports.defaultOptions=function(){return new a}},function(E,p,m){var u=m(20).Options,a=m(2).Output,o=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 a(_,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 x=0;x<g;x++)this.print_newline(x>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,x=_.next;x.type!==c.EOF&&_.closed!==x;){if(x.type===c.ATTRIBUTE&&x.text==="type"){x.next&&x.next.type===c.EQUALS&&x.next.next&&x.next.next.type===c.VALUE&&(g=x.next.next.text);break}x=x.next}return g},S=function(_,g){var x=null,N=null;return g.closed?(_==="script"?x="text/javascript":_==="style"&&(x="text/css"),x=O(g)||x,x.search("text/css")>-1?N="css":x.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":x.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":x.search(/test\/null/)>-1&&(N="null"),N):null};function C(_,g){return g.indexOf(_)!==-1}function R(_,g,x){this.parent=_||null,this.tag=g?g.tag_name:"",this.indent_level=x||0,this.parser_token=g||null}function T(_){this._printer=_,this._current_frame=null}T.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},T.prototype.record_tag=function(_){var g=new R(this._current_frame,_,this._printer.indent_level);this._current_frame=g},T.prototype._try_pop_frame=function(_){var g=null;return _&&(g=_.parser_token,this._printer.indent_level=_.indent_level,this._current_frame=_.parent),g},T.prototype._get_frame=function(_,g){for(var x=this._current_frame;x&&!(_.indexOf(x.tag)!==-1);){if(g&&g.indexOf(x.tag)!==-1){x=null;break}x=x.parent}return x},T.prototype.try_pop=function(_,g){var x=this._get_frame([_],g);return this._try_pop_frame(x)},T.prototype.indent_to_tag=function(_){var g=this._get_frame(_);g&&(this._printer.indent_level=g.indent_level)};function v(_,g,x,N){this._source_text=_||"",g=g||{},this._js_beautify=x,this._css_beautify=N,this._tag_stack=null;var F=new u(g,"html");this._options=F,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 x=_.match(/^[\t ]*/)[0],N={text:"",type:""},F=new b,A=new n(this._options,x),B=new o(_,this._options).tokenize();this._tag_stack=new T(A);for(var U=null,w=B.next();w.type!==c.EOF;)w.type===c.TAG_OPEN||w.type===c.COMMENT?(U=this._handle_tag_open(A,w,F,N),F=U):w.type===c.ATTRIBUTE||w.type===c.EQUALS||w.type===c.VALUE||w.type===c.TEXT&&!F.tag_complete?U=this._handle_inside_tag(A,w,F,B):w.type===c.TAG_CLOSE?U=this._handle_tag_close(A,w,F):w.type===c.TEXT?U=this._handle_text(A,w,F):A.add_raw_token(w),N=U,w=B.next();var Y=A._output.get_code(g);return Y},v.prototype._handle_tag_close=function(_,g,x){var N={text:g.text,type:g.type};return _.alignment_size=0,x.tag_complete=!0,_.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),x.is_unformatted?_.add_raw_token(g):(x.tag_start_char==="<"&&(_.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&x.has_wrapped_attrs&&_.print_newline(!1)),_.print_token(g)),x.indent_content&&!(x.is_unformatted||x.is_content_unformatted)&&(_.indent(),x.indent_content=!1),!x.is_inline_element&&!(x.is_unformatted||x.is_content_unformatted)&&_.set_wrap_point(),N},v.prototype._handle_inside_tag=function(_,g,x,N){var F=x.has_wrapped_attrs,A={text:g.text,type:g.type};if(_.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),x.is_unformatted)_.add_raw_token(g);else if(x.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),x.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&&x.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(_.traverse_whitespace(g),F=F||g.newlines!==0),this._is_wrap_attributes_force)){var B=x.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&x.attr_count===1){var U=!0,w=0,Y;do{if(Y=N.peek(w),Y.type===c.ATTRIBUTE){U=!1;break}w+=1}while(w<4&&Y.type!==c.EOF&&Y.type!==c.TAG_CLOSE);B=!U}B&&(_.print_newline(!1),F=!0)}_.print_token(g),F=F||_.previous_token_wrapped(),x.has_wrapped_attrs=F}return A},v.prototype._handle_text=function(_,g,x){var N={text:g.text,type:"TK_CONTENT"};return x.custom_beautifier_name?this._print_custom_beatifier_text(_,g,x):x.is_unformatted||x.is_content_unformatted?_.add_raw_token(g):(_.traverse_whitespace(g),_.print_token(g)),N},v.prototype._print_custom_beatifier_text=function(_,g,x){var N=this;if(g.text!==""){var F=g.text,A,B=1,U="",w="";x.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?A=this._js_beautify:x.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?A=this._css_beautify:x.custom_beautifier_name==="html"&&(A=function(Te,We){var $e=new v(Te,We,N._js_beautify,N._css_beautify);return $e.beautify()}),this._options.indent_scripts==="keep"?B=0:this._options.indent_scripts==="separate"&&(B=-_.indent_level);var Y=_.get_full_indent(B);if(F=F.replace(/\n[ \t]*$/,""),x.custom_beautifier_name!=="html"&&F[0]==="<"&&F.match(/^(<!--|<!\[CDATA\[)/)){var q=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(F);if(!q){_.add_raw_token(g);return}U=Y+q[1]+`
`,F=q[4],q[5]&&(w=Y+q[5]),F=F.replace(/\n[ \t]*$/,""),(q[2]||q[3].indexOf(`
`)!==-1)&&(q=q[3].match(/[ \t]+$/),q&&(g.whitespace_before=q[0]))}if(F)if(A){var ce=function(){this.eol=`
`};ce.prototype=this._options.raw_options;var Ee=new ce;F=A(Y+F,Ee)}else{var Qe=g.whitespace_before;Qe&&(F=F.replace(new RegExp(`
(`+Qe+")?","g"),`
`)),F=Y+F.replace(/\n/g,`
`+Y)}U&&(F?F=U+F+`
`+w:F=U+w),_.print_newline(!1),F&&(g.text=F,g.whitespace_before="",g.newlines=0,_.add_raw_token(g),_.print_newline(!0))}},v.prototype._handle_tag_open=function(_,g,x,N){var F=this._get_tag_open_token(g);return(x.is_unformatted||x.is_content_unformatted)&&!x.is_empty_element&&g.type===c.TAG_OPEN&&g.text.indexOf("</")===0?(_.add_raw_token(g),F.start_tag_token=this._tag_stack.try_pop(F.tag_name)):(_.traverse_whitespace(g),this._set_tag_position(_,g,F,x,N),F.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)&&(F.alignment_size=g.text.length+1),!F.tag_complete&&!F.is_unformatted&&(_.alignment_size=F.alignment_size),F};var b=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 x;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(x=g.text.match(/^<([^\s>]*)/),this.tag_check=x?x[1]:""):(x=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=x?x[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 N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};v.prototype._get_tag_open_token=function(_){var g=new b(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,x,N,F){if(x.is_empty_element||(x.is_end_tag?x.start_tag_token=this._tag_stack.try_pop(x.tag_name):(this._do_optional_end_element(x)&&(x.is_inline_element||_.print_newline(!1)),this._tag_stack.record_tag(x),(x.tag_name==="script"||x.tag_name==="style")&&!(x.is_unformatted||x.is_content_unformatted)&&(x.custom_beautifier_name=S(x.tag_check,g)))),C(x.tag_check,this._options.extra_liners)&&(_.print_newline(!1),_._output.just_added_blankline()||_.print_newline(!0)),x.is_empty_element){if(x.tag_start_char==="{"&&x.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),x.indent_content=!0;var A=_.current_line_has_match(/{{#if/);A||_.print_newline(!1)}x.tag_name==="!--"&&F.type===c.TAG_CLOSE&&N.is_end_tag&&x.text.indexOf(`
`)===-1||(x.is_inline_element||x.is_unformatted||_.print_newline(!1),this._calcluate_parent_multiline(_,x))}else if(x.is_end_tag){var B=!1;B=x.start_tag_token&&x.start_tag_token.multiline_content,B=B||!x.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(F.type===c.TAG_CLOSE&&x.start_tag_token===N)&&F.type!=="TK_CONTENT",(x.is_content_unformatted||x.is_unformatted)&&(B=!1),B&&_.print_newline(!1)}else x.indent_content=!x.custom_beautifier_name,x.tag_start_char==="<"&&(x.tag_name==="html"?x.indent_content=this._options.indent_inner_html:x.tag_name==="head"?x.indent_content=this._options.indent_head_inner_html:x.tag_name==="body"&&(x.indent_content=this._options.indent_body_inner_html)),!(x.is_inline_element||x.is_unformatted)&&(F.type!=="TK_CONTENT"||x.is_content_unformatted)&&_.print_newline(!1),this._calcluate_parent_multiline(_,x)},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 f=["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"],h=["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"&&f.indexOf(_.tag_name)!==-1){var x=_.parent.parent;(!x||h.indexOf(x.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},E.exports.Beautifier=v},function(E,p,m){var u=m(6).Options;function a(o){u.call(this,o,"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"])}a.prototype=new u,E.exports.Options=a},function(E,p,m){var u=m(9).Tokenizer,a=m(9).TOKEN,o=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:a.START,RAW:a.RAW,EOF:a.EOF},n=new o(/<\!--/,/-->/),O=function(S,C){u.call(this,S,C),this._current_tag_name="";var R=new c(this._input).read_options(this._options),T=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:T.starting_with(/{{!--/).until_after(/--}}/),handlebars:T.starting_with(/{{/).until_after(/}}/),handlebars_open:T.until(/[\n\r\t }]/),handlebars_raw_close:T.until(/}}/),comment:T.starting_with(/<!--/).until_after(/-->/),cdata:T.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:T.starting_with(/<!\[/).until_after(/]>/),processing:T.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=T.matching(v).until_after(v)}};O.prototype=new u,O.prototype._is_comment=function(S){return!1},O.prototype._is_opening=function(S){return S.type===i.TAG_OPEN},O.prototype._is_closing=function(S,C){return S.type===i.TAG_CLOSE&&C&&((S.text===">"||S.text==="/>")&&C.text[0]==="<"||S.text==="}}"&&C.text[0]==="{"&&C.text[1]==="{")},O.prototype._reset=function(){this._current_tag_name=""},O.prototype._get_next_token=function(S,C){var R=null;this._readWhitespace();var T=this._input.peek();return T===null?this._create_token(i.EOF,""):(R=R||this._read_open_handlebars(T,C),R=R||this._read_attribute(T,S,C),R=R||this._read_close(T,C),R=R||this._read_raw_content(T,S,C),R=R||this._read_content_word(T),R=R||this._read_comment_or_cdata(T),R=R||this._read_processing(T),R=R||this._read_open(T,C),R=R||this._create_token(i.UNKNOWN,this._input.next()),R)},O.prototype._read_comment_or_cdata=function(S){var C=null,R=null,T=null;if(S==="<"){var v=this._input.peek(1);v==="!"&&(R=this.__patterns.comment.read(),R?(T=n.get_directives(R),T&&T.ignore==="start"&&(R+=n.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(C=this._create_token(i.COMMENT,R),C.directives=T)}return C},O.prototype._read_processing=function(S){var C=null,R=null,T=null;if(S==="<"){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=T)}return C},O.prototype._read_open=function(S,C){var R=null,T=null;return C||S==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),T=this._create_token(i.TAG_OPEN,R)),T},O.prototype._read_open_handlebars=function(S,C){var R=null,T=null;return C||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),T=this._create_token(i.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),T=this._create_token(i.TAG_OPEN,R))),T},O.prototype._read_close=function(S,C){var R=null,T=null;return C&&(C.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(R=this._input.next(),S==="/"&&(R+=this._input.next()),T=this._create_token(i.TAG_CLOSE,R)):C.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),T=this._create_token(i.TAG_CLOSE,"}}"))),T},O.prototype._read_attribute=function(S,C,R){var T=null,v="";if(R&&R.text[0]==="<")if(S==="=")T=this._create_token(i.EQUALS,this._input.next());else if(S==='"'||S==="'"){var b=this._input.next();S==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),T=this._create_token(i.VALUE,b)}else v=this.__patterns.attribute.read(),v&&(C.type===i.EQUALS?T=this._create_token(i.VALUE,v):T=this._create_token(i.ATTRIBUTE,v));return T},O.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},O.prototype._read_raw_content=function(S,C,R){var T="";if(R&&R.text[0]==="{")T=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 b=this._read_comment_or_cdata(S);if(b)return b.type=i.TEXT,b;T=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(v)&&(T=this._input.readUntil(new RegExp("</"+v+"[\\n\\r\\t ]*?>","ig")))}return T?this._create_token(i.TEXT,T):null},O.prototype._read_content_word=function(S){var C="";if(this._options.unformatted_content_delimiter&&(S===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)},E.exports.Tokenizer=O,E.exports.TOKEN=i}],k={};function r(E){var p=k[E];if(p!==void 0)return p.exports;var m=k[E]={exports:{}};return W[E](m,m.exports,r),m.exports}var M=r(18);I=M})();var G=I;if(!0)!(Z=[D,D("6UM0"),D("TXwP")],V=function(W){var k=D("6UM0"),r=D("TXwP");return{html_beautify:function(M,E){return G(M,E,k.js_beautify,r.css_beautify)}}}.apply(_e,Z),V!==void 0&&(jt.exports=V));else var P,L})()},"rAM+":function(jt,_e,D){"use strict";D.d(_e,"a",function(){return V});var Z=D("Qw5x");function V(I,G){var P;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(P=Object(Z.a)(I))||G&&I&&typeof I.length=="number"){P&&(I=P);var L=0,W=function(){};return{s:W,n:function(){return L>=I.length?{done:!0}:{done:!1,value:I[L++]}},e:function(p){throw p},f:W}}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=I[Symbol.iterator]()},n:function(){var p=P.next();return k=p.done,p},e:function(p){r=!0,M=p},f:function(){try{!k&&P.return!=null&&P.return()}finally{if(r)throw M}}}}},rUJ1:function(jt,_e){const D=/[&<>"']/,Z=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,I=/[<>"']|&(?!#?\w+;)/g,G={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=T=>G[T];function L(T,v){if(v){if(D.test(T))return T.replace(Z,P)}else if(V.test(T))return T.replace(I,P);return T}const W=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function k(T){return T.replace(W,(v,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const r=/(^|[^\[])\^/g;function M(T,v){T=T.source||T,v=v||"";const b={replace:(f,h)=>(h=h.source||h,h=h.replace(r,"$1"),T=T.replace(f,h),b),getRegex:()=>new RegExp(T,v)};return b}const E=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(T,v,b){if(T){let f;try{f=decodeURIComponent(k(b)).replace(E,"").toLowerCase()}catch(h){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}v&&!p.test(b)&&(b=s(v,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(f){return null}return b}const u={},a=/^[^:]+:\/*[^/]*$/,o=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function s(T,v){u[" "+T]||(a.test(T)?u[" "+T]=T+"/":u[" "+T]=S(T,"/",!0)),T=u[" "+T];const b=T.indexOf(":")===-1;return v.substring(0,2)==="//"?b?v:T.replace(o,"$1")+v:v.charAt(0)==="/"?b?v:T.replace(c,"$1")+v:T+v}const i={exec:function(){}};function n(T){let v=1,b,f;for(;v<arguments.length;v++){b=arguments[v];for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(T[f]=b[f])}return T}function O(T,v){const b=T.replace(/\|/g,(_,g,x)=>{let N=!1,F=g;for(;--F>=0&&x[F]==="\\";)N=!N;return N?"|":" |"}),f=b.split(/ \|/);let h=0;if(f.length>v)f.splice(v);else for(;f.length<v;)f.push("");for(;h<f.length;h++)f[h]=f[h].trim().replace(/\\\|/g,"|");return f}function S(T,v,b){const f=T.length;if(f===0)return"";let h=0;for(;h<f;){const _=T.charAt(f-h-1);if(_===v&&!b)h++;else if(_!==v&&b)h++;else break}return T.substr(0,f-h)}function C(T,v){if(T.indexOf(v[1])===-1)return-1;const b=T.length;let f=0,h=0;for(;h<b;h++)if(T[h]==="\\")h++;else if(T[h]===v[0])f++;else if(T[h]===v[1]&&(f--,f<0))return h;return-1}function R(T){T&&T.sanitize&&!T.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")}jt.exports={escape:L,unescape:k,edit:M,cleanUrl:m,resolveUrl:s,noopTest:i,merge:n,splitCells:O,rtrim:S,findClosingBracket:C,checkSanitizeDeprecation:R}},sR1s:function(jt,_e,D){"use strict";D.d(_e,"b",function(){return G}),D.d(_e,"a",function(){return P}),D.d(_e,"c",function(){return L}),D.d(_e,"d",function(){return W});var Z=D("U8pU"),V="RC_TABLE_KEY";function I(k){return k==null?[]:Array.isArray(k)?k:[k]}function G(k,r){if(!r&&typeof r!="number")return k;for(var M=I(r),E=k,p=0;p<M.length;p+=1){if(!E)return null;var m=M[p];E=E[m]}return E}function P(k){var r=[],M={};return k.forEach(function(E){for(var p=E||{},m=p.key,u=p.dataIndex,a=m||I(u).join("-")||V;M[a];)a="".concat(a,"_next");M[a]=!0,r.push(a)}),r}function L(){var k={};function r(m,u){u&&Object.keys(u).forEach(function(a){var o=u[a];o&&Object(Z.a)(o)==="object"?(m[a]=m[a]||{},r(m[a],o)):m[a]=o})}for(var M=arguments.length,E=new Array(M),p=0;p<M;p++)E[p]=arguments[p];return E.forEach(function(m){r(k,m)}),k}function W(k){return k!=null}},sboe:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return I});var Z=D("q1tI"),V=D.n(Z),I=Z.createContext(null)},t23M:function(jt,_e,D){"use strict";var Z=D("VTBJ"),V=D("1OyB"),I=D("vuIU"),G=D("Ji7U"),P=D("LK+K"),L=D("q1tI"),W=D.n(L),k=D("m+aA"),r=D("Zm9Q"),M=D("Kwbf"),E=D("c+Xe"),p=D("bdgK"),m="rc-observer-key",u=function(a){Object(G.a)(c,a);var o=Object(P.a)(c);function c(){var s;return Object(V.a)(this,c),s=o.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,S=O.getBoundingClientRect(),C=S.width,R=S.height,T=O.offsetWidth,v=O.offsetHeight,b=Math.floor(C),f=Math.floor(R);if(s.state.width!==b||s.state.height!==f||s.state.offsetWidth!==T||s.state.offsetHeight!==v){var h={width:b,height:f,offsetWidth:T,offsetHeight:v};s.setState(h),n&&Promise.resolve().then(function(){n(Object(Z.a)(Object(Z.a)({},h),{},{offsetWidth:T,offsetHeight:v}))})}},s.setChildNode=function(i){s.childNode=i},s}return Object(I.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 p.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(L.isValidElement(O)&&Object(E.c)(O)){var S=O.ref;n[0]=L.cloneElement(O,{ref:Object(E.a)(S,this.setChildNode)})}return n.length===1?n[0]:n.map(function(C,R){return!L.isValidElement(C)||"key"in C&&C.key!==null?C:L.cloneElement(C,{key:"".concat(m,"-").concat(R)})})}}]),c}(L.Component);u.displayName="ResizeObserver",_e.a=u},t9D7:function(jt,_e,D){"use strict";D.d(_e,"b",function(){return W}),D.d(_e,"g",function(){return r}),D.d(_e,"d",function(){return M}),D.d(_e,"e",function(){return E}),D.d(_e,"a",function(){return p}),D.d(_e,"f",function(){return a}),D.d(_e,"c",function(){return o});var Z=D("Vhoy"),V=D("MI8n"),I=D("pmY6"),G=D("Cg/j"),P=D("ic2d"),L=D("nEHx");const W=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 T=i.exec(R);if(!T)return;let[,v]=T;return{id:v}}c.fromString=n;function O(R,T){let v=R.id;const b=v.lastIndexOf("~");return b!==-1&&(v=v.substring(0,b)),T&&(v=`${v}~${T}`),{id:v}}c.modify=O;function S(R,T){var v,b;return R.id===T.id&&((v=R.color)===null||v===void 0?void 0:v.id)===((b=T.color)===null||b===void 0?void 0:b.id)}c.isEqual=S;function C(R,T){return{id:R.id,color:T?r(T):void 0}}c.asThemeIcon=C,c.asClassNameArray=Z.a.asClassNameArray,c.asClassName=Z.a.asClassName,c.asCSSSelector=Z.a.asCSSSelector})(M||(M={}));function E(c){switch(c){case L.a.DARK:return"vs-dark";case L.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={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(I.i)(()=>{const s=this.themingParticipants.indexOf(c);this.themingParticipants.splice(s,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;P.a.add(p.ThemingContribution,u);function a(c){return u.onColorThemeChange(c)}class o extends I.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(jt,_e,D){typeof window!="undefined"&&function(V,I){jt.exports=I()}(this,function(){return function(Z){var V={};function I(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,I),P.l=!0,P.exports}return I.m=Z,I.c=V,I.d=function(G,P,L){I.o(G,P)||Object.defineProperty(G,P,{enumerable:!0,get:L})},I.r=function(G){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(G,"__esModule",{value:!0})},I.t=function(G,P){if(P&1&&(G=I(G)),P&8)return G;if(P&4&&typeof G=="object"&&G&&G.__esModule)return G;var L=Object.create(null);if(I.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:G}),P&2&&typeof G!="string")for(var W in G)I.d(L,W,function(k){return G[k]}.bind(null,W));return L},I.n=function(G){var P=G&&G.__esModule?function(){return G.default}:function(){return G};return I.d(P,"a",P),P},I.o=function(G,P){return Object.prototype.hasOwnProperty.call(G,P)},I.p="/dist/",I(I.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(Z,V,I){"use strict";var G=Object.prototype.hasOwnProperty,P="~";function L(){}Object.create&&(L.prototype=Object.create(null),new L().__proto__||(P=!1));function W(E,p,m){this.fn=E,this.context=p,this.once=m||!1}function k(E,p,m,u,a){if(typeof m!="function")throw new TypeError("The listener must be a function");var o=new W(m,u||E,a),c=P?P+p:p;return E._events[c]?E._events[c].fn?E._events[c]=[E._events[c],o]:E._events[c].push(o):(E._events[c]=o,E._eventsCount++),E}function r(E,p){--E._eventsCount===0?E._events=new L:delete E._events[p]}function M(){this._events=new L,this._eventsCount=0}M.prototype.eventNames=function(){var p=[],m,u;if(this._eventsCount===0)return p;for(u in m=this._events)G.call(m,u)&&p.push(P?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},M.prototype.listeners=function(p){var m=P?P+p:p,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var a=0,o=u.length,c=new Array(o);a<o;a++)c[a]=u[a].fn;return c},M.prototype.listenerCount=function(p){var m=P?P+p:p,u=this._events[m];return u?u.fn?1:u.length:0},M.prototype.emit=function(p,m,u,a,o,c){var s=P?P+p:p;if(!this._events[s])return!1;var i=this._events[s],n=arguments.length,O,S;if(i.fn){i.once&&this.removeListener(p,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,u),!0;case 4:return i.fn.call(i.context,m,u,a),!0;case 5:return i.fn.call(i.context,m,u,a,o),!0;case 6:return i.fn.call(i.context,m,u,a,o,c),!0}for(S=1,O=new Array(n-1);S<n;S++)O[S-1]=arguments[S];i.fn.apply(i.context,O)}else{var C=i.length,R;for(S=0;S<C;S++){i[S].once&&this.removeListener(p,i[S].fn,void 0,!0);switch(n){case 1:i[S].fn.call(i[S].context);break;case 2:i[S].fn.call(i[S].context,m);break;case 3:i[S].fn.call(i[S].context,m,u);break;case 4:i[S].fn.call(i[S].context,m,u,a);break;default:if(!O)for(R=1,O=new Array(n-1);R<n;R++)O[R-1]=arguments[R];i[S].fn.apply(i[S].context,O)}}}return!0},M.prototype.on=function(p,m,u){return k(this,p,m,u,!1)},M.prototype.once=function(p,m,u){return k(this,p,m,u,!0)},M.prototype.removeListener=function(p,m,u,a){var o=P?P+p:p;if(!this._events[o])return this;if(!m)return r(this,o),this;var c=this._events[o];if(c.fn)c.fn===m&&(!a||c.once)&&(!u||c.context===u)&&r(this,o);else{for(var s=0,i=[],n=c.length;s<n;s++)(c[s].fn!==m||a&&!c[s].once||u&&c[s].context!==u)&&i.push(c[s]);i.length?this._events[o]=i.length===1?i[0]:i:r(this,o)}return this},M.prototype.removeAllListeners=function(p){var m;return p?(m=P?P+p:p,this._events[m]&&r(this,m)):(this._events=new L,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,I){(function(G){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,L=/^([^\/?#]*)([^]*)$/,W=/(?:\/|^)\.(?=\/)/g,k=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(M,E,p){if(p=p||{},M=M.trim(),E=E.trim(),!E){if(!p.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 u=r.parseURL(E);if(!u)throw new Error("Error trying to parse relative URL.");if(u.scheme)return p.alwaysNormalize?(u.path=r.normalizePath(u.path),r.buildURLFromParts(u)):E;var a=r.parseURL(M);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var o=L.exec(a.path);a.netLoc=o[1],a.path=o[2]}a.netLoc&&!a.path&&(a.path="/");var c={scheme:a.scheme,netLoc:u.netLoc,path:null,params:u.params,query:u.query,fragment:u.fragment};if(!u.netLoc&&(c.netLoc=a.netLoc,u.path[0]!=="/"))if(!u.path)c.path=a.path,u.params||(c.params=a.params,u.query||(c.query=a.query));else{var s=a.path,i=s.substring(0,s.lastIndexOf("/")+1)+u.path;c.path=r.normalizePath(i)}return c.path===null&&(c.path=p.alwaysNormalize?r.normalizePath(u.path):u.path),r.buildURLFromParts(c)},parseURL:function(M){var E=P.exec(M);return E?{scheme:E[1]||"",netLoc:E[2]||"",path:E[3]||"",params:E[4]||"",query:E[5]||"",fragment:E[6]||""}:null},normalizePath:function(M){for(M=M.split("").reverse().join("").replace(W,"");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,I){function G(p){var m={};function u(o){if(m[o])return m[o].exports;var c=m[o]={i:o,l:!1,exports:{}};return p[o].call(c.exports,c,c.exports,u),c.l=!0,c.exports}u.m=p,u.c=m,u.i=function(o){return o},u.d=function(o,c,s){u.o(o,c)||Object.defineProperty(o,c,{configurable:!1,enumerable:!0,get:s})},u.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},u.n=function(o){var c=o&&o.__esModule?function(){return o.default}:function(){return o};return u.d(c,"a",c),c},u.o=function(o,c){return Object.prototype.hasOwnProperty.call(o,c)},u.p="/",u.oe=function(o){throw console.error(o),o};var a=u(u.s=ENTRY_MODULE);return a.default||a}var P="[\\.|\\-|\\+|\\w|/|@]+",L="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function W(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function k(p){return!isNaN(1*p)}function r(p,m,u){var a={};a[u]=[];var o=m.toString(),c=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!c)return a;for(var s=c[1],i=new RegExp("(\\\\n|\\W)"+W(s)+L,"g"),n;n=i.exec(o);){if(n[3]==="dll-reference")continue;a[u].push(n[3])}for(i=new RegExp("\\("+W(s)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+L,"g");n=i.exec(o);)p[n[2]]||(a[u].push(n[1]),p[n[2]]=I(n[1]).m),a[n[2]]=a[n[2]]||[],a[n[2]].push(n[4]);for(var O=Object.keys(a),S=0;S<O.length;S++)for(var C=0;C<a[O[S]].length;C++)k(a[O[S]][C])&&(a[O[S]][C]=1*a[O[S]][C]);return a}function M(p){var m=Object.keys(p);return m.reduce(function(u,a){return u||p[a].length>0},!1)}function E(p,m){for(var u={main:[m]},a={main:[]},o={main:{}};M(u);)for(var c=Object.keys(u),s=0;s<c.length;s++){var i=c[s],n=u[i],O=n.pop();if(o[i]=o[i]||{},o[i][O]||!p[i][O])continue;o[i][O]=!0,a[i]=a[i]||[],a[i].push(O);for(var S=r(p,p[i][O],i),C=Object.keys(S),R=0;R<C.length;R++)u[C[R]]=u[C[R]]||[],u[C[R]]=u[C[R]].concat(S[C[R]])}return a}Z.exports=function(p,m){m=m||{};var u={main:I.m},a=m.all?{main:Object.keys(u.main)}:E(u,p),o="";Object.keys(a).filter(function(O){return O!=="main"}).forEach(function(O){for(var S=0;a[O][S];)S++;a[O].push(S),u[O][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",o=o+"var "+O+" = ("+G.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+a[O].map(function(C){return""+JSON.stringify(C)+": "+u[O][C].toString()}).join(",")+`});
`}),o=o+"new (("+G.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+a.main.map(function(O){return""+JSON.stringify(O)+": "+u.main[O].toString()}).join(",")+"}))(self);";var c=new window.Blob([o],{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,I){"use strict";I.r(V),I.d(V,"hlsDefaultConfig",function(){return R}),I.d(V,"mergeConfig",function(){return v}),I.d(V,"enableStreamingMode",function(){return b});var G=I("./src/controller/abr-controller.ts"),P=I("./src/controller/audio-stream-controller.ts"),L=I("./src/controller/audio-track-controller.ts"),W=I("./src/controller/subtitle-stream-controller.ts"),k=I("./src/controller/subtitle-track-controller.ts"),r=I("./src/controller/buffer-controller.ts"),M=I("./src/controller/timeline-controller.ts"),E=I("./src/controller/cap-level-controller.ts"),p=I("./src/controller/fps-controller.ts"),m=I("./src/controller/eme-controller.ts"),u=I("./src/controller/cmcd-controller.ts"),a=I("./src/utils/xhr-loader.ts"),o=I("./src/utils/fetch-loader.ts"),c=I("./src/utils/cues.ts"),s=I("./src/utils/mediakeys-helper.ts"),i=I("./src/utils/logger.ts");function n(){return n=Object.assign||function(f){for(var h=1;h<arguments.length;h++){var _=arguments[h];for(var g in _)Object.prototype.hasOwnProperty.call(_,g)&&(f[g]=_[g])}return f},n.apply(this,arguments)}function O(f,h){var _=Object.keys(f);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(f);h&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(f,x).enumerable})),_.push.apply(_,g)}return _}function S(f){for(var h=1;h<arguments.length;h++){var _=arguments[h]!=null?arguments[h]:{};h%2?O(Object(_),!0).forEach(function(g){C(f,g,_[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(_)):O(Object(_)).forEach(function(g){Object.defineProperty(f,g,Object.getOwnPropertyDescriptor(_,g))})}return f}function C(f,h,_){return h in f?Object.defineProperty(f,h,{value:_,enumerable:!0,configurable:!0,writable:!0}):f[h]=_,f}var R=S(S({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:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:G.default,bufferController:r.default,capLevelController:E.default,fpsController:p.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},T()),{},{subtitleStreamController:W.SubtitleStreamController,subtitleTrackController:k.default,timelineController:M.TimelineController,audioStreamController:P.default,audioTrackController:L.default,emeController:m.default,cmcdController:u.default});function T(){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(f,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return n({},f,h)}function b(f){var h=f.loader;if(h!==o.default&&h!==a.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),f.progressive=!1;else{var _=Object(o.fetchSupported)();_&&(f.loader=o.default,f.progressive=!0,f.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/polyfills/number.ts"),P=I("./src/utils/ewma-bandwidth-estimator.ts"),L=I("./src/events.ts"),W=I("./src/utils/buffer-helper.ts"),k=I("./src/errors.ts"),r=I("./src/types/loader.ts"),M=I("./src/utils/logger.ts");function E(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function p(u,a,o){return a&&E(u.prototype,a),o&&E(u,o),u}var m=function(){function u(o){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=o;var c=o.config;this.bwEstimator=new P.default(c.abrEwmaSlowVoD,c.abrEwmaFastVoD,c.abrEwmaDefaultEstimate),this.registerListeners()}var a=u.prototype;return a.registerListeners=function(){var c=this.hls;c.on(L.Events.FRAG_LOADING,this.onFragLoading,this),c.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(L.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var c=this.hls;c.off(L.Events.FRAG_LOADING,this.onFragLoading,this),c.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),c.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this),c.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(L.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.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)}},a.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)},a._abandonRulesCheck=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,O=i.config,S=i.media;if(!c||!S)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||S.paused||!S.playbackRate||!S.readyState)return;var T=performance.now()-C.loading.start,v=Math.abs(S.playbackRate);if(T<=500*R/v)return;var b=i.levels,f=i.minAutoLevel,h=b[c.level],_=C.total||Math.max(C.loaded,Math.round(R*h.maxBitrate/8)),g=Math.max(1,C.bwEstimate?C.bwEstimate/8:C.loaded*1e3/T),x=(_-C.loaded)/g,N=S.currentTime,F=(W.BufferHelper.bufferInfo(S,N,O.maxBufferHole).end-N)/v;if(F>=2*R/v||x<=F)return;var A=Number.POSITIVE_INFINITY,B;for(B=c.level-1;B>f;B--){var U=b[B].maxBitrate;if(A=R*U/(8*.8*g),A<F)break}if(A>=x)return;var w=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 "+B+`
Current BW estimate: `+(Object(G.isFiniteNumber)(w)?(w/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+x.toFixed(3)+` s
Estimated load time for the next fragment: `+A.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),i.nextLoadLevel=B,this.bwEstimator.sample(T,C.loaded),this.clearTimer(),c.loader&&(this.fragCurrent=this.partCurrent=null,c.loader.abort()),i.trigger(L.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,part:s,stats:C})},a.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,S=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,T=(C.loaded?C.loaded.duration:0)+S;C.loaded={bytes:R,duration:T},C.realBitrate=Math.round(8*R/T)}if(i.bitrateTest){var v={stats:O,frag:i,part:n,id:i.type};this.onFragBuffered(L.Events.FRAG_BUFFERED,v),i.bitrateTest=!1}}},a.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 S=O.parsing.end-O.loading.start;this.bwEstimator.sample(S,O.loaded),O.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},a.onError=function(c,s){switch(s.details){case k.ErrorDetails.FRAG_LOAD_ERROR:case k.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var c=this.fragCurrent,s=this.partCurrent,i=this.hls,n=i.maxAutoLevel,O=i.config,S=i.minAutoLevel,C=i.media,R=s?s.duration:c?c.duration:0,T=C?C.currentTime:0,v=C&&C.playbackRate!==0?Math.abs(C.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():O.abrEwmaDefaultEstimate,f=(W.BufferHelper.bufferInfo(C,T,O.maxBufferHole).end-T)/v,h=this.findBestLevel(b,S,n,f,O.abrBandWidthFactor,O.abrBandWidthUpFactor);if(h>=0)return h;M.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var _=R?Math.min(R,O.maxStarvationDelay):O.maxStarvationDelay,g=O.abrBandWidthFactor,x=O.abrBandWidthUpFactor;if(!f){var N=this.bitrateTestDelay;if(N){var F=R?Math.min(R,O.maxLoadingDelay):O.maxLoadingDelay;_=F-N,M.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*_)+" ms"),g=x=1}}return h=this.findBestLevel(b,S,n,f+_,g,x),Math.max(h,0)},a.findBestLevel=function(c,s,i,n,O,S){for(var C,R=this.fragCurrent,T=this.partCurrent,v=this.lastLoadedFragLevel,b=this.hls.levels,f=b[v],h=!!(f!=null&&(C=f.details)!==null&&C!==void 0&&C.live),_=f==null?void 0:f.codecSet,g=T?T.duration:R?R.duration:0,x=i;x>=s;x--){var N=b[x];if(!N||_&&N.codecSet!==_)continue;var F=N.details,A=(T?F==null?void 0:F.partTarget:F==null?void 0:F.averagetargetduration)||g,B=void 0;x<=v?B=O*c:B=S*c;var U=b[x].maxBitrate,w=U*A/B;if(M.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(B)+"/"+U+"/"+A+"/"+n+"/"+w),B>U&&(!w||h&&!this.bitrateTestDelay||w<n))return x}return-1},p(u,[{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}}]),u}();V.default=m},"./src/controller/audio-stream-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/polyfills/number.ts"),P=I("./src/controller/base-stream-controller.ts"),L=I("./src/events.ts"),W=I("./src/utils/buffer-helper.ts"),k=I("./src/controller/fragment-tracker.ts"),r=I("./src/types/level.ts"),M=I("./src/types/loader.ts"),E=I("./src/loader/fragment.ts"),p=I("./src/demux/chunk-cache.ts"),m=I("./src/demux/transmuxer-interface.ts"),u=I("./src/types/transmuxer.ts"),a=I("./src/controller/fragment-finders.ts"),o=I("./src/utils/discontinuities.ts"),c=I("./src/errors.ts"),s=I("./src/utils/logger.ts");function i(){return i=Object.assign||function(R){for(var T=1;T<arguments.length;T++){var v=arguments[T];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(R[b]=v[b])}return R},i.apply(this,arguments)}function n(R,T){R.prototype=Object.create(T.prototype),R.prototype.constructor=R,O(R,T)}function O(R,T){return O=Object.setPrototypeOf||function(b,f){return b.__proto__=f,b},O(R,T)}var S=100,C=function(R){n(T,R);function T(b,f){var h;return h=R.call(this,b,f,"[audio-stream-controller]")||this,h.videoBuffer=null,h.videoTrackCC=-1,h.waitingVideoCC=-1,h.audioSwitch=!1,h.trackId=-1,h.waitingData=null,h.mainDetails=null,h.bufferFlushed=!1,h._registerListeners(),h}var v=T.prototype;return v.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},v._registerListeners=function(){var f=this.hls;f.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.on(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.on(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.on(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.on(L.Events.ERROR,this.onError,this),f.on(L.Events.BUFFER_RESET,this.onBufferReset,this),f.on(L.Events.BUFFER_CREATED,this.onBufferCreated,this),f.on(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v._unregisterListeners=function(){var f=this.hls;f.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),f.off(L.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),f.off(L.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),f.off(L.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),f.off(L.Events.ERROR,this.onError,this),f.off(L.Events.BUFFER_RESET,this.onBufferReset,this),f.off(L.Events.BUFFER_CREATED,this.onBufferCreated,this),f.off(L.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),f.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(L.Events.FRAG_BUFFERED,this.onFragBuffered,this)},v.onInitPtsFound=function(f,h){var _=h.frag,g=h.id,x=h.initPTS;if(g==="main"){var N=_.cc;this.initPTS[_.cc]=x,this.log("InitPTS for cc: "+N+" found from main: "+x),this.videoTrackCC=N,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},v.startLoad=function(f){if(!this.levels){this.startPosition=f,this.state=P.State.STOPPED;return}var h=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,h>0&&f===-1?(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=f,this.tick()},v.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var f,h=this.levels,_=this.trackId,g=h==null||((f=h[_])===null||f===void 0)?void 0:f.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var x,N=performance.now(),F=this.retryDate;(!F||N>=F||(x=this.media)!==null&&x!==void 0&&x.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 B=A.frag,U=A.part,w=A.cache,Y=A.complete;if(this.initPTS[B.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var q=w.flush(),ce={frag:B,part:U,payload:q,networkDetails:null};this._handleFragmentLoadProgress(ce),Y&&R.prototype._handleFragmentLoadComplete.call(this,ce)}else if(this.videoTrackCC!==this.waitingVideoCC)s.logger.log("Waiting fragment cc ("+B.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var Ee=this.getLoadPosition(),Qe=W.BufferHelper.bufferInfo(this.mediaBuffer,Ee,this.config.maxBufferHole),Te=Object(a.fragmentWithinToleranceTest)(Qe.end,this.config.maxFragLookUpTolerance,B);Te<0&&(s.logger.log("Waiting fragment cc ("+B.cc+") @ "+B.start+" cancelled because another fragment at "+Qe.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},v.clearWaitingFragment=function(){var f=this.waitingData;f&&(this.fragmentTracker.removeFragment(f.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},v.onTickEnd=function(){var f=this.media;if(!f||!f.readyState)return;var h=this.mediaBuffer?this.mediaBuffer:f,_=h.buffered;!this.loadedmetadata&&_.length&&(this.loadedmetadata=!0),this.lastCurrentTime=f.currentTime},v.doTickIdle=function(){var f,h,_=this.hls,g=this.levels,x=this.media,N=this.trackId,F=_.config;if(!g||!g[N])return;if(!x&&(this.startFragRequested||!F.startFragPrefetch))return;var A=g[N],B=A.details;if(!B||B.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(B)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,E.ElementaryStreamTypes.AUDIO,M.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,M.PlaylistLevelType.AUDIO);if(U===null)return;var w=U.len,Y=this.getMaxBufferLength(),q=this.audioSwitch;if(w>=Y&&!q)return;if(!q&&this._streamEnded(U,B)){_.trigger(L.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var ce=B.fragments,Ee=ce[0].start,Qe=U.end;if(q){var Te=this.getLoadPosition();Qe=Te,B.PTSKnown&&Te<Ee&&((U.end>Ee||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),x.currentTime=Ee+.05))}var We=this.getNextFragment(Qe,B);if(!We){this.bufferFlushed=!0;return}((f=We.decryptdata)===null||f===void 0?void 0:f.keyFormat)==="identity"&&!((h=We.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(We,B):this.loadFragment(We,B,Qe)},v.getMaxBufferLength=function(){var f=R.prototype.getMaxBufferLength.call(this),h=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,M.PlaylistLevelType.MAIN);return h===null?f:Math.max(f,h.len)},v.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},v.onAudioTracksUpdated=function(f,h){var _=h.audioTracks;this.resetTransmuxer(),this.levels=_.map(function(g){return new r.Level(g)})},v.onAudioTrackSwitching=function(f,h){var _=!!h.url;this.trackId=h.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),_?this.setInterval(S):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(f,h){this.mainDetails=h.details},v.onAudioTrackLoaded=function(f,h){var _,g=this.levels,x=h.details,N=h.id;if(!g){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+x.startSN+","+x.endSN+"],duration:"+x.totalduration);var F=g[N],A=0;if(x.live||(_=F.details)!==null&&_!==void 0&&_.live){var B=this.mainDetails;if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed||!B)return;!F.details&&x.hasProgramDateTime&&B.hasProgramDateTime?(Object(o.alignMediaPlaylistByPDT)(x,B),A=x.fragments[0].start):A=this.alignPlaylists(x,F.details)}F.details=x,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!x.live)&&this.setStartPosition(F.details,A),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(x)&&(this.state=P.State.IDLE),this.tick()},v._handleFragmentLoadProgress=function(f){var h,_=f.frag,g=f.part,x=f.payload,N=this.config,F=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 B=A[F];console.assert(B,"Audio track is defined on fragment load progress");var U=B.details;console.assert(U,"Audio track details are defined on fragment load progress");var w=N.defaultAudioCodec||B.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],ce=(h=_.initSegment)===null||h===void 0?void 0:h.data;if(q!==void 0){var Ee=!1,Qe=g?g.index:-1,Te=Qe!==-1,We=new u.ChunkMetadata(_.level,_.sn,_.stats.chunkCount,x.byteLength,Qe,Te);Y.push(x,ce,w,"",_,g,U.totalduration,Ee,We,q)}else{s.logger.log("Unknown video PTS for cc "+_.cc+", waiting for video PTS before demuxing audio frag "+_.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+F);var $e=this.waitingData=this.waitingData||{frag:_,part:g,cache:new p.default,complete:!1},Je=$e.cache;Je.push(new Uint8Array(x)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},v._handleFragmentLoadComplete=function(f){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,f)},v.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},v.onBufferCreated=function(f,h){var _=h.tracks.audio;_&&(this.mediaBuffer=_.buffer),h.tracks.video&&(this.videoBuffer=h.tracks.video.buffer)},v.onFragBuffered=function(f,h){var _=h.frag,g=h.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(L.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(_,g)},v.onError=function(f,h){switch(h.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,h);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=h.fatal?P.State.ERROR:P.State.IDLE,this.warn(h.details+" while loading frag, switching to "+this.state+" state"));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(h.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(f,h){var _=h.type;_===E.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},v._handleTransmuxComplete=function(f){var h,_="audio",g=this.hls,x=f.remuxResult,N=f.chunkMeta,F=this.getCurrentContext(N);if(!F){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var A=F.frag,B=F.part,U=x.audio,w=x.text,Y=x.id3,q=x.initSegment;if(this.fragContextChanged(A))return;if(this.state=P.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),q!=null&&q.tracks&&(this._bufferInitSegment(q.tracks,A,N),g.trigger(L.Events.FRAG_PARSING_INIT_SEGMENT,{frag:A,id:_,tracks:q.tracks})),U){var ce=U.startPTS,Ee=U.endPTS,Qe=U.startDTS,Te=U.endDTS;B&&(B.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:ce,endPTS:Ee,startDTS:Qe,endDTS:Te}),A.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,ce,Ee,Qe,Te),this.bufferFragmentData(U,A,B,N)}if(Y!=null&&(h=Y.samples)!==null&&h!==void 0&&h.length){var We=i({frag:A,id:_},Y);g.trigger(L.Events.FRAG_PARSING_METADATA,We)}if(w){var $e=i({frag:A,id:_},w);g.trigger(L.Events.FRAG_PARSING_USERDATA,$e)}},v._bufferInitSegment=function(f,h,_){if(this.state!==P.State.PARSING)return;f.video&&delete f.video;var g=f.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(L.Events.BUFFER_CODECS,f);var x=g.initSegment;if(x!=null&&x.byteLength){var N={type:"audio",frag:h,part:null,chunkMeta:_,parent:h.type,data:x};this.hls.trigger(L.Events.BUFFER_APPENDING,N)}this.tick()},v.loadFragment=function(f,h,_){var g=this.fragmentTracker.getState(f);this.fragCurrent=f,(this.audioSwitch||g===k.FragmentState.NOT_LOADED||g===k.FragmentState.PARTIAL)&&(f.sn==="initSegment"?this._loadInitSegment(f):h.live&&!Object(G.isFiniteNumber)(this.initPTS[f.cc])?(this.log("Waiting for video PTS in continuity counter "+f.cc+" of live stream before loading audio fragment "+f.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,f,h,_)))},v.completeAudioSwitch=function(){var f=this.hls,h=this.media,_=this.trackId;h&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,f.trigger(L.Events.AUDIO_TRACK_SWITCHED,{id:_})},T}(P.default);V.default=C},"./src/controller/audio-track-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/events.ts"),P=I("./src/errors.ts"),L=I("./src/controller/base-playlist-controller.ts"),W=I("./src/types/loader.ts");function k(m,u){for(var a=0;a<u.length;a++){var o=u[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}function r(m,u,a){return u&&k(m.prototype,u),a&&k(m,a),m}function M(m,u){m.prototype=Object.create(u.prototype),m.prototype.constructor=m,E(m,u)}function E(m,u){return E=Object.setPrototypeOf||function(o,c){return o.__proto__=c,o},E(m,u)}var p=function(m){M(u,m);function u(o){var c;return c=m.call(this,o,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var a=u.prototype;return a.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)},a.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)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,m.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(c,s){this.tracks=s.audioTracks||[]},a.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 S=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,S))},a.onLevelLoading=function(c,s){this.switchLevel(s.level)},a.onLevelSwitching=function(c,s){this.switchLevel(s.level)},a.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(S){return!i||S.groupId===i});this.selectDefaultTrack&&!n.some(function(S){return S.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()}},a.onError=function(c,s){if(m.prototype.onError.call(this,c,s),s.fatal||!s.context)return;s.context.type===W.PlaylistContextType.AUDIO_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},a.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,S=n.groupId,C=S===void 0?"":S,R=n.name,T=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:T,url:v}),n.details&&!n.details.live)return;var b=this.switchParams(n.url,i==null?void 0:i.details);this.loadPlaylist(b)},a.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}))},a.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},a.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(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}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(u,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),u}(L.default);V.default=p},"./src/controller/base-playlist-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return r});var G=I("./src/polyfills/number.ts"),P=I("./src/types/level.ts"),L=I("./src/controller/level-helper.ts"),W=I("./src/utils/logger.ts"),k=I("./src/errors.ts"),r=function(){function M(p,m){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=W.logger.log.bind(W.logger,m+":"),this.warn=W.logger.warn.bind(W.logger,m+":"),this.hls=p}var E=M.prototype;return E.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},E.onError=function(m,u){u.fatal&&u.type===k.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},E.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},E.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},E.stopLoad=function(){this.canLoad=!1,this.clearTimer()},E.switchParams=function(m,u){var a=u==null?void 0:u.renditionReports;if(a)for(var o=0;o<a.length;o++){var c=a[o],s=""+c.URI;if(s===m.substr(-s.length)){var i=parseInt(c["LAST-MSN"]),n=parseInt(c["LAST-PART"]);if(u&&this.hls.config.lowLatencyMode){var O=Math.min(u.age-u.partTarget,u.targetduration);n!==void 0&&O>u.partTarget&&(n+=1)}if(Object(G.isFiniteNumber)(i))return new P.HlsUrlParameters(i,Object(G.isFiniteNumber)(n)?n:void 0,P.HlsSkip.No)}}},E.loadPlaylist=function(m){},E.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},E.playlistLoaded=function(m,u,a){var o=this,c=u.details,s=u.stats,i=s.loading.end?Math.max(0,self.performance.now()-s.loading.end):0;if(c.advancedDateTime=Date.now()-i,c.live||a!=null&&a.live){if(c.reloaded(a),a&&this.log("live playlist "+m+" "+(c.advanced?"REFRESHED "+c.lastPartSn+"-"+c.lastPartIndex:"MISSED")),a&&c.fragments.length>0&&Object(L.mergeDetails)(a,c),!this.canLoad||!c.live)return;var n,O=void 0,S=void 0;if(c.canBlockReload&&c.endSN&&c.advanced){var C=this.hls.config.lowLatencyMode,R=c.lastPartSn,T=c.endSN,v=c.lastPartIndex,b=v!==-1,f=R===T,h=C?0:v;b?(O=f?T+1:R,S=f?h:v+1):O=T+1;var _=c.age,g=_+c.ageHeader,x=Math.min(g-c.partTarget,c.targetduration*1.5);if(x>0){if(a&&x>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+x+" with playlist age: "+c.age),x=0;else{var N=Math.floor(x/c.targetduration);if(O+=N,S!==void 0){var F=Math.round(x%c.targetduration/c.partTarget);S+=F}this.log("CDN Tune-in age: "+c.ageHeader+"s last advanced "+_.toFixed(2)+"s goal: "+x+" skip sn "+N+" to part "+S)}c.tuneInGoal=x}if(n=this.getDeliveryDirectives(c,u.deliveryDirectives,O,S),C||!f){this.loadPlaylist(n);return}}else n=this.getDeliveryDirectives(c,u.deliveryDirectives,O,S);var A=Object(L.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 o.loadPlaylist(n)},A)}else this.clearTimer()},E.getDeliveryDirectives=function(m,u,a,o){var c=Object(P.getSkipValue)(m,a);return u!=null&&u.skip&&m.deltaUpdateFailed&&(a=u.msn,o=u.part,c=P.HlsSkip.No),new P.HlsUrlParameters(a,o,c)},E.retryLoadingOrFail=function(m){var u=this,a=this.hls.config,o=this.retryCount<a.levelLoadingMaxRetry;if(o){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)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.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 o},M}()},"./src/controller/base-stream-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"State",function(){return T}),I.d(V,"default",function(){return v});var G=I("./src/polyfills/number.ts"),P=I("./src/task-loop.ts"),L=I("./src/controller/fragment-tracker.ts"),W=I("./src/utils/buffer-helper.ts"),k=I("./src/utils/logger.ts"),r=I("./src/events.ts"),M=I("./src/errors.ts"),E=I("./src/types/transmuxer.ts"),p=I("./src/utils/mp4-tools.ts"),m=I("./src/utils/discontinuities.ts"),u=I("./src/controller/fragment-finders.ts"),a=I("./src/controller/level-helper.ts"),o=I("./src/loader/fragment-loader.ts"),c=I("./src/crypt/decrypter.ts"),s=I("./src/utils/time-ranges.ts"),i=I("./src/types/loader.ts");function n(b,f){for(var h=0;h<f.length;h++){var _=f[h];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(b,_.key,_)}}function O(b,f,h){return f&&n(b.prototype,f),h&&n(b,h),b}function S(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function C(b,f){b.prototype=Object.create(f.prototype),b.prototype.constructor=b,R(b,f)}function R(b,f){return R=Object.setPrototypeOf||function(_,g){return _.__proto__=g,_},R(b,f)}var T={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(b){C(f,b);function f(_,g,x){var N;return N=b.call(this)||this,N.hls=void 0,N.fragPrevious=null,N.fragCurrent=null,N.fragmentTracker=void 0,N.transmuxer=null,N._state=T.STOPPED,N.media=void 0,N.mediaBuffer=void 0,N.config=void 0,N.bitrateTest=!1,N.lastCurrentTime=0,N.nextLoadPosition=0,N.startPosition=0,N.loadedmetadata=!1,N.fragLoadError=0,N.retryDate=0,N.levels=null,N.fragmentLoader=void 0,N.levelLastLoaded=null,N.startFragRequested=!1,N.decrypter=void 0,N.initPTS=[],N.onvseeking=null,N.onvended=null,N.logPrefix="",N.log=void 0,N.warn=void 0,N.logPrefix=x,N.log=k.logger.log.bind(k.logger,x+":"),N.warn=k.logger.warn.bind(k.logger,x+":"),N.hls=_,N.fragmentLoader=new o.default(_.config),N.fragmentTracker=g,N.config=_.config,N.decrypter=new c.default(_,_.config),_.on(r.Events.KEY_LOADED,N.onKeyLoaded,S(N)),N}var h=f.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(g){},h.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=T.STOPPED},h._streamEnded=function(g,x){var N=this.fragCurrent,F=this.fragmentTracker;if(!x.live&&N&&N.sn===x.endSN&&!g.nextStart){var A=F.getState(N);return A===L.FragmentState.PARTIAL||A===L.FragmentState.OK}return!1},h.onMediaAttached=function(g,x){var N=this.media=this.mediaBuffer=x.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),N.addEventListener("seeking",this.onvseeking),N.addEventListener("ended",this.onvended);var F=this.config;this.levels&&F.autoStartLoad&&this.state===T.STOPPED&&this.startLoad(F.startPosition)},h.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()},h.onMediaSeeking=function(){var g=this.config,x=this.fragCurrent,N=this.media,F=this.mediaBuffer,A=this.state,B=N?N.currentTime:0,U=W.BufferHelper.bufferInfo(F||N,B,g.maxBufferHole);if(this.log("media seeking to "+(Object(G.isFiniteNumber)(B)?B.toFixed(3):B)+", state: "+A),A===T.ENDED)this.resetLoadingState();else if(x&&!U.len){var w=g.maxFragLookUpTolerance,Y=x.start-w,q=x.start+x.duration+w,ce=B>q;(B<Y||ce)&&(ce&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.loader.abort()),this.resetLoadingState())}N&&(this.lastCurrentTime=B),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=B),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onKeyLoaded=function(g,x){if(this.state!==T.KEY_LOADING||x.frag!==this.fragCurrent||!this.levels)return;this.state=T.IDLE;var N=this.levels[x.frag.level].details;N&&this.loadFragment(x.frag,N,x.frag.start)},h.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=T.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,b.prototype.onHandlerDestroyed.call(this)},h.loadKey=function(g,x){this.log("Loading key for "+g.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=T.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})},h.loadFragment=function(g,x,N){this._loadFragForPlayback(g,x,N)},h._loadFragForPlayback=function(g,x,N){var F=this,A=function(U){if(F.fragContextChanged(g)){F.warn("Fragment "+g.sn+(U.part?" p: "+U.part.index:"")+" of level "+g.level+" was dropped during download."),F.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,F._handleFragmentLoadProgress(U)};this._doFragLoad(g,x,N,A).then(function(B){if(!B)return;F.fragLoadError=0;var U=F.state;if(F.fragContextChanged(g)){(U===T.FRAG_LOADING||U===T.BACKTRACKING||!F.fragCurrent&&U===T.PARSING)&&(F.fragmentTracker.removeFragment(g),F.state=T.IDLE);return}if("payload"in B&&(F.log("Loaded fragment "+g.sn+" of level "+g.level),F.hls.trigger(r.Events.FRAG_LOADED,B),F.state===T.BACKTRACKING)){F.fragmentTracker.backtrack(g,B),F.resetFragmentLoading(g);return}F._handleFragmentLoadComplete(B)}).catch(function(B){F.warn(B),F.resetFragmentLoading(g)})},h.flushMainBuffer=function(g,x,N){if(N===void 0&&(N=null),!(g-x))return;var F={startOffset:g,endOffset:x,type:N};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,F)},h._loadInitSegment=function(g){var x=this;this._doFragLoad(g).then(function(N){if(!N||x.fragContextChanged(g)||!x.levels)throw new Error("init load aborted");return N}).then(function(N){var F=x.hls,A=N.payload,B=g.decryptdata;if(A&&A.byteLength>0&&B&&B.key&&B.iv&&B.method==="AES-128"){var U=self.performance.now();return x.decrypter.webCryptoDecrypt(new Uint8Array(A),B.key.buffer,B.iv.buffer).then(function(w){var Y=self.performance.now();return F.trigger(r.Events.FRAG_DECRYPTED,{frag:g,payload:w,stats:{tstart:U,tdecrypt:Y}}),N.payload=w,N})}return N}).then(function(N){var F=x.fragCurrent,A=x.hls,B=x.levels;if(!B)throw new Error("init load aborted, missing levels");var U=B[g.level].details;console.assert(U,"Level details are defined when init segment is loaded");var w=g.stats;x.state=T.IDLE,x.fragLoadError=0,g.data=new Uint8Array(N.payload),w.parsing.start=w.buffering.start=self.performance.now(),w.parsing.end=w.buffering.end=self.performance.now(),N.frag===F&&A.trigger(r.Events.FRAG_BUFFERED,{stats:w,frag:F,part:null,id:g.type}),x.tick()}).catch(function(N){x.warn(N),x.resetFragmentLoading(g)})},h.fragContextChanged=function(g){var x=this.fragCurrent;return!g||!x||g.level!==x.level||g.sn!==x.sn||g.urlId!==x.urlId},h.fragBufferedComplete=function(g,x){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+s.default.toString(W.BufferHelper.getBuffered(N))),this.state=T.IDLE,this.tick()},h._handleFragmentLoadComplete=function(g){var x=this.transmuxer;if(!x)return;var N=g.frag,F=g.part,A=g.partsLoaded,B=!A||A.length===0||A.some(function(w){return!w}),U=new E.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,F?F.index:-1,!B);x.flush(U)},h._handleFragmentLoadProgress=function(g){},h._doFragLoad=function(g,x,N,F){var A=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(g.start,N||0),this.config.lowLatencyMode&&x){var B=x.partList;if(B&&F){N>g.end&&x.fragmentHint&&(g=x.fragmentHint);var U=this.getNextPart(B,g,N);if(U>-1){var w=B[U];return this.log("Loading part sn: "+g.sn+" p: "+w.index+" cc: "+g.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+U+"-"+(B.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=w.start+w.duration,this.state=T.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,part:B[U],targetBufferTime:N}),this.doFragPartsLoad(g,B,U,F).catch(function(Y){return A.handleFragLoadError(Y)})}else if(!g.url||this.loadedEndOfParts(B,N))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),Object(G.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=T.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:g,targetBufferTime:N}),this.fragmentLoader.load(g,F).catch(function(Y){return A.handleFragLoadError(Y)})},h.doFragPartsLoad=function(g,x,N,F){var A=this;return new Promise(function(B,U){var w=[],Y=function q(ce){var Ee=x[ce];A.fragmentLoader.loadPart(g,Ee,F).then(function(Qe){w[Ee.index]=Qe;var Te=Qe.part;A.hls.trigger(r.Events.FRAG_LOADED,Qe);var We=x[ce+1];if(We&&We.fragment===g)q(ce+1);else return B({frag:g,part:Te,partsLoaded:w})}).catch(U)};Y(N)})},h.handleFragLoadError=function(g){var x=g.data;return x&&x.details===M.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(r.Events.ERROR,x),null},h._handleTransmuxerFlush=function(g){var x=this.getCurrentContext(g);if(!x||this.state!==T.PARSING){this.fragCurrent||(this.state=T.IDLE);return}var N=x.frag,F=x.part,A=x.level,B=self.performance.now();N.stats.parsing.end=B,F&&(F.stats.parsing.end=B),this.updateLevelTiming(N,F,A,g.partial)},h.getCurrentContext=function(g){var x=this.levels,N=g.level,F=g.sn,A=g.part;if(!x||!x[N])return this.warn("Levels object was unset while buffering fragment "+F+" of level "+N+". The current chunk will not be buffered."),null;var B=x[N],U=A>-1?Object(a.getPartWith)(B,F,A):null,w=U?U.fragment:Object(a.getFragmentWithSN)(B,F,this.fragCurrent);return w?{frag:w,part:U,level:B}:null},h.bufferFragmentData=function(g,x,N,F){if(!g||this.state!==T.PARSING)return;var A=g.data1,B=g.data2,U=A;if(A&&B&&(U=Object(p.appendUint8Array)(A,B)),!U||!U.length)return;var w={type:g.type,frag:x,part:N,chunkMeta:F,parent:x.type,data:U};this.hls.trigger(r.Events.BUFFER_APPENDING,w),g.dropped&&g.independent&&!N&&this.flushBufferGap(x)},h.flushBufferGap=function(g){var x=this.media;if(!x)return;if(!W.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,g.start);return}var N=x.currentTime,F=W.BufferHelper.bufferInfo(x,N,0),A=g.duration,B=Math.min(this.config.maxFragLookUpTolerance*2,A*.25),U=Math.max(Math.min(g.start-B,F.end-B),N+B);g.start-U>B&&this.flushMainBuffer(U,g.start)},h.getFwdBufferInfo=function(g,x){var N=this.config,F=this.getLoadPosition();if(!Object(G.isFiniteNumber)(F))return null;var A=W.BufferHelper.bufferInfo(g,F,N.maxBufferHole);if(A.len===0&&A.nextStart!==void 0){var B=this.fragmentTracker.getBufferedFrag(F,x);if(B&&A.nextStart<B.end)return W.BufferHelper.bufferInfo(g,F,Math.max(A.nextStart,N.maxBufferHole))}return A},h.getMaxBufferLength=function(g){var x=this.config,N;return g?N=Math.max(8*x.maxBufferSize/g,x.maxBufferLength):N=x.maxBufferLength,Math.min(N,x.maxMaxBufferLength)},h.reduceMaxBufferLength=function(g){var x=this.config,N=g||x.maxBufferLength;return x.maxMaxBufferLength>=N?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(g,x){var N,F,A=x.fragments,B=A.length;if(!B)return null;var U=this.config,w=A[0].start,Y;if(x.live){var q=U.initialLiveManifestSize;if(B<q)return this.warn("Not enough fragments to start playback (have: "+B+", need: "+q+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(Y=this.getInitialLiveFragment(x,A),this.startPosition=Y?this.hls.liveSyncPosition||Y.start:g)}else g<=w&&(Y=A[0]);if(!Y){var ce=U.lowLatencyMode?x.partEnd:x.fragmentEnd;Y=this.getFragmentAtPosition(g,ce,x)}return(N=Y)!==null&&N!==void 0&&N.initSegment&&!((F=Y)!==null&&F!==void 0&&F.initSegment.data)&&!this.bitrateTest&&(Y=Y.initSegment),Y},h.getNextPart=function(g,x,N){for(var F=-1,A=!1,B=!0,U=0,w=g.length;U<w;U++){var Y=g[U];if(B=B&&!Y.independent,F>-1&&N<Y.start)break;var q=Y.loaded;!q&&(A||Y.independent||B)&&Y.fragment===x&&(F=U),A=q}return F},h.loadedEndOfParts=function(g,x){var N=g[g.length-1];return N&&x>N.start&&N.loaded},h.getInitialLiveFragment=function(g,x){var N=this.fragPrevious,F=null;if(N){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),F=Object(u.findFragmentByPDT)(x,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!F){var A=N.sn+1;if(A>=g.startSN&&A<=g.endSN){var B=x[A-g.startSN];N.cc===B.cc&&(F=B,this.log("Live playlist, switching playlist, load frag with next SN: "+F.sn))}F||(F=Object(u.findFragWithCC)(x,N.cc),F&&this.log("Live playlist, switching playlist, load frag with same CC: "+F.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(F=this.getFragmentAtPosition(U,this.bitrateTest?g.fragmentEnd:g.edge,g))}return F},h.getFragmentAtPosition=function(g,x,N){var F=this.config,A=this.fragPrevious,B=N.fragments,U=N.endSN,w=N.fragmentHint,Y=F.maxFragLookUpTolerance,q=!!(F.lowLatencyMode&&N.partList&&w);q&&w&&!this.bitrateTest&&(B=B.concat(w),U=w.sn);var ce;if(g<x){var Ee=g>x-Y?0:Y;ce=Object(u.findFragmentByPTS)(A,B,g,Ee)}else ce=B[B.length-1];if(ce){var Qe=ce.sn-N.startSN,Te=A&&ce.level===A.level,We=B[Qe+1],$e=this.fragmentTracker.getState(ce);if($e===L.FragmentState.BACKTRACKED){ce=null;for(var Je=Qe;B[Je]&&this.fragmentTracker.getState(B[Je])===L.FragmentState.BACKTRACKED;)A?ce=B[Je--]:ce=B[--Je];ce||(ce=We)}else A&&ce.sn===A.sn&&!q&&(Te&&(ce.sn<U&&this.fragmentTracker.getState(We)!==L.FragmentState.OK?(this.log("SN "+ce.sn+" just loaded, load next one: "+We.sn),ce=We):ce=null))}return ce},h.synchronizeToLiveEdge=function(g){var x=this.config,N=this.media;if(!N)return;var F=this.hls.liveSyncPosition,A=N.currentTime,B=g.fragments[0].start,U=g.edge,w=A>=B-x.maxFragLookUpTolerance&&A<=U;if(F!==null&&N.duration>F&&(A<F||!w)){var Y=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*g.targetduration;(!w&&N.readyState<4||A<U-Y)&&(this.loadedmetadata||(this.nextLoadPosition=F),N.readyState&&(this.warn("Playback: "+A.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+F.toFixed(3)),N.currentTime=F))}},h.alignPlaylists=function(g,x){var N=this.levels,F=this.levelLastLoaded,A=this.fragPrevious,B=F!==null?N[F]:null,U=g.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var w=g.fragments[0].start,Y=!x,q=g.alignedSliding&&Object(G.isFiniteNumber)(w);if(Y||!q&&!w){Object(m.alignStream)(A,B,g);var ce=g.fragments[0].start;return this.log("Live playlist sliding: "+ce.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+g.startSN+" prev-sn: "+(A?A.sn:"na")+" fragments: "+U),ce}return w},h.waitForCdnTuneIn=function(g){var x=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*x)},h.setStartPosition=function(g,x){var N=this.startPosition;if(N<x&&(N=-1),N===-1||this.lastCurrentTime===-1){var F=g.startTimeOffset;Object(G.isFiniteNumber)(F)?(N=x+F,F<0&&(N+=g.totalduration),N=Math.min(Math.max(x,N),x+g.totalduration),this.log("Start time offset "+F+" found in playlist, adjust startPosition to "+N),this.startPosition=N):g.live?N=this.hls.liveSyncPosition||x:this.startPosition=N=0,this.lastCurrentTime=N}this.nextLoadPosition=N},h.getLoadPosition=function(){var g=this.media,x=0;return this.loadedmetadata&&g?x=g.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},h.handleFragLoadAborted=function(g,x){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(x?" part"+x.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},h.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=T.IDLE)},h.onFragmentOrKeyLoadError=function(g,x){if(x.fatal)return;var N=x.frag;if(!N||N.type!==g)return;var F=this.fragCurrent;console.assert(F&&N.sn===F.sn&&N.level===F.level&&N.urlId===F.urlId,"Frag load error must match current frag to retry");var A=this.config;if(this.fragLoadError+1<=A.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(N.level))return;var B=Math.min(Math.pow(2,this.fragLoadError)*A.fragLoadingRetryDelay,A.fragLoadingMaxRetryTimeout);this.warn("Fragment "+N.sn+" of "+g+" "+N.level+" failed to load, retrying in "+B+"ms"),this.retryDate=self.performance.now()+B,this.fragLoadError++,this.state=T.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(g===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=T.IDLE):(k.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=T.ERROR)},h.afterBufferFlushed=function(g,x,N){if(!g)return;var F=W.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(x,F,N),this.state===T.ENDED&&this.resetLoadingState()},h.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=T.IDLE},h.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[g].details:null;if(x!=null&&x.live)return this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},h.updateLevelTiming=function(g,x,N,F){var A=this,B=N.details;console.assert(!!B,"level.details must be defined");var U=Object.keys(g.elementaryStreams).reduce(function(w,Y){var q=g.elementaryStreams[Y];if(q){var ce=q.endPTS-q.startPTS;if(ce<=0)return A.warn("Could not parse fragment "+g.sn+" "+Y+" duration reliably ("+ce+") resetting transmuxer to fallback to playlist timing"),A.resetTransmuxer(),w||!1;var Ee=F?0:Object(a.updateFragPTSDTS)(B,g,q.startPTS,q.endPTS,q.startDTS,q.endDTS);return A.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:B,level:N,drift:Ee,type:Y,frag:g,start:q.startPTS,end:q.endPTS}),!0}return w},!1);U?(this.state=T.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:g,part:x})):this.resetLoadingState()},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},O(f,[{key:"state",get:function(){return this._state},set:function(g){var x=this._state;x!==g&&(this._state=g,this.log(x+"->"+g))}}]),f}(P.default)},"./src/controller/buffer-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return u});var G=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),L=I("./src/utils/logger.ts"),W=I("./src/errors.ts"),k=I("./src/utils/buffer-helper.ts"),r=I("./src/utils/mediasource-helper.ts"),M=I("./src/loader/fragment.ts"),E=I("./src/controller/buffer-operation-queue.ts"),p=Object(r.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function a(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;L.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(){L.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){L.logger.log("[buffer-controller]: Media source ended")},this.hls=c,this._initSourceBuffer(),this.registerListeners()}var o=a.prototype;return o.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},o.destroy=function(){this.unregisterListeners(),this.details=null},o.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)},o.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)},o._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new E.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},o.onManifestParsed=function(s,i){var n=2;(i.audio&&!i.video||!i.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,L.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},o.onMediaAttaching=function(s,i){var n=this.media=i.media;if(n&&p){var O=this.mediaSource=new p;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}},o.onMediaDetaching=function(){var s=this.media,i=this.mediaSource,n=this._objectUrl;if(i){if(L.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(O){L.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()):L.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)},o.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){L.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",O)}}),this._initSourceBuffer()},o.onBufferCodecs=function(s,i){var n=this,O=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(S){if(O){var C=n.tracks[S];if(C&&typeof C.buffer.changeType=="function"){var R=i[S],T=R.codec,v=R.levelCodec,b=R.container,f=(C.levelCodec||C.codec).replace(m,"$1"),h=(v||T).replace(m,"$1");if(f!==h){var _=b+";codecs="+(v||T);n.appendChangeType(S,_)}}}else n.pendingTracks[S]=i[S]}),O)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},o.appendChangeType=function(s,i){var n=this,O=this.operationQueue,S={execute:function(){var R=n.sourceBuffer[s];R&&(L.logger.log("[buffer-controller]: changing "+s+" sourceBuffer type to "+i),R.changeType(i)),O.shiftAndExecuteNext(s)},onStart:function(){},onComplete:function(){},onError:function(R){L.logger.warn("[buffer-controller]: Failed to change "+s+" SourceBuffer type",R)}};O.append(S,s)},o.onBufferAppending=function(s,i){var n=this,O=this.hls,S=this.operationQueue,C=this.tracks,R=i.data,T=i.type,v=i.frag,b=i.part,f=i.chunkMeta,h=f.buffering[T],_=self.performance.now();h.start=_;var g=v.stats.buffering,x=b?b.stats.buffering:null;g.start===0&&(g.start=_),x&&x.start===0&&(x.start=_);var N=C.audio,F=T==="audio"&&f.id===1&&(N==null?void 0:N.container)==="audio/mpeg",A={execute:function(){if(h.executeStart=self.performance.now(),F){var U=n.sourceBuffer[T];if(U){var w=v.start-U.timestampOffset;Math.abs(w)>=.1&&(L.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+v.start+" (delta: "+w+") sn: "+v.sn+")"),U.timestampOffset=v.start)}}n.appendExecutor(R,T)},onStart:function(){},onComplete:function(){var U=self.performance.now();h.executeEnd=h.end=U,g.first===0&&(g.first=U),x&&x.first===0&&(x.first=U);var w=n.sourceBuffer,Y={};for(var q in w)Y[q]=k.BufferHelper.getBuffered(w[q]);n.appendError=0,n.hls.trigger(P.Events.BUFFER_APPENDED,{type:T,frag:v,part:b,chunkMeta:f,parent:v.type,timeRanges:Y})},onError:function(U){L.logger.error("[buffer-controller]: Error encountered while trying to append to the "+T+" SourceBuffer",U);var w={type:W.ErrorTypes.MEDIA_ERROR,parent:v.type,details:W.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?w.details=W.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,w.details=W.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>O.config.appendErrorMaxRetry&&(L.logger.error("[buffer-controller]: Failed "+O.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),w.fatal=!0)),O.trigger(P.Events.ERROR,w)}};S.append(A,T)},o.onBufferFlushing=function(s,i){var n=this,O=this.operationQueue,S=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){L.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",v)}}};i.type?O.append(S(i.type),i.type):this.getSourceBufferTypes().forEach(function(C){O.append(S(C),C)})},o.onFragParsed=function(s,i){var n=this,O=i.frag,S=i.part,C=[],R=S?S.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 T=function(){var b=self.performance.now();O.stats.buffering.end=b,S&&(S.stats.buffering.end=b);var f=S?S.stats:O.stats;n.hls.trigger(P.Events.FRAG_BUFFERED,{frag:O,part:S,stats:f,id:O.type})};C.length===0&&L.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+O.type+" level: "+O.level+" sn: "+O.sn),this.blockBuffers(T,C)},o.onFragChanged=function(s,i){this.flushBackBuffer()},o.onBufferEos=function(s,i){var n=this,O=this.getSourceBufferTypes().reduce(function(S,C){var R=n.sourceBuffer[C];return(!i.type||i.type===C)&&(R&&!R.ended&&(R.ended=!0,L.logger.log("[buffer-controller]: "+C+" sourceBuffer now EOS"))),S&&!!(!R||R.ended)},!0);O&&this.blockBuffers(function(){var S=n.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},o.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()},o.flushBackBuffer=function(){var s=this.hls,i=this.details,n=this.media,O=this.sourceBuffer;if(!n||i===null)return;var S=this.getSourceBufferTypes();if(!S.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,T=i.levelTargetDuration,v=Math.max(C,T),b=Math.floor(R/T)*T-v;S.forEach(function(f){var h=O[f];if(h){var _=k.BufferHelper.getBuffered(h);_.length>0&&b>_.start(0)&&(s.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),i.live&&s.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),s.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:f}))}})},o.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,S=s.fragments[0].start+s.totalduration,C=n.duration,R=Object(G.isFiniteNumber)(O.duration)?O.duration:0;s.live&&i.config.liveDurationInfinity?(L.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),O.duration=Infinity,this.updateSeekableRange(s)):(S>R&&S>C||!Object(G.isFiniteNumber)(C))&&(L.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),O.duration=S)},o.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 S=Math.max(0,n[0].start),C=Math.max(S,S+s.totalduration);i.setLiveSeekableRange(S,C)}},o.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 S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(P.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(C){i.executeNext(C)})}},o.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 S in s)if(!i[S]){var C=s[S];if(!C)throw Error("source buffer exists for track "+S+", however track does not");var R=C.levelCodec||C.codec,T=C.container+";codecs="+R;L.logger.log("[buffer-controller]: creating sourceBuffer("+T+")");try{var v=i[S]=n.addSourceBuffer(T),b=S;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[S]={buffer:v,codec:R,container:C.container,levelCodec:C.levelCodec,id:C.id},O++}catch(f){L.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+f.message),this.hls.trigger(P.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:f,mimeType:T})}}O&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},o._onSBUpdateStart=function(s){var i=this.operationQueue,n=i.current(s);n.onStart()},o._onSBUpdateEnd=function(s){var i=this.operationQueue,n=i.current(s);n.onComplete(),i.shiftAndExecuteNext(s)},o._onSBUpdateError=function(s,i){L.logger.error("[buffer-controller]: "+s+" SourceBuffer error",i),this.hls.trigger(P.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(s);n&&n.onError(i)},o.removeExecutor=function(s,i,n){var O=this.media,S=this.mediaSource,C=this.operationQueue,R=this.sourceBuffer,T=R[s];if(!O||!S||!T){L.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,b=Object(G.isFiniteNumber)(S.duration)?S.duration:Infinity,f=Math.max(0,i),h=Math.min(n,v,b);h>f?(L.logger.log("[buffer-controller]: Removing ["+f+","+h+"] from the "+s+" SourceBuffer"),console.assert(!T.updating,s+" sourceBuffer must not be updating"),T.remove(f,h)):C.shiftAndExecuteNext(s)},o.appendExecutor=function(s,i){var n=this.operationQueue,O=this.sourceBuffer,S=O[i];if(!S){L.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),n.shiftAndExecuteNext(i);return}S.ended=!1,console.assert(!S.updating,i+" sourceBuffer must not be updating"),S.appendBuffer(s)},o.blockBuffers=function(s,i){var n=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){L.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(s);return}var O=this.operationQueue,S=i.map(function(C){return O.appendBlocker(C)});Promise.all(S).then(function(){s(),i.forEach(function(C){var R=n.sourceBuffer[C];(!R||!R.updating)&&O.shiftAndExecuteNext(C)})})},o.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},o.addBufferListener=function(s,i,n){var O=this.sourceBuffer[s];if(!O)return;var S=n.bind(this,s);this.listeners[s].push({event:i,listener:S}),O.addEventListener(i,S)},o.removeBufferListeners=function(s){var i=this.sourceBuffer[s];if(!i)return;this.listeners[s].forEach(function(n){i.removeEventListener(n.event,n.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return P});var G=I("./src/utils/logger.ts"),P=function(){function L(k){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=k}var W=L.prototype;return W.append=function(r,M){var E=this.queues[M];E.push(r),E.length===1&&this.buffers[M]&&this.executeNext(M)},W.insertAbort=function(r,M){var E=this.queues[M];E.unshift(r),this.executeNext(M)},W.appendBlocker=function(r){var M,E=new Promise(function(m){M=m}),p={execute:M,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,r),E},W.executeNext=function(r){var M=this.buffers,E=this.queues,p=M[r],m=E[r];if(m.length){var u=m[0];try{u.execute()}catch(a){G.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(a),(!p||!p.updating)&&(m.shift(),this.executeNext(r))}}},W.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},W.current=function(r){return this.queues[r][0]},L}()},"./src/controller/cap-level-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/events.ts");function P(k,r){for(var M=0;M<r.length;M++){var E=r[M];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(k,E.key,E)}}function L(k,r,M){return r&&P(k.prototype,r),M&&P(k,M),k}var W=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(E){this.streamController=E},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 E=this.hls;E.on(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.on(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.on(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var E=this.hls;E.off(G.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),E.off(G.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),E.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),E.off(G.Events.BUFFER_CODECS,this.onBufferCodecs,this),E.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(E,p){k.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},r.onMediaAttaching=function(E,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},r.onManifestParsed=function(E,p){var m=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onBufferCodecs=function(E,p){var m=this.hls;m.config.capLevelToPlayerSize&&p.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var E=this.hls.levels;if(E.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(E.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},r.getMaxLevel=function(E){var p=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(a,o){return k.isLevelAllowed(o,p.restrictedLevels)&&o<=E});return this.clientRect=null,k.getMaxLevelByMediaSize(u,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 E=this.media,p={width:0,height:0};if(E){var m=E.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||E.width||0,p.height=m.bottom-m.top||E.height||0)}return this.clientRect=p,p},k.isLevelAllowed=function(E,p){return p===void 0&&(p=[]),p.indexOf(E)===-1},k.getMaxLevelByMediaSize=function(E,p,m){if(!E||!E.length)return-1;for(var u=function(i,n){return n?i.width!==n.width||i.height!==n.height:!0},a=E.length-1,o=0;o<E.length;o+=1){var c=E[o];if((c.width>=p||c.height>=m)&&u(c,E[o+1])){a=o;break}}return a},L(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 E=1;try{E=self.devicePixelRatio}catch(p){}return E}}]),k}();V.default=W},"./src/controller/cmcd-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return u});var G=I("./src/events.ts"),P=I("./src/types/cmcd.ts"),L=I("./src/utils/buffer-helper.ts"),W=I("./src/utils/logger.ts");function k(a,o){for(var c=0;c<o.length;c++){var s=o[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function r(a,o,c){return o&&k(a.prototype,o),c&&k(a,c),a}function M(a,o){var c=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(c)return(c=c.call(a)).next.bind(c);if(Array.isArray(a)||(c=E(a))||o&&a&&typeof a.length=="number"){c&&(a=c);var s=0;return function(){return s>=a.length?{done:!0}:{done:!1,value:a[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 E(a,o){if(!a)return;if(typeof a=="string")return p(a,o);var c=Object.prototype.toString.call(a).slice(8,-1);if(c==="Object"&&a.constructor&&(c=a.constructor.name),c==="Map"||c==="Set")return Array.from(a);if(c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,o)}function p(a,o){(o==null||o>a.length)&&(o=a.length);for(var c=0,s=new Array(o);c<o;c++)s[c]=a[c];return s}function m(){return m=Object.assign||function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o];for(var s in c)Object.prototype.hasOwnProperty.call(c,s)&&(a[s]=c[s])}return a},m.apply(this,arguments)}var u=function(){function a(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(S){W.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(O){try{var S=O.frag,C=s.hls.levels[S.level],R=s.getObjectType(S),T={d:S.duration*1e3,ot:R};(R===P.CMCDObjectType.VIDEO||R===P.CMCDObjectType.AUDIO||R==P.CMCDObjectType.MUXED)&&(T.br=C.bitrate/1e3,T.tb=s.getTopBandwidth(R),T.bl=s.getBufferLength(R)),s.apply(O,T)}catch(v){W.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||a.uuid(),this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.registerListeners())}var o=a.prototype;return o.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)},o.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()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(s,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},o.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},o.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}},o.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=a.toHeaders(i);if(!Object.keys(O).length)return;s.headers||(s.headers={}),m(s.headers,O)}else{var S=a.toQuery(i);if(!S)return;s.url=a.appendQueryToUri(s.url,S)}},o.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},o.getTopBandwidth=function(s){for(var i=0,n=s===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,O=M(n),S;!(S=O()).done;){var C=S.value;C.bitrate>i&&(i=C.bitrate)}return i>0?i:NaN},o.getBufferLength=function(s){var i=this.hls.media,n=s===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!n||!i)return NaN;var O=L.BufferHelper.bufferInfo(n,i.currentTime,this.config.maxBufferHole);return O.len*1e3},o.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 S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(R,T,v){i(R),this.loader.load(R,T,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},o.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 S=O.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(R,T,v){i(R),this.loader.load(R,T,v)},r(O,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),O}()},a.uuid=function(){var s=URL.createObjectURL(new Blob),i=s.toString();return URL.revokeObjectURL(s),i.substr(i.lastIndexOf("/")+1)},a.serialize=function(s){for(var i=[],n=function(F){return!Number.isNaN(F)&&F!=null&&F!==""&&F!==!1},O=function(F){return Math.round(F)},S=function(F){return O(F/100)*100},C=function(F){return encodeURIComponent(F)},R={br:O,d:O,bl:S,dl:S,mtp:S,nor:C,rtp:S,tb:O},T=Object.keys(s||{}).sort(),v=M(T),b;!(b=v()).done;){var f=b.value,h=s[f];if(!n(h))continue;if(f==="v"&&h===1)continue;if(f=="pr"&&h===1)continue;var _=R[f];_&&(h=_(h));var g=typeof h,x=void 0;f==="ot"||f==="sf"||f==="st"?x=f+"="+h:g==="boolean"?x=f:g==="number"?x=f+"="+h:x=f+"="+JSON.stringify(h),i.push(x)}return i.join(",")},a.toHeaders=function(s){for(var i=Object.keys(s),n={},O=["Object","Request","Session","Status"],S=[{},{},{},{}],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,T=i;R<T.length;R++){var v=T[R],b=C[v]!=null?C[v]:1;S[b][v]=s[v]}for(var f=0;f<S.length;f++){var h=a.serialize(S[f]);h&&(n["CMCD-"+O[f]]=h)}return n},a.toQuery=function(s){return"CMCD="+encodeURIComponent(a.serialize(s))},a.appendQueryToUri=function(s,i){if(!i)return s;var n=s.includes("?")?"&":"?";return""+s+n+i},a}()},"./src/controller/eme-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/events.ts"),P=I("./src/errors.ts"),L=I("./src/utils/logger.ts"),W=I("./src/utils/mediakeys-helper.ts");function k(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function r(u,a,o){return a&&k(u.prototype,a),o&&k(u,o),u}var M=3,E=function(a,o,c){var s={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(i){s.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:c.audioRobustness||""})}),o.forEach(function(i){s.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:c.videoRobustness||""})}),[s]},p=function(a,o,c,s){switch(a){case W.KeySystems.WIDEVINE:return E(o,c,s);default:throw new Error("Unknown key-system: "+a)}},m=function(){function u(o){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=o,this._config=o.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 a=u.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._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)},a._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)},a.getLicenseServerUrl=function(c){switch(c){case W.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+c+'"')},a._attemptKeySystemAccess=function(c,s,i){var n=this,O=p(c,s,i,this._drmSystemOptions);L.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(c,O);this.mediaKeysPromise=S.then(function(C){return n._onMediaKeySystemAccessObtained(c,C)}),S.catch(function(C){L.logger.error('Failed to obtain key-system "'+c+'" access:',C)})},a._onMediaKeySystemAccessObtained=function(c,s){var i=this;L.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(S){return n.mediaKeys=S,L.logger.log('Media-keys created for key-system "'+c+'"'),i._onMediaKeysCreated(),S});return O.catch(function(S){L.logger.error("Failed to create media-keys:",S)}),O},a._onMediaKeysCreated=function(){var c=this;this._mediaKeysList.forEach(function(s){s.mediaKeysSession||(s.mediaKeysSession=s.mediaKeys.createSession(),c._onNewMediaKeySession(s.mediaKeysSession))})},a._onNewMediaKeySession=function(c){var s=this;L.logger.log("New key-system session "+c.sessionId),c.addEventListener("message",function(i){s._onKeySessionMessage(c,i.message)},!1)},a._onKeySessionMessage=function(c,s){L.logger.log("Got EME message event, creating license request"),this._requestLicense(s,function(i){L.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),c.update(i)})},a.onMediaEncrypted=function(c){var s=this;if(L.logger.log('Media is encrypted using "'+c.initDataType+'" init data type'),!this.mediaKeysPromise){L.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)},a._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){L.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}L.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(s.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(c,s){var i=this,n=this._mediaKeysList[0];if(!n){L.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){L.logger.warn("Key-Session already initialized but requested again");return}var O=n.mediaKeysSession;if(!O){L.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){L.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}L.logger.log('Generating key-session request for "'+c+'" init data type'),n.mediaKeysSessionInitialized=!0,O.generateRequest(c,s).then(function(){L.logger.debug("Key-session generation succeeded")}).catch(function(S){L.logger.error("Error generating key-session request:",S),i.hls.trigger(G.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._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(S){L.logger.error(S)}try{n.readyState||n.open("POST",c,!0),O&&O.call(this.hls,n,c)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return n},a._onLicenseRequestReadyStageChange=function(c,s,i,n){switch(c.readyState){case 4:if(c.status===200){this._requestLicenseFailureCount=0,L.logger.log("License request succeeded");var O=c.response,S=this._licenseResponseCallback;if(S)try{O=S.call(this.hls,c,s)}catch(R){L.logger.error(R)}n(O)}else{if(L.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;L.logger.warn("Retrying license request, "+C+" attempts left"),this._requestLicense(i,n)}break}},a._generateLicenseRequestChallenge=function(c,s){switch(c.mediaKeySystemDomain){case W.KeySystems.WIDEVINE:return s}throw new Error("unsupported key-system: "+c.mediaKeySystemDomain)},a._requestLicense=function(c,s){L.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){L.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);L.logger.log("Sending license request to URL: "+n);var S=this._generateLicenseRequestChallenge(i,c);O.send(S)}catch(C){L.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})}},a.onMediaAttached=function(c,s){if(!this._emeEnabled)return;var i=s.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},a.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(){})},a.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(W.KeySystems.WIDEVINE,i,n)},r(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();V.default=m},"./src/controller/fps-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/events.ts"),P=I("./src/utils/logger.ts"),L=function(){function W(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=W.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,E){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=E.media instanceof self.HTMLVideoElement?E.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),p.fpsDroppedMonitoringPeriod)}},k.checkFPS=function(M,E,p){var m=performance.now();if(E){if(this.lastTime){var u=m-this.lastTime,a=p-this.lastDroppedFrames,o=E-this.lastDecodedFrames,c=1e3*a/u,s=this.hls;if(s.trigger(G.Events.FPS_DROP,{currentDropped:a,currentDecoded:o,totalDroppedFrames:p}),c>0&&a>s.config.fpsDroppedMonitoringThreshold*o){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=p,this.lastDecodedFrames=E}},k.checkFPSInterval=function(){var M=this.media;if(M)if(this.isVideoPlaybackQualityAvailable){var E=M.getVideoPlaybackQuality();this.checkFPS(M,E.totalVideoFrames,E.droppedVideoFrames)}else this.checkFPS(M,M.webkitDecodedFrameCount,M.webkitDroppedFrameCount)},W}();V.default=L},"./src/controller/fragment-finders.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"findFragmentByPDT",function(){return L}),I.d(V,"findFragmentByPTS",function(){return W}),I.d(V,"fragmentWithinToleranceTest",function(){return k}),I.d(V,"pdtWithinToleranceTest",function(){return r}),I.d(V,"findFragWithCC",function(){return M});var G=I("./src/polyfills/number.ts"),P=I("./src/utils/binary-search.ts");function L(E,p,m){if(p===null||!Array.isArray(E)||!E.length||!Object(G.isFiniteNumber)(p))return null;var u=E[0].programDateTime;if(p<(u||0))return null;var a=E[E.length-1].endProgramDateTime;if(p>=(a||0))return null;m=m||0;for(var o=0;o<E.length;++o){var c=E[o];if(r(p,m,c))return c}return null}function W(E,p,m,u){m===void 0&&(m=0),u===void 0&&(u=0);var a=null;if(E?a=p[E.sn-p[0].sn+1]||null:m===0&&p[0].start===0&&(a=p[0]),a&&k(m,u,a)===0)return a;var o=P.default.search(p,k.bind(null,m,u));return o||a}function k(E,p,m){E===void 0&&(E=0),p===void 0&&(p=0);var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0));return m.start+m.duration-u<=E?1:m.start-u>E&&m.start?-1:0}function r(E,p,m){var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,a=m.endProgramDateTime||0;return a-u>E}function M(E,p){return P.default.search(E,function(m){return m.cc<p?1:m.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"FragmentState",function(){return L}),I.d(V,"FragmentTracker",function(){return W});var G=I("./src/events.ts"),P=I("./src/types/loader.ts"),L;(function(M){M.NOT_LOADED="NOT_LOADED",M.BACKTRACKED="BACKTRACKED",M.APPENDING="APPENDING",M.PARTIAL="PARTIAL",M.OK="OK"})(L||(L={}));var W=function(){function M(p){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=p,this._registerListeners()}var E=M.prototype;return E._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)},E._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)},E.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},E.getAppendedFrag=function(m,u){if(u===P.PlaylistLevelType.MAIN){var a=this.activeFragment,o=this.activeParts;if(!a)return null;if(o)for(var c=o.length;c--;){var s=o[c],i=s?s.end:a.appendedPTS;if(s.start<=m&&i!==void 0&&m<=i)return c>9&&(this.activeParts=o.slice(c-9)),s}else if(a.start<=m&&a.appendedPTS!==void 0&&m<=a.appendedPTS)return a}return this.getBufferedFrag(m,u)},E.getBufferedFrag=function(m,u){for(var a=this.fragments,o=Object.keys(a),c=o.length;c--;){var s=a[o[c]];if((s==null?void 0:s.body.type)===u&&s.buffered){var i=s.body;if(i.start<=m&&m<=i.end)return i}}return null},E.detectEvictedFragments=function(m,u,a){var o=this;Object.keys(this.fragments).forEach(function(c){var s=o.fragments[c];if(!s)return;if(!s.buffered){s.body.type===a&&o.removeFragment(s.body);return}var i=s.range[m];if(!i)return;i.time.some(function(n){var O=!o.isTimeBuffered(n.startPTS,n.endPTS,u);return O&&o.removeFragment(s.body),O})})},E.detectPartialFragments=function(m){var u=this,a=this.timeRanges,o=m.frag,c=m.part;if(!a||o.sn==="initSegment")return;var s=r(o),i=this.fragments[s];if(!i)return;Object.keys(a).forEach(function(n){var O=o.elementaryStreams[n];if(!O)return;var S=a[n],C=c!==null||O.partial===!0;i.range[n]=u.getBufferedTimes(o,c,C,S)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},E.fragBuffered=function(m){var u=r(m),a=this.fragments[u];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},E.getBufferedTimes=function(m,u,a,o){for(var c={time:[],partial:a},s=u?u.start:m.start,i=u?u.end:m.end,n=m.minEndPTS||i,O=m.maxStartPTS||s,S=0;S<o.length;S++){var C=o.start(S)-this.bufferPadding,R=o.end(S)+this.bufferPadding;if(O>=C&&n<=R){c.time.push({startPTS:Math.max(s,o.start(S)),endPTS:Math.min(i,o.end(S))});break}else if(s<R&&i>C)c.partial=!0,c.time.push({startPTS:Math.max(s,o.start(S)),endPTS:Math.min(i,o.end(S))});else if(i<=C)break}return c},E.getPartialFragment=function(m){var u=null,a,o,c,s=0,i=this.bufferPadding,n=this.fragments;return Object.keys(n).forEach(function(O){var S=n[O];if(!S)return;k(S)&&(o=S.body.start-i,c=S.body.end+i,m>=o&&m<=c&&(a=Math.min(m-o,c-m),s<=a&&(u=S.body,s=a)))}),u},E.getState=function(m){var u=r(m),a=this.fragments[u];return a?a.buffered?k(a)?L.PARTIAL:L.OK:a.backtrack?L.BACKTRACKED:L.APPENDING:L.NOT_LOADED},E.backtrack=function(m,u){var a=r(m),o=this.fragments[a];if(!o||o.backtrack)return null;var c=o.backtrack=u||o.loaded;return o.loaded=null,c},E.getBacktrackData=function(m){var u=r(m),a=this.fragments[u];if(a){var o,c=a.backtrack;if(c!=null&&(o=c.payload)!==null&&o!==void 0&&o.byteLength)return c;this.removeFragment(m)}return null},E.isTimeBuffered=function(m,u,a){for(var o,c,s=0;s<a.length;s++){if(o=a.start(s)-this.bufferPadding,c=a.end(s)+this.bufferPadding,m>=o&&u<=c)return!0;if(u<=o)return!1}return!1},E.onFragLoaded=function(m,u){var a=u.frag,o=u.part;if(a.sn==="initSegment"||a.bitrateTest||o)return;var c=r(a);this.fragments[c]={body:a,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},E.onBufferAppended=function(m,u){var a=this,o=u.frag,c=u.part,s=u.timeRanges;if(o.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=o,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(a.detectEvictedFragments(n,O),!c)for(var S=0;S<O.length;S++)o.appendedPTS=Math.max(O.end(S),o.appendedPTS||0)})},E.onFragBuffered=function(m,u){this.detectPartialFragments(u)},E.hasFragment=function(m){var u=r(m);return!!this.fragments[u]},E.removeFragmentsInRange=function(m,u,a){var o=this;Object.keys(this.fragments).forEach(function(c){var s=o.fragments[c];if(!s)return;if(s.buffered){var i=s.body;i.type===a&&i.start<u&&i.end>m&&o.removeFragment(i)}})},E.removeFragment=function(m){var u=r(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},E.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},M}();function k(M){var E,p;return M.buffered&&(((E=M.range.video)===null||E===void 0?void 0:E.partial)||((p=M.range.audio)===null||p===void 0?void 0:p.partial))}function r(M){return M.type+"_"+M.level+"_"+M.urlId+"_"+M.sn}},"./src/controller/gap-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"STALL_MINIMUM_DURATION_MS",function(){return k}),I.d(V,"MAX_START_GAP_JUMP",function(){return r}),I.d(V,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return M}),I.d(V,"SKIP_BUFFER_RANGE_START",function(){return E}),I.d(V,"default",function(){return p});var G=I("./src/utils/buffer-helper.ts"),P=I("./src/errors.ts"),L=I("./src/events.ts"),W=I("./src/utils/logger.ts"),k=250,r=2,M=.1,E=.05,p=function(){function m(a,o,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=a,this.media=o,this.fragmentTracker=c,this.hls=s}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(o){var c=this.config,s=this.media,i=this.stalled,n=s.currentTime,O=s.seeking,S=this.seeking&&!O,C=!this.seeking&&O;if(this.seeking=O,n!==o){if(this.moved=!0,i!==null){if(this.stallReported){var R=self.performance.now()-i;W.logger.warn("playback not stuck anymore @"+n+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||S)&&(this.stalled=null),s.paused||s.ended||s.playbackRate===0||!G.BufferHelper.getBuffered(s).length)return;var T=G.BufferHelper.bufferInfo(s,n,0),v=T.len>0,b=T.nextStart||0;if(!v&&!b)return;if(O){var f=T.len>r,h=!b||b-n>r&&!this.fragmentTracker.getPartialFragment(n);if(f||h)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var _,g=Math.max(b,T.start||0)-n,x=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=x==null||((_=x.details)===null||_===void 0)?void 0:_.live,F=N?x.details.targetduration*2:r;if(g>0&&g<=F){this._trySkipBufferHole(null);return}}var A=self.performance.now();if(i===null){this.stalled=A;return}var B=A-i;!O&&B>=k&&this._reportStall(T.len);var U=G.BufferHelper.bufferInfo(s,n,c.maxBufferHole);this._tryFixBufferStall(U,B)},u._tryFixBufferStall=function(o,c){var s=this.config,i=this.fragmentTracker,n=this.media,O=n.currentTime,S=i.getPartialFragment(O);if(S){var C=this._trySkipBufferHole(S);if(C)return}o.len>s.maxBufferHole&&c>s.highBufferWatchdogPeriod*1e3&&(W.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(o){var c=this.hls,s=this.media,i=this.stallReported;i||(this.stallReported=!0,W.logger.warn("Playback stalling at @"+s.currentTime+" due to low buffer (buffer="+o+")"),c.trigger(L.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:o}))},u._trySkipBufferHole=function(o){for(var c=this.config,s=this.hls,i=this.media,n=i.currentTime,O=0,S=G.BufferHelper.getBuffered(i),C=0;C<S.length;C++){var R=S.start(C);if(n+c.maxBufferHole>=O&&n<R){var T=Math.max(R+E,i.currentTime+M);return W.logger.warn("skipping hole, adjusting currentTime from "+n+" to "+T),this.moved=!0,this.stalled=null,i.currentTime=T,o&&s.trigger(L.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 "+T,frag:o}),T}O=S.end(C)}return 0},u._tryNudgeBuffer=function(){var o=this.config,c=this.hls,s=this.media,i=s.currentTime,n=(this.nudgeRetry||0)+1;if(this.nudgeRetry=n,n<o.nudgeMaxRetry){var O=i+n*o.nudgeOffset;W.logger.warn("Nudging 'currentTime' from "+i+" to "+O),s.currentTime=O,c.trigger(L.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else W.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+o.nudgeMaxRetry+" nudges"),c.trigger(L.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,I){"use strict";I.r(V);var G=I("./src/events.ts"),P=I("./src/utils/texttrack-utils.ts"),L=I("./src/demux/id3.ts"),W=.25,k=function(){function r(E){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=E,this._registerListeners()}var M=r.prototype;return M.destroy=function(){this._unregisterListeners()},M._registerListeners=function(){var p=this.hls;p.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M._unregisterListeners=function(){var p=this.hls;p.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(G.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(G.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},M.onMediaAttached=function(p,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(p){if(!this.media)return;for(var m=0;m<p.length;m++){var u=p[m];if(u.kind==="metadata"&&u.label==="id3")return Object(P.sendAddTrackEvent)(u,this.media),u}return this.media.addTextTrack("metadata","id3")},M.onFragParsingMetadata=function(p,m){if(!this.media)return;var u=m.frag,a=m.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var o=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,c=0;c<a.length;c++){var s=L.getID3Frames(a[c].data);if(s){var i=a[c].pts,n=c<a.length-1?a[c+1].pts:u.end,O=n-i;O<=0&&(n=i+W);for(var S=0;S<s.length;S++){var C=s[S];if(!L.isTimeStampFrame(C)){var R=new o(i,n,"");R.value=C,this.id3Track.addCue(R)}}}}},M.onBufferFlushing=function(p,m){var u=m.startOffset,a=m.endOffset,o=m.type;if(!o||o==="audio"){var c=this.id3Track;c&&Object(P.removeCuesInRange)(c,u,a)}},r}();V.default=k},"./src/controller/latency-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return r});var G=I("./src/errors.ts"),P=I("./src/events.ts"),L=I("./src/utils/logger.ts");function W(M,E){for(var p=0;p<E.length;p++){var m=E[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(M,m.key,m)}}function k(M,E,p){return E&&W(M.prototype,E),p&&W(M,p),M}var r=function(){function M(p){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=p,this.config=p.config,this.registerListeners()}var E=M.prototype;return E.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},E.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)},E.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)},E.onMediaAttached=function(m,u){this.media=u.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},E.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},E.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},E.onLevelUpdated=function(m,u){var a=u.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},E.onError=function(m,u){if(u.details!==G.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,L.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},E.timeupdate=function(){var m=this.media,u=this.levelDetails;if(!m||!u)return;this.currentTime=m.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var o=this.config,c=o.lowLatencyMode,s=o.maxLiveSyncPlaybackRate;if(!c||s===1)return;var i=this.targetLatency;if(i===null)return;var n=a-i,O=Math.min(this.maxLatency,i+u.targetduration),S=n<O;if(u.live&&S&&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)},E.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},E.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,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,a=m.partHoldBack,o=m.targetduration,c=this.config,s=c.liveSyncDuration,i=c.liveSyncDurationCount,n=c.lowLatencyMode,O=this.hls.userConfig,S=n&&a||u;(O.liveSyncDuration||O.liveSyncDurationCount||S===0)&&(S=s!==void 0?s:i*o);var C=o,R=1;return S+Math.min(this.stallCount*R,C)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,a=this.levelDetails;if(m===null||u===null||a===null)return null;var o=a.edge,c=m-u-this.edgeStalled,s=o-a.totalduration,i=o-(this.config.lowLatencyMode&&a.partTarget||a.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 u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var a=m.buffered.length;return a?m.buffered.end(a-1):u.edge-this.currentTime}}]),M}()},"./src/controller/level-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return c});var G=I("./src/types/level.ts"),P=I("./src/events.ts"),L=I("./src/errors.ts"),W=I("./src/utils/codecs.ts"),k=I("./src/controller/level-helper.ts"),r=I("./src/controller/base-playlist-controller.ts"),M=I("./src/types/loader.ts");function E(){return E=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},E.apply(this,arguments)}function p(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&&p(s.prototype,i),n&&p(s,n),s}function u(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,a(s,i)}function a(s,i){return a=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},a(s,i)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),c=function(s){u(i,s);function i(O){var S;return S=s.call(this,O,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var n=i.prototype;return n._registerListeners=function(){var S=this.hls;S.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(P.Events.ERROR,this.onError,this)},n._unregisterListeners=function(){var S=this.hls;S.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),S.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 S=this._levels;S.forEach(function(C){C.loadError=0}),s.prototype.startLoad.call(this)},n.onManifestLoaded=function(S,C){var R=[],T=[],v=[],b,f={},h,_=!1,g=!1,x=!1;if(C.levels.forEach(function(B){var U=B.attrs;_=_||!!(B.width&&B.height),g=g||!!B.videoCodec,x=x||!!B.audioCodec,o&&B.audioCodec&&B.audioCodec.indexOf("mp4a.40.34")!==-1&&(B.audioCodec=void 0);var w=B.bitrate+"-"+B.attrs.RESOLUTION+"-"+B.attrs.CODECS;h=f[w],h?h.url.push(B.url):(h=new G.Level(B),f[w]=h,R.push(h)),U&&(U.AUDIO&&Object(k.addGroupId)(h,"audio",U.AUDIO),U.SUBTITLES&&Object(k.addGroupId)(h,"text",U.SUBTITLES))}),(_||g)&&x&&(R=R.filter(function(B){var U=B.videoCodec,w=B.width,Y=B.height;return!!U||!!(w&&Y)})),R=R.filter(function(B){var U=B.audioCodec,w=B.videoCodec;return(!U||Object(W.isCodecSupportedInMp4)(U,"audio"))&&(!w||Object(W.isCodecSupportedInMp4)(w,"video"))}),C.audioTracks&&(T=C.audioTracks.filter(function(B){return!B.audioCodec||Object(W.isCodecSupportedInMp4)(B.audioCodec,"audio")}),Object(k.assignTrackIdsByGroup)(T)),C.subtitles&&(v=C.subtitles,Object(k.assignTrackIdsByGroup)(v)),R.length>0){b=R[0].bitrate,R.sort(function(B,U){return B.bitrate-U.bitrate}),this._levels=R;for(var N=0;N<R.length;N++)if(R[N].bitrate===b){this._firstLevel=N,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+b);break}var F=x&&!g,A={levels:R,audioTracks:T,subtitleTracks:v,firstLevel:this._firstLevel,stats:C.stats,audio:x,video:g,altAudio:!F&&T.some(function(B){return!!B.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:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:C.url,reason:"no level with compatible codecs found in manifest"})},n.onError=function(S,C){if(s.prototype.onError.call(this,S,C),C.fatal)return;var R=C.context,T=this._levels[this.currentLevelIndex];if(R&&(R.type===M.PlaylistContextType.AUDIO_TRACK&&T.audioGroupIds&&R.groupId===T.audioGroupIds[T.urlId]||R.type===M.PlaylistContextType.SUBTITLE_TRACK&&T.textGroupIds&&R.groupId===T.textGroupIds[T.urlId])){this.redundantFailover(this.currentLevelIndex);return}var v=!1,b=!0,f;switch(C.details){case L.ErrorDetails.FRAG_LOAD_ERROR:case L.ErrorDetails.FRAG_LOAD_TIMEOUT:case L.ErrorDetails.KEY_LOAD_ERROR:case L.ErrorDetails.KEY_LOAD_TIMEOUT:if(C.frag){var h=this._levels[C.frag.level];h?(h.fragmentError++,h.fragmentError>this.hls.config.fragLoadingMaxRetry&&(f=C.frag.level)):f=C.frag.level}break;case L.ErrorDetails.LEVEL_LOAD_ERROR:case L.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(b=!1),f=R.level),v=!0;break;case L.ErrorDetails.REMUX_ALLOC_ERROR:f=C.level,v=!0;break}f!==void 0&&this.recoverLevel(C,f,v,b)},n.recoverLevel=function(S,C,R,T){var v=S.details,b=this._levels[C];if(b.loadError++,R){var f=this.retryLoadingOrFail(S);if(f)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(T){var h=b.url.length;if(h>1&&b.loadError<h)S.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 "+_),S.levelRetry=!0,this.hls.nextAutoLevel=_)}}},n.redundantFailover=function(S){var C=this._levels[S],R=C.url.length;if(R>1){var T=(C.urlId+1)%R;this.warn("Switching to redundant URL-id "+T),this._levels.forEach(function(v){v.urlId=T}),this.level=S}},n.onFragLoaded=function(S,C){var R=C.frag;if(R!==void 0&&R.type===M.PlaylistLevelType.MAIN){var T=this._levels[R.level];T!==void 0&&(T.fragmentError=0,T.loadError=0)}},n.onLevelLoaded=function(S,C){var R,T=C.level,v=C.details,b=this._levels[T];if(!b){var f;this.warn("Invalid level index "+T),(f=C.deliveryDirectives)!==null&&f!==void 0&&f.skip&&(v.deltaUpdateFailed=!0);return}T===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(T,C,b.details)):(R=C.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(v.deltaUpdateFailed=!0)},n.onAudioTrackSwitched=function(S,C){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var T=-1,v=this.hls.audioTracks[C.id].groupId,b=0;b<R.audioGroupIds.length;b++)if(R.audioGroupIds[b]===v){T=b;break}T!==R.urlId&&(R.urlId=T,this.startLoad())}},n.loadPlaylist=function(S){var C=this.currentLevelIndex,R=this._levels[C];if(this.canLoad&&R&&R.url.length>0){var T=R.urlId,v=R.url[T];if(S)try{v=S.addDirectives(v)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+C+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+T+" "+v),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:v,level:C,id:T,deliveryDirectives:S||null})}},n.removeLevel=function(S,C){var R=function(b,f){return f!==C},T=this._levels.filter(function(v,b){return b!==S?!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,b){var f=v.details;return f!=null&&f.fragments&&f.fragments.forEach(function(h){h.level=b}),v});this._levels=T,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:T})},m(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var C,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===S&&(C=R[S])!==null&&C!==void 0&&C.details)return;if(S<0||S>=R.length){var T=S<0;if(this.hls.trigger(P.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:T,reason:"invalid level idx"}),T)return;S=Math.min(S,R.length-1)}this.clearTimer();var v=this.currentLevelIndex,b=R[v],f=R[S];this.log("switching to level "+S+" from "+v),this.currentLevelIndex=S;var h=E({},f,{level:S,maxBitrate:f.maxBitrate,uri:f.uri,urlId:f.urlId});delete h._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,h);var _=f.details;if(!_||_.live){var g=this.switchParams(f.uri,b==null?void 0:b.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),i}(r.default)},"./src/controller/level-helper.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"addGroupId",function(){return L}),I.d(V,"assignTrackIdsByGroup",function(){return W}),I.d(V,"updatePTS",function(){return k}),I.d(V,"updateFragPTSDTS",function(){return M}),I.d(V,"mergeDetails",function(){return E}),I.d(V,"mapPartIntersection",function(){return p}),I.d(V,"mapFragmentIntersection",function(){return m}),I.d(V,"adjustSliding",function(){return u}),I.d(V,"addSliding",function(){return a}),I.d(V,"computeReloadInterval",function(){return o}),I.d(V,"getFragmentWithSN",function(){return c}),I.d(V,"getPartWith",function(){return s});var G=I("./src/polyfills/number.ts"),P=I("./src/utils/logger.ts");function L(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 W(i){var n={};i.forEach(function(O){var S=O.groupId||"";O.id=n[S]=n[S]||0,n[S]++})}function k(i,n,O){var S=i[n],C=i[O];r(S,C)}function r(i,n){var O=n.startPTS;if(Object(G.isFiniteNumber)(O)){var S=0,C;n.sn>i.sn?(S=O-i.start,C=i):(S=i.start-O,C=n),C.duration!==S&&(C.duration=S)}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,S,C,R){var T=S-O;T<=0&&(P.logger.warn("Fragment should have a positive duration",n),S=O+n.duration,R=C+n.duration);var v=O,b=S,f=n.startPTS,h=n.endPTS;if(Object(G.isFiniteNumber)(f)){var _=Math.abs(f-O);Object(G.isFiniteNumber)(n.deltaPTS)?n.deltaPTS=Math.max(_,n.deltaPTS):n.deltaPTS=_,v=Math.max(O,f),O=Math.min(O,f),C=Math.min(C,n.startDTS),b=Math.min(S,h),S=Math.max(S,h),R=Math.max(R,n.endDTS)}n.duration=S-O;var g=O-n.start;n.appendedPTS=S,n.start=n.startPTS=O,n.maxStartPTS=v,n.startDTS=C,n.endPTS=S,n.minEndPTS=b,n.endDTS=R;var x=n.sn;if(!i||x<i.startSN||x>i.endSN)return 0;var N,F=x-i.startSN,A=i.fragments;for(A[F]=n,N=F;N>0;N--)r(A[N],A[N-1]);for(N=F;N<A.length-1;N++)r(A[N],A[N+1]);return i.fragmentHint&&r(A[A.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,g}function E(i,n){for(var O=null,S=i.fragments,C=S.length-1;C>=0;C--){var R=S[C].initSegment;if(R){O=R;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var T=0,v;if(m(i,n,function(N,F){N.relurl&&(T=N.cc-F.cc),Object(G.isFiniteNumber)(N.startPTS)&&Object(G.isFiniteNumber)(N.endPTS)&&(F.start=F.startPTS=N.startPTS,F.startDTS=N.startDTS,F.appendedPTS=N.appendedPTS,F.maxStartPTS=N.maxStartPTS,F.endPTS=N.endPTS,F.endDTS=N.endDTS,F.minEndPTS=N.minEndPTS,F.duration=N.endPTS-N.startPTS,F.duration&&(v=F),n.PTSKnown=n.alignedSliding=!0),F.elementaryStreams=N.elementaryStreams,F.loader=N.loader,F.stats=N.stats,F.urlId=N.urlId,N.initSegment&&(F.initSegment=N.initSegment,O=N.initSegment)}),O){var b=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;b.forEach(function(N){var F;(!N.initSegment||N.initSegment.relurl===((F=O)===null||F===void 0?void 0:F.relurl))&&(N.initSegment=O)})}if(n.skippedSegments&&(n.deltaUpdateFailed=n.fragments.some(function(N){return!N}),n.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=n.skippedSegments;f--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}var h=n.fragments;if(T){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var _=0;_<h.length;_++)h[_].cc+=T}n.skippedSegments&&(n.startCC=n.fragments[0].cc),p(i.partList,n.partList,function(N,F){F.elementaryStreams=N.elementaryStreams,F.stats=N.stats}),v?M(n,v,v.startPTS,v.endPTS,v.startDTS,v.endDTS):u(i,n),h.length&&(n.totalduration=n.edge-h[0].start),n.driftStartTime=i.driftStartTime,n.driftStart=i.driftStart;var g=n.advancedDateTime;if(n.advanced&&g){var x=n.edge;n.driftStart||(n.driftStartTime=g,n.driftStart=x),n.driftEndTime=g,n.driftEnd=x}else n.driftEndTime=i.driftEndTime,n.driftEnd=i.driftEnd,n.advancedDateTime=i.advancedDateTime}function p(i,n,O){if(i&&n)for(var S=0,C=0,R=i.length;C<=R;C++){var T=i[C],v=n[C+S];T&&v&&T.index===v.index&&T.fragment.sn===v.fragment.sn?O(T,v):S--}}function m(i,n,O){for(var S=n.skippedSegments,C=Math.max(i.startSN,n.startSN)-n.startSN,R=(i.fragmentHint?1:0)+(S?n.endSN:Math.min(i.endSN,n.endSN))-n.startSN,T=n.startSN-i.startSN,v=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments,b=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,f=C;f<=R;f++){var h=b[T+f],_=v[f];S&&!_&&f<S&&(_=n.fragments[f]=h),h&&_&&O(h,_)}}function u(i,n){var O=n.startSN+n.skippedSegments-i.startSN,S=i.fragments;if(O<0||O>=S.length)return;a(n,S[O].start)}function a(i,n){if(n){for(var O=i.fragments,S=i.skippedSegments;S<O.length;S++)O[S].start+=n;i.fragmentHint&&(i.fragmentHint.start+=n)}}function o(i,n){var O=1e3*i.levelTargetDuration,S=O/2,C=i.age,R=C>0&&C<O*3,T=n.loading.end-n.loading.start,v,b=i.availabilityDelay;if(i.updated===!1)if(R){var f=333*i.misses;v=Math.max(Math.min(S,T*2),f),i.availabilityDelay=(i.availabilityDelay||0)+v}else v=S;else R?(b=Math.min(b||O/2,C),i.availabilityDelay=b,v=b+O-C):v=O-T;return Math.round(v)}function c(i,n,O){if(!i||!i.details)return null;var S=i.details,C=S.fragments[n-S.startSN];return C||(C=S.fragmentHint,C&&C.sn===n?C:n<S.startSN&&O&&O.sn===n?O:null)}function s(i,n,O){if(!i||!i.details)return null;var S=i.details.partList;if(S)for(var C=S.length;C--;){var R=S[C];if(R.index===O&&R.fragment.sn===n)return R}return null}},"./src/controller/stream-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return S});var G=I("./src/polyfills/number.ts"),P=I("./src/controller/base-stream-controller.ts"),L=I("./src/is-supported.ts"),W=I("./src/events.ts"),k=I("./src/utils/buffer-helper.ts"),r=I("./src/controller/fragment-tracker.ts"),M=I("./src/types/loader.ts"),E=I("./src/loader/fragment.ts"),p=I("./src/demux/transmuxer-interface.ts"),m=I("./src/types/transmuxer.ts"),u=I("./src/controller/gap-controller.ts"),a=I("./src/errors.ts"),o=I("./src/utils/logger.ts");function c(C,R){for(var T=0;T<R.length;T++){var v=R[T];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function s(C,R,T){return R&&c(C.prototype,R),T&&c(C,T),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,b){return v.__proto__=b,v},n(C,R)}var O=100,S=function(C){i(R,C);function R(v,b){var f;return f=C.call(this,v,b,"[stream-controller]")||this,f.audioCodecSwap=!1,f.gapController=null,f.level=-1,f._forceStartLoad=!1,f.altAudio=!1,f.audioOnly=!1,f.fragPlaying=null,f.onvplaying=null,f.onvseeked=null,f.fragLastKbps=0,f.stalled=!1,f.couldBacktrack=!1,f.audioCodecSwitch=!1,f.videoBuffer=null,f._registerListeners(),f}var T=R.prototype;return T._registerListeners=function(){var b=this.hls;b.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on(W.Events.ERROR,this.onError,this),b.on(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on(W.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T._unregisterListeners=function(){var b=this.hls;b.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off(W.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off(W.Events.ERROR,this.onError,this),b.off(W.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off(W.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off(W.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off(W.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off(W.Events.FRAG_BUFFERED,this.onFragBuffered,this)},T.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},T.startLoad=function(b){if(this.levels){var f=this.lastCurrentTime,h=this.hls;if(this.stopLoad(),this.setInterval(O),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var _=h.startLevel;_===-1&&(h.config.testBandwidth?(_=0,this.bitrateTest=!0):_=h.nextAutoLevel),this.level=h.nextLoadLevel=_,this.loadedmetadata=!1}f>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),b=f),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},T.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},T.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var b,f=this.levels,h=this.level,_=f==null||((b=f[h])===null||b===void 0)?void 0:b.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,x=self.performance.now(),N=this.retryDate;(!N||x>=N||(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()},T.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},T.doTickIdle=function(){var b,f,h=this.hls,_=this.levelLastLoaded,g=this.levels,x=this.media,N=h.config,F=h.nextLoadLevel;if(_===null||!x&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[F])return;var A=g[F];this.level=h.nextLoadLevel=F;var B=A.details;if(!B||this.state===P.State.WAITING_LEVEL||B.live&&this.levelLastLoaded!==F){this.state=P.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:x,M.PlaylistLevelType.MAIN);if(U===null)return;var w=U.len,Y=this.getMaxBufferLength(A.maxBitrate);if(w>=Y)return;if(this._streamEnded(U,B)){var q={};this.altAudio&&(q.type="video"),this.hls.trigger(W.Events.BUFFER_EOS,q),this.state=P.State.ENDED;return}var ce=U.end,Ee=this.getNextFragment(ce,B);if(this.couldBacktrack&&!this.fragPrevious&&Ee&&Ee.sn!=="initSegment"){var Qe=Ee.sn-B.startSN;Qe>1&&(Ee=B.fragments[Qe-1],this.fragmentTracker.removeFragment(Ee))}if(Ee&&this.fragmentTracker.getState(Ee)===r.FragmentState.OK&&this.nextLoadPosition>ce){var Te=this.audioOnly&&!this.altAudio?E.ElementaryStreamTypes.AUDIO:E.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(x,Te,M.PlaylistLevelType.MAIN),Ee=this.getNextFragment(this.nextLoadPosition,B)}if(!Ee)return;Ee.initSegment&&!Ee.initSegment.data&&!this.bitrateTest&&(Ee=Ee.initSegment),((b=Ee.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((f=Ee.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Ee,B):this.loadFragment(Ee,B,ce)},T.loadFragment=function(b,f,h){var _,g=this.fragmentTracker.getState(b);if(this.fragCurrent=b,g===r.FragmentState.BACKTRACKED){var x=this.fragmentTracker.getBacktrackData(b);if(x){this._handleFragmentLoadProgress(x),this._handleFragmentLoadComplete(x);return}else g=r.FragmentState.NOT_LOADED}g===r.FragmentState.NOT_LOADED||g===r.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,b,f,h)):g===r.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((_=this.media)===null||_===void 0?void 0:_.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},T.getAppendedFrag=function(b){var f=this.fragmentTracker.getAppendedFrag(b,M.PlaylistLevelType.MAIN);return f&&"fragment"in f?f.fragment:f},T.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,M.PlaylistLevelType.MAIN)},T.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},T.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},T.nextLevelSwitch=function(){var b=this.levels,f=this.media;if(f!=null&&f.readyState){var h,_=this.getAppendedFrag(f.currentTime);if(_&&_.start>1&&this.flushMainBuffer(0,_.start-1),!f.paused&&b){var g=this.hls.nextLoadLevel,x=b[g],N=this.fragLastKbps;N&&this.fragCurrent?h=this.fragCurrent.duration*x.maxBitrate/(1e3*N)+1:h=0}else h=0;var F=this.getBufferedFrag(f.currentTime+h);if(F){var A=this.followingBufferedFrag(F);if(A){this.abortCurrentFrag();var B=A.maxStartPTS?A.maxStartPTS:A.start,U=A.duration,w=Math.max(F.end,B+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(w,Number.POSITIVE_INFINITY)}}}},T.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},T.flushMainBuffer=function(b,f){C.prototype.flushMainBuffer.call(this,b,f,this.altAudio?"video":null)},T.onMediaAttached=function(b,f){C.prototype.onMediaAttached.call(this,b,f);var h=f.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),h.addEventListener("playing",this.onvplaying),h.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,h,this.fragmentTracker,this.hls)},T.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},T.onMediaPlaying=function(){this.tick()},T.onMediaSeeked=function(){var b=this.media,f=b?b.currentTime:null;Object(G.isFiniteNumber)(f)&&this.log("Media seeked to "+f.toFixed(3)),this.tick()},T.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(W.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},T.onManifestParsed=function(b,f){var h=!1,_=!1,g;f.levels.forEach(function(x){g=x.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(h=!0),g.indexOf("mp4a.40.5")!==-1&&(_=!0))}),this.audioCodecSwitch=h&&_&&!Object(L.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=f.levels,this.startFragRequested=!1},T.onLevelLoading=function(b,f){var h=this.levels;if(!h||this.state!==P.State.IDLE)return;var _=h[f.level];(!_.details||_.details.live&&this.levelLastLoaded!==f.level||this.waitForCdnTuneIn(_.details))&&(this.state=P.State.WAITING_LEVEL)},T.onLevelLoaded=function(b,f){var h,_=this.levels,g=f.level,x=f.details,N=x.totalduration;if(!_){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+x.startSN+","+x.endSN+"], cc ["+x.startCC+", "+x.endCC+"] duration:"+N);var F=this.fragCurrent;F&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(F.level!==f.level&&F.loader&&(this.state=P.State.IDLE,F.loader.abort()));var A=_[g],B=0;if(x.live||(h=A.details)!==null&&h!==void 0&&h.live){if(x.fragments[0]||(x.deltaUpdateFailed=!0),x.deltaUpdateFailed)return;B=this.alignPlaylists(x,A.details)}if(A.details=x,this.levelLastLoaded=g,this.hls.trigger(W.Events.LEVEL_UPDATED,{details:x,level:g}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(x))return;this.state=P.State.IDLE}this.startFragRequested?x.live&&this.synchronizeToLiveEdge(x):this.setStartPosition(x,B),this.tick()},T._handleFragmentLoadProgress=function(b){var f,h=b.frag,_=b.part,g=b.payload,x=this.levels;if(!x){this.warn("Levels were reset while fragment load was in progress. Fragment "+h.sn+" of level "+h.level+" will not be buffered");return}var N=x[h.level],F=N.details;if(!F){this.warn("Dropping fragment "+h.sn+" of level "+h.level+" after level details were reset");return}var A=N.videoCodec,B=F.PTSKnown||!F.live,U=(f=h.initSegment)===null||f===void 0?void 0:f.data,w=this._getAudioCodec(N),Y=this.transmuxer=this.transmuxer||new p.default(this.hls,M.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),q=_?_.index:-1,ce=q!==-1,Ee=new m.ChunkMetadata(h.level,h.sn,h.stats.chunkCount,g.byteLength,q,ce),Qe=this.initPTS[h.cc];Y.push(g,U,w,A,h,_,F.totalduration,B,Ee,Qe)},T.onAudioTrackSwitching=function(b,f){var h=this.altAudio,_=!!f.url,g=f.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 x=this.fragCurrent;x!=null&&x.loader&&(this.log("Switching to main audio track, cancel main fragment load"),x.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;h&&N.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(W.Events.AUDIO_TRACK_SWITCHED,{id:g})}},T.onAudioTrackSwitched=function(b,f){var h=f.id,_=!!this.hls.audioTracks[h].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()},T.onBufferCreated=function(b,f){var h=f.tracks,_,g,x=!1;for(var N in h){var F=h[N];if(F.id==="main"){if(g=N,_=F,N==="video"){var A=h[N];A&&(this.videoBuffer=A.buffer)}}else x=!0}x&&_?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=_.buffer):this.mediaBuffer=this.media},T.onFragBuffered=function(b,f){var h=f.frag,_=f.part;if(h&&h.type!==M.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(h)){this.warn("Fragment "+h.sn+(_?" p: "+_.index:"")+" of level "+h.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var g=_?_.stats:h.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),h.sn!=="initSegment"&&(this.fragPrevious=h),this.fragBufferedComplete(h,_)},T.onError=function(b,f){switch(f.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(M.PlaylistLevelType.MAIN,f);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==P.State.ERROR&&(f.fatal?(this.warn(""+f.details),this.state=P.State.ERROR):!f.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var h=!0,_=this.getFwdBufferInfo(this.media,M.PlaylistLevelType.MAIN);_&&_.len>.5&&(h=!this.reduceMaxBufferLength(_.len)),h&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},T.checkBuffer=function(){var b=this.media,f=this.gapController;if(!b||!f||!b.readyState)return;var h=k.BufferHelper.getBuffered(b);!this.loadedmetadata&&h.length?(this.loadedmetadata=!0,this.seekToStartPos()):f.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},T.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},T.onBufferFlushed=function(b,f){var h=f.type;if(h!==E.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var _=(h===E.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(_,h,M.PlaylistLevelType.MAIN)}},T.onLevelsUpdated=function(b,f){this.levels=f.levels},T.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},T.seekToStartPos=function(){var b=this.media,f=b.currentTime,h=this.startPosition;if(h>=0&&f<h){if(b.seeking){o.logger.log("could not seek to "+h+", already seeking at "+f);return}var _=k.BufferHelper.getBuffered(b),g=_.length?_.start(0):0,x=g-h;x>0&&(x<this.config.maxBufferHole||x<this.config.maxFragLookUpTolerance)&&(o.logger.log("adjusting start position by "+x+" to match buffer start"),h+=x,this.startPosition=h),this.log("seek to target start position "+h+" from current time "+f),b.currentTime=h}},T._getAudioCodec=function(b){var f=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&f&&(this.log("Swapping audio codec"),f.indexOf("mp4a.40.5")!==-1?f="mp4a.40.2":f="mp4a.40.5"),f},T._loadBitrateTestFrag=function(b){var f=this;this._doFragLoad(b).then(function(h){var _=f.hls;if(!h||_.nextLoadLevel||f.fragContextChanged(b))return;f.fragLoadError=0,f.state=P.State.IDLE,f.startFragRequested=!1,f.bitrateTest=!1;var g=b.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),_.trigger(W.Events.FRAG_LOADED,h)})},T._handleTransmuxComplete=function(b){var f,h="main",_=this.hls,g=b.remuxResult,x=b.chunkMeta,N=this.getCurrentContext(x);if(!N){this.warn("The loading context changed while buffering fragment "+x.sn+" of level "+x.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(x.level);return}var F=N.frag,A=N.part,B=N.level,U=g.video,w=g.text,Y=g.id3,q=g.initSegment,ce=this.altAudio?void 0:g.audio;if(this.fragContextChanged(F))return;if(this.state=P.State.PARSING,q){q.tracks&&(this._bufferInitSegment(B,q.tracks,F,x),_.trigger(W.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:h,tracks:q.tracks}));var Ee=q.initPTS,Qe=q.timescale;Object(G.isFiniteNumber)(Ee)&&(this.initPTS[F.cc]=Ee,_.trigger(W.Events.INIT_PTS_FOUND,{frag:F,id:h,initPTS:Ee,timescale:Qe}))}if(U&&g.independent!==!1){if(B.details){var Te=U.startPTS,We=U.endPTS,$e=U.startDTS,Je=U.endDTS;if(A)A.elementaryStreams[U.type]={startPTS:Te,endPTS:We,startDTS:$e,endDTS:Je};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var Ce=this.getLoadPosition()+this.config.maxBufferHole;if(Ce<Te){this.backtrack(F);return}F.setElementaryStreamInfo(U.type,F.start,We,F.start,Je,!0)}F.setElementaryStreamInfo(U.type,Te,We,$e,Je),this.bufferFragmentData(U,F,A,x)}}else if(g.independent===!1){this.backtrack(F);return}if(ce){var X=ce.startPTS,j=ce.endPTS,K=ce.startDTS,Q=ce.endDTS;A&&(A.elementaryStreams[E.ElementaryStreamTypes.AUDIO]={startPTS:X,endPTS:j,startDTS:K,endDTS:Q}),F.setElementaryStreamInfo(E.ElementaryStreamTypes.AUDIO,X,j,K,Q),this.bufferFragmentData(ce,F,A,x)}if(Y!=null&&(f=Y.samples)!==null&&f!==void 0&&f.length){var re={frag:F,id:h,samples:Y.samples};_.trigger(W.Events.FRAG_PARSING_METADATA,re)}if(w){var z={frag:F,id:h,samples:w.samples};_.trigger(W.Events.FRAG_PARSING_USERDATA,z)}},T._bufferInitSegment=function(b,f,h,_){var g=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!f.audio&&!f.video,this.altAudio&&!this.audioOnly&&delete f.audio;var x=f.audio,N=f.video,F=f.audiovideo;if(x){var A=b.audioCodec,B=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(A&&(A.indexOf("mp4a.40.5")!==-1?A="mp4a.40.2":A="mp4a.40.5"),x.metadata.channelCount!==1&&B.indexOf("firefox")===-1&&(A="mp4a.40.5")),B.indexOf("android")!==-1&&x.container!=="audio/mpeg"&&(A="mp4a.40.2",this.log("Android: force audio codec to "+A)),b.audioCodec&&b.audioCodec!==A&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+A+'"'),x.levelCodec=A,x.id="main",this.log("Init audio buffer, container:"+x.container+", codecs[selected/level/parsed]=["+(A||"")+"/"+(b.audioCodec||"")+"/"+x.codec+"]")}N&&(N.levelCodec=b.videoCodec,N.id="main",this.log("Init video buffer, container:"+N.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+N.codec+"]")),F&&this.log("Init audiovideo buffer, container:"+F.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+F.codec+"]"),this.hls.trigger(W.Events.BUFFER_CODECS,f),Object.keys(f).forEach(function(U){var w=f[U],Y=w.initSegment;Y!=null&&Y.byteLength&&g.hls.trigger(W.Events.BUFFER_APPENDING,{type:U,data:Y,frag:h,part:null,chunkMeta:_,parent:h.type})}),this.tick()},T.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var f=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,f?this.resetFragmentLoading(b):this.state=P.State.BACKTRACKING},T.checkFragmentChanged=function(){var b=this.media,f=null;if(b&&b.readyState>1&&b.seeking===!1){var h=b.currentTime;if(k.BufferHelper.isBuffered(b,h)?f=this.getAppendedFrag(h):k.BufferHelper.isBuffered(b,h+.1)&&(f=this.getAppendedFrag(h+.1)),f){var _=this.fragPlaying,g=f.level;(!_||f.sn!==_.sn||_.level!==g||f.urlId!==_.urlId)&&(this.hls.trigger(W.Events.FRAG_CHANGED,{frag:f}),(!_||_.level!==g)&&this.hls.trigger(W.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=f)}}},s(R,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var f=this.getAppendedFrag(b.currentTime);if(f)return f.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var f=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(f)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"SubtitleStreamController",function(){return i});var G=I("./src/events.ts"),P=I("./src/utils/logger.ts"),L=I("./src/utils/buffer-helper.ts"),W=I("./src/controller/fragment-finders.ts"),k=I("./src/utils/discontinuities.ts"),r=I("./src/controller/level-helper.ts"),M=I("./src/controller/fragment-tracker.ts"),E=I("./src/controller/base-stream-controller.ts"),p=I("./src/types/loader.ts"),m=I("./src/types/level.ts");function u(n,O){for(var S=0;S<O.length;S++){var C=O[S];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(n,C.key,C)}}function a(n,O,S){return O&&u(n.prototype,O),S&&u(n,S),n}function o(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){o(O,n);function O(C,R){var T;return T=n.call(this,C,R,"[subtitle-stream-controller]")||this,T.levels=[],T.currentTrackId=-1,T.tracksBuffered=[],T.mainDetails=null,T._registerListeners(),T}var S=O.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._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)},S._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)},S.startLoad=function(){this.stopLoad(),this.state=E.State.IDLE,this.setInterval(s),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(R,T){this.mainDetails=T.details},S.onSubtitleFragProcessed=function(R,T){var v=T.frag,b=T.success;if(this.fragPrevious=v,this.state=E.State.IDLE,!b)return;var f=this.tracksBuffered[this.currentTrackId];if(!f)return;for(var h,_=v.start,g=0;g<f.length;g++)if(_>=f[g].start&&_<=f[g].end){h=f[g];break}var x=v.start+v.duration;h?h.end=x:(h={start:_,end:x},f.push(h)),this.fragmentTracker.fragBuffered(v)},S.onBufferFlushing=function(R,T){var v=T.startOffset,b=T.endOffset;if(v===0&&b!==Number.POSITIVE_INFINITY){var f=this.currentTrackId,h=this.levels;if(!h.length||!h[f]||!h[f].details)return;var _=h[f].details,g=_.targetduration,x=b-g;if(x<=0)return;T.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(N){for(var F=0;F<N.length;){if(N[F].end<=x){N.shift();continue}else if(N[F].start<x)N[F].start=x;else break;F++}}),this.fragmentTracker.removeFragmentsInRange(v,x,p.PlaylistLevelType.SUBTITLE)}},S.onError=function(R,T){var v,b=T.frag;if(!b||b.type!==p.PlaylistLevelType.SUBTITLE)return;(v=this.fragCurrent)!==null&&v!==void 0&&v.loader&&this.fragCurrent.loader.abort(),this.state=E.State.IDLE},S.onSubtitleTracksUpdated=function(R,T){var v=this,b=T.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(f){return new m.Level(f)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(f){v.tracksBuffered[f.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(R,T){if(this.currentTrackId=T.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)},S.onSubtitleTrackLoaded=function(R,T){var v,b=T.details,f=T.id,h=this.currentTrackId,_=this.levels;if(!_.length)return;var g=_[h];if(f>=_.length||f!==h||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(v=g.details)!==null&&v!==void 0&&v.live){var x=this.mainDetails;if(b.deltaUpdateFailed||!x)return;var N=x.fragments[0];if(!g.details)b.hasProgramDateTime&&x.hasProgramDateTime?Object(k.alignMediaPlaylistByPDT)(b,x):N&&Object(r.addSliding)(b,N.start);else{var F=this.alignPlaylists(b,g.details);F===0&&N&&Object(r.addSliding)(b,N.start)}}if(g.details=b,this.levelLastLoaded=f,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===E.State.IDLE){var A=Object(W.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);A||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},S._handleFragmentLoadComplete=function(R){var T=R.frag,v=R.payload,b=T.decryptdata,f=this.hls;if(this.fragContextChanged(T))return;if(v&&v.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var h=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(v),b.key.buffer,b.iv.buffer).then(function(_){var g=performance.now();f.trigger(G.Events.FRAG_DECRYPTED,{frag:T,payload:_,stats:{tstart:h,tdecrypt:g}})})}},S.doTick=function(){if(!this.media){this.state=E.State.IDLE;return}if(this.state===E.State.IDLE){var R,T=this.currentTrackId,v=this.levels;if(!v.length||!v[T]||!v[T].details)return;var b=v[T].details,f=b.targetduration,h=this.config,_=this.media,g=L.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,_.currentTime-f,h.maxBufferHole),x=g.end,N=g.len,F=this.getMaxBufferLength()+f;if(N>F)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var A=b.fragments,B=A.length,U=b.edge,w,Y=this.fragPrevious;if(x<U){var q=h.maxFragLookUpTolerance;Y&&b.hasProgramDateTime&&(w=Object(W.findFragmentByPDT)(A,Y.endProgramDateTime,q)),w||(w=Object(W.findFragmentByPTS)(Y,A,x,q),!w&&Y&&Y.start<A[0].start&&(w=A[0]))}else w=A[B-1];(R=w)!==null&&R!==void 0&&R.encrypted?(P.logger.log("Loading key for "+w.sn),this.state=E.State.KEY_LOADING,this.hls.trigger(G.Events.KEY_LOADING,{frag:w})):w&&this.fragmentTracker.getState(w)===M.FragmentState.NOT_LOADED&&this.loadFragment(w,b,x)}},S.loadFragment=function(R,T,v){this.fragCurrent=R,n.prototype.loadFragment.call(this,R,T,v)},a(O,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),O}(E.default)},"./src/controller/subtitle-track-controller.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/events.ts"),P=I("./src/utils/texttrack-utils.ts"),L=I("./src/controller/base-playlist-controller.ts"),W=I("./src/types/loader.ts");function k(u,a){for(var o=0;o<a.length;o++){var c=a[o];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(u,c.key,c)}}function r(u,a,o){return a&&k(u.prototype,a),o&&k(u,o),u}function M(u,a){u.prototype=Object.create(a.prototype),u.prototype.constructor=u,E(u,a)}function E(u,a){return E=Object.setPrototypeOf||function(c,s){return c.__proto__=s,c},E(u,a)}var p=function(u){M(a,u);function a(c){var s;return s=u.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 o=a.prototype;return o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,u.prototype.destroy.call(this)},o.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)},o.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)},o.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)},o.pollTrackChange=function(s){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,s)},o.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},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},o.onManifestParsed=function(s,i){this.tracks=i.subtitleTracks},o.onSubtitleTrackLoaded=function(s,i){var n=i.id,O=i.details,S=this.trackId,C=this.tracksInGroup[S];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))},o.onLevelLoading=function(s,i){this.switchLevel(i.level)},o.onLevelSwitching=function(s,i){this.switchLevel(i.level)},o.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,S=this.tracks.filter(function(T){return!n||T.groupId===n});this.tracksInGroup=S;var C=this.findTrackId(O==null?void 0:O.name)||this.findTrackId();this.groupId=n;var R={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(G.Events.SUBTITLE_TRACKS_UPDATED,R),C!==-1&&this.setSubtitleTrack(C,O)}},o.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},o.onError=function(s,i){if(u.prototype.onError.call(this,s,i),i.fatal||!i.context)return;i.context.type===W.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},o.loadPlaylist=function(s){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var n=i.id,O=i.groupId,S=i.url;if(s)try{S=s.addDirectives(S)}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:S,id:n,groupId:O,deliveryDirectives:s||null})}},o.toggleTrackModes=function(s){var i=this,n=this.media,O=this.subtitleDisplay,S=this.trackId;if(!n)return;var C=m(n.textTracks),R=C.filter(function(b){return b.groupId===i.groupId});if(s===-1)[].slice.call(C).forEach(function(b){b.mode="disabled"});else{var T=R[S];T&&(T.mode="disabled")}var v=R[s];v&&(v.mode=O?"showing":"hidden")},o.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 S=O[s];if(this.log("Switching to subtitle track "+s),this.trackId=s,S){var C=S.id,R=S.groupId,T=R===void 0?"":R,v=S.name,b=S.type,f=S.url;this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:C,groupId:T,name:v,type:b,url:f});var h=this.switchParams(S.url,i==null?void 0:i.details);this.loadPlaylist(h)}else this.hls.trigger(G.Events.SUBTITLE_TRACK_SWITCH,{id:s})},o.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(a,[{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)}}]),a}(L.default);function m(u){for(var a=[],o=0;o<u.length;o++){var c=u[o];c.kind==="subtitles"&&c.label&&a.push(u[o])}return a}V.default=p},"./src/controller/timeline-controller.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"TimelineController",function(){return m});var G=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),L=I("./src/utils/cea-608-parser.ts"),W=I("./src/utils/output-filter.ts"),k=I("./src/utils/webvtt-parser.ts"),r=I("./src/utils/texttrack-utils.ts"),M=I("./src/utils/imsc1-ttml-parser.ts"),E=I("./src/types/loader.ts"),p=I("./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=o(),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 W.default(this,"textTrack1"),O=new W.default(this,"textTrack2"),S=new W.default(this,"textTrack3"),C=new W.default(this,"textTrack4");this.cea608Parser1=new L.default(1,n,O),this.cea608Parser2=new L.default(3,S,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,S,C,R){for(var T=!1,v=R.length;v--;){var b=R[v],f=a(b[0],b[1],O,S);if(f>=0&&(b[0]=Math.min(b[0],O),b[1]=Math.max(b[1],S),T=!0,f/(S-O)>.5))return}if(T||R.push([O,S]),this.config.renderTextTracksNatively){var h=this.captionsTracks[n];this.Cues.newCue(h,O,S,C)}else{var _=this.Cues.newCue(null,O,S,C);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:_,track:n})}},s.onInitPtsFound=function(n,O){var S=this,C=O.frag,R=O.id,T=O.initPTS,v=O.timescale,b=this.unparsedVttFrags;R==="main"&&(this.initPTS[C.cc]=T,this.timescale[C.cc]=v),b.length&&(this.unparsedVttFrags=[],b.forEach(function(f){S.onFragLoaded(P.Events.FRAG_LOADED,f)}))},s.getExistingTrack=function(n){var O=this.media;if(O)for(var S=0;S<O.textTracks.length;S++){var C=O.textTracks[S];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,S=this.captionsTracks,C=this.media,R=O[n],T=R.label,v=R.languageCode,b=this.getExistingTrack(n);if(b)S[n]=b,Object(r.clearCurrentCues)(S[n]),Object(r.sendAddTrackEvent)(S[n],C);else{var f=this.createTextTrack("captions",T,v);f&&(f[n]=!0,S[n]=f)}},s.createNonNativeTrack=function(n){if(this.nonNativeCaptionsTracks[n])return;var O=this.captionsProperties[n];if(!O)return;var S=O.label,C={_id:n,label:S,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,S){var C=this.media;return C?C.addTextTrack(n,O,S):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=o(),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 S=0;S<O.length;S++)Object(r.clearCurrentCues)(O[S])},s.onSubtitleTracksUpdated=function(n,O){var S=this;this.textTracks=[];var C=O.subtitleTracks||[],R=C.some(function(f){return f.textCodec===M.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var T=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(f,h){var _;if(h<v.length){for(var g=null,x=0;x<v.length;x++)if(u(v[x],f)){g=v[x];break}g&&(_=g)}_?Object(r.clearCurrentCues)(_):(_=S.createTextTrack("subtitles",f.name,f.lang),_&&(_.mode="disabled")),_&&(_.groupId=f.groupId,S.textTracks.push(_))})}else if(!T&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(f){return{label:f.name,kind:f.type.toLowerCase(),default:f.default,subtitleTrack:f}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},s.onManifestLoaded=function(n,O){var S=this;this.config.enableCEA708Captions&&O.captions&&O.captions.forEach(function(C){var R=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(!R)return;var T="textTrack"+R[1],v=S.captionsProperties[T];if(!v)return;v.label=C.name,C.lang&&(v.languageCode=C.lang),v.media=C})},s.onFragLoading=function(n,O){var S=this.cea608Parser1,C=this.cea608Parser2,R=this.lastSn,T=this.lastPartIndex;if(!this.enabled||!(S&&C))return;if(O.frag.type===E.PlaylistLevelType.MAIN){var v,b,f=O.frag.sn,h=(v=O==null||((b=O.part)===null||b===void 0)?void 0:b.index)!=null?v:-1;f===R+1||f===R&&h===T+1||(S.reset(),C.reset()),this.lastSn=f,this.lastPartIndex=h}},s.onFragLoaded=function(n,O){var S=O.frag,C=O.payload,R=this.initPTS,T=this.unparsedVttFrags;if(S.type===E.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!Object(G.isFiniteNumber)(R[S.cc])){T.push(O),R.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var v=S.decryptdata;if(v==null||v.key==null||v.method!=="AES-128"){var b=this.tracks[S.level],f=this.vttCCs;f[S.cc]||(f[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),b&&b.textCodec===M.IMSC1_CODEC?this._parseIMSC1(S,C):this._parseVTTs(S,C,f)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},s._parseIMSC1=function(n,O){var S=this,C=this.hls;Object(M.parseIMSC1)(O,this.initPTS[n.cc],this.timescale[n.cc],function(R){S._appendCues(R,n.level),C.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(R){p.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,S){var C=this,R=this.hls;Object(k.parseWebVTT)(O,this.initPTS[n.cc],this.timescale[n.cc],S,n.cc,n.start,function(T){C._appendCues(T,n.level),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},function(T){C._fallbackToIMSC1(n,O),p.logger.log("Failed to parse VTT cue: "+T),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:T})})},s._fallbackToIMSC1=function(n,O){var S=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,S._parseIMSC1(n,O)},function(){C.textCodec="wvtt"})},s._appendCues=function(n,O){var S=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],T=R.default?"default":"subtitles"+O;S.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:n,track:T})}},s.onFragDecrypted=function(n,O){var S=O.frag;if(S.type===E.PlaylistLevelType.SUBTITLE){if(!Object(G.isFiniteNumber)(this.initPTS[S.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 S=this.cea608Parser1,C=this.cea608Parser2;if(!this.enabled||!(S&&C))return;for(var R=0;R<O.samples.length;R++){var T=O.samples[R].bytes;if(T){var v=this.extractCea608Data(T);S.addData(O.samples[R].pts,v[0]),C.addData(O.samples[R].pts,v[1])}}},s.onBufferFlushing=function(n,O){var S=O.startOffset,C=O.endOffset,R=O.endOffsetSubtitles,T=O.type,v=this.media;if(!v||v.currentTime<C)return;if(!T||T==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(h){return Object(r.removeCuesInRange)(b[h],S,C)})}if(this.config.renderTextTracksNatively&&(S===0&&R!==void 0)){var f=this.textTracks;Object.keys(f).forEach(function(h){return Object(r.removeCuesInRange)(f[h],S,R)})}},s.extractCea608Data=function(n){for(var O=n[0]&31,S=2,C=[[],[]],R=0;R<O;R++){var T=n[S++],v=127&n[S++],b=127&n[S++],f=(4&T)!==0,h=3&T;if(v===0&&b===0)continue;f&&((h===0||h===1)&&(C[h].push(v),C[h].push(b)))}return C},c}();function u(c,s){return c&&c.label===s.name&&!(c.textTrack1||c.textTrack2)}function a(c,s,i,n){return Math.min(s,n)-Math.max(c,i)}function o(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return G});var G=function(){function P(W,k){this.subtle=void 0,this.aesIV=void 0,this.subtle=W,this.aesIV=k}var L=P.prototype;return L.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,I){"use strict";I.r(V),I.d(V,"removePadding",function(){return P}),I.d(V,"default",function(){return L});var G=I("./src/utils/typed-array.ts");function P(W){var k=W.byteLength,r=k&&new DataView(W.buffer).getUint8(k-1);return r?Object(G.sliceUint8)(W,0,k-r):W}var L=function(){function W(){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=W.prototype;return k.uint8ArrayToUint32Array_=function(M){for(var E=new DataView(M),p=new Uint32Array(4),m=0;m<4;m++)p[m]=E.getUint32(m*4);return p},k.initTable=function(){var M=this.sBox,E=this.invSBox,p=this.subMix,m=p[0],u=p[1],a=p[2],o=p[3],c=this.invSubMix,s=c[0],i=c[1],n=c[2],O=c[3],S=new Uint32Array(256),C=0,R=0,T=0;for(T=0;T<256;T++)T<128?S[T]=T<<1:S[T]=T<<1^283;for(T=0;T<256;T++){var v=R^R<<1^R<<2^R<<3^R<<4;v=v>>>8^v&255^99,M[C]=v,E[v]=C;var b=S[C],f=S[b],h=S[f],_=S[v]*257^v*16843008;m[C]=_<<24|_>>>8,u[C]=_<<16|_>>>16,a[C]=_<<8|_>>>24,o[C]=_,_=h*16843009^f*65537^b*257^C*16843008,s[v]=_<<24|_>>>8,i[v]=_<<16|_>>>16,n[v]=_<<8|_>>>24,O[v]=_,C?(C=b^S[S[S[h^b]]],R^=S[S[R]]):C=R=1}},k.expandKey=function(M){for(var E=this.uint8ArrayToUint32Array_(M),p=!0,m=0;m<E.length&&p;)p=E[m]===this.key[m],m++;if(p)return;this.key=E;var u=this.keySize=E.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);var a=this.ksRows=(u+6+1)*4,o,c,s=this.keySchedule=new Uint32Array(a),i=this.invKeySchedule=new Uint32Array(a),n=this.sBox,O=this.rcon,S=this.invSubMix,C=S[0],R=S[1],T=S[2],v=S[3],b,f;for(o=0;o<a;o++){if(o<u){b=s[o]=E[o];continue}f=b,o%u===0?(f=f<<8|f>>>24,f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255],f^=O[o/u|0]<<24):u>6&&o%u===4&&(f=n[f>>>24]<<24|n[f>>>16&255]<<16|n[f>>>8&255]<<8|n[f&255]),s[o]=b=(s[o-u]^f)>>>0}for(c=0;c<a;c++)o=a-c,c&3?f=s[o]:f=s[o-4],c<4||o<=4?i[c]=f:i[c]=C[n[f>>>24]]^R[n[f>>>16&255]]^T[n[f>>>8&255]]^v[n[f&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,E,p){for(var m=this.keySize+6,u=this.invKeySchedule,a=this.invSBox,o=this.invSubMix,c=o[0],s=o[1],i=o[2],n=o[3],O=this.uint8ArrayToUint32Array_(p),S=O[0],C=O[1],R=O[2],T=O[3],v=new Int32Array(M),b=new Int32Array(v.length),f,h,_,g,x,N,F,A,B,U,w,Y,q,ce,Ee=this.networkToHostOrderSwap;E<v.length;){for(B=Ee(v[E]),U=Ee(v[E+1]),w=Ee(v[E+2]),Y=Ee(v[E+3]),x=B^u[0],N=Y^u[1],F=w^u[2],A=U^u[3],q=4,ce=1;ce<m;ce++)f=c[x>>>24]^s[N>>16&255]^i[F>>8&255]^n[A&255]^u[q],h=c[N>>>24]^s[F>>16&255]^i[A>>8&255]^n[x&255]^u[q+1],_=c[F>>>24]^s[A>>16&255]^i[x>>8&255]^n[N&255]^u[q+2],g=c[A>>>24]^s[x>>16&255]^i[N>>8&255]^n[F&255]^u[q+3],x=f,N=h,F=_,A=g,q=q+4;f=a[x>>>24]<<24^a[N>>16&255]<<16^a[F>>8&255]<<8^a[A&255]^u[q],h=a[N>>>24]<<24^a[F>>16&255]<<16^a[A>>8&255]<<8^a[x&255]^u[q+1],_=a[F>>>24]<<24^a[A>>16&255]<<16^a[x>>8&255]<<8^a[N&255]^u[q+2],g=a[A>>>24]<<24^a[x>>16&255]<<16^a[N>>8&255]<<8^a[F&255]^u[q+3],b[E]=Ee(f^S),b[E+1]=Ee(g^C),b[E+2]=Ee(_^R),b[E+3]=Ee(h^T),S=B,C=U,R=w,T=Y,E=E+4}return b.buffer},W}()},"./src/crypt/decrypter.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return E});var G=I("./src/crypt/aes-crypto.ts"),P=I("./src/crypt/fast-aes-key.ts"),L=I("./src/crypt/aes-decryptor.ts"),W=I("./src/utils/logger.ts"),k=I("./src/utils/mp4-tools.ts"),r=I("./src/utils/typed-array.ts"),M=16,E=function(){function p(u,a,o){var c=o===void 0?{}:o,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=u,this.config=a,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=p.prototype;return m.destroy=function(){this.observer=null},m.isSync=function(){return this.config.enableSoftwareAES},m.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var o=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(L.removePadding)(o):o},m.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},m.decrypt=function(a,o,c,s){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),o,c);var i=this.flush();i&&s(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),o,c).then(s)},m.softwareDecrypt=function(a,o,c){var s=this.currentIV,i=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(a=Object(k.appendUint8Array)(n,a),this.remainderData=null);var O=this.getValidChunk(a);if(!O.length)return null;s&&(c=s);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new L.default),S.expandKey(o);var C=i;return this.currentResult=S.decrypt(O.buffer,0,c),this.currentIV=Object(r.sliceUint8)(O,-16).buffer,C||null},m.webCryptoDecrypt=function(a,o,c){var s=this,i=this.subtle;return(this.key!==o||!this.fastAesKey)&&(this.key=o,this.fastAesKey=new P.default(i,o)),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(a.buffer,n)}).catch(function(n){return s.onWebCryptoError(n,a,o,c)})},m.onWebCryptoError=function(a,o,c,s){return W.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(o,c,s)},m.getValidChunk=function(a){var o=a,c=a.length-a.length%M;return c!==a.length&&(o=Object(r.sliceUint8)(a,0,c),this.remainderData=Object(r.sliceUint8)(a,c)),o},m.logOnce=function(a){if(!this.logEnabled)return;W.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return G});var G=function(){function P(W,k){this.subtle=void 0,this.key=void 0,this.subtle=W,this.key=k}var L=P.prototype;return L.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/demux/base-audio-demuxer.ts"),P=I("./src/demux/adts.ts"),L=I("./src/utils/logger.ts"),W=I("./src/demux/id3.ts");function k(E,p){E.prototype=Object.create(p.prototype),E.prototype.constructor=E,r(E,p)}function r(E,p){return r=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},r(E,p)}var M=function(E){k(p,E);function p(u,a){var o;return o=E.call(this)||this,o.observer=void 0,o.config=void 0,o.observer=u,o.config=a,o}var m=p.prototype;return m.resetInitSegment=function(a,o,c){E.prototype.resetInitSegment.call(this,a,o,c),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:c,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var o=W.getID3Data(a,0)||[],c=o.length,s=a.length;c<s;c++)if(P.probe(a,c))return L.logger.log("ADTS sync word found !"),!0;return!1},m.canParse=function(a,o){return P.canParse(a,o)},m.appendFrame=function(a,o,c){P.initTrackConfig(a,this.observer,o,c,a.manifestCodec);var s=P.appendFrame(a,o,c,this.initPTS,this.frameIndex);if(s&&s.missing===0)return s},p}(G.default);M.minProbeByteLength=9,V.default=M},"./src/demux/adts.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"getAudioConfig",function(){return W}),I.d(V,"isHeaderPattern",function(){return k}),I.d(V,"getHeaderLength",function(){return r}),I.d(V,"getFullFrameLength",function(){return M}),I.d(V,"canGetFrameLength",function(){return E}),I.d(V,"isHeader",function(){return p}),I.d(V,"canParse",function(){return m}),I.d(V,"probe",function(){return u}),I.d(V,"initTrackConfig",function(){return a}),I.d(V,"getFrameDuration",function(){return o}),I.d(V,"parseFrameHeader",function(){return c}),I.d(V,"appendFrame",function(){return s});var G=I("./src/utils/logger.ts"),P=I("./src/errors.ts"),L=I("./src/events.ts");function W(i,n,O,S){var C,R,T,v,b=navigator.userAgent.toLowerCase(),f=S,h=[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(_>h.length-1){i.trigger(L.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+_});return}return T=(n[O+2]&1)<<2,T|=(n[O+3]&192)>>>6,G.logger.log("manifest codec:"+S+", ADTS type:"+C+", samplingIndex:"+_),/firefox/i.test(b)?_>=6?(C=5,v=new Array(4),R=_-3):(C=2,v=new Array(2),R=_):b.indexOf("android")!==-1?(C=2,v=new Array(2),R=_):(C=5,v=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&_>=6?R=_-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(_>=6&&T===1||/vivaldi/i.test(b))||!S&&T===1)&&(C=2,v=new Array(2)),R=_)),v[0]=C<<3,v[0]|=(_&14)>>1,v[1]|=(_&1)<<7,v[1]|=T<<3,C===5&&(v[1]|=(R&14)>>1,v[2]=(R&1)<<7,v[2]|=2<<2,v[3]=0),{config:v,samplerate:h[_],channelCount:T,codec:"mp4a.40."+C,manifestCodec:f}}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 E(i,n){return n+5<i.length}function p(i,n){return n+1<i.length&&k(i,n)}function m(i,n){return E(i,n)&&k(i,n)&&M(i,n)<=i.length-n}function u(i,n){if(p(i,n)){var O=r(i,n);if(n+O>=i.length)return!1;var S=M(i,n);if(S<=O)return!1;var C=n+S;return C===i.length||p(i,C)}return!1}function a(i,n,O,S,C){if(!i.samplerate){var R=W(n,O,S,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 o(i){return 1024*9e4/i}function c(i,n,O,S,C){var R=r(i,n),T=M(i,n);if(T-=R,T>0){var v=O+S*C;return{headerLength:R,frameLength:T,stamp:v}}}function s(i,n,O,S,C){var R=o(i.samplerate),T=c(n,O,S,C,R);if(T){var v=T.frameLength,b=T.headerLength,f=T.stamp,h=b+v,_=Math.max(0,O+h-n.length),g;_?(g=new Uint8Array(h-b),g.set(n.subarray(O+b,n.length),0)):g=n.subarray(O+b,O+h);var x={unit:g,pts:f};return _||i.samples.push(x),{sample:x,length:h,missing:_}}}},"./src/demux/base-audio-demuxer.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"initPTSFn",function(){return M});var G=I("./src/polyfills/number.ts"),P=I("./src/demux/id3.ts"),L=I("./src/demux/dummy-demuxed-track.ts"),W=I("./src/utils/mp4-tools.ts"),k=I("./src/utils/typed-array.ts"),r=function(){function E(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=E.prototype;return p.resetInitSegment=function(u,a,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(u,a){return!1},p.appendFrame=function(u,a,o){},p.demux=function(u,a){this.cachedData&&(u=Object(W.appendUint8Array)(this.cachedData,u),this.cachedData=null);var o=P.getID3Data(u,0),c=o?o.length:0,s,i,n=this._audioTrack,O=this._id3Track,S=o?P.getTimeStamp(o):void 0,C=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=M(S,a)),o&&o.length>0&&O.samples.push({pts:this.initPTS,dts:this.initPTS,data:o}),i=this.initPTS;c<C;){if(this.canParse(u,c)){var R=this.appendFrame(n,u,c);R?(this.frameIndex++,i=R.sample.pts,c+=R.length,s=c):c=C}else P.canParse(u,c)?(o=P.getID3Data(u,c),O.samples.push({pts:i,dts:i,data:o}),c+=o.length,s=c):c++;if(c===C&&s!==C){var T=Object(k.sliceUint8)(u,s);this.cachedData?this.cachedData=Object(W.appendUint8Array)(this.cachedData,T):this.cachedData=T}}return{audioTrack:n,avcTrack:Object(L.dummyTrack)(),id3Track:O,textTrack:Object(L.dummyTrack)()}},p.demuxSampleAes=function(u,a,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(u){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(L.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(L.dummyTrack)()}},p.destroy=function(){},E}(),M=function(p,m){return Object(G.isFiniteNumber)(p)?p*90:m*9e4};V.default=r},"./src/demux/chunk-cache.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return G});var G=function(){function L(){this.chunks=[],this.dataLength=0}var W=L.prototype;return W.push=function(r){this.chunks.push(r),this.dataLength+=r.length},W.flush=function(){var r=this.chunks,M=this.dataLength,E;if(r.length)r.length===1?E=r[0]:E=P(r,M);else return new Uint8Array(0);return this.reset(),E},W.reset=function(){this.chunks.length=0,this.dataLength=0},L}();function P(L,W){for(var k=new Uint8Array(W),r=0,M=0;M<L.length;M++){var E=L[M];k.set(E,r),r+=E.length}return k}},"./src/demux/dummy-demuxed-track.ts":function(Z,V,I){"use strict";I.r(V),I.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,I){"use strict";I.r(V);var G=I("./src/utils/logger.ts"),P=function(){function L(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 W=L.prototype;return W.loadWord=function(){var r=this.data,M=this.bytesAvailable,E=r.byteLength-M,p=new Uint8Array(4),m=Math.min(4,M);if(m===0)throw new Error("no bytes available");p.set(r.subarray(E,E+m)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=m*8,this.bytesAvailable-=m},W.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)},W.readBits=function(r){var M=Math.min(this.bitsAvailable,r),E=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?E<<M|this.readBits(M):E},W.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()},W.skipUEG=function(){this.skipBits(1+this.skipLZ())},W.skipEG=function(){this.skipBits(1+this.skipLZ())},W.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},W.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},W.readBoolean=function(){return this.readBits(1)===1},W.readUByte=function(){return this.readBits(8)},W.readUShort=function(){return this.readBits(16)},W.readUInt=function(){return this.readBits(32)},W.skipScalingList=function(r){for(var M=8,E=8,p,m=0;m<r;m++)E!==0&&(p=this.readEG(),E=(M+p+256)%256),M=E===0?M:E},W.readSPS=function(){var r=0,M=0,E=0,p=0,m,u,a,o=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),S=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);o();var R=o();if(c(5),n(3),o(),S(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var T=s();if(T===3&&n(1),S(),S(),n(1),i())for(u=T!==3?8:12,a=0;a<u;a++)i()&&(a<6?C(16):C(64))}S();var v=s();if(v===0)s();else if(v===1)for(n(1),O(),O(),m=s(),a=0;a<m;a++)O();S(),n(1);var b=s(),f=s(),h=c(1);h===0&&n(1),n(1),i()&&(r=s(),M=s(),E=s(),p=s());var _=[1,1];if(i()&&i()){var g=o();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:{_=[o()<<8|o(),o()<<8|o()];break}}}return{width:Math.ceil((b+1)*16-r*2-M*2),height:(2-h)*(f+1)*16-(h?2:4)*(E+p),pixelRatio:_}},W.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},L}();V.default=P},"./src/demux/id3.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"isHeader",function(){return G}),I.d(V,"isFooter",function(){return P}),I.d(V,"getID3Data",function(){return L}),I.d(V,"canParse",function(){return k}),I.d(V,"getTimeStamp",function(){return r}),I.d(V,"isTimeStampFrame",function(){return M}),I.d(V,"getID3Frames",function(){return p}),I.d(V,"decodeFrame",function(){return m}),I.d(V,"utf8ArrayToStr",function(){return s}),I.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)))},L=function(C,R){for(var T=R,v=0;G(C,R);){v+=10;var b=W(C,R+6);v+=b,P(C,R+10)&&(v+=10),R+=v}return v>0?C.subarray(T,T+v):void 0},W=function(C,R){var T=0;return T=(C[R]&127)<<21,T|=(C[R+1]&127)<<14,T|=(C[R+2]&127)<<7,T|=C[R+3]&127,T},k=function(C,R){return G(C,R)&&W(C,R+6)+10<=C.length-R},r=function(C){for(var R=p(C),T=0;T<R.length;T++){var v=R[T];if(M(v))return c(v)}return},M=function(C){return C&&C.key==="PRIV"&&C.info==="com.apple.streaming.transportStreamTimestamp"},E=function(C){var R=String.fromCharCode(C[0],C[1],C[2],C[3]),T=W(C,4),v=10;return{type:R,size:T,data:C.subarray(v,v+T)}},p=function(C){for(var R=0,T=[];G(C,R);){var v=W(C,R+6);R+=10;for(var b=R+v;R+8<b;){var f=E(C.subarray(R)),h=m(f);h&&T.push(h),R+=f.size+10}P(C,R)&&(R+=10)}return T},m=function(C){return C.type==="PRIV"?u(C):C.type[0]==="W"?o(C):a(C)},u=function(C){if(C.size<2)return;var R=s(C.data,!0),T=new Uint8Array(C.data.subarray(R.length+1));return{key:C.type,info:R,data:T.buffer}},a=function(C){if(C.size<2)return;if(C.type==="TXXX"){var R=1,T=s(C.data.subarray(R),!0);R+=T.length+1;var v=s(C.data.subarray(R));return{key:C.type,info:T,data:v}}var b=s(C.data.subarray(1));return{key:C.type,data:b}},o=function(C){if(C.type==="WXXX"){if(C.size<2)return;var R=1,T=s(C.data.subarray(R),!0);R+=T.length+1;var v=s(C.data.subarray(R));return{key:C.type,info:T,data:v}}var b=s(C.data);return{key:C.type,data:b}},c=function(C){if(C.data.byteLength===8){var R=new Uint8Array(C.data),T=R[3]&1,v=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return v/=45,T&&(v+=4772185884e-2),Math.round(v)}return},s=function(C,R){R===void 0&&(R=!1);var T=O();if(T){var v=T.decode(C);if(R){var b=v.indexOf("\0");return b!==-1?v.substring(0,b):v}return v.replace(/\0/g,"")}for(var f=C.length,h,_,g,x="",N=0;N<f;){if(h=C[N++],h===0&&R)return x;if(h===0||h===3)continue;switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:x+=String.fromCharCode(h);break;case 12:case 13:_=C[N++],x+=String.fromCharCode((h&31)<<6|_&63);break;case 14:_=C[N++],g=C[N++],x+=String.fromCharCode((h&15)<<12|(_&63)<<6|(g&63)<<0);break;default:}}return x},i={decodeTextFrame:a},n;function O(){return!n&&typeof self.TextDecoder!="undefined"&&(n=new self.TextDecoder("utf-8")),n}},"./src/demux/mp3demuxer.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/demux/base-audio-demuxer.ts"),P=I("./src/demux/id3.ts"),L=I("./src/utils/logger.ts"),W=I("./src/demux/mpegaudio.ts");function k(E,p){E.prototype=Object.create(p.prototype),E.prototype.constructor=E,r(E,p)}function r(E,p){return r=Object.setPrototypeOf||function(u,a){return u.__proto__=a,u},r(E,p)}var M=function(E){k(p,E);function p(){return E.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(a,o,c){E.prototype.resetInitSegment.call(this,a,o,c),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:c,inputTimeScale:9e4,dropped:0}},p.probe=function(a){if(!a)return!1;for(var o=P.getID3Data(a,0)||[],c=o.length,s=a.length;c<s;c++)if(W.probe(a,c))return L.logger.log("MPEG Audio sync word found !"),!0;return!1},m.canParse=function(a,o){return W.canParse(a,o)},m.appendFrame=function(a,o,c){return this.initPTS===null?void 0:W.appendFrame(a,o,c,this.initPTS,this.frameIndex)},p}(G.default);M.minProbeByteLength=4,V.default=M},"./src/demux/mp4demuxer.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/utils/mp4-tools.ts"),P=I("./src/demux/dummy-demuxed-track.ts"),L=function(){function W(r,M){this.remainderData=null,this.config=void 0,this.config=M}var k=W.prototype;return k.resetTimeStamp=function(){},k.resetInitSegment=function(){},k.resetContiguity=function(){},W.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 E=M,p=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(E=Object(G.appendUint8Array)(this.remainderData,M));var m=Object(G.segmentValidRange)(E);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=E;return{audioTrack:Object(P.dummyTrack)(),avcTrack:p,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,E,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},k.destroy=function(){},W}();L.minProbeByteLength=1024,V.default=L},"./src/demux/mpegaudio.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"appendFrame",function(){return r}),I.d(V,"parseHeader",function(){return M}),I.d(V,"isHeaderPattern",function(){return E}),I.d(V,"isHeader",function(){return p}),I.d(V,"canParse",function(){return m}),I.d(V,"probe",function(){return u});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],L=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],W=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],k=[0,1,1,4];function r(a,o,c,s,i){if(c+24>o.length)return;var n=M(o,c);if(n&&c+n.frameLength<=o.length){var O=n.samplesPerFrame*9e4/n.sampleRate,S=s+i*O,C={unit:o.subarray(c,c+n.frameLength),pts:S,dts:S};return a.config=[],a.channelCount=n.channelCount,a.samplerate=n.sampleRate,a.samples.push(C),{sample:C,length:n.frameLength,missing:0}}}function M(a,o){var c=a[o+1]>>3&3,s=a[o+1]>>1&3,i=a[o+2]>>4&15,n=a[o+2]>>2&3;if(c!==1&&i!==0&&i!==15&&n!==3){var O=a[o+2]>>1&1,S=a[o+3]>>6,C=c===3?3-s:s===3?3:4,R=P[C*14+i-1]*1e3,T=c===3?0:c===2?1:2,v=L[T*3+n],b=S===3?1:2,f=W[c][s],h=k[s],_=f*8*h,g=Math.floor(f*R/v+O)*h;if(G===null){var x=navigator.userAgent||"",N=x.match(/Chrome\/(\d+)/i);G=N?parseInt(N[1]):0}var F=!!G&&G<=87;return F&&s===2&&R>=224e3&&S===0&&(a[o+3]=a[o+3]|128),{sampleRate:v,channelCount:b,frameLength:g,samplesPerFrame:_}}}function E(a,o){return a[o]===255&&(a[o+1]&224)===224&&(a[o+1]&6)!==0}function p(a,o){return o+1<a.length&&E(a,o)}function m(a,o){var c=4;return E(a,o)&&c<=a.length-o}function u(a,o){if(o+1<a.length&&E(a,o)){var c=4,s=M(a,o),i=c;s!=null&&s.frameLength&&(i=s.frameLength);var n=o+i;return n===a.length||p(a,n)}return!1}},"./src/demux/sample-aes.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/crypt/decrypter.ts"),P=I("./src/demux/tsdemuxer.ts"),L=function(){function W(r,M,E){this.keyData=void 0,this.decrypter=void 0,this.keyData=E,this.decrypter=new G.default(r,M,{removePKCS7Padding:!1})}var k=W.prototype;return k.decryptBuffer=function(M,E){this.decrypter.decrypt(M,this.keyData.key.buffer,this.keyData.iv.buffer,E)},k.decryptAacSample=function(M,E,p,m){var u=M[E].unit,a=u.subarray(16,u.length-u.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),c=this;this.decryptBuffer(o,function(s){var i=new Uint8Array(s);u.set(i,16),m||c.decryptAacSamples(M,E+1,p)})},k.decryptAacSamples=function(M,E,p){for(;;E++){if(E>=M.length){p();return}if(M[E].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(M,E,p,m),!m)return}},k.getAvcEncryptedData=function(M){for(var E=Math.floor((M.length-48)/160)*16+16,p=new Int8Array(E),m=0,u=32;u<=M.length-16;u+=160,m+=16)p.set(M.subarray(u,u+16),m);return p},k.getAvcDecryptedUnit=function(M,E){for(var p=new Uint8Array(E),m=0,u=32;u<=M.length-16;u+=160,m+=16)M.set(p.subarray(m,m+16),u);return M},k.decryptAvcSample=function(M,E,p,m,u,a){var o=Object(P.discardEPB)(u.data),c=this.getAvcEncryptedData(o),s=this;this.decryptBuffer(c.buffer,function(i){u.data=s.getAvcDecryptedUnit(o,i),a||s.decryptAvcSamples(M,E,p+1,m)})},k.decryptAvcSamples=function(M,E,p,m){if(M instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;E++,p=0){if(E>=M.length){m();return}for(var u=M[E].units;!(p>=u.length);p++){var a=u[p];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var o=this.decrypter.isSync();if(this.decryptAvcSample(M,E,p,m,a,o),!o)return}}},W}();V.default=L},"./src/demux/transmuxer-interface.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return u});var G=I("./node_modules/webworkify-webpack/index.js"),P=I.n(G),L=I("./src/events.ts"),W=I("./src/demux/transmuxer.ts"),k=I("./src/utils/logger.ts"),r=I("./src/errors.ts"),M=I("./src/utils/mediasource-helper.ts"),E=I("./node_modules/eventemitter3/index.js"),p=I.n(E),m=Object(M.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function a(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 S=c.config,C=function(f,h){h=h||{},h.frag=O.frag,h.id=O.id,c.trigger(f,h)};this.observer=new E.EventEmitter,this.observer.on(L.Events.FRAG_DECRYPTED,C),this.observer.on(L.Events.ERROR,C);var R={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},T=navigator.vendor;if(S.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(b){c.trigger(L.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},v.postMessage({cmd:"init",typeSupported:R,vendor:T,id:s,config:JSON.stringify(S)})}catch(b){k.logger.warn("Error in worker:",b),k.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new W.default(this.observer,R,S,T,s),this.worker=null}}else this.transmuxer=new W.default(this.observer,R,S,T,s)}var o=a.prototype;return o.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},o.push=function(s,i,n,O,S,C,R,T,v,b){var f=this;v.transmuxing.start=self.performance.now();var h=this.transmuxer,_=this.worker,g=C?C.start:S.start,x=S.decryptdata,N=this.frag,F=!(N&&S.cc===N.cc),A=!(N&&v.level===N.level),B=N?v.sn-N.sn:-1,U=this.part?v.part-this.part.index:1,w=!A&&(B===1||B===0&&U===1),Y=self.performance.now();(A||B||S.stats.parsing.start===0)&&(S.stats.parsing.start=Y),C&&(U||!w)&&(C.stats.parsing.start=Y);var q=new W.TransmuxState(F,w,T,A,g);if(!w||F){k.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+v.sn+" p: "+v.part+" level: "+v.level+" id: "+v.id+`
discontinuity: `+F+`
trackSwitch: `+A+`
contiguous: `+w+`
accurateTimeOffset: `+T+`
timeOffset: `+g);var ce=new W.TransmuxConfig(n,O,i,R,b);this.configureTransmuxer(ce)}if(this.frag=S,this.part=C,_)_.postMessage({cmd:"demux",data:s,decryptdata:x,chunkMeta:v,state:q},s instanceof ArrayBuffer?[s]:[]);else if(h){var Ee=h.push(s,x,v,q);Object(W.isPromise)(Ee)?Ee.then(function(Qe){f.handleTransmuxComplete(Qe)}):this.handleTransmuxComplete(Ee)}},o.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 S=n.flush(s);Object(W.isPromise)(S)?S.then(function(C){i.handleFlushResult(C,s)}):this.handleFlushResult(S,s)}},o.handleFlushResult=function(s,i){var n=this;s.forEach(function(O){n.handleTransmuxComplete(O)}),this.onFlush(i)},o.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}}},o.configureTransmuxer=function(s){var i=this.worker,n=this.transmuxer;i?i.postMessage({cmd:"configure",config:s}):n&&n.configure(s)},o.handleTransmuxComplete=function(s){s.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(s)},a}()},"./src/demux/transmuxer-worker.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return r});var G=I("./src/demux/transmuxer.ts"),P=I("./src/events.ts"),L=I("./src/utils/logger.ts"),W=I("./node_modules/eventemitter3/index.js"),k=I.n(W);function r(u){var a=new W.EventEmitter,o=function(s,i){u.postMessage({event:s,data:i})};a.on(P.Events.FRAG_DECRYPTED,o),a.on(P.Events.ERROR,o),u.addEventListener("message",function(c){var s=c.data;switch(s.cmd){case"init":{var i=JSON.parse(s.config);u.transmuxer=new G.default(a,s.typeSupported,i,s.vendor,s.id),Object(L.enableLogs)(i.debug),o("init",null);break}case"configure":{u.transmuxer.configure(s.config);break}case"demux":{var n=u.transmuxer.push(s.data,s.decryptdata,s.chunkMeta,s.state);Object(G.isPromise)(n)?n.then(function(C){M(u,C)}):M(u,n);break}case"flush":{var O=s.chunkMeta,S=u.transmuxer.flush(O);Object(G.isPromise)(S)?S.then(function(C){p(u,C,O)}):p(u,S,O);break}default:break}})}function M(u,a){if(m(a.remuxResult))return;var o=[],c=a.remuxResult,s=c.audio,i=c.video;s&&E(o,s),i&&E(o,i),u.postMessage({event:"transmuxComplete",data:a},o)}function E(u,a){a.data1&&u.push(a.data1.buffer),a.data2&&u.push(a.data2.buffer)}function p(u,a,o){a.forEach(function(c){M(u,c)}),u.postMessage({event:"flush",data:o})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return i}),I.d(V,"isPromise",function(){return S}),I.d(V,"TransmuxConfig",function(){return C}),I.d(V,"TransmuxState",function(){return R});var G=I("./src/events.ts"),P=I("./src/errors.ts"),L=I("./src/crypt/decrypter.ts"),W=I("./src/demux/aacdemuxer.ts"),k=I("./src/demux/mp4demuxer.ts"),r=I("./src/demux/tsdemuxer.ts"),M=I("./src/demux/mp3demuxer.ts"),E=I("./src/remux/mp4-remuxer.ts"),p=I("./src/remux/passthrough-remuxer.ts"),m=I("./src/demux/chunk-cache.ts"),u=I("./src/utils/mp4-tools.ts"),a=I("./src/utils/logger.ts"),o;try{o=self.performance.now.bind(self.performance)}catch(T){a.logger.debug("Unable to use Performance API on this environment"),o=self.Date.now}var c=[{demux:r.default,remux:E.default},{demux:k.default,remux:p.default},{demux:W.default,remux:E.default},{demux:M.default,remux:E.default}],s=1024;c.forEach(function(T){var v=T.demux;s=Math.max(s,v.minProbeByteLength)});var i=function(){function T(b,f,h,_,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=b,this.typeSupported=f,this.config=h,this.vendor=_,this.id=g}var v=T.prototype;return v.configure=function(f){this.transmuxConfig=f,this.decrypter&&this.decrypter.reset()},v.push=function(f,h,_,g){var x=this,N=_.transmuxing;N.executeStart=o();var F=new Uint8Array(f),A=this.cache,B=this.config,U=this.currentTransmuxState,w=this.transmuxConfig;g&&(this.currentTransmuxState=g);var Y=n(F,h);if(Y&&Y.method==="AES-128"){var q=this.getDecrypter();if(B.enableSoftwareAES){var ce=q.softwareDecrypt(F,Y.key.buffer,Y.iv.buffer);if(!ce)return N.executeEnd=o(),O(_);F=new Uint8Array(ce)}else return this.decryptionPromise=q.webCryptoDecrypt(F,Y.key.buffer,Y.iv.buffer).then(function(Ue){var rt=x.push(Ue,null,_);return x.decryptionPromise=null,rt}),this.decryptionPromise}var Ee=g||U,Qe=Ee.contiguous,Te=Ee.discontinuity,We=Ee.trackSwitch,$e=Ee.accurateTimeOffset,Je=Ee.timeOffset,Ce=w.audioCodec,X=w.videoCodec,j=w.defaultInitPts,K=w.duration,Q=w.initSegmentData;if((Te||We)&&this.resetInitSegment(Q,Ce,X,K),Te&&this.resetInitialTimestamp(j),Qe||this.resetContiguity(),this.needsProbing(F,Te,We)){if(A.dataLength){var re=A.flush();F=Object(u.appendUint8Array)(re,F)}this.configureTransmuxer(F,w)}var z=this.transmux(F,Y,Je,$e,_),we=this.currentTransmuxState;return we.contiguous=!0,we.discontinuity=!1,we.trackSwitch=!1,N.executeEnd=o(),z},v.flush=function(f){var h=this,_=f.transmuxing;_.executeStart=o();var g=this.decrypter,x=this.cache,N=this.currentTransmuxState,F=this.decryptionPromise;if(F)return F.then(function(){return h.flush(f)});var A=[],B=N.timeOffset;if(g){var U=g.flush();U&&A.push(this.push(U,null,f))}var w=x.dataLength;x.reset();var Y=this.demuxer,q=this.remuxer;if(!Y||!q)return w>=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=o(),[O(f)];var ce=Y.flush(B);return S(ce)?ce.then(function(Ee){return h.flushRemux(A,Ee,f),A}):(this.flushRemux(A,ce,f),A)},v.flushRemux=function(f,h,_){var g=h.audioTrack,x=h.avcTrack,N=h.id3Track,F=h.textTrack,A=this.currentTransmuxState,B=A.accurateTimeOffset,U=A.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+_.sn+(_.part>-1?" p: "+_.part:"")+" of level "+_.level);var w=this.remuxer.remux(g,x,N,F,U,B,!0,this.id);f.push({remuxResult:w,chunkMeta:_}),_.transmuxing.executeEnd=o()},v.resetInitialTimestamp=function(f){var h=this.demuxer,_=this.remuxer;if(!h||!_)return;h.resetTimeStamp(f),_.resetTimeStamp(f)},v.resetContiguity=function(){var f=this.demuxer,h=this.remuxer;if(!f||!h)return;f.resetContiguity(),h.resetNextTimestamp()},v.resetInitSegment=function(f,h,_,g){var x=this.demuxer,N=this.remuxer;if(!x||!N)return;x.resetInitSegment(h,_,g),N.resetInitSegment(f,h,_)},v.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},v.transmux=function(f,h,_,g,x){var N;return h&&h.method==="SAMPLE-AES"?N=this.transmuxSampleAes(f,h,_,g,x):N=this.transmuxUnencrypted(f,_,g,x),N},v.transmuxUnencrypted=function(f,h,_,g){var x=this.demuxer.demux(f,h,!1,!this.config.progressive),N=x.audioTrack,F=x.avcTrack,A=x.id3Track,B=x.textTrack,U=this.remuxer.remux(N,F,A,B,h,_,!1,this.id);return{remuxResult:U,chunkMeta:g}},v.transmuxSampleAes=function(f,h,_,g,x){var N=this;return this.demuxer.demuxSampleAes(f,h,_).then(function(F){var A=N.remuxer.remux(F.audioTrack,F.avcTrack,F.id3Track,F.textTrack,_,g,!1,N.id);return{remuxResult:A,chunkMeta:x}})},v.configureTransmuxer=function(f,h){for(var _=this.config,g=this.observer,x=this.typeSupported,N=this.vendor,F=h.audioCodec,A=h.defaultInitPts,B=h.duration,U=h.initSegmentData,w=h.videoCodec,Y,q=0,ce=c.length;q<ce;q++)if(c[q].demux.probe(f)){Y=c[q];break}Y||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),Y={demux:k.default,remux:p.default});var Ee=this.demuxer,Qe=this.remuxer,Te=Y.remux,We=Y.demux;(!Qe||!(Qe instanceof Te))&&(this.remuxer=new Te(g,_,x,N)),(!Ee||!(Ee instanceof We))&&(this.demuxer=new We(g,_,x),this.probe=We.probe),this.resetInitSegment(U,F,w,B),this.resetInitialTimestamp(A)},v.needsProbing=function(f,h,_){return!this.demuxer||!this.remuxer||h||_},v.getDecrypter=function(){var f=this.decrypter;return f||(f=this.decrypter=new L.default(this.observer,this.config)),f},T}();function n(T,v){var b=null;return T.byteLength>0&&v!=null&&v.key!=null&&v.iv!==null&&v.method!=null&&(b=v),b}var O=function(v){return{remuxResult:{},chunkMeta:v}};function S(T){return"then"in T&&T.then instanceof Function}var C=function(v,b,f,h,_){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=v,this.videoCodec=b,this.initSegmentData=f,this.duration=h,this.defaultInitPts=_},R=function(v,b,f,h,_){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=v,this.contiguous=b,this.accurateTimeOffset=f,this.trackSwitch=h,this.timeOffset=_}},"./src/demux/tsdemuxer.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"discardEPB",function(){return O});var G=I("./src/demux/adts.ts"),P=I("./src/demux/mpegaudio.ts"),L=I("./src/demux/exp-golomb.ts"),W=I("./src/demux/id3.ts"),k=I("./src/demux/sample-aes.ts"),r=I("./src/events.ts"),M=I("./src/utils/mp4-tools.ts"),E=I("./src/utils/logger.ts"),p=I("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function S(R,T,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=T,this.typeSupported=v}S.probe=function(T){var v=S.syncOffset(T);return v<0?!1:(v&&E.logger.warn("MPEG2-TS detected but first sync word found @ offset "+v+", junk ahead ?"),!0)},S.syncOffset=function(T){for(var v=Math.min(1e3,T.length-3*188),b=0;b<v;){if(T[b]===71&&T[b+188]===71&&T[b+2*188]===71)return b;b++}return-1},S.createTrack=function(T,v){return{container:T==="video"||T==="audio"?"video/mp2t":void 0,type:T,id:m[T],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:T==="audio"?v:void 0}};var C=S.prototype;return C.resetInitSegment=function(T,v,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",b),this._audioTrack=S.createTrack("audio",b),this._id3Track=S.createTrack("id3",b),this._txtTrack=S.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=T,this.videoCodec=v,this._duration=b},C.resetTimeStamp=function(){},C.resetContiguity=function(){var T=this._audioTrack,v=this._avcTrack,b=this._id3Track;T&&(T.pesData=null),v&&(v.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},C.demux=function(T,v,b,f){b===void 0&&(b=!1),f===void 0&&(f=!1),b||(this.sampleAes=null);var h,_=this._avcTrack,g=this._audioTrack,x=this._id3Track,N=_.pid,F=_.pesData,A=g.pid,B=x.pid,U=g.pesData,w=x.pesData,Y=!1,q=this.pmtParsed,ce=this._pmtId,Ee=T.length;if(this.remainderData&&(T=Object(M.appendUint8Array)(this.remainderData,T),Ee=T.length,this.remainderData=null),Ee<188&&!f)return this.remainderData=T,{audioTrack:g,avcTrack:_,id3Track:x,textTrack:this._txtTrack};var Qe=Math.max(0,S.syncOffset(T));Ee-=(Ee+Qe)%188,Ee<T.byteLength&&!f&&(this.remainderData=new Uint8Array(T.buffer,Ee,T.buffer.byteLength-Ee));for(var Te=Qe;Te<Ee;Te+=188)if(T[Te]===71){var We=!!(T[Te+1]&64),$e=((T[Te+1]&31)<<8)+T[Te+2],Je=(T[Te+3]&48)>>4,Ce=void 0;if(Je>1){if(Ce=Te+5+T[Te+4],Ce===Te+188)continue}else Ce=Te+4;switch($e){case N:We&&(F&&(h=s(F))&&this.parseAVCPES(h,!1),F={data:[],size:0}),F&&(F.data.push(T.subarray(Ce,Te+188)),F.size+=Te+188-Ce);break;case A:We&&(U&&(h=s(U))&&(g.isAAC?this.parseAACPES(h):this.parseMPEGPES(h)),U={data:[],size:0}),U&&(U.data.push(T.subarray(Ce,Te+188)),U.size+=Te+188-Ce);break;case B:We&&(w&&(h=s(w))&&this.parseID3PES(h),w={data:[],size:0}),w&&(w.data.push(T.subarray(Ce,Te+188)),w.size+=Te+188-Ce);break;case 0:We&&(Ce+=T[Ce]+1),ce=this._pmtId=o(T,Ce);break;case ce:{We&&(Ce+=T[Ce]+1);var X=c(T,Ce,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);N=X.avc,N>0&&(_.pid=N),A=X.audio,A>0&&(g.pid=A,g.isAAC=X.isAAC),B=X.id3,B>0&&(x.pid=B),Y&&!q&&(E.logger.log("reparse from beginning"),Y=!1,Te=Qe-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:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});_.pesData=F,g.pesData=U,x.pesData=w;var j={audioTrack:g,avcTrack:_,id3Track:x,textTrack:this._txtTrack};return f&&this.extractRemainingSamples(j),j},C.flush=function(){var T=this.remainderData;this.remainderData=null;var v;return T?v=this.demux(T,-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(T){var v=T.audioTrack,b=T.avcTrack,f=T.id3Track,h=b.pesData,_=v.pesData,g=f.pesData,x;h&&(x=s(h))?(this.parseAVCPES(x,!0),b.pesData=null):b.pesData=h,_&&(x=s(_))?(v.isAAC?this.parseAACPES(x):this.parseMPEGPES(x),v.pesData=null):(_!=null&&_.size&&E.logger.log("last AAC PES packet truncated,might overlap between fragments"),v.pesData=_),g&&(x=s(g))?(this.parseID3PES(x),f.pesData=null):f.pesData=g},C.demuxSampleAes=function(T,v,b){var f=this.demux(T,b,!0,!this.config.progressive),h=this.sampleAes=new k.default(this.observer,this.config,v);return this.decrypt(f,h)},C.decrypt=function(T,v){return new Promise(function(b){var f=T.audioTrack,h=T.avcTrack;f.samples&&f.isAAC?v.decryptAacSamples(f.samples,0,function(){h.samples?v.decryptAvcSamples(h.samples,0,0,function(){b(T)}):b(T)}):h.samples&&v.decryptAvcSamples(h.samples,0,0,function(){b(T)})})},C.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},C.parseAVCPES=function(T,v){var b=this,f=this._avcTrack,h=this.parseAVCNALu(T.data),_=!1,g=this.avcSample,x,N=!1;T.data=null,g&&h.length&&!f.audFound&&(i(g,f),g=this.avcSample=a(!1,T.pts,T.dts,"")),h.forEach(function(F){switch(F.type){case 1:{x=!0,g||(g=b.avcSample=a(!0,T.pts,T.dts,"")),_&&(g.debug+="NDR "),g.frame=!0;var A=F.data;if(N&&A.length>4){var B=new L.default(A).readSliceType();(B===2||B===4||B===7||B===9)&&(g.key=!0)}break}case 5:x=!0,g||(g=b.avcSample=a(!0,T.pts,T.dts,"")),_&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{x=!0,_&&g&&(g.debug+="SEI ");var U=new L.default(O(F.data));U.readUByte();for(var w=0,Y=0,q=!1,ce=0;!q&&U.bytesAvailable>1;){w=0;do ce=U.readUByte(),w+=ce;while(ce===255);Y=0;do ce=U.readUByte(),Y+=ce;while(ce===255);if(w===4&&U.bytesAvailable!==0){q=!0;var Ee=U.readUByte();if(Ee===181){var Qe=U.readUShort();if(Qe===49){var Te=U.readUInt();if(Te===1195456820){var We=U.readUByte();if(We===3){for(var $e=U.readUByte(),Je=U.readUByte(),Ce=31&$e,X=[$e,Je],j=0;j<Ce;j++)X.push(U.readUByte()),X.push(U.readUByte()),X.push(U.readUByte());n(b._txtTrack.samples,{type:3,pts:T.pts,bytes:X})}}}}}else if(w===5&&U.bytesAvailable!==0){if(q=!0,Y>16){for(var K=[],Q=0;Q<16;Q++)K.push(U.readUByte().toString(16)),(Q===3||Q===5||Q===7||Q===9)&&K.push("-");for(var re=Y-16,z=new Uint8Array(re),we=0;we<re;we++)z[we]=U.readUByte();n(b._txtTrack.samples,{pts:T.pts,payloadType:w,uuid:K.join(""),userData:Object(W.utf8ArrayToStr)(z),userDataBytes:z})}}else if(Y<U.bytesAvailable)for(var Ue=0;Ue<Y;Ue++)U.readUByte()}break}case 7:if(x=!0,N=!0,_&&g&&(g.debug+="SPS "),!f.sps){var rt=new L.default(F.data),le=rt.readSPS();f.width=le.width,f.height=le.height,f.pixelRatio=le.pixelRatio,f.sps=[F.data],f.duration=b._duration;for(var Oe=F.data.subarray(1,4),Fe="avc1.",Ye=0;Ye<3;Ye++){var Tt=Oe[Ye].toString(16);Tt.length<2&&(Tt="0"+Tt),Fe+=Tt}f.codec=Fe}break;case 8:x=!0,_&&g&&(g.debug+="PPS "),f.pps||(f.pps=[F.data]);break;case 9:x=!1,f.audFound=!0,g&&i(g,f),g=b.avcSample=a(!1,T.pts,T.dts,_?"AUD ":"");break;case 12:x=!1;break;default:x=!1,g&&(g.debug+="unknown NAL "+F.type+" ");break}if(g&&x){var Nt=g.units;Nt.push(F)}}),v&&g&&(i(g,f),this.avcSample=null)},C.getLastNalUnit=function(){var T,v=this.avcSample,b;if(!v||v.units.length===0){var f=this._avcTrack.samples;v=f[f.length-1]}if((T=v)!==null&&T!==void 0&&T.units){var h=v.units;b=h[h.length-1]}return b},C.parseAVCNALu=function(T){var v=T.byteLength,b=this._avcTrack,f=b.naluState||0,h=f,_=[],g=0,x,N,F,A=-1,B=0;for(f===-1&&(A=0,B=T[0]&31,f=0,g=1);g<v;){if(x=T[g++],!f){f=x?0:1;continue}if(f===1){f=x?0:2;continue}if(!x)f=3;else if(x===1){if(A>=0){var U={data:T.subarray(A,g-f-1),type:B};_.push(U)}else{var w=this.getLastNalUnit();if(w&&(h&&g<=4-h&&(w.state&&(w.data=w.data.subarray(0,w.data.byteLength-h))),N=g-f-1,N>0)){var Y=new Uint8Array(w.data.byteLength+N);Y.set(w.data,0),Y.set(T.subarray(0,N),w.data.byteLength),w.data=Y,w.state=0}}g<v?(F=T[g]&31,A=g,B=F,f=0):f=-1}else f=0}if(A>=0&&f>=0){var q={data:T.subarray(A,v),type:B,state:f};_.push(q)}if(_.length===0){var ce=this.getLastNalUnit();if(ce){var Ee=new Uint8Array(ce.data.byteLength+T.byteLength);Ee.set(ce.data,0),Ee.set(T,ce.data.byteLength),ce.data=Ee}}return b.naluState=f,_},C.parseAACPES=function(T){var v=0,b=this._audioTrack,f=this.aacOverFlow,h=T.data;if(f){this.aacOverFlow=null;var _=f.sample.unit.byteLength,g=Math.min(f.missing,_),x=_-g;f.sample.unit.set(h.subarray(0,g),x),b.samples.push(f.sample),v=f.missing}var N,F;for(N=v,F=h.length;N<F-1&&!G.isHeader(h,N);N++);if(N!==v){var A,B;if(N<F-1?(A="AAC PES did not start with ADTS header,offset:"+N,B=!1):(A="no ADTS header found in AAC PES",B=!0),E.logger.warn("parsing error:"+A),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:B,reason:A}),B)return}G.initTrackConfig(b,this.observer,h,N,this.audioCodec);var U;if(T.pts!==void 0)U=T.pts;else if(f){var w=G.getFrameDuration(b.samplerate);U=f.sample.pts+w}else{E.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var Y=0;N<F;)if(G.isHeader(h,N)){if(N+5<F){var q=G.appendFrame(b,h,N,U,Y);if(q)if(q.missing)this.aacOverFlow=q;else{N+=q.length,Y++;continue}}break}else N++},C.parseMPEGPES=function(T){var v=T.data,b=v.length,f=0,h=0,_=T.pts;if(_===void 0){E.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<b;)if(P.isHeader(v,h)){var g=P.appendFrame(this._audioTrack,v,h,_,f);if(g)h+=g.length,f++;else break}else h++},C.parseID3PES=function(T){if(T.pts===void 0){E.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(T)},S}();u.minProbeByteLength=188;function a(S,C,R,T){return{key:S,frame:!1,pts:C,dts:R,units:[],debug:T,length:0}}function o(S,C){return(S[C+10]&31)<<8|S[C+11]}function c(S,C,R,T){var v={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(S[C+1]&15)<<8|S[C+2],f=C+3+b-4,h=(S[C+10]&15)<<8|S[C+11];for(C+=12+h;C<f;){var _=(S[C+1]&31)<<8|S[C+2];switch(S[C]){case 207:if(!T){E.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(!T){E.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):E.logger.log("MPEG audio found, not supported in this browser");break;case 36:E.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((S[C+3]&15)<<8|S[C+4])+5}return v}function s(S){var C=0,R,T,v,b,f,h=S.data;if(!S||S.size===0)return null;for(;h[0].length<19&&h.length>1;){var _=new Uint8Array(h[0].length+h[1].length);_.set(h[0]),_.set(h[1],h[0].length),h[0]=_,h.splice(1,1)}R=h[0];var g=(R[0]<<16)+(R[1]<<8)+R[2];if(g===1){if(T=(R[4]<<8)+R[5],T&&T>S.size-6)return null;var x=R[7];x&192&&(b=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,x&64?(f=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,b-f>60*9e4&&(E.logger.warn(Math.round((b-f)/9e4)+"s delta between PTS and DTS, align them"),b=f)):f=b),v=R[8];var N=v+9;if(S.size<=N)return null;S.size-=N;for(var F=new Uint8Array(S.size),A=0,B=h.length;A<B;A++){R=h[A];var U=R.byteLength;if(N)if(N>U){N-=U;continue}else R=R.subarray(N),U-=N,N=0;F.set(R,C),C+=U}return T&&(T-=v+3),{data:F,pts:b,dts:f,len:T}}return null}function i(S,C){if(S.units.length&&S.frame){if(S.pts===void 0){var R=C.samples,T=R.length;if(T){var v=R[T-1];S.pts=v.pts,S.dts=v.dts}else{C.dropped++;return}}C.samples.push(S)}S.debug.length&&E.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function n(S,C){var R=S.length;if(R>0){if(C.pts>=S[R-1].pts)S.push(C);else for(var T=R-1;T>=0;T--)if(C.pts<S[T].pts){S.splice(T,0,C);break}}else S.push(C)}function O(S){for(var C=S.byteLength,R=[],T=1;T<C-2;)S[T]===0&&S[T+1]===0&&S[T+2]===3?(R.push(T+2),T+=2):T++;if(R.length===0)return S;var v=C-R.length,b=new Uint8Array(v),f=0;for(T=0;T<v;f++,T++)f===R[0]&&(f++,R.shift()),b[T]=S[f];return b}V.default=u},"./src/errors.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"ErrorTypes",function(){return G}),I.d(V,"ErrorDetails",function(){return P});var G;(function(L){L.NETWORK_ERROR="networkError",L.MEDIA_ERROR="mediaError",L.KEY_SYSTEM_ERROR="keySystemError",L.MUX_ERROR="muxError",L.OTHER_ERROR="otherError"})(G||(G={}));var P;(function(L){L.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",L.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",L.KEY_SYSTEM_NO_SESSION="keySystemNoSession",L.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",L.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",L.MANIFEST_LOAD_ERROR="manifestLoadError",L.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",L.MANIFEST_PARSING_ERROR="manifestParsingError",L.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",L.LEVEL_EMPTY_ERROR="levelEmptyError",L.LEVEL_LOAD_ERROR="levelLoadError",L.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",L.LEVEL_SWITCH_ERROR="levelSwitchError",L.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",L.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",L.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",L.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",L.FRAG_LOAD_ERROR="fragLoadError",L.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",L.FRAG_DECRYPT_ERROR="fragDecryptError",L.FRAG_PARSING_ERROR="fragParsingError",L.REMUX_ALLOC_ERROR="remuxAllocError",L.KEY_LOAD_ERROR="keyLoadError",L.KEY_LOAD_TIMEOUT="keyLoadTimeOut",L.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",L.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",L.BUFFER_APPEND_ERROR="bufferAppendError",L.BUFFER_APPENDING_ERROR="bufferAppendingError",L.BUFFER_STALLED_ERROR="bufferStalledError",L.BUFFER_FULL_ERROR="bufferFullError",L.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",L.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",L.INTERNAL_EXCEPTION="internalException",L.INTERNAL_ABORTED="aborted",L.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(Z,V,I){"use strict";I.r(V),I.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,I){"use strict";I.r(V),I.d(V,"default",function(){return S});var G=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(G),L=I("./src/loader/playlist-loader.ts"),W=I("./src/loader/key-loader.ts"),k=I("./src/controller/id3-track-controller.ts"),r=I("./src/controller/latency-controller.ts"),M=I("./src/controller/level-controller.ts"),E=I("./src/controller/fragment-tracker.ts"),p=I("./src/controller/stream-controller.ts"),m=I("./src/is-supported.ts"),u=I("./src/utils/logger.ts"),a=I("./src/config.ts"),o=I("./node_modules/eventemitter3/index.js"),c=I.n(o),s=I("./src/events.ts"),i=I("./src/errors.ts");function n(C,R){for(var T=0;T<R.length;T++){var v=R[T];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(C,v.key,v)}}function O(C,R,T){return R&&n(C.prototype,R),T&&n(C,T),C}var S=function(){C.isSupported=function(){return Object(m.isSupported)()};function C(T){T===void 0&&(T={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new o.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(a.mergeConfig)(C.DefaultConfig,T);this.userConfig=T,Object(u.enableLogs)(v.debug),this._autoLevelCapping=-1,v.progressive&&Object(a.enableStreamingMode)(v);var b=v.abrController,f=v.bufferController,h=v.capLevelController,_=v.fpsController,g=this.abrController=new b(this),x=this.bufferController=new f(this),N=this.capLevelController=new h(this),F=new _(this),A=new L.default(this),B=new W.default(this),U=new k.default(this),w=this.levelController=new M.default(this),Y=new E.FragmentTracker(this),q=this.streamController=new p.default(this,Y);N.setStreamController(q),F.setStreamController(q);var ce=[w,q];this.networkControllers=ce;var Ee=[A,B,g,x,N,F,U,Y];this.audioTrackController=this.createController(v.audioTrackController,null,ce),this.createController(v.audioStreamController,Y,ce),this.subtitleTrackController=this.createController(v.subtitleTrackController,null,ce),this.createController(v.subtitleStreamController,Y,ce),this.createController(v.timelineController,null,Ee),this.emeController=this.createController(v.emeController,null,Ee),this.cmcdController=this.createController(v.cmcdController,null,Ee),this.latencyController=this.createController(r.default,null,Ee),this.coreComponents=Ee}var R=C.prototype;return R.createController=function(v,b,f){if(v){var h=b?new v(this,b):new v(this);return f&&f.push(h),h}return null},R.on=function(v,b,f){f===void 0&&(f=this),this._emitter.on(v,b,f)},R.once=function(v,b,f){f===void 0&&(f=this),this._emitter.once(v,b,f)},R.removeAllListeners=function(v){this._emitter.removeAllListeners(v)},R.off=function(v,b,f,h){f===void 0&&(f=this),this._emitter.off(v,b,f,h)},R.listeners=function(v){return this._emitter.listeners(v)},R.emit=function(v,b,f){return this._emitter.emit(v,b,f)},R.trigger=function(v,b){if(this.config.debug)return this.emit(v,v,b);try{return this.emit(v,v,b)}catch(f){u.logger.error("An internal error happened while handling event "+v+'. Error message: "'+f.message+'". Here is a stacktrace:',f),this.trigger(s.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:v,error:f})}return!1},R.listenerCount=function(v){return this._emitter.listenerCount(v)},R.destroy=function(){u.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){u.logger.log("attachMedia"),this._media=v,this.trigger(s.Events.MEDIA_ATTACHING,{media:v})},R.detachMedia=function(){u.logger.log("detachMedia"),this.trigger(s.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(v){this.stopLoad();var b=this.media,f=this.url,h=this.url=G.buildAbsoluteURL(self.location.href,v,{alwaysNormalize:!0});u.logger.log("loadSource:"+h),b&&f&&f!==h&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(s.Events.MANIFEST_LOADING,{url:v})},R.startLoad=function(v){v===void 0&&(v=-1),u.logger.log("startLoad("+v+")"),this.networkControllers.forEach(function(b){b.startLoad(v)})},R.stopLoad=function(){u.logger.log("stopLoad"),this.networkControllers.forEach(function(v){v.stopLoad()})},R.swapAudioCodec=function(){u.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){u.logger.log("recoverMediaError");var v=this._media;this.detachMedia(),v&&this.attachMedia(v)},R.removeLevel=function(v,b){b===void 0&&(b=0),this.levelController.removeLevel(v,b)},O(C,[{key:"levels",get:function(){var v=this.levelController.levels;return v||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(v){u.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){u.logger.log("set nextLevel:"+v),this.levelController.manualLevel=v,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(v){u.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){u.logger.log("set firstLevel:"+v),this.levelController.firstLevel=v}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(v){u.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 b=!!v;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(v){this._autoLevelCapping!==v&&(u.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,b=this.config.minAutoBitrate;if(!v)return 0;for(var f=v.length,h=0;h<f;h++)if(v[h].maxBitrate>b)return h;return 0}},{key:"maxAutoLevel",get:function(){var v=this.levels,b=this.autoLevelCapping,f;return b===-1&&v&&v.length?f=v.length-1:f=b,f}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(v){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,v)}},{key:"audioTracks",get:function(){var v=this.audioTrackController;return v?v.audioTracks:[]}},{key:"audioTrack",get:function(){var v=this.audioTrackController;return v?v.audioTrack:-1},set:function(v){var b=this.audioTrackController;b&&(b.audioTrack=v)}},{key:"subtitleTracks",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var v=this.subtitleTrackController;return v?v.subtitleTrack:-1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleTrack=v)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var v=this.subtitleTrackController;return v?v.subtitleDisplay:!1},set:function(v){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=v)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(v){this.config.lowLatencyMode=v}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return 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:a.hlsDefaultConfig},set:function(v){C.defaultConfig=v}}]),C}();S.defaultConfig=void 0},"./src/is-supported.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"isSupported",function(){return L}),I.d(V,"changeTypeSupported",function(){return W});var G=I("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function L(){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"'),E=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!M&&!!E}function W(){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,I){"use strict";I.r(V),I.d(V,"default",function(){return u}),I.d(V,"LoadError",function(){return o});var G=I("./src/polyfills/number.ts"),P=I("./src/errors.ts");function L(c,s){c.prototype=Object.create(s.prototype),c.prototype.constructor=c,E(c,s)}function W(c){var s=typeof Map=="function"?new Map:void 0;return W=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,p(this).constructor)}return O.prototype=Object.create(n.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),E(O,n)},W(c)}function k(c,s,i){return r()?k=Reflect.construct:k=function(O,S,C){var R=[null];R.push.apply(R,S);var T=Function.bind.apply(O,R),v=new T;return C&&E(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 E(c,s){return E=Object.setPrototypeOf||function(n,O){return n.__proto__=O,n},E(c,s)}function p(c){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(c)}var m=Math.pow(2,17),u=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 S=this,C=n.url;if(!C)return Promise.reject(new o({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,T=R.fLoader,v=R.loader;return new Promise(function(b,f){S.loader&&S.loader.destroy();var h=S.loader=n.loader=T?new T(R):new v(R),_=a(n),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};n.stats=h.stats,h.load(_,g,{onSuccess:function(N,F,A,B){S.resetLoader(n,h),b({frag:n,part:null,payload:N.data,networkDetails:B})},onError:function(N,F,A){S.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,response:N,networkDetails:A}))},onAbort:function(N,F,A){S.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,networkDetails:A}))},onTimeout:function(N,F,A){S.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:n,networkDetails:A}))},onProgress:function(N,F,A,B){O&&O({frag:n,part:null,payload:A,networkDetails:B})}})})},s.loadPart=function(n,O,S){var C=this;this.abort();var R=this.config,T=R.fLoader,v=R.loader;return new Promise(function(b,f){C.loader&&C.loader.destroy();var h=C.loader=n.loader=T?new T(R):new v(R),_=a(n,O),g={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:m};O.stats=h.stats,h.load(_,g,{onSuccess:function(N,F,A,B){C.resetLoader(n,h),C.updateStatsFromPart(n,O);var U={frag:n,part:O,payload:N.data,networkDetails:B};S(U),b(U)},onError:function(N,F,A){C.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:n,part:O,response:N,networkDetails:A}))},onAbort:function(N,F,A){n.stats.aborted=O.stats.aborted,C.resetLoader(n,h),f(new o({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:n,part:O,networkDetails:A}))},onTimeout:function(N,F,A){C.resetLoader(n,h),f(new o({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 S=n.stats,C=O.stats,R=C.total;if(S.loaded+=C.loaded,R){var T=Math.round(n.duration/O.duration),v=Math.min(Math.round(S.loaded/R),T),b=T-v,f=b*Math.round(S.loaded/v);S.total=S.loaded+f}else S.total=Math.max(S.loaded,S.total);var h=S.loading,_=C.loading;h.start?h.first+=_.first-_.start:(h.start=_.start,h.first=_.first),h.end=_.end},s.resetLoader=function(n,O){n.loader=null,this.loader===O&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),O.destroy()},c}();function a(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,S=i.byteRangeEndOffset;return Object(G.isFiniteNumber)(O)&&Object(G.isFiniteNumber)(S)&&(n.rangeStart=O,n.rangeEnd=S),n}var o=function(c){L(s,c);function s(i){for(var n,O=arguments.length,S=new Array(O>1?O-1:0),C=1;C<O;C++)S[C-1]=arguments[C];return n=c.call.apply(c,[this].concat(S))||this,n.data=void 0,n.data=i,n}return s}(W(Error))},"./src/loader/fragment.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"ElementaryStreamTypes",function(){return u}),I.d(V,"BaseSegment",function(){return a}),I.d(V,"Fragment",function(){return o}),I.d(V,"Part",function(){return c});var G=I("./src/polyfills/number.ts"),P=I("./node_modules/url-toolkit/src/url-toolkit.js"),L=I.n(P),W=I("./src/utils/logger.ts"),k=I("./src/loader/level-key.ts"),r=I("./src/loader/load-stats.ts");function M(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,E(s,i)}function E(s,i){return E=Object.setPrototypeOf||function(O,S){return O.__proto__=S,O},E(s,i)}function p(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&&p(s.prototype,i),n&&p(s,n),s}var u;(function(s){s.AUDIO="audio",s.VIDEO="video",s.AUDIOVIDEO="audiovideo"})(u||(u={}));var a=function(){function s(n){var O;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(O={},O[u.AUDIO]=null,O[u.VIDEO]=null,O[u.AUDIOVIDEO]=null,O),this.baseurl=n}var i=s.prototype;return i.setByteRange=function(O,S){var C=O.split("@",2),R=[];C.length===1?R[0]=S?S.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}(),o=function(s){M(i,s);function i(O,S){var C;return C=s.call(this,S)||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(S){for(var C=new Uint8Array(16),R=12;R<16;R++)C[R]=S>>8*(15-R)&255;return C},n.setDecryptDataFromLevelKey=function(S,C){var R=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(R=k.LevelKey.fromURI(S.uri),R.method=S.method,R.iv=this.createInitializationVector(C),R.keyFormat="identity"),R},n.setElementaryStreamInfo=function(S,C,R,T,v,b){b===void 0&&(b=!1);var f=this.elementaryStreams,h=f[S];if(!h){f[S]={startPTS:C,endPTS:R,startDTS:T,endDTS:v,partial:b};return}h.startPTS=Math.min(h.startPTS,C),h.endPTS=Math.max(h.endPTS,R),h.startDTS=Math.min(h.startDTS,T),h.endDTS=Math.max(h.endDTS,v)},n.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[u.AUDIO]=null,S[u.VIDEO]=null,S[u.AUDIOVIDEO]=null},m(i,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&W.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}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 S=Object(G.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),i}(a),c=function(s){M(i,s);function i(n,O,S,C,R){var T;T=s.call(this,S)||this,T.fragOffset=0,T.duration=0,T.gap=!1,T.independent=!1,T.relurl=void 0,T.fragment=void 0,T.index=void 0,T.stats=new r.LoadStats,T.duration=n.decimalFloatingPoint("DURATION"),T.gap=n.bool("GAP"),T.independent=n.bool("INDEPENDENT"),T.relurl=n.enumeratedString("URI"),T.fragment=O,T.index=C;var v=n.enumeratedString("BYTERANGE");return v&&T.setByteRange(v,R),R&&(T.fragOffset=R.fragOffset+R.duration),T}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}(a)},"./src/loader/key-loader.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return W});var G=I("./src/events.ts"),P=I("./src/errors.ts"),L=I("./src/utils/logger.ts"),W=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 E in this.loaders){var p=this.loaders[E];p&&p.destroy()}this.loaders={}},r.onKeyLoading=function(E,p){var m=p.frag,u=m.type,a=this.loaders[u];if(!m.decryptdata){L.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var o=m.decryptdata.uri;if(o!==this.decrypturl||this.decryptkey===null){var c=this.hls.config;if(a&&(L.logger.warn("abort previous key loader for type:"+u),a.abort()),!o){L.logger.warn("key uri is falsy");return}var s=c.loader,i=m.loader=this.loaders[u]=new s(c);this.decrypturl=o,this.decryptkey=null;var n={url:o,frag:m,responseType:"arraybuffer"},O={timeout:c.fragLoadingTimeOut,maxRetry:0,retryDelay:c.fragLoadingRetryDelay,maxRetryDelay:c.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};i.load(n,O,S)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(G.Events.KEY_LOADED,{frag:m}))},r.loadsuccess=function(E,p,m){var u=m.frag;if(!u.decryptdata){L.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(E.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(G.Events.KEY_LOADED,{frag:u})},r.loaderror=function(E,p){var m=p.frag,u=m.loader;u&&u.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:E})},r.loadtimeout=function(E,p){var m=p.frag,u=m.loader;u&&u.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,I){"use strict";I.r(V),I.d(V,"LevelDetails",function(){return k});var G=I("./src/polyfills/number.ts");function P(r,M){for(var E=0;E<M.length;E++){var p=M[E];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function L(r,M,E){return M&&P(r.prototype,M),E&&P(r,E),r}var W=10,k=function(){function r(E){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=E}var M=r.prototype;return M.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var m=this.lastPartSn-p.lastPartSn,u=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!u||!!m,this.advanced=this.endSN>p.endSN||m>0||m===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},L(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||W}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var m=this.driftEnd-this.driftStart;return m*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),r}()},"./src/loader/level-key.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"LevelKey",function(){return k});var G=I("./node_modules/url-toolkit/src/url-toolkit.js"),P=I.n(G);function L(r,M){for(var E=0;E<M.length;E++){var p=M[E];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(r,p.key,p)}}function W(r,M,E){return M&&L(r.prototype,M),E&&L(r,E),r}var k=function(){r.fromURL=function(E,p){return new r(E,p)},r.fromURI=function(E){return new r(E)};function r(M,E){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,E?this._uri=Object(G.buildAbsoluteURL)(M,E,{alwaysNormalize:!0}):this._uri=M}return W(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(Z,V,I){"use strict";I.r(V),I.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,I){"use strict";I.r(V),I.d(V,"default",function(){return i});var G=I("./src/polyfills/number.ts"),P=I("./node_modules/url-toolkit/src/url-toolkit.js"),L=I.n(P),W=I("./src/loader/fragment.ts"),k=I("./src/loader/level-details.ts"),r=I("./src/loader/level-key.ts"),M=I("./src/utils/attr-list.ts"),E=I("./src/utils/logger.ts"),p=I("./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,u=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=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 T,v;return c.test((T=(v=P.parseURL(R))===null||v===void 0?void 0:v.path)!=null?T:"")}var i=function(){function R(){}return R.findGroup=function(v,b){for(var f=0;f<v.length;f++){var h=v[f];if(h.id===b)return h}},R.convertAVC1ToAVCOTI=function(v){var b=v.split(".");if(b.length>2){var f=b.shift()+".";return f+=parseInt(b.shift()).toString(16),f+=("000"+parseInt(b.shift()).toString(16)).substr(-4),f}return v},R.resolve=function(v,b){return P.buildAbsoluteURL(b,v,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(v,b){var f=[],h={},_=!1;m.lastIndex=0;for(var g;(g=m.exec(v))!=null;)if(g[1]){var x=new M.AttrList(g[1]),N={attrs:x,bitrate:x.decimalInteger("AVERAGE-BANDWIDTH")||x.decimalInteger("BANDWIDTH"),name:x.NAME,url:R.resolve(g[2],b)},F=x.decimalResolution("RESOLUTION");F&&(N.width=F.width,N.height=F.height),n((x.CODECS||"").split(/[ ,]+/).filter(function(B){return B}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=R.convertAVC1ToAVCOTI(N.videoCodec)),f.push(N)}else if(g[3]){var A=new M.AttrList(g[3]);A["DATA-ID"]&&(_=!0,h[A["DATA-ID"]]=A)}return{levels:f,sessionData:_?h:null}},R.parseMasterPlaylistMedia=function(v,b,f,h){h===void 0&&(h=[]);var _,g=[],x=0;for(u.lastIndex=0;(_=u.exec(v))!==null;){var N=new M.AttrList(_[1]);if(N.TYPE===f){var F={attrs:N,bitrate:0,id:x++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:f,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?R.resolve(N.URI,b):""};if(h.length){var A=R.findGroup(h,F.groupId)||h[0];O(F,A,"audioCodec"),O(F,A,"textCodec")}g.push(F)}}return g},R.parseLevelPlaylist=function(v,b,f,h,_){var g=new k.LevelDetails(b),x=g.fragments,N=null,F=0,A=0,B=0,U=0,w=null,Y=new W.Fragment(h,b),q,ce,Ee,Qe=-1,Te=!1;for(a.lastIndex=0,g.m3u8=v;(q=a.exec(v))!==null;){Te&&(Te=!1,Y=new W.Fragment(h,b),Y.start=B,Y.sn=F,Y.cc=U,Y.level=f,N&&(Y.initSegment=N,Y.rawProgramDateTime=N.rawProgramDateTime));var We=q[1];if(We){Y.duration=parseFloat(We);var $e=(" "+q[2]).slice(1);Y.title=$e||null,Y.tagList.push($e?["INF",We,$e]:["INF",We])}else if(q[3])Object(G.isFiniteNumber)(Y.duration)&&(Y.start=B,Ee&&(Y.levelkey=Ee),Y.sn=F,Y.level=f,Y.cc=U,Y.urlId=_,x.push(Y),Y.relurl=(" "+q[3]).slice(1),C(Y,w),w=Y,B+=Y.duration,F++,A=0,Te=!0);else if(q[4]){var Je=(" "+q[4]).slice(1);w?Y.setByteRange(Je,w):Y.setByteRange(Je)}else if(q[5])Y.rawProgramDateTime=(" "+q[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Qe===-1&&(Qe=x.length);else{if(q=q[0].match(o),!q){E.logger.warn("No matches on slow regex match for level playlist!");continue}for(ce=1;ce<q.length&&!(typeof q[ce]!="undefined");ce++);var Ce=(" "+q[ce]).slice(1),X=(" "+q[ce+1]).slice(1),j=q[ce+2]?(" "+q[ce+2]).slice(1):"";switch(Ce){case"PLAYLIST-TYPE":g.type=X.toUpperCase();break;case"MEDIA-SEQUENCE":F=g.startSN=parseInt(X);break;case"SKIP":{var K=new M.AttrList(X),Q=K.decimalInteger("SKIPPED-SEGMENTS");if(Object(G.isFiniteNumber)(Q)){g.skippedSegments=Q;for(var re=Q;re--;)x.unshift(null);F+=Q}var z=K.enumeratedString("RECENTLY-REMOVED-DATERANGES");z&&(g.recentlyRemovedDateranges=z.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(X);break;case"VERSION":g.version=parseInt(X);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(X||j)&&Y.tagList.push(j?[X,j]:[X]);break;case"DIS":U++;case"GAP":Y.tagList.push([Ce]);break;case"BITRATE":Y.tagList.push([Ce,X]);break;case"DISCONTINUITY-SEQ":U=parseInt(X);break;case"KEY":{var we,Ue=new M.AttrList(X),rt=Ue.enumeratedString("METHOD"),le=Ue.URI,Oe=Ue.hexadecimalInteger("IV"),Fe=Ue.enumeratedString("KEYFORMATVERSIONS"),Ye=Ue.enumeratedString("KEYID"),Tt=(we=Ue.enumeratedString("KEYFORMAT"))!=null?we:"identity",Nt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Nt.indexOf(Tt)>-1){E.logger.warn("Keyformat "+Tt+" is not supported from the manifest");continue}else if(Tt!=="identity")continue;rt&&(Ee=r.LevelKey.fromURL(b,le),le&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(rt)>=0&&(Ee.method=rt,Ee.keyFormat=Tt,Ye&&(Ee.keyID=Ye),Fe&&(Ee.keyFormatVersions=Fe),Ee.iv=Oe));break}case"START":{var Xt=new M.AttrList(X),tt=Xt.decimalFloatingPoint("TIME-OFFSET");Object(G.isFiniteNumber)(tt)&&(g.startTimeOffset=tt);break}case"MAP":{var Zt=new M.AttrList(X);Y.relurl=Zt.URI,Zt.BYTERANGE&&Y.setByteRange(Zt.BYTERANGE),Y.level=f,Y.sn="initSegment",Ee&&(Y.levelkey=Ee),Y.initSegment=null,N=Y,Te=!0;break}case"SERVER-CONTROL":{var vn=new M.AttrList(X);g.canBlockReload=vn.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=vn.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&vn.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=vn.optionalFloat("PART-HOLD-BACK",0),g.holdBack=vn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var ze=new M.AttrList(X);g.partTarget=ze.decimalFloatingPoint("PART-TARGET");break}case"PART":{var He=g.partList;He||(He=g.partList=[]);var vt=A>0?He[He.length-1]:void 0,Rt=A++,de=new W.Part(new M.AttrList(X),Y,b,Rt,vt);He.push(de),Y.duration+=de.duration;break}case"PRELOAD-HINT":{var ee=new M.AttrList(X);g.preloadHint=ee;break}case"RENDITION-REPORT":{var ne=new M.AttrList(X);g.renditionReports=g.renditionReports||[],g.renditionReports.push(ne);break}default:E.logger.warn("line parsed but not handled: "+q);break}}}w&&!w.relurl?(x.pop(),B-=w.duration,g.partList&&(g.fragmentHint=w)):g.partList&&(C(Y,w),Y.cc=U,g.fragmentHint=Y);var se=x.length,pe=x[0],ae=x[se-1];if(B+=g.skippedSegments*g.targetduration,B>0&&se&&ae){g.averagetargetduration=B/se;var ie=ae.sn;g.endSN=ie!=="initSegment"?ie:0,pe&&(g.startCC=pe.cc,pe.initSegment||g.fragments.every(function(me){return me.relurl&&s(me.relurl)})&&(E.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new W.Fragment(h,b),Y.relurl=ae.relurl,Y.level=f,Y.sn="initSegment",pe.initSegment=Y,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(B+=g.fragmentHint.duration),g.totalduration=B,g.endCC=U,Qe>0&&S(x,Qe),g},R}();function n(R,T){["video","audio","text"].forEach(function(v){var b=R.filter(function(h){return Object(p.isCodecType)(h,v)});if(b.length){var f=b.filter(function(h){return h.lastIndexOf("avc1",0)===0||h.lastIndexOf("mp4a",0)===0});T[v+"Codec"]=f.length>0?f[0]:b[0],R=R.filter(function(h){return b.indexOf(h)===-1})}}),T.unknownCodecs=R}function O(R,T,v){var b=T[v];b&&(R[v]=b)}function S(R,T){for(var v=R[T],b=T;b--;){var f=R[b];if(!f)return;f.programDateTime=v.programDateTime-f.duration*1e3,v=f}}function C(R,T){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):T!=null&&T.programDateTime&&(R.programDateTime=T.endProgramDateTime),Object(G.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/polyfills/number.ts"),P=I("./src/events.ts"),L=I("./src/errors.ts"),W=I("./src/utils/logger.ts"),k=I("./src/utils/mp4-tools.ts"),r=I("./src/loader/m3u8-parser.ts"),M=I("./src/types/loader.ts"),E=I("./src/utils/attr-list.ts");function p(a){var o=a.type;switch(o){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(a,o){var c=a.url;return(c===void 0||c.indexOf("data:")===0)&&(c=o.url),c}var u=function(){function a(c){this.hls=void 0,this.loaders=Object.create(null),this.hls=c,this.registerListeners()}var o=a.prototype;return o.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)},o.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)},o.createInternalLoader=function(s){var i=this.hls.config,n=i.pLoader,O=i.loader,S=n||O,C=new S(i);return s.loader=C,this.loaders[s.type]=C,C},o.getInternalLoader=function(s){return this.loaders[s.type]},o.resetInternalLoader=function(s){this.loaders[s]&&delete this.loaders[s]},o.destroyInternalLoaders=function(){for(var s in this.loaders){var i=this.loaders[s];i&&i.destroy(),this.resetInternalLoader(s)}},o.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},o.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})},o.onLevelLoading=function(s,i){var n=i.id,O=i.level,S=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:null,level:O,responseType:"text",type:M.PlaylistContextType.LEVEL,url:S,deliveryDirectives:C})},o.onAudioTrackLoading=function(s,i){var n=i.id,O=i.groupId,S=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:M.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:C})},o.onSubtitleTrackLoading=function(s,i){var n=i.id,O=i.groupId,S=i.url,C=i.deliveryDirectives;this.load({id:n,groupId:O,level:null,responseType:"text",type:M.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:C})},o.load=function(s){var i,n=this.hls.config,O=this.getInternalLoader(s);if(O){var S=O.context;if(S&&S.url===s.url){W.logger.trace("[playlist-loader]: playlist request ongoing");return}W.logger.log("[playlist-loader]: aborting previous loader for type: "+s.type),O.abort()}var C,R,T,v;switch(s.type){case M.PlaylistContextType.MANIFEST:C=n.manifestLoadingMaxRetry,R=n.manifestLoadingTimeOut,T=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,T=n.levelLoadingRetryDelay,v=n.levelLoadingMaxRetryTimeout;break}if(O=this.createInternalLoader(s),(i=s.deliveryDirectives)!==null&&i!==void 0&&i.part){var b;if(s.type===M.PlaylistContextType.LEVEL&&s.level!==null?b=this.hls.levels[s.level].details:s.type===M.PlaylistContextType.AUDIO_TRACK&&s.id!==null?b=this.hls.audioTracks[s.id].details:s.type===M.PlaylistContextType.SUBTITLE_TRACK&&s.id!==null&&(b=this.hls.subtitleTracks[s.id].details),b){var f=b.partTarget,h=b.targetduration;f&&h&&(R=Math.min(Math.max(f*3,h*.8)*1e3,R))}}var _={timeout:R,maxRetry:C,retryDelay:T,maxRetryDelay:v,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};O.load(s,_,g)},o.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 S=s.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(s,n,"no EXTM3U delimiter",O);return}i.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(s,i,n,O):this.handleMasterPlaylist(s,i,n,O)},o.loaderror=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!1,s)},o.loadtimeout=function(s,i,n){n===void 0&&(n=null),this.handleNetworkError(i,n,!0)},o.handleMasterPlaylist=function(s,i,n,O){var S=this.hls,C=s.data,R=m(s,n),T=r.default.parseMasterPlaylist(C,R),v=T.levels,b=T.sessionData;if(!v.length){this.handleManifestParsingError(s,n,"no level found in manifest",O);return}var f=v.map(function(F){return{id:F.attrs.AUDIO,audioCodec:F.audioCodec}}),h=v.map(function(F){return{id:F.attrs.SUBTITLES,textCodec:F.textCodec}}),_=r.default.parseMasterPlaylistMedia(C,R,"AUDIO",f),g=r.default.parseMasterPlaylistMedia(C,R,"SUBTITLES",h),x=r.default.parseMasterPlaylistMedia(C,R,"CLOSED-CAPTIONS");if(_.length){var N=_.some(function(F){return!F.url});!N&&v[0].audioCodec&&!v[0].attrs.AUDIO&&(W.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 E.AttrList({}),bitrate:0,url:""}))}S.trigger(P.Events.MANIFEST_LOADED,{levels:v,audioTracks:_,subtitles:g,captions:x,url:R,stats:i,networkDetails:O,sessionData:b})},o.handleTrackOrLevelPlaylist=function(s,i,n,O){var S=this.hls,C=n.id,R=n.level,T=n.type,v=m(s,n),b=Object(G.isFiniteNumber)(C)?C:0,f=Object(G.isFiniteNumber)(R)?R:b,h=p(n),_=r.default.parseLevelPlaylist(s.data,v,f,h,b);if(!_.fragments.length){S.trigger(P.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.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(T===M.PlaylistContextType.MANIFEST){var g={attrs:new E.AttrList({}),bitrate:0,details:_,name:"",url:v};S.trigger(P.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:v,stats:i,networkDetails:O,sessionData:null})}if(i.parsing.end=performance.now(),_.needSidxRanges){var x,N=(x=_.fragments[0].initSegment)===null||x===void 0?void 0:x.url;this.load({url:N,isSidxRequest:!0,type:T,level:R,levelDetails:_,id:C,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}n.levelDetails=_,this.handlePlaylistLoaded(s,i,n,O)},o.handleSidxRequest=function(s,i){var n=Object(k.parseSegmentIndex)(new Uint8Array(s.data));if(!n)return;var O=n.references,S=i.levelDetails;O.forEach(function(C,R){var T=C.info,v=S.fragments[R];v.byteRange.length===0&&v.setByteRange(String(1+T.end-T.start)+"@"+String(T.start)),v.initSegment&&v.initSegment.setByteRange(String(n.moovEndOffset)+"@0")})},o.handleManifestParsingError=function(s,i,n,O){this.hls.trigger(P.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===M.PlaylistContextType.MANIFEST,url:s.url,reason:n,response:s,context:i,networkDetails:O})},o.handleNetworkError=function(s,i,n,O){n===void 0&&(n=!1),W.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 S=L.ErrorDetails.UNKNOWN,C=!1,R=this.getInternalLoader(s);switch(s.type){case M.PlaylistContextType.MANIFEST:S=n?L.ErrorDetails.MANIFEST_LOAD_TIMEOUT:L.ErrorDetails.MANIFEST_LOAD_ERROR,C=!0;break;case M.PlaylistContextType.LEVEL:S=n?L.ErrorDetails.LEVEL_LOAD_TIMEOUT:L.ErrorDetails.LEVEL_LOAD_ERROR,C=!1;break;case M.PlaylistContextType.AUDIO_TRACK:S=n?L.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,C=!1;break;case M.PlaylistContextType.SUBTITLE_TRACK:S=n?L.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:L.ErrorDetails.SUBTITLE_LOAD_ERROR,C=!1;break}R&&this.resetInternalLoader(s.type);var T={type:L.ErrorTypes.NETWORK_ERROR,details:S,fatal:C,url:s.url,loader:R,context:s,networkDetails:i};O&&(T.response=O),this.hls.trigger(P.Events.ERROR,T)},o.handlePlaylistLoaded=function(s,i,n,O){var S=n.type,C=n.level,R=n.id,T=n.groupId,v=n.loader,b=n.levelDetails,f=n.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(s,n,"invalid target duration",O);return}if(!v)return;b.live&&(v.getCacheAge&&(b.ageHeader=v.getCacheAge()||0),(!v.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(S){case M.PlaylistContextType.MANIFEST:case M.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:b,level:C||0,id:R||0,stats:i,networkDetails:O,deliveryDirectives:f});break;case M.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:b,id:R||0,groupId:T||"",stats:i,networkDetails:O,deliveryDirectives:f});break;case M.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:b,id:R||0,groupId:T||"",stats:i,networkDetails:O,deliveryDirectives:f});break}},a}();V.default=u},"./src/polyfills/number.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"isFiniteNumber",function(){return G}),I.d(V,"MAX_SAFE_INTEGER",function(){return P});var G=Number.isFinite||function(L){return typeof L=="number"&&isFinite(L)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(Z,V,I){"use strict";I.r(V);var G=function(){function P(){}return P.getSilentFrame=function(W,k){switch(W){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,I){"use strict";I.r(V);var G=Math.pow(2,32)-1,P=function(){function L(){}return L.init=function(){L.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 L.types)L.types.hasOwnProperty(k)&&(L.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]);L.HDLR_TYPES={video:r,audio:M};var E=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);L.STTS=L.STSC=L.STCO=p,L.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),L.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),L.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),L.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);L.FTYP=L.box(L.types.ftyp,m,a,m,u),L.DINF=L.box(L.types.dinf,L.box(L.types.dref,E))},L.box=function(k){for(var r=8,M=arguments.length,E=new Array(M>1?M-1:0),p=1;p<M;p++)E[p-1]=arguments[p];for(var m=E.length,u=m;m--;)r+=E[m].byteLength;var a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(k,4),m=0,r=8;m<u;m++)a.set(E[m],r),r+=E[m].byteLength;return a},L.hdlr=function(k){return L.box(L.types.hdlr,L.HDLR_TYPES[k])},L.mdat=function(k){return L.box(L.types.mdat,k)},L.mdhd=function(k,r){r*=k;var M=Math.floor(r/(G+1)),E=Math.floor(r%(G+1));return L.box(L.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,E>>24,E>>16&255,E>>8&255,E&255,85,196,0,0]))},L.mdia=function(k){return L.box(L.types.mdia,L.mdhd(k.timescale,k.duration),L.hdlr(k.type),L.minf(k))},L.mfhd=function(k){return L.box(L.types.mfhd,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255]))},L.minf=function(k){return k.type==="audio"?L.box(L.types.minf,L.box(L.types.smhd,L.SMHD),L.DINF,L.stbl(k)):L.box(L.types.minf,L.box(L.types.vmhd,L.VMHD),L.DINF,L.stbl(k))},L.moof=function(k,r,M){return L.box(L.types.moof,L.mfhd(k),L.traf(M,r))},L.moov=function(k){for(var r=k.length,M=[];r--;)M[r]=L.trak(k[r]);return L.box.apply(null,[L.types.moov,L.mvhd(k[0].timescale,k[0].duration)].concat(M).concat(L.mvex(k)))},L.mvex=function(k){for(var r=k.length,M=[];r--;)M[r]=L.trex(k[r]);return L.box.apply(null,[L.types.mvex].concat(M))},L.mvhd=function(k,r){r*=k;var M=Math.floor(r/(G+1)),E=Math.floor(r%(G+1)),p=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,E>>24,E>>16&255,E>>8&255,E&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 L.box(L.types.mvhd,p)},L.sdtp=function(k){var r=k.samples||[],M=new Uint8Array(4+r.length),E,p;for(E=0;E<r.length;E++)p=r[E].flags,M[E+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return L.box(L.types.sdtp,M)},L.stbl=function(k){return L.box(L.types.stbl,L.stsd(k),L.box(L.types.stts,L.STTS),L.box(L.types.stsc,L.STSC),L.box(L.types.stsz,L.STSZ),L.box(L.types.stco,L.STCO))},L.avc1=function(k){var r=[],M=[],E,p,m;for(E=0;E<k.sps.length;E++)p=k.sps[E],m=p.byteLength,r.push(m>>>8&255),r.push(m&255),r=r.concat(Array.prototype.slice.call(p));for(E=0;E<k.pps.length;E++)p=k.pps[E],m=p.byteLength,M.push(m>>>8&255),M.push(m&255),M=M.concat(Array.prototype.slice.call(p));var u=L.box(L.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))),a=k.width,o=k.height,c=k.pixelRatio[0],s=k.pixelRatio[1];return L.box(L.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,a>>8&255,a&255,o>>8&255,o&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u,L.box(L.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),L.box(L.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,c&255,s>>24,s>>16&255,s>>8&255,s&255])))},L.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]))},L.mp4a=function(k){var r=k.samplerate;return L.box(L.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]),L.box(L.types.esds,L.esds(k)))},L.mp3=function(k){var r=k.samplerate;return L.box(L.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]))},L.stsd=function(k){return k.type==="audio"?!k.isAAC&&k.codec==="mp3"?L.box(L.types.stsd,L.STSD,L.mp3(k)):L.box(L.types.stsd,L.STSD,L.mp4a(k)):L.box(L.types.stsd,L.STSD,L.avc1(k))},L.tkhd=function(k){var r=k.id,M=k.duration*k.timescale,E=k.width,p=k.height,m=Math.floor(M/(G+1)),u=Math.floor(M%(G+1));return L.box(L.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,u>>24,u>>16&255,u>>8&255,u&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,E>>8&255,E&255,0,0,p>>8&255,p&255,0,0]))},L.traf=function(k,r){var M=L.sdtp(k),E=k.id,p=Math.floor(r/(G+1)),m=Math.floor(r%(G+1));return L.box(L.types.traf,L.box(L.types.tfhd,new Uint8Array([0,0,0,0,E>>24,E>>16&255,E>>8&255,E&255])),L.box(L.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])),L.trun(k,M.length+16+20+8+16+8+8),M)},L.trak=function(k){return k.duration=k.duration||4294967295,L.box(L.types.trak,L.tkhd(k),L.mdia(k))},L.trex=function(k){var r=k.id;return L.box(L.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]))},L.trun=function(k,r){var M=k.samples||[],E=M.length,p=12+16*E,m=new Uint8Array(p),u,a,o,c,s,i;for(r+=8+p,m.set([0,0,15,1,E>>>24&255,E>>>16&255,E>>>8&255,E&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),u=0;u<E;u++)a=M[u],o=a.duration,c=a.size,s=a.flags,i=a.cts,m.set([o>>>24&255,o>>>16&255,o>>>8&255,o&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*u);return L.box(L.types.trun,m)},L.initSegment=function(k){L.types||L.init();var r=L.moov(k),M=new Uint8Array(L.FTYP.byteLength+r.byteLength);return M.set(L.FTYP),M.set(r,L.FTYP.byteLength),M},L}();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,I){"use strict";I.r(V),I.d(V,"default",function(){return i}),I.d(V,"normalizePts",function(){return n});var G=I("./src/polyfills/number.ts"),P=I("./src/remux/aac-helper.ts"),L=I("./src/remux/mp4-generator.ts"),W=I("./src/events.ts"),k=I("./src/errors.ts"),r=I("./src/utils/logger.ts"),M=I("./src/types/loader.ts"),E=I("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(R){for(var T=1;T<arguments.length;T++){var v=arguments[T];for(var b in v)Object.prototype.hasOwnProperty.call(v,b)&&(R[b]=v[b])}return R},p.apply(this,arguments)}var m=10*1e3,u=1024,a=1152,o=null,c=null,s=!1,i=function(){function R(v,b,f,h){if(h===void 0&&(h=""),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=b,this.typeSupported=f,this.ISGenerated=!1,o===null){var _=navigator.userAgent||"",g=_.match(/Chrome\/(\d+)/i);o=g?parseInt(g[1]):0}if(c===null){var x=navigator.userAgent.match(/Safari\/(\d+)/i);c=x?parseInt(x[1]):0}s=!!o&&o<75||!!c&&c<600}var T=R.prototype;return T.destroy=function(){},T.resetTimeStamp=function(b){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},T.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},T.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},T.getVideoStartPts=function(b){var f=!1,h=b.reduce(function(_,g){var x=g.pts-_;return x<-4294967296?(f=!0,n(_,g.pts)):x>0?_:g.pts},b[0].pts);return f&&r.logger.debug("PTS rollover detected"),h},T.remux=function(b,f,h,_,g,x,N,F){var A,B,U,w,Y,q,ce=g,Ee=g,Qe=b.pid>-1,Te=f.pid>-1,We=f.samples.length,$e=b.samples.length>0,Je=We>1,Ce=(!Qe||$e)&&(!Te||Je)||this.ISGenerated||N;if(Ce){this.ISGenerated||(U=this.generateIS(b,f,g));var X=this.isVideoContiguous,j=-1;if(Je&&(j=O(f.samples),!X&&this.config.forceKeyFrameOnDiscontinuity))if(q=!0,j>0){r.logger.warn("[mp4-remuxer]: Dropped "+j+" out of "+We+" video samples due to a missing keyframe");var K=this.getVideoStartPts(f.samples);f.samples=f.samples.slice(j),f.dropped+=j,Ee+=(f.samples[0].pts-K)/(f.timescale||9e4)}else j===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+We+" video samples"),q=!1);if(this.ISGenerated){if($e&&Je){var Q=this.getVideoStartPts(f.samples),re=n(b.samples[0].pts,Q)-Q,z=re/f.inputTimeScale;ce+=Math.max(0,z),Ee+=Math.max(0,-z)}if($e){if(b.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(b,f,g)),B=this.remuxAudio(b,ce,this.isAudioContiguous,x,Te||Je||F===M.PlaylistLevelType.AUDIO?Ee:void 0),Je){var we=B?B.endPTS-B.startPTS:0;f.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(b,f,g)),A=this.remuxVideo(f,Ee,X,we)}}else Je&&(A=this.remuxVideo(f,Ee,X,0));A&&(A.firstKeyFrame=j,A.independent=j!==-1)}}return this.ISGenerated&&(h.samples.length&&(Y=this.remuxID3(h,g)),_.samples.length&&(w=this.remuxText(_,g))),{audio:B,video:A,initSegment:U,independent:q,text:w,id3:Y}},T.generateIS=function(b,f,h){var _=b.samples,g=f.samples,x=this.typeSupported,N={},F=!Object(G.isFiniteNumber)(this._initPTS),A="audio/mp4",B,U,w;if(F&&(B=U=Infinity),b.config&&_.length&&(b.timescale=b.samplerate,b.isAAC||(x.mpeg?(A="audio/mpeg",b.codec=""):x.mp3&&(b.codec="mp3")),N.audio={id:"audio",container:A,codec:b.codec,initSegment:!b.isAAC&&x.mpeg?new Uint8Array(0):L.default.initSegment([b]),metadata:{channelCount:b.channelCount}},F&&(w=b.inputTimeScale,B=U=_[0].pts-Math.round(w*h))),f.sps&&f.pps&&g.length&&(f.timescale=f.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:f.codec,initSegment:L.default.initSegment([f]),metadata:{width:f.width,height:f.height}},F)){w=f.inputTimeScale;var Y=this.getVideoStartPts(g),q=Math.round(w*h);U=Math.min(U,n(g[0].dts,Y)-q),B=Math.min(B,Y-q)}if(Object.keys(N).length)return this.ISGenerated=!0,F&&(this._initPTS=B,this._initDTS=U),{tracks:N,initPTS:B,timescale:w}},T.remuxVideo=function(b,f,h,_){var g=b.inputTimeScale,x=b.samples,N=[],F=x.length,A=this._initPTS,B=this.nextAvcDts,U=8,w,Y,q,ce=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,Qe=0,Te=!1;if(!h||B===null){var We=f*g,$e=x[0].pts-n(x[0].dts,x[0].pts);B=We-$e}for(var Je=0;Je<F;Je++){var Ce=x[Je];if(Ce.pts=n(Ce.pts-A,B),Ce.dts=n(Ce.dts-A,B),Ce.dts>Ce.pts){var X=9e4*.2;Qe=Math.max(Math.min(Qe,Ce.pts-Ce.dts),-1*X)}Ce.dts<x[Je>0?Je-1:Je].dts&&(Te=!0)}Te&&x.sort(function(Qt,ht){var Et=Qt.dts-ht.dts,it=Qt.pts-ht.pts;return Et||it}),Y=x[0].dts,q=x[x.length-1].dts;var j=Math.round((q-Y)/(F-1));if(Qe<0){if(Qe<j*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(E.toMsFromMpegTsClock)(-j,!0)+" ms");for(var K=Qe,Q=0;Q<F;Q++)x[Q].dts=K=Math.max(K,x[Q].pts-j),x[Q].pts=Math.max(K,x[Q].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(E.toMsFromMpegTsClock)(Qe,!0)+" ms to overcome this issue");for(var re=0;re<F;re++)x[re].dts=x[re].dts+Qe}Y=x[0].dts}if(h){var z=Y-B,we=z>j,Ue=z<-1;if(we||Ue){we?r.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(z,!0)+" ms ("+z+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(E.toMsFromMpegTsClock)(-z,!0)+" ms ("+z+"dts) overlapping between fragments detected"),Y=B;var rt=x[0].pts-z;x[0].dts=Y,x[0].pts=rt,r.logger.log("Video: First PTS/DTS adjusted: "+Object(E.toMsFromMpegTsClock)(rt,!0)+"/"+Object(E.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(E.toMsFromMpegTsClock)(z,!0)+" ms")}}s&&(Y=Math.max(0,Y));for(var le=0,Oe=0,Fe=0;Fe<F;Fe++){for(var Ye=x[Fe],Tt=Ye.units,Nt=Tt.length,Xt=0,tt=0;tt<Nt;tt++)Xt+=Tt[tt].data.length;Oe+=Xt,le+=Nt,Ye.length=Xt,Ye.dts=Math.max(Ye.dts,Y),Ye.pts=Math.max(Ye.pts,Ye.dts,0),ce=Math.min(Ye.pts,ce),Ee=Math.max(Ye.pts,Ee)}q=x[F-1].dts;var Zt=Oe+4*le+8,vn;try{vn=new Uint8Array(Zt)}catch(Qt){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Zt,reason:"fail allocating video mdat "+Zt});return}var ze=new DataView(vn.buffer);ze.setUint32(0,Zt),vn.set(L.default.types.mdat,4);for(var He=0;He<F;He++){for(var vt=x[He],Rt=vt.units,de=0,ee=0,ne=Rt.length;ee<ne;ee++){var se=Rt[ee],pe=se.data,ae=se.data.byteLength;ze.setUint32(U,ae),U+=4,vn.set(pe,U),U+=ae,de+=4+ae}if(He<F-1)w=x[He+1].dts-vt.dts;else{var ie=this.config,me=vt.dts-x[He>0?He-1:He].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var ye=Math.floor(ie.maxBufferHole*g),xe=(_?ce+_*g:this.nextAudioPts)-vt.pts;xe>ye?(w=xe-me,w<0&&(w=me),r.logger.log("[mp4-remuxer]: It is approximately "+xe/90+" ms to the next segment; using duration "+w/90+" ms for the last video frame.")):w=me}else w=me}var De=Math.round(vt.pts-vt.dts);N.push(new S(vt.key,w,de,De))}if(N.length&&o&&o<70){var ct=N[0].flags;ct.dependsOn=2,ct.isNonSync=0}console.assert(w!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=B=q+w,this.isVideoContiguous=!0;var It=L.default.moof(b.sequenceNumber++,Y,p({},b,{samples:N})),un="video",mt={data1:It,data2:vn,startPTS:ce/g,endPTS:(Ee+w)/g,startDTS:Y/g,endDTS:B/g,type:un,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(vn.length,"MDAT length must not be zero"),mt},T.remuxAudio=function(b,f,h,_,g){var x=b.inputTimeScale,N=b.samplerate?b.samplerate:x,F=x/N,A=b.isAAC?u:a,B=A*F,U=this._initPTS,w=!b.isAAC&&this.typeSupported.mpeg,Y=[],q=b.samples,ce=w?0:8,Ee=this.nextAudioPts||-1,Qe=f*x;if(this.isAudioContiguous=h=h||q.length&&Ee>0&&(_&&Math.abs(Qe-Ee)<9e3||Math.abs(n(q[0].pts-U,Qe)-Ee)<20*B),q.forEach(function(pe){pe.pts=n(pe.pts-U,Qe)}),!h||Ee<0){if(q=q.filter(function(pe){return pe.pts>=0}),!q.length)return;g===0?Ee=0:_?Ee=Math.max(0,Qe):Ee=q[0].pts}if(b.isAAC)for(var Te=g!==void 0,We=this.config.maxAudioFramesDrift,$e=0,Je=Ee;$e<q.length;$e++){var Ce=q[$e],X=Ce.pts,j=X-Je,K=Math.abs(1e3*j/x);if(j<=-We*B&&Te)$e===0&&(r.logger.warn("Audio frame @ "+(X/x).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*j/x)+" ms."),this.nextAudioPts=Ee=Je=X);else if(j>=We*B&&K<m&&Te){var Q=Math.round(j/B);Je=X-Q*B,Je<0&&(Q--,Je+=B),$e===0&&(this.nextAudioPts=Ee=Je),r.logger.warn("[mp4-remuxer]: Injecting "+Q+" audio frame @ "+(Je/x).toFixed(3)+"s due to "+Math.round(1e3*j/x)+" ms gap.");for(var re=0;re<Q;re++){var z=Math.max(Je,0),we=P.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);we||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),we=Ce.unit.subarray()),q.splice($e,0,{unit:we,pts:z}),Je+=B,$e++}}Ce.pts=Je,Je+=B}for(var Ue=null,rt=null,le,Oe=0,Fe=q.length;Fe--;)Oe+=q[Fe].unit.byteLength;for(var Ye=0,Tt=q.length;Ye<Tt;Ye++){var Nt=q[Ye],Xt=Nt.unit,tt=Nt.pts;if(rt!==null){var Zt=Y[Ye-1];Zt.duration=Math.round((tt-rt)/F)}else if(h&&b.isAAC&&(tt=Ee),Ue=tt,Oe>0){Oe+=ce;try{le=new Uint8Array(Oe)}catch(pe){this.observer.emit(W.Events.ERROR,W.Events.ERROR,{type:k.ErrorTypes.MUX_ERROR,details:k.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Oe,reason:"fail allocating audio mdat "+Oe});return}if(!w){var vn=new DataView(le.buffer);vn.setUint32(0,Oe),le.set(L.default.types.mdat,4)}}else return;le.set(Xt,ce);var ze=Xt.byteLength;ce+=ze,Y.push(new S(!0,A,ze,0)),rt=tt}var He=Y.length;if(!He)return;var vt=Y[Y.length-1];this.nextAudioPts=Ee=rt+F*vt.duration;var Rt=w?new Uint8Array(0):L.default.moof(b.sequenceNumber++,Ue/F,p({},b,{samples:Y}));b.samples=[];var de=Ue/x,ee=Ee/x,ne="audio",se={data1:Rt,data2:le,startPTS:de,endPTS:ee,startDTS:de,endDTS:ee,type:ne,hasAudio:!0,hasVideo:!1,nb:He};return this.isAudioContiguous=!0,console.assert(le.length,"MDAT length must not be zero"),se},T.remuxEmptyAudio=function(b,f,h,_){var g=b.inputTimeScale,x=b.samplerate?b.samplerate:g,N=g/x,F=this.nextAudioPts,A=(F!==null?F:_.startDTS*g)+this._initDTS,B=_.endDTS*g+this._initDTS,U=N*u,w=Math.ceil((B-A)/U),Y=P.default.getSilentFrame(b.manifestCodec||b.codec,b.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=[],ce=0;ce<w;ce++){var Ee=A+ce*U;q.push({unit:Y,pts:Ee,dts:Ee})}return b.samples=q,this.remuxAudio(b,f,h,!1)},T.remuxID3=function(b,f){var h=b.samples.length;if(!h)return;for(var _=b.inputTimeScale,g=this._initPTS,x=this._initDTS,N=0;N<h;N++){var F=b.samples[N];F.pts=n(F.pts-g,f*_)/_,F.dts=n(F.dts-x,f*_)/_}var A=b.samples;return b.samples=[],{samples:A}},T.remuxText=function(b,f){var h=b.samples.length;if(!h)return;for(var _=b.inputTimeScale,g=this._initPTS,x=0;x<h;x++){var N=b.samples[x];N.pts=n(N.pts-g,f*_)/_}b.samples.sort(function(A,B){return A.pts-B.pts});var F=b.samples;return b.samples=[],{samples:F}},R}();function n(R,T){var v;if(T===null)return R;for(T<R?v=-8589934592:v=8589934592;Math.abs(R-T)>4294967296;)R+=v;return R}function O(R){for(var T=0;T<R.length;T++)if(R[T].key)return T;return-1}var S=function(T,v,b,f){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=v,this.size=b,this.cts=f,this.flags=new C(T)},C=function(T){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=T?2:1,this.isNonSync=T?0:1}},"./src/remux/passthrough-remuxer.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/polyfills/number.ts"),P=I("./src/utils/mp4-tools.ts"),L=I("./src/loader/fragment.ts"),W=I("./src/utils/logger.ts"),k=function(){function E(){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 p=E.prototype;return p.destroy=function(){},p.resetTimeStamp=function(u){this.initPTS=u,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(u,a,o){this.audioCodec=a,this.videoCodec=o,this.generateInitSegment(u),this.emitInitSegment=!0},p.generateInitSegment=function(u){var a=this.audioCodec,o=this.videoCodec;if(!u||!u.byteLength){this.initTracks=void 0,this.initData=void 0;return}var c=this.initData=Object(P.parseInitSegment)(u);a||(a=M(c.audio,L.ElementaryStreamTypes.AUDIO)),o||(o=M(c.video,L.ElementaryStreamTypes.VIDEO));var s={};c.audio&&c.video?s.audiovideo={container:"video/mp4",codec:a+","+o,initSegment:u,id:"main"}:c.audio?s.audio={container:"audio/mp4",codec:a,initSegment:u,id:"audio"}:c.video?s.video={container:"video/mp4",codec:o,initSegment:u,id:"main"}:W.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=s},p.remux=function(u,a,o,c,s){var i=this.initPTS,n=this.lastEndDTS,O={audio:void 0,video:void 0,text:c,id3:o,initSegment:void 0};Object(G.isFiniteNumber)(n)||(n=this.lastEndDTS=s||0);var S=a.samples;if(!S||!S.length)return O;var C={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(S),R=this.initData),!R||!R.length)return W.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,S,n));var T=Object(P.getDuration)(S,R),v=n,b=T+v;Object(P.offsetStartDTS)(R,S,i),T>0?this.lastEndDTS=b:(W.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var f=!!R.audio,h=!!R.video,_="";f&&(_+="audio"),h&&(_+="video");var g={data1:S,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:_,hasAudio:f,hasVideo:h,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=o,O.initSegment=C,O},E}(),r=function(p,m,u){return Object(P.getStartDTS)(p,m)-u};function M(E,p){var m=E==null?void 0:E.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===L.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}V.default=k},"./src/task-loop.ts":function(Z,V,I){"use strict";I.r(V),I.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 L=P.prototype;return L.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},L.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},L.onHandlerDestroyed=function(){},L.hasInterval=function(){return!!this._tickInterval},L.hasNextTick=function(){return!!this._tickTimer},L.setInterval=function(k){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,k),!0)},L.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},L.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},L.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},L.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},L.doTick=function(){},P}()},"./src/types/cmcd.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"CMCDVersion",function(){return G}),I.d(V,"CMCDObjectType",function(){return P}),I.d(V,"CMCDStreamingFormat",function(){return L}),I.d(V,"CMCDStreamType",function(){return W});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 L;(function(k){k.DASH="d",k.HLS="h",k.SMOOTH="s",k.OTHER="o"})(L||(L={}));var W;(function(k){k.VOD="v",k.LIVE="l"})(W||(W={}))},"./src/types/level.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"HlsSkip",function(){return L}),I.d(V,"getSkipValue",function(){return W}),I.d(V,"HlsUrlParameters",function(){return k}),I.d(V,"Level",function(){return r});function G(M,E){for(var p=0;p<E.length;p++){var m=E[p];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(M,m.key,m)}}function P(M,E,p){return E&&G(M.prototype,E),p&&G(M,p),M}var L;(function(M){M.No="",M.Yes="YES",M.v2="v2"})(L||(L={}));function W(M,E){var p=M.canSkipUntil,m=M.canSkipDateRanges,u=M.endSN,a=E!==void 0?E-u:0;return p&&a<p?m?L.v2:L.Yes:L.No}var k=function(){function M(p,m,u){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=m,this.skip=u}var E=M.prototype;return E.addDirectives=function(m){var u=new self.URL(m);return this.msn!==void 0&&u.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&u.searchParams.set("_HLS_part",this.part.toString()),this.skip&&u.searchParams.set("_HLS_skip",this.skip),u.toString()},M}(),r=function(){function M(E){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=[E.url],this.attrs=E.attrs,this.bitrate=E.bitrate,E.details&&(this.details=E.details),this.id=E.id||0,this.name=E.name,this.width=E.width||0,this.height=E.height||0,this.audioCodec=E.audioCodec,this.videoCodec=E.videoCodec,this.unknownCodecs=E.unknownCodecs,this.codecSet=[E.videoCodec,E.audioCodec].filter(function(p){return p}).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(p){var m=p%this.url.length;this._urlId!==m&&(this.details=void 0,this._urlId=m)}}]),M}()},"./src/types/loader.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"PlaylistContextType",function(){return G}),I.d(V,"PlaylistLevelType",function(){return P});var G;(function(L){L.MANIFEST="manifest",L.LEVEL="level",L.AUDIO_TRACK="audioTrack",L.SUBTITLE_TRACK="subtitleTrack"})(G||(G={}));var P;(function(L){L.MAIN="main",L.AUDIO="audio",L.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"ChunkMetadata",function(){return G});var G=function(W,k,r,M,E,p){M===void 0&&(M=0),E===void 0&&(E=-1),p===void 0&&(p=!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=W,this.sn=k,this.id=r,this.size=M,this.part=E,this.partial=p};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"AttrList",function(){return L});var G=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,L=function(){function W(r){typeof r=="string"&&(r=W.parseAttrList(r));for(var M in r)r.hasOwnProperty(M)&&(this[M]=r[M])}var k=W.prototype;return k.decimalInteger=function(M){var E=parseInt(this[M],10);return E>Number.MAX_SAFE_INTEGER?Infinity:E},k.hexadecimalInteger=function(M){if(this[M]){var E=(this[M]||"0x").slice(2);E=(E.length&1?"0":"")+E;for(var p=new Uint8Array(E.length/2),m=0;m<E.length/2;m++)p[m]=parseInt(E.slice(m*2,m*2+2),16);return p}else return null},k.hexadecimalIntegerAsNumber=function(M){var E=parseInt(this[M],16);return E>Number.MAX_SAFE_INTEGER?Infinity:E},k.decimalFloatingPoint=function(M){return parseFloat(this[M])},k.optionalFloat=function(M,E){var p=this[M];return p?parseFloat(p):E},k.enumeratedString=function(M){return this[M]},k.bool=function(M){return this[M]==="YES"},k.decimalResolution=function(M){var E=G.exec(this[M]);return E===null?void 0:{width:parseInt(E[1],10),height:parseInt(E[2],10)}},W.parseAttrList=function(M){var E,p={},m='"';for(P.lastIndex=0;(E=P.exec(M))!==null;){var u=E[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),p[E[1]]=u}return p},W}()},"./src/utils/binary-search.ts":function(Z,V,I){"use strict";I.r(V);var G={search:function(L,W){for(var k=0,r=L.length-1,M=null,E=null;k<=r;){M=(k+r)/2|0,E=L[M];var p=W(E);if(p>0)k=M+1;else if(p<0)r=M-1;else return E}return null}};V.default=G},"./src/utils/buffer-helper.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"BufferHelper",function(){return L});var G=I("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},L=function(){function W(){}return W.isBuffered=function(r,M){try{if(r){for(var E=W.getBuffered(r),p=0;p<E.length;p++)if(M>=E.start(p)&&M<=E.end(p))return!0}}catch(m){}return!1},W.bufferInfo=function(r,M,E){try{if(r){var p=W.getBuffered(r),m=[],u;for(u=0;u<p.length;u++)m.push({start:p.start(u),end:p.end(u)});return this.bufferedInfo(m,M,E)}}catch(a){}return{len:0,start:M,end:M,nextStart:void 0}},W.bufferedInfo=function(r,M,E){M=Math.max(0,M),r.sort(function(C,R){var T=C.start-R.start;return T||R.end-C.end});var p=[];if(E)for(var m=0;m<r.length;m++){var u=p.length;if(u){var a=p[u-1].end;r[m].start-a<E?r[m].end>a&&(p[u-1].end=r[m].end):p.push(r[m])}else p.push(r[m])}else p=r;for(var o=0,c,s=M,i=M,n=0;n<p.length;n++){var O=p[n].start,S=p[n].end;if(M+E>=O&&M<S)s=O,i=S,o=i-M;else if(M+E<O){c=O;break}}return{len:o,start:s||0,end:i||0,nextStart:c}},W.getBuffered=function(r){try{return r.buffered}catch(M){return G.logger.log("failed to get media.buffered",M),P}},W}()},"./src/utils/cea-608-parser.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"Row",function(){return i}),I.d(V,"CaptionScreen",function(){return n});var G=I("./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},L=function(b){var f=b;return P.hasOwnProperty(b)&&(f=P[b]),String.fromCharCode(f)},W=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},E={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},m=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],u;(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"})(u||(u={}));var a=function(){function v(){this.time=null,this.verboseLevel=u.ERROR}var b=v.prototype;return b.log=function(h,_){this.verboseLevel>=h&&G.logger.log(this.time+" ["+h+"] "+_)},v}(),o=function(b){for(var f=[],h=0;h<b.length;h++)f.push(b[h].toString(16));return f},c=function(){function v(f,h,_,g,x){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=f||"white",this.underline=h||!1,this.italics=_||!1,this.background=g||"black",this.flash=x||!1}var b=v.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(h){for(var _=["foreground","underline","italics","background","flash"],g=0;g<_.length;g++){var x=_[g];h.hasOwnProperty(x)&&(this[x]=h[x])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(h){return this.foreground===h.foreground&&this.underline===h.underline&&this.italics===h.italics&&this.background===h.background&&this.flash===h.flash},b.copy=function(h){this.foreground=h.foreground,this.underline=h.underline,this.italics=h.italics,this.background=h.background,this.flash=h.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},v}(),s=function(){function v(f,h,_,g,x,N){this.uchar=void 0,this.penState=void 0,this.uchar=f||" ",this.penState=new c(h,_,g,x,N)}var b=v.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(h,_){this.uchar=h,this.penState.copy(_)},b.setPenState=function(h){this.penState.copy(h)},b.equals=function(h){return this.uchar===h.uchar&&this.penState.equals(h.penState)},b.copy=function(h){this.uchar=h.uchar,this.penState.copy(h.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},v}(),i=function(){function v(f){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var h=0;h<k;h++)this.chars.push(new s);this.logger=f,this.pos=0,this.currPenState=new c}var b=v.prototype;return b.equals=function(h){for(var _=!0,g=0;g<k;g++)if(!this.chars[g].equals(h.chars[g])){_=!1;break}return _},b.copy=function(h){for(var _=0;_<k;_++)this.chars[_].copy(h.chars[_])},b.isEmpty=function(){for(var h=!0,_=0;_<k;_++)if(!this.chars[_].isEmpty()){h=!1;break}return h},b.setCursor=function(h){this.pos!==h&&(this.pos=h),this.pos<0?(this.logger.log(u.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>k&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=k)},b.moveCursor=function(h){var _=this.pos+h;if(h>1)for(var g=this.pos+1;g<_+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(_)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(h){h>=144&&this.backSpace();var _=L(h);if(this.pos>=k){this.logger.log(u.ERROR,"Cannot insert "+h.toString(16)+" ("+_+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(_,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(h){var _;for(_=h;_<k;_++)this.chars[_].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var h=[],_=!0,g=0;g<k;g++){var x=this.chars[g].uchar;x!==" "&&(_=!1),h.push(x)}return _?"":h.join("")},b.setPenStyles=function(h){this.currPenState.setStyles(h);var _=this.chars[this.pos];_.setPenState(this.currPenState)},v}(),n=function(){function v(f){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var h=0;h<W;h++)this.rows.push(new i(f));this.logger=f,this.currRow=W-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=v.prototype;return b.reset=function(){for(var h=0;h<W;h++)this.rows[h].clear();this.currRow=W-1},b.equals=function(h){for(var _=!0,g=0;g<W;g++)if(!this.rows[g].equals(h.rows[g])){_=!1;break}return _},b.copy=function(h){for(var _=0;_<W;_++)this.rows[_].copy(h.rows[_])},b.isEmpty=function(){for(var h=!0,_=0;_<W;_++)if(!this.rows[_].isEmpty()){h=!1;break}return h},b.backSpace=function(){var h=this.rows[this.currRow];h.backSpace()},b.clearToEndOfRow=function(){var h=this.rows[this.currRow];h.clearToEndOfRow()},b.insertChar=function(h){var _=this.rows[this.currRow];_.insertChar(h)},b.setPen=function(h){var _=this.rows[this.currRow];_.setPenStyles(h)},b.moveCursor=function(h){var _=this.rows[this.currRow];_.moveCursor(h)},b.setCursor=function(h){this.logger.log(u.INFO,"setCursor: "+h);var _=this.rows[this.currRow];_.setCursor(h)},b.setPAC=function(h){this.logger.log(u.INFO,"pacData = "+JSON.stringify(h));var _=h.row-1;if(this.nrRollUpRows&&_<this.nrRollUpRows-1&&(_=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==_){for(var g=0;g<W;g++)this.rows[g].clear();var x=this.currRow+1-this.nrRollUpRows,N=this.lastOutputScreen;if(N){var F=N.rows[x].cueStartTime,A=this.logger.time;if(F&&A!==null&&F<A)for(var B=0;B<this.nrRollUpRows;B++)this.rows[_-this.nrRollUpRows+B+1].copy(N.rows[x+B])}}this.currRow=_;var U=this.rows[this.currRow];if(h.indent!==null){var w=h.indent,Y=Math.max(w-1,0);U.setCursor(h.indent),h.color=U.chars[Y].penState.foreground}var q={foreground:h.color,underline:h.underline,italics:h.italics,background:"black",flash:!1};this.setPen(q)},b.setBkgData=function(h){this.logger.log(u.INFO,"bkgData = "+JSON.stringify(h)),this.backSpace(),this.setPen(h),this.insertChar(32)},b.setRollUpRows=function(h){this.nrRollUpRows=h},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(u.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(u.TEXT,this.getDisplayText());var h=this.currRow+1-this.nrRollUpRows,_=this.rows.splice(h,1)[0];_.clear(),this.rows.splice(this.currRow,0,_),this.logger.log(u.INFO,"Rolling up")},b.getDisplayText=function(h){h=h||!1;for(var _=[],g="",x=-1,N=0;N<W;N++){var F=this.rows[N].getTextString();F&&(x=N+1,h?_.push("Row "+x+": '"+F+"'"):_.push(F.trim()))}return _.length>0&&(h?g="["+_.join(" | ")+"]":g=_.join(`
`)),g},b.getTextAndFormat=function(){return this.rows},v}(),O=function(){function v(f,h,_){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=f,this.outputFilter=h,this.mode=null,this.verbose=0,this.displayedMemory=new n(_),this.nonDisplayedMemory=new n(_),this.lastOutputScreen=new n(_),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=_}var b=v.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[W-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(h){this.outputFilter=h},b.setPAC=function(h){this.writeScreen.setPAC(h)},b.setBkgData=function(h){this.writeScreen.setBkgData(h)},b.setMode=function(h){if(h===this.mode)return;this.mode=h,this.logger.log(u.INFO,"MODE="+h),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=h},b.insertChars=function(h){for(var _=0;_<h.length;_++)this.writeScreen.insertChar(h[_]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(u.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(u.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(u.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(u.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(u.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(h){this.logger.log(u.INFO,"RU("+h+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(h)},b.ccFON=function(){this.logger.log(u.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(u.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(u.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(u.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(u.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(u.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(u.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(u.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(u.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(h){this.logger.log(u.INFO,"TO("+h+") - Tab Offset"),this.writeScreen.moveCursor(h)},b.ccMIDROW=function(h){var _={flash:!1};if(_.underline=h%2===1,_.italics=h>=46,_.italics)_.foreground="white";else{var g=Math.floor(h/2)-16,x=["white","green","blue","cyan","red","yellow","magenta"];_.foreground=x[g]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(_)),this.writeScreen.setPen(_)},b.outputDataUpdate=function(h){h===void 0&&(h=!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),h&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:_),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(h){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,h,this.displayedMemory),this.cueStartTime=h))},v}(),S=function(){function v(f,h,_){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new a;this.channels=[null,new O(f,h,g),new O(f+1,_,g)],this.cmdHistory=T(),this.logger=g}var b=v.prototype;return b.getHandler=function(h){return this.channels[h].getHandler()},b.setHandler=function(h,_){this.channels[h].setHandler(_)},b.addData=function(h,_){var g,x,N,F=!1;this.logger.time=h;for(var A=0;A<_.length;A+=2){if(x=_[A]&127,N=_[A+1]&127,x===0&&N===0)continue;if(this.logger.log(u.DATA,"["+o([_[A],_[A+1]])+"] -> ("+o([x,N])+")"),g=this.parseCmd(x,N),g||(g=this.parseMidrow(x,N)),g||(g=this.parsePAC(x,N)),g||(g=this.parseBackgroundAttributes(x,N)),!g&&(F=this.parseChars(x,N),F)){var B=this.currentChannel;if(B&&B>0){var U=this.channels[B];U.insertChars(F)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!F&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+o([x,N])+" orig: "+o([_[A],_[A+1]]))}},b.parseCmd=function(h,_){var g=this.cmdHistory,x=(h===20||h===28||h===21||h===29)&&_>=32&&_<=47,N=(h===23||h===31)&&_>=33&&_<=35;if(!(x||N))return!1;if(R(h,_,g))return C(null,null,g),this.logger.log(u.DEBUG,"Repeated command ("+o([h,_])+") is dropped"),!0;var F=h===20||h===21||h===23?1:2,A=this.channels[F];return h===20||h===21||h===28||h===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(h,_,g),this.currentChannel=F,!0},b.parseMidrow=function(h,_){var g=0;if((h===17||h===25)&&_>=32&&_<=47){if(h===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var x=this.channels[g];return x?(x.ccMIDROW(_),this.logger.log(u.DEBUG,"MIDROW ("+o([h,_])+")"),!0):!1}return!1},b.parsePAC=function(h,_){var g,x=this.cmdHistory,N=(h>=17&&h<=23||h>=25&&h<=31)&&_>=64&&_<=127,F=(h===16||h===24)&&_>=64&&_<=95;if(!(N||F))return!1;if(R(h,_,x))return C(null,null,x),!0;var A=h<=23?1:2;_>=64&&_<=95?g=A===1?r[h]:E[h]:g=A===1?M[h]:p[h];var B=this.channels[A];return B?(B.setPAC(this.interpretPAC(g,_)),C(h,_,x),this.currentChannel=A,!0):!1},b.interpretPAC=function(h,_){var g,x={color:null,italics:!1,indent:null,underline:!1,row:h};return _>95?g=_-96:g=_-64,x.underline=(g&1)===1,g<=13?x.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(x.italics=!0,x.color="white"):x.indent=Math.floor((g-16)/2)*4,x},b.parseChars=function(h,_){var g,x=null,N=null;if(h>=25?(g=2,N=h-8):(g=1,N=h),N>=17&&N<=19){var F;N===17?F=_+80:N===18?F=_+112:F=_+144,this.logger.log(u.INFO,"Special char '"+L(F)+"' in channel "+g),x=[F]}else h>=32&&h<=127&&(x=_===0?[h]:[h,_]);if(x){var A=o(x);this.logger.log(u.DEBUG,"Char codes = "+A.join(",")),C(h,_,this.cmdHistory)}return x},b.parseBackgroundAttributes=function(h,_){var g=(h===16||h===24)&&_>=32&&_<=47,x=(h===23||h===31)&&_>=45&&_<=47;if(!(g||x))return!1;var N,F={};h===16||h===24?(N=Math.floor((_-32)/2),F.background=m[N],_%2===1&&(F.background=F.background+"_semi")):_===45?F.background="transparent":(F.foreground="black",_===47&&(F.underline=!0));var A=h<=23?1:2,B=this.channels[A];return B.setBkgData(F),C(h,_,this.cmdHistory),!0},b.reset=function(){for(var h=0;h<Object.keys(this.channels).length;h++){var _=this.channels[h];_&&_.reset()}this.cmdHistory=T()},b.cueSplitAtTime=function(h){for(var _=0;_<this.channels.length;_++){var g=this.channels[_];g&&g.cueSplitAtTime(h)}},v}();function C(v,b,f){f.a=v,f.b=b}function R(v,b,f){return f.a===v&&f.b===b}function T(){return{a:null,b:null}}V.default=S},"./src/utils/codecs.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"isCodecType",function(){return P}),I.d(V,"isCodecSupportedInMp4",function(){return L});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(W,k){var r=G[k];return!!r&&r[W.slice(0,4)]===!0}function L(W,k){return MediaSource.isTypeSupported((k||"video")+'/mp4;codecs="'+W+'"')}},"./src/utils/cues.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/utils/vttparser.ts"),P=I("./src/utils/webvtt-parser.ts"),L=I("./src/utils/texttrack-utils.ts"),W=/\s/,k={newCue:function(M,E,p,m){for(var u=[],a,o,c,s,i,n=self.VTTCue||self.TextTrackCue,O=0;O<m.rows.length;O++)if(a=m.rows[O],c=!0,s=0,i="",!a.isEmpty()){for(var S=0;S<a.chars.length;S++)W.test(a.chars[S].uchar)&&c?s++:(i+=a.chars[S].uchar,c=!1);a.cueStartTime=E,E===p&&(p+=1e-4),s>=16?s--:s++;var C=Object(G.fixLineBreaks)(i.trim()),R=Object(P.generateCueId)(E,p,C);(!M||!M.cues||!M.cues.getCueById(R))&&(o=new n(E,p,C),o.id=R,o.line=O+1,o.align="left",o.position=10+Math.min(80,Math.floor(s*8/32)*10),u.push(o))}return M&&u.length&&(u.sort(function(T,v){return T.line==="auto"||v.line==="auto"?0:T.line>8&&v.line>8?v.line-T.line:T.line-v.line}),u.forEach(function(T){return Object(L.addCueToTrack)(M,T)})),u}};V.default=k},"./src/utils/discontinuities.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"findFirstFragWithCC",function(){return W}),I.d(V,"shouldAlignOnDiscontinuities",function(){return k}),I.d(V,"findDiscontinuousReferenceFrag",function(){return r}),I.d(V,"adjustSlidingStart",function(){return E}),I.d(V,"alignStream",function(){return p}),I.d(V,"alignPDT",function(){return u}),I.d(V,"alignFragmentByPDTDelta",function(){return a}),I.d(V,"alignMediaPlaylistByPDT",function(){return o});var G=I("./src/polyfills/number.ts"),P=I("./src/utils/logger.ts"),L=I("./src/controller/level-helper.ts");function W(c,s){for(var i=null,n=0,O=c.length;n<O;n++){var S=c[n];if(S&&S.cc===s){i=S;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=W(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 E(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 p(c,s,i){if(!s)return;m(c,i,s),!i.alignedSliding&&s.details&&u(i,s.details),!i.alignedSliding&&s.details&&!i.skippedSegments&&Object(L.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),E(n.start,s))}}function u(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+" "),E(O,c))}function a(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 o(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(S){a(S,O)}),c.fragmentHint&&a(c.fragmentHint,O),c.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/utils/ewma.ts"),P=function(){function L(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 W=L.prototype;return W.update=function(r,M){var E=this.slow_,p=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new G.default(r,E.getEstimate(),E.getTotalWeight())),this.fast_.halfLife!==M&&(this.fast_=new G.default(M,p.getEstimate(),p.getTotalWeight()))},W.sample=function(r,M){r=Math.max(r,this.minDelayMs_);var E=8*M,p=r/1e3,m=E/p;this.fast_.sample(p,m),this.slow_.sample(p,m)},W.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},W.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},W.destroy=function(){},L}();V.default=P},"./src/utils/ewma.ts":function(Z,V,I){"use strict";I.r(V);var G=function(){function P(W,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=W,this.alpha_=W?Math.exp(Math.log(.5)/W):0,this.estimate_=k,this.totalWeight_=r}var L=P.prototype;return L.sample=function(k,r){var M=Math.pow(this.alpha_,k);this.estimate_=r*(1-M)+M*this.estimate_,this.totalWeight_+=k},L.getTotalWeight=function(){return this.totalWeight_},L.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,I){"use strict";I.r(V),I.d(V,"fetchSupported",function(){return a});var G=I("./src/polyfills/number.ts"),P=I("./src/loader/load-stats.ts"),L=I("./src/demux/chunk-cache.ts");function W(n,O){n.prototype=Object.create(O.prototype),n.prototype.constructor=n,p(n,O)}function k(n){var O=typeof Map=="function"?new Map:void 0;return k=function(C){if(C===null||!E(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}}),p(R,C)},k(n)}function r(n,O,S){return M()?r=Reflect.construct:r=function(R,T,v){var b=[null];b.push.apply(b,T);var f=Function.bind.apply(R,b),h=new f;return v&&p(h,v.prototype),h},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 E(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function p(n,O){return p=Object.setPrototypeOf||function(C,R){return C.__proto__=R,C},p(n,O)}function m(n){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},m(n)}function u(){return u=Object.assign||function(n){for(var O=1;O<arguments.length;O++){var S=arguments[O];for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(n[C]=S[C])}return n},u.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(n){}return!1}var o=function(){function n(S){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=S.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,T){var v=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var f=c(C,this.controller.signal),h=T.onProgress,_=C.responseType==="arraybuffer",g=_?"byteLength":"length";this.context=C,this.config=R,this.callbacks=T,this.request=this.fetchSetup(C,f),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){v.abortInternal(),T.onTimeout(b,C,v.response)},R.timeout),self.fetch(this.request).then(function(x){if(v.response=v.loader=x,!x.ok){var N=x.status,F=x.statusText;throw new i(F||"fetch, bad network response",N,x)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(x.headers.get("Content-Length")||"0"),h&&Object(G.isFiniteNumber)(R.highWaterMark)?v.loadProgressively(x,b,C,R.highWaterMark,h):_?x.arrayBuffer():x.text()}).then(function(x){var N=v.response;self.clearTimeout(v.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=x[g];var F={url:N.url,data:x};h&&!Object(G.isFiniteNumber)(R.highWaterMark)&&h(b,C,x,N),T.onSuccess(F,b,C,N)}).catch(function(x){if(self.clearTimeout(v.requestTimeout),b.aborted)return;var N=x.code||0;T.onError({code:N,text:x.message},C,x.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,T,v,b){v===void 0&&(v=0);var f=new L.default,h=C.body.getReader(),_=function g(){return h.read().then(function(x){if(x.done)return f.dataLength&&b(R,T,f.flush(),C),Promise.resolve(new ArrayBuffer(0));var N=x.value,F=N.length;return R.loaded+=F,F<v||f.dataLength?(f.push(N),f.dataLength>=v&&b(R,T,f.flush(),C)):b(R,T,N,C),g()}).catch(function(){return Promise.reject()})};return _()},n}();function c(n,O){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:O,headers:new self.Headers(u({},n.headers))};return n.rangeEnd&&S.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),S}function s(n,O){return new self.Request(n.url,O)}var i=function(n){W(O,n);function O(S,C,R){var T;return T=n.call(this,S)||this,T.code=void 0,T.details=void 0,T.code=C,T.details=R,T}return O}(k(Error));V.default=o},"./src/utils/imsc1-ttml-parser.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"IMSC1_CODEC",function(){return E}),I.d(V,"parseIMSC1",function(){return a});var G=I("./src/utils/mp4-tools.ts"),P=I("./src/utils/vttparser.ts"),L=I("./src/utils/vttcue.ts"),W=I("./src/demux/id3.ts"),k=I("./src/utils/timescale-conversion.ts"),r=I("./src/utils/webvtt-parser.ts");function M(){return M=Object.assign||function(v){for(var b=1;b<arguments.length;b++){var f=arguments[b];for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(v[h]=f[h])}return v},M.apply(this,arguments)}var E="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,m=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,u={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(v,b,f,h,_){var g=Object(G.findBox)(new Uint8Array(v),["mdat"]);if(g.length===0){_(new Error("Could not parse IMSC1 mdat"));return}var x=g[0],N=Object(W.utf8ArrayToStr)(new Uint8Array(v,x.start,x.end-x.start)),F=Object(k.toTimescaleFromScale)(b,1,f);try{h(o(N,F))}catch(A){_(A)}}function o(v,b){var f=new DOMParser,h=f.parseFromString(v,"text/xml"),_=h.getElementsByTagName("tt")[0];if(!_)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},x=Object.keys(g).reduce(function(U,w){return U[w]=_.getAttribute("ttp:"+w)||g[w],U},{}),N=_.getAttribute("xml:space")!=="preserve",F=s(c(_,"styling","style")),A=s(c(_,"layout","region")),B=c(_,"body","[begin]");return[].map.call(B,function(U){var w=i(U,N);if(!w||!U.hasAttribute("begin"))return null;var Y=C(U.getAttribute("begin"),x),q=C(U.getAttribute("dur"),x),ce=C(U.getAttribute("end"),x);if(Y===null)throw S(U);if(ce===null){if(q===null)throw S(U);ce=Y+q}var Ee=new L.default(Y-b,ce-b,w);Ee.id=Object(r.generateCueId)(Ee.startTime,Ee.endTime,Ee.text);var Qe=A[U.getAttribute("region")],Te=F[U.getAttribute("style")];Ee.position=10,Ee.size=80;var We=n(Qe,Te),$e=We.textAlign;if($e){var Je=u[$e];Je&&(Ee.lineAlign=Je),Ee.align=$e}return M(Ee,We),Ee}).filter(function(U){return U!==null})}function c(v,b,f){var h=v.getElementsByTagName(b)[0];return h?[].slice.call(h.querySelectorAll(f)):[]}function s(v){return v.reduce(function(b,f){var h=f.getAttribute("xml:id");return h&&(b[h]=f),b},{})}function i(v,b){return[].slice.call(v.childNodes).reduce(function(f,h,_){var g;return h.nodeName==="br"&&_?f+`
`:(g=h.childNodes)!==null&&g!==void 0&&g.length?i(h,b):b?f+h.textContent.trim().replace(/\s+/g," "):f+h.textContent},"")}function n(v,b){var f="http://www.w3.org/ns/ttml#styling",h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return h.reduce(function(_,g){var x=O(b,f,g)||O(v,f,g);return x&&(_[g]=x),_},{})}function O(v,b,f){return v.hasAttributeNS(b,f)?v.getAttributeNS(b,f):null}function S(v){return new Error("Could not parse ttml timestamp "+v)}function C(v,b){if(!v)return null;var f=Object(P.parseTimeStamp)(v);return f===null&&(p.test(v)?f=R(v,b):m.test(v)&&(f=T(v,b))),f}function R(v,b){var f=p.exec(v),h=(f[4]|0)+(f[5]|0)/b.subFrameRate;return(f[1]|0)*3600+(f[2]|0)*60+(f[3]|0)+h/b.frameRate}function T(v,b){var f=m.exec(v),h=Number(f[1]),_=f[2];switch(_){case"h":return h*3600;case"m":return h*60;case"ms":return h*1e3;case"f":return h/b.frameRate;case"t":return h/b.tickRate}return h}},"./src/utils/logger.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"enableLogs",function(){return r}),I.d(V,"logger",function(){return M});var G=function(){},P={trace:G,debug:G,log:G,warn:G,info:G,error:G},L=P;function W(E){var p=self.console[E];return p?p.bind(self.console,"["+E+"] >"):G}function k(E){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];m.forEach(function(a){L[a]=E[a]?E[a].bind(E):W(a)})}function r(E){if(self.console&&E===!0||typeof E=="object"){k(E,"debug","log","info","warn","error");try{L.log()}catch(p){L=P}}else L=P}var M=L},"./src/utils/mediakeys-helper.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"KeySystems",function(){return G}),I.d(V,"requestMediaKeySystemAccess",function(){return P});var G;(function(L){L.WIDEVINE="com.widevine.alpha",L.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,I){"use strict";I.r(V),I.d(V,"getMediaSource",function(){return G});function G(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"bin2str",function(){return k}),I.d(V,"readUint16",function(){return r}),I.d(V,"readUint32",function(){return M}),I.d(V,"writeUint32",function(){return E}),I.d(V,"findBox",function(){return p}),I.d(V,"parseSegmentIndex",function(){return m}),I.d(V,"parseInitSegment",function(){return u}),I.d(V,"getStartDTS",function(){return a}),I.d(V,"getDuration",function(){return o}),I.d(V,"computeRawDurationFromSamples",function(){return c}),I.d(V,"offsetStartDTS",function(){return s}),I.d(V,"segmentValidRange",function(){return i}),I.d(V,"appendUint8Array",function(){return n});var G=I("./src/utils/typed-array.ts"),P=I("./src/loader/fragment.ts"),L=Math.pow(2,32)-1,W=[].push;function k(O){return String.fromCharCode.apply(null,O)}function r(O,S){"data"in O&&(S+=O.start,O=O.data);var C=O[S]<<8|O[S+1];return C<0?65536+C:C}function M(O,S){"data"in O&&(S+=O.start,O=O.data);var C=O[S]<<24|O[S+1]<<16|O[S+2]<<8|O[S+3];return C<0?4294967296+C:C}function E(O,S,C){"data"in O&&(S+=O.start,O=O.data),O[S]=C>>24,O[S+1]=C>>16&255,O[S+2]=C>>8&255,O[S+3]=C&255}function p(O,S){var C=[];if(!S.length)return C;var R,T,v;"data"in O?(R=O.data,T=O.start,v=O.end):(R=O,T=0,v=R.byteLength);for(var b=T;b<v;){var f=M(R,b),h=k(R.subarray(b+4,b+8)),_=f>1?b+f:v;if(h===S[0])if(S.length===1)C.push({data:R,start:b+8,end:_});else{var g=p({data:R,start:b+8,end:_},S.slice(1));g.length&&W.apply(C,g)}b=_}return C}function m(O){var S=p(O,["moov"]),C=S[0],R=C?C.end:null,T=p(O,["sidx"]);if(!T||!T[0])return null;var v=[],b=T[0],f=b.data[0],h=f===0?8:16,_=M(b,h);h+=4;var g=0,x=0;f===0?h+=8:h+=16,h+=2;var N=b.end+x,F=r(b,h);h+=2;for(var A=0;A<F;A++){var B=h,U=M(b,B);B+=4;var w=U&2147483647,Y=(U&2147483648)>>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var q=M(b,B);B+=4,v.push({referenceSize:w,subsegmentDuration:q,info:{duration:q/_,start:N,end:N+w-1}}),N+=w,B+=4,h=B}return{earliestPresentationTime:g,timescale:_,version:f,referencesCount:F,references:v,moovEndOffset:R}}function u(O){for(var S=[],C=p(O,["moov","trak"]),R=0;R<C.length;R++){var T=C[R],v=p(T,["tkhd"])[0];if(v){var b=v.data[v.start],f=b===0?12:20,h=M(v,f),_=p(T,["mdia","mdhd"])[0];if(_){b=_.data[_.start],f=b===0?12:20;var g=M(_,f),x=p(T,["mdia","hdlr"])[0];if(x){var N=k(x.data.subarray(x.start+8,x.start+12)),F={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[N];if(F){var A=p(T,["mdia","minf","stbl","stsd"])[0],B=void 0;A&&(B=k(A.data.subarray(A.start+12,A.start+16))),S[h]={timescale:g,type:F},S[F]={timescale:g,id:h,codec:B}}}}}}var U=p(O,["moov","mvex","trex"]);return U.forEach(function(w){var Y=M(w,4),q=S[Y];q&&(q.default={duration:M(w,12),flags:M(w,20)})}),S}function a(O,S){return p(S,["moof","traf"]).reduce(function(C,R){var T=p(R,["tfdt"])[0],v=T.data[T.start],b=p(R,["tfhd"]).reduce(function(f,h){var _=M(h,4),g=O[_];if(g){var x=M(T,4);v===1&&(x*=Math.pow(2,32),x+=M(T,8));var N=g.timescale||9e4,F=x/N;if(isFinite(F)&&(f===null||F<f))return F}return f},null);return b!==null&&isFinite(b)&&(C===null||b<C)?b:C},null)||0}function o(O,S){for(var C=0,R=0,T=0,v=p(O,["moof","traf"]),b=0;b<v.length;b++){var f=v[b],h=p(f,["tfhd"])[0],_=M(h,4),g=S[_];if(!g)continue;var x=g.default,N=M(h,0)|(x==null?void 0:x.flags),F=x==null?void 0:x.duration;N&8&&(N&2?F=M(h,12):F=M(h,8));for(var A=g.timescale||9e4,B=p(f,["trun"]),U=0;U<B.length;U++){if(F){var w=M(B[U],4);C=F*w}else C=c(B[U]);g.type===P.ElementaryStreamTypes.VIDEO?R+=C/A:g.type===P.ElementaryStreamTypes.AUDIO&&(T+=C/A)}}if(R===0&&T===0){var Y=m(O);if(Y!=null&&Y.references)return Y.references.reduce(function(q,ce){return q+ce.info.duration||0},0)}return R||T}function c(O){var S=M(O,0),C=8;S&1&&(C+=4),S&4&&(C+=4);for(var R=0,T=M(O,4),v=0;v<T;v++){if(S&256){var b=M(O,C);R+=b,C+=4}S&512&&(C+=4),S&1024&&(C+=4),S&2048&&(C+=4)}return R}function s(O,S,C){p(S,["moof","traf"]).forEach(function(R){p(R,["tfhd"]).forEach(function(T){var v=M(T,4),b=O[v];if(!b)return;var f=b.timescale||9e4;p(R,["tfdt"]).forEach(function(h){var _=h.data[h.start],g=M(h,4);if(_===0)E(h,4,g-C*f);else{g*=Math.pow(2,32),g+=M(h,8),g-=C*f,g=Math.max(g,0);var x=Math.floor(g/(L+1)),N=Math.floor(g%(L+1));E(h,4,x),E(h,8,N)}})})})}function i(O){var S={valid:null,remainder:null},C=p(O,["moof"]);if(C){if(C.length<2)return S.remainder=O,S}else return S;var R=C[C.length-1];return S.valid=Object(G.sliceUint8)(O,0,R.start-8),S.remainder=Object(G.sliceUint8)(O,R.start-8),S}function n(O,S){var C=new Uint8Array(O.length+S.length);return C.set(O),C.set(S,O.length),C}},"./src/utils/output-filter.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"default",function(){return G});var G=function(){function P(W,k){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=W,this.trackName=k}var L=P.prototype;return L.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},L.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)},L.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"sendAddTrackEvent",function(){return P}),I.d(V,"addCueToTrack",function(){return L}),I.d(V,"clearCurrentCues",function(){return W}),I.d(V,"removeCuesInRange",function(){return k}),I.d(V,"getCuesInRange",function(){return M});var G=I("./src/utils/logger.ts");function P(E,p){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=E,p.dispatchEvent(m)}function L(E,p){var m=E.mode;if(m==="disabled"&&(E.mode="hidden"),E.cues&&!E.cues.getCueById(p.id))try{if(E.addCue(p),!E.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(a){G.logger.debug("[texttrack-utils]: "+a);var u=new self.TextTrackCue(p.startTime,p.endTime,p.text);u.id=p.id,E.addCue(u)}m==="disabled"&&(E.mode=m)}function W(E){var p=E.mode;if(p==="disabled"&&(E.mode="hidden"),E.cues)for(var m=E.cues.length;m--;)E.removeCue(E.cues[m]);p==="disabled"&&(E.mode=p)}function k(E,p,m){var u=E.mode;if(u==="disabled"&&(E.mode="hidden"),E.cues&&E.cues.length>0)for(var a=M(E.cues,p,m),o=0;o<a.length;o++)E.removeCue(a[o]);u==="disabled"&&(E.mode=u)}function r(E,p){if(p<E[0].startTime)return 0;var m=E.length-1;if(p>E[m].endTime)return-1;for(var u=0,a=m;u<=a;){var o=Math.floor((a+u)/2);if(p<E[o].startTime)a=o-1;else if(p>E[o].startTime&&u<m)u=o+1;else return o}return E[u].startTime-p<p-E[a].startTime?u:a}function M(E,p,m){var u=[],a=r(E,p);if(a>-1)for(var o=a,c=E.length;o<c;o++){var s=E[o];if(s.startTime>=p&&s.endTime<=m)u.push(s);else if(s.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(Z,V,I){"use strict";I.r(V);var G={toString:function(L){for(var W="",k=L.length,r=0;r<k;r++)W+="["+L.start(r).toFixed(3)+","+L.end(r).toFixed(3)+"]";return W}};V.default=G},"./src/utils/timescale-conversion.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"toTimescaleFromBase",function(){return P}),I.d(V,"toTimescaleFromScale",function(){return L}),I.d(V,"toMsFromMpegTsClock",function(){return W}),I.d(V,"toMpegTsClockFromTimescale",function(){return k});var G=9e4;function P(r,M,E,p){E===void 0&&(E=1),p===void 0&&(p=!1);var m=r*M*E;return p?Math.round(m):m}function L(r,M,E,p){return E===void 0&&(E=1),p===void 0&&(p=!1),P(r,M,1/E,p)}function W(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,I){"use strict";I.r(V),I.d(V,"sliceUint8",function(){return G});function G(P,L,W){return Uint8Array.prototype.slice?P.slice(L,W):new Uint8Array(Array.prototype.slice.call(P,L,W))}},"./src/utils/vttcue.ts":function(Z,V,I){"use strict";I.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 L(E,p){if(typeof p!="string")return!1;if(!Array.isArray(E))return!1;var m=p.toLowerCase();return~E.indexOf(m)?m:!1}function W(E){return L(G,E)}function k(E){return L(P,E)}function r(E){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u<p;u++)m[u-1]=arguments[u];for(var a=1;a<arguments.length;a++){var o=arguments[a];for(var c in o)E[c]=o[c]}return E}function M(E,p,m){var u=this,a={enumerable:!0};u.hasBeenReset=!1;var o="",c=!1,s=E,i=p,n=m,O=null,S="",C=!0,R="auto",T="start",v=50,b="middle",f=50,h="middle";Object.defineProperty(u,"id",r({},a,{get:function(){return o},set:function(g){o=""+g}})),Object.defineProperty(u,"pauseOnExit",r({},a,{get:function(){return c},set:function(g){c=!!g}})),Object.defineProperty(u,"startTime",r({},a,{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(u,"endTime",r({},a,{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(u,"text",r({},a,{get:function(){return n},set:function(g){n=""+g,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",r({},a,{get:function(){return O},set:function(g){O=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",r({},a,{get:function(){return S},set:function(g){var x=W(g);if(x===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",r({},a,{get:function(){return C},set:function(g){C=!!g,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",r({},a,{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(u,"lineAlign",r({},a,{get:function(){return T},set:function(g){var x=k(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");T=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",r({},a,{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(u,"positionAlign",r({},a,{get:function(){return b},set:function(g){var x=k(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");b=x,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",r({},a,{get:function(){return f},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");f=g,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",r({},a,{get:function(){return h},set:function(g){var x=k(g);if(!x)throw new SyntaxError("An invalid or illegal string was specified.");h=x,this.hasBeenReset=!0}})),u.displayState=void 0}return M.prototype.getCueAsHTML=function(){var E=self.WebVTT;return E.convertCueToDOMTree(self,this.text)},M}()},"./src/utils/vttparser.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"parseTimeStamp",function(){return L}),I.d(V,"fixLineBreaks",function(){return p}),I.d(V,"VTTParser",function(){return m});var G=I("./src/utils/vttcue.ts"),P=function(){function u(){}var a=u.prototype;return a.decode=function(c,s){if(!c)return"";if(typeof c!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(c))},u}();function L(u){function a(c,s,i,n){return(c|0)*3600+(s|0)*60+(i|0)+parseFloat(n||0)}var o=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?a(o[2],o[3],0,o[4]):a(o[1],o[2],o[3],o[4]):null}var W=function(){function u(){this.values=Object.create(null)}var a=u.prototype;return a.set=function(c,s){!this.get(c)&&s!==""&&(this.values[c]=s)},a.get=function(c,s,i){return i?this.has(c)?this.values[c]:s[i]:this.has(c)?this.values[c]:s},a.has=function(c){return c in this.values},a.alt=function(c,s,i){for(var n=0;n<i.length;++n)if(s===i[n]){this.set(c,s);break}},a.integer=function(c,s){/^-?\d+$/.test(s)&&this.set(c,parseInt(s,10))},a.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},u}();function k(u,a,o,c){var s=c?u.split(c):[u];for(var i in s){if(typeof s[i]!="string")continue;var n=s[i].split(o);if(n.length!==2)continue;var O=n[0],S=n[1];a(O,S)}}var r=new G.default(0,0,""),M=r.align==="middle"?"middle":"center";function E(u,a,o){var c=u;function s(){var O=L(u);if(O===null)throw new Error("Malformed timestamp: "+c);return u=u.replace(/^[^\sa-zA-Z-]+/,""),O}function i(O,S){var C=new W;k(O,function(v,b){var f;switch(v){case"region":for(var h=o.length-1;h>=0;h--)if(o[h].id===b){C.set(v,o[h].region);break}break;case"vertical":C.alt(v,b,["rl","lr"]);break;case"line":f=b.split(","),C.integer(v,f[0]),C.percent(v,f[0])&&C.set("snapToLines",!1),C.alt(v,f[0],["auto"]),f.length===2&&C.alt("lineAlign",f[1],["start",M,"end"]);break;case"position":f=b.split(","),C.percent(v,f[0]),f.length===2&&C.alt("positionAlign",f[1],["start",M,"end","line-left","line-right","auto"]);break;case"size":C.percent(v,b);break;case"align":C.alt(v,b,["start",M,"end","left","right"]);break}},/:/,/\s/),S.region=C.get("region",null),S.vertical=C.get("vertical","");var R=C.get("line","auto");R==="auto"&&r.line===-1&&(R=-1),S.line=R,S.lineAlign=C.get("lineAlign","start"),S.snapToLines=C.get("snapToLines",!0),S.size=C.get("size",100),S.align=C.get("align",M);var T=C.get("position","auto");T==="auto"&&r.position===50&&(T=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=T}function n(){u=u.replace(/^\s+/,"")}if(n(),a.startTime=s(),n(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+c);u=u.substr(3),n(),a.endTime=s(),n(),i(u,a)}function p(u){return u.replace(/<br(?: \/)?>/gi,`
`)}var m=function(){function u(){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 a=u.prototype;return a.parse=function(c){var s=this;c&&(s.buffer+=s.decoder.decode(c,{stream:!0}));function i(){var T=s.buffer,v=0;for(T=p(T);v<T.length&&T[v]!=="\r"&&T[v]!==`
`;)++v;var b=T.substr(0,v);return T[v]==="\r"&&++v,T[v]===`
`&&++v,s.buffer=T.substr(v),b}function n(T){k(T,function(v,b){},/:/)}try{var O="";if(s.state==="INITIAL"){if(!/\r\n|\n/.test(s.buffer))return this;O=i();var S=O.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[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{E(O,s.cue,s.regionList)}catch(T){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(T){s.state==="CUETEXT"&&s.cue&&s.oncue&&s.oncue(s.cue),s.cue=null,s.state=s.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.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},u}()},"./src/utils/webvtt-parser.ts":function(Z,V,I){"use strict";I.r(V),I.d(V,"generateCueId",function(){return m}),I.d(V,"parseWebVTT",function(){return a});var G=I("./src/polyfills/number.ts"),P=I("./src/utils/vttparser.ts"),L=I("./src/demux/id3.ts"),W=I("./src/utils/timescale-conversion.ts"),k=I("./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},E=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},p=function(c){for(var s=5381,i=c.length;i;)s=s*33^c.charCodeAt(--i);return(s>>>0).toString()};function m(o,c,s){return p(o.toString())+p(c.toString())+p(s)}var u=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(;(S=O)!==null&&S!==void 0&&S.new;){var S;c.ccOffset+=n.start-O.start,n.new=!1,n=O,O=c[n.prevCC]}c.presentationOffset=i};function a(o,c,s,i,n,O,S,C){var R=new P.VTTParser,T=Object(L.utf8ArrayToStr)(new Uint8Array(o)).trim().replace(r,`
`).split(`
`),v=[],b=Object(W.toMpegTsClockFromTimescale)(c,s),f="00:00.000",h=0,_=0,g,x=!0,N=!1;R.oncue=function(F){var A=i[n],B=i.ccOffset,U=(h-b)/9e4;if(A!=null&&A.new&&(_!==void 0?B=i.ccOffset=A.start:u(i,n,U)),U&&(B=U-i.presentationOffset),N){var w=F.endTime-F.startTime,Y=Object(k.normalizePts)((F.startTime+B-_)*9e4,O*9e4)/9e4;F.startTime=Y,F.endTime=Y+w}var q=F.text.trim();F.text=decodeURIComponent(encodeURIComponent(q)),F.id||(F.id=m(F.startTime,F.endTime,q)),F.endTime>0&&v.push(F)},R.onparsingerror=function(F){g=F},R.onflush=function(){if(g){C(g);return}S(v)},T.forEach(function(F){if(x)if(M(F,"X-TIMESTAMP-MAP=")){x=!1,N=!0,F.substr(16).split(",").forEach(function(A){M(A,"LOCAL:")?f=A.substr(6):M(A,"MPEGTS:")&&(h=parseInt(A.substr(7)))});try{_=E(f)/1e3}catch(A){N=!1,g=A}return}else F===""&&(x=!1);R.parse(F+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(Z,V,I){"use strict";I.r(V);var G=I("./src/utils/logger.ts"),P=I("./src/loader/load-stats.ts"),L=/^age:\s*[\d.]+\s*$/m,W=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 E=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),E&&(E.onreadystatechange=null,E.onprogress=null,E.readyState!==4&&(this.stats.aborted=!0,E.abort()))},r.abort=function(){var E;this.abortInternal(),(E=this.callbacks)!==null&&E!==void 0&&E.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(E,p,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=E,this.config=p,this.callbacks=m,this.retryDelay=p.retryDelay,this.loadInternal()},r.loadInternal=function(){var E=this.config,p=this.context;if(!E)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var a=this.xhrSetup;try{if(a)try{a(m,p.url)}catch(s){m.open("GET",p.url,!0),a(m,p.url)}m.readyState||m.open("GET",p.url,!0);var o=this.context.headers;if(o)for(var c in o)m.setRequestHeader(c,o[c])}catch(s){this.callbacks.onError({code:m.status,text:s.message},p,m);return}p.rangeEnd&&m.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),E.timeout),m.send()},r.readystatechange=function(){var E=this.context,p=this.loader,m=this.stats;if(!E||!p)return;var u=p.readyState,a=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){p.onreadystatechange=null,p.onprogress=null;var o=p.status;if(o>=200&&o<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var c,s;if(E.responseType==="arraybuffer"?(c=p.response,s=c.byteLength):(c=p.responseText,s=c.length),m.loaded=m.total=s,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(m,E,c,p),!this.callbacks)return;var n={url:p.responseURL,data:c};this.callbacks.onSuccess(n,m,E,p)}else m.retry>=a.maxRetry||o>=400&&o<499?(G.logger.error(o+" while loading "+E.url),this.callbacks.onError({code:o,text:p.statusText},E,p)):(G.logger.warn(o+" while loading "+E.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,a.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},r.loadtimeout=function(){G.logger.warn("timeout while loading "+this.context.url);var E=this.callbacks;E&&(this.abortInternal(),E.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(E){var p=this.stats;p.loaded=E.loaded,E.lengthComputable&&(p.total=E.total)},r.getCacheAge=function(){var E=null;if(this.loader&&L.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");E=p?parseFloat(p):null}return E},k}();V.default=W}}).default})},vHTk:function(jt,_e,D){jt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return Xt});var Z=D("rePB"),V=D("VTBJ"),I=D("KQm4"),G=D("U8pU"),P=D("ODXe"),L=D("q1tI"),W=D("TSYQ"),k=D.n(W),r=D("Gytx"),M=D.n(r),E=D("Kwbf"),p=D("t23M"),m=D("qx4F"),u=D("6eGT"),a=D("IBYe"),o=D("Ff2n"),c=D("c+Xe"),s=D("fyJ8"),i=D("biw7");function n(ze,He,vt,Rt,de){var ee=vt[ze]||{},ne=vt[He]||{},se,pe;ee.fixed==="left"?se=Rt.left[ze]:ne.fixed==="right"&&(pe=Rt.right[He]);var ae=!1,ie=!1,me=!1,ye=!1,xe=vt[He+1],De=vt[ze-1];if(de==="rtl"){if(se!==void 0){var ct=De&&De.fixed==="left";ye=!ct}else if(pe!==void 0){var It=xe&&xe.fixed==="right";me=!It}}else if(se!==void 0){var un=xe&&xe.fixed==="left";ae=!un}else if(pe!==void 0){var mt=De&&De.fixed==="right";ie=!mt}return{fixLeft:se,fixRight:pe,lastFixLeft:ae,firstFixRight:ie,lastFixRight:me,firstFixLeft:ye,isSticky:Rt.isSticky}}var O=D("sR1s");function S(ze){var He=ze.cells,vt=ze.stickyOffsets,Rt=ze.flattenColumns,de=ze.rowComponent,ee=ze.cellComponent,ne=ze.onHeaderRow,se=ze.index,pe=L.useContext(i.a),ae=pe.prefixCls,ie=pe.direction,me;ne&&(me=ne(He.map(function(xe){return xe.column}),se));var ye=Object(O.a)(He.map(function(xe){return xe.column}));return L.createElement(de,Object.assign({},me),He.map(function(xe,De){var ct=xe.column,It=n(xe.colStart,xe.colEnd,Rt,vt,ie),un;return ct&&ct.onHeaderCell&&(un=xe.column.onHeaderCell(ct)),L.createElement(s.a,Object.assign({},xe,{ellipsis:ct.ellipsis,align:ct.align,component:ee,prefixCls:ae,key:ye[De]},It,{additionalProps:un,rowType:"header"}))}))}S.displayName="HeaderRow";var C=S;function R(ze){var He=[];function vt(ne,se){var pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;He[pe]=He[pe]||[];var ae=se,ie=ne.filter(Boolean).map(function(me){var ye={key:me.key,className:me.className||"",children:me.title,column:me,colStart:ae},xe=1,De=me.children;return De&&De.length>0&&(xe=vt(De,ae,pe+1).reduce(function(ct,It){return ct+It},0),ye.hasSubColumns=!0),"colSpan"in me&&(xe=me.colSpan),"rowSpan"in me&&(ye.rowSpan=me.rowSpan),ye.colSpan=xe,ye.colEnd=ye.colStart+xe-1,He[pe].push(ye),ae+=xe,xe});return ie}vt(ze,0);for(var Rt=He.length,de=function(se){He[se].forEach(function(pe){!("rowSpan"in pe)&&!pe.hasSubColumns&&(pe.rowSpan=Rt-se)})},ee=0;ee<Rt;ee+=1)de(ee);return He}function T(ze){var He=ze.stickyOffsets,vt=ze.columns,Rt=ze.flattenColumns,de=ze.onHeaderRow,ee=L.useContext(i.a),ne=ee.prefixCls,se=ee.getComponent,pe=L.useMemo(function(){return R(vt)},[vt]),ae=se(["header","wrapper"],"thead"),ie=se(["header","row"],"tr"),me=se(["header","cell"],"th");return L.createElement(ae,{className:"".concat(ne,"-thead")},pe.map(function(ye,xe){var De=L.createElement(C,{key:xe,flattenColumns:Rt,cells:ye,stickyOffsets:He,rowComponent:ie,cellComponent:me,onHeaderRow:de,index:xe});return De}))}var v=T,b=D("hW8S");function f(ze){for(var He=ze.colWidths,vt=ze.columns,Rt=ze.columCount,de=[],ee=Rt||vt.length,ne=!1,se=ee-1;se>=0;se-=1){var pe=He[se],ae=vt&&vt[se],ie=ae&&ae[b.a];(pe||ie||ne)&&(de.unshift(L.createElement("col",Object.assign({key:se,style:{width:pe,minWidth:pe}},ie))),ne=!0)}return L.createElement("colgroup",null,de)}var h=f;function _(ze,He){return Object(L.useMemo)(function(){for(var vt=[],Rt=0;Rt<He;Rt+=1){var de=ze[Rt];if(de!==void 0)vt[Rt]=de;else return null}return vt},[ze.join("_"),He])}var g=L.forwardRef(function(ze,He){var vt=ze.noData,Rt=ze.columns,de=ze.flattenColumns,ee=ze.colWidths,ne=ze.columCount,se=ze.stickyOffsets,pe=ze.direction,ae=ze.fixHeader,ie=ze.offsetHeader,me=ze.stickyClassName,ye=ze.onScroll,xe=Object(o.a)(ze,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),De=L.useContext(i.a),ct=De.prefixCls,It=De.scrollbarSize,un=De.isSticky,mt=un&&!ae?0:It,Qt=L.useRef(null),ht=L.useCallback(function(Gt){Object(c.b)(He,Gt),Object(c.b)(Qt,Gt)},[]);L.useEffect(function(){var Gt;function qt(Ve){var et=Ve.currentTarget,gt=Ve.deltaX;gt&&(ye({currentTarget:et,scrollLeft:et.scrollLeft+gt}),Ve.preventDefault())}return(Gt=Qt.current)===null||Gt===void 0||Gt.addEventListener("wheel",qt),function(){var Ve;(Ve=Qt.current)===null||Ve===void 0||Ve.removeEventListener("wheel",qt)}},[]);var Et=de[de.length-1],it={fixed:Et?Et.fixed:null,onHeaderCell:function(){return{className:"".concat(ct,"-cell-scrollbar")}}},ve=Object(L.useMemo)(function(){return mt?[].concat(Object(I.a)(Rt),[it]):Rt},[mt,Rt]),Me=Object(L.useMemo)(function(){return mt?[].concat(Object(I.a)(de),[it]):de},[mt,de]),St=Object(L.useMemo)(function(){var Gt=se.right,qt=se.left;return Object(V.a)(Object(V.a)({},se),{},{left:pe==="rtl"?[].concat(Object(I.a)(qt.map(function(Ve){return Ve+mt})),[0]):qt,right:pe==="rtl"?Gt:[].concat(Object(I.a)(Gt.map(function(Ve){return Ve+mt})),[0]),isSticky:un})},[mt,se,un]),lt=_(ee,ne);return L.createElement("div",{style:Object(V.a)({overflow:"hidden"},un?{top:ie}:{}),ref:ht,className:k()("".concat(ct,"-header"),Object(Z.a)({},me,!!me))},L.createElement("table",{style:{tableLayout:"fixed",visibility:vt||lt?null:"hidden"}},L.createElement(h,{colWidths:lt?[].concat(Object(I.a)(lt),[mt]):[],columCount:ne+1,columns:Me}),L.createElement(v,Object.assign({},xe,{stickyOffsets:St,columns:ve,flattenColumns:Me}))))});g.displayName="FixedHeader";var x=g,N=L.createContext(null),F=N;function A(ze){var He=ze.prefixCls,vt=ze.children,Rt=ze.component,de=ze.cellComponent,ee=ze.fixHeader,ne=ze.fixColumn,se=ze.horizonScroll,pe=ze.className,ae=ze.expanded,ie=ze.componentWidth,me=ze.colSpan,ye=L.useContext(i.a),xe=ye.scrollbarSize;return L.useMemo(function(){var De=vt;return ne&&(De=L.createElement("div",{style:{width:ie-(ee?xe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(He,"-expanded-row-fixed")},De)),L.createElement(Rt,{className:pe,style:{display:ae?null:"none"}},L.createElement(s.a,{component:de,prefixCls:He,colSpan:me},De))},[vt,Rt,ee,se,pe,ae,ie,me,xe])}var B=A;function U(ze){var He=ze.className,vt=ze.style,Rt=ze.record,de=ze.index,ee=ze.rowKey,ne=ze.getRowKey,se=ze.rowExpandable,pe=ze.expandedKeys,ae=ze.onRow,ie=ze.indent,me=ie===void 0?0:ie,ye=ze.rowComponent,xe=ze.cellComponent,De=ze.childrenColumnName,ct=L.useContext(i.a),It=ct.prefixCls,un=ct.fixedInfoList,mt=L.useContext(F),Qt=mt.fixHeader,ht=mt.fixColumn,Et=mt.horizonScroll,it=mt.componentWidth,ve=mt.flattenColumns,Me=mt.expandableType,St=mt.expandRowByClick,lt=mt.onTriggerExpand,Gt=mt.rowClassName,qt=mt.expandedRowClassName,Ve=mt.indentSize,et=mt.expandIcon,gt=mt.expandedRowRender,Ht=mt.expandIconColumnIndex,Vt=L.useState(!1),dn=Object(P.a)(Vt,2),Zn=dn[0],Wn=dn[1],tn=pe&&pe.has(ze.recordKey);L.useEffect(function(){tn&&Wn(!0)},[tn]);var Hn=Me==="row"&&(!se||se(Rt)),ir=Me==="nest",Dn=De&&Rt&&Rt[De],Vn=Hn||ir,qn;ae&&(qn=ae(Rt,de));var Mr=function(Yn){if(St&&Vn&&lt(Rt,Yn),qn&&qn.onClick){for(var mi,hn=arguments.length,ei=new Array(hn>1?hn-1:0),zr=1;zr<hn;zr++)ei[zr-1]=arguments[zr];(mi=qn).onClick.apply(mi,[Yn].concat(ei))}},Sr;typeof Gt=="string"?Sr=Gt:typeof Gt=="function"&&(Sr=Gt(Rt,de,me));var on=Object(O.a)(ve),Jn=L.createElement(ye,Object.assign({},qn,{"data-row-key":ee,className:k()(He,"".concat(It,"-row"),"".concat(It,"-row-level-").concat(me),Sr,qn&&qn.className),style:Object(V.a)(Object(V.a)({},vt),qn?qn.style:null),onClick:Mr}),ve.map(function(Lr,Yn){var mi=Lr.render,hn=Lr.dataIndex,ei=Lr.className,zr=on[Yn],wi=un[Yn],gi;Yn===(Ht||0)&&ir&&(gi=L.createElement(L.Fragment,null,L.createElement("span",{style:{paddingLeft:"".concat(Ve*me,"px")},className:"".concat(It,"-row-indent indent-level-").concat(me)}),et({prefixCls:It,expanded:tn,expandable:Dn,record:Rt,onExpand:lt})));var ri;return Lr.onCell&&(ri=Lr.onCell(Rt,de)),L.createElement(s.a,Object.assign({className:ei,ellipsis:Lr.ellipsis,align:Lr.align,component:xe,prefixCls:It,key:zr,record:Rt,index:de,dataIndex:hn,render:mi,shouldCellUpdate:Lr.shouldCellUpdate},wi,{appendNode:gi,additionalProps:ri}))})),oi;if(Hn&&(Zn||tn)){var xi=gt(Rt,de,me+1,tn),Jr=qt&&qt(Rt,de,me);oi=L.createElement(B,{expanded:tn,className:k()("".concat(It,"-expanded-row"),"".concat(It,"-expanded-row-level-").concat(me+1),Jr),prefixCls:It,fixHeader:Qt,fixColumn:ht,horizonScroll:Et,component:ye,componentWidth:it,cellComponent:xe,colSpan:ve.length},xi)}var Yr;return Dn&&tn&&(Yr=(Rt[De]||[]).map(function(Lr,Yn){var mi=ne(Lr,Yn);return L.createElement(U,Object.assign({},ze,{key:mi,rowKey:mi,record:Lr,recordKey:mi,index:Yn,indent:me+1}))})),L.createElement(L.Fragment,null,Jn,oi,Yr)}U.displayName="BodyRow";var w=U,Y=L.createContext(null),q=Y;function ce(ze){var He=ze.columnKey,vt=ze.onColumnResize,Rt=L.useRef();return L.useEffect(function(){Rt.current&&vt(He,Rt.current.offsetWidth)},[]),L.createElement(p.a,{onResize:function(ee){var ne=ee.offsetWidth;vt(He,ne)}},L.createElement("td",{ref:Rt,style:{padding:0,border:0,height:0}},L.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Ee(ze){var He=ze.data,vt=ze.getRowKey,Rt=ze.measureColumnWidth,de=ze.expandedKeys,ee=ze.onRow,ne=ze.rowExpandable,se=ze.emptyNode,pe=ze.childrenColumnName,ae=L.useContext(q),ie=ae.onColumnResize,me=L.useContext(i.a),ye=me.prefixCls,xe=me.getComponent,De=L.useContext(F),ct=De.fixHeader,It=De.horizonScroll,un=De.flattenColumns,mt=De.componentWidth;return L.useMemo(function(){var Qt=xe(["body","wrapper"],"tbody"),ht=xe(["body","row"],"tr"),Et=xe(["body","cell"],"td"),it;He.length?it=He.map(function(Me,St){var lt=vt(Me,St);return L.createElement(w,{key:lt,rowKey:lt,record:Me,recordKey:lt,index:St,rowComponent:ht,cellComponent:Et,expandedKeys:de,onRow:ee,getRowKey:vt,rowExpandable:ne,childrenColumnName:pe})}):it=L.createElement(B,{expanded:!0,className:"".concat(ye,"-placeholder"),prefixCls:ye,fixHeader:ct,fixColumn:It,horizonScroll:It,component:ht,componentWidth:mt,cellComponent:Et,colSpan:un.length},se);var ve=Object(O.a)(un);return L.createElement(Qt,{className:"".concat(ye,"-tbody")},Rt&&L.createElement("tr",{"aria-hidden":"true",className:"".concat(ye,"-measure-row"),style:{height:0}},ve.map(function(Me){return L.createElement(ce,{key:Me,columnKey:Me,onColumnResize:ie})})),it)},[He,ye,ee,Rt,de,vt,xe,mt,se,un])}var Qe=L.memo(Ee);Qe.displayName="Body";var Te=Qe,We=D("wRmb"),$e=D("xEkU"),Je=D.n($e);function Ce(ze){var He=Object(L.useRef)(ze),vt=Object(L.useState)({}),Rt=Object(P.a)(vt,2),de=Rt[1],ee=Object(L.useRef)(null),ne=Object(L.useRef)([]);function se(pe){ee.current===null&&(ne.current=[],ee.current=Je()(function(){ne.current.forEach(function(ae){He.current=ae(He.current)}),ee.current=null,de({})})),ne.current.push(pe)}return Object(L.useEffect)(function(){return function(){Je.a.cancel(ee.current)}},[]),[He.current,se]}function X(ze){var He=Object(L.useRef)(ze),vt=Object(L.useRef)(null);function Rt(){window.clearTimeout(vt.current)}function de(ne){He.current=ne,Rt(),vt.current=window.setTimeout(function(){He.current=null,vt.current=null},100)}function ee(){return He.current}return Object(L.useEffect)(function(){return Rt},[]),[de,ee]}function j(ze,He,vt){var Rt=Object(L.useMemo)(function(){for(var de=[],ee=[],ne=0,se=0,pe=0;pe<He;pe+=1)if(vt==="rtl"){ee[pe]=se,se+=ze[pe]||0;var ae=He-pe-1;de[ae]=ne,ne+=ze[ae]||0}else{de[pe]=ne,ne+=ze[pe]||0;var ie=He-pe-1;ee[ie]=se,se+=ze[ie]||0}return{left:de,right:ee}},[ze,He,vt]);return Rt}var K=j;function Q(ze){var He=ze.className,vt=ze.children;return L.createElement("div",{className:He},vt)}var re=Q,z=D("n6Qo");function we(ze){var He,vt=ze.prefixCls,Rt=ze.record,de=ze.onExpand,ee=ze.expanded,ne=ze.expandable,se="".concat(vt,"-row-expand-icon");if(!ne)return L.createElement("span",{className:k()(se,"".concat(vt,"-row-spaced"))});var pe=function(ie){de(Rt,ie),ie.stopPropagation()};return L.createElement("span",{className:k()(se,(He={},Object(Z.a)(He,"".concat(vt,"-row-expanded"),ee),Object(Z.a)(He,"".concat(vt,"-row-collapsed"),!ee),He)),onClick:pe})}function Ue(ze,He,vt){var Rt=[];function de(ee){(ee||[]).forEach(function(ne,se){Rt.push(He(ne,se)),de(ne[vt])})}return de(ze),Rt}var rt=D("zT1h"),le=D("y0+3"),Oe=function(He,vt){var Rt,de,ee=He.scrollBodyRef,ne=He.onScroll,se=He.offsetScroll,pe=L.useContext(i.a),ae=pe.prefixCls,ie=((Rt=ee.current)===null||Rt===void 0?void 0:Rt.scrollWidth)||0,me=((de=ee.current)===null||de===void 0?void 0:de.clientWidth)||0,ye=ie&&me*(me/ie),xe=L.useRef(),De=Ce({scrollLeft:0,isHiddenScrollBar:!1}),ct=Object(P.a)(De,2),It=ct[0],un=ct[1],mt=L.useRef({delta:0,x:0}),Qt=L.useState(!1),ht=Object(P.a)(Qt,2),Et=ht[0],it=ht[1],ve=function(){it(!1)},Me=function(Ve){Ve.persist(),mt.current.delta=Ve.pageX-It.scrollLeft,mt.current.x=0,it(!0),Ve.preventDefault()},St=function(Ve){var et,gt=Ve||((et=window)===null||et===void 0?void 0:et.event),Ht=gt.buttons;if(!Et||Ht===0){Et&&it(!1);return}var Vt=mt.current.x+Ve.pageX-mt.current.x-mt.current.delta;Vt<=0&&(Vt=0),Vt+ye>=me&&(Vt=me-ye),ne({scrollLeft:Vt/me*(ie+2)}),mt.current.x=Ve.pageX},lt=function(){var Ve=Object(le.b)(ee.current).top,et=Ve+ee.current.offsetHeight,gt=document.documentElement.scrollTop+window.innerHeight;et-Object(m.a)()<=gt||Ve>=gt-se?un(function(Ht){return Object(V.a)(Object(V.a)({},Ht),{},{isHiddenScrollBar:!0})}):un(function(Ht){return Object(V.a)(Object(V.a)({},Ht),{},{isHiddenScrollBar:!1})})},Gt=function(Ve){un(function(et){return Object(V.a)(Object(V.a)({},et),{},{scrollLeft:Ve/ie*me||0})})};return L.useImperativeHandle(vt,function(){return{setScrollLeft:Gt}}),L.useEffect(function(){var qt=Object(rt.a)(document.body,"mouseup",ve,!1),Ve=Object(rt.a)(document.body,"mousemove",St,!1);return lt(),function(){qt.remove(),Ve.remove()}},[ye,Et]),L.useEffect(function(){var qt=Object(rt.a)(window,"scroll",lt,!1),Ve=Object(rt.a)(window,"resize",lt,!1);return function(){qt.remove(),Ve.remove()}},[]),L.useEffect(function(){It.isHiddenScrollBar||un(function(qt){var Ve,et;return Object(V.a)(Object(V.a)({},qt),{},{scrollLeft:ee.current.scrollLeft/((Ve=ee.current)===null||Ve===void 0?void 0:Ve.scrollWidth)*((et=ee.current)===null||et===void 0?void 0:et.clientWidth)})})},[It.isHiddenScrollBar]),ie<=me||!ye||It.isHiddenScrollBar?null:L.createElement("div",{style:{height:Object(m.a)(),width:me,bottom:se},className:"".concat(ae,"-sticky-scroll")},L.createElement("div",{onMouseDown:Me,ref:xe,className:k()("".concat(ae,"-sticky-scroll-bar"),Object(Z.a)({},"".concat(ae,"-sticky-scroll-bar-active"),Et)),style:{width:"".concat(ye,"px"),transform:"translate3d(".concat(It.scrollLeft,"px, 0, 0)")}}))},Fe=L.forwardRef(Oe);function Ye(ze,He){return L.useMemo(function(){var vt=!!ze;return{isSticky:vt,stickyClassName:vt?"".concat(He,"-sticky-header"):"",offsetHeader:Object(G.a)(ze)==="object"&&ze.offsetHeader||0,offsetScroll:Object(G.a)(ze)==="object"&&ze.offsetScroll||0}},[ze,He])}var Tt=[],Nt={},Xt="rc-table-internal-hook",tt=L.memo(function(ze){var He=ze.children;return He},function(ze,He){return M()(ze.props,He.props)?ze.pingLeft!==He.pingLeft||ze.pingRight!==He.pingRight:!1});function Zt(ze){var He,vt=ze.prefixCls,Rt=ze.className,de=ze.rowClassName,ee=ze.style,ne=ze.data,se=ze.rowKey,pe=ze.scroll,ae=ze.tableLayout,ie=ze.direction,me=ze.title,ye=ze.footer,xe=ze.summary,De=ze.id,ct=ze.showHeader,It=ze.components,un=ze.emptyText,mt=ze.onRow,Qt=ze.onHeaderRow,ht=ze.internalHooks,Et=ze.transformColumns,it=ze.internalRefs,ve=ze.sticky,Me=ne||Tt,St=!!Me.length,lt=L.useState(0),Gt=Object(P.a)(lt,2),qt=Gt[0],Ve=Gt[1];L.useEffect(function(){Ve(Object(m.a)())});var et=L.useMemo(function(){return Object(O.c)(It,{})},[It]),gt=L.useCallback(function(xn,gn){return Object(O.b)(et,xn)||gn},[et]),Ht=L.useMemo(function(){return typeof se=="function"?se:function(xn){var gn=xn&&xn[se];return gn}},[se]),Vt=Object(b.c)(ze),dn=Vt.expandIcon,Zn=Vt.expandedRowKeys,Wn=Vt.defaultExpandedRowKeys,tn=Vt.defaultExpandAllRows,Hn=Vt.expandedRowRender,ir=Vt.onExpand,Dn=Vt.onExpandedRowsChange,Vn=Vt.expandRowByClick,qn=Vt.rowExpandable,Mr=Vt.expandIconColumnIndex,Sr=Vt.expandedRowClassName,on=Vt.childrenColumnName,Jn=Vt.indentSize,oi=dn||we,xi=on||"children",Jr=L.useMemo(function(){return Hn?"row":ze.expandable&&ht===Xt&&ze.expandable.__PARENT_RENDER_ICON__||Me.some(function(xn){return xn&&Object(G.a)(xn)==="object"&&xn[xi]})?"nest":!1},[!!Hn,Me]),Yr=L.useState(function(){return Wn||(tn?Ue(Me,Ht,xi):[])}),Lr=Object(P.a)(Yr,2),Yn=Lr[0],mi=Lr[1],hn=L.useMemo(function(){return new Set(Zn||Yn||[])},[Zn,Yn]),ei=L.useCallback(function(xn){var gn=Ht(xn,Me.indexOf(xn)),Ct,Ze=hn.has(gn);Ze?(hn.delete(gn),Ct=Object(I.a)(hn)):Ct=[].concat(Object(I.a)(hn),[gn]),mi(Ct),ir&&ir(!Ze,xn),Dn&&Dn(Ct)},[Ht,hn,Me,ir,Dn]),zr=L.useState(0),wi=Object(P.a)(zr,2),gi=wi[0],ri=wi[1],Bi=Object(We.b)(Object(V.a)(Object(V.a)(Object(V.a)({},ze),Vt),{},{expandable:!!Hn,expandedKeys:hn,getRowKey:Ht,onTriggerExpand:ei,expandIcon:oi,expandIconColumnIndex:Mr,direction:ie}),ht===Xt?Et:null),Hi=Object(P.a)(Bi,2),ii=Hi[0],wr=Hi[1],Oi=L.useMemo(function(){return{columns:ii,flattenColumns:wr}},[ii,wr]),Ri=L.useRef(),di=L.useRef(),_i=L.useRef(),oa=L.useState(!1),$i=Object(P.a)(oa,2),yr=$i[0],br=$i[1],si=L.useState(!1),kr=Object(P.a)(si,2),kn=kr[0],fn=kr[1],Tn=Ce(new Map),mn=Object(P.a)(Tn,2),er=mn[0],rr=mn[1],J=Object(O.a)(wr),ge=J.map(function(xn){return er.get(xn)}),Re=L.useMemo(function(){return ge},[ge.join("_")]),Ae=K(Re,wr.length,ie),at=pe&&Object(O.d)(pe.y),Be=pe&&Object(O.d)(pe.x),nt=Be&&wr.some(function(xn){var gn=xn.fixed;return gn}),yt=L.useRef(),Mt=Ye(ve,vt),kt=Mt.isSticky,Ge=Mt.offsetHeader,xt=Mt.offsetScroll,ot=Mt.stickyClassName,ut,bt,Dt;at&&(bt={overflowY:"scroll",maxHeight:pe.y}),Be&&(ut={overflowX:"auto"},at||(bt={overflowY:"hidden"}),Dt={width:pe.x===!0?"auto":pe.x,minWidth:"100%"});var pt=L.useCallback(function(xn,gn){rr(function(Ct){var Ze=new Map(Ct);return Ze.set(xn,gn),Ze})},[]),Kt=X(null),nn=Object(P.a)(Kt,2),wn=nn[0],In=nn[1];function yn(xn,gn){if(!gn)return;typeof gn=="function"?gn(xn):gn.scrollLeft!==xn&&(gn.scrollLeft=xn)}var On=function(gn){var Ct=gn.currentTarget,Ze=gn.scrollLeft,Lt=typeof Ze=="number"?Ze:Ct.scrollLeft,At=Ct||Nt;if(!In()||In()===At){var en;wn(At),yn(Lt,di.current),yn(Lt,_i.current),yn(Lt,(en=yt.current)===null||en===void 0?void 0:en.setScrollLeft)}if(Ct){var Nn=Ct.scrollWidth,Sn=Ct.clientWidth;br(Lt>0),fn(Lt<Nn-Sn)}},Cn=function(){_i.current&&On({currentTarget:_i.current})},Ot=function(gn){var Ct=gn.width;Cn(),ri(Ri.current?Ri.current.offsetWidth:Ct)};L.useEffect(function(){return Cn},[]),L.useEffect(function(){Be&&Cn()},[Be]),L.useEffect(function(){ht===Xt&&it&&(it.body.current=_i.current)});var rn=gt(["table"],"table"),Ut=L.useMemo(function(){return ae||(nt?pe.x==="max-content"?"auto":"fixed":at||wr.some(function(xn){var gn=xn.ellipsis;return gn})?"fixed":"auto")},[at,nt,wr,ae]),wt,Rn={colWidths:Re,columCount:wr.length,stickyOffsets:Ae,onHeaderRow:Qt,fixHeader:at},bn=L.useMemo(function(){return St?null:typeof un=="function"?un():un},[St,un]),Wt=L.createElement(Te,{data:Me,measureColumnWidth:at||Be||kt,expandedKeys:hn,rowExpandable:qn,getRowKey:Ht,onRow:mt,emptyNode:bn,childrenColumnName:xi}),dt=L.createElement(h,{colWidths:wr.map(function(xn){var gn=xn.width;return gn}),columns:wr}),An=xe&&L.createElement(z.b,null,xe(Me)),an=gt(["body"]);if(at||kt){var Kn;typeof an=="function"?(Kn=an(Me,{scrollbarSize:qt,ref:_i,onScroll:On}),Rn.colWidths=wr.map(function(xn,gn){var Ct=xn.width,Ze=gn===ii.length-1?Ct-qt:Ct;return typeof Ze=="number"&&!Number.isNaN(Ze)?Ze:(Object(E.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Kn=L.createElement("div",{style:Object(V.a)(Object(V.a)({},ut),bt),onScroll:On,ref:_i,className:k()("".concat(vt,"-body"))},L.createElement(rn,{style:Object(V.a)(Object(V.a)({},Dt),{},{tableLayout:Ut})},dt,Wt,An),kt&&L.createElement(Fe,{ref:yt,offsetScroll:xt,scrollBodyRef:_i,onScroll:On})),wt=L.createElement(L.Fragment,null,ct!==!1&&L.createElement(x,Object.assign({noData:!Me.length},Rn,Oi,{direction:ie,offsetHeader:Ge,stickyClassName:ot,ref:di,onScroll:On})),Kn)}else wt=L.createElement("div",{style:Object(V.a)(Object(V.a)({},ut),bt),className:k()("".concat(vt,"-content")),onScroll:On,ref:_i},L.createElement(rn,{style:Object(V.a)(Object(V.a)({},Dt),{},{tableLayout:Ut})},dt,ct!==!1&&L.createElement(v,Object.assign({},Rn,Oi)),Wt,An));var zt=Object(b.b)(ze),En=L.createElement("div",Object.assign({className:k()(vt,Rt,(He={},Object(Z.a)(He,"".concat(vt,"-rtl"),ie==="rtl"),Object(Z.a)(He,"".concat(vt,"-ping-left"),yr),Object(Z.a)(He,"".concat(vt,"-ping-right"),kn),Object(Z.a)(He,"".concat(vt,"-layout-fixed"),ae==="fixed"),Object(Z.a)(He,"".concat(vt,"-fixed-header"),at),Object(Z.a)(He,"".concat(vt,"-fixed-column"),nt),Object(Z.a)(He,"".concat(vt,"-scroll-horizontal"),Be),Object(Z.a)(He,"".concat(vt,"-has-fix-left"),wr[0]&&wr[0].fixed),Object(Z.a)(He,"".concat(vt,"-has-fix-right"),wr[wr.length-1]&&wr[wr.length-1].fixed==="right"),He)),style:ee,id:De,ref:Ri},zt),L.createElement(tt,{pingLeft:yr,pingRight:kn,props:Object(V.a)(Object(V.a)({},ze),{},{stickyOffsets:Ae,mergedExpandedKeys:hn})},me&&L.createElement(re,{className:"".concat(vt,"-title")},me(Me)),L.createElement("div",{className:"".concat(vt,"-container")},wt),ye&&L.createElement(re,{className:"".concat(vt,"-footer")},ye(Me))));Be&&(En=L.createElement(p.a,{onResize:Ot},En));var Ln=L.useMemo(function(){return{prefixCls:vt,getComponent:gt,scrollbarSize:qt,direction:ie,fixedInfoList:wr.map(function(xn,gn){return n(gn,gn,wr,Ae,ie)}),isSticky:kt}},[vt,gt,qt,ie,wr,Ae,ie,kt]),cn=L.useMemo(function(){return Object(V.a)(Object(V.a)({},Oi),{},{tableLayout:Ut,rowClassName:de,expandedRowClassName:Sr,componentWidth:gi,fixHeader:at,fixColumn:nt,horizonScroll:Be,expandIcon:oi,expandableType:Jr,expandRowByClick:Vn,expandedRowRender:Hn,onTriggerExpand:ei,expandIconColumnIndex:Mr,indentSize:Jn})},[Oi,Ut,de,Sr,gi,at,nt,Be,oi,Jr,Vn,Hn,ei,Mr,Jn]),dr=L.useMemo(function(){return{onColumnResize:pt}},[pt]);return L.createElement(i.a.Provider,{value:Ln},L.createElement(F.Provider,{value:cn},L.createElement(q.Provider,{value:dr},En)))}Zt.Column=a.a,Zt.ColumnGroup=u.a,Zt.Summary=z.a,Zt.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var vn=_e.b=Zt},wRmb:function(jt,_e,D){"use strict";D.d(_e,"a",function(){return M});var Z=D("rePB"),V=D("KQm4"),I=D("VTBJ"),G=D("Ff2n"),P=D("q1tI"),L=D.n(P),W=D("Kwbf"),k=D("Zm9Q"),r=D("hW8S");function M(a){return Object(k.a)(a).filter(function(o){return P.isValidElement(o)}).map(function(o){var c=o.key,s=o.props,i=s.children,n=Object(G.a)(s,["children"]),O=Object(I.a)({key:c},n);return i&&(O.children=M(i)),O})}function E(a){return a.reduce(function(o,c){var s=c.fixed,i=s===!0?"left":s,n=c.children;return n&&n.length>0?[].concat(Object(V.a)(o),Object(V.a)(E(n).map(function(O){return Object(I.a)({fixed:i},O)}))):[].concat(Object(V.a)(o),[Object(I.a)(Object(I.a)({},c),{},{fixed:i})])},[])}function p(a){for(var o=!0,c=0;c<a.length;c+=1){var s=a[c];if(o&&s.fixed!=="left")o=!1;else if(!o&&s.fixed==="left"){Object(W.a)(!1,"Index ".concat(c-1," of `columns` missing `fixed='left'` prop."));break}}for(var i=!0,n=a.length-1;n>=0;n-=1){var O=a[n];if(i&&O.fixed!=="right")i=!1;else if(!i&&O.fixed==="right"){Object(W.a)(!1,"Index ".concat(n+1," of `columns` missing `fixed='right'` prop."));break}}}function m(a){return a.map(function(o){var c=o.fixed,s=Object(G.a)(o,["fixed"]),i=c;return c==="left"?i="right":c==="right"&&(i="left"),Object(I.a)({fixed:i},s)})}function u(a,o){var c=a.prefixCls,s=a.columns,i=a.children,n=a.expandable,O=a.expandedKeys,S=a.getRowKey,C=a.onTriggerExpand,R=a.expandIcon,T=a.rowExpandable,v=a.expandIconColumnIndex,b=a.direction,f=a.expandRowByClick,h=P.useMemo(function(){return s||M(i)},[s,i]),_=P.useMemo(function(){if(n){var N,F=v||0,A=h[F],B=(N={},Object(Z.a)(N,r.a,{className:"".concat(c,"-expand-icon-col")}),Object(Z.a)(N,"title",""),Object(Z.a)(N,"fixed",A?A.fixed:null),Object(Z.a)(N,"className","".concat(c,"-row-expand-icon-cell")),Object(Z.a)(N,"render",function(Y,q,ce){var Ee=S(q,ce),Qe=O.has(Ee),Te=T?T(q):!0,We=R({prefixCls:c,expanded:Qe,expandable:Te,record:q,onExpand:C});return f?P.createElement("span",{onClick:function(Je){return Je.stopPropagation()}},We):We}),N),U=h.slice();return F>=0&&U.splice(F,0,B),U}return h},[n,h,S,O,R,b]),g=P.useMemo(function(){var N=_;return o&&(N=o(N)),N.length||(N=[{render:function(){return null}}]),N},[o,_,b]),x=P.useMemo(function(){return b==="rtl"?m(E(g)):E(g)},[g,b]);return[g,x]}_e.b=u},wwSX:function(jt,_e,D){jt.exports=D.p+"static/b2.2c844a2a.svg"},xOL1:function(jt,_e){jt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC"},xb3X:function(jt,_e,D){jt.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(jt,_e,D){"use strict";D.d(_e,"a",function(){return E}),D.d(_e,"b",function(){return m});var Z=/margin|padding|width|height|max|min|offset/,V={left:!0,top:!0},I={cssFloat:1,styleFloat:1,float:1};function G(u){return u.nodeType===1?u.ownerDocument.defaultView.getComputedStyle(u,null):{}}function P(u,a,o){if(a=a.toLowerCase(),o==="auto"){if(a==="height")return u.offsetHeight;if(a==="width")return u.offsetWidth}return a in V||(V[a]=Z.test(a)),V[a]?parseFloat(o)||0:o}function L(u,a){var o=arguments.length,c=G(u);return a=I[a]?"cssFloat"in u.style?"cssFloat":"styleFloat":a,o===1?c:P(u,a,c[a]||u.style[a])}function W(u,a,o){var c=arguments.length;if(a=I[a]?"cssFloat"in u.style?"cssFloat":"styleFloat":a,c===3)return typeof o=="number"&&Z.test(a)&&(o="".concat(o,"px")),u.style[a]=o,o;for(var s in a)a.hasOwnProperty(s)&&W(u,s,a[s]);return G(u)}function k(u){return u===document.body?document.documentElement.clientWidth:u.offsetWidth}function r(u){return u===document.body?window.innerHeight||document.documentElement.clientHeight:u.offsetHeight}function M(){var u=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:u,height:a}}function E(){var u=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:u,height:a}}function p(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function m(u){var a=u.getBoundingClientRect(),o=document.documentElement;return{left:a.left+(window.pageXOffset||o.scrollLeft)-(o.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||o.scrollTop)-(o.clientTop||document.body.clientTop||0)}}},"yTi+":function(jt,_e,D){jt.exports=D.p+"static/AssistantCode3.fdd8db3c.jpeg"},zetH:function(jt,_e,D){jt.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(jt,_e,D){jt.exports=D.p+"static/b3.30079151.svg"}}]);