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__Exerc...

436 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[69,3,5,6,7,8,9],{"+NIl":function(qe,Ne,K){(function(te){te(K("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Q,N){"use strict";function J(c,a){c.cmdState.push(a)}function B(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function D(c){var a=c.cmdState.pop();a&&a.closeBracket()}function H(c){for(var a=c.cmdState,l=a.length-1;l>=0;l--){var o=a[l];if(o.name=="DEFAULT")continue;return o}return{styleIdentifier:function(){return null}}}function F(c,a,l){return function(){this.name=c,this.bracketNo=0,this.style=a,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=F("importmodule","tag",["string","builtin"]),k.documentclass=F("documentclass","tag",["","atom"]),k.usepackage=F("usepackage","tag",["atom"]),k.begin=F("begin","tag",["atom"]),k.end=F("end","tag",["atom"]),k.label=F("label","tag",["atom"]),k.ref=F("ref","tag",["atom"]),k.eqref=F("eqref","tag",["atom"]),k.cite=F("cite","tag",["atom"]),k.bibitem=F("bibitem","tag",["atom"]),k.Bibitem=F("Bibitem","tag",["atom"]),k.RBibitem=F("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,a){c.f=a}function _(c,a){var l;if(c.match(/^\\[a-zA-Z@]+/)){var o=c.current().slice(1);return l=k.hasOwnProperty(o)?k[o]:k.DEFAULT,l=new l,J(a,l),I(a,p),l.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(a,function(s,d){return v(s,d,"\\]")}),"keyword";if(c.match("\\("))return I(a,function(s,d){return v(s,d,"\\)")}),"keyword";if(c.match("$$"))return I(a,function(s,d){return v(s,d,"$$")}),"keyword";if(c.match("$"))return I(a,function(s,d){return v(s,d,"$")}),"keyword";var r=c.next();if(r=="%")return c.skipToEnd(),"comment";if(r=="}"||r=="]"){if(l=B(a),l)l.closeBracket(r),I(a,p);else return"error";return"bracket"}else return r=="{"||r=="["?(l=k.DEFAULT,l=new l,J(a,l),"bracket"):/\d/.test(r)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),l=H(a),l.name=="begin"&&(l.argument=c.current()),l.styleIdentifier())}function v(c,a,l){if(c.eatSpace())return null;if(l&&c.match(l))return I(a,_),"keyword";if(c.match(/^\\[a-zA-Z@]+/))return"tag";if(c.match(/^[a-zA-Z]+/))return"variable-2";if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/]/))return"tag";if(c.match(/^[\^_&]/))return"tag";if(c.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(c.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var o=c.next();return o=="{"||o=="}"||o=="["||o=="]"||o=="("||o==")"?"bracket":o=="%"?(c.skipToEnd(),"comment"):"error"}function p(c,a){var l=c.peek(),o;return l=="{"||l=="["?(o=B(a),o.openBracket(l),c.eat(l),I(a,_),"bracket"):/[ \t\r]/.test(l)?(c.eat(l),null):(I(a,_),D(a),_(c,a))}return{startState:function(){var c=N.inMathMode?function(a,l){return v(a,l)}:_;return{cmdState:[],f:c}},copyState:function(c){return{cmdState:c.cmdState.slice(),f:c.f}},token:function(c,a){return a.f(c,a)},blankLine:function(c){c.f=_,c.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(qe,Ne,K){},"/GNS":function(qe,Ne,K){qe.exports=K.p+"static/search1.c4136dd4.png"},"19Vz":function(qe,Ne,K){(function(te){te(K("VrN/"))})(function(te){te.defineOption("placeholder","",function(F,k,I){var _=I&&I!=te.Init;if(k&&!_)F.on("blur",B),F.on("change",D),F.on("swapDoc",D),te.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){J(F)}),D(F);else if(!k&&_){F.off("blur",B),F.off("change",D),F.off("swapDoc",D),te.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),Q(F);var v=F.getWrapperElement();v.className=v.className.replace(" CodeMirror-empty","")}k&&!F.hasFocus()&&B(F)});function Q(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function N(F){Q(F);var k=F.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=F.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var I=F.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),k.appendChild(I),F.display.lineSpace.insertBefore(k,F.display.lineSpace.firstChild)}function J(F){setTimeout(function(){var k=!1,I=F.getInputField();I.nodeName=="TEXTAREA"?k=!I.value:F.lineCount()==1&&(k=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),k?N(F):Q(F)},20)}function B(F){H(F)&&N(F)}function D(F){var k=F.getWrapperElement(),I=H(F);k.className=k.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?N(F):Q(F)}function H(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(qe,Ne,K){(function(te){te(K("VrN/"))})(function(te){"use strict";var Q={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},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};te.defineMode("xml",function(J,B){var D=J.indentUnit,H={},F=B.htmlMode?Q:N;for(var k in F)H[k]=F[k];for(var k in B)H[k]=B[k];var I,_;function v(u,x){function g(E){return x.tokenize=E,E(u,x)}var y=u.next();if(y=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?g(a("atom","]]>")):null:u.match("--")?g(a("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),g(l(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),x.tokenize=a("meta","?>"),"meta"):(I=u.eat("/")?"closeTag":"openTag",x.tokenize=p,"tag bracket");if(y=="&"){var M;return u.eat("#")?u.eat("x")?M=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):M=u.eatWhile(/[\d]/)&&u.eat(";"):M=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),M?"atom":"error"}else return u.eatWhile(/[^&<]/),null}v.isInText=!0;function p(u,x){var g=u.next();if(g==">"||g=="/"&&u.eat(">"))return x.tokenize=v,I=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return I="equals",null;if(g=="<"){x.tokenize=v,x.state=d,x.tagName=x.tagStart=null;var y=x.tokenize(u,x);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(g)?(x.tokenize=c(g),x.stringStartCol=u.column(),x.tokenize(u,x)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(u){var x=function(g,y){for(;!g.eol();)if(g.next()==u){y.tokenize=p;break}return"string"};return x.isInAttribute=!0,x}function a(u,x){return function(g,y){for(;!g.eol();){if(g.match(x)){y.tokenize=v;break}g.next()}return u}}function l(u){return function(x,g){for(var y;(y=x.next())!=null;){if(y=="<")return g.tokenize=l(u+1),g.tokenize(x,g);if(y==">")if(u==1){g.tokenize=v;break}else return g.tokenize=l(u-1),g.tokenize(x,g)}return"meta"}}function o(u,x,g){this.prev=u.context,this.tagName=x,this.indent=u.indented,this.startOfLine=g,(H.doNotIndent.hasOwnProperty(x)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function r(u){u.context&&(u.context=u.context.prev)}function s(u,x){for(var g;;){if(!u.context)return;if(g=u.context.tagName,!H.contextGrabbers.hasOwnProperty(g)||!H.contextGrabbers[g].hasOwnProperty(x))return;r(u)}}function d(u,x,g){return u=="openTag"?(g.tagStart=x.column(),R):u=="closeTag"?A:d}function R(u,x,g){return u=="word"?(g.tagName=x.current(),_="tag",C):H.allowMissingTagName&&u=="endTag"?(_="tag bracket",C(u,x,g)):(_="error",R)}function A(u,x,g){if(u=="word"){var y=x.current();return g.context&&g.context.tagName!=y&&H.implicitlyClosed.hasOwnProperty(g.context.tagName)&&r(g),g.context&&g.context.tagName==y||H.matchClosing===!1?(_="tag",T):(_="tag error",w)}else return H.allowMissingTagName&&u=="endTag"?(_="tag bracket",T(u,x,g)):(_="error",w)}function T(u,x,g){return u!="endTag"?(_="error",T):(r(g),d)}function w(u,x,g){return _="error",T(u,x,g)}function C(u,x,g){if(u=="word")return _="attribute",b;if(u=="endTag"||u=="selfcloseTag"){var y=g.tagName,M=g.tagStart;return g.tagName=g.tagStart=null,u=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(y)?s(g,y):(s(g,y),g.context=new o(g,y,M==g.indented)),d}return _="error",C}function b(u,x,g){return u=="equals"?m:(H.allowMissing||(_="error"),C(u,x,g))}function m(u,x,g){return u=="string"?h:u=="word"&&H.allowUnquoted?(_="string",C):(_="error",C(u,x,g))}function h(u,x,g){return u=="string"?h:C(u,x,g)}return{startState:function(u){var x={tokenize:v,state:d,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(x.baseIndent=u),x},token:function(u,x){if(!x.tagName&&u.sol()&&(x.indented=u.indentation()),u.eatSpace())return null;I=null;var g=x.tokenize(u,x);return(g||I)&&g!="comment"&&(_=null,x.state=x.state(I||g,u,x),_&&(g=_=="error"?g+" error":_)),g},indent:function(u,x,g){var y=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+D;if(y&&y.noIndent)return te.Pass;if(u.tokenize!=p&&u.tokenize!=v)return g?g.match(/^(\s*)/)[0].length:0;if(u.tagName)return H.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+D*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/<!\[CDATA\[/.test(x))return 0;var M=x&&/^<(\/)?([\w_:\.-]*)/.exec(x);if(M&&M[1])for(;y;)if(y.tagName==M[2]){y=y.prev;break}else if(H.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(M)for(;y;){var E=H.contextGrabbers[y.tagName];if(E&&E.hasOwnProperty(M[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+D:u.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(u){u.state==m&&(u.state=C)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var x=[],g=u.context;g;g=g.prev)g.tagName&&x.push(g.tagName);return x.reverse()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(qe,Ne,K){"use strict";K.d(Ne,"d",function(){return gt}),K.d(Ne,"b",function(){return _e}),K.d(Ne,"c",function(){return ot}),K.d(Ne,"a",function(){return wt});var te=K("VTBJ"),Q=K("1OyB"),N=K("vuIU"),J=K("JX7q"),B=K("Ji7U"),D=K("LK+K"),H=K("q1tI"),F=K("I8Z2"),k=K("BGR+"),I=K("wx14"),_=K("rePB"),v=K("4IlW"),p=K("2GS6"),c=K("Gytx"),a=K.n(c),l=K("TSYQ"),o=K.n(l),r=K("U8pU"),s=K("ODXe"),d=/iPhone/i,R=/iPod/i,A=/iPad/i,T=/\bAndroid(?:.+)Mobile\b/i,w=/Android/i,C=/\bAndroid(?:.+)SD4930UR\b/i,b=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,m=/Windows Phone/i,h=/\bWindows(?:.+)ARM\b/i,u=/BlackBerry/i,x=/BB10/i,g=/Opera Mini/i,y=/\b(CriOS|Chrome)(?:.+)Mobile/i,M=/Mobile(?:.+)Firefox\b/i;function E(pt,Xe){return pt.test(Xe)}function j(pt){var Xe=pt||(typeof navigator!="undefined"?navigator.userAgent:""),Ge=Xe.split("[FBAN");if(typeof Ge[1]!="undefined"){var De=Ge,oe=Object(s.a)(De,1);Xe=oe[0]}if(Ge=Xe.split("Twitter"),typeof Ge[1]!="undefined"){var he=Ge,Ze=Object(s.a)(he,1);Xe=Ze[0]}var Ue={apple:{phone:E(d,Xe)&&!E(m,Xe),ipod:E(R,Xe),tablet:!E(d,Xe)&&E(A,Xe)&&!E(m,Xe),device:(E(d,Xe)||E(R,Xe)||E(A,Xe))&&!E(m,Xe)},amazon:{phone:E(C,Xe),tablet:!E(C,Xe)&&E(b,Xe),device:E(C,Xe)||E(b,Xe)},android:{phone:!E(m,Xe)&&E(C,Xe)||!E(m,Xe)&&E(T,Xe),tablet:!E(m,Xe)&&!E(C,Xe)&&!E(T,Xe)&&(E(b,Xe)||E(w,Xe)),device:!E(m,Xe)&&(E(C,Xe)||E(b,Xe)||E(T,Xe)||E(w,Xe))||E(/\bokhttp\b/i,Xe)},windows:{phone:E(m,Xe),tablet:E(h,Xe),device:E(m,Xe)||E(h,Xe)},other:{blackberry:E(u,Xe),blackberry10:E(x,Xe),opera:E(g,Xe),firefox:E(M,Xe),chrome:E(y,Xe),device:E(u,Xe)||E(x,Xe)||E(g,Xe)||E(M,Xe)||E(y,Xe)},any:null,phone:null,tablet:null};return Ue.any=Ue.apple.device||Ue.android.device||Ue.windows.device||Ue.other.device,Ue.phone=Ue.apple.phone||Ue.android.phone||Ue.windows.phone,Ue.tablet=Ue.apple.tablet||Ue.android.tablet||Ue.windows.tablet,Ue}var G=Object(te.a)(Object(te.a)({},j()),{},{isMobile:j}),U=G;function O(){}function X(pt,Xe,Ge){var De=Xe||"";return pt.key||"".concat(De,"item_").concat(Ge)}function $(pt){return"".concat(pt,"-menu-")}function se(pt,Xe){var Ge=-1;H.Children.forEach(pt,function(De){Ge+=1,De&&De.type&&De.type.isMenuItemGroup?H.Children.forEach(De.props.children,function(oe){Ge+=1,Xe(oe,Ge)}):Xe(De,Ge)})}function ce(pt,Xe,Ge){if(!pt||Ge.find)return;H.Children.forEach(pt,function(De){if(De){var oe=De.type;if(!oe||!(oe.isSubMenu||oe.isMenuItem||oe.isMenuItemGroup))return;Xe.indexOf(De.key)!==-1?Ge.find=!0:De.props.children&&ce(De.props.children,Xe,Ge)}})}var Pe=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Se=function(Xe){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,De=Xe&&typeof Xe.getBoundingClientRect=="function"&&Xe.getBoundingClientRect().width;if(De){if(Ge){var oe=getComputedStyle(Xe),he=oe.marginLeft,Ze=oe.marginRight;De+=+he.replace("px","")+ +Ze.replace("px","")}De=+De.toFixed(6)}return De||0},Re=function(Xe,Ge,De){Xe&&Object(r.a)(Xe.style)==="object"&&(Xe.style[Ge]=De)},Oe=function(){return U.any},Me=K("KQm4"),be=K("Ff2n"),ue=K("i8i4"),ne=K("bdgK"),ve=K("uciX"),le=K("8XRh"),ke={adjustX:1,adjustY:1},Fe={topLeft:{points:["bl","tl"],overflow:ke,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ke,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:ke,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:ke,offset:[4,0]}},Ie={topLeft:{points:["bl","tl"],overflow:ke,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:ke,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:ke,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:ke,offset:[4,0]}},He=Fe,$e=0,tt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Qe=function(Xe,Ge,De){var oe=$(Ge),he=Xe.getState();Xe.setState({defaultActiveFirst:Object(te.a)(Object(te.a)({},he.defaultActiveFirst),{},Object(_.a)({},oe,De))})},Je=function(pt){Object(B.a)(Ge,pt);var Xe=Object(D.a)(Ge);function Ge(De){var oe;Object(Q.a)(this,Ge),oe=Xe.call(this,De),oe.onDestroy=function(Te){oe.props.onDestroy(Te)},oe.onKeyDown=function(Te){var Ke=Te.keyCode,st=oe.menuInstance,ft=oe.props,Tt=ft.isOpen,Jt=ft.store;if(Ke===v.a.ENTER)return oe.onTitleClick(Te),Qe(Jt,oe.props.eventKey,!0),!0;if(Ke===v.a.RIGHT)return Tt?st.onKeyDown(Te):(oe.triggerOpenChange(!0),Qe(Jt,oe.props.eventKey,!0)),!0;if(Ke===v.a.LEFT){var an;if(Tt)an=st.onKeyDown(Te);else return;return an||(oe.triggerOpenChange(!1),an=!0),an}return Tt&&(Ke===v.a.UP||Ke===v.a.DOWN)?st.onKeyDown(Te):void 0},oe.onOpenChange=function(Te){oe.props.onOpenChange(Te)},oe.onPopupVisibleChange=function(Te){oe.triggerOpenChange(Te,Te?"mouseenter":"mouseleave")},oe.onMouseEnter=function(Te){var Ke=oe.props,st=Ke.eventKey,ft=Ke.onMouseEnter,Tt=Ke.store;Qe(Tt,oe.props.eventKey,!1),ft({key:st,domEvent:Te})},oe.onMouseLeave=function(Te){var Ke=oe.props,st=Ke.parentMenu,ft=Ke.eventKey,Tt=Ke.onMouseLeave;st.subMenuInstance=Object(J.a)(oe),Tt({key:ft,domEvent:Te})},oe.onTitleMouseEnter=function(Te){var Ke=oe.props,st=Ke.eventKey,ft=Ke.onItemHover,Tt=Ke.onTitleMouseEnter;ft({key:st,hover:!0}),Tt({key:st,domEvent:Te})},oe.onTitleMouseLeave=function(Te){var Ke=oe.props,st=Ke.parentMenu,ft=Ke.eventKey,Tt=Ke.onItemHover,Jt=Ke.onTitleMouseLeave;st.subMenuInstance=Object(J.a)(oe),Tt({key:ft,hover:!1}),Jt({key:ft,domEvent:Te})},oe.onTitleClick=function(Te){var Ke=Object(J.a)(oe),st=Ke.props;if(st.onTitleClick({key:st.eventKey,domEvent:Te}),st.triggerSubMenuAction==="hover")return;oe.triggerOpenChange(!st.isOpen,"click"),Qe(st.store,oe.props.eventKey,!1)},oe.onSubMenuClick=function(Te){typeof oe.props.onClick=="function"&&oe.props.onClick(oe.addKeyPath(Te))},oe.onSelect=function(Te){oe.props.onSelect(Te)},oe.onDeselect=function(Te){oe.props.onDeselect(Te)},oe.getPrefixCls=function(){return"".concat(oe.props.rootPrefixCls,"-submenu")},oe.getActiveClassName=function(){return"".concat(oe.getPrefixCls(),"-active")},oe.getDisabledClassName=function(){return"".concat(oe.getPrefixCls(),"-disabled")},oe.getSelectedClassName=function(){return"".concat(oe.getPrefixCls(),"-selected")},oe.getOpenClassName=function(){return"".concat(oe.props.rootPrefixCls,"-submenu-open")},oe.saveMenuInstance=function(Te){oe.menuInstance=Te},oe.addKeyPath=function(Te){return Object(te.a)(Object(te.a)({},Te),{},{keyPath:(Te.keyPath||[]).concat(oe.props.eventKey)})},oe.triggerOpenChange=function(Te,Ke){var st=oe.props.eventKey,ft=function(){oe.onOpenChange({key:st,item:Object(J.a)(oe),trigger:Ke,open:Te})};Ke==="mouseenter"?oe.mouseenterTimeout=setTimeout(function(){ft()},0):ft()},oe.isChildrenSelected=function(){var Te={find:!1};return ce(oe.props.children,oe.props.selectedKeys,Te),Te.find},oe.isOpen=function(){return oe.props.openKeys.indexOf(oe.props.eventKey)!==-1},oe.adjustWidth=function(){if(!oe.subMenuTitle||!oe.menuInstance)return;var Te=ue.findDOMNode(oe.menuInstance);if(Te.offsetWidth>=oe.subMenuTitle.offsetWidth)return;Te.style.minWidth="".concat(oe.subMenuTitle.offsetWidth,"px")},oe.saveSubMenuTitle=function(Te){oe.subMenuTitle=Te},oe.getBaseProps=function(){var Te=Object(J.a)(oe),Ke=Te.props;return{mode:Ke.mode==="horizontal"?"vertical":Ke.mode,visible:oe.props.isOpen,level:Ke.level+1,inlineIndent:Ke.inlineIndent,focusable:!1,onClick:oe.onSubMenuClick,onSelect:oe.onSelect,onDeselect:oe.onDeselect,onDestroy:oe.onDestroy,selectedKeys:Ke.selectedKeys,eventKey:"".concat(Ke.eventKey,"-menu-"),openKeys:Ke.openKeys,motion:Ke.motion,onOpenChange:oe.onOpenChange,subMenuOpenDelay:Ke.subMenuOpenDelay,parentMenu:Object(J.a)(oe),subMenuCloseDelay:Ke.subMenuCloseDelay,forceSubMenuRender:Ke.forceSubMenuRender,triggerSubMenuAction:Ke.triggerSubMenuAction,builtinPlacements:Ke.builtinPlacements,defaultActiveFirst:Ke.store.getState().defaultActiveFirst[$(Ke.eventKey)],multiple:Ke.multiple,prefixCls:Ke.rootPrefixCls,id:oe.internalMenuId,manualRef:oe.saveMenuInstance,itemIcon:Ke.itemIcon,expandIcon:Ke.expandIcon,direction:Ke.direction}},oe.getMotion=function(Te,Ke){var st=Object(J.a)(oe),ft=st.haveRendered,Tt=oe.props,Jt=Tt.motion,an=Tt.rootPrefixCls,Vt=Object(te.a)(Object(te.a)({},Jt),{},{leavedClassName:"".concat(an,"-hidden"),removeOnLeave:!1,motionAppear:ft||!Ke||Te!=="inline"});return Vt};var he=De.store,Ze=De.eventKey,Ue=he.getState(),ze=Ue.defaultActiveFirst;oe.isRootMenu=!1;var ct=!1;return ze&&(ct=ze[Ze]),Qe(he,Ze,ct),oe}return Object(N.a)(Ge,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var oe=this,he=this.props,Ze=he.mode,Ue=he.parentMenu,ze=he.manualRef;if(ze&&ze(this),Ze!=="horizontal"||!Ue.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return oe.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var oe=this.props,he=oe.onDestroy,Ze=oe.eventKey;he&&he(Ze),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(oe){var he=this,Ze=this.getBaseProps(),Ue=this.getMotion(Ze.mode,Ze.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ze.visible||Ze.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var ze=Ze.direction;return H.createElement(le.default,Object.assign({visible:Ze.visible},Ue),function(ct){var Te=ct.className,Ke=ct.style,st=o()("".concat(Ze.prefixCls,"-sub"),Te,Object(_.a)({},"".concat(Ze.prefixCls,"-rtl"),ze==="rtl"));return H.createElement(xe,Object.assign({},Ze,{id:he.internalMenuId,className:st,style:Ke}),oe)})}},{key:"render",value:function(){var oe,he=Object(te.a)({},this.props),Ze=he.isOpen,Ue=this.getPrefixCls(),ze=he.mode==="inline",ct=o()(Ue,"".concat(Ue,"-").concat(he.mode),(oe={},Object(_.a)(oe,he.className,!!he.className),Object(_.a)(oe,this.getOpenClassName(),Ze),Object(_.a)(oe,this.getActiveClassName(),he.active||Ze&&!ze),Object(_.a)(oe,this.getDisabledClassName(),he.disabled),Object(_.a)(oe,this.getSelectedClassName(),this.isChildrenSelected()),oe));this.internalMenuId||(he.eventKey?this.internalMenuId="".concat(he.eventKey,"$Menu"):($e+=1,this.internalMenuId="$__$".concat($e,"$Menu")));var Te={},Ke={},st={};he.disabled||(Te={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ke={onClick:this.onTitleClick},st={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var ft={},Tt=he.direction;ze&&(Tt==="rtl"?ft.paddingRight=he.inlineIndent*he.level:ft.paddingLeft=he.inlineIndent*he.level);var Jt={};this.props.isOpen&&(Jt={"aria-owns":this.internalMenuId});var an=null;he.mode!=="horizontal"&&(an=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(an=H.createElement(this.props.expandIcon,Object(te.a)({},this.props))));var Vt=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:ft,className:"".concat(Ue,"-title"),role:"button"},st,Ke,{"aria-expanded":Ze},Jt,{"aria-haspopup":"true",title:typeof he.title=="string"?he.title:void 0}),he.title,an||H.createElement("i",{className:"".concat(Ue,"-arrow")})),Ot=this.renderChildren(he.children),gn=he.parentMenu.isRootMenu?he.parentMenu.props.getPopupContainer:function(Pn){return Pn.parentNode},Kt=tt[he.mode],Zt=he.popupOffset?{offset:he.popupOffset}:{},Nt=he.mode==="inline"?"":he.popupClassName;Nt+=Tt==="rtl"?" ".concat(Ue,"-rtl"):"";var nn=he.disabled,Cn=he.triggerSubMenuAction,wn=he.subMenuOpenDelay,mt=he.forceSubMenuRender,Gt=he.subMenuCloseDelay,Mn=he.builtinPlacements;Pe.forEach(function(Pn){return delete he[Pn]}),delete he.onClick;var Un=Tt==="rtl"?Object.assign({},Ie,Mn):Object.assign({},Fe,Mn);return delete he.direction,H.createElement("li",Object.assign({},he,Te,{className:ct,role:"menuitem"}),ze&&Vt,ze&&Ot,!ze&&H.createElement(ve.a,{prefixCls:Ue,popupClassName:o()("".concat(Ue,"-popup"),Nt),getPopupContainer:gn,builtinPlacements:Un,popupPlacement:Kt,popupVisible:Ze,popupAlign:Zt,popup:Ot,action:nn?[]:[Cn],mouseEnterDelay:wn,mouseLeaveDelay:Gt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:mt},Vt))}}]),Ge}(H.Component);Je.defaultProps={onMouseEnter:O,onMouseLeave:O,onTitleMouseEnter:O,onTitleMouseLeave:O,onTitleClick:O,manualRef:O,mode:"vertical",title:""};var Ye=Object(F.b)(function(pt,Xe){var Ge=pt.openKeys,De=pt.activeKey,oe=pt.selectedKeys,he=Xe.eventKey,Ze=Xe.subMenuKey;return{isOpen:Ge.indexOf(he)>-1,active:De[Ze]===he,selectedKeys:oe}})(Je);Ye.isSubMenu=!0;var gt=Ye,_t="menuitem-overflowed",vt=.5,dt=function(pt){Object(B.a)(Ge,pt);var Xe=Object(D.a)(Ge);function Ge(){var De;return Object(Q.a)(this,Ge),De=Xe.apply(this,arguments),De.resizeObserver=null,De.mutationObserver=null,De.originalTotalWidth=0,De.overflowedItems=[],De.menuItemSizes=[],De.cancelFrameId=null,De.state={lastVisibleIndex:void 0},De.getMenuItemNodes=function(){var oe=De.props.prefixCls,he=ue.findDOMNode(Object(J.a)(De));return he?[].slice.call(he.children).filter(function(Ze){return Ze.className.split(" ").indexOf("".concat(oe,"-overflowed-submenu"))<0}):[]},De.getOverflowedSubMenuItem=function(oe,he,Ze){var Ue=De.props,ze=Ue.overflowedIndicator,ct=Ue.level,Te=Ue.mode,Ke=Ue.prefixCls,st=Ue.theme;if(ct!==1||Te!=="horizontal")return null;var ft=De.props.children[0],Tt=ft.props,Jt=Tt.children,an=Tt.title,Vt=Tt.style,Ot=Object(be.a)(Tt,["children","title","style"]),gn=Object(te.a)({},Vt),Kt="".concat(oe,"-overflowed-indicator"),Zt="".concat(oe,"-overflowed-indicator");he.length===0&&Ze!==!0?gn=Object(te.a)(Object(te.a)({},gn),{},{display:"none"}):Ze&&(gn=Object(te.a)(Object(te.a)({},gn),{},{visibility:"hidden",position:"absolute"}),Kt="".concat(Kt,"-placeholder"),Zt="".concat(Zt,"-placeholder"));var Nt=st?"".concat(Ke,"-").concat(st):"",nn={};return Pe.forEach(function(Cn){Ot[Cn]!==void 0&&(nn[Cn]=Ot[Cn])}),H.createElement(gt,Object.assign({title:ze,className:"".concat(Ke,"-overflowed-submenu"),popupClassName:Nt},nn,{key:Kt,eventKey:Zt,disabled:!1,style:gn}),he)},De.setChildrenWidthAndResize=function(){if(De.props.mode!=="horizontal")return;var oe=ue.findDOMNode(Object(J.a)(De));if(!oe)return;var he=oe.children;if(!he||he.length===0)return;var Ze=oe.children[he.length-1];Re(Ze,"display","inline-block");var Ue=De.getMenuItemNodes(),ze=Ue.filter(function(ct){return ct.className.split(" ").indexOf(_t)>=0});ze.forEach(function(ct){Re(ct,"display","inline-block")}),De.menuItemSizes=Ue.map(function(ct){return Se(ct,!0)}),ze.forEach(function(ct){Re(ct,"display","none")}),De.overflowedIndicatorWidth=Se(oe.children[oe.children.length-1],!0),De.originalTotalWidth=De.menuItemSizes.reduce(function(ct,Te){return ct+Te},0),De.handleResize(),Re(Ze,"display","none")},De.handleResize=function(){if(De.props.mode!=="horizontal")return;var oe=ue.findDOMNode(Object(J.a)(De));if(!oe)return;var he=Se(oe);De.overflowedItems=[];var Ze=0,Ue;De.originalTotalWidth>he+vt&&(Ue=-1,De.menuItemSizes.forEach(function(ze){Ze+=ze,Ze+De.overflowedIndicatorWidth<=he&&(Ue+=1)})),De.setState({lastVisibleIndex:Ue})},De}return Object(N.a)(Ge,[{key:"componentDidMount",value:function(){var oe=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var he=ue.findDOMNode(this);if(!he)return;this.resizeObserver=new ne.default(function(Ze){Ze.forEach(function(){var Ue=oe.cancelFrameId;cancelAnimationFrame(Ue),oe.cancelFrameId=requestAnimationFrame(oe.setChildrenWidthAndResize)})}),[].slice.call(he.children).concat(he).forEach(function(Ze){oe.resizeObserver.observe(Ze)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){oe.resizeObserver.disconnect(),[].slice.call(he.children).concat(he).forEach(function(Ze){oe.resizeObserver.observe(Ze)}),oe.setChildrenWidthAndResize()}),this.mutationObserver.observe(he,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(oe){var he=this,Ze=this.state.lastVisibleIndex;return(oe||[]).reduce(function(Ue,ze,ct){var Te=ze;if(he.props.mode==="horizontal"){var Ke=he.getOverflowedSubMenuItem(ze.props.eventKey,[]);Ze!==void 0&&he.props.className.indexOf("".concat(he.props.prefixCls,"-root"))!==-1&&(ct>Ze&&(Te=H.cloneElement(ze,{style:{display:"none"},eventKey:"".concat(ze.props.eventKey,"-hidden"),className:"".concat(_t)})),ct===Ze+1&&(he.overflowedItems=oe.slice(Ze+1).map(function(ft){return H.cloneElement(ft,{key:ft.props.eventKey,mode:"vertical-left"})}),Ke=he.getOverflowedSubMenuItem(ze.props.eventKey,he.overflowedItems)));var st=[].concat(Object(Me.a)(Ue),[Ke,Te]);return ct===oe.length-1&&st.push(he.getOverflowedSubMenuItem(ze.props.eventKey,[],!0)),st}return[].concat(Object(Me.a)(Ue),[Te])},[])}},{key:"render",value:function(){var oe=this.props,he=oe.visible,Ze=oe.prefixCls,Ue=oe.overflowedIndicator,ze=oe.mode,ct=oe.level,Te=oe.tag,Ke=oe.children,st=oe.theme,ft=Object(be.a)(oe,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=Te;return H.createElement(Tt,Object.assign({},ft),this.renderChildren(Ke))}}]),Ge}(H.Component);dt.defaultProps={tag:"div",className:""};var Ct=dt;function xt(pt){return pt.length?pt.every(function(Xe){return!!Xe.props.disabled}):!0}function Le(pt,Xe,Ge){var De=pt.getState();pt.setState({activeKey:Object(te.a)(Object(te.a)({},De.activeKey),{},Object(_.a)({},Xe,Ge))})}function Ce(pt){return pt.eventKey||"0-menu-"}function nt(pt,Xe){var Ge=Xe,De=pt.children,oe=pt.eventKey;if(Ge){var he;if(se(De,function(Ze,Ue){Ze&&Ze.props&&!Ze.props.disabled&&Ge===X(Ze,oe,Ue)&&(he=!0)}),he)return Ge}return Ge=null,pt.defaultActiveFirst&&se(De,function(Ze,Ue){!Ge&&Ze&&!Ze.props.disabled&&(Ge=X(Ze,oe,Ue))}),Ge}function rt(pt){if(pt){var Xe=this.instanceArray.indexOf(pt);Xe!==-1?this.instanceArray[Xe]=pt:this.instanceArray.push(pt)}}var Be=function(pt){Object(B.a)(Ge,pt);var Xe=Object(D.a)(Ge);function Ge(De){var oe;return Object(Q.a)(this,Ge),oe=Xe.call(this,De),oe.onKeyDown=function(he,Ze){var Ue=he.keyCode,ze;if(oe.getFlatInstanceArray().forEach(function(Te){Te&&Te.props.active&&Te.onKeyDown&&(ze=Te.onKeyDown(he))}),ze)return 1;var ct=null;return(Ue===v.a.UP||Ue===v.a.DOWN)&&(ct=oe.step(Ue===v.a.UP?-1:1)),ct?(he.preventDefault(),Le(oe.props.store,Ce(oe.props),ct.props.eventKey),typeof Ze=="function"&&Ze(ct),1):void 0},oe.onItemHover=function(he){var Ze=he.key,Ue=he.hover;Le(oe.props.store,Ce(oe.props),Ue?Ze:null)},oe.onDeselect=function(he){oe.props.onDeselect(he)},oe.onSelect=function(he){oe.props.onSelect(he)},oe.onClick=function(he){oe.props.onClick(he)},oe.onOpenChange=function(he){oe.props.onOpenChange(he)},oe.onDestroy=function(he){oe.props.onDestroy(he)},oe.getFlatInstanceArray=function(){return oe.instanceArray},oe.step=function(he){var Ze=oe.getFlatInstanceArray(),Ue=oe.props.store.getState().activeKey[Ce(oe.props)],ze=Ze.length;if(!ze)return null;he<0&&(Ze=Ze.concat().reverse());var ct=-1;if(Ze.every(function(ft,Tt){return ft&&ft.props.eventKey===Ue?(ct=Tt,!1):!0}),!oe.props.defaultActiveFirst&&ct!==-1&&xt(Ze.slice(ct,ze-1)))return;var Te=(ct+1)%ze,Ke=Te;do{var st=Ze[Ke];if(!st||st.props.disabled)Ke=(Ke+1)%ze;else return st}while(Ke!==Te);return null},oe.renderCommonMenuItem=function(he,Ze,Ue){var ze=oe.props.store.getState(),ct=Object(J.a)(oe),Te=ct.props,Ke=X(he,Te.eventKey,Ze),st=he.props;if(!st||typeof he.type=="string")return he;var ft=Ke===ze.activeKey,Tt=Object(te.a)(Object(te.a)({mode:st.mode||Te.mode,level:Te.level,inlineIndent:Te.inlineIndent,renderMenuItem:oe.renderMenuItem,rootPrefixCls:Te.prefixCls,index:Ze,parentMenu:Te.parentMenu,manualRef:st.disabled?void 0:Object(p.a)(he.ref,rt.bind(Object(J.a)(oe))),eventKey:Ke,active:!st.disabled&&ft,multiple:Te.multiple,onClick:function(an){(st.onClick||O)(an),oe.onClick(an)},onItemHover:oe.onItemHover,motion:Te.motion,subMenuOpenDelay:Te.subMenuOpenDelay,subMenuCloseDelay:Te.subMenuCloseDelay,forceSubMenuRender:Te.forceSubMenuRender,onOpenChange:oe.onOpenChange,onDeselect:oe.onDeselect,onSelect:oe.onSelect,builtinPlacements:Te.builtinPlacements,itemIcon:st.itemIcon||oe.props.itemIcon,expandIcon:st.expandIcon||oe.props.expandIcon},Ue),{},{direction:Te.direction});return(Te.mode==="inline"||Oe())&&(Tt.triggerSubMenuAction="click"),H.cloneElement(he,Tt)},oe.renderMenuItem=function(he,Ze,Ue){if(!he)return null;var ze=oe.props.store.getState(),ct={openKeys:ze.openKeys,selectedKeys:ze.selectedKeys,triggerSubMenuAction:oe.props.triggerSubMenuAction,subMenuKey:Ue};return oe.renderCommonMenuItem(he,Ze,ct)},De.store.setState({activeKey:Object(te.a)(Object(te.a)({},De.store.getState().activeKey),{},Object(_.a)({},De.eventKey,nt(De,De.activeKey)))}),oe.instanceArray=[],oe}return Object(N.a)(Ge,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(oe){return this.props.visible||oe.visible||this.props.className!==oe.className||!a()(this.props.style,oe.style)}},{key:"componentDidUpdate",value:function(oe){var he=this.props,Ze="activeKey"in he?he.activeKey:he.store.getState().activeKey[Ce(he)],Ue=nt(he,Ze);if(Ue!==Ze)Le(he.store,Ce(he),Ue);else if("activeKey"in oe){var ze=nt(oe,oe.activeKey);Ue!==ze&&Le(he.store,Ce(he),Ue)}}},{key:"render",value:function(){var oe=this,he=Object(I.a)({},this.props);this.instanceArray=[];var Ze=o()(he.prefixCls,he.className,"".concat(he.prefixCls,"-").concat(he.mode)),Ue={className:Ze,role:he.role||"menu"};he.id&&(Ue.id=he.id),he.focusable&&(Ue.tabIndex=0,Ue.onKeyDown=this.onKeyDown);var ze=he.prefixCls,ct=he.eventKey,Te=he.visible,Ke=he.level,st=he.mode,ft=he.overflowedIndicator,Tt=he.theme;return Pe.forEach(function(Jt){return delete he[Jt]}),delete he.onClick,H.createElement(Ct,Object.assign({},he,{prefixCls:ze,mode:st,tag:"ul",level:Ke,theme:Tt,visible:Te,overflowedIndicator:ft},Ue),H.Children.map(he.children,function(Jt,an){return oe.renderMenuItem(Jt,an,ct||"0-menu-")}))}}]),Ge}(H.Component);Be.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:O};var et=Object(F.b)()(Be),xe=et,fe=K("Kwbf");function ge(pt,Xe,Ge){var De=pt.prefixCls,oe=pt.motion,he=pt.defaultMotions,Ze=he===void 0?{}:he,Ue=pt.openAnimation,ze=pt.openTransitionName,ct=Xe.switchingModeFromInline;if(oe)return oe;if(Object(r.a)(Ue)==="object"&&Ue)Object(fe.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ue=="string")return{motionName:"".concat(De,"-open-").concat(Ue)};if(ze)return{motionName:ze};var Te=Ze[Ge];return Te||(ct?null:Ze.other)}var re=function(pt){Object(B.a)(Ge,pt);var Xe=Object(D.a)(Ge);function Ge(De){var oe;Object(Q.a)(this,Ge),oe=Xe.call(this,De),oe.inlineOpenKeys=[],oe.onSelect=function(Ue){var ze=Object(J.a)(oe),ct=ze.props;if(ct.selectable){var Te=oe.store.getState(),Ke=Te.selectedKeys,st=Ue.key;ct.multiple?Ke=Ke.concat([st]):Ke=[st],"selectedKeys"in ct||oe.store.setState({selectedKeys:Ke}),ct.onSelect(Object(te.a)(Object(te.a)({},Ue),{},{selectedKeys:Ke}))}},oe.onClick=function(Ue){var ze=oe.getRealMenuMode(),ct=Object(J.a)(oe),Te=ct.store,Ke=ct.props.onOpenChange;ze!=="inline"&&!("openKeys"in oe.props)&&(Te.setState({openKeys:[]}),Ke([])),oe.props.onClick(Ue)},oe.onKeyDown=function(Ue,ze){oe.innerMenu.getWrappedInstance().onKeyDown(Ue,ze)},oe.onOpenChange=function(Ue){var ze=Object(J.a)(oe),ct=ze.props,Te=oe.store.getState().openKeys.concat(),Ke=!1,st=function(Tt){var Jt=!1;if(Tt.open)Jt=Te.indexOf(Tt.key)===-1,Jt&&Te.push(Tt.key);else{var an=Te.indexOf(Tt.key);Jt=an!==-1,Jt&&Te.splice(an,1)}Ke=Ke||Jt};Array.isArray(Ue)?Ue.forEach(st):st(Ue),Ke&&("openKeys"in oe.props||oe.store.setState({openKeys:Te}),ct.onOpenChange(Te))},oe.onDeselect=function(Ue){var ze=Object(J.a)(oe),ct=ze.props;if(ct.selectable){var Te=oe.store.getState().selectedKeys.concat(),Ke=Ue.key,st=Te.indexOf(Ke);st!==-1&&Te.splice(st,1),"selectedKeys"in ct||oe.store.setState({selectedKeys:Te}),ct.onDeselect(Object(te.a)(Object(te.a)({},Ue),{},{selectedKeys:Te}))}},oe.onMouseEnter=function(Ue){oe.restoreModeVerticalFromInline();var ze=oe.props.onMouseEnter;ze&&ze(Ue)},oe.onTransitionEnd=function(Ue){var ze=Ue.propertyName==="width"&&Ue.target===Ue.currentTarget,ct=Ue.target.className,Te=Object.prototype.toString.call(ct)==="[object SVGAnimatedString]"?ct.animVal:ct,Ke=Ue.propertyName==="font-size"&&Te.indexOf("anticon")>=0;(ze||Ke)&&oe.restoreModeVerticalFromInline()},oe.setInnerMenu=function(Ue){oe.innerMenu=Ue},oe.isRootMenu=!0;var he=De.defaultSelectedKeys,Ze=De.defaultOpenKeys;return"selectedKeys"in De&&(he=De.selectedKeys||[]),"openKeys"in De&&(Ze=De.openKeys||[]),oe.store=Object(F.c)({selectedKeys:he,openKeys:Ze,activeKey:{"0-menu-":nt(De,De.activeKey)}}),oe.state={switchingModeFromInline:!1},oe}return Object(N.a)(Ge,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(oe){this.updateOpentKeysWhenSwitchMode(oe),this.updateMiniStore();var he=this.props,Ze=he.siderCollapsed,Ue=he.inlineCollapsed,ze=he.onOpenChange;(!oe.inlineCollapsed&&Ue||!oe.siderCollapsed&&Ze)&&ze([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(oe){var he=this.props,Ze=this.store,Ue=this.inlineOpenKeys,ze=Ze.getState(),ct={};oe.mode==="inline"&&he.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in he||((he.inlineCollapsed&&!oe.inlineCollapsed||he.siderCollapsed&&!oe.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=ze.openKeys.concat(),ct.openKeys=[]),(!he.inlineCollapsed&&oe.inlineCollapsed||!he.siderCollapsed&&oe.siderCollapsed)&&(ct.openKeys=Ue,this.inlineOpenKeys=[])),Object.keys(ct).length&&Ze.setState(ct)}},{key:"updateMenuDisplay",value:function(){var oe=this.props.collapsedWidth,he=this.store,Ze=this.prevOpenKeys,Ue=this.getInlineCollapsed()&&(oe===0||oe==="0"||oe==="0px");Ue?(this.prevOpenKeys=he.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Ze&&(this.store.setState({openKeys:Ze}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var oe=this.props.mode,he=this.state.switchingModeFromInline,Ze=this.getInlineCollapsed();return he&&Ze?"inline":Ze?"vertical":oe}},{key:"getInlineCollapsed",value:function(){var oe=this.props,he=oe.inlineCollapsed,Ze=oe.siderCollapsed;return Ze!==void 0?Ze:he}},{key:"restoreModeVerticalFromInline",value:function(){var oe=this.state.switchingModeFromInline;oe&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var oe=Object(te.a)({},Object(k.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),he=this.getRealMenuMode();return oe.className+=" ".concat(oe.prefixCls,"-root"),oe.direction==="rtl"&&(oe.className+=" ".concat(oe.prefixCls,"-rtl")),oe=Object(te.a)(Object(te.a)({},oe),{},{mode:he,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ge(this.props,this.state,he)}),delete oe.openAnimation,delete oe.openTransitionName,H.createElement(F.a,{store:this.store},H.createElement(xe,Object.assign({},oe,{ref:this.setInnerMenu}),this.props.children))}}]),Ge}(H.Component);re.defaultProps={selectable:!0,onClick:O,onSelect:O,onOpenChange:O,onDeselect:O,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var ae=re,de=function(pt){Object(B.a)(Ge,pt);var Xe=Object(D.a)(Ge);function Ge(){var De;return Object(Q.a)(this,Ge),De=Xe.apply(this,arguments),De.onKeyDown=function(oe){var he=oe.keyCode;return he===v.a.ENTER?(De.onClick(oe),!0):void 0},De.onMouseLeave=function(oe){var he=De.props,Ze=he.eventKey,Ue=he.onItemHover,ze=he.onMouseLeave;Ue({key:Ze,hover:!1}),ze({key:Ze,domEvent:oe})},De.onMouseEnter=function(oe){var he=De.props,Ze=he.eventKey,Ue=he.onItemHover,ze=he.onMouseEnter;Ue({key:Ze,hover:!0}),ze({key:Ze,domEvent:oe})},De.onClick=function(oe){var he=De.props,Ze=he.eventKey,Ue=he.multiple,ze=he.onClick,ct=he.onSelect,Te=he.onDeselect,Ke=he.isSelected,st={key:Ze,keyPath:[Ze],item:Object(J.a)(De),domEvent:oe};ze(st),Ue?Ke?Te(st):ct(st):Ke||ct(st)},De.saveNode=function(oe){De.node=oe},De}return Object(N.a)(Ge,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var oe=this.props;oe.onDestroy&&oe.onDestroy(oe.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var oe,he=Object(te.a)({},this.props),Ze=o()(this.getPrefixCls(),he.className,(oe={},Object(_.a)(oe,this.getActiveClassName(),!he.disabled&&he.active),Object(_.a)(oe,this.getSelectedClassName(),he.isSelected),Object(_.a)(oe,this.getDisabledClassName(),he.disabled),oe)),Ue=Object(te.a)(Object(te.a)({},he.attribute),{},{title:typeof he.title=="string"?he.title:void 0,className:Ze,role:he.role||"menuitem","aria-disabled":he.disabled});he.role==="option"?Ue=Object(te.a)(Object(te.a)({},Ue),{},{role:"option","aria-selected":he.isSelected}):(he.role===null||he.role==="none")&&(Ue.role="none");var ze={onClick:he.disabled?null:this.onClick,onMouseLeave:he.disabled?null:this.onMouseLeave,onMouseEnter:he.disabled?null:this.onMouseEnter},ct=Object(te.a)({},he.style);he.mode==="inline"&&(he.direction==="rtl"?ct.paddingRight=he.inlineIndent*he.level:ct.paddingLeft=he.inlineIndent*he.level),Pe.forEach(function(Ke){return delete he[Ke]}),delete he.direction;var Te=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Te=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(k.default)(he,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ue,ze,{style:ct,ref:this.saveNode}),he.children,Te)}}]),Ge}(H.Component);de.isMenuItem=!0,de.defaultProps={onSelect:O,onMouseEnter:O,onMouseLeave:O,manualRef:O};var ye=Object(F.b)(function(pt,Xe){var Ge=pt.activeKey,De=pt.selectedKeys,oe=Xe.eventKey,he=Xe.subMenuKey;return{active:Ge[he]===oe,isSelected:De.indexOf(oe)!==-1}})(de),_e=ye,je=function(pt){Object(B.a)(Ge,pt);var Xe=Object(D.a)(Ge);function Ge(){var De;return Object(Q.a)(this,Ge),De=Xe.apply(this,arguments),De.renderInnerMenuItem=function(oe){var he=De.props,Ze=he.renderMenuItem,Ue=he.index;return Ze(oe,Ue,De.props.subMenuKey)},De}return Object(N.a)(Ge,[{key:"render",value:function(){var oe=Object(I.a)({},this.props),he=oe.className,Ze=he===void 0?"":he,Ue=oe.rootPrefixCls,ze="".concat(Ue,"-item-group-title"),ct="".concat(Ue,"-item-group-list"),Te=oe.title,Ke=oe.children;return Pe.forEach(function(st){return delete oe[st]}),delete oe.onClick,delete oe.direction,H.createElement("li",Object.assign({},oe,{className:"".concat(Ze," ").concat(Ue,"-item-group")}),H.createElement("div",{className:ze,title:typeof Te=="string"?Te:void 0},Te),H.createElement("ul",{className:ct},H.Children.map(Ke,this.renderInnerMenuItem)))}}]),Ge}(H.Component);je.isMenuItemGroup=!0,je.defaultProps={disabled:!0};var ot=je,bt=function(Xe){var Ge=Xe.className,De=Xe.rootPrefixCls,oe=Xe.style;return H.createElement("li",{className:"".concat(Ge," ").concat(De,"-item-divider"),style:oe})};bt.defaultProps={disabled:!0,className:"",style:{}};var wt=bt,Et=Ne.e=ae},"4qgm":function(qe,Ne){qe.exports="data:image/png;base64,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"},"4u4S":function(qe,Ne){qe.exports="data:image/png;base64,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"},"55Ip":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return s});var te=K("Ty5D"),Q=K("dI71"),N=K("q1tI"),J=K.n(N),B=K("YS25"),D=K("17x9"),H=K.n(D),F=K("wx14"),k=K("zLVn"),I=K("9R94"),_=function(m){Object(Q.a)(h,m);function h(){for(var x,g=arguments.length,y=new Array(g),M=0;M<g;M++)y[M]=arguments[M];return x=m.call.apply(m,[this].concat(y))||this,x.history=Object(B.a)(x.props),x}var u=h.prototype;return u.render=function(){return J.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(J.a.Component),v=function(m){Object(Q.a)(h,m);function h(){for(var x,g=arguments.length,y=new Array(g),M=0;M<g;M++)y[M]=arguments[M];return x=m.call.apply(m,[this].concat(y))||this,x.history=Object(B.b)(x.props),x}var u=h.prototype;return u.render=function(){return J.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(J.a.Component),p=function(h,u){return typeof h=="function"?h(u):h},c=function(h,u){return typeof h=="string"?Object(B.c)(h,null,null,u):h},a=function(h){return h},l=J.a.forwardRef;typeof l=="undefined"&&(l=a);function o(m){return!!(m.metaKey||m.altKey||m.ctrlKey||m.shiftKey)}var r=l(function(m,h){var u=m.innerRef,x=m.navigate,g=m.onClick,y=Object(k.a)(m,["innerRef","navigate","onClick"]),M=y.target,E=Object(F.a)({},y,{onClick:function(G){try{g&&g(G)}catch(U){throw G.preventDefault(),U}!G.defaultPrevented&&G.button===0&&(!M||M==="_self")&&!o(G)&&(G.preventDefault(),x())}});return a!==l?E.ref=h||u:E.ref=u,J.a.createElement("a",E)}),s=l(function(m,h){var u=m.component,x=u===void 0?r:u,g=m.replace,y=m.to,M=m.innerRef,E=Object(k.a)(m,["component","replace","to","innerRef"]);return J.a.createElement(te.e.Consumer,null,function(j){j||Object(I.a)(!1);var G=j.history,U=c(p(y,j.location),j.location),O=U?G.createHref(U):"",X=Object(F.a)({},E,{href:O,navigate:function(){var se=p(y,j.location),ce=g?G.replace:G.push;ce(se)}});return a!==l?X.ref=h||M:X.innerRef=M,J.a.createElement(x,X)})});if(!1)var d,R;var A=function(h){return h},T=J.a.forwardRef;typeof T=="undefined"&&(T=A);function w(){for(var m=arguments.length,h=new Array(m),u=0;u<m;u++)h[u]=arguments[u];return h.filter(function(x){return x}).join(" ")}var C=T(function(m,h){var u=m["aria-current"],x=u===void 0?"page":u,g=m.activeClassName,y=g===void 0?"active":g,M=m.activeStyle,E=m.className,j=m.exact,G=m.isActive,U=m.location,O=m.sensitive,X=m.strict,$=m.style,se=m.to,ce=m.innerRef,Pe=Object(k.a)(m,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return J.a.createElement(te.e.Consumer,null,function(Se){Se||Object(I.a)(!1);var Re=U||Se.location,Oe=c(p(se,Re),Re),Me=Oe.pathname,be=Me&&Me.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ue=be?Object(te.f)(Re.pathname,{path:be,exact:j,sensitive:O,strict:X}):null,ne=!!(G?G(ue,Re):ue),ve=ne?w(E,y):E,le=ne?Object(F.a)({},$,{},M):$,ke=Object(F.a)({"aria-current":ne&&x||null,className:ve,style:le,to:Oe},Pe);return A!==T?ke.ref=h||ce:ke.innerRef=ce,J.a.createElement(s,ke)})});if(!1)var b},"5D2P":function(qe,Ne){qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAFTklEQVRoQ91aS4xURRQ993UzUUZcqFEc4meh0cQFSlwgrvAHSgQWhOhCk4GZqmdw+ERUWDkrBMUBnIzzqqYjcTaaGBLFxA8MjIk/3PhZCCa6UAyKC11ARnDo6Wvu+HrS0/R7r96nWVBJpxfv3nPPrbp169aHUEAzxsxl5gcB3AdgAREtkH8AXSH87wBOMfMp+QfwFREd0Vr/k9c8ZQUwxixi5mWe5y1l5qUAyimxqkQ0XqvVxonoE631Nyn1p8VTO7B///75Fy5c2MzMWwB0ZDHaQmeSiPbMmTNnb3d39+k0mKkcMMZsBiC/W9IYSSH7K4C9Wuu9rjpODoyMjNxQq9VGADzuCpxT7gPP83p7e3v/TMJJdCAIgoVEdBDAzUlgBX8/ycwrfd//Pg431gFr7RPM/HbBxFLBEdGTSql3opQiHQiCoI+IXk9lrU3CzLzR9/3BVvAtHbDWPsrMH7aJTyZYInpMKfVRs/JFDlQqlduq1eoxIro2k6U2KTHzX+VyeXFPT8/PjSYucsBae4iZH24Tj1ywRHRYKfVIpANhnt+Ty0r7lbc0rhMzI2CMuRHAlwBubT+HXBZ+AbBEa/3HrFLCWruTmV/MBZ1N+TiAdyNUX2qZeYh2KaW2zThQqVTumZqaOlZgbePqynEiWquU+qFZwRjzBoBnIoAmS6WSTOhvp0PIGPMcgN2uVguSiyQfBIFPRMMJdrZqrV+bdsBa+x4zryqImAtMJHlr7RJmPgxgbhwQEb2vlFpNAwMDV3Z2dp7JUM+7EG0lE0l+dHS089y5c4dkkjqAVycmJq4ma+0yZv7YQaEIkUjyAh4EwTAR+a6GiGg5BUGwg4i2uyrlkEsi7xL3s8wz88syAm8x89M5iLmoxpIP4348bRYkolEyxowBkA25S1sLQJbyHhfhUCaWvMT9+fPnx5h5cQrMuugRceAEgDsdlKfTVph2rwMgC4mk37gWSz5L3DcZ+1EckAw0L44FM4/4vq+aZfr7+zu6urq2MbPMoSuavieSt9b6zJyU7+OonXVygIjWKKUOxCGFhaA4cj0AF/KS7z8D4DmMfpTIGdcQOgtgldZaJlpss9auA/B1q/Kgrhjm+08B3JuEF/ediE44T2IikiOP1Uqp7/IYDePeElFvXhwAY2nTqJCXkTiZ1XgBcT9jmplHxYEd4SR04kRER0ul0ur169dLWKVqYb7/IpVSjHB9IctSShzQWq9JQySMeyG/MI1ewhxYnqeYq2itnePYGPMmgO6iyAP4v5gTwBzl9Cta68RdnDHmWQAtz3WyOjRTTodZYSsRvZoRbLvWemeU7vDw8P2e532eETtSjZmf931/d31HtkguHdIWUw3oWmttm60NDQ1dVS6XZat6V8EOTMplitwpNJ5K7ALwQg5Da7XWszbnxphRAE/lwIxSnQnd5mMVGYWsZ///MvMK3/ePiFVjjFyADLSBvCyo0vuzj1VCo3J5kflgi5lPE9EKIprHzFIqtKO1PtiqWzLGyIb6oRyW5ZynBOCOHBhRqmNa61nHnhedjQZBcDsRycS7pg0E8kD+LZse3/d/agS5/I7XG0JpI4B9ebqsQN1NWuuWly2X7xVTvfestXfXarWDRHRTgT2aCMXMv3metzJp/5F4SymWhoaG5pfLZVlpL9k1a7VaVRs2bEi89HZyIOwu2b1tukQX3TL3OHGYsjw1GBwc7Oro6Kg7UthTA7mhn5yc3NfX1ycPQ5xbmhGYBSqPPYhINkMPAJDHHrJ4pWlTAOShx1FmvnSPPVoxbHxu43neAmauP7eRf2nTz2yI6FStViv0uc1/ndZCH8rgOooAAAAASUVORK5CYII="},"5VLF":function(qe,Ne,K){"use strict";var te,Q;function N(J,B,D){var H=function(F,k){return J.js_beautify(F,k)};return H.js=J.js_beautify,H.css=B.css_beautify,H.html=D.html_beautify,H.js_beautify=J.js_beautify,H.css_beautify=B.css_beautify,H.html_beautify=D.html_beautify,H}!(te=[K("6UM0"),K("TXwP"),K("psGv")],Q=function(J,B,D){return N(J,B,D)}.apply(Ne,te),Q!==void 0&&(qe.exports=Q))},"6+eU":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return T});var te=K("wx14"),Q=K("rePB"),N=K("VTBJ"),J=K("1OyB"),B=K("vuIU"),D=K("Ji7U"),H=K("LK+K"),F=K("q1tI"),k=K.n(F),I=K("TSYQ"),_=K.n(I),v=function(C){var b,m="".concat(C.rootPrefixCls,"-item"),h=_()(m,"".concat(m,"-").concat(C.page),(b={},Object(Q.a)(b,"".concat(m,"-active"),C.active),Object(Q.a)(b,C.className,!!C.className),Object(Q.a)(b,"".concat(m,"-disabled"),!C.page),b)),u=function(){C.onClick(C.page)},x=function(y){C.onKeyPress(y,C.onClick,C.page)};return k.a.createElement("li",{title:C.showTitle?C.page:null,className:h,onClick:u,onKeyPress:x,tabIndex:"0"},C.itemRender(C.page,"page",k.a.createElement("a",{rel:"nofollow"},C.page)))},p=v,c={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},a=function(w){Object(D.a)(b,w);var C=Object(H.a)(b);function b(){var m;Object(J.a)(this,b);for(var h=arguments.length,u=new Array(h),x=0;x<h;x++)u[x]=arguments[x];return m=C.call.apply(C,[this].concat(u)),m.state={goInputText:""},m.buildOptionText=function(g){return"".concat(g," ").concat(m.props.locale.items_per_page)},m.changeSize=function(g){m.props.changeSize(Number(g))},m.handleChange=function(g){m.setState({goInputText:g.target.value})},m.handleBlur=function(g){var y=m.props,M=y.goButton,E=y.quickGo,j=y.rootPrefixCls,G=m.state.goInputText;if(M||G==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(j,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;m.setState({goInputText:""}),E(m.getValidValue())},m.go=function(g){var y=m.state.goInputText;if(y==="")return;(g.keyCode===c.ENTER||g.type==="click")&&(m.setState({goInputText:""}),m.props.quickGo(m.getValidValue()))},m}return Object(B.a)(b,[{key:"getValidValue",value:function(){var h=this.state,u=h.goInputText,x=h.current;return!u||isNaN(u)?x:Number(u)}},{key:"getPageSizeOptions",value:function(){var h=this.props,u=h.pageSize,x=h.pageSizeOptions;return x.some(function(g){return g.toString()===u.toString()})?x:x.concat([u.toString()]).sort(function(g,y){var M=isNaN(Number(g))?0:Number(g),E=isNaN(Number(y))?0:Number(y);return M-E})}},{key:"render",value:function(){var h=this,u=this.props,x=u.pageSize,g=u.locale,y=u.rootPrefixCls,M=u.changeSize,E=u.quickGo,j=u.goButton,G=u.selectComponentClass,U=u.buildOptionText,O=u.selectPrefixCls,X=u.disabled,$=this.state.goInputText,se="".concat(y,"-options"),ce=G,Pe=null,Se=null,Re=null;if(!M&&!E)return null;var Oe=this.getPageSizeOptions();if(M&&ce){var Me=Oe.map(function(be,ue){return k.a.createElement(ce.Option,{key:ue,value:be.toString()},(U||h.buildOptionText)(be))});Pe=k.a.createElement(ce,{disabled:X,prefixCls:O,showSearch:!1,className:"".concat(se,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(x||Oe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Me)}return E&&(j&&(Re=typeof j=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:X,className:"".concat(se,"-quick-jumper-button")},g.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),Se=k.a.createElement("div",{className:"".concat(se,"-quick-jumper")},g.jump_to,k.a.createElement("input",{disabled:X,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,Re)),k.a.createElement("li",{className:"".concat(se)},Pe,Se)}}]),b}(k.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=a,o=K("N2Kk");function r(){}function s(w){return typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function d(w,C,b){return b}function R(w,C,b){var m=typeof w=="undefined"?C.pageSize:w;return Math.floor((b.total-1)/m)+1}var A=function(w){Object(D.a)(b,w);var C=Object(H.a)(b);function b(m){var h;Object(J.a)(this,b),h=C.call(this,m),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(R(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(M,E){var j=h.props.prefixCls,G=M||k.a.createElement("button",{type:"button","aria-label":E,className:"".concat(j,"-item-link")});return typeof M=="function"&&(G=k.a.createElement(M,Object(N.a)({},h.props))),G},h.savePaginationNode=function(M){h.paginationNode=M},h.isValid=function(M){return s(M)&&M!==h.state.current},h.shouldDisplayQuickJumper=function(){var M=h.props,E=M.showQuickJumper,j=M.pageSize,G=M.total;return G<=j?!1:E},h.handleKeyDown=function(M){(M.keyCode===c.ARROW_UP||M.keyCode===c.ARROW_DOWN)&&M.preventDefault()},h.handleKeyUp=function(M){var E=h.getValidValue(M),j=h.state.currentInputValue;E!==j&&h.setState({currentInputValue:E}),M.keyCode===c.ENTER?h.handleChange(E):M.keyCode===c.ARROW_UP?h.handleChange(E-1):M.keyCode===c.ARROW_DOWN&&h.handleChange(E+1)},h.changePageSize=function(M){var E=h.state.current,j=R(M,h.state,h.props);E=E>j?j:E,j===0&&(E=h.state.current),typeof M=="number"&&("pageSize"in h.props||h.setState({pageSize:M}),"current"in h.props||h.setState({current:E,currentInputValue:E})),h.props.onShowSizeChange(E,M),"onChange"in h.props&&h.props.onChange&&h.props.onChange(E,M)},h.handleChange=function(M){var E=h.props.disabled,j=M;if(h.isValid(j)&&!E){var G=R(void 0,h.state,h.props);j>G?j=G:j<1&&(j=1),"current"in h.props||h.setState({current:j,currentInputValue:j});var U=h.state.pageSize;return h.props.onChange(j,U),j}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<R(void 0,h.state,h.props)},h.runIfEnter=function(M,E){if(M.key==="Enter"||M.charCode===13){for(var j=arguments.length,G=new Array(j>2?j-2:0),U=2;U<j;U++)G[U-2]=arguments[U];E.apply(void 0,G)}},h.runIfEnterPrev=function(M){h.runIfEnter(M,h.prev)},h.runIfEnterNext=function(M){h.runIfEnter(M,h.next)},h.runIfEnterJumpPrev=function(M){h.runIfEnter(M,h.jumpPrev)},h.runIfEnterJumpNext=function(M){h.runIfEnter(M,h.jumpNext)},h.handleGoTO=function(M){(M.keyCode===c.ENTER||M.type==="click")&&h.handleChange(h.state.currentInputValue)};var u=m.onChange!==r,x="current"in m;x&&!u&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var g=m.defaultCurrent;"current"in m&&(g=m.current);var y=m.defaultPageSize;return"pageSize"in m&&(y=m.pageSize),g=Math.min(g,R(y,void 0,m)),h.state={current:g,currentInputValue:g,pageSize:y},h}return Object(B.a)(b,[{key:"componentDidUpdate",value:function(h,u){var x=this.props.prefixCls;if(u.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(x,"-item-").concat(u.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(h){var u=h.target.value,x=R(void 0,this.state,this.props),g=this.state.currentInputValue,y;return u===""?y=u:isNaN(Number(u))?y=g:u>=x?y=x:y=Number(u),y}},{key:"getShowSizeChanger",value:function(){var h=this.props,u=h.showSizeChanger,x=h.total,g=h.totalBoundaryShowSizeChanger;return typeof u!="undefined"?u:x>g}},{key:"renderPrev",value:function(h){var u=this.props,x=u.prevIcon,g=u.itemRender,y=g(h,"prev",this.getItemIcon(x,"prev page")),M=!this.hasPrev();return Object(F.isValidElement)(y)?Object(F.cloneElement)(y,{disabled:M}):y}},{key:"renderNext",value:function(h){var u=this.props,x=u.nextIcon,g=u.itemRender,y=g(h,"next",this.getItemIcon(x,"next page")),M=!this.hasNext();return Object(F.isValidElement)(y)?Object(F.cloneElement)(y,{disabled:M}):y}},{key:"render",value:function(){var h=this,u=this.props,x=u.prefixCls,g=u.className,y=u.style,M=u.disabled,E=u.hideOnSinglePage,j=u.total,G=u.locale,U=u.showQuickJumper,O=u.showLessItems,X=u.showTitle,$=u.showTotal,se=u.simple,ce=u.itemRender,Pe=u.showPrevNextJumpers,Se=u.jumpPrevIcon,Re=u.jumpNextIcon,Oe=u.selectComponentClass,Me=u.selectPrefixCls,be=u.pageSizeOptions,ue=this.state,ne=ue.current,ve=ue.pageSize,le=ue.currentInputValue;if(E===!0&&j<=ve)return null;var ke=R(void 0,this.state,this.props),Fe=[],Ie=null,He=null,$e=null,tt=null,Qe=null,Je=U&&U.goButton,Ye=O?1:2,gt=ne-1>0?ne-1:0,_t=ne+1<ke?ne+1:ke,vt=Object.keys(this.props).reduce(function(re,ae){return(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(re[ae]=h.props[ae]),re},{});if(se)return Je&&(typeof Je=="boolean"?Qe=k.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):Qe=k.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Je),Qe=k.a.createElement("li",{title:X?"".concat(G.jump_to).concat(ne,"/").concat(ke):null,className:"".concat(x,"-simple-pager")},Qe)),k.a.createElement("ul",Object(te.a)({className:_()(x,"".concat(x,"-simple"),Object(Q.a)({},"".concat(x,"-disabled"),M),g),style:y,ref:this.savePaginationNode},vt),k.a.createElement("li",{title:X?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:_()("".concat(x,"-prev"),Object(Q.a)({},"".concat(x,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(gt)),k.a.createElement("li",{title:X?"".concat(ne,"/").concat(ke):null,className:"".concat(x,"-simple-pager")},k.a.createElement("input",{type:"text",value:le,disabled:M,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),k.a.createElement("span",{className:"".concat(x,"-slash")},"/"),ke),k.a.createElement("li",{title:X?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:_()("".concat(x,"-next"),Object(Q.a)({},"".concat(x,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(_t)),Qe);if(ke<=3+Ye*2){var dt={locale:G,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:X,itemRender:ce};ke||Fe.push(k.a.createElement(p,Object(te.a)({},dt,{key:"noPager",page:ke,className:"".concat(x,"-disabled")})));for(var Ct=1;Ct<=ke;Ct+=1){var xt=ne===Ct;Fe.push(k.a.createElement(p,Object(te.a)({},dt,{key:Ct,page:Ct,active:xt})))}}else{var Le=O?G.prev_3:G.prev_5,Ce=O?G.next_3:G.next_5;Pe&&(Ie=k.a.createElement("li",{title:X?Le:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:_()("".concat(x,"-jump-prev"),Object(Q.a)({},"".concat(x,"-jump-prev-custom-icon"),!!Se))},ce(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Se,"prev page"))),He=k.a.createElement("li",{title:X?Ce:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:_()("".concat(x,"-jump-next"),Object(Q.a)({},"".concat(x,"-jump-next-custom-icon"),!!Re))},ce(this.getJumpNextPage(),"jump-next",this.getItemIcon(Re,"next page")))),tt=k.a.createElement(p,{locale:G,last:!0,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:!1,showTitle:X,itemRender:ce}),$e=k.a.createElement(p,{locale:G,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:X,itemRender:ce});var nt=Math.max(1,ne-Ye),rt=Math.min(ne+Ye,ke);ne-1<=Ye&&(rt=1+Ye*2),ke-ne<=Ye&&(nt=ke-Ye*2);for(var Be=nt;Be<=rt;Be+=1){var et=ne===Be;Fe.push(k.a.createElement(p,{locale:G,rootPrefixCls:x,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Be,page:Be,active:et,showTitle:X,itemRender:ce}))}ne-1>=Ye*2&&ne!==1+2&&(Fe[0]=Object(F.cloneElement)(Fe[0],{className:"".concat(x,"-item-after-jump-prev")}),Fe.unshift(Ie)),ke-ne>=Ye*2&&ne!==ke-2&&(Fe[Fe.length-1]=Object(F.cloneElement)(Fe[Fe.length-1],{className:"".concat(x,"-item-before-jump-next")}),Fe.push(He)),nt!==1&&Fe.unshift($e),rt!==ke&&Fe.push(tt)}var xe=null;$&&(xe=k.a.createElement("li",{className:"".concat(x,"-total-text")},$(j,[j===0?0:(ne-1)*ve+1,ne*ve>j?j:ne*ve])));var fe=!this.hasPrev()||!ke,ge=!this.hasNext()||!ke;return k.a.createElement("ul",Object(te.a)({className:_()(x,g,Object(Q.a)({},"".concat(x,"-disabled"),M)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},vt),xe,k.a.createElement("li",{title:X?G.prev_page:null,onClick:this.prev,tabIndex:fe?null:0,onKeyPress:this.runIfEnterPrev,className:_()("".concat(x,"-prev"),Object(Q.a)({},"".concat(x,"-disabled"),fe)),"aria-disabled":fe},this.renderPrev(gt)),Fe,k.a.createElement("li",{title:X?G.next_page:null,onClick:this.next,tabIndex:ge?null:0,onKeyPress:this.runIfEnterNext,className:_()("".concat(x,"-next"),Object(Q.a)({},"".concat(x,"-disabled"),ge)),"aria-disabled":ge},this.renderNext(_t)),k.a.createElement(l,{disabled:M,locale:G,rootPrefixCls:x,selectComponentClass:Oe,selectPrefixCls:Me,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:ve,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Je}))}}],[{key:"getDerivedStateFromProps",value:function(h,u){var x={};if("current"in h&&(x.current=h.current,h.current!==u.current&&(x.currentInputValue=x.current)),"pageSize"in h&&h.pageSize!==u.pageSize){var g=u.current,y=R(h.pageSize,u,h);g=g>y?y:g,"current"in h||(x.current=g,x.currentInputValue=g),x.pageSize=h.pageSize}return x}}]),b}(k.a.Component);A.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:o.a,style:{},itemRender:d,totalBoundaryShowSizeChanger:50};var T=A},"6RRn":function(qe,Ne,K){"use strict";var te=K("wCXF"),Q=K("n6Qo");K.d(Ne,"b",function(){return Q.a});var N=K("IBYe"),J=K("6eGT"),B=K("hW8S");K.d(Ne,"a",function(){return B.a}),Ne.c=te.b},"6UM0":function(qe,Ne,K){var te,Q;(function(){var N;(function(){"use strict";var B=[function(k,I,_){var v=_(1).Beautifier,p=_(5).Options;function c(a,l){var o=new v(a,l);return o.beautify()}k.exports=c,k.exports.defaultOptions=function(){return new p}},function(k,I,_){var v=_(2).Output,p=_(3).Token,c=_(4),a=_(5).Options,l=_(7).Tokenizer,o=_(7).line_starters,r=_(7).positionable_operators,s=_(7).TOKEN;function d(O,X){return X.indexOf(O)!==-1}function R(O){return O.replace(/^\s+/g,"")}function A(O){for(var X={},$=0;$<O.length;$++)X[O[$].replace(/-/g,"_")]=O[$];return X}function T(O,X){return O&&O.type===s.RESERVED&&O.text===X}function w(O,X){return O&&O.type===s.RESERVED&&d(O.text,X)}var C=["case","return","do","if","throw","else","await","break","continue","async"],b=["before-newline","after-newline","preserve-newline"],m=A(b),h=[m.before_newline,m.preserve_newline],u={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function x(O,X){if(X.multiline_frame||X.mode===u.ForInitializer||X.mode===u.Conditional)return;O.remove_indent(X.start_line_index)}function g(O){O=O.replace(c.allLineBreaks,`
`);for(var X=[],$=O.indexOf(`
`);$!==-1;)X.push(O.substring(0,$)),O=O.substring($+1),$=O.indexOf(`
`);return O.length&&X.push(O),X}function y(O){return O===u.ArrayLiteral}function M(O){return d(O,[u.Expression,u.ForInitializer,u.Conditional])}function E(O,X){for(var $=0;$<O.length;$++){var se=O[$].trim();if(se.charAt(0)!==X)return!1}return!0}function j(O,X){for(var $=0,se=O.length,ce;$<se;$++)if(ce=O[$],ce&&ce.indexOf(X)!==0)return!1;return!0}function G(O,X){X=X||{},this._source_text=O||"",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(X)}G.prototype.create_flags=function(O,X){var $=0;O&&($=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>$&&($=O.line_indent_level));var se={mode:X,parent:O,last_token:O?O.last_token:new p(s.START_BLOCK,""),last_word:O?O.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:O?O.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return se},G.prototype._reset=function(O){var X=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new v(this._options,X),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var $=new l(O,this._options);return this._tokens=$.tokenize(),O},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,X=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,X&&c.lineBreak.test(X||"")&&($=X.match(c.lineBreak)[0]));for(var se=this._tokens.next();se;)this.handle_token(se),this._last_last_text=this._flags.last_token.text,this._flags.last_token=se,se=this._tokens.next();return O=this._output.get_code($),O},G.prototype.handle_token=function(O,X){O.type===s.START_EXPR?this.handle_start_expr(O):O.type===s.END_EXPR?this.handle_end_expr(O):O.type===s.START_BLOCK?this.handle_start_block(O):O.type===s.END_BLOCK?this.handle_end_block(O):O.type===s.WORD?this.handle_word(O):O.type===s.RESERVED?this.handle_word(O):O.type===s.SEMICOLON?this.handle_semicolon(O):O.type===s.STRING?this.handle_string(O):O.type===s.EQUALS?this.handle_equals(O):O.type===s.OPERATOR?this.handle_operator(O):O.type===s.COMMA?this.handle_comma(O):O.type===s.BLOCK_COMMENT?this.handle_block_comment(O,X):O.type===s.COMMENT?this.handle_comment(O,X):O.type===s.DOT?this.handle_dot(O):O.type===s.EOF?this.handle_eof(O):O.type===s.UNKNOWN?this.handle_unknown(O,X):this.handle_unknown(O,X)},G.prototype.handle_whitespace_and_comments=function(O,X){var $=O.newlines,se=this._options.keep_array_indentation&&y(this._flags.mode);if(O.comments_before)for(var ce=O.comments_before.next();ce;)this.handle_whitespace_and_comments(ce,X),this.handle_token(ce,X),ce=O.comments_before.next();if(se)for(var Pe=0;Pe<$;Pe+=1)this.print_newline(Pe>0,X);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,X);for(var Se=1;Se<$;Se+=1)this.print_newline(!0,X)}};var U=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(O,X){if(X=X===void 0?!1:X,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&O.newlines||X,se=d(this._flags.last_token.text,r)||d(O.text,r);if(se){var ce=d(this._flags.last_token.text,r)&&d(this._options.operator_position,h)||d(O.text,r);$=$&&ce}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(w(this._flags.last_token,U))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(O,X){if(!X&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&T($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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))},G.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var X=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(X),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.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))},G.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===u.Statement&&x(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(O){var X=!1;return X=X||w(this._flags.last_token,["var","let","const"])&&O.type===s.WORD,X=X||T(this._flags.last_token,"do"),X=X||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&w(this._flags.last_token,U)&&!O.newlines,X=X||T(this._flags.last_token,"else")&&!(T(O,"if")&&!O.comments_before),X=X||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),X=X||this._flags.last_token.type===s.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==s.WORD&&O.type!==s.RESERVED,X=X||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||w(this._flags.last_token,["get","set"])),X?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,w(O,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var X=u.Expression;if(O.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){w(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(X),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}X=u.ArrayLiteral,y(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),d(this._flags.last_token.type,[s.START_EXPR,s.END_EXPR,s.WORD,s.OPERATOR,s.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===s.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,X=u.ForInitializer):d(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,X=u.Conditional):d(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.whitespace_before===""?this._output.space_before_token=!1:(d(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var se=this._tokens.peek(-4);w($,["async","function"])||$.text==="*"&&w(se,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(se.text==="{"||se.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(O);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&d(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===s.START_BLOCK?this.print_newline():(this._flags.last_token.type===s.END_EXPR||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===s.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(X),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(O){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===s.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(O),this.restore_mode(),x(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var X=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):$&&(d($.text,[":",","])&&d(X.type,[s.STRING,s.WORD,s.RESERVED])||d(X.text,["get","set","..."])&&d($.type,[s.WORD,s.RESERVED]))?d(this._last_last_text,["class","interface"])&&!d($.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):d(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||w(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(w(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var se=!X.comments_before&&X.text==="}",ce=se&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Pe=0,Se=null;this._flags.inline_frame=!0;do if(Pe+=1,Se=this._tokens.peek(Pe-1),Se.newlines){this._flags.inline_frame=!1;break}while(Se.type!==s.EOF&&!(Se.type===s.END_BLOCK&&Se.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ce||this._flags.last_token.type===s.EQUALS||w(this._flags.last_token,C)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.COMMA)&&((this._flags.last_token.type===s.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==s.OPERATOR&&this._flags.last_token.type!==s.START_EXPR&&(this._flags.last_token.type===s.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!se&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===u.Statement;)this.restore_mode();var X=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!X?this._output.space_before_token=!0:this._options.brace_style==="expand"?X||this.print_newline():X||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(O)},G.prototype.handle_word=function(O){if(O.type===s.RESERVED){if(d(O.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)O.type=s.WORD;else if(O.text==="import"&&d(this._tokens.peek().text,["(","."]))O.type=s.WORD;else if(d(O.text,["as","from"])&&!this._flags.import_block)O.type=s.WORD;else if(this._flags.mode===u.ObjectLiteral){var X=this._tokens.peek();X.text===":"&&(O.type=s.WORD)}}if(this.start_of_statement(O)?w(this._flags.last_token,["var","let","const"])&&O.type===s.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!M(this._flags.mode)&&(this._flags.last_token.type!==s.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==s.EQUALS&&(this._options.preserve_newlines||!w(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(T(O,"while")){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&w(O,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),T(O,"function")){(d(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(d(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?w(this._flags.last_token,["get","set","new","export"])||w(this._flags.last_token,U)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===s.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(M(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var $="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":w(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===u.BlockStatement?$="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&M(this._flags.mode)?$="SPACE":this._flags.last_token.type===s.STRING?$="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(d(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&d(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),w(O,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),w(O,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var se=this._output.current_line;se.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?w(this._flags.last_token,C)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&w(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!w(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(O,"if")&&T(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):w(O,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===s.WORD||O.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===s.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(O,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var X=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&T(X,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},G.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR||this._flags.last_token.type===s.EQUALS||this._flags.last_token.type===s.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},G.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},G.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),this._output.space_before_token=!0,this._flags.declaration_statement?(M(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(O)},G.prototype.handle_operator=function(O){var X=O.text==="*"&&(w(this._flags.last_token,["function","yield"])||d(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),$=d(O.text,["-","+"])&&(d(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||d(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var se=!X;this.handle_whitespace_and_comments(O,se)}if(O.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===s.OPERATOR&&d(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==s.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 ce=!0,Pe=!0,Se=!1;if(O.text===":"?this._flags.ternary_depth===0?ce=!1:(this._flags.ternary_depth-=1,Se=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!$&&!X&&this._options.preserve_newlines&&d(O.text,r)){var Re=O.text===":",Oe=Re&&Se,Me=Re&&!Se;switch(this._options.operator_position){case m.before_newline:this._output.space_before_token=!Me,this.print_token(O),(!Re||Oe)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case m.after_newline:this._output.space_before_token=!0,!Re||Oe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case m.preserve_newline:Me||this.allow_wrap_or_preserved_newline(O),ce=!(this._output.just_added_newline()||Me),this._output.space_before_token=ce,this.print_token(O),this._output.space_before_token=!0;return}}if(X){this.allow_wrap_or_preserved_newline(O),ce=!1;var be=this._tokens.peek();Pe=be&&d(be.type,[s.WORD,s.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),ce=this._flags.last_token.type===s.START_BLOCK,Pe=!1;else if(d(O.text,["--","++","!","~"])||$){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),ce=!1,Pe=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var ue=w(this._flags.last_token,C)&&O.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&M(this._flags.mode)&&(ce=!0),this._flags.last_token.type===s.RESERVED?ce=!0:this._flags.last_token.type===s.END_EXPR?ce=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ce=d(O.text,["--","-","++","+"])&&d(this._flags.last_token.text,["--","-","++","+"]),d(O.text,["+","-"])&&d(this._flags.last_token.text,["--","++"])&&(Pe=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ce,this.print_token(O),this._output.space_before_token=Pe},G.prototype.handle_block_comment=function(O,X){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,X),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,X)},G.prototype.print_block_commment=function(O,X){var $=g(O.text),se,ce=!1,Pe=!1,Se=O.whitespace_before,Re=Se.length;if(this.print_newline(!1,X),this.print_token_line_indentation(O),this._output.add_token($[0]),this.print_newline(!1,X),$.length>1){for($=$.slice(1),ce=E($,"*"),Pe=j($,Se),ce&&(this._flags.alignment=1),se=0;se<$.length;se++)ce?(this.print_token_line_indentation(O),this._output.add_token(R($[se]))):Pe&&$[se]?(this.print_token_line_indentation(O),this._output.add_token($[se].substring(Re))):(this._output.current_line.set_indent(-1),this._output.add_token($[se])),this.print_newline(!1,X);this._flags.alignment=0}},G.prototype.handle_comment=function(O,X){O.newlines?this.print_newline(!1,X):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,X)},G.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),w(this._flags.last_token,C)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},G.prototype.handle_unknown=function(O,X){this.print_token(O),O.text[O.text.length-1]===`
`&&this.print_newline(!1,X)},G.prototype.handle_eof=function(O){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},k.exports.Beautifier=G},function(k){function I(p){this.__parent=p,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=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function _(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}_.prototype.get_indent_size=function(p,c){var a=this.__base_string_length;return c=c||0,p<0&&(a=0),a+=p*this.__indent_size,a+=c,a},_.prototype.get_indent_string=function(p,c){var a=this.__base_string;return c=c||0,p<0&&(p=0,a=""),c+=p*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},_.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var p=this.__cache.length,c=0,a="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),p&&(a+=new Array(p+1).join(" ")),this.__cache.push(a)};function v(p,c){this.__indent_cache=new _(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},v.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return p!==`
`&&(a=a.replace(/[\n]/g,p)),a},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.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(" "))},v.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(p,c){for(var a=this.__lines.length-2;a>=0;){var l=this.__lines[a];if(l.is_empty())break;if(l.item(0).indexOf(p)!==0&&l.item(-1)!==c){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},k.exports.Output=v},function(k){function I(_,v,p,c){this.type=_,this.text=v,this.comments_before=null,this.newlines=p||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=I},function(k,I){var _="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",v="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",c="\\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}|["+_+p+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+v+p+c+"])*";I.identifier=new RegExp(a+l,"g"),I.identifierStart=new RegExp(a),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+v+p+c+"])+");var o=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(k,I,_){var v=_(6).Options,p=["before-newline","after-newline","preserve-newline"];function c(a){v.call(this,a,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="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 o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var r=0;r<o.length;r++)o[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=o[r];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",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new v,k.exports.Options=c},function(k){function I(p,c){this.raw_options=_(p,c),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"])}I.prototype._get_array=function(p,c){var a=this.raw_options[p],l=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(l=a.concat()):typeof a=="string"&&(l=a.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(p,c){var a=this.raw_options[p],l=a===void 0?!!c:!!a;return l},I.prototype._get_characters=function(p,c){var a=this.raw_options[p],l=c||"";return typeof a=="string"&&(l=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},I.prototype._get_number=function(p,c){var a=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var l=parseInt(a,10);return isNaN(l)&&(l=c),l},I.prototype._get_selection=function(p,c,a){var l=this._get_selection_list(p,c,a);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l[0]},I.prototype._get_selection_list=function(p,c,a){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[c[0]],!this._is_valid_selection(a,c))throw new Error("Invalid Default Value!");var l=this._get_array(p,a);if(!this._is_valid_selection(l,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(a){return c.indexOf(a)===-1})};function _(p,c){var a={};p=v(p);var l;for(l in p)l!==c&&(a[l]=p[l]);if(c&&p[c])for(l in p[c])a[l]=p[c][l];return a}function v(p){var c={},a;for(a in p){var l=a.replace(/-/g,"_");c[l]=p[a]}return c}k.exports.Options=I,k.exports.normalizeOpts=v,k.exports.mergeOpts=_},function(k,I,_){var v=_(8).InputScanner,p=_(9).Tokenizer,c=_(9).TOKEN,a=_(13).Directives,l=_(4),o=_(12).Pattern,r=_(14).TemplatablePattern;function s(E,j){return j.indexOf(E)!==-1}var d={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:c.START,RAW:c.RAW,EOF:c.EOF},R=new a(/\/\*/,/\*\//),A=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[0-9]/,w=/[^\d\.]/,C=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),b=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),b="\\?\\.(?!\\d) "+b,b=b.replace(/ /g,"|");var m=new RegExp(b),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),u=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),x=new RegExp("^(?:"+u.join("|")+")$"),g,y=function(E,j){p.call(this,E,j),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new o(this._input),U=new r(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(l.identifier).matching(l.identifierMatch),number:G.matching(A),punct:G.matching(m),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(/<!--/),html_comment_end:G.matching(/-->/),include:G.starting_with(/#include/).until_after(l.lineBreak),shebang:G.starting_with(/#!/).until_after(l.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};y.prototype=new p,y.prototype._is_comment=function(E){return E.type===d.COMMENT||E.type===d.BLOCK_COMMENT||E.type===d.UNKNOWN},y.prototype._is_opening=function(E){return E.type===d.START_BLOCK||E.type===d.START_EXPR},y.prototype._is_closing=function(E,j){return(E.type===d.END_BLOCK||E.type===d.END_EXPR)&&j&&(E.text==="]"&&j.text==="["||E.text===")"&&j.text==="("||E.text==="}"&&j.text==="{")},y.prototype._reset=function(){g=!1},y.prototype._get_next_token=function(E,j){var G=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(d.EOF,""):(G=G||this._read_non_javascript(U),G=G||this._read_string(U),G=G||this._read_word(E),G=G||this._read_singles(U),G=G||this._read_comment(U),G=G||this._read_regexp(U,E),G=G||this._read_xml(U,E),G=G||this._read_punctuation(),G=G||this._create_token(d.UNKNOWN,this._input.next()),G)},y.prototype._read_word=function(E){var j;if(j=this.__patterns.identifier.read(),j!=="")return j=j.replace(l.allLineBreaks,`
`),!(E.type===d.DOT||E.type===d.RESERVED&&(E.text==="set"||E.text==="get"))&&x.test(j)?(j==="in"||j==="of")&&(E.type===d.WORD||E.type===d.STRING)?this._create_token(d.OPERATOR,j):this._create_token(d.RESERVED,j):this._create_token(d.WORD,j);if(j=this.__patterns.number.read(),j!=="")return this._create_token(d.WORD,j)},y.prototype._read_singles=function(E){var j=null;return E==="("||E==="["?j=this._create_token(d.START_EXPR,E):E===")"||E==="]"?j=this._create_token(d.END_EXPR,E):E==="{"?j=this._create_token(d.START_BLOCK,E):E==="}"?j=this._create_token(d.END_BLOCK,E):E===";"?j=this._create_token(d.SEMICOLON,E):E==="."&&w.test(this._input.peek(1))?j=this._create_token(d.DOT,E):E===","&&(j=this._create_token(d.COMMA,E)),j&&this._input.next(),j},y.prototype._read_punctuation=function(){var E=this.__patterns.punct.read();if(E!=="")return E==="="?this._create_token(d.EQUALS,E):E==="?."?this._create_token(d.DOT,E):this._create_token(d.OPERATOR,E)},y.prototype._read_non_javascript=function(E){var j="";if(E==="#"){if(this._is_first_token()&&(j=this.__patterns.shebang.read(),j))return this._create_token(d.UNKNOWN,j.trim()+`
`);if(j=this.__patterns.include.read(),j)return this._create_token(d.UNKNOWN,j.trim()+`
`);E=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(T)){do E=this._input.next(),G+=E;while(this._input.hasNext()&&E!=="#"&&E!=="=");return E==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(d.WORD,G)}this._input.back()}else if(E==="<"&&this._is_first_token()){if(j=this.__patterns.html_comment_start.read(),j){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)j+=this._input.next();return g=!0,this._create_token(d.COMMENT,j)}}else if(g&&E==="-"&&(j=this.__patterns.html_comment_end.read(),j))return g=!1,this._create_token(d.COMMENT,j);return null},y.prototype._read_comment=function(E){var j=null;if(E==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var U=R.get_directives(G);U&&U.ignore==="start"&&(G+=R.readIgnored(this._input)),G=G.replace(l.allLineBreaks,`
`),j=this._create_token(d.BLOCK_COMMENT,G),j.directives=U}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),j=this._create_token(d.COMMENT,G))}return j},y.prototype._read_string=function(E){if(E==="`"||E==="'"||E==='"'){var j=this._input.next();return this.has_char_escapes=!1,E==="`"?j+=this._read_string_recursive("`",!0,"${"):j+=this._read_string_recursive(E),this.has_char_escapes&&this._options.unescape_strings&&(j=M(j)),this._input.peek()===E&&(j+=this._input.next()),j=j.replace(l.allLineBreaks,`
`),this._create_token(d.STRING,j)}return null},y.prototype._allow_regexp_or_xml=function(E){return E.type===d.RESERVED&&s(E.text,["return","case","throw","else","do","typeof","yield"])||E.type===d.END_EXPR&&E.text===")"&&E.opened.previous.type===d.RESERVED&&s(E.opened.previous.text,["if","while","for"])||s(E.type,[d.COMMENT,d.START_EXPR,d.START_BLOCK,d.START,d.END_BLOCK,d.OPERATOR,d.EQUALS,d.EOF,d.SEMICOLON,d.COMMA])},y.prototype._read_regexp=function(E,j){if(E==="/"&&this._allow_regexp_or_xml(j)){for(var G=this._input.next(),U=!1,O=!1;this._input.hasNext()&&(U||O||this._input.peek()!==E)&&!this._input.testChar(l.newline);)G+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===E&&(G+=this._input.next(),G+=this._input.read(l.identifier)),this._create_token(d.STRING,G)}return null},y.prototype._read_xml=function(E,j){if(this._options.e4x&&E==="<"&&this._allow_regexp_or_xml(j)){var G="",U=this.__patterns.xml.read_match();if(U){for(var O=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),X=O.indexOf("{")===0,$=0;U;){var se=!!U[1],ce=U[2],Pe=!!U[U.length-1]||ce.slice(0,8)==="![CDATA[";if(!Pe&&(ce===O||X&&ce.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(se?--$:++$),G+=U[0],$<=0)break;U=this.__patterns.xml.read_match()}return U||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(l.allLineBreaks,`
`),this._create_token(d.STRING,G)}}return null};function M(E){for(var j="",G=0,U=new v(E),O=null;U.hasNext();)if(O=U.match(/([\s]|[^\\]|\\\\)+/g),O&&(j+=O[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")O=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")O=U.match(/u([0-9A-Fa-f]{4})/g);else{j+="\\",U.hasNext()&&(j+=U.next());continue}if(!O)return E;if(G=parseInt(O[1],16),G>126&&G<=255&&O[0].indexOf("x")===0)return E;if(G>=0&&G<32){j+="\\"+O[0];continue}else G===34||G===39||G===92?j+="\\"+String.fromCharCode(G):j+=String.fromCharCode(G)}return j}y.prototype._read_string_recursive=function(E,j,G){var U,O;E==="'"?O=this.__patterns.single_quote:E==='"'?O=this.__patterns.double_quote:E==="`"?O=this.__patterns.template_text:E==="}"&&(O=this.__patterns.template_expression);for(var X=O.read(),$="";this._input.hasNext();){if($=this._input.next(),$===E||!j&&l.newline.test($)){this._input.back();break}else $==="\\"&&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(),$+=this._input.next()):G&&(G==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),G===$&&(E==="`"?$+=this._read_string_recursive("}",j,"`"):$+=this._read_string_recursive("`",j,"${"),this._input.hasNext()&&($+=this._input.next())));$+=O.read(),X+=$}return X},k.exports.Tokenizer=y,k.exports.TOKEN=d,k.exports.positionable_operators=C.slice(),k.exports.line_starters=h.slice()},function(k){var I=RegExp.prototype.hasOwnProperty("sticky");function _(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},_.prototype.peek=function(v){var p=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(p=this.__input.charAt(v)),p},_.prototype.__match=function(v,p){v.lastIndex=p;var c=v.exec(this.__input);return c&&!(I&&v.sticky)&&(c.index!==p&&(c=null)),c},_.prototype.test=function(v,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(v,p):!1},_.prototype.testChar=function(v,p){var c=this.peek(p);return v.lastIndex=0,c!==null&&v.test(c)},_.prototype.match=function(v){var p=this.__match(v,this.__position);return p?this.__position+=p[0].length:p=null,p},_.prototype.read=function(v,p,c){var a="",l;return v&&(l=this.match(v),l&&(a+=l[0])),p&&(l||!v)&&(a+=this.readUntil(p,c)),a},_.prototype.readUntil=function(v,p){var c="",a=this.__position;v.lastIndex=this.__position;var l=v.exec(this.__input);return l?(a=l.index,p&&(a+=l[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},_.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},_.prototype.get_regexp=function(v,p){var c=null,a="g";return p&&I&&(a="y"),typeof v=="string"&&v!==""?c=new RegExp(v,a):v&&(c=new RegExp(v.source,a)),c},_.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(v){var p=this.__position,c=this.readUntilAfter(v);return this.__position=p,c},_.prototype.lookBack=function(v){var p=this.__position-1;return p>=v.length&&this.__input.substring(p-v.length,p).toLowerCase()===v},k.exports.InputScanner=_},function(k,I,_){var v=_(8).InputScanner,p=_(3).Token,c=_(10).TokenStream,a=_(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(r,s){this._input=new v(r),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};o.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var r,s=new p(l.START,""),d=null,R=[],A=new c;s.type!==l.EOF;){for(r=this._get_next_token(s,d);this._is_comment(r);)A.add(r),r=this._get_next_token(s,d);A.isEmpty()||(r.comments_before=A,A=new c),r.parent=d,this._is_opening(r)?(R.push(d),d=r):d&&this._is_closing(r,d)&&(r.opened=d,d.closed=r,d=R.pop(),r.parent=d),r.previous=s,s.next=r,this.__tokens.add(r),s=r}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(r,s){this._readWhitespace();var d=this._input.read(/.+/g);return d?this._create_token(l.RAW,d):this._create_token(l.EOF,"")},o.prototype._is_comment=function(r){return!1},o.prototype._is_opening=function(r){return!1},o.prototype._is_closing=function(r,s){return!1},o.prototype._create_token=function(r,s){var d=new p(r,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return d},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=o,k.exports.TOKEN=l},function(k){function I(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position<this.__tokens_length},I.prototype.next=function(){var _=null;return this.hasNext()&&(_=this.__tokens[this.__position],this.__position+=1),_},I.prototype.peek=function(_){var v=null;return _=_||0,_+=this.__position,_>=0&&_<this.__tokens_length&&(v=this.__tokens[_]),v},I.prototype.add=function(_){this.__parent_token&&(_.parent=this.__parent_token),this.__tokens.push(_),this.__tokens_length+=1},k.exports.TokenStream=I},function(k,I,_){var v=_(12).Pattern;function p(c,a){v.call(this,c,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new v,p.prototype.__set_whitespace_patterns=function(c,a){c+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+c+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},p.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var c=this._input.read(this._match_pattern);if(c===" ")this.whitespace_before_token=" ";else if(c){var a=this.__split(this._newline_regexp,c);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return c},p.prototype.matching=function(c,a){var l=this._create();return l.__set_whitespace_patterns(c,a),l._update(),l},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(c,a){c.lastIndex=0;for(var l=0,o=[],r=c.exec(a);r;)o.push(a.substring(l,r.index)),l=r.index+r[0].length,r=c.exec(a);return l<a.length?o.push(a.substring(l,a.length)):o.push(""),o},k.exports.WhitespacePattern=p},function(k){function I(_,v){this._input=_,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,v&&(this._starting_pattern=this._input.get_regexp(v._starting_pattern,!0),this._match_pattern=this._input.get_regexp(v._match_pattern,!0),this._until_pattern=this._input.get_regexp(v._until_pattern),this._until_after=v._until_after)}I.prototype.read=function(){var _=this._input.read(this._starting_pattern);return(!this._starting_pattern||_)&&(_+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),_},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(_){var v=this._create();return v._until_after=!0,v._until_pattern=this._input.get_regexp(_),v._update(),v},I.prototype.until=function(_){var v=this._create();return v._until_after=!1,v._until_pattern=this._input.get_regexp(_),v._update(),v},I.prototype.starting_with=function(_){var v=this._create();return v._starting_pattern=this._input.get_regexp(_,!0),v._update(),v},I.prototype.matching=function(_){var v=this._create();return v._match_pattern=this._input.get_regexp(_,!0),v._update(),v},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},k.exports.Pattern=I},function(k){function I(_,v){_=typeof _=="string"?_:_.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+v,"g")}I.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(_);p;)v[p[1]]=p[2],p=this.__directive_pattern.exec(_);return v},I.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=I},function(k,I,_){var v=_(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(a,l){v.call(this,a,l),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var o=new v(a);this.__patterns={handlebars_comment:o.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:o.starting_with(/{{{/).until_after(/}}}/),handlebars:o.starting_with(/{{/).until_after(/}}/),php:o.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new v,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(a){var l=this._create();return l._disabled[a]=!0,l._update(),l},c.prototype.read_options=function(a){var l=this._create();for(var o in p)l._disabled[o]=a.templating.indexOf(o)===-1;return l._update(),l},c.prototype.exclude=function(a){var l=this._create();return l._excluded[a]=!0,l._update(),l},c.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 l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),a+=l,l=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},c.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("|")+")")},c.prototype._read_template=function(){var a="",l=this._input.peek();if(l==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(a=a||this.__patterns.erb.read())}else l==="{"&&(!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},k.exports.TemplatablePattern=c}],D={};function H(k){var I=D[k];if(I!==void 0)return I.exports;var _=D[k]={exports:{}};return B[k](_,_.exports,H),_.exports}var F=H(0);N=F})();var J=N;!(te=[],Q=function(){return{js_beautify:J}}.apply(Ne,te),Q!==void 0&&(qe.exports=Q))})()},"6eGT":function(qe,Ne,K){"use strict";function te(Q){return null}Ne.a=te},"7Cbv":function(qe,Ne,K){"use strict";var te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function N(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Q)}var J=/^(?:[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 B(p){return typeof p=="string"&&J.test(p)}for(var D=B,H=[],F=0;F<256;++F)H.push((F+256).toString(16).substr(1));function k(p){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(H[p[c+0]]+H[p[c+1]]+H[p[c+2]]+H[p[c+3]]+"-"+H[p[c+4]]+H[p[c+5]]+"-"+H[p[c+6]]+H[p[c+7]]+"-"+H[p[c+8]]+H[p[c+9]]+"-"+H[p[c+10]]+H[p[c+11]]+H[p[c+12]]+H[p[c+13]]+H[p[c+14]]+H[p[c+15]]).toLowerCase();if(!D(a))throw TypeError("Stringified UUID is invalid");return a}var I=k;function _(p,c,a){p=p||{};var l=p.random||(p.rng||N)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,c){a=a||0;for(var o=0;o<16;++o)c[a+o]=l[o];return c}return I(l)}var v=Ne.a=_},"7ZXX":function(qe,Ne,K){qe.exports=K.p+"static/err.6e7c5817.png"},"7ahc":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return R});var te=K("k1fw"),Q=K("0Owb"),N=K("+L6B"),J=K("2/Rp"),B=K("y8nQ"),D=K("Vl3Y"),H=K("tJVT"),F=K("OaEy"),k=K("2fM7"),I=K("q1tI"),_=K.n(I),v=K("VrN/"),p=K.n(v),c=K("p77/"),a=K.n(c),l=K("c5Ni"),o=K.n(l),r=k.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};Ne.b=function(A){var T=A.callback,w=A.onCancel,C=Object(I.useState)("python"),b=Object(H.a)(C,2),m=b[0],h=b[1];function u(g){h(d[g][1])}function x(g){T(g)}return _.a.createElement(D.a,Object(Q.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:x}),_.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},_.a.createElement(k.a,{onChange:u},Object.keys(d).map(function(g){return _.a.createElement(r,{key:g,value:g},d[g][0])}))),_.a.createElement(D.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},_.a.createElement(R,{mode:m})),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(J.a,{type:"ghost",onClick:w},"\u53D6\u6D88")))};function R(A){var T=A.value,w=A.onChange,C=A.mode,b=A.options,m=b===void 0?{}:b,h=Object(I.useRef)(),u=Object(I.useState)(),x=Object(H.a)(u,2),g=x[0],y=x[1];return Object(I.useEffect)(function(){if(g){function M(E){var j=E.getValue();w&&w(j)}return g.on("change",M),function(){g.off("change",M)}}},[g,w]),Object(I.useEffect)(function(){g&&g.setOption("mode",C)},[g,C]),Object(I.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(I.useEffect)(function(){if(h.current&&!g){var M=p.a.fromTextArea(h.current,Object(te.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},m));y(M)}},[h.current,g]),_.a.createElement("div",{className:"my-codemirror-container"},_.a.createElement("textarea",{ref:h}))}},"7ixt":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return N});var te={adjustX:1,adjustY:1},Q=[0,0],N={left:{points:["cr","cl"],overflow:te,offset:[-4,0],targetOffset:Q},right:{points:["cl","cr"],overflow:te,offset:[4,0],targetOffset:Q},top:{points:["bc","tc"],overflow:te,offset:[0,-4],targetOffset:Q},bottom:{points:["tc","bc"],overflow:te,offset:[0,4],targetOffset:Q},topLeft:{points:["bl","tl"],overflow:te,offset:[0,-4],targetOffset:Q},leftTop:{points:["tr","tl"],overflow:te,offset:[-4,0],targetOffset:Q},topRight:{points:["br","tr"],overflow:te,offset:[0,-4],targetOffset:Q},rightTop:{points:["tl","tr"],overflow:te,offset:[4,0],targetOffset:Q},bottomRight:{points:["tr","br"],overflow:te,offset:[0,4],targetOffset:Q},rightBottom:{points:["bl","br"],overflow:te,offset:[4,0],targetOffset:Q},bottomLeft:{points:["tl","bl"],overflow:te,offset:[0,4],targetOffset:Q},leftBottom:{points:["br","bl"],overflow:te,offset:[-4,0],targetOffset:Q}},J=N},"7v3h":function(qe,Ne,K){qe.exports=K.p+"static/empty2.dd73f390.png"},"8/bI":function(qe,Ne,K){qe.exports=K.p+"static/empty.8918e228.png"},"815F":function(qe,Ne,K){"use strict";K.d(Ne,"e",function(){return H}),K.d(Ne,"c",function(){return k}),K.d(Ne,"d",function(){return I}),K.d(Ne,"a",function(){return v}),K.d(Ne,"f",function(){return p}),K.d(Ne,"b",function(){return c});var te=K("KQm4"),Q=K("VTBJ"),N=K("Ff2n"),J=K("Zm9Q"),B=K("Kwbf"),D=K("OZM5");function H(a,l){return a!=null?a:l}function F(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function o(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(d){var R=d.key,A=d.children;Object(B.a)(R!=null,"Tree node must have a certain key: [".concat(s).concat(R,"]"));var T=String(R);Object(B.a)(!l.has(T)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(T)),l.set(T,!0),o(A,"".concat(s).concat(T," > "))})}o(a)}function k(a){function l(o){var r=Object(J.a)(o);return r.map(function(s){if(!Object(D.i)(s))return Object(B.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var d=s.key,R=s.props,A=R.children,T=Object(N.a)(R,["children"]),w=Object(Q.a)({key:d},T),C=l(A);return C.length&&(w.children=C),w}).filter(function(s){return s})}return l(a)}function I(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=new Set(l===!0?[]:l),r=[];function s(d){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return d.map(function(A,T){var w=Object(D.h)(R?R.pos:"0",T),C=H(A.key,w),b=Object(Q.a)(Object(Q.a)({},A),{},{parent:R,pos:w,children:null,data:A,isStart:[].concat(Object(te.a)(R?R.isStart:[]),[T===0]),isEnd:[].concat(Object(te.a)(R?R.isEnd:[]),[T===d.length-1])});return r.push(b),l===!0||o.has(C)?b.children=s(A.children||[],b):b.children=[],b})}return s(a),r}function _(a,l,o){var r;o?typeof o=="string"?r=function(R){return R[o]}:typeof o=="function"&&(r=function(R){return o(R)}):r=function(R,A){return H(R.key,A)};function s(d,R,A){var T=d?d.children:a,w=d?Object(D.h)(A.pos,R):"0";if(d){var C=r(d,w),b={node:d,index:R,pos:w,key:C,parentPos:A.node?A.pos:null,level:A.level+1};l(b)}T&&T.forEach(function(m,h){s(m,h,{node:d,pos:w,level:A?A.level+1:-1})})}s(null)}function v(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=l.initWrapper,r=l.processEntity,s=l.onProcessFinished,d=arguments.length>2?arguments[2]:void 0,R={},A={},T={posEntities:R,keyEntities:A};return o&&(T=o(T)||T),_(a,function(w){var C=w.node,b=w.index,m=w.pos,h=w.key,u=w.parentPos,x=w.level,g={node:C,index:b,key:h,pos:m,level:x},y=H(h,m);R[m]=g,A[y]=g,g.parent=R[u],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),r&&r(g,T)},d),s&&s(T),T}function p(a,l){var o=l.expandedKeys,r=l.selectedKeys,s=l.loadedKeys,d=l.loadingKeys,R=l.checkedKeys,A=l.halfCheckedKeys,T=l.dragOverNodeKey,w=l.dropPosition,C=l.keyEntities,b=C[a],m={eventKey:a,expanded:o.indexOf(a)!==-1,selected:r.indexOf(a)!==-1,loaded:s.indexOf(a)!==-1,loading:d.indexOf(a)!==-1,checked:R.indexOf(a)!==-1,halfChecked:A.indexOf(a)!==-1,pos:String(b?b.pos:""),dragOver:T===a&&w===0,dragOverGapTop:T===a&&w===-1,dragOverGapBottom:T===a&&w===1};return m}function c(a){var l=a.data,o=a.expanded,r=a.selected,s=a.checked,d=a.loaded,R=a.loading,A=a.halfChecked,T=a.dragOver,w=a.dragOverGapTop,C=a.dragOverGapBottom,b=a.pos,m=a.active,h=Object(Q.a)(Object(Q.a)({},l),{},{expanded:o,selected:r,checked:s,loaded:d,loading:R,halfChecked:A,dragOver:T,dragOverGapTop:w,dragOverGapBottom:C,pos:b,active:m});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(B.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),h}},"8EBN":function(qe,Ne,K){(function(te){te(K("VrN/"))})(function(te){"use strict";te.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 Q=0;Q<te.modeInfo.length;Q++){var N=te.modeInfo[Q];N.mimes&&(N.mime=N.mimes[0])}te.findModeByMIME=function(J){J=J.toLowerCase();for(var B=0;B<te.modeInfo.length;B++){var D=te.modeInfo[B];if(D.mime==J)return D;if(D.mimes){for(var H=0;H<D.mimes.length;H++)if(D.mimes[H]==J)return D}}if(/\+xml$/.test(J))return te.findModeByMIME("application/xml");if(/\+json$/.test(J))return te.findModeByMIME("application/json")},te.findModeByExtension=function(J){J=J.toLowerCase();for(var B=0;B<te.modeInfo.length;B++){var D=te.modeInfo[B];if(D.ext){for(var H=0;H<D.ext.length;H++)if(D.ext[H]==J)return D}}},te.findModeByFileName=function(J){for(var B=0;B<te.modeInfo.length;B++){var D=te.modeInfo[B];if(D.file&&D.file.test(J))return D}var H=J.lastIndexOf("."),F=H>-1&&J.substring(H+1,J.length);if(F)return te.findModeByExtension(F)},te.findModeByName=function(J){J=J.toLowerCase();for(var B=0;B<te.modeInfo.length;B++){var D=te.modeInfo[B];if(D.name.toLowerCase()==J)return D;if(D.alias){for(var H=0;H<D.alias.length;H++)if(D.alias[H].toLowerCase()==J)return D}}}})},"8hTe":function(qe,Ne,K){qe.exports={button:"button___1wy9m"}},"9Bee":function(qe,Ne,K){"use strict";var te=K("DYRE"),Q=K("zeV3"),N=K("+L6B"),J=K("2/Rp"),B=K("k1fw"),D=K("9og8"),H=K("tJVT"),F=K("WmNS"),k=K.n(F),I=K("q1tI"),_=K.n(I),v=K("vg9a"),p=K("DlQD"),c=K.n(p),a=K("rUJ1");function l(V,S){var L=V.match(/^(\s+)(?:```)/);if(L===null)return S;var W=L[1];return S.split(`
`).map(function(ee){var Y=ee.match(/^\s+/);if(Y===null)return ee;var Ae=Object(H.a)(Y,1),at=Ae[0];return at.length>=W.length?ee.slice(W.length):ee}).join(`
`)}var o=[],r=["<ul>"],s=new c.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){o.length=0,r=["<ul>"]}var A={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(V,S,L,W){if(S>=V.length||V[S].level<=L)return S;var ee=V[S];W.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),S++;var Y=[];return S=T(V,S,ee.level,Y),Y.length>0&&(W.push("<ul>"),Y.forEach(function(Ae){W.push(Ae)}),W.push("</ul>")),W.push("</li>"),S=T(V,S,L,W),S}function w(){return T(o,0,0,r),r.push("</ul>"),r.join("")}var C={heading:function(S){var L=d.exec(S);if(L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences:function(S){var L=this.rules.block.fences.exec(S);if(L){var W=L[0],ee=l(W,L[3]||""),Y=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(Y)>=0){var Ae=h(),at=ee;ee=Ae,u[Ae]={type:"block",expression:at}}return{type:"code",raw:W,lang:Y,text:ee}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,m=0,h=function(){return"__special_katext_id_".concat(m++,"__")},u={};function x(){return u}function g(){m=0,u={}}function y(V){return V=V.replace(b,function(S,L){var W=h();return u[W]={type:"inline",expression:L},W}),V}var M=s.listitem;s.listitem=function(V){return M(y(V))};var E=s.paragraph;s.paragraph=function(V){return E(y(V))};var j=s.tablecell;s.tablecell=function(V,S){return j(y(V),S)},s.code=function(V,S,L){var W=(S||"").match(/\S*/)[0];return W?["latex","katex","math"].indexOf(W)>=0?"<p class='editormd-tex'>".concat(V,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(S,'">').concat(L?V:Object(a.escape)(V,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(L?V:Object(a.escape)(V,!0))+"</code></pre>"},s.heading=function(V,S,L){var W=this.options.headerPrefix+L.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:W,level:S,text:V}),"<h"+S+' id="'+W+'">'+V+"</h"+S+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:C,renderer:s});var G=c.a,U=K("SJMd"),O=K("ulZh"),X=K.n(O),$=K("m3rI"),se=K("Oy/b"),ce=K("p5ED"),Pe=K("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Se=function(V,S){return(Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(L[ee]=W[ee])})(V,S)};function Re(V,S){function L(){this.constructor=V}Se(V,S),V.prototype=S===null?Object.create(S):(L.prototype=S.prototype,new L)}function Oe(V,S,L,W){return new(L||(L=Promise))(function(ee,Y){function Ae(Bt){try{St(W.next(Bt))}catch(pe){Y(pe)}}function at(Bt){try{St(W.throw(Bt))}catch(pe){Y(pe)}}function St(Bt){var pe;Bt.done?ee(Bt.value):(pe=Bt.value,pe instanceof L?pe:new L(function(Pt){Pt(pe)})).then(Ae,at)}St((W=W.apply(V,S||[])).next())})}function Me(V,S){var L,W,ee,Y,Ae={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function at(St){return function(Bt){return function(pe){if(L)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(L=1,W&&(ee=2&pe[0]?W.return:pe[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,pe[1])).done)return ee;switch(W=0,ee&&(pe=[2&pe[0],ee.value]),pe[0]){case 0:case 1:ee=pe;break;case 4:return Ae.label++,{value:pe[1],done:!1};case 5:Ae.label++,W=pe[1],pe=[0];continue;case 7:pe=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ee=Ae.trys,(ee=ee.length>0&&ee[ee.length-1])||pe[0]!==6&&pe[0]!==2)){Ae=0;continue}if(pe[0]===3&&(!ee||pe[1]>ee[0]&&pe[1]<ee[3])){Ae.label=pe[1];break}if(pe[0]===6&&Ae.label<ee[1]){Ae.label=ee[1],ee=pe;break}if(ee&&Ae.label<ee[2]){Ae.label=ee[2],Ae.ops.push(pe);break}ee[2]&&Ae.ops.pop(),Ae.trys.pop();continue}pe=S.call(V,Ae)}catch(Pt){pe=[6,Pt],W=0}finally{L=ee=0}if(5&pe[0])throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}([St,Bt])}}}function be(){for(var V=0,S=0,L=arguments.length;S<L;S++)V+=arguments[S].length;var W=Array(V),ee=0;for(S=0;S<L;S++)for(var Y=arguments[S],Ae=0,at=Y.length;Ae<at;Ae++,ee++)W[ee]=Y[Ae];return W}var ue=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(S,L){for(var W=0,ee=L;W<ee.length;W++){var Y=ee[W],Ae=Y[0],at=Y[1];S.setAttribute(Ae,at)}},V.createRect=function(S,L,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",S.toString()),ee.setAttribute("height",L.toString()),W&&V.setAttributes(ee,W),ee},V.createLine=function(S,L,W,ee,Y){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",S.toString()),Ae.setAttribute("y1",L.toString()),Ae.setAttribute("x2",W.toString()),Ae.setAttribute("y2",ee.toString()),Y&&V.setAttributes(Ae,Y),Ae},V.createPolygon=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",S),L&&V.setAttributes(W,L),W},V.createCircle=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(S/2).toString()),W.setAttribute("cy",(S/2).toString()),W.setAttribute("r",S.toString()),L&&V.setAttributes(W,L),W},V.createEllipse=function(S,L,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(S/2).toString()),ee.setAttribute("cy",(L/2).toString()),ee.setAttribute("rx",(S/2).toString()),ee.setAttribute("ry",(L/2).toString()),W&&V.setAttributes(ee,W),ee},V.createGroup=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&V.setAttributes(L,S),L},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(S,L,W,ee,Y,Ae,at){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(St,[["id",S],["orient",L],["markerWidth",W.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ae.toString()]]),St.appendChild(at),St},V.createText=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),S&&V.setAttributes(L,S),L},V.createTSpan=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=S,L&&V.setAttributes(W,L),W},V.createImage=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&V.setAttributes(L,S),L},V.createPoint=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=S,W.y=L,W},V.createPath=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",S),L&&V.setAttributes(W,L),W},V}(),ne=function(){function V(){}return V.addKey=function(S){V.key=S},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),ve=function(){function V(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return V.prototype.rasterize=function(S,L,W){var ee=this;return new Promise(function(Y){var Ae=W!==void 0?W:document.createElement("canvas");S===null&&(ee.markersOnly=!0,ee.naturalSize=!1);var at=document.createElementNS("http://www.w3.org/2000/svg","svg");at.setAttribute("xmlns","http://www.w3.org/2000/svg"),at.setAttribute("width",L.width.baseVal.valueAsString),at.setAttribute("height",L.height.baseVal.valueAsString),at.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),at.innerHTML=L.innerHTML,ee.naturalSize===!0?(at.width.baseVal.value=S.naturalWidth,at.height.baseVal.value=S.naturalHeight):ee.width!==void 0&&ee.height!==void 0&&(at.width.baseVal.value=ee.width,at.height.baseVal.value=ee.height),Ae.width=at.width.baseVal.value,Ae.height=at.height.baseVal.value;var St=at.outerHTML,Bt=Ae.getContext("2d");ee.markersOnly!==!0&&Bt.drawImage(S,0,0,Ae.width,Ae.height);var pe=window.URL,Pt=new Image(Ae.width,Ae.height);Pt.setAttribute("crossOrigin","anonymous");var qt=new Blob([St],{type:"image/svg+xml"}),Tn=pe.createObjectURL(qt);Pt.onload=function(){Bt.drawImage(Pt,0,0),pe.revokeObjectURL(Tn);var Hn=Ae.toDataURL(ee.imageType,ee.imageQuality);Y(Hn)},Pt.src=Tn})},V}(),le=function(){},ke=function(){function V(S){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},V.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new Fe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Fe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ie("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ie("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},V.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),Fe=function(V,S){this.selector=V,this.style=S},Ie=function(V,S){this.localName=V,this.style=S},He=function(){function V(S,L,W,ee,Y){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=S,this.displayMode=L,this.markerItems=W,this.uiStyleSettings=ee,this.styles=Y,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return V.prototype.show=function(S){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var W=document.createElement("div");W.className=this.toolbarBlockStyleClass.name,W.style.whiteSpace="nowrap",this.uiContainer.appendChild(W),this.addActionButton(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(W,'<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(Y){var Ae=document.createElement("div");Ae.className=""+L.toolbarButtonStyleClass.name,Ae.setAttribute("data-type-name",Y.typeName),Ae.innerHTML=Y.icon,Ae.addEventListener("click",function(){L.markerToolbarButtonClicked(Ae,Y)}),L.buttons.push(Ae),L.markerButtons.push(Ae)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'<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(ee,'<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()},V.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},V.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<S||L===S&&this.markerButtons.length-1===S?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===S&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},V.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")},V.prototype.resetButtonStyles=function(){var S=this;this.buttons.forEach(function(L){L.className=L.className.replace(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:S.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name)})},V.prototype.addActionButton=function(S,L,W){var ee=this,Y=document.createElement("div");switch(Y.className=""+this.toolbarButtonStyleClass.name,Y.innerHTML=L,Y.setAttribute("data-action",W),Y.addEventListener("click",function(){ee.actionToolbarButtonClicked(Y,W)}),W){case"select":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Y.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Y.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Y.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Y.style.fill=this.uiStyleSettings.closeButtonColor}S.appendChild(Y),this.buttons.push(Y)},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ie("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 Ie("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ie("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ie("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 Ie("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ie("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
padding: `+S+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Fe("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},V.prototype.markerToolbarButtonClicked=function(S,L){this.setActiveButton(S),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(S,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(W){return W("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(S){var L=this.markerButtons.find(function(W){return W.getAttribute("data-type-name")===S});L&&this.setActiveButton(L)},V.prototype.setCurrentMarker=function(S){var L=this;this.currentMarker=S,this.buttons.filter(function(W){return/delete|notes/.test(W.getAttribute("data-action"))}).forEach(function(W){L.currentMarker===void 0?(W.style.fillOpacity="0.4",W.style.pointerEvents="none"):(W.style.fillOpacity="1",W.style.pointerEvents="all")})},V}(),$e=function(){function V(S,L,W,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=L,this.uiStyleSettings=W,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new Ie("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 Ie("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ie("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ie("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ie("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 Ie("toolbox-panel-row_colors",`
background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ie("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ie("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Fe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},V.prototype.show=function(S){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(S){var L,W,ee=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((W=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&W!==void 0?W:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Ae;Y.uiStyleSettings=ee.uiStyleSettings;var at=document.createElement("div");at.className=ee.toolboxButtonStyleClass.name+" "+((Ae=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:ee.toolboxButtonStyleColorsClass.name),at.innerHTML=Y.icon,at.title=Y.title,at.addEventListener("click",function(){ee.panelButtonClick(Y)}),ee.panelButtons.push(at),ee.buttonRow.appendChild(at)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(S){var L=this,W=-1;if(S!==this.activePanel){W=this.panels.indexOf(S),this.panelRow.innerHTML="";var ee=S.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Ae){var at,St;Y.className=L.toolboxButtonStyleClass.name+" "+(Ae===W?""+((at=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&at!==void 0?at:L.toolboxActiveButtonStyleColorsClass.name):""+((St=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&St!==void 0?St:L.toolboxButtonStyleColorsClass.name))})},V}(),tt=function(V,S){this.title=V,this.icon=S},Qe=function(V){function S(L,W,ee,Y){var Ae=V.call(this,L,Y||'<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 Ae.colors=[],Ae.addTransparent=!1,Ae.colorBoxes=[],Ae.colors=W,Ae.currentColor=ee,Ae.setCurrentColor=Ae.setCurrentColor.bind(Ae),Ae.getColorBox=Ae.getColorBox.bind(Ae),Ae}return Re(S,V),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var Y=L.getColorBox(ee);W.appendChild(Y),L.colorBoxes.push(Y)}),W},S.prototype.getColorBox=function(L){var W=this,ee=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-ee,Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.boxSizing="content-box",Ae.style.width=Y-2+"px",Ae.style.height=Y-2+"px",Ae.style.padding="1px",Ae.style.marginRight="2px",Ae.style.marginBottom="2px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderRadius=(Y+2)/2+"px",Ae.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){W.setCurrentColor(L,Ae)});var at=document.createElement("div");return at.style.display="inline-block",at.style.width=Y-2+"px",at.style.height=Y-2+"px",at.style.backgroundColor=L,at.style.borderRadius=Y/2+"px",L==="transparent"&&(at.style.fill=this.uiStyleSettings.toolboxAccentColor,at.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>`),Ae.appendChild(at),Ae},S.prototype.setCurrentColor=function(L,W){var ee=this;this.currentColor=L,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},S}(tt),Je=function(){function V(S,L,W){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=L,this.globalSettings=W,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(S){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(S,L){},V.prototype.dblClick=function(S,L){},V.prototype.manipulate=function(S){},V.prototype.pointerUp=function(S){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},V.prototype.scale=function(S,L){},V.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},V.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),Ye=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},V}(),gt=function(){function V(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},V}(),_t=function(){function V(){}return V.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},V.toSVGMatrix=function(S,L){return S.a=L.a,S.b=L.b,S.c=L.c,S.d=L.d,S.e=L.e,S.f=L.f,S},V}(),vt=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ue.createTransform()),Y.setupControlBox(),Y}return Re(S,V),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var W=ue.createTransform();this._visual.transform.baseVal.appendItem(W)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(L){return!!V.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(L);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(W),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(W)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ae=this.container.transform.baseVal.getItem(0);Ae.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ae,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},S.prototype.pointerUp=function(L){var W=this.state;V.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",W==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},S.prototype.manipulate=function(L){var W=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(W.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(W.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(W):this.state==="rotate"&&this.rotate(L)},S.prototype.resize=function(L){var W=this.manipulationStartLeft,ee=this.manipulationStartWidth,Y=this.manipulationStartTop,Ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:W=this.manipulationStartLeft+L.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-W;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+L.y-this.manipulationStartY,Ae=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ae=this.manipulationStartHeight+L.y-this.manipulationStartY}ee>=0?(this.left=W,this.width=ee):(this.left=W+ee,this.width=-ee),Ae>=0?(this.top=Y,this.height=Ae):(this.top=Y+Ae,this.height=-Ae),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var W=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*W,this.applyRotation()}},S.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},S.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var W=this.container.getCTM(),ee=ue.createPoint(L.x,L.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},S.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var W=this.container.getCTM();W=W.inverse();var ee=ue.createPoint(L.x,L.y);return{x:(ee=ee.matrixTransform(W)).x,y:ee.y}},S.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var L=ue.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=ue.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=ue.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ye,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,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()},S.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()},S.prototype.createGrip=function(){var L=new gt;return L.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(L.visual),L},S.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,W=-L/2,ee=W,Y=(this.width+this.CB_DISTANCE)/2-L/2,Ae=(this.height+this.CB_DISTANCE)/2-L/2,at=this.height+this.CB_DISTANCE-L/2,St=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,W,ee),this.positionGrip(this.controlGrips.topCenter.visual,Y,ee),this.positionGrip(this.controlGrips.topRight.visual,St,ee),this.positionGrip(this.controlGrips.centerLeft.visual,W,Ae),this.positionGrip(this.controlGrips.centerRight.visual,St,Ae),this.positionGrip(this.controlGrips.bottomLeft.visual,W,at),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,at),this.positionGrip(this.controlGrips.bottomRight.visual,St,at),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,ee-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(L,W,ee){var Y=L.transform.baseVal.getItem(0);Y.setTranslate(W,ee),L.transform.baseVal.replaceItem(Y,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:_t.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:_t.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},S.prototype.restoreState=function(L){V.prototype.restoreState.call(this,L);var W=L;this.left=W.left,this.top=W.top,this.width=W.width,this.height=W.height,this.rotationAngle=W.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(_t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,W.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(_t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,W.containerTransformMatrix))},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W);var ee=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:ee.x*L,y:ee.y*W});this.left=Y.x,this.top=Y.y,this.width=this.width*L,this.height=this.height*W,this.adjustControlBox()},S}(Je),dt=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.visual)},S.prototype.createVisual=function(){this.visual=ue.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.manipulate=function(L){V.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){V.prototype.resize.call(this,L),this.setSize()},S.prototype.setSize=function(){V.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(L){V.prototype.pointerUp.call(this,L),this.setSize()},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},S.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},S.prototype.restoreState=function(L){var W=L;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),V.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W),this.setSize()},S.title="Rectangle marker",S}(vt),Ct=function(V){function S(L,W,ee,Y){var Ae=V.call(this,L,Y||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ae.widths=[],Ae.widthBoxes=[],Ae.widths=W,Ae.currentWidth=ee,Ae.setCurrentWidth=Ae.setCurrentWidth.bind(Ae),Ae}return Re(S,V),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.widths.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){L.setCurrentWidth(ee,Y)}),W.appendChild(Y);var Ae=document.createElement("div");Ae.innerText=ee.toString(),Ae.style.marginRight="5px",Y.appendChild(Ae);var at=document.createElement("div");at.style.minHeight="20px",at.style.flexGrow="2",at.style.display="flex",at.style.alignItems="center";var St=document.createElement("hr");St.style.minWidth="20px",St.style.border="0px",St.style.borderTop=ee+"px solid "+L.uiStyleSettings.toolboxColor,St.style.flexGrow="2",at.appendChild(St),Y.appendChild(at),L.widthBoxes.push(Y)}),W},S.prototype.setCurrentWidth=function(L,W){var ee=this;this.currentWidth=L,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(tt),xt=function(V){function S(L,W,ee,Y){var Ae=V.call(this,L,Y||'<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 Ae.styles=[],Ae.styleBoxes=[],Ae.styles=W,Ae.currentStyle=ee,Ae.setCurrentStyle=Ae.setCurrentStyle.bind(Ae),Ae}return Re(S,V),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",this.styles.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/L.styles.length-5+"%",Y.style.borderColor=ee===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){L.setCurrentStyle(ee,Y)}),W.appendChild(Y);var Ae=document.createElement("div");Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.overflow="hidden";var at=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ee!==""?'stroke-dasharray="'+ee+'"':"")+` />
</svg>`;Ae.innerHTML=at,Y.appendChild(Ae),L.styleBoxes.push(Y)}),W},S.prototype.setCurrentStyle=function(L,W){var ee=this;this.currentStyle=L,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(tt),Le=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Qe("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return Re(S,V),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=V.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="FrameMarker",S.title="Frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',S}(dt),Ce=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},nt=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!!V.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.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(W)?this.activeGrip=this.grip1:this.grip2.ownsTarget(W)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(L){var W=this.state;V.prototype.pointerUp.call(this,L),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(L),this._state="select",W==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},S.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var L=new gt;return L.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(L.visual),L},S.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},S.prototype.positionGrip=function(L,W,ee){var Y=L.transform.baseVal.getItem(0);Y.setTranslate(W,ee),L.transform.baseVal.replaceItem(Y,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},S.prototype.restoreState=function(L){V.prototype.restoreState.call(this,L);var W=L;this.x1=W.x1,this.y1=W.y1,this.x2=W.x2,this.y2=W.y2},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W),this.x1=this.x1*L,this.y1=this.y1*W,this.x2=this.x2*L,this.y2=this.y2*W,this.adjustVisual(),this.adjustControlBox()},S}(Je),rt=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Qe("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){V.prototype.restoreState.call(this,L);var W=L;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',S}(nt),Be=function(V){function S(L,W,ee,Y){var Ae=V.call(this,L,Y||'<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 Ae.fonts=[],Ae.fontBoxes=[],Ae.fonts=W,Ae.currentFont=ee,Ae.setCurrentFont=Ae.setCurrentFont.bind(Ae),Ae}return Re(S,V),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.overflow="hidden",W.style.flexGrow="2",this.fonts.forEach(function(ee){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/L.fonts.length-5+"%",Y.style.borderColor=ee===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){L.setCurrentFont(ee,Y)}),W.appendChild(Y);var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.fontFamily=ee,Ae.style.overflow="hidden";var at=document.createElement("div");at.style.whiteSpace="nowrap",at.style.overflow="hidden",at.style.textOverflow="ellipsis",at.innerHTML="The quick brown fox jumps over the lazy dog",Ae.appendChild(at),Y.appendChild(Ae),L.fontBoxes.push(Y)}),W},S.prototype.setCurrentFont=function(L,W){var ee=this;this.currentFont=L,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(tt),et=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=ee.defaultColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new Qe("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new Be("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return Re(S,V),S.prototype.ownsTarget=function(L){if(V.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var W=!1;return this.textElement.childNodes.forEach(function(ee){ee===L&&(W=!0)}),W},S.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.renderText=function(){var L=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(W){L.textElement.appendChild(ue.createTSpan(W.trim()===""?" ":W.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var L=this.textElement.getBBox(),W=1;if(L.width>0&&L.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/L.width,Y=(1*this.height-this.height*this.padding*2/100)/L.height;W=Math.min(ee,Y)}return W},S.prototype.getTextPosition=function(L){var W=this.textElement.getBBox(),ee=0,Y=0;return W.width>0&&W.height>0&&(ee=(this.width-W.width*L)/2,Y=this.height/2-W.height*L/2),{x:ee,y:Y}},S.prototype.sizeText=function(){var L=this.textElement.getBBox(),W=this.getTextScale(),ee=this.getTextPosition(W);ee.y-=L.y*W,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+W+", "+W+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(W,W))},S.prototype.manipulate=function(L){V.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(L){V.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},S.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(L){var W=this.state;W==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,L),this.setSize(),(W==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var L=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(W){W.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var W=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&W>.9;)W-=.1,L.textEditor.style.fontSize=Math.max(W,.9)+"em"}),this.textEditor.addEventListener("keyup",function(W){W.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(W){if(W.clipboardData){var ee=W.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(ee)),W.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),W=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),Y={x:ee.width*L,y:ee.height*L};W.x-=Y.x/2,W.y-=Y.y/2,this.textEditor.style.top=W.y+"px",this.textEditor.style.left=W.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-W.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},S.prototype.dblClick=function(L,W){V.prototype.dblClick.call(this,L,W),this.showTextEditor()},S.prototype.setColor=function(L){this.textElement&&ue.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},S.prototype.setFont=function(L){this.textElement&&ue.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.color=W.color,this.fontFamily=W.fontFamily,this.padding=W.padding,this.text=W.text,this.createVisual(),V.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.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>',S}(vt),xe=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=ee.defaultColor,Y.lineWidth=ee.defaultStrokeWidth,Y.pixelRatio=ee.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new Qe("Color",ee.defaultColorSet,ee.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var L=ue.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){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(L.x,L.y),this.drawing=!0):V.prototype.pointerDown.call(this,L,W)},S.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){V.prototype.resize.call(this,L),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,L)},S.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)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),W=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=W[0],Y=W[1],Ae=W[2],at=W[3],St=!1,Bt=0;Bt<this.canvasElement.height;Bt++)for(var pe=0;pe<this.canvasElement.width;pe++)L.data[Bt*this.canvasElement.width*4+4*pe+3]>0&&(St=!0,Bt<Y&&(Y=Bt),pe<ee&&(ee=pe),Bt>at&&(at=Bt),pe>Ae&&(Ae=pe));if(St){this.left=ee/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Ae-ee)/this.pixelRatio,this.height=(at-Y)/this.pixelRatio;var Pt=document.createElement("canvas");Pt.width=Ae-ee,Pt.height=at-Y,Pt.getContext("2d").putImageData(this.canvasContext.getImageData(ee,Y,Ae-ee,at-Y),0,0),this.drawingImgUrl=Pt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},S.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){this.createVisual(),V.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.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>',S}(vt),fe=function(V){function S(L,W,ee){var Y=V.call(this,L,ee||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Y.typeBoxes=[],Y.currentType=W,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return Re(S,V),S.prototype.getUi=function(){var L=this,W=document.createElement("div");W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2";for(var ee=function(at){var St="both";switch(at){case 0:St="both";break;case 1:St="start";break;case 2:St="end";break;case 3:St="none"}var Bt=document.createElement("div");if(Bt.style.display="flex",Bt.style.flexGrow="2",Bt.style.alignItems="center",Bt.style.justifyContent="space-between",Bt.style.padding="5px",Bt.style.borderWidth="2px",Bt.style.borderStyle="solid",Bt.style.borderColor=St===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",Bt.addEventListener("click",function(){L.setCurrentType(St,Bt)}),W.appendChild(Bt),St==="both"||St==="start"){var pe=document.createElement("div");pe.style.display="flex",pe.style.alignItems="center",pe.style.minHeight="20px",pe.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="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,pe.style.marginLeft="5px",Bt.appendChild(pe)}var Pt=document.createElement("div");Pt.style.display="flex",Pt.style.alignItems="center",Pt.style.minHeight="20px",Pt.style.flexGrow="2";var qt=document.createElement("hr");if(qt.style.minWidth="20px",qt.style.border="0px",qt.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),qt.style.flexGrow="2",Pt.appendChild(qt),Bt.appendChild(Pt),St==="both"||St==="end"){var Tn=document.createElement("div");Tn.style.display="flex",Tn.style.alignItems="center",Tn.style.minHeight="20px",Tn.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="`+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Tn.style.marginRight="5px",Bt.appendChild(Tn)}Y.typeBoxes.push(Bt)},Y=this,Ae=0;Ae<4;Ae++)ee(Ae);return W},S.prototype.setCurrentType=function(L,W){var ee=this;this.currentType=L,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(tt),ge=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new fe("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},S.prototype.getArrowPoints=function(L,W){var ee=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return L-ee/2+","+(W+Y/2)+" "+L+","+(W-Y/2)+" "+(L+ee/2)+","+(W+Y/2)},S.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.arrow1.transform.baseVal.getItem(0);W.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(W,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},S.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){V.prototype.restoreState.call(this,L);var W=L;this.arrowType=W.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',S}(rt),re=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.fillColor=ee.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new Qe("Color",ee.defaultColorSet,ee.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return Re(S,V),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=V.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="CoverMarker",S.title="Cover marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',S}(dt),ae=function(V){function S(L,W,ee,Y){var Ae=V.call(this,L,Y||'<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 Ae.opacities=[],Ae.opacityBoxes=[],Ae.opacities=W,Ae.currentOpacity=ee,Ae.setCurrentOpacity=Ae.setCurrentOpacity.bind(Ae),Ae}return Re(S,V),S.prototype.getUi=function(){var L=this,W=document.createElement("div");return W.style.display="flex",W.style.overflow="hidden",W.style.flexGrow="2",W.style.justifyContent="space-between",this.opacities.forEach(function(ee){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=ee===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){L.setCurrentOpacity(ee,Y)}),W.appendChild(Y);var Ae=document.createElement("div");Ae.innerText=100*ee+"%",Y.appendChild(Ae),L.opacityBoxes.push(Y)}),W},S.prototype.setCurrentOpacity=function(L,W){var ee=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===W?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(tt),de=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=ee.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=ee.defaultHighlightOpacity,Y.fillPanel=new Qe("Color",ee.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return Re(S,V),S.prototype.setOpacity=function(L){this.opacity=L,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=V.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="HighlightMarker",S.title="Highlight marker",S.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>',S}(re),ye='<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>',_e=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=ee.defaultStrokeColor,Y.bgColor=ee.defaultFillColor,Y.fontFamily=ee.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new Qe("Text color",ee.defaultColorSet,Y.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>'),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new Qe("Fill color",ee.defaultColorSet,Y.bgColor,ye),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new Be("Font",ee.defaultFontFamilies,ee.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new gt,Y.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return Re(S,V),S.prototype.ownsTarget=function(L){return V.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},S.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(L,W){this.state==="new"&&V.prototype.pointerDown.call(this,L,W),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(W)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,L,W)},S.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,L);else{var W=this.state==="creating";V.prototype.pointerUp.call(this,L),this.setTipPoints(W),this.positionTip()}},S.prototype.manipulate=function(L){if(this.tipMoving){var W=this.unrotatePoint(L);this.tipPosition={x:W.x-this.manipulationStartLeft,y:W.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,L)},S.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",L]]),ue.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},S.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},S.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var W=Math.min(this.height/2,15),ee=this.height/5;L&&(this.tipPosition={x:W+ee/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:0},this.tipBase2Position={x:W+ee,y:0}):(this.tipBase1Position={x:0,y:W},this.tipBase2Position={x:0,y:W+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Y<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ee,y:0},this.tipBase2Position={x:this.width-W,y:0}):(this.tipBase1Position={x:this.width,y:W},this.tipBase2Position={x:this.width,y:W+ee}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Y<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-W-ee,y:this.height},this.tipBase2Position={x:this.width-W,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-W-ee},this.tipBase2Position={x:this.width,y:this.height-W}):Y<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ee=this.width/5,W=Math.min(this.width/2,15),this.tipBase1Position={x:W,y:this.height},this.tipBase2Position={x:W+ee,y:this.height}):(this.tipBase1Position={x:0,y:this.height-W},this.tipBase2Position={x:0,y:this.height-W-ee})},S.prototype.resize=function(L){V.prototype.resize.call(this,L),this.positionTip()},S.prototype.positionTip=function(){ue.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.select=function(){this.positionTip(),V.prototype.select.call(this)},S.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.bgColor=W.bgColor,this.tipPosition=W.tipPosition,V.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*W},this.positionTip()},S.typeName="CalloutMarker",S.title="Callout marker",S.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>',S}(et),je=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.fillColor=ee.defaultFillColor,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.setOpacity=Y.setOpacity.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y.strokePanel=new Qe("Line color",be(ee.defaultColorSet,["transparent"]),ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.fillPanel=new Qe("Fill color",be(ee.defaultColorSet,["transparent"]),Y.fillColor,ye),Y.fillPanel.onColorChanged=Y.setFillColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.visual)},S.prototype.createVisual=function(){this.visual=ue.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},S.prototype.manipulate=function(L){V.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){V.prototype.resize.call(this,L),this.setSize()},S.prototype.setSize=function(){V.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},S.prototype.pointerUp=function(L){V.prototype.pointerUp.call(this,L),this.setSize()},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},S.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.setOpacity=function(L){this.opacity=L,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){var W=L;this.fillColor=W.fillColor,this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.opacity=W.opacity,this.createVisual(),V.prototype.restoreState.call(this,L),this.setSize()},S.prototype.scale=function(L,W){V.prototype.scale.call(this,L,W),this.setSize()},S.typeName="EllipseMarker",S.title="Ellipse marker",S.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>',S}(vt),ot=function(V){function S(L,W,ee){return V.call(this,L,W,ee)||this}return Re(S,V),Object.defineProperty(S.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},S.prototype.createTips=function(){this.tip1=ue.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.tip2)},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),W=this.tip1.transform.baseVal.getItem(0);W.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(W,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=V.prototype.getState.call(this);return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){V.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.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>',S}(rt),bt=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.strokePanel.colors=ee.defaultColorSet,Y.fillColor="transparent",Y}return Re(S,V),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=V.prototype.getState.call(this);return L.typeName=S.typeName,L},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.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>',S}(je),wt=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),Et=function(V){function S(L,W,ee){var Y=V.call(this,L,W,ee)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=ee.defaultColor,Y.strokeWidth=ee.defaultStrokeWidth,Y.strokeDasharray=ee.defaultStrokeDasharray,Y.strokePanel=new Qe("Line color",ee.defaultColorSet,ee.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Ct("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return Re(S,V),S.prototype.ownsTarget=function(L){return!(!V.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(L,W){V.prototype.pointerDown.call(this,L,W),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(W)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/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()))},S.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),V.prototype.manipulate.call(this,L)},S.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),V.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},S.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},S.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},S.prototype.scale=function(L,W){this.curveX=this.curveX*L,this.curveY=this.curveY*W,V.prototype.scale.call(this,L,W)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return L.typeName=S.typeName,L},S.prototype.restoreState=function(L){V.prototype.restoreState.call(this,L);var W=L;this.strokeColor=W.strokeColor,this.strokeWidth=W.strokeWidth,this.strokeDasharray=W.strokeDasharray,this.curveX=W.curveX,this.curveY=W.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.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>',S}(nt),pt=function(){function V(S,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=L}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),Xe=function(V){function S(L,W,ee){var Y=V.call(this,L,!1)||this;return Y.dataUrl=W,Y.state=ee,Y}return Re(S,V),S}(pt),Ge=function(V){function S(L,W,ee){ee===void 0&&(ee=!1);var Y=V.call(this,L,ee)||this;return Y.marker=W,Y}return Re(S,V),S}(pt),De=function(){function V(){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 V.prototype.addEventListener=function(S,L){this[S].push(L)},V.prototype.removeEventListener=function(S,L){var W=this[S].indexOf(L);W>-1&&this[S].splice(W,1)},V}(),oe=function(){function V(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ce,this._isOpen=!1,this.undoRedoManager=new wt,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 De,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=V.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.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(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[Le,xe,ge,et,bt,je,de,_e,ot,re,rt,Et]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Le,xe,ge,et,je,de,_e]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Le,xe,ge,et,de]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var L=this;this._availableMarkerTypes.splice(0),S.forEach(function(W){if(typeof W=="string"){var ee=L.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===W});ee!==void 0&&L._availableMarkerTypes.push(ee)}else L._availableMarkerTypes.push(W)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&le.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=le.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new pt(S))})},V.prototype.render=function(){return Oe(this,void 0,void 0,function(){var S;return Me(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(S=new ve).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},V.prototype.close=function(S){var L=this;if(S===void 0&&(S=!1),this.isOpen){var W=!1;S||this.eventListeners.beforeclose.forEach(function(ee){var Y=new pt(L,!0);ee(Y),Y.defaultPrevented&&(W=!0)}),W||(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(ee){return ee(new pt(L))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var S,L=[],W=0;W<arguments.length;W++)L[W]=arguments[W];(S=this._availableMarkerTypes).push.apply(S,L)},V.prototype.addRenderEventListener=function(S){this.addEventListener("render",function(L){S(L.dataUrl,L.state)})},V.prototype.removeRenderEventListener=function(S){},V.prototype.addCloseEventListener=function(S){this.addEventListener("close",function(){S()})},V.prototype.removeCloseEventListener=function(S){},V.prototype.setupResizeObserver=function(){var S=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return S.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},V.prototype.onPopupTargetResize=function(){var S=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/S>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,W=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/S;this.resize(L,W)},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.prototype.resize=function(S,L){this._isResizing=!0;var W=S/this.imageWidth,ee=L/this.imageHeight;this.imageWidth=Math.round(S),this.imageHeight=Math.round(L),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(W,ee),this._isResizing=!1},V.prototype.scaleMarkers=function(S,L){var W,ee=this;this._currentMarker&&this._currentMarker instanceof et?this._currentMarker.scale(S,L):(W=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Y){Y!==ee._currentMarker&&Y.scale(S,L)}),W!==void 0&&this.setCurrentMarker(W)},V.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"},V.prototype.setTopLeft=function(){var S=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=S.left-L.left,this.top=S.top-L.top},V.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)},V.prototype.addDefs=function(){for(var S,L=[],W=0;W<arguments.length;W++)L[W]=arguments[W];this.defs=ue.createDefs(),this.addDefsToImage(),(S=this.defs).append.apply(S,L)},V.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},V.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)},V.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},V.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},V.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)},V.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},V.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)},V.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 S=document.createElement("a");S.href="https://markerjs.com/",S.target="_blank",S.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>',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.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")},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"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 He(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 $e(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},V.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.removeMarker=function(S){this.markerImage.removeChild(S.container),this.markers.indexOf(S)>-1&&this.markers.splice(this.markers.indexOf(S),1),S.dispose()},V.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())},V.prototype.toolbarButtonClicked=function(S,L){if(S==="marker"&&L!==void 0)this.createNewMarker(L);else if(S==="action")switch(L){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()}},V.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var Y=new Ge(S,S._currentMarker,!0);ee(Y),Y.defaultPrevented&&(L=!0)}),!L){var W=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(ee){return ee(new Ge(S,W))})}}},V.prototype.clear=function(){var S=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ae){var at=new Ge(S,void 0,!0);Ae(at),at.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var W=function(Ae){var at=ee.markers[Ae];ee.setCurrentMarker(ee.markers[Ae]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(St){return St(new Ge(S,at))})},ee=this,Y=this.markers.length-1;Y>=0;Y--)W(Y);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var S;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=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},V.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)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),W=this.undoRedoManager.getLastUndoStep();if(!W||W.width===L.width&&W.height===L.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ee<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Y){return Y(new pt(S))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function(Y){return Y(new pt(S))})}},V.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},V.prototype.undoStep=function(){var S=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new pt(S))}))},V.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},V.prototype.redoStep=function(){var S=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(W){return W(new pt(S))}))},V.prototype.stepZoom=function(){var S=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=S<this.zoomSteps.length-1?this.zoomSteps[S+1]:this.zoomSteps[0]},V.prototype.panTo=function(S){this.contentDiv.scrollBy({left:this.prevPanPoint.x-S.x,top:this.prevPanPoint.y-S.y}),this.prevPanPoint=S},V.prototype.startRenderAndClose=function(){return Oe(this,void 0,void 0,function(){var S,L,W=this;return Me(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return S=ee.sent(),L=this.getState(),this.eventListeners.render.forEach(function(Y){return Y(new Xe(W,S,L))}),this.close(!0),[2]}})})},V.prototype.getState=function(S){S===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(W){return L.markers.push(W.getState())}),L},V.prototype.restoreState=function(S){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);S.markers.forEach(function(W){var ee=L._availableMarkerTypes.find(function(Ae){return Ae.typeName===W.typeName});if(ee!==void 0){var Y=L.addNewMarker(ee);Y.restoreState(W),L.markers.push(Y)}}),S.width&&S.height&&(S.width!==this.imageWidth||S.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/S.width,this.imageHeight/S.height),this.eventListeners.restorestate.forEach(function(W){return W(new pt(L))})},V.prototype.addNewMarker=function(S){var L=ue.createGroup();return this.markerImage.appendChild(L),new S(L,this.overlayContainer,this.settings)},V.prototype.createNewMarker=function(S){var L,W=this;(L=typeof S=="string"?this._availableMarkerTypes.find(function(ee){return ee.typeName===S}):S)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),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(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ee){return ee(new Ge(W,W._currentMarker))}))},V.prototype.markerCreated=function(S){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(S),this.setCurrentMarker(S),S instanceof xe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(xe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(W){return W(new Ge(L,L._currentMarker))})},V.prototype.colorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=S,this.settings.defaultStrokeColor=S)},V.prototype.fillColorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=S)},V.prototype.markerStateChanged=function(S){var L=this;this.eventListeners.markerchange.forEach(function(W){return W(new Ge(L,S))})},V.prototype.setCurrentMarker=function(S){var L=this;this._currentMarker!==S&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(W){return W(new Ge(L,L._currentMarker))})),this._currentMarker=S,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(W){return W(new Ge(L,L._currentMarker))}))},V.prototype.onPointerDown=function(S){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||S.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(W){return W.ownsTarget(S.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:S.clientX,y:S.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY))},V.prototype.onDblClick=function(S){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(W){return W.ownsTarget(S.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target):this.setCurrentMarker()}},V.prototype.onPointerMove=function(S){this.touchPoints!==1&&S.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||S.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(S.clientX,S.clientY)):this.zoomLevel>1&&this.panTo({x:S.clientX,y:S.clientY}))},V.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(S,L){var W=this.markerImage.getBoundingClientRect();return{x:(S-W.left)/this.zoomLevel,y:(L-W.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"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()},V.prototype.addLicenseKey=function(S){ne.addKey(S)},V.prototype.addEventListener=function(S,L){this.eventListeners.addEventListener(S,L)},V.prototype.removeEventListener=function(S,L){this.eventListeners.removeEventListener(S,L)},V.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new pt(S))}))},V.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new pt(S))}))},V.instanceCounter=0,V}();/* **********************************
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 he=function(V,S){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,W){L.__proto__=W}||function(L,W){for(var ee in W)Object.prototype.hasOwnProperty.call(W,ee)&&(L[ee]=W[ee])})(V,S)};function Ze(V,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function L(){this.constructor=V}he(V,S),V.prototype=S===null?Object.create(S):(L.prototype=S.prototype,new L)}function Ue(V,S,L,W){return new(L||(L=Promise))(function(ee,Y){function Ae(Bt){try{St(W.next(Bt))}catch(pe){Y(pe)}}function at(Bt){try{St(W.throw(Bt))}catch(pe){Y(pe)}}function St(Bt){var pe;Bt.done?ee(Bt.value):(pe=Bt.value,pe instanceof L?pe:new L(function(Pt){Pt(pe)})).then(Ae,at)}St((W=W.apply(V,S||[])).next())})}function ze(V,S){var L,W,ee,Y,Ae={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:at(0),throw:at(1),return:at(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function at(St){return function(Bt){return function(pe){if(L)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(L=1,W&&(ee=2&pe[0]?W.return:pe[0]?W.throw||((ee=W.return)&&ee.call(W),0):W.next)&&!(ee=ee.call(W,pe[1])).done)return ee;switch(W=0,ee&&(pe=[2&pe[0],ee.value]),pe[0]){case 0:case 1:ee=pe;break;case 4:return Ae.label++,{value:pe[1],done:!1};case 5:Ae.label++,W=pe[1],pe=[0];continue;case 7:pe=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ee=Ae.trys,(ee=ee.length>0&&ee[ee.length-1])||pe[0]!==6&&pe[0]!==2)){Ae=0;continue}if(pe[0]===3&&(!ee||pe[1]>ee[0]&&pe[1]<ee[3])){Ae.label=pe[1];break}if(pe[0]===6&&Ae.label<ee[1]){Ae.label=ee[1],ee=pe;break}if(ee&&Ae.label<ee[2]){Ae.label=ee[2],Ae.ops.push(pe);break}ee[2]&&Ae.ops.pop(),Ae.trys.pop();continue}pe=S.call(V,Ae)}catch(Pt){pe=[6,Pt],W=0}finally{L=ee=0}if(5&pe[0])throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}([St,Bt])}}}var ct=function(){function V(){}return V.addKey=function(S){V.key=S},Object.defineProperty(V,"isLicensed",{get:function(){return!!V.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(V.key)},enumerable:!1,configurable:!0}),V}(),Te=function(){function V(){}return V.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},V.setAttributes=function(S,L){for(var W=0,ee=L;W<ee.length;W++){var Y=ee[W],Ae=Y[0],at=Y[1];S.setAttribute(Ae,at)}},V.createRect=function(S,L,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",S.toString()),ee.setAttribute("height",L.toString()),W&&V.setAttributes(ee,W),ee},V.createLine=function(S,L,W,ee,Y){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",S.toString()),Ae.setAttribute("y1",L.toString()),Ae.setAttribute("x2",W.toString()),Ae.setAttribute("y2",ee.toString()),Y&&V.setAttributes(Ae,Y),Ae},V.createPolygon=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","polygon");return W.setAttribute("points",S),L&&V.setAttributes(W,L),W},V.createCircle=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","circle");return W.setAttribute("cx",(S/2).toString()),W.setAttribute("cy",(S/2).toString()),W.setAttribute("r",S.toString()),L&&V.setAttributes(W,L),W},V.createEllipse=function(S,L,W){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(S/2).toString()),ee.setAttribute("cy",(L/2).toString()),ee.setAttribute("rx",(S/2).toString()),ee.setAttribute("ry",(L/2).toString()),W&&V.setAttributes(ee,W),ee},V.createGroup=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&V.setAttributes(L,S),L},V.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},V.createMarker=function(S,L,W,ee,Y,Ae,at){var St=document.createElementNS("http://www.w3.org/2000/svg","marker");return V.setAttributes(St,[["id",S],["orient",L],["markerWidth",W.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",Ae.toString()]]),St.appendChild(at),St},V.createText=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),S&&V.setAttributes(L,S),L},V.createTSpan=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","tspan");return W.textContent=S,L&&V.setAttributes(W,L),W},V.createImage=function(S){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&V.setAttributes(L,S),L},V.createPoint=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return W.x=S,W.y=L,W},V.createPath=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg","path");return W.setAttribute("d",S),L&&V.setAttributes(W,L),W},V.createElement=function(S,L){var W=document.createElementNS("http://www.w3.org/2000/svg",S);return L&&V.setAttributes(W,L),W},V.getHollowRectanglePath=function(S,L,W,ee,Y,Ae,at,St){return"M"+S+","+L+"V"+(L+ee)+"H"+(S+W)+"V"+L+"H"+Y+"V"+Ae+"H"+(Y+at)+"V"+(Ae+St)+"H"+Y+"V"+L+"Z"},V}(),Ke=function(){function V(S){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(V.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(V.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(V.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),V.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},V.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},V.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new st("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ft("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ft("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},V.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},V}(),st=function(V,S){this.selector=V,this.style=S},ft=function(V,S){this.localName=V,this.style=S},Tt=function(){function V(){this.blocks=[],this.display=""}return V.prototype.addButtonBlock=function(S){S.className=this.blockClassName,S.buttonClassName=this.buttonClassName,S.buttonColorsClassName=this.buttonColorsClassName,S.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(S)},V.prototype.addElementBlock=function(S){S.className===void 0&&(S.className=this.blockClassName),this.blocks.push(S)},V.prototype.getUI=function(){var S=document.createElement("div");return S.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,S.style.display=this.display,this.blocks.forEach(function(L){return S.appendChild(L.getUI())}),S},V}(),Jt=function(){function V(){}return V.prototype.getUI=function(){var S=document.createElement("div");if(S.className=this.className,this.minWidth!==void 0&&(S.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":S.style.justifyContent="flex-start";break;case"center":S.style.justifyContent="center";break;case"end":S.style.justifyContent="flex-end"}return S.style.whiteSpace="nowrap",S},V}(),an=function(V){function S(){var L=V!==null&&V.apply(this,arguments)||this;return L.buttons=[],L}return Ze(S,V),S.prototype.addButton=function(L){L.className=this.buttonClassName,L.colorsClassName=this.buttonColorsClassName,L.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(L)},S.prototype.getUI=function(){var L=V.prototype.getUI.call(this);return this.buttons.forEach(function(W){return L.appendChild(W.getUI())}),L},S}(Jt),Vt=function(){function V(S,L){this._isActive=!1,this._isHidden=!1,this._icon=S,this.title=L,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(V.prototype,"icon",{get:function(){return this._icon},set:function(S){this._icon=S,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isActive",{get:function(){return this._isActive},set:function(S){this._isActive=S,this.adjustClassName()},enumerable:!1,configurable:!0}),V.prototype.getUI=function(){var S=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 S.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},V.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,"")))},V.prototype.hide=function(){this._isHidden=!0},V}(),Ot=function(V){function S(){var L=V!==null&&V.apply(this,arguments)||this;return L.elements=[],L}return Ze(S,V),S.prototype.addElement=function(L){this.elements.push(L)},S.prototype.getUI=function(){var L=V.prototype.getUI.call(this);return this.elements.forEach(function(W){return L.appendChild(W)}),L},S}(Jt),gn=function(){function V(S,L){this.horizontal=S,this.vertical=L}return Object.defineProperty(V.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),V.prototype.getVerticalLength=function(S){return S/this.ratio},V.prototype.getHorizontalLength=function(S){return S*this.ratio},V}(),Kt=function(){function V(){}return V.getIcon=function(S,L){if(S>0&&L>0){var W=new gn(S,L),ee=W.ratio>=1?20:W.getHorizontalLength(20),Y=W.ratio<1?20:W.getVerticalLength(20),Ae=document.createElementNS("http://www.w3.org/2000/svg","svg");Ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ae);var at=Te.createDefs();Ae.appendChild(at);var St=Te.createElement("clipPath",[["id","text-bg-clip"]]);at.appendChild(St);var Bt=Te.createPath(Te.getHollowRectanglePath((24-ee)/2,(24-Y)/2,ee,Y,(24-ee)/2+2,(24-Y)/2+2,ee-4,Y-4));Ae.appendChild(Bt);var pe=Te.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);pe.appendChild(Te.createTSpan(S+":"+L)),Ae.appendChild(pe);var Pt=pe.getBBox();Te.setAttributes(pe,[["x",((24-Pt.width)/2).toString()],["y",((24-Pt.height)/2-Pt.y).toString()]]);var qt=Te.createPath(Te.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Pt.width))/2,(24-Math.ceil(Pt.height))/2,Math.ceil(Pt.width),Math.ceil(Pt.height)));return St.appendChild(qt),Te.setAttributes(Bt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ae),Ae.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>'},V}(),Zt=function(V){function S(L,W,ee){var Y=V.call(this,L,W)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=ee,Y}return Ze(S,V),S.prototype.setupDropdown=function(){var L=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(W){W.className=L.className,W.colorsClassName=L.colorsClassName,L.dropdownBlock.appendChild(W.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},S.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},S.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},S.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},S.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},S.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},S}(Vt),Nt=function(){function V(S,L){this.GRIP_SIZE=10,this.color=S,this.fillColor=L,this.visual=Te.createGroup(),this.visual.appendChild(Te.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Te.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},V.prototype.setCenter=function(S,L){this.visual.childNodes.forEach(function(W){return Te.setAttributes(W,[["cx",S.toString()],["cy",L.toString()]])})},V}(),nn=function(){function V(S,L,W,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=S,this.canvasHeight=L,this.margin=W,this.container=ee,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(V.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(S){this._aspectRatio=S,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.gridContainer&&Te.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(S){this._zoomFactor=S,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),V.prototype.open=function(){var S=this;this.cropShadeElement=Te.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Te.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var L=0;L<this.numberOfGridLines;L++)this.horizontalGridLines.push(Te.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Te.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(W){return S.gridContainer.appendChild(W)}),this.verticalGridLines.forEach(function(W){return S.gridContainer.appendChild(W)}),this.cropRectElement=Te.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Nt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},V.prototype.setCropRectangle=function(S){this.cropRect=S;var L=Object.assign({},this.cropRect);this.zoomFactor!==1&&(L.width=this.cropRect.width*this.zoomFactor,L.height=this.cropRect.height*this.zoomFactor,L.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-L.width/2,L.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-L.height/2),Te.setAttributes(this.cropRectElement,[["x",L.x.toString()],["y",L.y.toString()],["width",L.width.toString()],["height",L.height.toString()]]);var W=L.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Ae){var at=L.y+W*(Ae+1);Te.setAttributes(Y,[["x1",""+L.x],["y1",""+at],["x2",""+(L.x+L.width)],["y2",""+at]])});var ee=L.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Ae){var at=L.x+ee*(Ae+1);Te.setAttributes(Y,[["x1",""+at],["y1",""+L.y],["x2",""+at],["y2",""+(L.y+L.height)]])}),Te.setAttributes(this.cropShadeElement,[["d",Te.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,L.x,L.y,L.width,L.height)]]),this.topLeftGrip.setCenter(L.x,L.y),this.topRightGrip.setCenter(L.x+L.width,L.y),this.bottomLeftGrip.setCenter(L.x,L.y+L.height),this.bottomRightGrip.setCenter(L.x+L.width,L.y+L.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},V.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)},V.prototype.clientToLocalCoordinates=function(S,L){var W=this.container.getBoundingClientRect();return{x:S-W.left+this.margin,y:L-W.top+this.margin}},V.prototype.onPointerDown=function(S){this.container.setPointerCapture(S.pointerId),this.previousPoint=this.clientToLocalCoordinates(S.clientX,S.clientY),this.cropRectElement===S.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(S.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(S.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(S.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(S.target)&&(this.activeGrip=this.bottomRightGrip)},V.prototype.onPointerMove=function(S){if(this.isMoving)this.move(this.clientToLocalCoordinates(S.clientX,S.clientY));else if(this.activeGrip){var L=this.clientToLocalCoordinates(S.clientX,S.clientY);this.resize(L)}S.preventDefault()},V.prototype.onPointerUp=function(S){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(S.pointerId)},V.prototype.move=function(S){var L=S.x-this.previousPoint.x,W=S.y-this.previousPoint.y;this.zoomFactor!==1&&(L=-L/this.zoomFactor,W=-W/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+L),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+W),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=S},V.prototype.resize=function(S){var L=Object.assign({},this.cropRect),W=S.x-this.previousPoint.x,ee=S.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:L.x+W<this.margin&&(W=this.margin-L.x),L.x+=W,L.width=this.cropRect.x+this.cropRect.width-L.x;break;case this.bottomRightGrip:case this.topRightGrip:L.width+W>this.canvasWidth*this.zoomFactor&&(W=this.canvasWidth*this.zoomFactor-L.width),L.width+=W}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(L.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(W),L.height=this.aspectRatio.getVerticalLength(L.width)):(L.y+=ee,L.height=this.cropRect.y+this.cropRect.height-L.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?L.height=this.aspectRatio.getVerticalLength(L.width):L.height+=ee}L.width<10&&(L.x=this.cropRect.x,L.width=10),L.height<10&&(L.y=this.cropRect.y,L.height=10),this.previousPoint=S,L.x>=this.margin&&L.y>=this.margin&&L.x-this.margin+L.width<=this.canvasWidth&&L.y-this.margin+L.height<=this.canvasHeight&&(this.cropRect=L,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},V.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var S=this.cropRect.x+this.cropRect.width/2,L=this.cropRect.y+this.cropRect.height/2,W=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);W/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=W:this.cropRect.height=ee,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=S-this.cropRect.width/2,this.cropRect.y=L-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)}},V.prototype.getRescaledRect=function(S,L,W,ee,Y,Ae){var at=W/S,St=ee/L;return{x:(Y.x-Ae)*at+Ae,y:(Y.y-Ae)*St+Ae,width:Y.width*at,height:Y.height*St}},V.prototype.scaleCanvas=function(S,L){var W=this.getRescaledRect(this.canvasWidth,this.canvasHeight,S,L,this.cropRect,this.margin);this.canvasWidth=S,this.canvasHeight=L,this.onCropChange&&this.onCropChange(W),this.setCropRectangle(W)},V}(),Cn=function(){function V(S){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=S,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(V.prototype,"angle",{get:function(){return this._angle},set:function(S){this._angle=S,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),V.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},V.prototype.onPointerDown=function(S){this.controlContainer.setPointerCapture(S.pointerId),this.isDragging=!0,this.previousPoint={x:S.clientX,y:S.clientY}},V.prototype.onPointerMove=function(S){this.isDragging&&(this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.previousPoint.x=S.clientX)},V.prototype.onPointerUp=function(S){this.isDragging&&this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(S.pointerId)},V.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var S=this.angleLabelText.getBBox();Te.setAttributes(this.angleLabelElement,[["x",((this.width-S.width)/2).toString()],["y",(this.height/2).toString()]])}},V.prototype.positionScaleShape=function(){if(this.scaleShape){var S=this.scaleShape.transform.baseVal.getItem(0);S.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(S,0)}},V.prototype.getVisual=function(){var S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("width",this.width+"px"),S.setAttribute("height",this.height+"px"),S.setAttribute("viewBox","0 0 "+this.width+" "+this.height),S.style.flexShrink="0",document.body.appendChild(S);for(var L="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,W=1;W<=this.width/5+10;W++){var ee=W%5==0?this.height/3:this.height/6;L+="h4v"+-ee+"h1v"+ee}L+="v1H0Z",this.scaleShape=Te.createPath(L);var Y=Te.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),S.appendChild(this.scaleShape),this.angleLabelElement=Te.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Te.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ae=Te.createTSpan("");return Ae.innerHTML="&deg;",this.angleLabelElement.appendChild(Ae),S.appendChild(this.angleLabelElement),document.body.removeChild(S),S},V}(),wn=function(){function V(){this.naturalSize=!1,this.imageType="image/png"}return V.prototype.rasterize=function(S,L,W,ee,Y,Ae,at){var St=this;return new Promise(function(Bt){var pe=document.createElement("canvas");pe.width=S.width.baseVal.value-2*ee,pe.height=S.height.baseVal.value-2*ee;var Pt=1,qt=1;St.naturalSize===!0?(Pt=L.naturalWidth/(S.width.baseVal.value-2*ee)/Ae,qt=L.naturalHeight/(S.height.baseVal.value-2*ee)/at,pe.width=L.naturalWidth/Ae,pe.height=L.naturalHeight/at):St.width!==void 0&&St.height!==void 0&&(Pt=St.width/W.width,qt=St.height/W.height,pe.width*=Pt,pe.height*=qt);var Tn=pe.getContext("2d");Tn.translate(pe.width/2,pe.height/2),Tn.rotate(Y*Math.PI/180),Tn.scale(Ae,at),Tn.translate(-pe.width/2,-pe.height/2),Tn.drawImage(L,0,0,pe.width,pe.height);var Hn=document.createElement("canvas");Hn.width=W.width*Pt,Hn.height=W.height*qt,Hn.getContext("2d").putImageData(Tn.getImageData((W.x-ee)*Pt,(W.y-ee)*qt,W.width*Pt,W.height*qt),0,0),Bt(Hn.toDataURL(St.imageType,St.imageQuality))})},V}(),mt=function(){function V(S){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=V.instanceCounter++,this.styles=new Ke(this.instanceNo),this.target=S,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(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(S){this._zoomToCropEnabled=S,S?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"gridLines",{get:function(){return this._gridLines},set:function(S){this._gridLines=S,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(S){this._rotationAngle=S,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"aspectRatio",{get:function(){var S;return(S=this._aspectRatio)!==null&&S!==void 0?S:this.aspectRatios[0]},set:function(S){this._aspectRatio=S},enumerable:!1,configurable:!0}),V.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},V.prototype.show=function(){this.showUI(),this.open()},V.prototype.close=function(S){S===void 0&&(S=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),S||this.closeEventListeners.forEach(function(L){return L()}),this._isOpen=!1)},V.prototype.addRenderEventListener=function(S){this.renderEventListeners.push(S)},V.prototype.removeRenderEventListener=function(S){this.renderEventListeners.indexOf(S)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(S),1)},V.prototype.addCloseEventListener=function(S){this.closeEventListeners.push(S)},V.prototype.removeCloseEventListener=function(S){this.closeEventListeners.indexOf(S)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(S),1)},V.prototype.setupResizeObserver=function(){var S=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.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))},V.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var S=1*this.target.clientWidth/this.target.clientHeight,L=this.contentDiv.clientWidth/S>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*S:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,W=L+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/S;this.resize(L,W)}},V.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},V.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",Te.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},V.prototype.resize=function(S,L){this.imageWidth=Math.round(S),this.imageHeight=Math.round(L),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()},V.prototype.setEditingTarget=function(){var S=document.createElement("canvas");S.width=this.target.naturalWidth,S.height=this.target.naturalHeight,S.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var L=S.toDataURL();Te.setAttributes(this.editingTarget,[["href",L]]),this.setEditingTargetSize()},V.prototype.setTopLeft=function(){var S=this.target.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=S.left-L.left-this.CANVAS_MARGIN,this.top=S.top-L.top-this.CANVAS_MARGIN},V.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=Te.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Te.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Te.createGroup(),this.editingTargetRotationScaleContainer=Te.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var S=Te.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(S);var L=Te.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(L),this.editingTargetContainer=Te.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)},V.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},V.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Te.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new nn(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()},V.prototype.zoomToCrop=function(){if(this.cropRect){var S=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,L=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=S+"px "+L+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-S+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-L+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},V.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)},V.prototype.cropRectChanged=function(S){this.cropRect=S,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},V.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},V.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"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.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 S=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,L=this.target.offsetTop>S+this.CANVAS_MARGIN?this.target.offsetTop-(S+this.CANVAS_MARGIN):0;this.coverDiv.style.top=L+"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},V.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},V.prototype.addTopToolbar=function(){var S=this;this.topToolbar=new Tt,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 L=new an;L.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(L);var W=[];this.aspectRatios.forEach(function(qt){var Tn=new Vt(Kt.getIcon(qt.horizontal,qt.vertical),qt.horizontal===0&&qt.vertical===0?"FREE":qt.horizontal+":"+qt.vertical);Tn.onClick=function(){return S.ratioButtonClicked(qt)},W.push(Tn)}),this.aspectRatioButton=new Zt(Kt.getIcon(0,0),"Aspect ratio",W),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,L.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new Vt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){S.isGridVisible=!S.isGridVisible,ee.isActive=S.isGridVisible},L.addButton(ee);var Y=new Vt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){S.zoomToCropEnabled=!S.zoomToCropEnabled,Y.isActive=S.zoomToCropEnabled},L.addButton(Y),!ct.isLicensed){var Ae=new Ot;this.topToolbar.addElementBlock(Ae);var at=document.createElement("div");at.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var St=document.createElement("a");St.style.color="currentColor",St.href="https://markerjs.com/products/cropro",St.target="_blank",St.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>',at.appendChild(St),Ae.addElement(at)}var Bt=new an;Bt.minWidth=3*this.toolbarHeight+"px",Bt.contentAlign="end",this.topToolbar.addButtonBlock(Bt);var pe=new Vt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");pe.onClick=this.startRenderAndClose,Bt.addButton(pe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(pe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Pt=new Vt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Pt.onClick=this.close,Bt.addButton(Pt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Pt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},V.prototype.addBottomToolbar=function(){var S=this;this.bottomToolbar=new Tt,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 L=new an;L.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(L);var W=new Vt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");W.onClick=this.rotateLeftButtonClicked,L.addButton(W);var ee=new Vt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ee.onClick=this.rotateRightButtonClicked,L.addButton(ee);var Y=new Ot;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Cn("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(Bt){S.rotateBy(Bt),S.straightener.angle=S.rotationAngle},Y.addElement(this.straightener.getUI());var Ae=new an;Ae.minWidth=2*this.toolbarHeight+"px",Ae.contentAlign="end",this.bottomToolbar.addButtonBlock(Ae);var at=new Vt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");at.onClick=this.flipHorizontallyButtonClicked,Ae.addButton(at);var St=new Vt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");St.onClick=this.flipVerticallyButtonClicked,Ae.addButton(St)},V.prototype.ratioButtonClicked=function(S){this.aspectRatio=S,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},V.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Kt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},V.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new gn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},V.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},V.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},V.prototype.restoreState=function(S){if(S){var L=this.cropLayer.getRescaledRect(S.width,S.height,this.imageWidth,this.imageHeight,S.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(L),this.cropRectChanged(L),this.flippedHorizontally=S.flippedHorizontally,this.flippedVertically=S.flippedVertically,this.applyFlip(),this.rotationAngle=S.rotationAngle,this.applyRotation()}},V.prototype.clientToLocalCoordinates=function(S,L){var W=this.cropImage.getBoundingClientRect();return{x:S-W.left,y:L-W.top}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var S=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=S+"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()},V.prototype.rotateLeftButtonClicked=function(){var S=this.rotationAngle-90;this.rotationAngle%90!=0&&(S+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(S)},V.prototype.rotateRightButtonClicked=function(){var S=this.rotationAngle+90;this.rotationAngle%90!=0&&(S-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(S)},V.prototype.rotateTo=function(S){S=(S=S>180?S-360:S)<=-180?S+360:S,this.rotationAngle=S,this.applyRotation()},V.prototype.rotateBy=function(S){this.rotateTo((this.rotationAngle+S)%360)},V.prototype.applyRotation=function(){var S=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var L=this.editingTargetRotationContainer.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(L,0);var W=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/W.width,this.imageHeight/W.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=S},V.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},V.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},V.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},V.prototype.startRenderAndClose=function(){return Ue(this,void 0,void 0,function(){var S,L;return ze(this,function(W){switch(W.label){case 0:return[4,this.render()];case 1:return S=W.sent(),L=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(S,L)}),this.close(!0),[2]}})})},V.prototype.render=function(){return Ue(this,void 0,void 0,function(){var S;return ze(this,function(L){switch(L.label){case 0:return(S=new wn).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.width=this.renderWidth,S.height=this.renderHeight,this.unzoomFromCrop(),Te.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,S.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 L.sent(),[4,S.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,L.sent()]}})})},V.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ft("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 ft("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ft("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var S=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ft("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*S)+`px;
height: `+(this.toolbarHeight-2*S)+`px;
padding: `+S+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ft("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ft("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ft("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 ft("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ft("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 ft("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*S)+`px;
padding: `+S+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ft("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},V.instanceCounter=0,V}(),Gt=K("8hTe"),Mn=K.n(Gt),Un=/<pre[^>]*>/g;function Pn(V){var S=document.createElement("div");return S.innerHTML=V,S.childNodes.length===0?"":S.childNodes[0].nodeValue}var Vn=Ne.a=function(V){var S=V.value,L=S===void 0?"":S,W=V.edit,ee=W===void 0?!1:W,Y=V.className,Ae=V.showTextOnly,at=V.showLines,St=V.replaces,Bt=V.zoomImg,pe=V.hasMask,Pt=V.style,qt=Pt===void 0?{}:Pt,Tn=V.stylesPrev,Hn=Tn===void 0?{}:Tn,Kn=String(L),In=Object(I.useRef)(),pi=Object(I.useRef)(),ui=Object(I.useState)(""),Bn=Object(H.a)(ui,2),di=Bn[0],Ai=Bn[1],wi=Object(I.useState)("office"),Yn=Object(H.a)(wi,2),Wi=Yn[0],Pi=Yn[1],yi=function(){var on=new mt(pi.current);on.displayMode="popup",on.addRenderEventListener(function(){var Dn=Object(D.a)(k.a.mark(function un(Rn){var yn;return k.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return In.current.style.display="none",jn.next=3,Object(Pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Rn}});case 3:yn=jn.sent,yn!=null&&yn.id&&St(pi.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 5:case"end":return jn.stop()}},un)}));return function(un){return Dn.apply(this,arguments)}}()),on.show()},Qi=function(){var on=new oe(pi.current);on.settings.displayMode="popup",on.addEventListener("render",function(){var Dn=Object(D.a)(k.a.mark(function un(Rn){var yn;return k.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:if(In.current.style.display="none",!pi.current){jn.next=6;break}return jn.next=4,Object(Pe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Rn.dataUrl}});case 4:yn=jn.sent,yn!=null&&yn.id&&St(pi.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 6:case"end":return jn.stop()}},un)}));return function(un){return Dn.apply(this,arguments)}}()),on.show(),window.markerArea=on},bi=Object(I.useMemo)(function(){In.current&&(In.current.style.zIndex=-1);try{var _n=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,on=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Dn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Kn=Kn.replace(_n,"("+$.a.API_SERVER+"/api/attachments/").replace(on,'"'+$.a.API_SERVER+"/api/attachments/").replace(Dn,'"'+$.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(Oi){}var un=G(Kn),Rn=x();if(Kn.match(/\[TOC\]/)&&(un=un.replace("<p>[TOC]</p>",w()),R()),un=un.replace(/(__special_katext_id_\d+__)/g,function(Oi,jn){var Xn=Rn[jn],Ki=Xn.type,Ri=Xn.expression;return Object(se.renderToString)(Pn(Ri)||"",{displayMode:Ki==="block",throwOnError:!1,output:"html"})}),un=un.replace(/▁/g,"\u2581\u2581\u2581"),g(),Ae){var yn=document.createElement("div");return yn.innerHTML=un,yn.innerText}return setTimeout(function(){return Hi()},500),un},[Kn]),ci=Object(I.useRef)();A.WebkitLineClamp=at,at&&(qt=Object(B.a)(Object(B.a)({},qt),A));function Ni(_n){var on=_n.target;if(on.tagName.toUpperCase()==="IMG"){if(Bt){var Dn=on.getAttribute("src");Ai(Dn),Pi("image")}}else if(on.tagName.toUpperCase()==="A"){var un=on.getAttribute("href");if(un.indexOf("office")>-1)_n.preventDefault(),Ai(un),Pi("office");else if(un.indexOf("application/pdf")>-1)_n.preventDefault(),Ai(un),Pi("pdf");else if(un.indexOf("text/html")>-1)_n.preventDefault(),Ai(un),Pi("html");else if(un.startsWith("#")){_n.preventDefault();var Rn=document.getElementById(un.replace("#",""));Rn&&Rn.scrollIntoView(!0)}}}var Hi=function(){var on,Dn=(on=ci.current)===null||on===void 0?void 0:on.querySelectorAll("video");Dn==null||Dn.forEach(function(un){if(un.oncontextmenu=function(){return!1},un.src.indexOf(".m3u8")>-1&&!un.canPlayType("application/vnd.apple.mpegurl")){if(X.a.isSupported()){var Rn=new X.a;Rn.loadSource(un.src),Rn.attachMedia(un)}}})};Object(I.useEffect)(function(){if(ci.current&&bi&&(bi.match(Un)&&window.PR.prettyPrint()),ci.current)return ci.current.addEventListener("click",Ni),function(){ci.current.removeEventListener("click",Ni),g(),R()}},[bi,ci.current,Ni]);var _i=function(on){if(!ee)return;on.target.nodeName==="IMG"?(In.current.style.zIndex=1,In.current.style.display="flex",In.current.style.width=on.target.clientWidth+"px",In.current.style.height=on.target.clientHeight+"px",In.current.style.top=on.target.offsetTop+"px",In.current.style.left=on.target.offsetLeft+"px",pi.current.src=on.target.getAttribute("src")):In.current.style.display="none"};return _.a.createElement("div",{style:{position:"relative"}},_.a.createElement("div",{ref:ci,style:Object(B.a)({},qt),className:"".concat(Y||""," markdown-body ").concat(Mn.a.mdBody),onMouseOver:_i,dangerouslySetInnerHTML:{__html:bi}}),_.a.createElement("div",{ref:In,className:Mn.a.button},_.a.createElement(Q.a,null,_.a.createElement(J.a,{onClick:function(){return yi()}},"\u88C1\u526A"),_.a.createElement(J.a,{onClick:function(){return Qi()}},"\u7F16\u8F91"))),_.a.createElement("img",{ref:pi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),_.a.createElement(ce.a,{close:!0,data:di,type:di!=null&&di.length?Wi:"",style:Object(B.a)({},Hn),onClose:function(){return Ai("")}}))}},"9GDu":function(qe,Ne,K){qe.exports={flex_box_center:"flex_box_center___2Dduc",flex_space_between:"flex_space_between___2Le2r",flex_box_vertical_center:"flex_box_vertical_center___2KZsK",flex_box_center_end:"flex_box_center_end___1aosz",flex_box_column:"flex_box_column___cFN2D",bg:"bg___ka_0p",title:"title___3M9-E",questionIcons:"questionIcons___VjWTs",green:"green___2q3Jn",orange:"orange___KXt8o",greenTip:"greenTip___1nV5h",redTip:"redTip___3QDm4",orangeTip:"orangeTip___3F21W",pollDesc:"pollDesc___3Jb8Y",answered:"answered___1tbR8",unanswer:"unanswer___2Jts9",anchor:"anchor___3_nBp",answerFlag:"answerFlag___32KcB",flagActive:"flagActive___3ac8b",flagHalf:"flagHalf___1AvT6",answerStudentFlag:"answerStudentFlag___UbvlB",answerStudentActive:"answerStudentActive___27het",questionItem:"questionItem___3nBk4",itemType:"itemType___3NNh-",itemFlag:"itemFlag___2fz1F",answerWrap:"answerWrap___23vJg",answerSubjective:"answerSubjective___1i3N-",otherInput:"otherInput___gQ5U6",submitButton:"submitButton___RAvWu",randomFlag:"randomFlag___1J_UJ",answerTrue:"answerTrue___1cUgp",answerFalse:"answerFalse___Q16xV",answerHalf:"answerHalf___2I-fp",renderHtml:"renderHtml___1O15z",simpleText:"simpleText___1-h1E",answerYes:"answerYes___3w-7A",answerNo:"answerNo___2TuuH",answerInfo:"answerInfo___3KPDJ",answerSheet:"answerSheet___1UuGf",active:"active___2njWQ",countDown:"countDown___ViVY-",red:"red___RmODq",fold:"fold___ZVRBm",cardList:"cardList___1KJD0",iframe:"iframe___8V6GW"}},"9VGf":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return N});var te=K("q1tI"),Q=K.n(te);function N(J,B){var D=Object(te.useRef)();Object(te.useEffect)(function(){D.current=J}),Object(te.useEffect)(function(){function H(){D.current()}if(B!==null){var F=setInterval(H,B);return function(){return clearInterval(F)}}},[B])}},"A/g1":function(qe,Ne){qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjEtMDctMDJUMTk6Mzg6MjMrMDg6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBkYzpmb3JtYXQ9ImltYWdlL3BuZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmVkYzRhODM0LTVjNWQtNDQ1My04MDYzLWNkNzcwODQyODg5ZSIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjQ4MTE0OTVlLTVkMDctZTk0YS1iNWEwLWYxOWJmZmM0NGUyNyIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOmMwNjQyYzA1LTg5MzQtNDdlYy04MTFiLTlkYjdhZGNkYjFiMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YzA2NDJjMDUtODkzNC00N2VjLTgxMWItOWRiN2FkY2RiMWIwIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjM4OjIzKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZWRjNGE4MzQtNWM1ZC00NDUzLTgwNjMtY2Q3NzA4NDI4ODllIiBzdEV2dDp3aGVuPSIyMDIxLTA3LTAyVDE5OjQxOjQ2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgMjIuMSAoTWFjaW50b3NoKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5fJkpyAAAGoElEQVRogc2abWxbVxnH/8+59/rdTpx2GW3UNWJJV7Ylaxp3LUFsWgJDiI5R8bK2GppAmsgQLKQthS8IEJ9okibrREf3gX2Y1K2bxAoDtog60RBSVxKnWUO7kpSppXJZK2ja2HFi33vPw4cmpbN9r++1k8Lv2znnf577f+zje95Mhw4dQqUkwljpF7kuv0EdHkm1HklRr6TQq2tn5xcklwhIMnMSQJIJxykTiSce+1am0mer5XacqM7uDJjiqbAuWlvSygrBnmKyxcoI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"},BU3w:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return D});var te=K("MNnm"),Q="rc-util-key";function N(H){if(H.attachTo)return H.attachTo;var F=document.querySelector("head");return F||document.body}function J(H){var F,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var I=document.createElement("style");if((F=k.csp)===null||F===void 0?void 0:F.nonce){var _;I.nonce=(_=k.csp)===null||_===void 0?void 0:_.nonce}I.innerHTML=H;var v=N(k),p=v.firstChild;return k.prepend&&v.prepend?v.prepend(I):k.prepend&&p?v.insertBefore(I,p):v.appendChild(I),I}var B=new Map;function D(H,F){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=N(k);if(!B.has(I)){var _=J("",k),v=_.parentNode;B.set(I,v),v.removeChild(_)}var p=Array.from(B.get(I).children).find(function(r){return r.tagName==="STYLE"&&r[Q]===F});if(p){var c,a;if(((c=k.csp)===null||c===void 0?void 0:c.nonce)&&p.nonce!==((a=k.csp)===null||a===void 0?void 0:a.nonce)){var l;p.nonce=(l=k.csp)===null||l===void 0?void 0:l.nonce}return p.innerHTML!==H&&(p.innerHTML=H),p}var o=J(H,k);return o[Q]=F,o}},Bd2K:function(qe,Ne,K){(function(te){te(K("VrN/"),K("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(k,I,_){if(_!=te.Init&&_&&k.removeKeyMap("autoCloseTags"),!I)return;var v={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(v["'/'"]=function(p){return D(p)}),(typeof I!="object"||I.whenOpening!==!1)&&(v["'>'"]=function(p){return J(p)}),k.addKeyMap(v)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function J(k){if(k.getOption("disableInput"))return te.Pass;for(var I=k.listSelections(),_=[],v=k.getOption("autoCloseTags"),p=0;p<I.length;p++){if(!I[p].empty())return te.Pass;var c=I[p].head,a=k.getTokenAt(c),l=te.innerMode(k.getMode(),a.state),o=l.state,r=l.mode.xmlCurrentTag&&l.mode.xmlCurrentTag(o),s=r&&r.name;if(!s)return te.Pass;var d=l.mode.configuration=="html",R=typeof v=="object"&&v.dontCloseTags||d&&Q,A=typeof v=="object"&&v.indentTags||d&&N;a.end>c.ch&&(s=s.slice(0,s.length-a.end+c.ch));var T=s.toLowerCase();if(!s||a.type=="string"&&(a.end!=c.ch||!/[\"\']/.test(a.string.charAt(a.string.length-1))||a.string.length==1)||a.type=="tag"&&r.close||a.string.indexOf("/")==c.ch-a.start-1||R&&H(R,T)>-1||F(k,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(o)||[],s,c,!0))return te.Pass;var w=typeof v=="object"&&v.emptyTags;if(w&&H(w,s)>-1){_[p]={text:"/>",newPos:te.Pos(c.line,c.ch+2)};continue}var C=A&&H(A,T)>-1;_[p]={indent:C,text:">"+(C?`
`:"")+"</"+s+">",newPos:C?te.Pos(c.line+1,0):te.Pos(c.line,c.ch+1)}}for(var b=typeof v=="object"&&v.dontIndentOnAutoClose,p=I.length-1;p>=0;p--){var m=_[p];k.replaceRange(m.text,I[p].head,I[p].anchor,"+insert");var h=k.listSelections().slice(0);h[p]={head:m.newPos,anchor:m.newPos},k.setSelections(h),!b&&m.indent&&(k.indentLine(m.newPos.line,null,!0),k.indentLine(m.newPos.line+1,null,!0))}}function B(k,I){for(var _=k.listSelections(),v=[],p=I?"/":"</",c=k.getOption("autoCloseTags"),a=typeof c=="object"&&c.dontIndentOnSlash,l=0;l<_.length;l++){if(!_[l].empty())return te.Pass;var o=_[l].head,r=k.getTokenAt(o),s=te.innerMode(k.getMode(),r.state),d=s.state;if(I&&(r.type=="string"||r.string.charAt(0)!="<"||r.start!=o.ch-1))return te.Pass;var R,A=s.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(A&&s.mode.name=="javascript")R=p+"script";else if(A&&s.mode.name=="css")R=p+"style";else{var T=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(d);if(!T||T.length&&F(k,T,T[T.length-1],o))return te.Pass;R=p+T[T.length-1]}k.getLine(o.line).charAt(r.end)!=">"&&(R+=">"),v[l]=R}if(k.replaceSelections(v),_=k.listSelections(),!a)for(var l=0;l<_.length;l++)(l==_.length-1||_[l].head.line<_[l+1].head.line)&&k.indentLine(_[l].head.line)}function D(k){return k.getOption("disableInput")?te.Pass:B(k,!0)}te.commands.closeTag=function(k){return B(k)};function H(k,I){if(k.indexOf)return k.indexOf(I);for(var _=0,v=k.length;_<v;++_)if(k[_]==I)return _;return-1}function F(k,I,_,v,p){if(!te.scanForClosingTag)return!1;var c=Math.min(k.lastLine()+1,v.line+500),a=te.scanForClosingTag(k,v,null,c);if(!a||a.tag!=_)return!1;for(var l=p?1:0,o=I.length-1;o>=0&&I[o]==_;o--)++l;v=a.to;for(var o=1;o<l;o++){var r=te.scanForClosingTag(k,v,null,c);if(!r||r.tag!=_)return!1;v=r.to}return!0}})},BjJ7:function(qe,Ne,K){"use strict";K.d(Ne,"d",function(){return Q}),K.d(Ne,"c",function(){return N}),K.d(Ne,"e",function(){return J}),K.d(Ne,"b",function(){return B}),K.d(Ne,"a",function(){return H});var te=K("m3rI");function Q(F){var k=!0;if(F.length>0){for(var I=0;I<F.length;I++)if(F[I].compile_success==0||!F[I].compile_success){k=!1;break}}else k=!1;return k}function N(F){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],_=0;_<F.length;_++){var v=F[_],p=k?"".concat(k,"/").concat(v.name):"".concat(v.name);I.push({title:v.name,isLeaf:!(v.type==="tree"),key:p})}return I}function J(F,k,I){for(var _=0;_<F.length;_++){var v=F[_];if(v.key===k){v.children=I;break}v.children&&J(v.children,k,I)}return F}function B(F,k,I){var _;return function(){var v=this,p=arguments,c=function(){_=null,I||F.apply(v,p)},a=I&&!_;clearTimeout(_),_=setTimeout(c,k),a&&F.apply(v,p)}}var D=!0,H=te.a.API_SERVER},BlwA:function(qe,Ne,K){"use strict";var te=K("9og8"),Q=K("miYZ"),N=K("tsqr"),J=K("tJVT"),B=K("WmNS"),D=K.n(B),H=K("q1tI"),F=K.n(H),k=K("Ty5D"),I=K("ErOA"),_=K("m3rI"),v=K("DR4n"),p=K.n(v),c=function(o,r){for(var s=o.split(","),d=s[0].match(/:(.*?);/)[1],R=atob(s[1]),A=R.length,T=new Uint8Array(A);A--;)T[A]=R.charCodeAt(A);return new Blob([T],{type:d})},a=Object(H.forwardRef)(function(l,o){var r=l.time,s=l.number,d=l.supportCamera,R=l.take_photo,A=l.update,T=l.id,w=Object(H.useRef)(),C=Object(H.useRef)(),b=Object(k.i)(),m=Object(H.useState)([]),h=Object(J.a)(m,2),u=h[0],x=h[1],g=Object(H.useState)(0),y=Object(J.a)(g,2),M=y[0],E=y[1],j=Object(H.useState)(""),G=Object(J.a)(j,2),U=G[0],O=G[1],X=Object(H.useState)(),$=Object(J.a)(X,2),se=$[0],ce=$[1],Pe=Object(H.useState)(0),Se=Object(J.a)(Pe,2),Re=Se[0],Oe=Se[1];Object(H.useEffect)(function(){return ue(),function(){ve(),Me()}},[]),Object(H.useEffect)(function(){M===2&&r&&s>0&&(be(),Oe(1))},[r]),Object(H.useEffect)(function(){if(Re===0)return;if(Re===2)clearInterval(se);else{var ke=0,Fe=setInterval(function(){u.includes(ke)&&ne(),ke++},1e3);ce(Fe)}return function(){return clearInterval(se)}},[Re]),Object(H.useImperativeHandle)(o,function(){return{handlePhoto:ne}});var Me=function(){Oe(2)},be=function(){var Fe=r/s,Ie=[];function He($e,tt){return parseInt(Math.floor(Math.random()*(tt-$e+1))+$e)}new Array(s).fill(0).map(function($e,tt){R?Ie.push(He(Fe*tt,Fe*(tt+1))):tt==0?Ie.push(0):Ie.push(He(Fe*tt,Fe*(tt+1)))}),u=Ie,x([].concat(Ie)),console.log(Ie)},ue=function(){navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(Fe){var Ie=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return Ie?new Promise(function(He,$e){Ie.call(navigator,Fe,He,$e)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({video:{width:640,height:480}}).then(function(Fe){d&&d(2),E(2),"srcObject"in w.current?w.current.srcObject=Fe:w.current.src=window.URL.createObjectURL(Fe),w.current.onloadedmetadata=function(Ie){w.current.play()},w.current.addEventListener("ended",function(){console.log("\u64AD\u653E\u7ED3\u675F"),Me(),N.b.error({content:"\u60A8\u5DF2\u7ECF\u5173\u95ED\u4E86\u6444\u50CF\u5934\uFF0C\u8BF7\u572810\u79D2\u949F\u5185\u6062\u590D\u6444\u50CF\u5934\uFF0C\u5426\u5219\u5C06\u63A8\u51FA\u8003\u8BD5",duration:10,key:9998})},!1)}).catch(function(Fe){E(1),d&&d(1),Fe.message==="Permission denied"||Fe.name==="NotAllowedError"?N.b.error("\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"):N.b.error("\u6444\u50CF\u5934\u83B7\u53D6\u5931\u8D25\uFF0C\u6216\u60A8\u5DF2\u62D2\u7EDD\u4E86\u83B7\u53D6\u6444\u50CF\u5934"),console.log("errname: "+Fe.name),console.log("err: "+Fe.message)})},ne=function(){try{C.current.width=w.current.videoWidth,C.current.height=w.current.videoHeight;var Fe=C.current.getContext("2d");Fe.drawImage(w.current,0,0,C.current.width,C.current.height),O(C.current.toDataURL("image/png")),le(C.current.toDataURL("image/png"))}catch(Ie){}},ve=function(){try{var Fe=w.current.srcObject,Ie=Fe.getTracks();Ie.forEach(function(He){He.stop()}),w.current.srcObject=null}catch(He){}},le=function(){var ke=Object(te.a)(D.a.mark(function Fe(Ie){var He,$e;return D.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:He=new FormData,He.append("file",c(Ie,"1")),He.append("1","123"),$e=new window.XMLHttpRequest,$e.withCredentials=!0,$e.addEventListener("load",function(Je){var Ye=JSON.parse(Je.target.responseText);Object(I.a)("/api/exercises/".concat(T,"/upload_photo.json"),{method:"post",body:{attachment_id:Ye.id}})},!1),$e.addEventListener("error",function(Je){console.error(Je)},!1),$e.open("POST","".concat(_.a.API_SERVER,"/api/attachments.json")),$e.send(He);case 9:case"end":return Qe.stop()}},Fe)}));return function(Ie){return ke.apply(this,arguments)}}();return F.a.createElement(F.a.Fragment,null,M!==3&&F.a.createElement("aside",{className:p.a.video,id:"screenshot"},M===0&&F.a.createElement("span",null,"\u6B63\u5728\u5F00\u542F\u6444\u50CF\u5934..."),M===1&&F.a.createElement("span",null,"\u6444\u50CF\u5934\u5F00\u542F\u5931\u8D25"),M===2&&F.a.createElement("div",null,F.a.createElement("video",{width:"288",ref:w,autoPlay:!0}),F.a.createElement("canvas",{style:{display:"none"},ref:C}))))});Ne.a=a},"C+DQ":function(qe,Ne,K){},DR4n:function(qe,Ne,K){qe.exports={flex_box_center:"flex_box_center___2zmmW",flex_space_between:"flex_space_between___3nCIw",flex_box_vertical_center:"flex_box_vertical_center___1PFij",flex_box_center_end:"flex_box_center_end___2FA05",flex_box_column:"flex_box_column___2k0kx",video:"video___1mYnG"}},DlQD:function(qe,Ne,K){(function(te,Q){qe.exports=Q()})(this,function(){"use strict";function te(xe,fe){for(var ge=0;ge<fe.length;ge++){var re=fe[ge];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(xe,re.key,re)}}function Q(xe,fe,ge){return fe&&te(xe.prototype,fe),ge&&te(xe,ge),xe}function N(xe,fe){if(!xe)return;if(typeof xe=="string")return J(xe,fe);var ge=Object.prototype.toString.call(xe).slice(8,-1);if(ge==="Object"&&xe.constructor&&(ge=xe.constructor.name),ge==="Map"||ge==="Set")return Array.from(xe);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return J(xe,fe)}function J(xe,fe){(fe==null||fe>xe.length)&&(fe=xe.length);for(var ge=0,re=new Array(fe);ge<fe;ge++)re[ge]=xe[ge];return re}function B(xe,fe){var ge;if(typeof Symbol=="undefined"||xe[Symbol.iterator]==null){if(Array.isArray(xe)||(ge=N(xe))||fe&&xe&&typeof xe.length=="number"){ge&&(xe=ge);var re=0;return function(){return re>=xe.length?{done:!0}:{done:!1,value:xe[re++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ge=xe[Symbol.iterator](),ge.next.bind(ge)}function D(xe,fe){return fe={exports:{}},xe(fe,fe.exports),fe.exports}var H=D(function(xe){function fe(){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 ge(re){xe.exports.defaults=re}xe.exports={defaults:fe(),getDefaults:fe,changeDefaults:ge}}),F=H.defaults,k=H.getDefaults,I=H.changeDefaults,_=/[&<>"']/,v=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(fe){return a[fe]};function o(xe,fe){if(fe){if(_.test(xe))return xe.replace(v,l)}else if(p.test(xe))return xe.replace(c,l);return xe}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(xe){return xe.replace(r,function(fe,ge){return ge=ge.toLowerCase(),ge==="colon"?":":ge.charAt(0)==="#"?ge.charAt(1)==="x"?String.fromCharCode(parseInt(ge.substring(2),16)):String.fromCharCode(+ge.substring(1)):""})}var d=/(^|[^\[])\^/g;function R(xe,fe){xe=xe.source||xe,fe=fe||"";var ge={replace:function(ae,de){return de=de.source||de,de=de.replace(d,"$1"),xe=xe.replace(ae,de),ge},getRegex:function(){return new RegExp(xe,fe)}};return ge}var A=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function w(xe,fe,ge){if(xe){var re;try{re=decodeURIComponent(s(ge)).replace(A,"").toLowerCase()}catch(ae){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}fe&&!T.test(ge)&&(ge=u(fe,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(ae){return null}return ge}var C={},b=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(xe,fe){C[" "+xe]||(b.test(xe)?C[" "+xe]=xe+"/":C[" "+xe]=M(xe,"/",!0)),xe=C[" "+xe];var ge=xe.indexOf(":")===-1;return fe.substring(0,2)==="//"?ge?fe:xe.replace(m,"$1")+fe:fe.charAt(0)==="/"?ge?fe:xe.replace(h,"$1")+fe:xe+fe}var x={exec:function(){}};function g(xe){for(var fe=1,ge,re;fe<arguments.length;fe++){ge=arguments[fe];for(re in ge)Object.prototype.hasOwnProperty.call(ge,re)&&(xe[re]=ge[re])}return xe}function y(xe,fe){var ge=xe.replace(/\|/g,function(de,ye,_e){for(var je=!1,ot=ye;--ot>=0&&_e[ot]==="\\";)je=!je;return je?"|":" |"}),re=ge.split(/ \|/),ae=0;if(re.length>fe)re.splice(fe);else for(;re.length<fe;)re.push("");for(;ae<re.length;ae++)re[ae]=re[ae].trim().replace(/\\\|/g,"|");return re}function M(xe,fe,ge){var re=xe.length;if(re===0)return"";for(var ae=0;ae<re;){var de=xe.charAt(re-ae-1);if(de===fe&&!ge)ae++;else if(de!==fe&&ge)ae++;else break}return xe.substr(0,re-ae)}function E(xe,fe){if(xe.indexOf(fe[1])===-1)return-1;for(var ge=xe.length,re=0,ae=0;ae<ge;ae++)if(xe[ae]==="\\")ae++;else if(xe[ae]===fe[0])re++;else if(xe[ae]===fe[1]&&(re--,re<0))return ae;return-1}function j(xe){xe&&xe.sanitize&&!xe.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 G={escape:o,unescape:s,edit:R,cleanUrl:w,resolveUrl:u,noopTest:x,merge:g,splitCells:y,rtrim:M,findClosingBracket:E,checkSanitizeDeprecation:j},U=H.defaults,O=G.rtrim,X=G.splitCells,$=G.escape,se=G.findClosingBracket;function ce(xe,fe,ge){var re=fe.href,ae=fe.title?$(fe.title):null,de=xe[1].replace(/\\([\[\]])/g,"$1");return xe[0].charAt(0)!=="!"?{type:"link",raw:ge,href:re,title:ae,text:de}:{type:"image",raw:ge,href:re,title:ae,text:$(de)}}function Pe(xe,fe){var ge=xe.match(/^(\s+)(?:```)/);if(ge===null)return fe;var re=ge[1];return fe.split(`
`).map(function(ae){var de=ae.match(/^\s+/);if(de===null)return ae;var ye=de[0];return ye.length>=re.length?ae.slice(re.length):ae}).join(`
`)}var Se=function(){function xe(ge){this.options=ge||U}var fe=xe.prototype;return fe.space=function(re){var ae=this.rules.block.newline.exec(re);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
`}},fe.code=function(re,ae){var de=this.rules.block.code.exec(re);if(de){var ye=ae[ae.length-1];if(ye&&ye.type==="paragraph")return{raw:de[0],text:de[0].trimRight()};var _e=de[0].replace(/^ {4}/gm,"");return{type:"code",raw:de[0],codeBlockStyle:"indented",text:this.options.pedantic?_e:O(_e,`
`)}}},fe.fences=function(re){var ae=this.rules.block.fences.exec(re);if(ae){var de=ae[0],ye=Pe(de,ae[3]||"");return{type:"code",raw:de,lang:ae[2]?ae[2].trim():ae[2],text:ye}}},fe.heading=function(re){var ae=this.rules.block.heading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},fe.nptable=function(re){var ae=this.rules.block.nptable.exec(re);if(ae){var de={type:"table",header:X(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[],raw:ae[0]};if(de.header.length===de.align.length){var ye=de.align.length,_e;for(_e=0;_e<ye;_e++)/^ *-+: *$/.test(de.align[_e])?de.align[_e]="right":/^ *:-+: *$/.test(de.align[_e])?de.align[_e]="center":/^ *:-+ *$/.test(de.align[_e])?de.align[_e]="left":de.align[_e]=null;for(ye=de.cells.length,_e=0;_e<ye;_e++)de.cells[_e]=X(de.cells[_e],de.header.length);return de}}},fe.hr=function(re){var ae=this.rules.block.hr.exec(re);if(ae)return{type:"hr",raw:ae[0]}},fe.blockquote=function(re){var ae=this.rules.block.blockquote.exec(re);if(ae){var de=ae[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ae[0],text:de}}},fe.list=function(re){var ae=this.rules.block.list.exec(re);if(ae){for(var de=ae[0],ye=ae[2],_e=ye.length>1,je=ye[ye.length-1]===")",ot={type:"list",raw:de,ordered:_e,start:_e?+ye.slice(0,-1):"",loose:!1,items:[]},bt=ae[0].match(this.rules.block.item),wt=!1,Et,pt,Xe,Ge,De,oe,he,Ze=bt.length,Ue=0;Ue<Ze;Ue++)Et=bt[Ue],de=Et,pt=Et.length,Et=Et.replace(/^ *([*+-]|\d+[.)]) */,""),~Et.indexOf(`
`)&&(pt-=Et.length,Et=this.options.pedantic?Et.replace(/^ {1,4}/gm,""):Et.replace(new RegExp("^ {1,"+pt+"}","gm"),"")),Ue!==Ze-1&&(Xe=this.rules.block.bullet.exec(bt[Ue+1])[0],(_e?Xe.length===1||!je&&Xe[Xe.length-1]===")":Xe.length>1||this.options.smartLists&&Xe!==ye)&&(Ge=bt.slice(Ue+1).join(`
`),ot.raw=ot.raw.substring(0,ot.raw.length-Ge.length),Ue=Ze-1)),De=wt||/\n\n(?!\s*$)/.test(Et),Ue!==Ze-1&&(wt=Et.charAt(Et.length-1)===`
`,De||(De=wt)),De&&(ot.loose=!0),oe=/^\[[ xX]\] /.test(Et),he=void 0,oe&&(he=Et[1]!==" ",Et=Et.replace(/^\[[ xX]\] +/,"")),ot.items.push({type:"list_item",raw:de,task:oe,checked:he,loose:De,text:Et});return ot}},fe.html=function(re){var ae=this.rules.block.html.exec(re);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):$(ae[0]):ae[0]}},fe.def=function(re){var ae=this.rules.block.def.exec(re);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var de=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:de,raw:ae[0],href:ae[2],title:ae[3]}}},fe.table=function(re){var ae=this.rules.block.table.exec(re);if(ae){var de={type:"table",header:X(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[]};if(de.header.length===de.align.length){de.raw=ae[0];var ye=de.align.length,_e;for(_e=0;_e<ye;_e++)/^ *-+: *$/.test(de.align[_e])?de.align[_e]="right":/^ *:-+: *$/.test(de.align[_e])?de.align[_e]="center":/^ *:-+ *$/.test(de.align[_e])?de.align[_e]="left":de.align[_e]=null;for(ye=de.cells.length,_e=0;_e<ye;_e++)de.cells[_e]=X(de.cells[_e].replace(/^ *\| *| *\| *$/g,""),de.header.length);return de}}},fe.lheading=function(re){var ae=this.rules.block.lheading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[2].charAt(0)==="="?1:2,text:ae[1]}},fe.paragraph=function(re){var ae=this.rules.block.paragraph.exec(re);if(ae)return{type:"paragraph",raw:ae[0],text:ae[1].charAt(ae[1].length-1)===`
`?ae[1].slice(0,-1):ae[1]}},fe.text=function(re,ae){var de=this.rules.block.text.exec(re);if(de){var ye=ae[ae.length-1];return ye&&ye.type==="text"?{raw:de[0],text:de[0]}:{type:"text",raw:de[0],text:de[0]}}},fe.escape=function(re){var ae=this.rules.inline.escape.exec(re);if(ae)return{type:"escape",raw:ae[0],text:$(ae[1])}},fe.tag=function(re,ae,de){var ye=this.rules.inline.tag.exec(re);if(ye)return!ae&&/^<a /i.test(ye[0])?ae=!0:ae&&/^<\/a>/i.test(ye[0])&&(ae=!1),!de&&/^<(pre|code|kbd|script)(\s|>)/i.test(ye[0])?de=!0:de&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ye[0])&&(de=!1),{type:this.options.sanitize?"text":"html",raw:ye[0],inLink:ae,inRawBlock:de,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):$(ye[0]):ye[0]}},fe.link=function(re){var ae=this.rules.inline.link.exec(re);if(ae){var de=se(ae[2],"()");if(de>-1){var ye=ae[0].indexOf("!")===0?5:4,_e=ye+ae[1].length+de;ae[2]=ae[2].substring(0,de),ae[0]=ae[0].substring(0,_e).trim(),ae[3]=""}var je=ae[2],ot="";if(this.options.pedantic){var bt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(je);bt?(je=bt[1],ot=bt[3]):ot=""}else ot=ae[3]?ae[3].slice(1,-1):"";je=je.trim().replace(/^<([\s\S]*)>$/,"$1");var wt=ce(ae,{href:je&&je.replace(this.rules.inline._escapes,"$1"),title:ot&&ot.replace(this.rules.inline._escapes,"$1")},ae[0]);return wt}},fe.reflink=function(re,ae){var de;if((de=this.rules.inline.reflink.exec(re))||(de=this.rules.inline.nolink.exec(re))){var ye=(de[2]||de[1]).replace(/\s+/g," ");if(ye=ae[ye.toLowerCase()],!ye||!ye.href){var _e=de[0].charAt(0);return{type:"text",raw:_e,text:_e}}var je=ce(de,ye,de[0]);return je}},fe.strong=function(re,ae,de){de===void 0&&(de="");var ye=this.rules.inline.strong.start.exec(re);if(ye&&(!ye[1]||ye[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ae=ae.slice(-1*re.length);var _e=ye[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;_e.lastIndex=0;for(var je;(ye=_e.exec(ae))!=null;)if(je=this.rules.inline.strong.middle.exec(ae.slice(0,ye.index+3)),je)return{type:"strong",raw:re.slice(0,je[0].length),text:re.slice(2,je[0].length-2)}}},fe.em=function(re,ae,de){de===void 0&&(de="");var ye=this.rules.inline.em.start.exec(re);if(ye&&(!ye[1]||ye[1]&&(de===""||this.rules.inline.punctuation.exec(de)))){ae=ae.slice(-1*re.length);var _e=ye[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;_e.lastIndex=0;for(var je;(ye=_e.exec(ae))!=null;)if(je=this.rules.inline.em.middle.exec(ae.slice(0,ye.index+2)),je)return{type:"em",raw:re.slice(0,je[0].length),text:re.slice(1,je[0].length-1)}}},fe.codespan=function(re){var ae=this.rules.inline.code.exec(re);if(ae){var de=ae[2].replace(/\n/g," "),ye=/[^ ]/.test(de),_e=de.startsWith(" ")&&de.endsWith(" ");return ye&&_e&&(de=de.substring(1,de.length-1)),de=$(de,!0),{type:"codespan",raw:ae[0],text:de}}},fe.br=function(re){var ae=this.rules.inline.br.exec(re);if(ae)return{type:"br",raw:ae[0]}},fe.del=function(re){var ae=this.rules.inline.del.exec(re);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},fe.autolink=function(re,ae){var de=this.rules.inline.autolink.exec(re);if(de){var ye,_e;return de[2]==="@"?(ye=$(this.options.mangle?ae(de[1]):de[1]),_e="mailto:"+ye):(ye=$(de[1]),_e=ye),{type:"link",raw:de[0],text:ye,href:_e,tokens:[{type:"text",raw:ye,text:ye}]}}},fe.url=function(re,ae){var de;if(de=this.rules.inline.url.exec(re)){var ye,_e;if(de[2]==="@")ye=$(this.options.mangle?ae(de[0]):de[0]),_e="mailto:"+ye;else{var je;do je=de[0],de[0]=this.rules.inline._backpedal.exec(de[0])[0];while(je!==de[0]);ye=$(de[0]),de[1]==="www."?_e="http://"+ye:_e=ye}return{type:"link",raw:de[0],text:ye,href:_e,tokens:[{type:"text",raw:ye,text:ye}]}}},fe.inlineText=function(re,ae,de){var ye=this.rules.inline.text.exec(re);if(ye){var _e;return ae?_e=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):$(ye[0]):ye[0]:_e=$(this.options.smartypants?de(ye[0]):ye[0]),{type:"text",raw:ye[0],text:_e}}},xe}(),Re=G.noopTest,Oe=G.edit,Me=G.merge,be={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:Re,table:Re,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Oe(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Oe(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Oe(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Oe(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Oe(be._paragraph).replace("hr",be.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",be._tag).getRegex(),be.blockquote=Oe(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Me({},be),be.gfm=Me({},be.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*|$)"}),be.gfm.nptable=Oe(be.gfm.nptable).replace("hr",be.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",be._tag).getRegex(),be.gfm.table=Oe(be.gfm.table).replace("hr",be.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",be._tag).getRegex(),be.pedantic=Me({},be.normal,{html:Oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._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:Re,paragraph:Oe(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Re,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:Re,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ue._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ue.punctuation=Oe(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=Oe(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=Oe(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=Oe(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=Oe(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=Oe(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=Oe(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=Oe(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=Oe(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=Oe(ue._blockSkip,"g").getRegex(),ue.overlapSkip=Oe(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ue.autolink=Oe(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=Oe(ue.tag).replace("comment",be._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=Oe(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=Oe(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=Oe(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Me({},ue),ue.pedantic=Me({},ue.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Oe(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:Oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Me({},ue.normal,{escape:Oe(ue.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),ue.gfm.url=Oe(ue.gfm.url,"i").replace("email",ue.gfm._extended_email).getRegex(),ue.breaks=Me({},ue.gfm,{br:Oe(ue.br).replace("{2,}","*").getRegex(),text:Oe(ue.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:be,inline:ue},ve=H.defaults,le=ne.block,ke=ne.inline;function Fe(xe){return xe.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 Ie(xe){var fe="",ge,re,ae=xe.length;for(ge=0;ge<ae;ge++)re=xe.charCodeAt(ge),Math.random()>.5&&(re="x"+re.toString(16)),fe+="&#"+re+";";return fe}var He=function(){function xe(ge){this.tokens=[],this.tokens.links=Object.create(null),this.options=ge||ve,this.options.tokenizer=this.options.tokenizer||new Se,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:le.normal,inline:ke.normal};this.options.pedantic?(re.block=le.pedantic,re.inline=ke.pedantic):this.options.gfm&&(re.block=le.gfm,this.options.breaks?re.inline=ke.breaks:re.inline=ke.gfm),this.tokenizer.rules=re}xe.lex=function(re,ae){var de=new xe(ae);return de.lex(re)};var fe=xe.prototype;return fe.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},fe.blockTokens=function(re,ae,de){ae===void 0&&(ae=[]),de===void 0&&(de=!0),re=re.replace(/^ +$/gm,"");for(var ye,_e,je,ot;re;){if(ye=this.tokenizer.space(re)){re=re.substring(ye.raw.length),ye.type&&ae.push(ye);continue}if(ye=this.tokenizer.code(re,ae)){re=re.substring(ye.raw.length),ye.type?ae.push(ye):(ot=ae[ae.length-1],ot.raw+=`
`+ye.raw,ot.text+=`
`+ye.text);continue}if(ye=this.tokenizer.fences(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(ye=this.tokenizer.heading(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(ye=this.tokenizer.nptable(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(ye=this.tokenizer.hr(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(ye=this.tokenizer.blockquote(re)){re=re.substring(ye.raw.length),ye.tokens=this.blockTokens(ye.text,[],de),ae.push(ye);continue}if(ye=this.tokenizer.list(re)){for(re=re.substring(ye.raw.length),je=ye.items.length,_e=0;_e<je;_e++)ye.items[_e].tokens=this.blockTokens(ye.items[_e].text,[],!1);ae.push(ye);continue}if(ye=this.tokenizer.html(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(de&&(ye=this.tokenizer.def(re))){re=re.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(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(ye=this.tokenizer.lheading(re)){re=re.substring(ye.raw.length),ae.push(ye);continue}if(de&&(ye=this.tokenizer.paragraph(re))){re=re.substring(ye.raw.length),ae.push(ye);continue}if(ye=this.tokenizer.text(re,ae)){re=re.substring(ye.raw.length),ye.type?ae.push(ye):(ot=ae[ae.length-1],ot.raw+=`
`+ye.raw,ot.text+=`
`+ye.text);continue}if(re){var bt="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(bt);break}else throw new Error(bt)}}return ae},fe.inline=function(re){var ae,de,ye,_e,je,ot,bt=re.length;for(ae=0;ae<bt;ae++){ot=re[ae];switch(ot.type){case"paragraph":case"text":case"heading":{ot.tokens=[],this.inlineTokens(ot.text,ot.tokens);break}case"table":{for(ot.tokens={header:[],cells:[]},_e=ot.header.length,de=0;de<_e;de++)ot.tokens.header[de]=[],this.inlineTokens(ot.header[de],ot.tokens.header[de]);for(_e=ot.cells.length,de=0;de<_e;de++)for(je=ot.cells[de],ot.tokens.cells[de]=[],ye=0;ye<je.length;ye++)ot.tokens.cells[de][ye]=[],this.inlineTokens(je[ye],ot.tokens.cells[de][ye]);break}case"blockquote":{this.inline(ot.tokens);break}case"list":{for(_e=ot.items.length,de=0;de<_e;de++)this.inline(ot.items[de].tokens);break}}}return re},fe.inlineTokens=function(re,ae,de,ye,_e){ae===void 0&&(ae=[]),de===void 0&&(de=!1),ye===void 0&&(ye=!1),_e===void 0&&(_e="");var je,ot=re,bt;if(this.tokens.links){var wt=Object.keys(this.tokens.links);if(wt.length>0)for(;(bt=this.tokenizer.rules.inline.reflinkSearch.exec(ot))!=null;)wt.includes(bt[0].slice(bt[0].lastIndexOf("[")+1,-1))&&(ot=ot.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+ot.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(bt=this.tokenizer.rules.inline.blockSkip.exec(ot))!=null;)ot=ot.slice(0,bt.index)+"["+"a".repeat(bt[0].length-2)+"]"+ot.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(je=this.tokenizer.escape(re)){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.tag(re,de,ye)){re=re.substring(je.raw.length),de=je.inLink,ye=je.inRawBlock,ae.push(je);continue}if(je=this.tokenizer.link(re)){re=re.substring(je.raw.length),je.type==="link"&&(je.tokens=this.inlineTokens(je.text,[],!0,ye)),ae.push(je);continue}if(je=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(je.raw.length),je.type==="link"&&(je.tokens=this.inlineTokens(je.text,[],!0,ye)),ae.push(je);continue}if(je=this.tokenizer.strong(re,ot,_e)){re=re.substring(je.raw.length),je.tokens=this.inlineTokens(je.text,[],de,ye),ae.push(je);continue}if(je=this.tokenizer.em(re,ot,_e)){re=re.substring(je.raw.length),je.tokens=this.inlineTokens(je.text,[],de,ye),ae.push(je);continue}if(je=this.tokenizer.codespan(re)){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.br(re)){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.del(re)){re=re.substring(je.raw.length),je.tokens=this.inlineTokens(je.text,[],de,ye),ae.push(je);continue}if(je=this.tokenizer.autolink(re,Ie)){re=re.substring(je.raw.length),ae.push(je);continue}if(!de&&(je=this.tokenizer.url(re,Ie))){re=re.substring(je.raw.length),ae.push(je);continue}if(je=this.tokenizer.inlineText(re,ye,Fe)){re=re.substring(je.raw.length),_e=je.raw.slice(-1),ae.push(je);continue}if(re){var Et="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return ae},Q(xe,null,[{key:"rules",get:function(){return{block:le,inline:ke}}}]),xe}(),$e=H.defaults,tt=G.cleanUrl,Qe=G.escape,Je=function(){function xe(ge){this.options=ge||$e}var fe=xe.prototype;return fe.code=function(re,ae,de){var ye=(ae||"").match(/\S*/)[0];if(this.options.highlight){var _e=this.options.highlight(re,ye);_e!=null&&_e!==re&&(de=!0,re=_e)}return ye?'<pre><code class="'+this.options.langPrefix+Qe(ye,!0)+'">'+(de?re:Qe(re,!0))+`</code></pre>
`:"<pre><code>"+(de?re:Qe(re,!0))+`</code></pre>
`},fe.blockquote=function(re){return`<blockquote>
`+re+`</blockquote>
`},fe.html=function(re){return re},fe.heading=function(re,ae,de,ye){return this.options.headerIds?"<h"+ae+' id="'+this.options.headerPrefix+ye.slug(de)+'">'+re+"</h"+ae+`>
`:"<h"+ae+">"+re+"</h"+ae+`>
`},fe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},fe.list=function(re,ae,de){var ye=ae?"ol":"ul",_e=ae&&de!==1?' start="'+de+'"':"";return"<"+ye+_e+`>
`+re+"</"+ye+`>
`},fe.listitem=function(re){return"<li>"+re+`</li>
`},fe.checkbox=function(re){return"<input "+(re?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},fe.paragraph=function(re){return"<p>"+re+`</p>
`},fe.table=function(re,ae){return ae&&(ae="<tbody>"+ae+"</tbody>"),`<table>
<thead>
`+re+`</thead>
`+ae+`</table>
`},fe.tablerow=function(re){return`<tr>
`+re+`</tr>
`},fe.tablecell=function(re,ae){var de=ae.header?"th":"td",ye=ae.align?"<"+de+' align="'+ae.align+'">':"<"+de+">";return ye+re+"</"+de+`>
`},fe.strong=function(re){return"<strong>"+re+"</strong>"},fe.em=function(re){return"<em>"+re+"</em>"},fe.codespan=function(re){return"<code>"+re+"</code>"},fe.br=function(){return this.options.xhtml?"<br/>":"<br>"},fe.del=function(re){return"<del>"+re+"</del>"},fe.link=function(re,ae,de){if(re=tt(this.options.sanitize,this.options.baseUrl,re),re===null)return de;var ye='<a href="'+Qe(re)+'"';return ae&&(ye+=' title="'+ae+'"'),ye+=">"+de+"</a>",ye},fe.image=function(re,ae,de){if(re=tt(this.options.sanitize,this.options.baseUrl,re),re===null)return de;var ye='<img src="'+re+'" alt="'+de+'"';return ae&&(ye+=' title="'+ae+'"'),ye+=this.options.xhtml?"/>":">",ye},fe.text=function(re){return re},xe}(),Ye=function(){function xe(){}var fe=xe.prototype;return fe.strong=function(re){return re},fe.em=function(re){return re},fe.codespan=function(re){return re},fe.del=function(re){return re},fe.html=function(re){return re},fe.text=function(re){return re},fe.link=function(re,ae,de){return""+de},fe.image=function(re,ae,de){return""+de},fe.br=function(){return""},xe}(),gt=function(){function xe(){this.seen={}}var fe=xe.prototype;return fe.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var de=ae;do this.seen[de]++,ae=de+"-"+this.seen[de];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},xe}(),_t=H.defaults,vt=G.unescape,dt=function(){function xe(ge){this.options=ge||_t,this.options.renderer=this.options.renderer||new Je,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ye,this.slugger=new gt}xe.parse=function(re,ae){var de=new xe(ae);return de.parse(re)};var fe=xe.prototype;return fe.parse=function(re,ae){ae===void 0&&(ae=!0);var de="",ye,_e,je,ot,bt,wt,Et,pt,Xe,Ge,De,oe,he,Ze,Ue,ze,ct,Te,Ke=re.length;for(ye=0;ye<Ke;ye++){Ge=re[ye];switch(Ge.type){case"space":continue;case"hr":{de+=this.renderer.hr();continue}case"heading":{de+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,vt(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{de+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(pt="",Et="",ot=Ge.header.length,_e=0;_e<ot;_e++)Et+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[_e]),{header:!0,align:Ge.align[_e]});for(pt+=this.renderer.tablerow(Et),Xe="",ot=Ge.cells.length,_e=0;_e<ot;_e++){for(wt=Ge.tokens.cells[_e],Et="",bt=wt.length,je=0;je<bt;je++)Et+=this.renderer.tablecell(this.parseInline(wt[je]),{header:!1,align:Ge.align[je]});Xe+=this.renderer.tablerow(Et)}de+=this.renderer.table(pt,Xe);continue}case"blockquote":{Xe=this.parse(Ge.tokens),de+=this.renderer.blockquote(Xe);continue}case"list":{for(De=Ge.ordered,oe=Ge.start,he=Ge.loose,ot=Ge.items.length,Xe="",_e=0;_e<ot;_e++)Ue=Ge.items[_e],ze=Ue.checked,ct=Ue.task,Ze="",Ue.task&&(Te=this.renderer.checkbox(ze),he?Ue.tokens.length>0&&Ue.tokens[0].type==="text"?(Ue.tokens[0].text=Te+" "+Ue.tokens[0].text,Ue.tokens[0].tokens&&Ue.tokens[0].tokens.length>0&&Ue.tokens[0].tokens[0].type==="text"&&(Ue.tokens[0].tokens[0].text=Te+" "+Ue.tokens[0].tokens[0].text)):Ue.tokens.unshift({type:"text",text:Te}):Ze+=Te),Ze+=this.parse(Ue.tokens,he),Xe+=this.renderer.listitem(Ze,ct,ze);de+=this.renderer.list(Xe,De,oe);continue}case"html":{de+=this.renderer.html(Ge.text);continue}case"paragraph":{de+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(Xe=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;ye+1<Ke&&re[ye+1].type==="text";)Ge=re[++ye],Xe+=`
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);de+=ae?this.renderer.paragraph(Xe):Xe;continue}default:{var st='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(st);return}else throw new Error(st)}}}return de},fe.parseInline=function(re,ae){ae=ae||this.renderer;var de="",ye,_e,je=re.length;for(ye=0;ye<je;ye++){_e=re[ye];switch(_e.type){case"escape":{de+=ae.text(_e.text);break}case"html":{de+=ae.html(_e.text);break}case"link":{de+=ae.link(_e.href,_e.title,this.parseInline(_e.tokens,ae));break}case"image":{de+=ae.image(_e.href,_e.title,_e.text);break}case"strong":{de+=ae.strong(this.parseInline(_e.tokens,ae));break}case"em":{de+=ae.em(this.parseInline(_e.tokens,ae));break}case"codespan":{de+=ae.codespan(_e.text);break}case"br":{de+=ae.br();break}case"del":{de+=ae.del(this.parseInline(_e.tokens,ae));break}case"text":{de+=ae.text(_e.text);break}default:{var ot='Token with "'+_e.type+'" type was not found.';if(this.options.silent){console.error(ot);return}else throw new Error(ot)}}}return de},xe}(),Ct=G.merge,xt=G.checkSanitizeDeprecation,Le=G.escape,Ce=H.getDefaults,nt=H.changeDefaults,rt=H.defaults;function Be(xe,fe,ge){if(typeof xe=="undefined"||xe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof xe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(xe)+", string expected");if(typeof fe=="function"&&(ge=fe,fe=null),fe=Ct({},Be.defaults,fe||{}),xt(fe),ge){var re=fe.highlight,ae;try{ae=He.lex(xe,fe)}catch(je){return ge(je)}var de=function(ot){var bt;if(!ot)try{bt=dt.parse(ae,fe)}catch(wt){ot=wt}return fe.highlight=re,ot?ge(ot):ge(null,bt)};if(!re||re.length<3)return de();if(delete fe.highlight,!ae.length)return de();var ye=0;Be.walkTokens(ae,function(je){je.type==="code"&&(ye++,setTimeout(function(){re(je.text,je.lang,function(ot,bt){if(ot)return de(ot);bt!=null&&bt!==je.text&&(je.text=bt,je.escaped=!0),ye--,ye===0&&de()})},0))}),ye===0&&de();return}try{var _e=He.lex(xe,fe);return fe.walkTokens&&Be.walkTokens(_e,fe.walkTokens),dt.parse(_e,fe)}catch(je){if(je.message+=`
Please report this to https://github.com/markedjs/marked.`,fe.silent)return"<p>An error occurred:</p><pre>"+Le(je.message+"",!0)+"</pre>";throw je}}Be.options=Be.setOptions=function(xe){return Ct(Be.defaults,xe),nt(Be.defaults),Be},Be.getDefaults=Ce,Be.defaults=rt,Be.use=function(xe){var fe=Ct({},xe);if(xe.renderer&&function(){var re=Be.defaults.renderer||new Je,ae=function(_e){var je=re[_e];re[_e]=function(){for(var ot=arguments.length,bt=new Array(ot),wt=0;wt<ot;wt++)bt[wt]=arguments[wt];var Et=xe.renderer[_e].apply(re,bt);return Et===!1&&(Et=je.apply(re,bt)),Et}};for(var de in xe.renderer)ae(de);fe.renderer=re}(),xe.tokenizer&&function(){var re=Be.defaults.tokenizer||new Se,ae=function(_e){var je=re[_e];re[_e]=function(){for(var ot=arguments.length,bt=new Array(ot),wt=0;wt<ot;wt++)bt[wt]=arguments[wt];var Et=xe.tokenizer[_e].apply(re,bt);return Et===!1&&(Et=je.apply(re,bt)),Et}};for(var de in xe.tokenizer)ae(de);fe.tokenizer=re}(),xe.walkTokens){var ge=Be.defaults.walkTokens;fe.walkTokens=function(re){xe.walkTokens(re),ge&&ge(re)}}Be.setOptions(fe)},Be.walkTokens=function(xe,fe){for(var ge=B(xe),re;!(re=ge()).done;){var ae=re.value;fe(ae);switch(ae.type){case"table":{for(var de=B(ae.tokens.header),ye;!(ye=de()).done;){var _e=ye.value;Be.walkTokens(_e,fe)}for(var je=B(ae.tokens.cells),ot;!(ot=je()).done;)for(var bt=ot.value,wt=B(bt),Et;!(Et=wt()).done;){var pt=Et.value;Be.walkTokens(pt,fe)}break}case"list":{Be.walkTokens(ae.items,fe);break}default:ae.tokens&&Be.walkTokens(ae.tokens,fe)}}},Be.Parser=dt,Be.parser=dt.parse,Be.Renderer=Je,Be.TextRenderer=Ye,Be.Lexer=He,Be.lexer=He.lex,Be.Tokenizer=Se,Be.Slugger=gt,Be.parse=Be;var et=Be;return et})},E7E6:function(qe,Ne){qe.exports="data:image/png;base64,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"},ELLl:function(qe,Ne,K){(function(te){te(K("VrN/"))})(function(te){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=te.Pos;te.defineOption("autoCloseBrackets",!1,function(a,l,o){o&&o!=te.Init&&(a.removeKeyMap(B),a.state.closeBrackets=null),l&&(D(J(l,"pairs")),a.state.closeBrackets=l,a.addKeyMap(B))});function J(a,l){return l=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[l]!=null?a[l]:Q[l]}var B={Backspace:k,Enter:I};function D(a){for(var l=0;l<a.length;l++){var o=a.charAt(l),r="'"+o+"'";B[r]||(B[r]=H(o))}}D(Q.pairs+"`");function H(a){return function(l){return v(l,a)}}function F(a){var l=a.state.closeBrackets;if(!l||l.override)return l;var o=a.getModeAt(a.getCursor());return o.closeBrackets||l}function k(a){var l=F(a);if(!l||a.getOption("disableInput"))return te.Pass;for(var o=J(l,"pairs"),r=a.listSelections(),s=0;s<r.length;s++){if(!r[s].empty())return te.Pass;var d=p(a,r[s].head);if(!d||o.indexOf(d)%2!=0)return te.Pass}for(var s=r.length-1;s>=0;s--){var R=r[s].head;a.replaceRange("",N(R.line,R.ch-1),N(R.line,R.ch+1),"+delete")}}function I(a){var l=F(a),o=l&&J(l,"explode");if(!o||a.getOption("disableInput"))return te.Pass;for(var r=a.listSelections(),s=0;s<r.length;s++){if(!r[s].empty())return te.Pass;var d=p(a,r[s].head);if(!d||o.indexOf(d)%2!=0)return te.Pass}a.operation(function(){var R=a.lineSeparator()||`
`;a.replaceSelection(R+R,null),a.execCommand("goCharLeft"),r=a.listSelections();for(var A=0;A<r.length;A++){var T=r[A].head.line;a.indentLine(T,null,!0),a.indentLine(T+1,null,!0)}})}function _(a){var l=te.cmpPos(a.anchor,a.head)>0;return{anchor:new N(a.anchor.line,a.anchor.ch+(l?-1:1)),head:new N(a.head.line,a.head.ch+(l?1:-1))}}function v(a,l){var o=F(a);if(!o||a.getOption("disableInput"))return te.Pass;var r=J(o,"pairs"),s=r.indexOf(l);if(s==-1)return te.Pass;for(var d=J(o,"closeBefore"),R=J(o,"triples"),A=r.charAt(s+1)==l,T=a.listSelections(),w=s%2==0,C,b=0;b<T.length;b++){var m=T[b],h=m.head,u,x=a.getRange(h,N(h.line,h.ch+1));if(w&&!m.empty())u="surround";else if((A||!w)&&x==l)A&&c(a,h)?u="both":R.indexOf(l)>=0&&a.getRange(h,N(h.line,h.ch+3))==l+l+l?u="skipThree":u="skip";else if(A&&h.ch>1&&R.indexOf(l)>=0&&a.getRange(N(h.line,h.ch-2),h)==l+l){if(h.ch>2&&/\bstring/.test(a.getTokenTypeAt(N(h.line,h.ch-2))))return te.Pass;u="addFour"}else if(A){var g=h.ch==0?" ":a.getRange(N(h.line,h.ch-1),h);if(!te.isWordChar(x)&&g!=l&&!te.isWordChar(g))u="both";else return te.Pass}else if(w&&(x.length===0||/\s/.test(x)||d.indexOf(x)>-1))u="both";else return te.Pass;if(!C)C=u;else if(C!=u)return te.Pass}var y=s%2?r.charAt(s-1):l,M=s%2?l:r.charAt(s+1);a.operation(function(){if(C=="skip")a.execCommand("goCharRight");else if(C=="skipThree")for(var E=0;E<3;E++)a.execCommand("goCharRight");else if(C=="surround"){for(var j=a.getSelections(),E=0;E<j.length;E++)j[E]=y+j[E]+M;a.replaceSelections(j,"around"),j=a.listSelections().slice();for(var E=0;E<j.length;E++)j[E]=_(j[E]);a.setSelections(j)}else C=="both"?(a.replaceSelection(y+M,null),a.triggerElectric(y+M),a.execCommand("goCharLeft")):C=="addFour"&&(a.replaceSelection(y+y+y+y,"before"),a.execCommand("goCharRight"))})}function p(a,l){var o=a.getRange(N(l.line,l.ch-1),N(l.line,l.ch+1));return o.length==2?o:null}function c(a,l){var o=a.getTokenAt(N(l.line,l.ch+1));return/\bstring/.test(o.type)&&o.start==l.ch&&(l.ch==0||!/\bstring/.test(a.getTokenTypeAt(l)))}})},FOrL:function(qe,Ne,K){qe.exports=K.p+"static/nodata.a6b3f948.png"},FPkq:function(qe,Ne,K){qe.exports=K.p+"static/qrCode.dd0fe9b2.png"},GABl:function(qe,Ne){qe.exports="data:image/png;base64,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"},Gytx:function(qe,Ne){qe.exports=function(te,Q,N,J){var B=N?N.call(J,te,Q):void 0;if(B!==void 0)return!!B;if(te===Q)return!0;if(typeof te!="object"||!te||typeof Q!="object"||!Q)return!1;var D=Object.keys(te),H=Object.keys(Q);if(D.length!==H.length)return!1;for(var F=Object.prototype.hasOwnProperty.bind(Q),k=0;k<D.length;k++){var I=D[k];if(!F(I))return!1;var _=te[I],v=Q[I];if(B=N?N.call(J,_,v,I):void 0,B===!1||B===void 0&&_!==v)return!1}return!0}},HmJG:function(qe,Ne,K){},HpTS:function(qe,Ne,K){qe.exports=K.p+"static/small_program.f74069ec.png"},I8Z2:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return J}),K.d(Ne,"b",function(){return p}),K.d(Ne,"c",function(){return a});var te=K("q1tI"),Q=function(){var l=function(o,r){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,d){s.__proto__=d}||function(s,d){for(var R in d)d.hasOwnProperty(R)&&(s[R]=d[R])},l(o,r)};return function(o,r){l(o,r);function s(){this.constructor=o}o.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}(),N=te.createContext(null),J=function(l){Q(o,l);function o(){return l!==null&&l.apply(this,arguments)||this}return o.prototype.render=function(){return te.createElement(N.Provider,{value:this.props.store},this.props.children)},o}(te.Component),B=K("Gytx"),D=K.n(B),H=K("2mql"),F=K.n(H),k=function(){var l=function(o,r){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,d){s.__proto__=d}||function(s,d){for(var R in d)d.hasOwnProperty(R)&&(s[R]=d[R])},l(o,r)};return function(o,r){l(o,r);function s(){this.constructor=o}o.prototype=r===null?Object.create(r):(s.prototype=r.prototype,new s)}}(),I=function(){return I=Object.assign||function(l){for(var o,r=1,s=arguments.length;r<s;r++){o=arguments[r];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(l[d]=o[d])}return l},I.apply(this,arguments)};function _(l){return l.displayName||l.name||"Component"}var v=function(){return{}};function p(l,o){o===void 0&&(o={});var r=!!l,s=l||v;return function(R){var A=function(w){k(C,w);function C(b,m){var h=w.call(this,b,m)||this;return h.unsubscribe=null,h.handleChange=function(){if(!h.unsubscribe)return;var u=s(h.store.getState(),h.props);h.setState({subscribed:u})},h.store=h.context,h.state={subscribed:s(h.store.getState(),b),store:h.store,props:b},h}return C.getDerivedStateFromProps=function(b,m){return l&&l.length===2&&b!==m.props?{subscribed:s(m.store.getState(),b),props:b}:{props:b}},C.prototype.componentDidMount=function(){this.trySubscribe()},C.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},C.prototype.shouldComponentUpdate=function(b,m){return!D()(this.props,b)||!D()(this.state.subscribed,m.subscribed)},C.prototype.trySubscribe=function(){r&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},C.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},C.prototype.render=function(){var b=I(I(I({},this.props),this.state.subscribed),{store:this.store});return te.createElement(R,I({},b,{ref:this.props.miniStoreForwardedRef}))},C.displayName="Connect("+_(R)+")",C.contextType=N,C}(te.Component);if(o.forwardRef){var T=te.forwardRef(function(w,C){return te.createElement(A,I({},w,{miniStoreForwardedRef:C}))});return F()(T,R)}return F()(A,R)}}var c=function(){return c=Object.assign||function(l){for(var o,r=1,s=arguments.length;r<s;r++){o=arguments[r];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(l[d]=o[d])}return l},c.apply(this,arguments)};function a(l){var o=l,r=[];function s(A){o=c(c({},o),A);for(var T=0;T<r.length;T++)r[T]()}function d(){return o}function R(A){return r.push(A),function(){var w=r.indexOf(A);r.splice(w,1)}}return{setState:s,getState:d,subscribe:R}}},IBYe:function(qe,Ne,K){"use strict";function te(Q){return null}Ne.a=te},J66h:function(qe,Ne,K){(function(te){var Q,N;(function(J,B){qe.exports=B(J)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof te!="undefined"?te:this,function(J){"use strict";J=J||{};var B=J.Base64,D="2.6.4",H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",F=function(y){for(var M={},E=0,j=y.length;E<j;E++)M[y.charAt(E)]=E;return M}(H),k=String.fromCharCode,I=function(y){if(y.length<2){var M=y.charCodeAt(0);return M<128?y:M<2048?k(192|M>>>6)+k(128|M&63):k(224|M>>>12&15)+k(128|M>>>6&63)+k(128|M&63)}else{var M=65536+(y.charCodeAt(0)-55296)*1024+(y.charCodeAt(1)-56320);return k(240|M>>>18&7)+k(128|M>>>12&63)+k(128|M>>>6&63)+k(128|M&63)}},_=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,v=function(y){return y.replace(_,I)},p=function(y){var M=[0,2,1][y.length%3],E=y.charCodeAt(0)<<16|(y.length>1?y.charCodeAt(1):0)<<8|(y.length>2?y.charCodeAt(2):0),j=[H.charAt(E>>>18),H.charAt(E>>>12&63),M>=2?"=":H.charAt(E>>>6&63),M>=1?"=":H.charAt(E&63)];return j.join("")},c=J.btoa&&typeof J.btoa=="function"?function(y){return J.btoa(y)}:function(y){if(y.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return y.replace(/[\s\S]{1,3}/g,p)},a=function(y){return c(v(String(y)))},l=function(y){return y.replace(/[+\/]/g,function(M){return M=="+"?"-":"_"}).replace(/=/g,"")},o=function(y,M){return M?l(a(y)):a(y)},r=function(y){return o(y,!0)},s;J.Uint8Array&&(s=function(y,M){for(var E="",j=0,G=y.length;j<G;j+=3){var U=y[j],O=y[j+1],X=y[j+2],$=U<<16|O<<8|X;E+=H.charAt($>>>18)+H.charAt($>>>12&63)+(typeof O!="undefined"?H.charAt($>>>6&63):"=")+(typeof X!="undefined"?H.charAt($&63):"=")}return M?l(E):E});var d=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(y){switch(y.length){case 4:var M=(7&y.charCodeAt(0))<<18|(63&y.charCodeAt(1))<<12|(63&y.charCodeAt(2))<<6|63&y.charCodeAt(3),E=M-65536;return k((E>>>10)+55296)+k((E&1023)+56320);case 3:return k((15&y.charCodeAt(0))<<12|(63&y.charCodeAt(1))<<6|63&y.charCodeAt(2));default:return k((31&y.charCodeAt(0))<<6|63&y.charCodeAt(1))}},A=function(y){return y.replace(d,R)},T=function(y){var M=y.length,E=M%4,j=(M>0?F[y.charAt(0)]<<18:0)|(M>1?F[y.charAt(1)]<<12:0)|(M>2?F[y.charAt(2)]<<6:0)|(M>3?F[y.charAt(3)]:0),G=[k(j>>>16),k(j>>>8&255),k(j&255)];return G.length-=[0,0,2,1][E],G.join("")},w=J.atob&&typeof J.atob=="function"?function(y){return J.atob(y)}:function(y){return y.replace(/\S{1,4}/g,T)},C=function(y){return w(String(y).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(y){return A(w(y))},m=function(y){return String(y).replace(/[-_]/g,function(M){return M=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(y){return b(m(y))},u;J.Uint8Array&&(u=function(y){return Uint8Array.from(C(m(y)),function(M){return M.charCodeAt(0)})});var x=function(){var y=J.Base64;return J.Base64=B,y};if(J.Base64={VERSION:D,atob:C,btoa:c,fromBase64:h,toBase64:o,utob:v,encode:o,encodeURI:r,btou:A,decode:h,noConflict:x,fromUint8Array:s,toUint8Array:u},typeof Object.defineProperty=="function"){var g=function(y){return{value:y,enumerable:!1,writable:!0,configurable:!0}};J.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return h(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(y){return o(this,y)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return o(this,!0)}))}}return J.Meteor&&(Base64=J.Base64),qe.exports?qe.exports.Base64=J.Base64:!(Q=[],N=function(){return J.Base64}.apply(Ne,Q),N!==void 0&&(qe.exports=N)),{Base64:J.Base64}})}).call(this,K("IyRk"))},JWDV:function(qe,Ne,K){qe.exports=K.p+"static/charpter-white.5fa14f93.svg"},JeFH:function(qe,Ne){qe.exports="data:image/png;base64,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"},Jq4h:function(qe,Ne,K){qe.exports=K.p+"static/qrcode.2267e4d5.png"},LdHM:function(qe,Ne,K){"use strict";K.d(Ne,"b",function(){return d}),K.d(Ne,"a",function(){return A});var te=K("1OyB"),Q=K("vuIU"),N=K("Ji7U"),J=K("LK+K"),B=K("q1tI"),D=K("rePB"),H=K("Ff2n"),F=K("ODXe"),k=K("4IlW"),I=K("bX4T"),_=K("YrtM"),v=K("TSYQ"),p=K.n(v),c=K("+nKL"),a=K("8OUc"),l=function(X,$){var se=X.prefixCls,ce=X.id,Pe=X.flattenOptions,Se=X.childrenAsData,Re=X.values,Oe=X.searchValue,Me=X.multiple,be=X.defaultActiveFirstOption,ue=X.height,ne=X.itemHeight,ve=X.notFoundContent,le=X.open,ke=X.menuItemSelectedIcon,Fe=X.virtual,Ie=X.onSelect,He=X.onToggleOpen,$e=X.onActiveValue,tt=X.onScroll,Qe=X.onMouseEnter,Je="".concat(se,"-item"),Ye=Object(_.a)(function(){return Pe},[le,Pe],function(et,xe){return xe[0]&&et[1]!==xe[1]}),gt=B.useRef(null),_t=function(xe){xe.preventDefault()},vt=function(xe){gt.current&&gt.current.scrollTo({index:xe})},dt=function(xe){for(var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=Ye.length,re=0;re<ge;re+=1){var ae=(xe+re*fe+ge)%ge,de=Ye[ae],ye=de.group,_e=de.data;if(!ye&&!_e.disabled)return ae}return-1},Ct=B.useState(function(){return dt(0)}),xt=Object(F.a)(Ct,2),Le=xt[0],Ce=xt[1],nt=function(xe){Ce(xe);var fe=Ye[xe];if(!fe){$e(null,-1);return}$e(fe.data.value,xe)};B.useEffect(function(){nt(be!==!1?dt(0):-1)},[Ye.length,Oe]),B.useEffect(function(){var et=setTimeout(function(){if(!Me&&le&&Re.size===1){var xe=Array.from(Re)[0],fe=Ye.findIndex(function(ge){var re=ge.data;return re.value===xe});nt(fe),vt(fe)}});return function(){return clearTimeout(et)}},[le]);var rt=function(xe){xe!==void 0&&Ie(xe,{selected:!Re.has(xe)}),Me||He(!1)};if(B.useImperativeHandle($,function(){return{onKeyDown:function(xe){var fe=xe.which;switch(fe){case k.a.UP:case k.a.DOWN:{var ge=0;if(fe===k.a.UP?ge=-1:fe===k.a.DOWN&&(ge=1),ge!==0){var re=dt(Le+ge,ge);vt(re),nt(re)}break}case k.a.ENTER:{var ae=Ye[Le];ae&&!ae.data.disabled?rt(ae.data.value):rt(void 0),le&&xe.preventDefault();break}case k.a.ESC:He(!1)}},onKeyUp:function(){},scrollTo:function(xe){vt(xe)}}}),Ye.length===0)return B.createElement("div",{role:"listbox",id:"".concat(ce,"_list"),className:"".concat(Je,"-empty"),onMouseDown:_t},ve);function Be(et){var xe=Ye[et];if(!xe)return null;var fe=xe.data||{},ge=fe.value,re=fe.label,ae=fe.children,de=Object(I.a)(fe,!0),ye=Se?ae:re;return xe?B.createElement("div",Object.assign({"aria-label":typeof ye=="string"?ye:null},de,{key:et,role:"option",id:"".concat(ce,"_list_").concat(et),"aria-selected":Re.has(ge)}),ge):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(ce,"_list"),style:{height:0,width:0,overflow:"hidden"}},Be(Le-1),Be(Le),Be(Le+1)),B.createElement(c.a,{itemKey:"key",ref:gt,data:Ye,height:ue,itemHeight:ne,fullHeight:!1,onMouseDown:_t,onScroll:tt,virtual:Fe,onMouseEnter:Qe},function(et,xe){var fe,ge=et.group,re=et.groupOption,ae=et.data,de=ae.label,ye=ae.key;if(ge)return B.createElement("div",{className:p()(Je,"".concat(Je,"-group"))},de!==void 0?de:ye);var _e=ae.disabled,je=ae.value,ot=ae.title,bt=ae.children,wt=ae.style,Et=ae.className,pt=Object(H.a)(ae,["disabled","value","title","children","style","className"]),Xe=Re.has(je),Ge="".concat(Je,"-option"),De=p()(Je,Ge,Et,(fe={},Object(D.a)(fe,"".concat(Ge,"-grouped"),re),Object(D.a)(fe,"".concat(Ge,"-active"),Le===xe&&!_e),Object(D.a)(fe,"".concat(Ge,"-disabled"),_e),Object(D.a)(fe,"".concat(Ge,"-selected"),Xe),fe)),oe=Se?bt:de,he=!ke||typeof ke=="function"||Xe;return B.createElement("div",Object.assign({},pt,{"aria-selected":Xe,className:De,title:ot,onMouseMove:function(){if(Le===xe||_e)return;nt(xe)},onClick:function(){_e||rt(je)},style:wt}),B.createElement("div",{className:"".concat(Ge,"-content")},oe||je),B.isValidElement(ke)||Xe,he&&B.createElement(a.a,{className:"".concat(Je,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:Xe}},Xe?"\u2713":null))}))},o=B.forwardRef(l);o.displayName="OptionList";var r=o,s=function(){return null};s.isSelectOption=!0;var d=s,R=function(){return null};R.isSelectOptGroup=!0;var A=R,T=K("VTBJ"),w=K("Zm9Q");function C(O){var X=O.key,$=O.props,se=$.children,ce=$.value,Pe=Object(H.a)($,["children","value"]);return Object(T.a)({key:X,value:ce!==void 0?ce:X,children:se},Pe)}function b(O){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(w.a)(O).map(function($,se){if(!B.isValidElement($)||!$.type)return null;var ce=$.type.isSelectOptGroup,Pe=$.key,Se=$.props,Re=Se.children,Oe=Object(H.a)(Se,["children"]);return X||!ce?C($):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Pe===null?se:Pe,"__"),label:Pe},Oe),{},{options:b(Re)})}).filter(function($){return $})}var m=K("2Qr1"),h=K("qNPg"),u=K("U8pU"),x=K("Kwbf"),g=K("WKfj");function y(O){var X=O.mode,$=O.options,se=O.children,ce=O.backfill,Pe=O.allowClear,Se=O.placeholder,Re=O.getInputElement,Oe=O.showSearch,Me=O.onSearch,be=O.defaultOpen,ue=O.autoFocus,ne=O.labelInValue,ve=O.value,le=O.inputValue,ke=O.optionLabelProp,Fe=X==="multiple"||X==="tags",Ie=Oe!==void 0?Oe:Fe||X==="combobox",He=$||b(se);if(Object(x.a)(X!=="tags"||He.every(function(Je){return!Je.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),X==="tags"||X==="combobox"){var $e=He.some(function(Je){return Je.options?Je.options.some(function(Ye){return typeof("value"in Ye?Ye.value:Ye.key)=="number"}):typeof("value"in Je?Je.value:Je.key)=="number"});Object(x.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(x.a)(X!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(x.a)(X==="combobox"||!ce,"`backfill` only works with `combobox` mode."),Object(x.a)(X==="combobox"||!Re,"`getInputElement` only work with `combobox` mode."),Object(x.b)(X!=="combobox"||!Re||!Pe||!Se,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Me&&!Ie&&X!=="combobox"&&X!=="tags"&&Object(x.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(x.b)(!be||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ve!=null){var tt=Object(g.d)(ve);Object(x.a)(!ne||tt.every(function(Je){return Object(u.a)(Je)==="object"&&("key"in Je||"value"in Je)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(x.a)(!Fe||Array.isArray(ve),"`value` should be array when `mode` is `multiple` or `tags`")}if(se){var Qe=null;Object(w.a)(se).some(function(Je){if(!B.isValidElement(Je)||!Je.type)return!1;var Ye=Je.type;if(Ye.isSelectOption)return!1;if(Ye.isSelectOptGroup){var gt=Object(w.a)(Je.props.children).every(function(_t){return!B.isValidElement(_t)||!Je.type||_t.type.isSelectOption?!0:(Qe=_t.type,!1)});return!gt}return Qe=Ye,!0}),Qe&&Object(x.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Qe.displayName||Qe.name||Qe,"`.")),Object(x.a)(le===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=y,E=Object(h.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:b,flattenOptions:m.d,getLabeledValue:m.e,filterOptions:m.b,isValueDisabled:m.g,findValueOption:m.c,warningProps:M,fillOptionsWithMissingValue:m.a}),j=function(O){Object(N.a)($,O);var X=Object(J.a)($);function $(){var se;return Object(te.a)(this,$),se=X.apply(this,arguments),se.selectRef=B.createRef(),se.focus=function(){se.selectRef.current.focus()},se.blur=function(){se.selectRef.current.blur()},se}return Object(Q.a)($,[{key:"render",value:function(){return B.createElement(E,Object.assign({ref:this.selectRef},this.props))}}]),$}(B.Component);j.Option=d,j.OptGroup=A;var G=j,U=Ne.c=G},M8RZ:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return k});var te=K("fWQN"),Q=K("mtLc"),N=K("yKVA"),J=K("879j"),B=K("q1tI"),D=K.n(B),H=K("i8i4"),F=K.n(H),k=function(I){Object(N.a)(v,I);var _=Object(J.a)(v);function v(p){var c;Object(te.a)(this,v),c=_.call(this,p);var a=window.document;return c.node=a.createElement("div"),a.body.appendChild(c.node),c}return Object(Q.a)(v,[{key:"render",value:function(){var c=this.props.children;return Object(H.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),v}(D.a.Component)},Nmxd:function(qe,Ne){qe.exports="data:image/png;base64,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"},NvD2:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return D});var te=K("Kwbf");function Q(H,F){var k=new Set;return H.forEach(function(I){F.has(I)||k.add(I)}),k}function N(H){var F=H||{},k=F.disabled,I=F.disableCheckbox,_=F.checkable;return!!(k||I)||_===!1}function J(H,F,k,I){for(var _=new Set(H),v=new Set,p=0;p<=k;p+=1){var c=F.get(p)||new Set;c.forEach(function(r){var s=r.key,d=r.node,R=r.children,A=R===void 0?[]:R;_.has(s)&&!I(d)&&A.filter(function(T){return!I(T.node)}).forEach(function(T){_.add(T.key)})})}for(var a=new Set,l=k;l>=0;l-=1){var o=F.get(l)||new Set;o.forEach(function(r){var s=r.parent,d=r.node;if(I(d)||!r.parent||a.has(r.parent.key))return;if(I(r.parent.node)){a.add(s.key);return}var R=!0,A=!1;(s.children||[]).filter(function(T){return!I(T.node)}).forEach(function(T){var w=T.key,C=_.has(w);R&&!C&&(R=!1),!A&&(C||v.has(w))&&(A=!0)}),R&&_.add(s.key),A&&v.add(s.key),a.add(s.key)})}return{checkedKeys:Array.from(_),halfCheckedKeys:Array.from(Q(v,_))}}function B(H,F,k,I,_){for(var v=new Set(H),p=new Set(F),c=0;c<=I;c+=1){var a=k.get(c)||new Set;a.forEach(function(s){var d=s.key,R=s.node,A=s.children,T=A===void 0?[]:A;!v.has(d)&&!p.has(d)&&!_(R)&&T.filter(function(w){return!_(w.node)}).forEach(function(w){v.delete(w.key)})})}p=new Set;for(var l=new Set,o=I;o>=0;o-=1){var r=k.get(o)||new Set;r.forEach(function(s){var d=s.parent,R=s.node;if(_(R)||!s.parent||l.has(s.parent.key))return;if(_(s.parent.node)){l.add(d.key);return}var A=!0,T=!1;(d.children||[]).filter(function(w){return!_(w.node)}).forEach(function(w){var C=w.key,b=v.has(C);A&&!b&&(A=!1),!T&&(b||p.has(C))&&(T=!0)}),A||v.delete(d.key),T&&p.add(d.key),l.add(d.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(Q(p,v))}}function D(H,F,k,I){var _=[],v;I?v=I:v=N;var p=new Set(H.filter(function(o){var r=!!k[o];return r||_.push(o),r})),c=new Map,a=0;Object.keys(k).forEach(function(o){var r=k[o],s=r.level,d=c.get(s);d||(d=new Set,c.set(s,d)),d.add(r),a=Math.max(a,s)}),Object(te.a)(!_.length,"Tree missing follow keys: ".concat(_.slice(0,100).map(function(o){return"'".concat(o,"'")}).join(", ")));var l;return F===!0?l=J(p,c,a,v):l=B(p,F.halfCheckedKeys,c,a,v),l}},OLES:function(qe,Ne,K){"use strict";var te=K("U8pU"),Q=K("VTBJ"),N=K("Ff2n"),J=K("q1tI"),B=K("uciX"),D=K("7ixt"),H=function(p){var c=p.overlay,a=p.prefixCls,l=p.id,o=p.overlayInnerStyle;return J.createElement("div",{className:"".concat(a,"-inner"),id:l,role:"tooltip",style:o},typeof c=="function"?c():c)},F=H,k=function(p,c){var a=p.overlayClassName,l=p.trigger,o=l===void 0?["hover"]:l,r=p.mouseEnterDelay,s=r===void 0?0:r,d=p.mouseLeaveDelay,R=d===void 0?.1:d,A=p.overlayStyle,T=p.prefixCls,w=T===void 0?"rc-tooltip":T,C=p.children,b=p.onVisibleChange,m=p.afterVisibleChange,h=p.transitionName,u=p.animation,x=p.placement,g=x===void 0?"right":x,y=p.align,M=y===void 0?{}:y,E=p.destroyTooltipOnHide,j=E===void 0?!1:E,G=p.defaultVisible,U=p.getTooltipContainer,O=p.overlayInnerStyle,X=Object(N.a)(p,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),$=Object(J.useRef)(null);Object(J.useImperativeHandle)(c,function(){return $.current});var se=Object(Q.a)({},X);"visible"in p&&(se.popupVisible=p.visible);var ce=function(){var Me=p.arrowContent,be=Me===void 0?null:Me,ue=p.overlay,ne=p.id;return[J.createElement("div",{className:"".concat(w,"-arrow"),key:"arrow"},be),J.createElement(F,{key:"content",prefixCls:w,id:ne,overlay:ue,overlayInnerStyle:O})]},Pe=!1,Se=!1;if(typeof j=="boolean")Pe=j;else if(j&&Object(te.a)(j)==="object"){var Re=j.keepParent;Pe=Re===!0,Se=Re===!1}return J.createElement(B.a,Object.assign({popupClassName:a,prefixCls:w,popup:ce,action:o,builtinPlacements:D.a,popupPlacement:g,ref:$,popupAlign:M,getPopupContainer:U,onPopupVisibleChange:b,afterPopupVisibleChange:m,popupTransitionName:h,popupAnimation:u,defaultPopupVisible:G,destroyPopupOnHide:Pe,autoDestroy:Se,mouseLeaveDelay:R,popupStyle:A,mouseEnterDelay:s},se),C)},I=Object(J.forwardRef)(k),_=Ne.a=I},OZM5:function(qe,Ne,K){"use strict";K.d(Ne,"b",function(){return I}),K.d(Ne,"a",function(){return _}),K.d(Ne,"k",function(){return v}),K.d(Ne,"h",function(){return p}),K.d(Ne,"i",function(){return c}),K.d(Ne,"g",function(){return a}),K.d(Ne,"c",function(){return l}),K.d(Ne,"d",function(){return o}),K.d(Ne,"j",function(){return d}),K.d(Ne,"e",function(){return R}),K.d(Ne,"f",function(){return A});var te=K("KQm4"),Q=K("U8pU"),N=K("Ff2n"),J=K("q1tI"),B=K.n(J),D=K("Kwbf"),H=K("WaYH"),F=.25,k=2;function I(T,w){var C=T.slice(),b=C.indexOf(w);return b>=0&&C.splice(b,1),C}function _(T,w){var C=T.slice();return C.indexOf(w)===-1&&C.push(w),C}function v(T){return T.split("-")}function p(T,w){return"".concat(T,"-").concat(w)}function c(T){return T&&T.type&&T.type.isTreeNode}function a(T,w){var C=[T],b=w[T];function m(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(u){var x=u.key,g=u.children;C.push(x),m(g)})}return m(b.children),C}function l(T,w){var C=T.clientY,b=w.selectHandle.getBoundingClientRect(),m=b.top,h=b.bottom,u=b.height,x=Math.max(u*F,k);return C<=m+x?-1:C>=h-x?1:0}function o(T,w){if(!T)return;var C=w.multiple;return C?T.slice():T.length?[T[0]]:T}var r=function(w){return w};function s(T,w){if(!T)return[];var C=w||{},b=C.processProps,m=b===void 0?r:b,h=Array.isArray(T)?T:[T];return h.map(function(u){var x=u.children,g=Object(N.a)(u,["children"]),y=s(x,w);return B.a.createElement(H.a,Object.assign({},m(g)),y)})}function d(T){if(!T)return null;var w;if(Array.isArray(T))w={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(Q.a)(T)==="object")w={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(D.a)(!1,"`checkedKeys` is not an array or an object"),null;return w}function R(T,w){var C=new Set;function b(m){if(C.has(m))return;var h=w[m];if(!h)return;C.add(m);var u=h.parent,x=h.node;if(x.disabled)return;u&&b(u.key)}return(T||[]).forEach(function(m){b(m)}),Object(te.a)(C)}function A(T){var w={};return Object.keys(T).forEach(function(C){(C.startsWith("data-")||C.startsWith("aria-"))&&(w[C]=T[C])}),w}},Ohmc:function(qe,Ne,K){qe.exports=K.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(qe,Ne,K){"use strict";var te=K("2qtc"),Q=K("kLXV"),N=K("rAM+"),J=K("miYZ"),B=K("tsqr"),D=K("9og8"),H=K("tJVT"),F=K("jrin"),k=K("WmNS"),I=K.n(k),_=K("q1tI"),v=K.n(_),p=K("VrN/"),c=K.n(p),a=K("bdgK"),l=K("p77/"),o=K("Bd2K"),r=K("ELLl"),s=K("19Vz"),d=K("lZu9"),R=K("+NIl"),A=K("kSUc"),T=K("9Bee"),w=function(_e){var je=_e.value,ot=je===void 0?"":je,bt=_e.className,wt=_e.showTextOnly,Et=_e.showLines,pt=_e.style,Xe=pt===void 0?{}:pt,Ge=Object(_.useMemo)(function(){return""},[ot]);return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ge}}))},C=K("0Owb"),b=K("dejd"),m=K("C+DQ"),h=K("1vsH"),u=K("m3rI"),x=[{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(_e){var je=_e.onActionCallback,ot=_e.title,bt=_e.icon,wt=_e.actionName,Et=_e.className,pt=Et===void 0?"":Et,Xe=_e.children;function Ge(){je(wt)}return v.a.createElement("a",{title:ot,className:pt,onClick:Ge},v.a.createElement("i",{className:"md-iconfont ".concat(bt)}),Xe)}var y=function(_e){var je=_e.watch,ot=_e.showNullButton,bt=_e.onActionCallback,wt=_e.fullScreen,Et=_e.insertTemp,pt=_e.hidetoolBar,Xe=_e.uuid,Ge=_e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(Xe,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var De=[].concat(x,[{title:"".concat(je?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(je?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return v.a.createElement("ul",{className:"markdown-toolbar-container"},!pt&&De.map(function(oe,he){return v.a.createElement("li",{key:he},oe.actionName?v.a.createElement(g,Object(C.a)({},oe,{onActionCallback:bt})):v.a.createElement("span",{className:"v-line"}))}),ot?v.a.createElement("li",null,v.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:bt},v.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Et&&v.a.createElement("li",null,v.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Et),onActionCallback:bt},v.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),v.a.createElement("li",{className:"btn-full-screen"},v.a.createElement(g,{icon:"".concat(wt?"icon-shrink":"icon-enlarge"),title:wt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:bt})))},M=K("M8RZ"),E=K("+L6B"),j=K("2/Rp"),G=K("y8nQ"),U=K("Vl3Y"),O=K("5NDa"),X=K("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},se=function(_e){var je=_e.callback,ot=_e.onCancel;function bt(wt){je(wt)}return v.a.createElement(U.a,Object(C.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:bt}),v.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},v.a.createElement(X.a,null)),v.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},v.a.createElement(X.a,null)),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(j.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},ce=K("7ahc"),Pe=K("HmJG"),Se=K("BjJ7"),Re=U.a.useForm,Oe={width:280,marginRight:10},Me={labelCol:{span:5},wrapperCol:{span:19}},be=function(_e){var je=_e.callback,ot=_e.onCancel,bt=Re(),wt=Object(H.a)(bt,1),Et=wt[0];function pt(De){je(De)}function Xe(De,oe){if(De.status===-1){B.b.error(De.message);return}Et.setFieldsValue({src:"/api/attachments/".concat(De.id),type:oe.type})}function Ge(De){var oe=De.target.files[0];ne(oe,Xe)}return v.a.createElement(U.a,Object(C.a)({form:Et},Me,{className:"upload-image-panel",onFinish:pt}),v.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},v.a.createElement("div",{className:"flex-container"},v.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},v.a.createElement(X.a,{style:Oe})),v.a.createElement(ue,{onFileChange:Ge}))),v.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},v.a.createElement(X.a,{style:{width:264}})),v.a.createElement(U.a.Item,{style:{textAlign:"right"}},v.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(j.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))};function ue(_e){var je=_e.onFileChange;return v.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",v.a.createElement("input",{type:"file",onChange:je}))}function ne(_e,je){if(!_e)throw new String("\u6CA1\u6709\u6587\u4EF6");var ot=new FormData;ot.append("editormd-image-file",_e),ot.append("file_param_name","editormd-image-file"),ot.append("byxhr","true");var bt=new window.XMLHttpRequest;bt.withCredentials=!0,bt.addEventListener("load",function(wt){je(JSON.parse(wt.target.responseText),_e)},!1),bt.addEventListener("error",function(wt){console.error(wt)},!1),bt.open("POST","".concat(Se.a,"/api/attachments.json")),bt.send(ot)}var ve=K("giR+"),le=K("fyUT"),ke=K("7Kak"),Fe=K("9yH6"),Ie=Fe.a.Group,He={margin:"0 8px"},$e=function(_e){var je=_e.callback,ot=_e.onCancel;function bt(wt){je(wt)}return v.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:bt},v.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},v.a.createElement("span",{style:He},"\u5355\u5143\u683C\u6570\uFF1A"),v.a.createElement("span",{style:He},"\u884C\u6570"),v.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},v.a.createElement(le.a,null)),v.a.createElement("span",{style:He},"\u5217\u6570"),v.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},v.a.createElement(le.a,null))),v.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},v.a.createElement("span",{style:He},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),v.a.createElement(U.a.Item,{name:"align"},v.a.createElement(Ie,null,v.a.createElement(Fe.a,{value:"default"},v.a.createElement("i",{className:"fa fa-align-justify"})),v.a.createElement(Fe.a,{value:"left"},v.a.createElement("i",{className:"fa fa-align-left"})),v.a.createElement(Fe.a,{value:"center"},v.a.createElement("i",{className:"fa fa-align-center"})),v.a.createElement(Fe.a,{value:"right"},v.a.createElement("i",{className:"fa fa-align-right"}))))),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(j.a,{type:"ghost",onClick:ot},"\u53D6\u6D88")))},tt=K("ErOA"),Qe=K("7Cbv"),Je="link",Ye="upload-image",gt="code-block",_t="add-table",vt="------------",dt={default:vt,left:":".concat(vt),center:":".concat(vt,":"),right:"".concat(vt,":")},Ct=K("9VGf"),xt,Le;function Ce(){}var nt=0,rt=1e4,Be="\u2581",et=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function xe(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,ge=fe?"Cmd":"Ctrl",re=["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"],ae=(xt={},Object(F.a)(xt,ge+"-B","bold"),Object(F.a)(xt,ge+"-I","italic"),xt),de=(Le={},Object(F.a)(Le,Je,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Le,gt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Le,Ye,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Le,_t,"\u6DFB\u52A0\u8868\u683C"),Le),ye=Ne.a=function(_e){var je=_e.defaultValue,ot=je===void 0?"":je,bt=_e.onChange,wt=_e.width,Et=wt===void 0?"100%":wt,pt=_e.height,Xe=pt===void 0?400:pt,Ge=_e.miniToolbar,De=Ge===void 0?!1:Ge,oe=_e.isFocus,he=oe===void 0?!1:oe,Ze=_e.watch,Ue=_e.insertTemp,ze=_e.mode,ct=ze===void 0?"markdown":ze,Te=_e.id,Ke=Te===void 0?"markdown-editor-id":Te,st=_e.showResizeBar,ft=st===void 0?!1:st,Tt=_e.noStorage,Jt=Tt===void 0?!1:Tt,an=_e.showNullButton,Vt=an===void 0?!1:an,Ot=_e.hidetoolBar,gn=Ot===void 0?!1:Ot,Kt=_e.fullScreen,Zt=Kt===void 0?!1:Kt,Nt=_e.onBlur,nn=_e.onCMBeforeChange,Cn=_e.onFullScreen,wn=_e.className,mt=wn===void 0?"":wn,Gt=_e.disablePaste,Mn=Gt===void 0?!1:Gt,Un=_e.placeholder,Pn=Un===void 0?"":Un,Vn=_e.values,V=Vn===void 0?"":Vn,S=Object(_.useState)(null),L=Object(H.a)(S,2),W=L[0],ee=L[1],Y=Object(_.useState)(ot),Ae=Object(H.a)(Y,2),at=Ae[0],St=Ae[1],Bt=Object(_.useState)(Ze),pe=Object(H.a)(Bt,2),Pt=pe[0],qt=pe[1],Tn=Object(_.useState)(Zt),Hn=Object(H.a)(Tn,2),Kn=Hn[0],In=Hn[1],pi=Object(_.useState)(""),ui=Object(H.a)(pi,2),Bn=ui[0],di=ui[1],Ai=Object(_.useState)(0),wi=Object(H.a)(Ai,2),Yn=wi[0],Wi=wi[1],Pi=Object(_.useState)(Xe),yi=Object(H.a)(Pi,2),Qi=yi[0],bi=yi[1],ci=Object(_.useState)(!1),Ni=Object(H.a)(ci,2),Hi=Ni[0],_i=Ni[1],_n=Object(_.useRef)(Object(Qe.a)()),on=Object(_.useRef)(!1),Dn=Object(_.useRef)(),un=Object(_.useRef)(),Rn=Object(_.useRef)(),yn=Object(_.useRef)(),Oi=Object(_.useRef)(),jn=function(){var Ht=Object(D.a)(I.a.mark(function $t(){var zt,sn;return I.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return Sn.next=2,Object(tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:_n.current}});case 2:sn=Sn.sent,sn!=null&&(zt=sn.attachments)!==null&&zt!==void 0&&zt.length&&(console.log("cm:",W,un),sn.attachments.map(function(hn){hn.content_type.indexOf("image")>-1?W.replaceSelection("![,](/api/attachments/".concat(hn.id,"?type=").concat(hn.content_type,")")):hn.content_type.indexOf("video")>-1?W.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):hn.content_type.indexOf("pdf")>-1?W.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,'&disposition=inline" target="_blank">').concat(hn.name,"</a>")):W.replaceSelection("[".concat(hn.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(hn.id,"?type=").concat(hn.content_type,")"))}));case 4:case"end":return Sn.stop()}},$t)}));return function(){return Ht.apply(this,arguments)}}();Object(_.useEffect)(function(){St(V),W==null||W.setValue(V)},[V]),Object(_.useEffect)(function(){Cn==null||Cn(Kn)},[Kn]),Object(_.useEffect)(function(){if(un.current){var Ht=c.a.fromTextArea(un.current,{mode:ct,lineNumbers:!De,lineWrapping:!0,value:ot,autoCloseTags:!0,autoCloseBrackets:!0});he&&Ht.focus();function $t(zt,sn){if(Mn){sn.preventDefault();return}var cn=sn.clipboardData;if(cn){var Sn=cn.types.toString(),hn=cn.items;if(Sn==="Files"||cn.types.indexOf("Files")>-1){if(sn.preventDefault(),ct=="stex")return;try{var kn,qn=hn[1];((kn=hn[0])===null||kn===void 0?void 0:kn.kind)==="file"&&(qn=hn[0]);var ln=qn.getAsFile(),tn=ln.name.split(".").pop();ne(ln,function(pn){if(pn.id){var Qn,Gn,rn;(ln==null||((Qn=ln.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Ht.replaceSelection("![,](/api/attachments/".concat(pn.id,"?type=").concat(pn.content_type,")")):(ln==null||((Gn=ln.type)===null||Gn===void 0)?void 0:Gn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,'"></video>')):(ln==null||((rn=ln.type)===null||rn===void 0)?void 0:rn.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,"?type=").concat(ln.type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):re.includes(tn)?Ht.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,'?type=office&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Ht.replaceSelection("[".concat(ln.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,"?type=").concat(pn.content_type,")"))}else(pn==null?void 0:pn.status)===401&&(document.location.href="/user/login")})}catch(pn){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ht.on("paste",$t),Ht.on("dragleave",function(zt,sn){Rn.current.classList.remove("mouse-hover-md")}),Ht.on("dragover",function(zt,sn){Rn.current.classList.add("mouse-hover-md")}),Ht.on("drop",function(zt,sn){Rn.current.classList.add("mouse-hover-md");var cn;if(cn=sn.dataTransfer.files,cn.length>0){sn.preventDefault(),sn.stopPropagation();for(var Sn=function(qn){var ln=cn[qn],tn=ln.name.split(".").pop();ne(ln,function(pn){if(pn.id){var Qn,Gn,rn;(ln==null||((Qn=ln.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Ht.replaceSelection("![,](/api/attachments/".concat(pn.id,"?type=").concat(pn.content_type,")")):(ln==null||((Gn=ln.type)===null||Gn===void 0)?void 0:Gn.indexOf("video"))>-1?Ht.replaceSelection('<video width="100%" controls src="'.concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,'"></video>')):(ln==null||((rn=ln.type)===null||rn===void 0)?void 0:rn.indexOf("pdf"))>-1?Ht.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,"?type=").concat(ln.type,'&disposition=inline" target="_blank">').concat(ln.name,"</a>")):re.includes(tn)?Ht.replaceSelection('<a href="'.concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,'?type=office&disposition=inline" target="_blank">').concat(ln.name,"</a>")):Ht.replaceSelection("[".concat(ln.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(pn.id,"?type=").concat(pn.content_type,")"))}else(pn==null?void 0:pn.status)===401&&(document.location.href="/user/login")})},hn=0;hn<cn.length;hn++)Sn(hn)}}),ee(Ht),function(){Ht.off("paste",$t)}}},[]);var Xn=Object(_.useCallback)(function(){if(Rn.current)try{}catch(Ht){console.log(Ht,"---- to set md editor body height")}},[Qi,Rn,Kn]);Object(_.useEffect)(function(){function Ht(){var zt=new a.default(function(sn){var cn=Object(N.a)(sn),Sn;try{for(cn.s();!(Sn=cn.n()).done;){var hn=Sn.value;(hn.target.offsetHeight>0||hn.target.offsetWidth>0)&&(Xn(),W.setSize("100%","100%"),W.refresh())}}catch(kn){cn.e(kn)}finally{cn.f()}});return zt.observe(un.current.parentElement),zt}if(W){var $t=Ht();return function(){$t.unobserve(un.current.parentElement)}}},[W,Xn]),Object(_.useEffect)(function(){if(W){for(var Ht=[],$t=function(){var hn=sn[zt];cn=Object(H.a)(hn,2);var kn=cn[0],qn=cn[1],ln=Object(F.a)({},kn,function(){Ki(qn)});Ht.push(ln),W.addKeyMap(ln)},zt=0,sn=Object.entries(ae);zt<sn.length;zt++){var cn;$t()}return Dn.current=setInterval(function(){on.current&&jn()},4e3),function(){clearInterval(Dn.current);var Sn=Object(N.a)(Ht),hn;try{for(Sn.s();!(hn=Sn.n()).done;){var kn=hn.value;W.removeKeyMap(kn)}}catch(qn){Sn.e(qn)}finally{Sn.f()}}}},[W]),Object(_.useEffect)(function(){Zt!==Kn&&In(Zt)},[Zt]),Object(Ct.a)(function(){if(!Jt&&Yn>0){var Ht=new Date().getTime(),$t=window.sessionStorage.getItem(Ke);Ht>=Yn+rt&&(!$t||$t!==at)&&(window.sessionStorage.setItem(Ke,at),_i(!0))}},rt),Object(_.useEffect)(function(){qt(Ze)},[W,Ze]),Object(_.useEffect)(function(){W&&(he&&W.focus())},[W,he]),Object(_.useEffect)(function(){if(Pt&&W){var Ht=W.getScrollerElement();function $t(zt){var sn=zt.target;if(Oi.current){var cn=sn.scrollTop/sn.scrollHeight;Oi.current.scrollTop=Oi.current.scrollHeight*cn}}return Ht.addEventListener("scroll",$t),function(){Ht.removeEventListener("scroll",$t)}}},[W,Pt]),Object(_.useEffect)(function(){if(W&&nn){function Ht($t,zt){nn($t,zt)}return W.on("beforeChange",Ht),function(){W.off("beforeChange",Ht)}}},[W,nn]),Object(_.useEffect)(function(){if(W&&Nt){function Ht(){Nt(W.getValue())}return W.on("blur",Ht),function(){W.off("blur",Ht)}}},[W,Nt]),Object(_.useEffect)(function(){if(W){function Ht($t){var zt=$t.getValue();St(zt),Wi(new Date().getTime()),$t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),bt&&bt(zt)}return W.on("change",Ht),function(){W.off("change",Ht)}}},[W,bt]),Object(_.useEffect)(function(){W&&(ot==null?(W.setValue(""),St("")):ot!==W.getValue()&&(W.setValue(ot),St(ot),W.setCursor(W.lineCount(),0)))},[W,ot]);var Ki=Object(_.useCallback)(function(Ht){var $t=W.getCursor(),zt=W.getSelection(),sn=zt.split(`
`);switch(Ht){case"bold":return W.replaceSelection("**"+zt+"**"),zt===""&&W.setCursor($t.line,$t.ch+2),W.focus();case"italic":return W.replaceSelection("*"+zt+"*"),zt===""&&W.setCursor($t.line,$t.ch+1),W.focus();case"code":return W.replaceSelection("`"+zt+"`"),zt===""&&W.setCursor($t.line,$t.ch+1),W.focus();case"inline-latex":return W.replaceSelection("`$$"+zt+"$$`"),zt===""&&W.setCursor($t.line,$t.ch+3),W.focus();case"latex":return W.replaceSelection("```latex\n"+zt+"\n```"),W.setCursor($t.line+1,zt.length+1),W.focus();case"line-break":return W.replaceSelection(`<br/>
`),W.focus();case"list-ul":return zt===""?W.replaceSelection("- "+zt):W.replaceSelection(sn.map(function(cn){return cn===""?"":"- ".concat(cn)}).join(`
`)),W.focus();case"list-ol":return zt===""?W.replaceSelection("1. "+zt):W.replaceSelection(sn.map(function(cn,Sn){return cn===""?"":"".concat(Sn+1,". ").concat(cn)}).join(`
`)),W.focus();case"add-null-ch":return zt===""&&W.setCursor($t.line,$t.ch+1),W.replaceSelection(Be),W.focus();case"inster-template-1":return zt===""&&W.setCursor($t.line,$t.ch),W.replaceSelection(et),W.focus();case"eraser":return W.setValue(""),W.focus();case"trigger-watch":return qt(!Pt),W.focus();case"trigger-full-screen":return In(!Kn),W.focus();case Je:di(Je);return;case gt:di(gt);return;case Ye:di(Ye);return;case _t:di(_t);return;default:throw new Error}},[W,Pt,Kn]),Ri=Object(_.useCallback)(function(Ht){di("");switch(Bn){case Je:var $t=Ht.title,zt=Ht.link;return W.replaceSelection("[".concat($t,"](").concat(zt,")")),W.focus();case gt:var sn=Ht.language,cn=Ht.content;return W.replaceSelection(["```"+sn,cn,"```"].join(`
`)),W.focus();case Ye:var Sn=Ht.src,hn=Ht.alt;return hn?W.replaceSelection("![ ".concat(hn," ]( ").concat(Sn,' "').concat(hn,'" )')):W.replaceSelection("![,](".concat(Sn,")")),W.focus();case _t:for(var kn=Ht.row,qn=Ht.col,ln=Ht.align,tn=`
`,pn=0;pn<kn;pn++){for(var Qn=[],Gn=[],rn=0;rn<qn;rn++)pn===1&&Gn.push(dt[ln]),Qn.push(" ");pn===1&&(tn+="| ".concat(Gn.join(" | "),` |
`)),tn+="| ".concat(Qn.join(qn===1?"":" | "),` |
`)}return W.replaceSelection(tn+`
`),W.focus();default:throw new Error}},[W,Bn]),Gi=Object(_.useMemo)(function(){switch(Bn){case Je:return v.a.createElement(se,{callback:Ri,onCancel:Ii});case gt:return v.a.createElement(ce.b,{callback:Ri,onCancel:Ii});case Ye:return v.a.createElement(be,{callback:Ri,onCancel:Ii});case _t:return v.a.createElement($e,{callback:Ri,onCancel:Ii});default:return null}},[Bn]);function Ii(){di("")}Object(_.useEffect)(function(){if(yn.current){var Ht=yn.current,$t=!1,zt=0;function sn(hn){$t=!0,zt=hn.pageY}function cn(){$t=!1}function Sn(hn){if($t){var kn=hn.pageY-zt;kn<0&&(kn=0),kn>300&&(kn=300);var qn=Xe+kn+"px";bi(qn)}}return Ht.addEventListener("mousedown",sn),document.addEventListener("mousemove",Sn),document.addEventListener("mouseup",cn),function(){Ht.removeEventListener("mousedown",sn),document.removeEventListener("mousemove",Sn),document.removeEventListener("mouseup",cn)}}},[W,yn]),Object(_.useEffect)(function(){bi(Xe)},[Xe]);var Li=xe(Et),ji=xe(Qi),Ei={width:Li,height:ji},zi=Object(_.useMemo)(function(){if(Yn){var Ht=new Date(Yn),$t=Ht.getHours(),zt=Ht.getMinutes(),sn=Ht.getSeconds();return $t=$t<10?"0"+$t:$t,zt=zt<10?"0"+zt:zt,sn=sn<10?"0"+sn:sn,"".concat($t,":").concat(zt,":").concat(sn)}return 0},[Yn]);function Ji(){window.sessionStorage.removeItem(Ke),_i(!1),Wi(0)}function oi(){_i(!1),Wi(0),W.setValue(window.sessionStorage.getItem(Ke))}function ir(Ht,$t){var zt=W.getValue();zt=zt.replace(Ht,$t),St(zt),W==null||W.setValue(zt)}return v.a.createElement(_.Fragment,null,v.a.createElement("div",{className:"markdown-editor-wrapper",ref:Rn},v.a.createElement("div",{className:"markdown-editor-container ".concat(mt," ").concat(Pt?"on-preview":""," ").concat(De?"mini":""," ").concat(Kn?"full-screen":""),style:Ei},v.a.createElement(y,{insertTemp:Ue,watch:Pt,fullScreen:Kn,showNullButton:Vt,onActionCallback:Ki,hidetoolBar:gn,uuid:_n.current,setOpenPhones:function(){on.current=!0}}),v.a.createElement("div",{className:"markdown-editor-body"},v.a.createElement("div",{className:"codemirror-container"},v.a.createElement("textarea",{ref:un,placeholder:Pn})),Pt?v.a.createElement("div",{ref:Oi,className:"preview-container"},ct==="stex"&&v.a.createElement(w,{value:at}),ct!=="stex"&&v.a.createElement(T.a,{edit:!0,value:at,replaces:ir})):null))),ft?v.a.createElement("a",{ref:yn,className:"editor-resize"}):null,v.a.createElement(M.a,null,de[Bn]?v.a.createElement(Q.a,{centered:!0,title:de[Bn],visible:!0,onCancel:Ii,footer:null,className:"markdown-popup-form"},Gi):null))}},RMFE:function(qe,Ne){qe.exports="data:image/png;base64,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"},"SA+Z":function(qe,Ne,K){var te=K("wTVA"),Q=K("EbDI"),N=K("ZhPi"),J=K("wkBT");function B(D){return te(D)||Q(D)||N(D)||J()}qe.exports=B,qe.exports.__esModule=!0,qe.exports.default=qe.exports},SJMd:function(qe,Ne){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var K,te,Q,N=!1,J,B;window.PR_SHOULD_USE_CONTINUATION=!0;var D,H;(function(){var F=window,k=["break,continue,do,else,for,if,return,while"],I=[k,"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"],_=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[_,"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"],p=[_,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[_,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],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",l=[_,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],o="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",r=[k,"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"],s=[k,"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"],d=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[v,c,p,l,o,r,s,d],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",w="kwd",C="com",b="typ",m="lit",h="pun",u="pln",x="tag",g="dec",y="src",M="atn",E="atv",j="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(Ie){for(var He=0,$e=!1,tt=!1,Qe=0,Je=Ie.length;Qe<Je;++Qe){var Ye=Ie[Qe];if(Ye.ignoreCase)tt=!0;else if(/[a-z]/i.test(Ye.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){$e=!0,tt=!1;break}}var gt={b:8,t:9,n:10,v:11,f:12,r:13};function _t(Le){var Ce=Le.charCodeAt(0);if(Ce!==92)return Ce;var nt=Le.charAt(1);return Ce=gt[nt],Ce||("0"<=nt&&nt<="7"?parseInt(Le.substring(1),8):nt==="u"||nt==="x"?parseInt(Le.substring(2),16):Le.charCodeAt(1))}function vt(Le){if(Le<32)return(Le<16?"\\x0":"\\x")+Le.toString(16);var Ce=String.fromCharCode(Le);return Ce==="\\"||Ce==="-"||Ce==="]"||Ce==="^"?"\\"+Ce:Ce}function dt(Le){var Ce=Le.substring(1,Le.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")),nt=[],rt=Ce[0]==="^",Be=["["];rt&&Be.push("^");for(var et=rt?1:0,xe=Ce.length;et<xe;++et){var fe=Ce[et];if(/\\[bdsw]/i.test(fe))Be.push(fe);else{var ge=_t(fe),re;et+2<xe&&Ce[et+1]==="-"?(re=_t(Ce[et+2]),et+=2):re=ge,nt.push([ge,re]),re<65||ge>122||(re<65||ge>90||nt.push([Math.max(65,ge)|32,Math.min(re,90)|32]),re<97||ge>122||nt.push([Math.max(97,ge)&~32,Math.min(re,122)&~32]))}}nt.sort(function(_e,je){return _e[0]-je[0]||je[1]-_e[1]});for(var ae=[],de=[],et=0;et<nt.length;++et){var ye=nt[et];ye[0]<=de[1]+1?de[1]=Math.max(de[1],ye[1]):ae.push(de=ye)}for(var et=0;et<ae.length;++et){var ye=ae[et];Be.push(vt(ye[0])),ye[1]>ye[0]&&(ye[1]+1>ye[0]&&Be.push("-"),Be.push(vt(ye[1])))}return Be.push("]"),Be.join("")}function Ct(Le){for(var Ce=Le.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")),nt=Ce.length,rt=[],Be=0,et=0;Be<nt;++Be){var xe=Ce[Be];if(xe==="(")++et;else if(xe.charAt(0)==="\\"){var fe=+xe.substring(1);fe&&(fe<=et?rt[fe]=-1:Ce[Be]=vt(fe))}}for(var Be=1;Be<rt.length;++Be)rt[Be]===-1&&(rt[Be]=++He);for(var Be=0,et=0;Be<nt;++Be){var xe=Ce[Be];if(xe==="(")++et,rt[et]||(Ce[Be]="(?:");else if(xe.charAt(0)==="\\"){var fe=+xe.substring(1);fe&&fe<=et&&(Ce[Be]="\\"+rt[fe])}}for(var Be=0;Be<nt;++Be)Ce[Be]==="^"&&Ce[Be+1]!=="^"&&(Ce[Be]="");if(Le.ignoreCase&&$e)for(var Be=0;Be<nt;++Be){var xe=Ce[Be],ge=xe.charAt(0);xe.length>=2&&ge==="["?Ce[Be]=dt(xe):ge!=="\\"&&(Ce[Be]=xe.replace(/[a-zA-Z]/g,function(de){var ye=de.charCodeAt(0);return"["+String.fromCharCode(ye&~32,ye|32)+"]"}))}return Ce.join("")}for(var xt=[],Qe=0,Je=Ie.length;Qe<Je;++Qe){var Ye=Ie[Qe];if(Ye.global||Ye.multiline)throw new Error(""+Ye);xt.push("(?:"+Ct(Ye)+")")}return new RegExp(xt.join("|"),tt?"gi":"g")}function O(Ie,He){var $e=/(?:^|\s)nocode(?:\s|$)/,tt=[],Qe=0,Je=[],Ye=0;function gt(_t){var vt=_t.nodeType;if(vt==1){if($e.test(_t.className))return;for(var dt=_t.firstChild;dt;dt=dt.nextSibling)gt(dt);var Ct=_t.nodeName.toLowerCase();(Ct==="br"||Ct==="li")&&(tt[Ye]=`
`,Je[Ye<<1]=Qe++,Je[Ye++<<1|1]=_t)}else if(vt==3||vt==4){var xt=_t.nodeValue;xt.length&&(He?xt=xt.replace(/\r\n?/g,`
`):xt=xt.replace(/[ \t\r\n]+/g," "),tt[Ye]=xt,Je[Ye<<1]=Qe,Qe+=xt.length,Je[Ye++<<1|1]=_t)}}return gt(Ie),{sourceCode:tt.join("").replace(/\n$/,""),spans:Je}}function X(Ie,He,$e,tt,Qe){if(!$e)return;var Je={sourceNode:Ie,pre:1,langExtension:null,numberLines:null,sourceCode:$e,spans:null,basePos:He,decorations:null};tt(Je),Qe.push.apply(Qe,Je.decorations)}var $=/\S/;function se(Ie){for(var He=void 0,$e=Ie.firstChild;$e;$e=$e.nextSibling){var tt=$e.nodeType;He=tt===1?He?Ie:$e:tt===3&&$.test($e.nodeValue)?Ie:He}return He===Ie?void 0:He}function ce(Ie,He){var $e={},tt;(function(){for(var Ye=Ie.concat(He),gt=[],_t={},vt=0,dt=Ye.length;vt<dt;++vt){var Ct=Ye[vt],xt=Ct[3];if(xt)for(var Le=xt.length;--Le>=0;)$e[xt.charAt(Le)]=Ct;var Ce=Ct[1],nt=""+Ce;_t.hasOwnProperty(nt)||(gt.push(Ce),_t[nt]=null)}gt.push(/[\0-\uffff]/),tt=U(gt)})();var Qe=He.length,Je=function(Ye){for(var gt=Ye.sourceCode,_t=Ye.basePos,vt=Ye.sourceNode,dt=[_t,u],Ct=0,xt=gt.match(tt)||[],Le={},Ce=0,nt=xt.length;Ce<nt;++Ce){var rt=xt[Ce],Be=Le[rt],et=void 0,xe;if(typeof Be=="string")xe=!1;else{var fe=$e[rt.charAt(0)];if(fe)et=rt.match(fe[1]),Be=fe[0];else{for(var ge=0;ge<Qe;++ge)if(fe=He[ge],et=rt.match(fe[1]),et){Be=fe[0];break}et||(Be=u)}xe=Be.length>=5&&Be.substring(0,5)==="lang-",xe&&!(et&&typeof et[1]=="string")&&(xe=!1,Be=y),xe||(Le[rt]=Be)}var re=Ct;if(Ct+=rt.length,!xe)dt.push(_t+re,Be);else{var ae=et[1],de=rt.indexOf(ae),ye=de+ae.length;et[2]&&(ye=rt.length-et[2].length,de=ye-ae.length);var _e=Be.substring(5);X(vt,_t+re,rt.substring(0,de),Je,dt),X(vt,_t+re+de,ae,ue(_e,ae),dt),X(vt,_t+re+ye,rt.substring(ye),Je,dt)}}Ye.decorations=dt};return Je}function Pe(Ie){var He=[],$e=[];Ie.tripleQuotedStrings?He.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ie.multiLineStrings?He.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):He.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ie.verbatimStrings&&$e.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var tt=Ie.hashComments;tt&&(Ie.cStyleComments?(tt>1?He.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):He.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):He.push([C,/^#[^\r\n]*/,null,"#"])),Ie.cStyleComments&&($e.push([C,/^\/\/[^\r\n]*/,null]),$e.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=Ie.regexLiterals;if(Qe){var Je=Qe>1?"":`
\r`,Ye=Je?".":"[\\S\\s]",gt="/(?=[^/*"+Je+"])(?:[^/\\x5B\\x5C"+Je+"]|\\x5C"+Ye+"|\\x5B(?:[^\\x5C\\x5D"+Je+"]|\\x5C"+Ye+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+G+"("+gt+")")])}var _t=Ie.types;_t&&$e.push([b,_t]);var vt=(""+Ie.keywords).replace(/^ | $/g,"");vt.length&&$e.push([w,new RegExp("^(?:"+vt.replace(/[\s,]+/g,"|")+")\\b"),null]),He.push([u,/^\s+/,null,` \r
\xA0`]);var dt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ie.regexLiterals&&(dt+="(?!s*/)"),$e.push([m,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[m,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[h,new RegExp(dt),null]),ce(He,$e)}var Se=Pe({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Re(Ie,He,$e){for(var tt=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,Je=Ie.ownerDocument,Ye=Je.createElement("li");Ie.firstChild;)Ye.appendChild(Ie.firstChild);var gt=[Ye];function _t(Ce){var nt=Ce.nodeType;if(nt==1&&!tt.test(Ce.className))if(Ce.nodeName==="br")vt(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var rt=Ce.firstChild;rt;rt=rt.nextSibling)_t(rt);else if((nt==3||nt==4)&&$e){var Be=Ce.nodeValue,et=Be.match(Qe);if(et){var xe=Be.substring(0,et.index);Ce.nodeValue=xe;var fe=Be.substring(et.index+et[0].length);if(fe){var ge=Ce.parentNode;ge.insertBefore(Je.createTextNode(fe),Ce.nextSibling)}vt(Ce),xe||Ce.parentNode.removeChild(Ce)}}}function vt(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function nt(et,xe){var fe=xe?et.cloneNode(!1):et,ge=et.parentNode;if(ge){var re=nt(ge,1),ae=et.nextSibling;re.appendChild(fe);for(var de=ae;de;de=ae)ae=de.nextSibling,re.appendChild(de)}return fe}for(var rt=nt(Ce.nextSibling,0),Be;(Be=rt.parentNode)&&Be.nodeType===1;)rt=Be;gt.push(rt)}for(var dt=0;dt<gt.length;++dt)_t(gt[dt]);He===(He|0)&&gt[0].setAttribute("value",He);var Ct=Je.createElement("ol");Ct.className="linenums";for(var xt=Math.max(0,He-1|0)||0,dt=0,Le=gt.length;dt<Le;++dt)Ye=gt[dt],Ye.className="L"+(dt+xt)%10,Ye.firstChild||Ye.appendChild(Je.createTextNode("\xA0")),Ct.appendChild(Ye);Ie.appendChild(Ct)}function Oe(Ie){var He=/\bMSIE\s(\d+)/.exec(navigator.userAgent);He=He&&+He[1]<=8;var $e=/\n/g,tt=Ie.sourceCode,Qe=tt.length,Je=0,Ye=Ie.spans,gt=Ye.length,_t=0,vt=Ie.decorations,dt=vt.length,Ct=0;vt[dt]=Qe;var xt,Le;for(Le=xt=0;Le<dt;)vt[Le]!==vt[Le+2]?(vt[xt++]=vt[Le++],vt[xt++]=vt[Le++]):Le+=2;for(dt=xt,Le=xt=0;Le<dt;){for(var Ce=vt[Le],nt=vt[Le+1],rt=Le+2;rt+2<=dt&&vt[rt+1]===nt;)rt+=2;vt[xt++]=Ce,vt[xt++]=nt,Le=rt}dt=vt.length=xt;var Be=Ie.sourceNode,et="";Be&&(et=Be.style.display,Be.style.display="none");try{for(var xe=null;_t<gt;){var fe=Ye[_t],ge=Ye[_t+2]||Qe,re=vt[Ct+2]||Qe,rt=Math.min(ge,re),ae=Ye[_t+1],de;if(ae.nodeType!==1&&(de=tt.substring(Je,rt))){He&&(de=de.replace($e,"\r")),ae.nodeValue=de;var ye=ae.ownerDocument,_e=ye.createElement("span");_e.className=vt[Ct+1];var je=ae.parentNode;je.replaceChild(_e,ae),_e.appendChild(ae),Je<ge&&(Ye[_t+1]=ae=ye.createTextNode(tt.substring(rt,ge)),je.insertBefore(ae,_e.nextSibling))}Je=rt,Je>=ge&&(_t+=2),Je>=re&&(Ct+=2)}}finally{Be&&(Be.style.display=et)}}var Me={};function be(Ie,He){for(var $e=He.length;--$e>=0;){var tt=He[$e];Me.hasOwnProperty(tt)?F.console&&console.warn("cannot override language handler %s",tt):Me[tt]=Ie}}function ue(Ie,He){return Ie&&Me.hasOwnProperty(Ie)||(Ie=/^\s*</.test(He)?"default-markup":"default-code"),Me[Ie]}be(Se,["default-code"]),be(ce([],[[u,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),be(ce([[u,/^[\s]+/,null,` \r
`],[E,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),be(ce([],[[E,/^[\s\S]+/]]),["uq.val"]),be(Pe({keywords:v,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),be(Pe({keywords:"null,true,false"}),["json"]),be(Pe({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),be(Pe({keywords:p,cStyleComments:!0}),["java"]),be(Pe({keywords:d,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(Pe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(Pe({keywords:o,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(Pe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(Pe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(Pe({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(ce([],[[T,/^[\s\S]+/]]),["regex"]);function ne(Ie){var He=Ie.langExtension;try{var $e=O(Ie.sourceNode,Ie.pre),tt=$e.sourceCode;Ie.sourceCode=tt,Ie.spans=$e.spans,Ie.basePos=0,ue(He,tt)(Ie),Oe(Ie)}catch(Qe){F.console&&console.log(Qe&&Qe.stack||Qe)}}function ve(Ie,He,$e){var tt=$e||!1,Qe=He||null,Je=document.createElement("div");Je.innerHTML="<pre>"+Ie+"</pre>",Je=Je.firstChild,tt&&Re(Je,tt,!0);var Ye={langExtension:Qe,numberLines:tt,sourceNode:Je,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Ye),Je.innerHTML}function le(Ie,He){var $e=He||document.body,tt=$e.ownerDocument||document;function Qe(fe){return $e.getElementsByTagName(fe)}for(var Je=[Qe("pre"),Qe("code"),Qe("xmp")],Ye=[],gt=0;gt<Je.length;++gt)for(var _t=0,vt=Je[gt].length;_t<vt;++_t)Ye.push(Je[gt][_t]);Je=null;var dt=Date;dt.now||(dt={now:function(){return+new Date}});var Ct=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Le=/\bprettyprint\b/,Ce=/\bprettyprinted\b/,nt=/pre|xmp/i,rt=/^code$/i,Be=/^(?:pre|code|xmp)$/i,et={};function xe(){for(var fe=F.PR_SHOULD_USE_CONTINUATION?dt.now()+250:Infinity;Ct<Ye.length&&dt.now()<fe;Ct++){for(var ge=Ye[Ct],re=et,ae=ge;ae=ae.previousSibling;){var de=ae.nodeType,ye=(de===7||de===8)&&ae.nodeValue;if(ye?!/^\??prettify\b/.test(ye):de!==3||/\S/.test(ae.nodeValue))break;if(ye){re={},ye.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ze,Ue,ze){re[Ue]=ze});break}}var _e=ge.className;if((re!==et||Le.test(_e))&&!Ce.test(_e)){for(var je=!1,ot=ge.parentNode;ot;ot=ot.parentNode){var bt=ot.tagName;if(Be.test(bt)&&ot.className&&Le.test(ot.className)){je=!0;break}}if(!je){ge.className+=" prettyprinted";var wt=re.lang;if(!wt){wt=_e.match(xt);var Et;!wt&&(Et=se(ge))&&rt.test(Et.tagName)&&(wt=Et.className.match(xt)),wt&&(wt=wt[1])}var pt;if(nt.test(ge.tagName))pt=1;else{var Xe=ge.currentStyle,Ge=tt.defaultView,De=Xe?Xe.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(ge,null).getPropertyValue("white-space"):0;pt=De&&De.substring(0,3)==="pre"}var oe=re.linenums;(oe=oe==="true"||+oe)||(oe=_e.match(/\blinenums\b(?::(\d+))?/),oe=oe?oe[1]&&oe[1].length?+oe[1]:!0:!1),oe&&Re(ge,oe,pt);var he={langExtension:wt,sourceNode:ge,numberLines:oe,pre:pt,sourceCode:null,basePos:null,spans:null,decorations:null};ne(he)}}}Ct<Ye.length?F.setTimeout(xe,250):typeof Ie=="function"&&Ie()}xe()}var ke=F.PR={createSimpleLexer:ce,registerLangHandler:be,sourceDecorator:Pe,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:E,PR_COMMENT:C,PR_DECLARATION:g,PR_KEYWORD:w,PR_LITERAL:m,PR_NOCODE:j,PR_PLAIN:u,PR_PUNCTUATION:h,PR_SOURCE:y,PR_STRING:T,PR_TAG:x,PR_TYPE:b,prettyPrintOne:N?F.prettyPrintOne=ve:D=ve,prettyPrint:H=N?F.prettyPrint=le:H=le},Fe=F.define;typeof Fe=="function"&&Fe.amd&&Fe("google-code-prettify",[],function(){return ke})})()},SMhR:function(qe,Ne){qe.exports="data:image/png;base64,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"},TGq3:function(qe,Ne,K){qe.exports=K.p+"static/lockclose.365036e8.svg"},TXwP:function(qe,Ne,K){var te,Q;(function(){var N;(function(){"use strict";var B=[,,function(k){function I(p){this.__parent=p,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=[]}I.prototype.clone_empty=function(){var p=new I(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},I.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},I.prototype.has_match=function(p){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(p))return!0;return!1},I.prototype.set_indent=function(p,c){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=c||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.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)},I.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},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(p){this.__items.push(p);var c=p.lastIndexOf(`
`);c!==-1?this.__character_count=p.length-c:this.__character_count+=p.length},I.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function _(p,c){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),c=c||"",p.indent_level>0&&(c=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}_.prototype.get_indent_size=function(p,c){var a=this.__base_string_length;return c=c||0,p<0&&(a=0),a+=p*this.__indent_size,a+=c,a},_.prototype.get_indent_string=function(p,c){var a=this.__base_string;return c=c||0,p<0&&(p=0,a=""),c+=p*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},_.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var p=this.__cache.length,c=0,a="";this.__indent_size&&p>=this.__indent_size&&(c=Math.floor(p/this.__indent_size),p-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),p&&(a+=new Array(p+1).join(" ")),this.__cache.push(a)};function v(p,c){this.__indent_cache=new _(p,c),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(p,c){return this.__indent_cache.get_indent_string(p,c)},v.prototype.get_indent_size=function(p,c){return this.__indent_cache.get_indent_size(p,c)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(p){this.trim(!0);var c=this.current_line.pop();c&&(c[c.length-1]===`
`&&(c=c.replace(/\n+$/g,"")),this.current_line.push(c)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return p!==`
`&&(a=a.replace(/[\n]/g,p)),a},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(p,c){return p=p||0,c=c||0,this.next_line.set_indent(p,c),this.__lines.length>1?(this.current_line.set_indent(p,c),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(p){for(var c=0;c<p.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.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(" "))},v.prototype.remove_indent=function(p){for(var c=this.__lines.length;p<c;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(p,c){for(var a=this.__lines.length-2;a>=0;){var l=this.__lines[a];if(l.is_empty())break;if(l.item(0).indexOf(p)!==0&&l.item(-1)!==c){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},k.exports.Output=v},,,,function(k){function I(p,c){this.raw_options=_(p,c),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"])}I.prototype._get_array=function(p,c){var a=this.raw_options[p],l=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(l=a.concat()):typeof a=="string"&&(l=a.split(/[^a-zA-Z0-9_\/\-]+/)),l},I.prototype._get_boolean=function(p,c){var a=this.raw_options[p],l=a===void 0?!!c:!!a;return l},I.prototype._get_characters=function(p,c){var a=this.raw_options[p],l=c||"";return typeof a=="string"&&(l=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},I.prototype._get_number=function(p,c){var a=this.raw_options[p];c=parseInt(c,10),isNaN(c)&&(c=0);var l=parseInt(a,10);return isNaN(l)&&(l=c),l},I.prototype._get_selection=function(p,c,a){var l=this._get_selection_list(p,c,a);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l[0]},I.prototype._get_selection_list=function(p,c,a){if(!c||c.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[c[0]],!this._is_valid_selection(a,c))throw new Error("Invalid Default Value!");var l=this._get_array(p,a);if(!this._is_valid_selection(l,c))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[p]+"'");return l},I.prototype._is_valid_selection=function(p,c){return p.length&&c.length&&!p.some(function(a){return c.indexOf(a)===-1})};function _(p,c){var a={};p=v(p);var l;for(l in p)l!==c&&(a[l]=p[l]);if(c&&p[c])for(l in p[c])a[l]=p[c][l];return a}function v(p){var c={},a;for(a in p){var l=a.replace(/-/g,"_");c[l]=p[a]}return c}k.exports.Options=I,k.exports.normalizeOpts=v,k.exports.mergeOpts=_},,function(k){var I=RegExp.prototype.hasOwnProperty("sticky");function _(v){this.__input=v||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position<this.__input_length},_.prototype.next=function(){var v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},_.prototype.peek=function(v){var p=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(p=this.__input.charAt(v)),p},_.prototype.__match=function(v,p){v.lastIndex=p;var c=v.exec(this.__input);return c&&!(I&&v.sticky)&&(c.index!==p&&(c=null)),c},_.prototype.test=function(v,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(v,p):!1},_.prototype.testChar=function(v,p){var c=this.peek(p);return v.lastIndex=0,c!==null&&v.test(c)},_.prototype.match=function(v){var p=this.__match(v,this.__position);return p?this.__position+=p[0].length:p=null,p},_.prototype.read=function(v,p,c){var a="",l;return v&&(l=this.match(v),l&&(a+=l[0])),p&&(l||!v)&&(a+=this.readUntil(p,c)),a},_.prototype.readUntil=function(v,p){var c="",a=this.__position;v.lastIndex=this.__position;var l=v.exec(this.__input);return l?(a=l.index,p&&(a+=l[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},_.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},_.prototype.get_regexp=function(v,p){var c=null,a="g";return p&&I&&(a="y"),typeof v=="string"&&v!==""?c=new RegExp(v,a):v&&(c=new RegExp(v.source,a)),c},_.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},_.prototype.peekUntilAfter=function(v){var p=this.__position,c=this.readUntilAfter(v);return this.__position=p,c},_.prototype.lookBack=function(v){var p=this.__position-1;return p>=v.length&&this.__input.substring(p-v.length,p).toLowerCase()===v},k.exports.InputScanner=_},,,,,function(k){function I(_,v){_=typeof _=="string"?_:_.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(_+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(_+/\sbeautify\signore:end\s/.source+v,"g")}I.prototype.get_directives=function(_){if(!_.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var p=this.__directive_pattern.exec(_);p;)v[p[1]]=p[2],p=this.__directive_pattern.exec(_);return v},I.prototype.readIgnored=function(_){return _.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=I},,function(k,I,_){var v=_(16).Beautifier,p=_(17).Options;function c(a,l){var o=new v(a,l);return o.beautify()}k.exports=c,k.exports.defaultOptions=function(){return new p}},function(k,I,_){var v=_(17).Options,p=_(2).Output,c=_(8).InputScanner,a=_(13).Directives,l=new a(/\/\*/,/\*\//),o=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,s=/\s/,d=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(w,C){this._source_text=w||"",this._options=new v(C),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(w){var C="";for(this._ch=this._input.next();this._ch;){if(C+=this._ch,this._ch==="\\")C+=this._input.next();else if(w.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return C},T.prototype.eatWhitespace=function(w){for(var C=s.test(this._input.peek()),b=0;s.test(this._input.peek());)this._ch=this._input.next(),w&&this._ch===`
`&&((b===0||b<this._options.max_preserve_newlines)&&(b++,this._output.add_new_line(!0)));return C},T.prototype.foundNestedPseudoClass=function(){for(var w=0,C=1,b=this._input.peek(C);b;){if(b==="{")return!0;if(b==="(")w+=1;else if(b===")"){if(w===0)return!1;w-=1}else if(b===";"||b==="}")return!1;C++,b=this._input.peek(C)}return!1},T.prototype.print_string=function(w){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(w)},T.prototype.preserveSingleSpace=function(w){w&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,C=this._options.eol;C==="auto"&&(C=`
`,w&&o.test(w||"")&&(C=w.match(o)[0])),w=w.replace(r,`
`);var b=w.match(/^[\t ]*/)[0];this._output=new p(this._options,b),this._input=new c(w),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var m=0,h=!1,u=!1,x=!1,g=!1,y=!1,M=!1,E=this._ch,j=!1,G,U,O;G=this._input.read(d),U=G!=="",O=E,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),E=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var X=this._input.read(R),$=l.get_directives(X);$&&$.ignore==="start"&&(X+=l.readIgnored(this._input)),this.print_string(X),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(A)),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 se=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);se.match(/[ :]$/)&&(se=this.eatString(": ").replace(/\s$/,""),this.print_string(se),this._output.space_before_token=!0),se=se.replace(/\s$/,""),se==="extend"?g=!0:se==="import"&&(y=!0),se in this.NESTED_AT_RULE?(this._nestedLevel+=1,se in this.CONDITIONAL_GROUP_RULE&&(x=!0)):!h&&m===0&&se.indexOf(":")!==-1&&(u=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")u&&(u=!1,this.outdent()),x?(x=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(O==="("?this._output.space_before_token=!1:O!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),O==="{"&&this._output.trim(!0),y=!1,g=!1,u&&(this.outdent(),u=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var ce=0;ce<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ce++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ce])){j=!0;break}(h||x)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&m===0?(this.print_string(":"),u||(u=!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 Pe=O==='"'||O==="'";this.preserveSingleSpace(Pe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")j=!1,m===0?(u&&(this.outdent(),u=!1),g=!1,y=!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(),m++,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(")")),m&&(m--,this.outdent()));else{var Se=!1;this._input.lookBack("with")&&(Se=!0),this.preserveSingleSpace(U||Se),this.print_string(this._ch),u&&O==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),M=!0):(this.eatWhitespace(),m++,this.indent())}else if(this._ch===")")m&&(m--,this.outdent()),M&&this._input.peek()===";"&&this._options.selector_separator_newline&&(M=!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&&(!u||M)&&m===0&&!y&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!u&&m===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&&s.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("="),s.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 Re=O==='"'||O==="'";this.preserveSingleSpace(Re||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&j&&this._output.add_new_line()}var Oe=this._output.get_code(C);return Oe},k.exports.Beautifier=T},function(k,I,_){var v=_(6).Options;function p(c){v.call(this,c,"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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var o=0;o<l.length;o++)l[o]!=="expand"?this.brace_style="collapse":this.brace_style=l[o]}p.prototype=new v,k.exports.Options=p}],D={};function H(k){var I=D[k];if(I!==void 0)return I.exports;var _=D[k]={exports:{}};return B[k](_,_.exports,H),_.exports}var F=H(15);N=F})();var J=N;!(te=[],Q=function(){return{css_beautify:J}}.apply(Ne,te),Q!==void 0&&(qe.exports=Q))})()},"VrN/":function(qe,Ne,K){(function(te,Q){qe.exports=Q()})(this,function(){"use strict";var te=navigator.userAgent,Q=navigator.platform,N=/gecko\/\d/i.test(te),J=/MSIE \d/.test(te),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(te),D=/Edge\/(\d+)/.exec(te),H=J||B||D,F=H&&(J?document.documentMode||6:+(D||B)[1]),k=!D&&/WebKit\//.test(te),I=k&&/Qt\/\d+\.\d+/.test(te),_=!D&&/Chrome\//.test(te),v=/Opera\//.test(te),p=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(te),a=/PhantomJS/.test(te),l=!D&&/AppleWebKit/.test(te)&&/Mobile\/\w+/.test(te),o=/Android/.test(te),r=l||o||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(te),s=l||/Mac/.test(Q),d=/\bCrOS\b/.test(te),R=/win/i.test(Q),A=v&&te.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(v=!1,k=!0);var T=s&&(I||v&&(A==null||A<12.11)),w=N||H&&F>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,t){var i=e.className,n=C(t).exec(i);if(n){var f=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(f?n[1]+f:"")}};function m(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return m(e).appendChild(t)}function u(e,t,i,n){var f=document.createElement(e);if(i&&(f.className=i),n&&(f.style.cssText=n),typeof t=="string")f.appendChild(document.createTextNode(t));else if(t)for(var P=0;P<t.length;++P)f.appendChild(t[P]);return f}function x(e,t,i,n){var f=u(e,t,i,n);return f.setAttribute("role","presentation"),f}var g;document.createRange?g=function(e,t,i,n){var f=document.createRange();return f.setEnd(n||e,i),f.setStart(e,t),f}:g=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(f){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function y(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 M(){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 E(e,t){var i=e.className;C(t).test(i)||(e.className+=(i?" ":"")+t)}function j(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!C(i[n]).test(t)&&(t+=" "+i[n]);return t}var G=function(e){e.select()};l?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:H&&(G=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 O(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function X(e,t,i,n,f){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var P=n||0,z=f||0;;){var Z=e.indexOf(" ",P);if(Z<0||Z>=t)return z+(t-P);z+=Z-P,z+=i-z%i,P=Z+1}}var $=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};$.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},$.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function se(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var ce=50,Pe={toString:function(){return"CodeMirror.Pass"}},Se={scroll:!1},Re={origin:"*mouse"},Oe={origin:"+move"};function Me(e,t,i){for(var n=0,f=0;;){var P=e.indexOf(" ",n);P==-1&&(P=e.length);var z=P-n;if(P==e.length||f+z>=t)return n+Math.min(z,t-f);if(f+=P-n,f+=i-f%i,n=P+1,f>=t)return n}}var be=[""];function ue(e){for(;be.length<=e;)be.push(ne(be)+" ");return be[e]}function ne(e){return e[e.length-1]}function ve(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function le(e,t,i){for(var n=0,f=i(t);n<e.length&&i(e[n])<=f;)n++;e.splice(n,0,t)}function ke(){}function Fe(e,t){var i;return Object.create?i=Object.create(e):(ke.prototype=e,i=new ke),t&&O(t,i),i}var Ie=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function He(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ie.test(e))}function $e(e,t){return t?t.source.indexOf("\\w")>-1&&He(e)?!0:t.test(e):He(e)}function tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Qe=/[\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 Je(e){return e.charCodeAt(0)>=768&&Qe.test(e)}function Ye(e,t,i){for(;(i<0?t>0:t<e.length)&&Je(e.charAt(t));)t+=i;return t}function gt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var f=(t+i)/2,P=n<0?Math.ceil(f):Math.floor(f);if(P==t)return e(P)?t:i;e(P)?i=P:t=P+n}}function _t(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var f=!1,P=0;P<e.length;++P){var z=e[P];(z.from<i&&z.to>t||t==i&&z.to==t)&&(n(Math.max(z.from,t),Math.min(z.to,i),z.level==1?"rtl":"ltr",P),f=!0)}f||n(t,i,"ltr")}var vt=null;function dt(e,t,i){var n;vt=null;for(var f=0;f<e.length;++f){var P=e[f];if(P.from<t&&P.to>t)return f;P.to==t&&(P.from!=P.to&&i=="before"?n=f:vt=f),P.from==t&&(P.from!=P.to&&i!="before"?n=f:vt=f)}return n!=null?n:vt}var Ct=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ie){return ie<=247?e.charAt(ie):1424<=ie&&ie<=1524?"R":1536<=ie&&ie<=1785?t.charAt(ie-1536):1774<=ie&&ie<=2220?"r":8192<=ie&&ie<=8203?"w":ie==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,P=/[LRr]/,z=/[Lb1n]/,Z=/[1n]/;function q(ie,Ee,we){this.level=ie,this.from=Ee,this.to=we}return function(ie,Ee){var we=Ee=="ltr"?"L":"R";if(ie.length==0||Ee=="ltr"&&!n.test(ie))return!1;for(var Ve=ie.length,We=[],lt=0;lt<Ve;++lt)We.push(i(ie.charCodeAt(lt)));for(var yt=0,At=we;yt<Ve;++yt){var It=We[yt];It=="m"?We[yt]=At:At=It}for(var Ut=0,Lt=we;Ut<Ve;++Ut){var jt=We[Ut];jt=="1"&&Lt=="r"?We[Ut]="n":P.test(jt)&&(Lt=jt,jt=="r"&&(We[Ut]="R"))}for(var en=1,Qt=We[0];en<Ve-1;++en){var fn=We[en];fn=="+"&&Qt=="1"&&We[en+1]=="1"?We[en]="1":fn==","&&Qt==We[en+1]&&(Qt=="1"||Qt=="n")&&(We[en]=Qt),Qt=fn}for(var Ln=0;Ln<Ve;++Ln){var ri=We[Ln];if(ri==",")We[Ln]="N";else if(ri=="%"){var Fn=void 0;for(Fn=Ln+1;Fn<Ve&&We[Fn]=="%";++Fn);for(var ki=Ln&&We[Ln-1]=="!"||Fn<Ve&&We[Fn]=="1"?"1":"N",Ti=Ln;Ti<Fn;++Ti)We[Ti]=ki;Ln=Fn-1}}for(var Jn=0,Ci=we;Jn<Ve;++Jn){var li=We[Jn];Ci=="L"&&li=="1"?We[Jn]="L":P.test(li)&&(Ci=li)}for(var ti=0;ti<Ve;++ti)if(f.test(We[ti])){var Zn=void 0;for(Zn=ti+1;Zn<Ve&&f.test(We[Zn]);++Zn);for(var Wn=(ti?We[ti-1]:we)=="L",Si=(Zn<Ve?We[Zn]:we)=="L",Hr=Wn==Si?Wn?"L":"R":we,vr=ti;vr<Zn;++vr)We[vr]=Hr;ti=Zn-1}for(var fi=[],nr,ai=0;ai<Ve;)if(z.test(We[ai])){var Ro=ai;for(++ai;ai<Ve&&z.test(We[ai]);++ai);fi.push(new q(0,Ro,ai))}else{var sr=ai,Cr=fi.length,Sr=Ee=="rtl"?1:0;for(++ai;ai<Ve&&We[ai]!="L";++ai);for(var vi=sr;vi<ai;)if(Z.test(We[vi])){sr<vi&&(fi.splice(Cr,0,new q(1,sr,vi)),Cr+=Sr);var Kr=vi;for(++vi;vi<ai&&Z.test(We[vi]);++vi);fi.splice(Cr,0,new q(2,Kr,vi)),Cr+=Sr,sr=vi}else++vi;sr<ai&&fi.splice(Cr,0,new q(1,sr,ai))}return Ee=="ltr"&&(fi[0].level==1&&(nr=ie.match(/^\s+/))&&(fi[0].from=nr[0].length,fi.unshift(new q(0,0,nr[0].length))),ne(fi).level==1&&(nr=ie.match(/\s+$/))&&(ne(fi).to-=nr[0].length,fi.push(new q(0,Ve-nr[0].length,Ve)))),Ee=="rtl"?fi.reverse():fi}}();function xt(e,t){var i=e.order;return i==null&&(i=e.order=Ct(e.text,t)),i}var Le=[],Ce=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Le).concat(i)}};function nt(e,t){return e._handlers&&e._handlers[t]||Le}function rt(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,f=n&&n[t];if(f){var P=se(f,i);P>-1&&(n[t]=f.slice(0,P).concat(f.slice(P+1)))}}}function Be(e,t){var i=nt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),f=0;f<i.length;++f)i[f].apply(null,n)}function et(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Be(e,i||t.type,e,t),de(t)||t.codemirrorIgnore}function xe(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)se(i,t[n])==-1&&i.push(t[n])}function fe(e,t){return nt(e,t).length>0}function ge(e){e.prototype.on=function(t,i){Ce(this,t,i)},e.prototype.off=function(t,i){rt(this,t,i)}}function re(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ae(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function de(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ye(e){re(e),ae(e)}function _e(e){return e.target||e.srcElement}function je(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ot=function(){if(H&&F<9)return!1;var e=u("div");return"draggable"in e||"dragDrop"in e}(),bt;function wt(e){if(bt==null){var t=u("span","\u200B");h(e,u("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(bt=t.offsetWidth<=1&&t.offsetHeight>2&&!(H&&F<8))}var i=bt?u("span","\u200B"):u("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Et;function pt(e){if(Et!=null)return Et;var t=h(e,document.createTextNode("A\u062EA")),i=g(t,0,1).getBoundingClientRect(),n=g(t,1,2).getBoundingClientRect();return m(e),!i||i.left==i.right?!1:Et=n.right-i.right<3}var Xe=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var f=e.indexOf(`
`,t);f==-1&&(f=e.length);var P=e.slice(t,e.charAt(f-1)=="\r"?f-1:f),z=P.indexOf("\r");z!=-1?(i.push(P.slice(0,z)),t+=z+1):(i.push(P),t=f+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Ge=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},De=function(){var e=u("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),oe=null;function he(e){if(oe!=null)return oe;var t=h(e,u("span","x")),i=t.getBoundingClientRect(),n=g(t,0,1).getBoundingClientRect();return oe=Math.abs(i.left-n.left)>1}var Ze={},Ue={};function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ze[e]=t}function ct(e,t){Ue[e]=t}function Te(e){if(typeof e=="string"&&Ue.hasOwnProperty(e))e=Ue[e];else if(e&&typeof e.name=="string"&&Ue.hasOwnProperty(e.name)){var t=Ue[e.name];typeof t=="string"&&(t={name:t}),e=Fe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Te("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Te("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ke(e,t){t=Te(t);var i=Ze[t.name];if(!i)return Ke(e,"text/plain");var n=i(e,t);if(st.hasOwnProperty(t.name)){var f=st[t.name];for(var P in f){if(!f.hasOwnProperty(P))continue;n.hasOwnProperty(P)&&(n["_"+P]=n[P]),n[P]=f[P]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var z in t.modeProps)n[z]=t.modeProps[z];return n}var st={};function ft(e,t){var i=st.hasOwnProperty(e)?st[e]:st[e]={};O(t,i)}function Tt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var f=t[n];f instanceof Array&&(f=f.concat([])),i[n]=f}return i}function Jt(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function an(e,t,i){return e.startState?e.startState(t,i):!0}var Vt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Vt.prototype.eol=function(){return this.pos>=this.string.length},Vt.prototype.sol=function(){return this.pos==this.lineStart},Vt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Vt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Vt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Vt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Vt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Vt.prototype.skipToEnd=function(){this.pos=this.string.length},Vt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Vt.prototype.backUp=function(e){this.pos-=e},Vt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=X(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.indentation=function(){return X(this.string,null,this.tabSize)-(this.lineStart?X(this.string,this.lineStart,this.tabSize):0)},Vt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(z){return i?z.toLowerCase():z},f=this.string.substr(this.pos,e.length);if(n(f)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var P=this.string.slice(this.pos).match(e);return P&&P.index>0?null:(P&&t!==!1&&(this.pos+=P[0].length),P)}},Vt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Vt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Vt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Vt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ot(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 i=e;!i.lines;)for(var n=0;;++n){var f=i.children[n],P=f.chunkSize();if(t<P){i=f;break}t-=P}return i.lines[t]}function gn(e,t,i){var n=[],f=t.line;return e.iter(t.line,i.line+1,function(P){var z=P.text;f==i.line&&(z=z.slice(0,i.ch)),f==t.line&&(z=z.slice(t.ch)),n.push(z),++f}),n}function Kt(e,t,i){var n=[];return e.iter(t,i,function(f){n.push(f.text)}),n}function Zt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Nt(e){if(e.parent==null)return null;for(var t=e.parent,i=se(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var f=0;!(n.children[f]==t);++f)i+=n.children[f].chunkSize();return i+t.first}function nn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var f=e.children[n],P=f.height;if(t<P){e=f;continue e}t-=P,i+=f.chunkSize()}return i}while(!e.lines);for(var z=0;z<e.lines.length;++z){var Z=e.lines[z],q=Z.height;if(t<q)break;t-=q}return i+z}function Cn(e,t){return t>=e.first&&t<e.first+e.size}function wn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function mt(e,t,i){if(i===void 0&&(i=null),!(this instanceof mt))return new mt(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Gt(e,t){return e.line-t.line||e.ch-t.ch}function Mn(e,t){return e.sticky==t.sticky&&Gt(e,t)==0}function Un(e){return mt(e.line,e.ch)}function Pn(e,t){return Gt(e,t)<0?t:e}function Vn(e,t){return Gt(e,t)<0?e:t}function V(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function S(e,t){if(t.line<e.first)return mt(e.first,0);var i=e.first+e.size-1;return t.line>i?mt(i,Ot(e,i).text.length):L(t,Ot(e,t.line).text.length)}function L(e,t){var i=e.ch;return i==null||i>t?mt(e.line,t):i<0?mt(e.line,0):e}function W(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=S(e,t[n]);return i}var ee=function(e,t){this.state=e,this.lookAhead=t},Y=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Y.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Y.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}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,i){return t instanceof ee?new Y(e,Tt(e.mode,t.state),i,t.lookAhead):new Y(e,Tt(e.mode,t),i)},Y.prototype.save=function(e){var t=e!==!1?Tt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ee(t,this.maxLookAhead):t};function Ae(e,t,i,n){var f=[e.state.modeGen],P={};Kn(e,t.text,e.doc.mode,i,function(ie,Ee){return f.push(ie,Ee)},P,n);for(var z=i.state,Z=function(ie){i.baseTokens=f;var Ee=e.state.overlays[ie],we=1,Ve=0;i.state=!0,Kn(e,t.text,Ee.mode,i,function(We,lt){for(var yt=we;Ve<We;){var At=f[we];At>We&&f.splice(we,1,We,f[we+1],At),we+=2,Ve=Math.min(We,At)}if(!lt)return;if(Ee.opaque)f.splice(yt,we-yt,We,"overlay "+lt),we=yt+2;else for(;yt<we;yt+=2){var It=f[yt+1];f[yt+1]=(It?It+" ":"")+"overlay "+lt}},P),i.state=z,i.baseTokens=null,i.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Z(q);return{styles:f,classes:P.bgClass||P.textClass?P:null}}function at(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=St(e,Nt(t)),f=t.text.length>e.options.maxHighlightLength&&Tt(e.doc.mode,n.state),P=Ae(e,t,n);f&&(n.state=f),t.stateAfter=n.save(!f),t.styles=P.styles,P.classes?t.styleClasses=P.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,i){var n=e.doc,f=e.display;if(!n.mode.startState)return new Y(n,!0,t);var P=In(e,t,i),z=P>n.first&&Ot(n,P-1).stateAfter,Z=z?Y.fromSaved(n,z,P):new Y(n,an(n.mode),P);return n.iter(P,t,function(q){Bt(e,q.text,Z);var ie=Z.line;q.stateAfter=ie==t-1||ie%5==0||ie>=f.viewFrom&&ie<f.viewTo?Z.save():null,Z.nextLine()}),i&&(n.modeFrontier=Z.line),Z}function Bt(e,t,i,n){var f=e.doc.mode,P=new Vt(t,e.options.tabSize,i);for(P.start=P.pos=n||0,t==""&&pe(f,i.state);!P.eol();)Pt(f,P,i.state),P.start=P.pos}function pe(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Jt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Pt(e,t,i,n){for(var f=0;f<10;f++){n&&(n[0]=Jt(e,i).mode);var P=e.token(t,i);if(t.pos>t.start)return P}throw new Error("Mode "+e.name+" failed to advance stream.")}var qt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Tn(e,t,i,n){var f=e.doc,P=f.mode,z;t=S(f,t);var Z=Ot(f,t.line),q=St(e,t.line,i),ie=new Vt(Z.text,e.options.tabSize,q),Ee;for(n&&(Ee=[]);(n||ie.pos<t.ch)&&!ie.eol();)ie.start=ie.pos,z=Pt(P,ie,q.state),n&&Ee.push(new qt(ie,z,Tt(f.mode,q.state)));return n?Ee:new qt(ie,z,q.state)}function Hn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Kn(e,t,i,n,f,P,z){var Z=i.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var q=0,ie=null,Ee=new Vt(t,e.options.tabSize,n),we,Ve=e.options.addModeClass&&[null];for(t==""&&Hn(pe(i,n.state),P);!Ee.eol();){if(Ee.pos>e.options.maxHighlightLength?(Z=!1,z&&Bt(e,t,n,Ee.pos),Ee.pos=t.length,we=null):we=Hn(Pt(i,Ee,n.state,Ve),P),Ve){var We=Ve[0].name;We&&(we="m-"+(we?We+" "+we:We))}if(!Z||ie!=we){for(;q<Ee.start;)q=Math.min(Ee.start,q+5e3),f(q,ie);ie=we}Ee.start=Ee.pos}for(;q<Ee.pos;){var lt=Math.min(Ee.pos,q+5e3);f(lt,ie),q=lt}}function In(e,t,i){for(var n,f,P=e.doc,z=i?-1:t-(e.doc.mode.innerMode?1e3:100),Z=t;Z>z;--Z){if(Z<=P.first)return P.first;var q=Ot(P,Z-1),ie=q.stateAfter;if(ie&&(!i||Z+(ie instanceof ee?ie.lookAhead:0)<=P.modeFrontier))return Z;var Ee=X(q.text,null,e.options.tabSize);(f==null||n>Ee)&&(f=Z-1,n=Ee)}return f}function pi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var f=Ot(e,n).stateAfter;if(f&&(!(f instanceof ee)||n+f.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var ui=!1,Bn=!1;function di(){ui=!0}function Ai(){Bn=!0}function wi(e,t,i){this.marker=e,this.from=t,this.to=i}function Yn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Wi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Pi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function yi(e,t,i){var n;if(e)for(var f=0;f<e.length;++f){var P=e[f],z=P.marker,Z=P.from==null||(z.inclusiveLeft?P.from<=t:P.from<t);if(Z||P.from==t&&z.type=="bookmark"&&(!i||!P.marker.insertLeft)){var q=P.to==null||(z.inclusiveRight?P.to>=t:P.to>t);(n||(n=[])).push(new wi(z,P.from,q?null:P.to))}}return n}function Qi(e,t,i){var n;if(e)for(var f=0;f<e.length;++f){var P=e[f],z=P.marker,Z=P.to==null||(z.inclusiveRight?P.to>=t:P.to>t);if(Z||P.from==t&&z.type=="bookmark"&&(!i||P.marker.insertLeft)){var q=P.from==null||(z.inclusiveLeft?P.from<=t:P.from<t);(n||(n=[])).push(new wi(z,q?null:P.from-t,P.to==null?null:P.to-t))}}return n}function bi(e,t){if(t.full)return null;var i=Cn(e,t.from.line)&&Ot(e,t.from.line).markedSpans,n=Cn(e,t.to.line)&&Ot(e,t.to.line).markedSpans;if(!i&&!n)return null;var f=t.from.ch,P=t.to.ch,z=Gt(t.from,t.to)==0,Z=yi(i,f,z),q=Qi(n,P,z),ie=t.text.length==1,Ee=ne(t.text).length+(ie?f:0);if(Z)for(var we=0;we<Z.length;++we){var Ve=Z[we];if(Ve.to==null){var We=Yn(q,Ve.marker);We?ie&&(Ve.to=We.to==null?null:We.to+Ee):Ve.to=f}}if(q)for(var lt=0;lt<q.length;++lt){var yt=q[lt];if(yt.to!=null&&(yt.to+=Ee),yt.from==null){var At=Yn(Z,yt.marker);At||(yt.from=Ee,ie&&(Z||(Z=[])).push(yt))}else yt.from+=Ee,ie&&(Z||(Z=[])).push(yt)}Z&&(Z=ci(Z)),q&&q!=Z&&(q=ci(q));var It=[Z];if(!ie){var Ut=t.text.length-2,Lt;if(Ut>0&&Z)for(var jt=0;jt<Z.length;++jt)Z[jt].to==null&&(Lt||(Lt=[])).push(new wi(Z[jt].marker,null,null));for(var en=0;en<Ut;++en)It.push(Lt);It.push(q)}return It}function ci(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ni(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(We){if(We.markedSpans)for(var lt=0;lt<We.markedSpans.length;++lt){var yt=We.markedSpans[lt].marker;yt.readOnly&&(!n||se(n,yt)==-1)&&(n||(n=[])).push(yt)}}),!n)return null;for(var f=[{from:t,to:i}],P=0;P<n.length;++P)for(var z=n[P],Z=z.find(0),q=0;q<f.length;++q){var ie=f[q];if(Gt(ie.to,Z.from)<0||Gt(ie.from,Z.to)>0)continue;var Ee=[q,1],we=Gt(ie.from,Z.from),Ve=Gt(ie.to,Z.to);(we<0||!z.inclusiveLeft&&!we)&&Ee.push({from:ie.from,to:Z.from}),(Ve>0||!z.inclusiveRight&&!Ve)&&Ee.push({from:Z.to,to:ie.to}),f.splice.apply(f,Ee),q+=Ee.length-3}return f}function Hi(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function _i(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function _n(e){return e.inclusiveLeft?-1:0}function on(e){return e.inclusiveRight?1:0}function Dn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),f=t.find(),P=Gt(n.from,f.from)||_n(e)-_n(t);if(P)return-P;var z=Gt(n.to,f.to)||on(e)-on(t);return z||t.id-e.id}function un(e,t){var i=Bn&&e.markedSpans,n;if(i)for(var f=void 0,P=0;P<i.length;++P)f=i[P],f.marker.collapsed&&(t?f.from:f.to)==null&&(!n||Dn(n,f.marker)<0)&&(n=f.marker);return n}function Rn(e){return un(e,!0)}function yn(e){return un(e,!1)}function Oi(e,t){var i=Bn&&e.markedSpans,n;if(i)for(var f=0;f<i.length;++f){var P=i[f];P.marker.collapsed&&(P.from==null||P.from<t)&&(P.to==null||P.to>t)&&(!n||Dn(n,P.marker)<0)&&(n=P.marker)}return n}function jn(e,t,i,n,f){var P=Ot(e,t),z=Bn&&P.markedSpans;if(z)for(var Z=0;Z<z.length;++Z){var q=z[Z];if(!q.marker.collapsed)continue;var ie=q.marker.find(0),Ee=Gt(ie.from,i)||_n(q.marker)-_n(f),we=Gt(ie.to,n)||on(q.marker)-on(f);if(Ee>=0&&we<=0||Ee<=0&&we>=0)continue;if(Ee<=0&&(q.marker.inclusiveRight&&f.inclusiveLeft?Gt(ie.to,i)>=0:Gt(ie.to,i)>0)||Ee>=0&&(q.marker.inclusiveRight&&f.inclusiveLeft?Gt(ie.from,n)<=0:Gt(ie.from,n)<0))return!0}}function Xn(e){for(var t;t=Rn(e);)e=t.find(-1,!0).line;return e}function Ki(e){for(var t;t=yn(e);)e=t.find(1,!0).line;return e}function Ri(e){for(var t,i;t=yn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Gi(e,t){var i=Ot(e,t),n=Xn(i);return i==n?t:Nt(n)}function Ii(e,t){if(t>e.lastLine())return t;var i=Ot(e,t),n;if(!Li(e,i))return t;for(;n=yn(i);)i=n.find(1,!0).line;return Nt(i)+1}function Li(e,t){var i=Bn&&t.markedSpans;if(i)for(var n=void 0,f=0;f<i.length;++f){if(n=i[f],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&ji(e,t,n))return!0}}function ji(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return ji(e,n.line,Yn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var f=void 0,P=0;P<t.markedSpans.length;++P)if(f=t.markedSpans[P],f.marker.collapsed&&!f.marker.widgetNode&&f.from==i.to&&(f.to==null||f.to!=i.from)&&(f.marker.inclusiveLeft||i.marker.inclusiveRight)&&ji(e,t,f))return!0}function Ei(e){e=Xn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var f=i.lines[n];if(f==e)break;t+=f.height}for(var P=i.parent;P;i=P,P=i.parent)for(var z=0;z<P.children.length;++z){var Z=P.children[z];if(Z==i)break;t+=Z.height}return t}function zi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Rn(n);){var f=i.find(0,!0);n=f.from.line,t+=f.from.ch-f.to.ch}for(n=e;i=yn(n);){var P=i.find(0,!0);t-=n.text.length-P.from.ch,n=P.to.line,t+=n.text.length-P.to.ch}return t}function Ji(e){var t=e.display,i=e.doc;t.maxLine=Ot(i,i.first),t.maxLineLength=zi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var f=zi(n);f>t.maxLineLength&&(t.maxLineLength=f,t.maxLine=n)})}var oi=function(e,t,i){this.text=e,_i(this,t),this.height=i?i(this):1};oi.prototype.lineNo=function(){return Nt(this)},ge(oi);function ir(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Hi(e),_i(e,i);var f=n?n(e):1;f!=e.height&&Zt(e,f)}function Ht(e){e.parent=null,Hi(e)}var $t={},zt={};function sn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?zt:$t;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function cn(e,t){var i=x("span",null,null,k?"padding-right: .1px":null),n={pre:x("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var f=0;f<=(t.rest?t.rest.length:0);f++){var P=f?t.rest[f-1]:t.line,z=void 0;n.pos=0,n.addToken=hn,pt(e.display.measure)&&(z=xt(P,e.doc.direction))&&(n.addToken=qn(n.addToken,z)),n.map=[];var Z=t!=e.display.externalMeasured&&Nt(P);tn(P,n,at(e,P,Z)),P.styleClasses&&(P.styleClasses.bgClass&&(n.bgClass=j(P.styleClasses.bgClass,n.bgClass||"")),P.styleClasses.textClass&&(n.textClass=j(P.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(wt(e.display.measure))),f==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(k){var q=n.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function Sn(e){var t=u("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function hn(e,t,i,n,f,P,z){if(!t)return;var Z=e.splitSpaces?kn(t,e.trailingSpace):t,q=e.cm.state.specialChars,ie=!1,Ee;if(!q.test(t))e.col+=t.length,Ee=document.createTextNode(Z),e.map.push(e.pos,e.pos+t.length,Ee),H&&F<9&&(ie=!0),e.pos+=t.length;else{Ee=document.createDocumentFragment();for(var we=0;;){q.lastIndex=we;var Ve=q.exec(t),We=Ve?Ve.index-we:t.length-we;if(We){var lt=document.createTextNode(Z.slice(we,we+We));H&&F<9?Ee.appendChild(u("span",[lt])):Ee.appendChild(lt),e.map.push(e.pos,e.pos+We,lt),e.col+=We,e.pos+=We}if(!Ve)break;we+=We+1;var yt=void 0;if(Ve[0]==" "){var At=e.cm.options.tabSize,It=At-e.col%At;yt=Ee.appendChild(u("span",ue(It),"cm-tab")),yt.setAttribute("role","presentation"),yt.setAttribute("cm-text"," "),e.col+=It}else Ve[0]=="\r"||Ve[0]==`
`?(yt=Ee.appendChild(u("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),yt.setAttribute("cm-text",Ve[0]),e.col+=1):(yt=e.cm.options.specialCharPlaceholder(Ve[0]),yt.setAttribute("cm-text",Ve[0]),H&&F<9?Ee.appendChild(u("span",[yt])):Ee.appendChild(yt),e.col+=1);e.map.push(e.pos,e.pos+1,yt),e.pos++}}if(e.trailingSpace=Z.charCodeAt(t.length-1)==32,i||n||f||ie||P||z){var Ut=i||"";n&&(Ut+=n),f&&(Ut+=f);var Lt=u("span",[Ee],Ut,P);if(z)for(var jt in z)z.hasOwnProperty(jt)&&jt!="style"&&jt!="class"&&Lt.setAttribute(jt,z[jt]);return e.content.appendChild(Lt)}e.content.appendChild(Ee)}function kn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",f=0;f<e.length;f++){var P=e.charAt(f);P==" "&&i&&(f==e.length-1||e.charCodeAt(f+1)==32)&&(P="\xA0"),n+=P,i=P==" "}return n}function qn(e,t){return function(i,n,f,P,z,Z,q){f=f?f+" cm-force-border":"cm-force-border";for(var ie=i.pos,Ee=ie+n.length;;){for(var we=void 0,Ve=0;Ve<t.length&&!(we=t[Ve],we.to>ie&&we.from<=ie);Ve++);if(we.to>=Ee)return e(i,n,f,P,z,Z,q);e(i,n.slice(0,we.to-ie),f,P,null,Z,q),P=null,n=n.slice(we.to-ie),ie=we.to}}}function ln(e,t,i,n){var f=!n&&i.widgetNode;f&&e.map.push(e.pos,e.pos+t,f),!n&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",i.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=t,e.trailingSpace=!1}function tn(e,t,i){var n=e.markedSpans,f=e.text,P=0;if(!n){for(var z=1;z<i.length;z+=2)t.addToken(t,f.slice(P,P=i[z]),sn(i[z+1],t.cm.options));return}for(var Z=f.length,q=0,ie=1,Ee="",we,Ve,We=0,lt,yt,At,It,Ut;;){if(We==q){lt=yt=At=Ve="",Ut=null,It=null,We=Infinity;for(var Lt=[],jt=void 0,en=0;en<n.length;++en){var Qt=n[en],fn=Qt.marker;if(fn.type=="bookmark"&&Qt.from==q&&fn.widgetNode)Lt.push(fn);else if(Qt.from<=q&&(Qt.to==null||Qt.to>q||fn.collapsed&&Qt.to==q&&Qt.from==q)){if(Qt.to!=null&&Qt.to!=q&&We>Qt.to&&(We=Qt.to,yt=""),fn.className&&(lt+=" "+fn.className),fn.css&&(Ve=(Ve?Ve+";":"")+fn.css),fn.startStyle&&Qt.from==q&&(At+=" "+fn.startStyle),fn.endStyle&&Qt.to==We&&(jt||(jt=[])).push(fn.endStyle,Qt.to),fn.title&&((Ut||(Ut={})).title=fn.title),fn.attributes)for(var Ln in fn.attributes)(Ut||(Ut={}))[Ln]=fn.attributes[Ln];fn.collapsed&&(!It||Dn(It.marker,fn)<0)&&(It=Qt)}else Qt.from>q&&We>Qt.from&&(We=Qt.from)}if(jt)for(var ri=0;ri<jt.length;ri+=2)jt[ri+1]==We&&(yt+=" "+jt[ri]);if(!It||It.from==q)for(var Fn=0;Fn<Lt.length;++Fn)ln(t,0,Lt[Fn]);if(It&&(It.from||0)==q){if(ln(t,(It.to==null?Z+1:It.to)-q,It.marker,It.from==null),It.to==null)return;It.to==q&&(It=!1)}}if(q>=Z)break;for(var ki=Math.min(Z,We);;){if(Ee){var Ti=q+Ee.length;if(!It){var Jn=Ti>ki?Ee.slice(0,ki-q):Ee;t.addToken(t,Jn,we?we+lt:lt,At,q+Jn.length==We?yt:"",Ve,Ut)}if(Ti>=ki){Ee=Ee.slice(ki-q),q=ki;break}q=Ti,At=""}Ee=f.slice(P,P=i[ie++]),we=sn(i[ie++],t.cm.options)}}}function pn(e,t,i){this.line=t,this.rest=Ri(t),this.size=this.rest?Nt(ne(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Li(e,t)}function Qn(e,t,i){for(var n=[],f,P=t;P<i;P=f){var z=new pn(e.doc,Ot(e.doc,P),P);f=P+z.size,n.push(z)}return n}var Gn=null;function rn(e){Gn?Gn.ops.push(e):e.ownsGroup=Gn={ops:[e],delayedCallbacks:[]}}function Zi(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var f=e.ops[n];if(f.cursorActivityHandlers)for(;f.cursorActivityCalled<f.cursorActivityHandlers.length;)f.cursorActivityHandlers[f.cursorActivityCalled++].call(null,f.cm)}}while(i<t.length)}function En(e,t){var i=e.ownsGroup;if(!i)return;try{Zi(i)}finally{Gn=null,t(i)}}var mn=null;function bn(e,t){var i=nt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),f;Gn?f=Gn.delayedCallbacks:mn?f=mn:(f=mn=[],setTimeout($n,0));for(var P=function(Z){f.push(function(){return i[Z].apply(null,n)})},z=0;z<i.length;++z)P(z)}function $n(){var e=mn;mn=null;for(var t=0;t<e.length;++t)e[t]()}function qi(e,t,i,n){for(var f=0;f<t.changes.length;f++){var P=t.changes[f];P=="text"?Gr(e,t):P=="gutter"?zr(e,t,i,n):P=="class"?wr(e,t):P=="widget"&&Vr(e,t,n)}t.changes=null}function Vi(e){return e.node==e.text&&(e.node=u("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),H&&F<8&&(e.node.style.zIndex=2)),e.node}function $i(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=Vi(t);t.background=n.insertBefore(u("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Ar(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):cn(e,t)}function Gr(e,t){var i=t.text.className,n=Ar(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,wr(e,t)):i&&(t.text.className=i)}function wr(e,t){$i(e,t),t.line.wrapClass?Vi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function zr(e,t,i,n){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 f=Vi(t);t.gutterBackground=u("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),f.insertBefore(t.gutterBackground,t.text)}var P=t.line.gutterMarkers;if(e.options.lineNumbers||P){var z=Vi(t),Z=t.gutter=u("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),z.insertBefore(Z,t.text),t.line.gutterClass&&(Z.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!P||!P["CodeMirror-linenumbers"])&&(t.lineNumber=Z.appendChild(u("div",wn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),P)for(var q=0;q<e.display.gutterSpecs.length;++q){var ie=e.display.gutterSpecs[q].className,Ee=P.hasOwnProperty(ie)&&P[ie];Ee&&Z.appendChild(u("div",[Ee],"CodeMirror-gutter-elt","left: "+n.gutterLeft[ie]+"px; width: "+n.gutterWidth[ie]+"px"))}}}function Vr(e,t,i){t.alignable&&(t.alignable=null);for(var n=C("CodeMirror-linewidget"),f=t.node.firstChild,P=void 0;f;f=P)P=f.nextSibling,n.test(f.className)&&t.node.removeChild(f);Yr(e,t,i)}function Ja(e,t,i,n){var f=Ar(e,t);return t.text=t.node=f.pre,f.bgClass&&(t.bgClass=f.bgClass),f.textClass&&(t.textClass=f.textClass),wr(e,t),zr(e,t,i,n),Yr(e,t,n),t.node}function Yr(e,t,i){if(Xr(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Xr(e,t.rest[n],t,i,!1)}function Xr(e,t,i,n,f){if(!t.widgets)return;for(var P=Vi(i),z=0,Z=t.widgets;z<Z.length;++z){var q=Z[z],ie=u("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||ie.setAttribute("cm-ignore-events","true"),Za(q,ie,i,n),e.display.input.setUneditable(ie),f&&q.above?P.insertBefore(ie,i.gutter||i.text):P.appendChild(ie),bn(q,"redraw")}}function Za(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var f=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(f-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=f+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function lr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!y(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,u("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function er(e,t){for(var i=_e(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Or(e){return e.lineSpace.offsetTop}function tr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,u("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function mi(e){return ce-e.display.nativeBarWidth}function rr(e){return e.display.scroller.clientWidth-mi(e)-e.display.barWidth}function yr(e){return e.display.scroller.clientHeight-mi(e)-e.display.barHeight}function $a(e,t,i){var n=e.options.lineWrapping,f=n&&rr(e);if(!t.measure.heights||n&&t.measure.width!=f){var P=t.measure.heights=[];if(n){t.measure.width=f;for(var z=t.text.firstChild.getClientRects(),Z=0;Z<z.length-1;Z++){var q=z[Z],ie=z[Z+1];Math.abs(q.bottom-ie.bottom)>2&&P.push((q.bottom+ie.top)/2-i.top)}}P.push(i.bottom-i.top)}}function Qr(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var f=0;f<e.rest.length;f++)if(Nt(e.rest[f])>i)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}function eo(e,t){t=Xn(t);var i=Nt(t),n=e.display.externalMeasured=new pn(e.doc,t,i);n.lineN=i;var f=n.built=cn(e,n);return n.text=f.pre,h(e.display.lineMeasure,f.pre),n}function Ea(e,t,i,n){return Ui(e,ur(e,t),i,n)}function ar(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[xn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function ur(e,t){var i=Nt(t),n=ar(e,i);n&&!n.text?n=null:n&&n.changes&&(qi(e,n,i,Mt(e)),e.curOp.forceUpdate=!0),n||(n=eo(e,t));var f=Qr(n,t,i);return{line:t,view:n,rect:null,map:f.map,cache:f.cache,before:f.before,hasHeights:!1}}function Ui(e,t,i,n,f){t.before&&(i=-1);var P=i+(n||""),z;return t.cache.hasOwnProperty(P)?z=t.cache[P]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($a(e,t.view,t.rect),t.hasHeights=!0),z=no(e,t,i,n),z.bogus||(t.cache[P]=z)),{left:z.left,right:z.right,top:f?z.rtop:z.top,bottom:f?z.rbottom:z.bottom}}var xa={left:0,right:0,top:0,bottom:0};function br(e,t,i){for(var n,f,P,z,Z,q,ie=0;ie<e.length;ie+=3)if(Z=e[ie],q=e[ie+1],t<Z?(f=0,P=1,z="left"):t<q?(f=t-Z,P=f+1):(ie==e.length-3||t==q&&e[ie+3]>t)&&(P=q-Z,f=P-1,t>=q&&(z="right")),f!=null){if(n=e[ie+2],Z==q&&i==(n.insertLeft?"left":"right")&&(z=i),i=="left"&&f==0)for(;ie&&e[ie-2]==e[ie-3]&&e[ie-1].insertLeft;)n=e[(ie-=3)+2],z="left";if(i=="right"&&f==q-Z)for(;ie<e.length-3&&e[ie+3]==e[ie+4]&&!e[ie+5].insertLeft;)n=e[(ie+=3)+2],z="right";break}return{node:n,start:f,end:P,collapse:z,coverStart:Z,coverEnd:q}}function to(e,t){var i=xa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var f=e.length-1;f>=0&&!((i=e[f]).left!=i.right);f--);return i}function no(e,t,i,n){var f=br(t.map,i,n),P=f.node,z=f.start,Z=f.end,q=f.collapse,ie;if(P.nodeType==3){for(var Ee=0;Ee<4;Ee++){for(;z&&Je(t.line.text.charAt(f.coverStart+z));)--z;for(;f.coverStart+Z<f.coverEnd&&Je(t.line.text.charAt(f.coverStart+Z));)++Z;if(H&&F<9&&z==0&&Z==f.coverEnd-f.coverStart?ie=P.parentNode.getBoundingClientRect():ie=to(g(P,z,Z).getClientRects(),n),ie.left||ie.right||z==0)break;Z=z,z=z-1,q="right"}H&&F<11&&(ie=io(e.display.measure,ie))}else{z>0&&(q=n="right");var we;e.options.lineWrapping&&(we=P.getClientRects()).length>1?ie=we[n=="right"?we.length-1:0]:ie=P.getBoundingClientRect()}if(H&&F<9&&!z&&(!ie||!ie.left&&!ie.right)){var Ve=P.parentNode.getClientRects()[0];Ve?ie={left:Ve.left,right:Ve.left+kt(e.display),top:Ve.top,bottom:Ve.bottom}:ie=xa}for(var We=ie.top-t.rect.top,lt=ie.bottom-t.rect.top,yt=(We+lt)/2,At=t.view.measure.heights,It=0;It<At.length-1&&!(yt<At[It]);It++);var Ut=It?At[It-1]:0,Lt=At[It],jt={left:(q=="right"?ie.right:ie.left)-t.rect.left,right:(q=="left"?ie.left:ie.right)-t.rect.left,top:Ut,bottom:Lt};return!ie.left&&!ie.right&&(jt.bogus=!0),e.options.singleCursorHeightPerLine||(jt.rtop=We,jt.rbottom=lt),jt}function io(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!he(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function Ta(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 Ca(e){e.display.externalMeasure=null,m(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ta(e.display.view[t])}function dr(e){Ca(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Sa(){return _&&o?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Aa(){return _&&o?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Jr(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=lr(e.widgets[i]));return t}function Rr(e,t,i,n,f){if(!f){var P=Jr(t);i.top+=P,i.bottom+=P}if(n=="line")return i;n||(n="local");var z=Ei(t);if(n=="local"?z+=Or(e.display):z-=e.display.viewOffset,n=="page"||n=="window"){var Z=e.display.lineSpace.getBoundingClientRect();z+=Z.top+(n=="window"?0:Aa());var q=Z.left+(n=="window"?0:Sa());i.left+=q,i.right+=q}return i.top+=z,i.bottom+=z,i}function wa(e,t,i){if(i=="div")return t;var n=t.left,f=t.top;if(i=="page")n-=Sa(),f-=Aa();else if(i=="local"||!i){var P=e.display.sizer.getBoundingClientRect();n+=P.left,f+=P.top}var z=e.display.lineSpace.getBoundingClientRect();return{left:n-z.left,top:f-z.top}}function Zr(e,t,i,n,f){return n||(n=Ot(e.doc,t.line)),Rr(e,n,Ea(e,n,t.ch,f),i)}function ei(e,t,i,n,f,P){n=n||Ot(e.doc,t.line),f||(f=ur(e,n));function z(lt,yt){var At=Ui(e,f,lt,yt?"right":"left",P);return yt?At.left=At.right:At.right=At.left,Rr(e,n,At,i)}var Z=xt(n,e.doc.direction),q=t.ch,ie=t.sticky;if(q>=n.text.length?(q=n.text.length,ie="before"):q<=0&&(q=0,ie="after"),!Z)return z(ie=="before"?q-1:q,ie=="before");function Ee(lt,yt,At){var It=Z[yt],Ut=It.level==1;return z(At?lt-1:lt,Ut!=At)}var we=dt(Z,q,ie),Ve=vt,We=Ee(q,we,ie=="before");return Ve!=null&&(We.other=Ee(q,Ve,ie!="before")),We}function Oa(e,t){var i=0;t=S(e.doc,t),e.options.lineWrapping||(i=kt(e.display)*t.ch);var n=Ot(e.doc,t.line),f=Ei(n)+Or(e.display);return{left:i,right:i,top:f,bottom:f+n.height}}function qr(e,t,i,n,f){var P=mt(e,t,i);return P.xRel=f,n&&(P.outside=n),P}function $r(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return qr(n.first,0,null,-1,-1);var f=nn(n,i),P=n.first+n.size-1;if(f>P)return qr(n.first+n.size-1,Ot(n,P).text.length,null,1,1);t<0&&(t=0);for(var z=Ot(n,f);;){var Z=ut(e,z,f,t,i),q=Oi(z,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!q)return Z;var ie=q.find(1);if(ie.line==f)return ie;z=Ot(n,f=ie.line)}}function Ra(e,t,i,n){n-=Jr(t);var f=t.text.length,P=gt(function(z){return Ui(e,i,z-1).bottom<=n},f,0);return f=gt(function(z){return Ui(e,i,z).top>n},P,f),{begin:P,end:f}}function Ft(e,t,i,n){i||(i=ur(e,t));var f=Rr(e,t,Ui(e,i,n),"line").top;return Ra(e,t,i,f)}function me(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function ut(e,t,i,n,f){f-=Ei(t);var P=ur(e,t),z=Jr(t),Z=0,q=t.text.length,ie=!0,Ee=xt(t,e.doc.direction);if(Ee){var we=(e.options.lineWrapping?Dt:it)(e,t,i,P,Ee,n,f);ie=we.level!=1,Z=ie?we.from:we.to-1,q=ie?we.to:we.from-1}var Ve=null,We=null,lt=gt(function(en){var Qt=Ui(e,P,en);return Qt.top+=z,Qt.bottom+=z,me(Qt,n,f,!1)?(Qt.top<=f&&Qt.left<=n&&(Ve=en,We=Qt),!0):!1},Z,q),yt,At,It=!1;if(We){var Ut=n-We.left<We.right-n,Lt=Ut==ie;lt=Ve+(Lt?0:1),At=Lt?"after":"before",yt=Ut?We.left:We.right}else{!ie&&(lt==q||lt==Z)&&lt++,At=lt==0?"after":lt==t.text.length?"before":Ui(e,P,lt-(ie?1:0)).bottom+z<=f==ie?"after":"before";var jt=ei(e,mt(i,lt,At),"line",t,P);yt=jt.left,It=f<jt.top?-1:f>=jt.bottom?1:0}return lt=Ye(t.text,lt,1),qr(i,lt,At,It,n-yt)}function it(e,t,i,n,f,P,z){var Z=gt(function(we){var Ve=f[we],We=Ve.level!=1;return me(ei(e,mt(i,We?Ve.to:Ve.from,We?"before":"after"),"line",t,n),P,z,!0)},0,f.length-1),q=f[Z];if(Z>0){var ie=q.level!=1,Ee=ei(e,mt(i,ie?q.from:q.to,ie?"after":"before"),"line",t,n);me(Ee,P,z,!0)&&Ee.top>z&&(q=f[Z-1])}return q}function Dt(e,t,i,n,f,P,z){var Z=Ra(e,t,n,z),q=Z.begin,ie=Z.end;/\s/.test(t.text.charAt(ie-1))&&ie--;for(var Ee=null,we=null,Ve=0;Ve<f.length;Ve++){var We=f[Ve];if(We.from>=ie||We.to<=q)continue;var lt=We.level!=1,yt=Ui(e,n,lt?Math.min(ie,We.to)-1:Math.max(q,We.from)).right,At=yt<P?P-yt+1e9:yt-P;(!Ee||we>At)&&(Ee=We,we=At)}return Ee||(Ee=f[f.length-1]),Ee.from<q&&(Ee={from:q,to:Ee.to,level:Ee.level}),Ee.to>ie&&(Ee={from:Ee.from,to:ie,level:Ee.level}),Ee}var ht;function Rt(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ht==null){ht=u("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ht.appendChild(document.createTextNode("x")),ht.appendChild(u("br"));ht.appendChild(document.createTextNode("x"))}h(e.measure,ht);var i=ht.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),m(e.measure),i||1}function kt(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=u("span","xxxxxxxxxx"),i=u("pre",[t],"CodeMirror-line-like");h(e.measure,i);var n=t.getBoundingClientRect(),f=(n.right-n.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Mt(e){for(var t=e.display,i={},n={},f=t.gutters.clientLeft,P=t.gutters.firstChild,z=0;P;P=P.nextSibling,++z){var Z=e.display.gutterSpecs[z].className;i[Z]=P.offsetLeft+P.clientLeft+f,n[Z]=P.clientWidth}return{fixedPos:Yt(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Yt(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Wt(e){var t=Rt(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/kt(e.display)-3);return function(f){if(Li(e.doc,f))return 0;var P=0;if(f.widgets)for(var z=0;z<f.widgets.length;z++)f.widgets[z].height&&(P+=f.widgets[z].height);return i?P+(Math.ceil(f.text.length/n)||1)*t:P+t}}function Xt(e){var t=e.doc,i=Wt(e);t.iter(function(n){var f=i(n);f!=n.height&&Zt(n,f)})}function vn(e,t,i,n){var f=e.display;if(!i&&_e(t).getAttribute("cm-not-content")=="true")return null;var P,z,Z=f.lineSpace.getBoundingClientRect();try{P=t.clientX-Z.left,z=t.clientY-Z.top}catch(we){return null}var q=$r(e,P,z),ie;if(n&&q.xRel>0&&(ie=Ot(e.doc,q.line).text).length==q.ch){var Ee=X(ie,ie.length,e.options.tabSize)-ie.length;q=mt(q.line,Math.max(0,Math.round((P-qa(e.display).left)/kt(e.display))-Ee))}return q}function xn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function dn(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var f=e.display;if(n&&i<f.viewTo&&(f.updateLineNumbers==null||f.updateLineNumbers>t)&&(f.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=f.viewTo)Bn&&Gi(e.doc,t)<f.viewTo&&Di(e);else if(i<=f.viewFrom)Bn&&Ii(e.doc,i+n)>f.viewFrom?Di(e):(f.viewFrom+=n,f.viewTo+=n);else if(t<=f.viewFrom&&i>=f.viewTo)Di(e);else if(t<=f.viewFrom){var P=cr(e,i,i+n,1);P?(f.view=f.view.slice(P.index),f.viewFrom=P.lineN,f.viewTo+=n):Di(e)}else if(i>=f.viewTo){var z=cr(e,t,t,-1);z?(f.view=f.view.slice(0,z.index),f.viewTo=z.lineN):Di(e)}else{var Z=cr(e,t,t,-1),q=cr(e,i,i+n,1);Z&&q?(f.view=f.view.slice(0,Z.index).concat(Qn(e,Z.lineN,q.lineN)).concat(f.view.slice(q.index)),f.viewTo+=n):Di(e)}var ie=f.externalMeasured;ie&&(i<ie.lineN?ie.lineN+=n:t<ie.lineN+ie.size&&(f.externalMeasured=null))}function si(e,t,i){e.curOp.viewChanged=!0;var n=e.display,f=e.display.externalMeasured;if(f&&t>=f.lineN&&t<f.lineN+f.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var P=n.view[xn(e,t)];if(P.node==null)return;var z=P.changes||(P.changes=[]);se(z,i)==-1&&z.push(i)}function Di(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function cr(e,t,i,n){var f=xn(e,t),P,z=e.display.view;if(!Bn||i==e.doc.first+e.doc.size)return{index:f,lineN:i};for(var Z=e.display.viewFrom,q=0;q<f;q++)Z+=z[q].size;if(Z!=t){if(n>0){if(f==z.length-1)return null;P=Z+z[f].size-t,f++}else P=Z-t;t+=P,i+=P}for(;Gi(e.doc,i)!=i;){if(f==(n<0?0:z.length-1))return null;i+=n*z[f-(n<0?1:0)].size,f+=n}return{index:f,lineN:i}}function Ia(e,t,i){var n=e.display,f=n.view;f.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Qn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Qn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(xn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Qn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,xn(e,i)))),n.viewTo=i}function Lo(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var f=t[n];!f.hidden&&(!f.node||f.changes)&&++i}return i}function ea(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Do(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},f=n.cursors=document.createDocumentFragment(),P=n.selection=document.createDocumentFragment(),z=0;z<i.sel.ranges.length;z++){if(!t&&z==i.sel.primIndex)continue;var Z=i.sel.ranges[z];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var q=Z.empty();(q||e.options.showCursorWhenSelecting)&&Mo(e,Z.head,f),q||Ys(e,Z,P)}return n}function Mo(e,t,i){var n=ei(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),f=i.appendChild(u("div","\xA0","CodeMirror-cursor"));if(f.style.left=n.left+"px",f.style.top=n.top+"px",f.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var P=i.appendChild(u("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));P.style.display="",P.style.left=n.other.left+"px",P.style.top=n.other.top+"px",P.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function La(e,t){return e.top-t.top||e.left-t.left}function Ys(e,t,i){var n=e.display,f=e.doc,P=document.createDocumentFragment(),z=qa(e.display),Z=z.left,q=Math.max(n.sizerWidth,rr(e)-n.sizer.offsetLeft)-z.right,ie=f.direction=="ltr";function Ee(Lt,jt,en,Qt){jt<0&&(jt=0),jt=Math.round(jt),Qt=Math.round(Qt),P.appendChild(u("div",null,"CodeMirror-selected","position: absolute; left: "+Lt+`px;
top: `+jt+"px; width: "+(en==null?q-Lt:en)+`px;
height: `+(Qt-jt)+"px"))}function we(Lt,jt,en){var Qt=Ot(f,Lt),fn=Qt.text.length,Ln,ri;function Fn(Jn,Ci){return Zr(e,mt(Lt,Jn),"div",Qt,Ci)}function ki(Jn,Ci,li){var ti=Ft(e,Qt,null,Jn),Zn=Ci=="ltr"==(li=="after")?"left":"right",Wn=li=="after"?ti.begin:ti.end-(/\s/.test(Qt.text.charAt(ti.end-1))?2:1);return Fn(Wn,Zn)[Zn]}var Ti=xt(Qt,f.direction);return _t(Ti,jt||0,en==null?fn:en,function(Jn,Ci,li,ti){var Zn=li=="ltr",Wn=Fn(Jn,Zn?"left":"right"),Si=Fn(Ci-1,Zn?"right":"left"),Hr=jt==null&&Jn==0,vr=en==null&&Ci==fn,fi=ti==0,nr=!Ti||ti==Ti.length-1;if(Si.top-Wn.top<=3){var ai=(ie?Hr:vr)&&fi,Ro=(ie?vr:Hr)&&nr,sr=ai?Z:(Zn?Wn:Si).left,Cr=Ro?q:(Zn?Si:Wn).right;Ee(sr,Wn.top,Cr-sr,Wn.bottom)}else{var Sr,vi,Kr,Io;Zn?(Sr=ie&&Hr&&fi?Z:Wn.left,vi=ie?q:ki(Jn,li,"before"),Kr=ie?Z:ki(Ci,li,"after"),Io=ie&&vr&&nr?q:Si.right):(Sr=ie?ki(Jn,li,"before"):Z,vi=!ie&&Hr&&fi?q:Wn.right,Kr=!ie&&vr&&nr?Z:Si.left,Io=ie?ki(Ci,li,"after"):q),Ee(Sr,Wn.top,vi-Sr,Wn.bottom),Wn.bottom<Si.top&&Ee(Z,Wn.bottom,null,Si.top),Ee(Kr,Si.top,Io-Kr,Si.bottom)}(!Ln||La(Wn,Ln)<0)&&(Ln=Wn),La(Si,Ln)<0&&(Ln=Si),(!ri||La(Wn,ri)<0)&&(ri=Wn),La(Si,ri)<0&&(ri=Si)}),{start:Ln,end:ri}}var Ve=t.from(),We=t.to();if(Ve.line==We.line)we(Ve.line,Ve.ch,We.ch);else{var lt=Ot(f,Ve.line),yt=Ot(f,We.line),At=Xn(lt)==Xn(yt),It=we(Ve.line,Ve.ch,At?lt.text.length+1:null).end,Ut=we(We.line,At?0:null,We.ch).start;At&&(It.top<Ut.top-2?(Ee(It.right,It.top,null,It.bottom),Ee(Z,Ut.top,Ut.left,Ut.bottom)):Ee(It.right,It.top,Ut.left-It.right,It.bottom)),It.bottom<Ut.top&&Ee(Z,It.bottom,null,Ut.top)}i.appendChild(P)}function ro(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ir(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ko(e){e.state.focused||(e.display.input.focus(),ao(e))}function Po(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ir(e))},100)}function ao(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Be(e,"focus",e,t),e.state.focused=!0,E(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ro(e)}function Ir(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Da(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var f=t.view[n],P=e.options.lineWrapping,z=void 0,Z=0;if(f.hidden)continue;if(H&&F<8){var q=f.node.offsetTop+f.node.offsetHeight;z=q-i,i=q}else{var ie=f.node.getBoundingClientRect();z=ie.bottom-ie.top,!P&&f.text.firstChild&&(Z=f.text.firstChild.getBoundingClientRect().right-ie.left-1)}var Ee=f.line.height-z;if((Ee>.005||Ee<-.005)&&(Zt(f.line,z),No(f.line),f.rest))for(var we=0;we<f.rest.length;we++)No(f.rest[we]);if(Z>e.display.sizerWidth){var Ve=Math.ceil(Z/kt(e.display));Ve>e.display.maxLineLength&&(e.display.maxLineLength=Ve,e.display.maxLine=f.line,e.display.maxLineChanged=!0)}}}function No(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Ma(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Or(e));var f=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,P=nn(t,n),z=nn(t,f);if(i&&i.ensure){var Z=i.ensure.from.line,q=i.ensure.to.line;Z<P?(P=Z,z=nn(t,Ei(Ot(t,Z))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=z&&(P=nn(t,Ei(Ot(t,q))-e.wrapper.clientHeight),z=q)}return{from:P,to:Math.max(z,P+1)}}function Xs(e,t){if(et(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),f=null;if(t.top+n.top<0?f=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!a){var P=u("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Or(e.display))+`px;
height: `+(t.bottom-t.top+mi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(P),P.scrollIntoView(f),e.display.lineSpace.removeChild(P)}}function Qs(e,t,i,n){n==null&&(n=0);var f;!e.options.lineWrapping&&t==i&&(t=t.ch?mt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?mt(t.line,t.ch+1,"before"):t);for(var P=0;P<5;P++){var z=!1,Z=ei(e,t),q=!i||i==t?Z:ei(e,i);f={left:Math.min(Z.left,q.left),top:Math.min(Z.top,q.top)-n,right:Math.max(Z.left,q.left),bottom:Math.max(Z.bottom,q.bottom)+n};var ie=oo(e,f),Ee=e.doc.scrollTop,we=e.doc.scrollLeft;if(ie.scrollTop!=null&&(na(e,ie.scrollTop),Math.abs(e.doc.scrollTop-Ee)>1&&(z=!0)),ie.scrollLeft!=null&&(_r(e,ie.scrollLeft),Math.abs(e.doc.scrollLeft-we)>1&&(z=!0)),!z)break}return f}function Js(e,t){var i=oo(e,t);i.scrollTop!=null&&na(e,i.scrollTop),i.scrollLeft!=null&&_r(e,i.scrollLeft)}function oo(e,t){var i=e.display,n=Rt(e.display);t.top<0&&(t.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,P=yr(e),z={};t.bottom-t.top>P&&(t.bottom=t.top+P);var Z=e.doc.height+tr(i),q=t.top<n,ie=t.bottom>Z-n;if(t.top<f)z.scrollTop=q?0:t.top;else if(t.bottom>f+P){var Ee=Math.min(t.top,(ie?Z:t.bottom)-P);Ee!=f&&(z.scrollTop=Ee)}var we=e.options.fixedGutter?0:i.gutters.offsetWidth,Ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-we,We=rr(e)-i.gutters.offsetWidth,lt=t.right-t.left>We;return lt&&(t.right=t.left+We),t.left<10?z.scrollLeft=0:t.left<Ve?z.scrollLeft=Math.max(0,t.left+we-(lt?0:10)):t.right>We+Ve-3&&(z.scrollLeft=t.right+(lt?0:10)-We),z}function so(e,t){if(t==null)return;ka(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Lr(e){ka(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ta(e,t,i){(t!=null||i!=null)&&ka(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){ka(e),e.curOp.scrollToPos=t}function ka(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Oa(e,t.from),n=Oa(e,t.to);Uo(e,i,n,t.margin)}}function Uo(e,t,i,n){var f=oo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});ta(e,f.scrollLeft,f.scrollTop)}function na(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||uo(e,{top:t}),Bo(e,t,!0),N&&uo(e),aa(e,100)}function Bo(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function _r(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ko(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ia(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+tr(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?i:0,docHeight:n,scrollHeight:n+mi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Er=function(e,t,i){this.cm=i;var n=this.vert=u("div",[u("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=u("div",[u("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=f.tabIndex=-1,e(n),e(f),Ce(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ce(f,"scroll",function(){f.clientWidth&&t(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,H&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Er.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var f=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var P=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+P)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Er.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Er.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Er.prototype.zeroWidthHack=function(){var e=s&&!c?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new $,this.disableVert=new $},Er.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var f=e.getBoundingClientRect(),P=i=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);P!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Er.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ra=function(){};ra.prototype.update=function(){return{bottom:0,right:0}},ra.prototype.setScrollLeft=function(){},ra.prototype.setScrollTop=function(){},ra.prototype.clear=function(){};function Dr(e,t){t||(t=ia(e));var i=e.display.barWidth,n=e.display.barHeight;Fo(e,t);for(var f=0;f<4&&i!=e.display.barWidth||n!=e.display.barHeight;f++)i!=e.display.barWidth&&e.options.lineWrapping&&Da(e),Fo(e,ia(e)),i=e.display.barWidth,n=e.display.barHeight}function Fo(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var jo={native:Er,null:ra};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new jo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ce(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?_r(e,t):na(e,t)},e),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function xr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++qs},rn(e.curOp)}function Tr(e){var t=e.curOp;t&&En(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;$s(i)})}function $s(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var f=0;f<t.length;f++)nl(t[f]);for(var P=0;P<t.length;P++)il(t[P]);for(var z=0;z<t.length;z++)rl(t[z])}function el(e){var t=e.cm,i=t.display;ol(t),e.updateMaxLine&&Ji(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Pa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&lo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Da(t),e.barMeasure=ia(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ea(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+mi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&_r(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Dr(t,e.barMeasure),e.updatedDisplay&&ho(t,e.barMeasure),e.selectionChanged&&ro(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&ko(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Ho(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Bo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&_r(t,e.scrollLeft,!0,!0),e.scrollToPos){var f=Qs(t,S(n,e.scrollToPos.from),S(n,e.scrollToPos.to),e.scrollToPos.margin);Xs(t,f)}var P=e.maybeHiddenMarkers,z=e.maybeUnhiddenMarkers;if(P)for(var Z=0;Z<P.length;++Z)P[Z].lines.length||Be(P[Z],"hide");if(z)for(var q=0;q<z.length;++q)z[q].lines.length&&Be(z[q],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Mi(e,t){if(e.curOp)return t();xr(e);try{return t()}finally{Tr(e)}}function ni(e,t){return function(){if(e.curOp)return t.apply(e,arguments);xr(e);try{return t.apply(e,arguments)}finally{Tr(e)}}}function gi(e){return function(){if(this.curOp)return e.apply(this,arguments);xr(this);try{return e.apply(this,arguments)}finally{Tr(this)}}}function ii(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);xr(t);try{return e.apply(this,arguments)}finally{Tr(t)}}}function aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=St(e,t.highlightFrontier),f=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(P){if(n.line>=e.display.viewFrom){var z=P.styles,Z=P.text.length>e.options.maxHighlightLength?Tt(t.mode,n.state):null,q=Ae(e,P,n,!0);Z&&(n.state=Z),P.styles=q.styles;var ie=P.styleClasses,Ee=q.classes;Ee?P.styleClasses=Ee:ie&&(P.styleClasses=null);for(var we=!z||z.length!=P.styles.length||ie!=Ee&&(!ie||!Ee||ie.bgClass!=Ee.bgClass||ie.textClass!=Ee.textClass),Ve=0;!we&&Ve<z.length;++Ve)we=z[Ve]!=P.styles[Ve];we&&f.push(n.line),P.stateAfter=n.save(),n.nextLine()}else P.text.length<=e.options.maxHighlightLength&&Bt(e,P.text,n),P.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return aa(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),f.length&&Mi(e,function(){for(var P=0;P<f.length;P++)si(e,f[P],"text")})}var Pa=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Ma(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=rr(e),this.force=i,this.dims=Mt(e),this.events=[]};Pa.prototype.signal=function(e,t){fe(e,t)&&this.events.push(arguments)},Pa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Be.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=mi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=mi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=M();if(!t||!y(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&y(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function lo(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Di(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Lo(e)==0)return!1;Go(e)&&(Di(e),t.dims=Mt(e));var f=n.first+n.size,P=Math.max(t.visible.from-e.options.viewportMargin,n.first),z=Math.min(f,t.visible.to+e.options.viewportMargin);i.viewFrom<P&&P-i.viewFrom<20&&(P=Math.max(n.first,i.viewFrom)),i.viewTo>z&&i.viewTo-z<20&&(z=Math.min(f,i.viewTo)),Bn&&(P=Gi(e.doc,P),z=Ii(e.doc,z));var Z=P!=i.viewFrom||z!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ia(e,P,z),i.viewOffset=Ei(Ot(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var q=Lo(e);if(!Z&&q==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ie=sl(e);return q>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),q>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(ie),m(i.cursorDiv),m(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,Z&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,aa(e,400)),i.updateLineNumbers=null,!0}function Ho(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==rr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+tr(e.display)-yr(e),i.top)}),t.visible=Ma(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Ma(e.display,e.doc,i));if(!lo(e,t))break;Da(e);var f=ia(e);ea(e),Dr(e,f),ho(e,f),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 uo(e,t){var i=new Pa(e,t);if(lo(e,i)){Da(e),Ho(e,i);var n=ia(e);ea(e),Dr(e,n),ho(e,n),i.finish()}}function ul(e,t,i){var n=e.display,f=e.options.lineNumbers,P=n.lineDiv,z=P.firstChild;function Z(lt){var yt=lt.nextSibling;return k&&s&&e.display.currentWheelTarget==lt?lt.style.display="none":lt.parentNode.removeChild(lt),yt}for(var q=n.view,ie=n.viewFrom,Ee=0;Ee<q.length;Ee++){var we=q[Ee];if(!we.hidden)if(!we.node||we.node.parentNode!=P){var Ve=Ja(e,we,ie,i);P.insertBefore(Ve,z)}else{for(;z!=we.node;)z=Z(z);var We=f&&t!=null&&t<=ie&&we.lineNumber;we.changes&&(se(we.changes,"gutter")>-1&&(We=!1),qi(e,we,ie,i)),We&&(m(we.lineNumber),we.lineNumber.appendChild(document.createTextNode(wn(e.options,ie)))),z=we.node.nextSibling}ie+=we.size}for(;z;)z=Z(z)}function co(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ho(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+mi(e)+"px"}function Ko(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Yt(t)-t.scroller.scrollLeft+e.doc.scrollLeft,f=t.gutters.offsetWidth,P=n+"px",z=0;z<i.length;z++)if(!i[z].hidden){e.options.fixedGutter&&(i[z].gutter&&(i[z].gutter.style.left=P),i[z].gutterBackground&&(i[z].gutterBackground.style.left=P));var Z=i[z].alignable;if(Z)for(var q=0;q<Z.length;q++)Z[q].style.left=P}e.options.fixedGutter&&(t.gutters.style.left=n+f+"px")}function Go(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=wn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var f=n.measure.appendChild(u("div",[u("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),P=f.firstChild.offsetWidth,z=f.offsetWidth-P;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(P,n.lineGutter.offsetWidth-z)+1,n.lineNumWidth=n.lineNumInnerWidth+z,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",co(e.display),!0}return!1}function fo(e,t){for(var i=[],n=!1,f=0;f<e.length;f++){var P=e[f],z=null;if(typeof P!="string"&&(z=P.style,P=P.className),P=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:P,style:z})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function zo(e){var t=e.gutters,i=e.gutterSpecs;m(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var f=i[n],P=f.className,z=f.style,Z=t.appendChild(u("div",null,"CodeMirror-gutter "+P));z&&(Z.style.cssText=z),P=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",co(e)}function oa(e){zo(e.display),dn(e),Ko(e)}function dl(e,t,i,n){var f=this;this.input=i,f.scrollbarFiller=u("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=u("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=x("div",null,"CodeMirror-code"),f.selectionDiv=u("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=u("div",null,"CodeMirror-cursors"),f.measure=u("div",null,"CodeMirror-measure"),f.lineMeasure=u("div",null,"CodeMirror-measure"),f.lineSpace=x("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var P=x("div",[f.lineSpace],"CodeMirror-lines");f.mover=u("div",[P],null,"position: relative"),f.sizer=u("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=u("div",null,null,"position: absolute; height: "+ce+"px; width: 1px;"),f.gutters=u("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=u("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=u("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),H&&F<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),!k&&!(N&&r)&&(f.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(f.wrapper):e(f.wrapper)),f.viewFrom=f.viewTo=t.first,f.reportedViewFrom=f.reportedViewTo=t.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,f.gutterSpecs=fo(n.gutters,n.lineNumbers),zo(f),i.init(f)}var Na=0,Bi=null;H?Bi=-.53:N?Bi=15:_?Bi=-.7:p&&(Bi=-1/3);function Vo(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Vo(e);return t.x*=Bi,t.y*=Bi,t}function Yo(e,t){var i=Vo(t),n=i.x,f=i.y,P=e.display,z=P.scroller,Z=z.scrollWidth>z.clientWidth,q=z.scrollHeight>z.clientHeight;if(!(n&&Z||f&&q))return;if(f&&s&&k){e:for(var ie=t.target,Ee=P.view;ie!=z;ie=ie.parentNode)for(var we=0;we<Ee.length;we++)if(Ee[we].node==ie){e.display.currentWheelTarget=ie;break e}}if(n&&!N&&!v&&Bi!=null){f&&q&&na(e,Math.max(0,z.scrollTop+f*Bi)),_r(e,Math.max(0,z.scrollLeft+n*Bi)),(!f||f&&q)&&re(t),P.wheelStartX=null;return}if(f&&Bi!=null){var Ve=f*Bi,We=e.doc.scrollTop,lt=We+P.wrapper.clientHeight;Ve<0?We=Math.max(0,We+Ve-50):lt=Math.min(e.doc.height,lt+Ve+50),uo(e,{top:We,bottom:lt})}Na<20&&(P.wheelStartX==null?(P.wheelStartX=z.scrollLeft,P.wheelStartY=z.scrollTop,P.wheelDX=n,P.wheelDY=f,setTimeout(function(){if(P.wheelStartX==null)return;var yt=z.scrollLeft-P.wheelStartX,At=z.scrollTop-P.wheelStartY,It=At&&P.wheelDY&&At/P.wheelDY||yt&&P.wheelDX&&yt/P.wheelDX;if(P.wheelStartX=P.wheelStartY=null,!It)return;Bi=(Bi*Na+It)/(Na+1),++Na},200)):(P.wheelDX+=n,P.wheelDY+=f))}var Fi=function(e,t){this.ranges=e,this.primIndex=t};Fi.prototype.primary=function(){return this.ranges[this.primIndex]},Fi.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 i=this.ranges[t],n=e.ranges[t];if(!Mn(i.anchor,n.anchor)||!Mn(i.head,n.head))return!1}return!0},Fi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new An(Un(this.ranges[t].anchor),Un(this.ranges[t].head));return new Fi(e,this.primIndex)},Fi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Fi.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Gt(t,n.from())>=0&&Gt(e,n.to())<=0)return i}return-1};var An=function(e,t){this.anchor=e,this.head=t};An.prototype.from=function(){return Vn(this.anchor,this.head)},An.prototype.to=function(){return Pn(this.anchor,this.head)},An.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yi(e,t,i){var n=e&&e.options.selectionsMayTouch,f=t[i];t.sort(function(Ve,We){return Gt(Ve.from(),We.from())}),i=se(t,f);for(var P=1;P<t.length;P++){var z=t[P],Z=t[P-1],q=Gt(Z.to(),z.from());if(n&&!z.empty()?q>0:q>=0){var ie=Vn(Z.from(),z.from()),Ee=Pn(Z.to(),z.to()),we=Z.empty()?z.from()==z.head:Z.from()==Z.head;P<=i&&--i,t.splice(--P,2,new An(we?Ee:ie,we?ie:Ee))}}return new Fi(t,i)}function hr(e,t){return new Fi([new An(e,t||e)],0)}function fr(e){return e.text?mt(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Xo(e,t){if(Gt(e,t.from)<0)return e;if(Gt(e,t.to)<=0)return fr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=fr(t).ch-t.to.ch),mt(i,n)}function po(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var f=e.sel.ranges[n];i.push(new An(Xo(f.anchor,t),Xo(f.head,t)))}return Yi(e.cm,i,e.sel.primIndex)}function Qo(e,t,i){return e.line==t.line?mt(i.line,e.ch-t.ch+i.ch):mt(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],f=mt(e.first,0),P=f,z=0;z<t.length;z++){var Z=t[z],q=Qo(Z.from,f,P),ie=Qo(fr(Z),f,P);if(f=Z.to,P=ie,i=="around"){var Ee=e.sel.ranges[z],we=Gt(Ee.head,Ee.anchor)<0;n[z]=new An(we?ie:q,we?q:ie)}else n[z]=new An(q,q)}return new Fi(n,e.sel.primIndex)}function mo(e){e.doc.mode=Ke(e.options,e.doc.modeOption),sa(e)}function sa(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,aa(e,100),e.state.modeGen++,e.curOp&&dn(e)}function Jo(e,t){return t.from.ch==0&&t.to.ch==0&&ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,i,n){function f(Ut){return i?i[Ut]:null}function P(Ut,Lt,jt){ir(Ut,Lt,jt,n),bn(Ut,"change",Ut,t)}function z(Ut,Lt){for(var jt=[],en=Ut;en<Lt;++en)jt.push(new oi(ie[en],f(en),n));return jt}var Z=t.from,q=t.to,ie=t.text,Ee=Ot(e,Z.line),we=Ot(e,q.line),Ve=ne(ie),We=f(ie.length-1),lt=q.line-Z.line;if(t.full)e.insert(0,z(0,ie.length)),e.remove(ie.length,e.size-ie.length);else if(Jo(e,t)){var yt=z(0,ie.length-1);P(we,we.text,We),lt&&e.remove(Z.line,lt),yt.length&&e.insert(Z.line,yt)}else if(Ee==we)if(ie.length==1)P(Ee,Ee.text.slice(0,Z.ch)+Ve+Ee.text.slice(q.ch),We);else{var At=z(1,ie.length-1);At.push(new oi(Ve+Ee.text.slice(q.ch),We,n)),P(Ee,Ee.text.slice(0,Z.ch)+ie[0],f(0)),e.insert(Z.line+1,At)}else if(ie.length==1)P(Ee,Ee.text.slice(0,Z.ch)+ie[0]+we.text.slice(q.ch),f(0)),e.remove(Z.line+1,lt);else{P(Ee,Ee.text.slice(0,Z.ch)+ie[0],f(0)),P(we,Ve+we.text.slice(q.ch),We);var It=z(1,ie.length-1);lt>1&&e.remove(Z.line+1,lt-1),e.insert(Z.line+1,It)}bn(e,"change",e,t)}function pr(e,t,i){function n(f,P,z){if(f.linked)for(var Z=0;Z<f.linked.length;++Z){var q=f.linked[Z];if(q.doc==P)continue;var ie=z&&q.sharedHist;if(i&&!ie)continue;t(q.doc,ie),n(q.doc,f,ie)}}n(e,null,!0)}function Zo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Xt(e),mo(e),qo(e),e.options.lineWrapping||Ji(e),e.options.mode=t.modeOption,dn(e)}function qo(e){(e.doc.direction=="rtl"?E:b)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Mi(e,function(){qo(e),dn(e)})}function Ua(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 vo(e,t){var i={from:Un(t.from),to:fr(t),text:gn(e,t.from,t.to)};return ts(e,i,t.from.line,t.to.line+1),pr(e,function(n){return ts(n,i,t.from.line,t.to.line+1)},!0),i}function $o(e){for(;e.length;){var t=ne(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return $o(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function es(e,t,i,n){var f=e.history;f.undone.length=0;var P=+new Date,z,Z;if((f.lastOp==n||f.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&f.lastModTime>P-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(z=pl(f,f.lastOp==n)))Z=ne(z.changes),Gt(t.from,t.to)==0&&Gt(t.from,Z.to)==0?Z.to=fr(t):z.changes.push(vo(e,t));else{var q=ne(f.done);for((!q||!q.ranges)&&Ba(e.sel,f.done),z={changes:[vo(e,t)],generation:f.generation},f.done.push(z);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(i),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=P,f.lastOp=f.lastSelOp=n,f.lastOrigin=f.lastSelOrigin=t.origin,Z||Be(e,"historyAdded")}function ml(e,t,i,n){var f=t.charAt(0);return f=="*"||f=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var f=e.history,P=n&&n.origin;i==f.lastSelOp||P&&f.lastSelOrigin==P&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==P||ml(e,P,ne(f.done),t))?f.done[f.done.length-1]=t:Ba(t,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=P,f.lastSelOp=i,n&&n.clearRedo!==!1&&$o(f.undone)}function Ba(e,t){var i=ne(t);i&&i.ranges&&i.equals(e)||t.push(e)}function ts(e,t,i,n){var f=t["spans_"+e.id],P=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(z){z.markedSpans&&((f||(f=t["spans_"+e.id]={}))[P]=z.markedSpans),++P})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],f=0;f<t.text.length;++f)n.push(vl(i[f]));return n}function ns(e,t){var i=yl(e,t),n=bi(e,t);if(!i)return n;if(!n)return i;for(var f=0;f<i.length;++f){var P=i[f],z=n[f];if(P&&z){e:for(var Z=0;Z<z.length;++Z){for(var q=z[Z],ie=0;ie<P.length;++ie)if(P[ie].marker==q.marker)continue e;P.push(q)}}else z&&(i[f]=z)}return i}function Mr(e,t,i){for(var n=[],f=0;f<e.length;++f){var P=e[f];if(P.ranges){n.push(i?Fi.prototype.deepCopy.call(P):P);continue}var z=P.changes,Z=[];n.push({changes:Z});for(var q=0;q<z.length;++q){var ie=z[q],Ee=void 0;if(Z.push({from:ie.from,to:ie.to,text:ie.text}),t)for(var we in ie)(Ee=we.match(/^spans_(\d+)$/))&&(se(t,Number(Ee[1]))>-1&&(ne(Z)[we]=ie[we],delete ie[we]))}}return n}function yo(e,t,i,n){if(n){var f=e.anchor;if(i){var P=Gt(t,f)<0;P!=Gt(i,f)<0?(f=t,t=i):P!=Gt(t,i)<0&&(t=i)}return new An(f,t)}else return new An(i||t,t)}function Fa(e,t,i,n,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),hi(e,new Fi([yo(e.sel.primary(),t,i,f)],0),n)}function is(e,t,i){for(var n=[],f=e.cm&&(e.cm.display.shift||e.extend),P=0;P<e.sel.ranges.length;P++)n[P]=yo(e.sel.ranges[P],t[P],null,f);var z=Yi(e.cm,n,e.sel.primIndex);hi(e,z,i)}function bo(e,t,i,n){var f=e.sel.ranges.slice(0);f[t]=i,hi(e,Yi(e.cm,f,e.sel.primIndex),n)}function rs(e,t,i,n){hi(e,hr(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(f){this.ranges=[];for(var P=0;P<f.length;P++)this.ranges[P]=new An(S(e,f[P].anchor),S(e,f[P].head))},origin:i&&i.origin};return Be(e,"beforeSelectionChange",e,n),e.cm&&Be(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Yi(e.cm,n.ranges,n.ranges.length-1):t}function as(e,t,i){var n=e.history.done,f=ne(n);f&&f.ranges?(n[n.length-1]=t,ja(e,t,i)):hi(e,t,i)}function hi(e,t,i){ja(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function ja(e,t,i){(fe(e,"beforeSelectionChange")||e.cm&&fe(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Gt(t.primary().head,e.sel.primary().head)<0?-1:1);os(e,ls(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Lr(e.cm)}function os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),bn(e,"cursorActivity",e)}function ss(e){os(e,ls(e,e.sel,null,!1))}function ls(e,t,i,n){for(var f,P=0;P<t.ranges.length;P++){var z=t.ranges[P],Z=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[P],q=Wa(e,z.anchor,Z&&Z.anchor,i,n),ie=Wa(e,z.head,Z&&Z.head,i,n);(f||q!=z.anchor||ie!=z.head)&&(f||(f=t.ranges.slice(0,P)),f[P]=new An(q,ie))}return f?Yi(e.cm,f,t.primIndex):t}function kr(e,t,i,n,f){var P=Ot(e,t.line);if(P.markedSpans)for(var z=0;z<P.markedSpans.length;++z){var Z=P.markedSpans[z],q=Z.marker,ie="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,Ee="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Z.from==null||(ie?Z.from<=t.ch:Z.from<t.ch))&&(Z.to==null||(Ee?Z.to>=t.ch:Z.to>t.ch))){if(f&&(Be(q,"beforeCursorEnter"),q.explicitlyCleared))if(P.markedSpans){--z;continue}else break;if(!q.atomic)continue;if(i){var we=q.find(n<0?1:-1),Ve=void 0;if((n<0?Ee:ie)&&(we=us(e,we,-n,we&&we.line==t.line?P:null)),we&&we.line==t.line&&(Ve=Gt(we,i))&&(n<0?Ve<0:Ve>0))return kr(e,we,t,n,f)}var We=q.find(n<0?-1:1);return(n<0?ie:Ee)&&(We=us(e,We,n,We.line==t.line?P:null)),We?kr(e,We,t,n,f):null}}return t}function Wa(e,t,i,n,f){var P=n||1,z=kr(e,t,i,P,f)||!f&&kr(e,t,i,P,!0)||kr(e,t,i,-P,f)||!f&&kr(e,t,i,-P,!0);return z||(e.cantEdit=!0,mt(e.first,0))}function us(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?S(e,mt(t.line-1)):null:i>0&&t.ch==(n||Ot(e,t.line)).text.length?t.line<e.first+e.size-1?mt(t.line+1,0):null:new mt(t.line,t.ch+i)}function ds(e){e.setSelection(mt(e.firstLine(),0),mt(e.lastLine()),Se)}function cs(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(f,P,z,Z){f&&(n.from=S(e,f)),P&&(n.to=S(e,P)),z&&(n.text=z),Z!==void 0&&(n.origin=Z)}),Be(e,"beforeChange",e,n),e.cm&&Be(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Pr(e,t,i){if(e.cm){if(!e.cm.curOp)return ni(e.cm,Pr)(e,t,i);if(e.cm.state.suppressEdits)return}if((fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var n=ui&&!i&&Ni(e,t.from,t.to);if(n)for(var f=n.length-1;f>=0;--f)hs(e,{from:n[f].from,to:n[f].to,text:f?[""]:t.text,origin:t.origin});else hs(e,t)}function hs(e,t){if(t.text.length==1&&t.text[0]==""&&Gt(t.from,t.to)==0)return;var i=po(e,t);es(e,t,i,e.cm?e.cm.curOp.id:NaN),la(e,t,i,bi(e,t));var n=[];pr(e,function(f,P){!P&&se(n,f.history)==-1&&(gs(f.history,t),n.push(f.history)),la(f,t,null,bi(f,t))})}function Ha(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var f=e.history,P,z=e.sel,Z=t=="undo"?f.done:f.undone,q=t=="undo"?f.undone:f.done,ie=0;ie<Z.length&&!(P=Z[ie],i?P.ranges&&!P.equals(e.sel):!P.ranges);ie++);if(ie==Z.length)return;for(f.lastOrigin=f.lastSelOrigin=null;;)if(P=Z.pop(),P.ranges){if(Ba(P,q),i&&!P.equals(e.sel)){hi(e,P,{clearRedo:!1});return}z=P}else if(n){Z.push(P);return}else break;var Ee=[];Ba(z,q),q.push({changes:Ee,generation:f.generation}),f.generation=P.generation||++f.maxGeneration;for(var we=fe(e,"beforeChange")||e.cm&&fe(e.cm,"beforeChange"),Ve=function(yt){var At=P.changes[yt];if(At.origin=t,we&&!cs(e,At,!1))return Z.length=0,{};Ee.push(vo(e,At));var It=yt?po(e,At):ne(Z);la(e,At,It,ns(e,At)),!yt&&e.cm&&e.cm.scrollIntoView({from:At.from,to:fr(At)});var Ut=[];pr(e,function(Lt,jt){!jt&&se(Ut,Lt.history)==-1&&(gs(Lt.history,At),Ut.push(Lt.history)),la(Lt,At,null,ns(Lt,At))})},We=P.changes.length-1;We>=0;--We){var lt=Ve(We);if(lt)return lt.v}}function fs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Fi(ve(e.sel.ranges,function(f){return new An(mt(f.anchor.line+t,f.anchor.ch),mt(f.head.line+t,f.head.ch))}),e.sel.primIndex),e.cm){dn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)si(e.cm,n,"gutter")}}function la(e,t,i,n){if(e.cm&&!e.cm.curOp)return ni(e.cm,la)(e,t,i,n);if(t.to.line<e.first){fs(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 f=t.text.length-1-(e.first-t.from.line);fs(e,f),t={from:mt(e.first,0),to:mt(t.to.line+f,t.to.ch),text:[ne(t.text)],origin:t.origin}}var P=e.lastLine();t.to.line>P&&(t={from:t.from,to:mt(P,Ot(e,P).text.length),text:[t.text[0]],origin:t.origin}),t.removed=gn(e,t.from,t.to),i||(i=po(e,t)),e.cm?_l(e.cm,t,n):go(e,t,n),ja(e,i,Se),e.cantEdit&&Wa(e,mt(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,i){var n=e.doc,f=e.display,P=t.from,z=t.to,Z=!1,q=P.line;e.options.lineWrapping||(q=Nt(Xn(Ot(n,P.line))),n.iter(q,z.line+1,function(We){if(We==f.maxLine)return Z=!0,!0})),n.sel.contains(t.from,t.to)>-1&&xe(e),go(n,t,i,Wt(e)),e.options.lineWrapping||(n.iter(q,P.line+t.text.length,function(We){var lt=zi(We);lt>f.maxLineLength&&(f.maxLine=We,f.maxLineLength=lt,f.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),pi(n,P.line),aa(e,400);var ie=t.text.length-(z.line-P.line)-1;t.full?dn(e):P.line==z.line&&t.text.length==1&&!Jo(e.doc,t)?si(e,P.line,"text"):dn(e,P.line,z.line+1,ie);var Ee=fe(e,"changes"),we=fe(e,"change");if(we||Ee){var Ve={from:P,to:z,text:t.text,removed:t.removed,origin:t.origin};we&&bn(e,"change",e,Ve),Ee&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ve)}e.display.selForContextMenu=null}function Nr(e,t,i,n,f){var P;n||(n=i),Gt(n,i)<0&&(P=[n,i],i=P[0],n=P[1]),typeof t=="string"&&(t=e.splitLines(t)),Pr(e,{from:i,to:n,text:t,origin:f})}function ps(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ms(e,t,i,n){for(var f=0;f<e.length;++f){var P=e[f],z=!0;if(P.ranges){P.copied||(P=e[f]=P.deepCopy(),P.copied=!0);for(var Z=0;Z<P.ranges.length;Z++)ps(P.ranges[Z].anchor,t,i,n),ps(P.ranges[Z].head,t,i,n);continue}for(var q=0;q<P.changes.length;++q){var ie=P.changes[q];if(i<ie.from.line)ie.from=mt(ie.from.line+n,ie.from.ch),ie.to=mt(ie.to.line+n,ie.to.ch);else if(t<=ie.to.line){z=!1;break}}z||(e.splice(0,f+1),f=0)}}function gs(e,t){var i=t.from.line,n=t.to.line,f=t.text.length-(n-i)-1;ms(e.done,i,n,f),ms(e.undone,i,n,f)}function ua(e,t,i,n){var f=t,P=t;return typeof t=="number"?P=Ot(e,V(e,t)):f=Nt(t),f==null?null:(n(P,f)&&e.cm&&si(e.cm,f,i),P)}function da(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var f=this.lines[i];this.height-=f.height,Ht(f),bn(f,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function ca(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var f=e[n];t+=f.chunkSize(),i+=f.height,f.parent=this}this.size=t,this.height=i,this.parent=null}ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],f=n.chunkSize();if(e<f){var P=Math.min(t,f-e),z=n.height;if(n.removeInner(e,P),this.height-=z-n.height,f==P&&(this.children.splice(i--,1),n.parent=null),(t-=P)==0)break;e=0}else e-=f}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof da))){var Z=[];this.collapse(Z),this.children=[new da(Z)],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,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var f=this.children[n],P=f.chunkSize();if(e<=P){if(f.insertInner(e,t,i),f.lines&&f.lines.length>50){for(var z=f.lines.length%25+25,Z=z;Z<f.lines.length;){var q=new da(f.lines.slice(Z,Z+=25));f.height-=q.height,this.children.splice(++n,0,q),q.parent=this}f.lines=f.lines.slice(0,z),this.maybeSpill()}break}e-=P}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new ca(t);if(e.parent){e.size-=i.size,e.height-=i.height;var f=se(e.parent.children,e);e.parent.children.splice(f+1,0,i)}else{var n=new ca(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var f=this.children[n],P=f.chunkSize();if(e<P){var z=Math.min(t,P-e);if(f.iterN(e,z,i))return!0;if((t-=z)==0)break;e=0}else e-=P}}};var ha=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Nt(i);if(n==null||!t)return;for(var f=0;f<t.length;++f)t[f]==this&&t.splice(f--,1);t.length||(i.widgets=null);var P=lr(this);Zt(i,Math.max(0,i.height-P)),e&&(Mi(e,function(){vs(e,i,-P),si(e,n,"widget")}),bn(e,"lineWidgetCleared",e,this,n))},ha.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var f=lr(this)-t;if(!f)return;Li(this.doc,n)||Zt(n,n.height+f),i&&Mi(i,function(){i.curOp.forceUpdate=!0,vs(i,n,f),bn(i,"lineWidgetChanged",i,e,Nt(n))})},ge(ha);function vs(e,t,i){Ei(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&so(e,i)}function El(e,t,i,n){var f=new ha(e,i,n),P=e.cm;return P&&f.noHScroll&&(P.display.alignWidgets=!0),ua(e,t,"widget",function(z){var Z=z.widgets||(z.widgets=[]);if(f.insertAt==null?Z.push(f):Z.splice(Math.min(Z.length-1,Math.max(0,f.insertAt)),0,f),f.line=z,P&&!Li(e,z)){var q=Ei(z)<e.scrollTop;Zt(z,z.height+lr(f)),q&&so(P,f.height),P.curOp.forceUpdate=!0}return!0}),P&&bn(P,"lineWidgetAdded",P,f,typeof t=="number"?t:Nt(t)),f}var ys=0,mr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ys};mr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&xr(e),fe(this,"clear")){var i=this.find();i&&bn(this,"clear",i.from,i.to)}for(var n=null,f=null,P=0;P<this.lines.length;++P){var z=this.lines[P],Z=Yn(z.markedSpans,this);e&&!this.collapsed?si(e,Nt(z),"text"):e&&(Z.to!=null&&(f=Nt(z)),Z.from!=null&&(n=Nt(z))),z.markedSpans=Wi(z.markedSpans,Z),Z.from==null&&this.collapsed&&!Li(this.doc,z)&&e&&Zt(z,Rt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var ie=Xn(this.lines[q]),Ee=zi(ie);Ee>e.display.maxLineLength&&(e.display.maxLine=ie,e.display.maxLineLength=Ee,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&dn(e,n,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ss(e.doc)),e&&bn(e,"markerCleared",e,this,n,f),t&&Tr(e),this.parent&&this.parent.clear()},mr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,f=0;f<this.lines.length;++f){var P=this.lines[f],z=Yn(P.markedSpans,this);if(z.from!=null&&(i=mt(t?P:Nt(P),z.from),e==-1))return i;if(z.to!=null&&(n=mt(t?P:Nt(P),z.to),e==1))return n}return i&&{from:i,to:n}},mr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Mi(n,function(){var f=t.line,P=Nt(t.line),z=ar(n,P);if(z&&(Ta(z),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Li(i.doc,f)&&i.height!=null){var Z=i.height;i.height=null;var q=lr(i)-Z;q&&Zt(f,f.height+q)}bn(n,"markerChanged",n,e)})},mr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||se(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},mr.prototype.detachLine=function(e){if(this.lines.splice(se(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ge(mr);function Ur(e,t,i,n,f){if(n&&n.shared)return xl(e,t,i,n,f);if(e.cm&&!e.cm.curOp)return ni(e.cm,Ur)(e,t,i,n,f);var P=new mr(e,f),z=Gt(t,i);if(n&&O(n,P,!1),z>0||z==0&&P.clearWhenEmpty!==!1)return P;if(P.replacedWith&&(P.collapsed=!0,P.widgetNode=x("span",[P.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||P.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(P.widgetNode.insertLeft=!0)),P.collapsed){if(jn(e,t.line,t,i,P)||t.line!=i.line&&jn(e,i.line,t,i,P))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ai()}P.addToHistory&&es(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var Z=t.line,q=e.cm,ie;if(e.iter(Z,i.line+1,function(we){q&&P.collapsed&&!q.options.lineWrapping&&Xn(we)==q.display.maxLine&&(ie=!0),P.collapsed&&Z!=t.line&&Zt(we,0),Pi(we,new wi(P,Z==t.line?t.ch:null,Z==i.line?i.ch:null)),++Z}),P.collapsed&&e.iter(t.line,i.line+1,function(we){Li(e,we)&&Zt(we,0)}),P.clearOnEnter&&Ce(P,"beforeCursorEnter",function(){return P.clear()}),P.readOnly&&(di(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),P.collapsed&&(P.id=++ys,P.atomic=!0),q){if(ie&&(q.curOp.updateMaxLine=!0),P.collapsed)dn(q,t.line,i.line+1);else if(P.className||P.startStyle||P.endStyle||P.css||P.attributes||P.title)for(var Ee=t.line;Ee<=i.line;Ee++)si(q,Ee,"text");P.atomic&&ss(q.doc),bn(q,"markerAdded",q,P)}return P}var fa=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};fa.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();bn(this,"clear")},fa.prototype.find=function(e,t){return this.primary.find(e,t)},ge(fa);function xl(e,t,i,n,f){n=O(n),n.shared=!1;var P=[Ur(e,t,i,n,f)],z=P[0],Z=n.widgetNode;return pr(e,function(q){Z&&(n.widgetNode=Z.cloneNode(!0)),P.push(Ur(q,S(q,t),S(q,i),n,f));for(var ie=0;ie<q.linked.length;++ie)if(q.linked[ie].isParent)return;z=ne(P)}),new fa(P,z)}function bs(e){return e.findMarks(mt(e.first,0),e.clipPos(mt(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var i=0;i<t.length;i++){var n=t[i],f=n.find(),P=e.clipPos(f.from),z=e.clipPos(f.to);if(Gt(P,z)){var Z=Ur(e,P,z,n.primary,n.primary.type);n.markers.push(Z),Z.parent=n}}}function Cl(e){for(var t=function(n){var f=e[n],P=[f.primary.doc];pr(f.primary.doc,function(q){return P.push(q)});for(var z=0;z<f.markers.length;z++){var Z=f.markers[z];se(P,Z.doc)==-1&&(Z.parent=null,f.markers.splice(z--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,xi=function(e,t,i,n,f){if(!(this instanceof xi))return new xi(e,t,i,n,f);i==null&&(i=0),ca.call(this,[new da([new oi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var P=mt(i,0);this.sel=hr(P),this.history=new Ua(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=f=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),go(this,{from:P,to:P,text:e}),hi(this,hr(P),Se)};xi.prototype=Fe(ca.prototype,{constructor:xi,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Kt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ii(function(e){var t=mt(this.first,0),i=this.first+this.size-1;Pr(this,{from:t,to:mt(i,Ot(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ta(this.cm,0,0),hi(this,hr(t),Se)}),replaceRange:function(e,t,i,n){t=S(this,t),i=i?S(this,i):t,Nr(this,e,t,i,n)},getRange:function(e,t,i){var n=gn(this,S(this,e),S(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Cn(this,e))return Ot(this,e)},getLineNumber:function(e){return Nt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ot(this,e)),Xn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return S(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ii(function(e,t,i){rs(this,S(this,typeof e=="number"?mt(e,t||0):e),null,i)}),setSelection:ii(function(e,t,i){rs(this,S(this,e),S(this,t||e),i)}),extendSelection:ii(function(e,t,i){Fa(this,S(this,e),t&&S(this,t),i)}),extendSelections:ii(function(e,t){is(this,W(this,e),t)}),extendSelectionsBy:ii(function(e,t){var i=ve(this.sel.ranges,e);is(this,W(this,i),t)}),setSelections:ii(function(e,t,i){if(!e.length)return;for(var n=[],f=0;f<e.length;f++)n[f]=new An(S(this,e[f].anchor),S(this,e[f].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),hi(this,Yi(this.cm,n,t),i)}),addSelection:ii(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new An(S(this,e),S(this,t||e))),hi(this,Yi(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var f=gn(this,t[n].from(),t[n].to());i=i?i.concat(f):f}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var f=gn(this,i[n].from(),i[n].to());e!==!1&&(f=f.join(e||this.lineSeparator())),t[n]=f}return t},replaceSelection:function(e,t,i){for(var n=[],f=0;f<this.sel.ranges.length;f++)n[f]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:ii(function(e,t,i){for(var n=[],f=this.sel,P=0;P<f.ranges.length;P++){var z=f.ranges[P];n[P]={from:z.from(),to:z.to(),text:this.splitLines(e[P]),origin:i}}for(var Z=t&&t!="end"&&hl(this,n,t),q=n.length-1;q>=0;q--)Pr(this,n[q]);Z?as(this,Z):this.cm&&Lr(this.cm)}),undo:ii(function(){Ha(this,"undo")}),redo:ii(function(){Ha(this,"redo")}),undoSelection:ii(function(){Ha(this,"undo",!0)}),redoSelection:ii(function(){Ha(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var f=0;f<e.undone.length;f++)e.undone[f].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Ua(this.history.maxGeneration),pr(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:Mr(this.history.done),undone:Mr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ua(this.history.maxGeneration);t.done=Mr(e.done.slice(0),null,!0),t.undone=Mr(e.undone.slice(0),null,!0)},setGutterMarker:ii(function(e,t,i){return ua(this,e,"gutter",function(n){var f=n.gutterMarkers||(n.gutterMarkers={});return f[t]=i,!i&&tt(f)&&(n.gutterMarkers=null),!0})}),clearGutter:ii(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&ua(t,i,"gutter",function(){return i.gutterMarkers[e]=null,tt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Cn(this,e))return null;if(t=e,e=Ot(this,e),!e)return null}else if(t=Nt(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:ii(function(e,t,i){return ua(this,e,t=="gutter"?"gutter":"class",function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[f])n[f]=i;else{if(C(i).test(n[f]))return!1;n[f]+=" "+i}return!0})}),removeLineClass:ii(function(e,t,i){return ua(this,e,t=="gutter"?"gutter":"class",function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",P=n[f];if(P)if(i==null)n[f]=null;else{var z=P.match(C(i));if(!z)return!1;var Z=z.index+z[0].length;n[f]=P.slice(0,z.index)+(!z.index||Z==P.length?"":" ")+P.slice(Z)||null}else return!1;return!0})}),addLineWidget:ii(function(e,t,i){return El(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Ur(this,S(this,e),S(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=S(this,e),Ur(this,e,e,i,"bookmark")},findMarksAt:function(e){e=S(this,e);var t=[],i=Ot(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var f=i[n];(f.from==null||f.from<=e.ch)&&(f.to==null||f.to>=e.ch)&&t.push(f.marker.parent||f.marker)}return t},findMarks:function(e,t,i){e=S(this,e),t=S(this,t);var n=[],f=e.line;return this.iter(e.line,t.line+1,function(P){var z=P.markedSpans;if(z)for(var Z=0;Z<z.length;Z++){var q=z[Z];!(q.to!=null&&f==e.line&&e.ch>=q.to||q.from==null&&f!=e.line||q.from!=null&&f==t.line&&q.from>=t.ch)&&(!i||i(q.marker))&&n.push(q.marker.parent||q.marker)}++f}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(f){var P=f.text.length+n;if(P>e)return t=e,!0;e-=P,++i}),S(this,mt(i,t))},indexFromPos:function(e){e=S(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new xi(Kt(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new xi(Kt(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(n,bs(this)),n},unlinkDoc:function(e){if(e instanceof Nn&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Cl(bs(this));break}if(e.history==this.history){var n=[e.id];pr(e,function(f){return n.push(f.id)},!0),e.history=new Ua(null),e.history.done=Mr(this.history.done,n),e.history.undone=Mr(this.history.undone,n)}},iterLinkedDocs:function(e){pr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Xe(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:ii(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)})}),xi.prototype.eachLine=xi.prototype.iter;var _s=0;function Al(e){var t=this;if(Es(t),et(t,e)||er(t.display,e))return;re(e),H&&(_s=+new Date);var i=vn(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var f=n.length,P=Array(f),z=0,Z=function(){++z==f&&ni(t,function(){i=S(t.doc,i);var We={from:i,to:i,text:t.doc.splitLines(P.filter(function(lt){return lt!=null}).join(t.doc.lineSeparator())),origin:"paste"};Pr(t.doc,We),as(t.doc,hr(S(t.doc,i),S(t.doc,fr(We))))})()},q=function(We,lt){if(t.options.allowDropFileTypes&&se(t.options.allowDropFileTypes,We.type)==-1){Z();return}var yt=new FileReader;yt.onerror=function(){return Z()},yt.onload=function(){var At=yt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(At)){Z();return}P[lt]=At,Z()},yt.readAsText(We)},ie=0;ie<n.length;ie++)q(n[ie],ie);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ee=e.dataTransfer.getData("Text");if(Ee){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),ja(t.doc,hr(i,i)),we)for(var Ve=0;Ve<we.length;++Ve)Nr(t.doc,"",we[Ve].anchor,we[Ve].head,"drag");t.replaceSelection(Ee,"around","paste"),t.display.input.focus()}}catch(We){}}}function wl(e,t){if(H&&(!e.state.draggingText||+new Date-_s<100)){ye(t);return}if(et(e,t)||er(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p){var i=u("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",v&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),v&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=vn(e,t);if(!i)return;var n=document.createDocumentFragment();Mo(e,i,n),e.display.dragCursor||(e.display.dragCursor=u("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,n)}function Es(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function xs(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var f=t[n].CodeMirror;f&&i.push(f)}i.length&&i[0].operation(function(){for(var P=0;P<i.length;P++)e(i[P])})}var Ts=!1;function Rl(){if(Ts)return;Il(),Ts=!0}function Il(){var e;Ce(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,xs(Ll)},100))}),Ce(window,"blur",function(){return xs(Ir)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var gr={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"},pa=0;pa<10;pa++)gr[pa+48]=gr[pa+96]=String(pa);for(var Ka=65;Ka<=90;Ka++)gr[Ka]=String.fromCharCode(Ka);for(var ma=1;ma<=12;ma++)gr[ma+111]=gr[ma+63235]="F"+ma;var or={};or.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"},or.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"},or.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"},or.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"]},or.default=s?or.macDefault:or.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,f,P,z=0;z<t.length-1;z++){var Z=t[z];if(/^(cmd|meta|m)$/i.test(Z))P=!0;else if(/^a(lt)?$/i.test(Z))i=!0;else if(/^(c|ctrl|control)$/i.test(Z))n=!0;else if(/^s(hift)?$/i.test(Z))f=!0;else throw new Error("Unrecognized modifier name: "+Z)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),P&&(e="Cmd-"+e),f&&(e="Shift-"+e),e}function Ml(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var f=ve(i.split(" "),Dl),P=0;P<f.length;P++){var z=void 0,Z=void 0;P==f.length-1?(Z=f.join(" "),z=n):(Z=f.slice(0,P+1).join(" "),z="...");var q=t[Z];if(!q)t[Z]=z;else if(q!=z)throw new Error("Inconsistent bindings for "+Z)}delete e[i]}for(var ie in t)e[ie]=t[ie];return e}function Br(e,t,i,n){t=Ga(t);var f=t.call?t.call(e,n):t[e];if(f===!1)return"nothing";if(f==="...")return"multi";if(f!=null&&i(f))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Br(e,t.fallthrough,i,n);for(var P=0;P<t.fallthrough.length;P++){var z=Br(e,t.fallthrough[P],i,n);if(z)return z}}}function Cs(e){var t=typeof e=="string"?e:gr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ss(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function As(e,t){if(v&&e.keyCode==34&&e.char)return!1;var i=gr[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Ss(i,e,t))}function Ga(e){return typeof e=="string"?or[e]:e}function Fr(e,t){for(var i=e.doc.sel.ranges,n=[],f=0;f<i.length;f++){for(var P=t(i[f]);n.length&&Gt(P.from,ne(n).to)<=0;){var z=n.pop();if(Gt(z.from,P.from)<0){P.from=z.from;break}}n.push(P)}Mi(e,function(){for(var Z=n.length-1;Z>=0;Z--)Nr(e.doc,"",n[Z].from,n[Z].to,"+delete");Lr(e)})}function _o(e,t,i){var n=Ye(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Eo(e,t,i){var n=_o(e,t.ch,i);return n==null?null:new mt(t.line,n,i<0?"after":"before")}function xo(e,t,i,n,f){if(e){t.doc.direction=="rtl"&&(f=-f);var P=xt(i,t.doc.direction);if(P){var z=f<0?ne(P):P[0],Z=f<0==(z.level==1),q=Z?"after":"before",ie;if(z.level>0||t.doc.direction=="rtl"){var Ee=ur(t,i);ie=f<0?i.text.length-1:0;var we=Ui(t,Ee,ie).top;ie=gt(function(Ve){return Ui(t,Ee,Ve).top==we},f<0==(z.level==1)?z.from:z.to-1,ie),q=="before"&&(ie=_o(i,ie,1))}else ie=f<0?z.to:z.from;return new mt(n,ie,q)}}return new mt(n,f<0?i.text.length:0,f<0?"before":"after")}function kl(e,t,i,n){var f=xt(t,e.doc.direction);if(!f)return Eo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var P=dt(f,i.ch,i.sticky),z=f[P];if(e.doc.direction=="ltr"&&z.level%2==0&&(n>0?z.to>i.ch:z.from<i.ch))return Eo(t,i,n);var Z=function(It,Ut){return _o(t,It instanceof mt?It.ch:It,Ut)},q,ie=function(It){return e.options.lineWrapping?(q=q||ur(e,t),Ft(e,t,q,It)):{begin:0,end:t.text.length}},Ee=ie(i.sticky=="before"?Z(i,-1):i.ch);if(e.doc.direction=="rtl"||z.level==1){var we=z.level==1==n<0,Ve=Z(i,we?1:-1);if(Ve!=null&&(we?Ve<=z.to&&Ve<=Ee.end:Ve>=z.from&&Ve>=Ee.begin)){var We=we?"before":"after";return new mt(i.line,Ve,We)}}var lt=function(It,Ut,Lt){for(var jt=function(Ln,ri){return ri?new mt(i.line,Z(Ln,1),"before"):new mt(i.line,Ln,"after")};It>=0&&It<f.length;It+=Ut){var en=f[It],Qt=Ut>0==(en.level!=1),fn=Qt?Lt.begin:Z(Lt.end,-1);if(en.from<=fn&&fn<en.to)return jt(fn,Qt);if(fn=Qt?en.from:Z(en.to,-1),Lt.begin<=fn&&fn<Lt.end)return jt(fn,Qt)}},yt=lt(P+n,n,Ee);if(yt)return yt;var At=n>0?Ee.end:Z(Ee.begin,-1);return At!=null&&!(n>0&&At==t.text.length)&&(yt=lt(n>0?0:f.length-1,n,ie(At)),yt)?yt:null}var ga={selectAll:ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Se)},killLine:function(e){return Fr(e,function(t){if(t.empty()){var i=Ot(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:mt(t.head.line+1,0)}:{from:t.head,to:mt(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Fr(e,function(t){return{from:mt(t.from().line,0),to:S(e.doc,mt(t.to().line+1,0))}})},delLineLeft:function(e){return Fr(e,function(t){return{from:mt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Fr(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Fr(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},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(mt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(mt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ws(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Os(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Oe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Oe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?Os(e,t.head):n},Oe)},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=[],i=e.listSelections(),n=e.options.tabSize,f=0;f<i.length;f++){var P=i[f].from(),z=X(e.getLine(P.line),P.ch,n);t.push(ue(n-z%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Mi(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var f=t[n].head,P=Ot(e.doc,f.line).text;if(P){if(f.ch==P.length&&(f=new mt(f.line,f.ch-1)),f.ch>0)f=new mt(f.line,f.ch+1),e.replaceRange(P.charAt(f.ch-1)+P.charAt(f.ch-2),mt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var z=Ot(e.doc,f.line-1).text;z&&(f=new mt(f.line,1),e.replaceRange(P.charAt(0)+e.doc.lineSeparator()+z.charAt(z.length-1),mt(f.line-1,z.length-1),f,"+transpose"))}}i.push(new An(f,f))}e.setSelections(i)})},newlineAndIndent:function(e){return Mi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Lr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ws(e,t){var i=Ot(e.doc,t),n=Xn(i);return n!=i&&(t=Nt(n)),xo(!0,e,n,t,1)}function Pl(e,t){var i=Ot(e.doc,t),n=Ki(i);return n!=i&&(t=Nt(n)),xo(!0,e,i,t,-1)}function Os(e,t){var i=ws(e,t.line),n=Ot(e.doc,i.line),f=xt(n,e.doc.direction);if(!f||f[0].level==0){var P=Math.max(i.ch,n.text.search(/\S/)),z=t.line==i.line&&t.ch<=P&&t.ch;return mt(i.line,z?0:P,i.sticky)}return i}function za(e,t,i){if(typeof t=="string"&&(t=ga[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),f=t(e)!=Pe}finally{e.display.shift=n,e.state.suppressEdits=!1}return f}function Nl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var f=Br(t,e.state.keyMaps[n],i,e);if(f)return f}return e.options.extraKeys&&Br(t,e.options.extraKeys,i,e)||Br(t,e.options.keyMap,i,e)}var Ul=new $;function va(e,t,i,n){var f=e.state.keySeq;if(f){if(Cs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==f&&(e.state.keySeq=null,e.display.input.reset())}),Rs(e,f+" "+t,i,n))return!0}return Rs(e,t,i,n)}function Rs(e,t,i,n){var f=Nl(e,t,n);return f=="multi"&&(e.state.keySeq=t),f=="handled"&&bn(e,"keyHandled",e,t,i),(f=="handled"||f=="multi")&&(re(i),ro(e)),!!f}function Is(e,t){var i=As(t,!0);return i?t.shiftKey&&!e.state.keySeq?va(e,"Shift-"+i,t,function(n){return za(e,n,!0)})||va(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return za(e,n)}):va(e,i,t,function(n){return za(e,n)}):!1}function Bl(e,t,i){return va(e,"'"+i+"'",t,function(n){return za(e,n,!0)})}var To=null;function Ls(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=M(),et(t,e))return;H&&F<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Is(t,e);v&&(To=n?i:null,!n&&i==88&&!De&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),N&&!s&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;E(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(b(t,"CodeMirror-crosshair"),rt(document,"keyup",i),rt(document,"mouseover",i))}Ce(document,"keyup",i),Ce(document,"mouseover",i)}function Ds(e){e.keyCode==16&&(this.doc.sel.shift=!1),et(this,e)}function Ms(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(er(t.display,e)||et(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(v&&i==To){To=null,re(e);return}if(v&&(!e.which||e.which<10)&&Is(t,e))return;var f=String.fromCharCode(n==null?i:n);if(f=="\b")return;if(Bl(t,e,f))return;t.display.input.onKeyPress(e)}var jl=400,Co=function(e,t,i){this.time=e,this.pos=t,this.button=i};Co.prototype.compare=function(e,t,i){return this.time+jl>e&&Gt(t,this.pos)==0&&i==this.button};var ya,ba;function Wl(e,t){var i=+new Date;return ba&&ba.compare(i,e,t)?(ya=ba=null,"triple"):ya&&ya.compare(i,e,t)?(ba=new Co(i,e,t),ya=null,"double"):(ya=new Co(i,e,t),ba=null,"single")}function ks(e){var t=this,i=t.display;if(et(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,er(i,e)){k||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(So(t,e))return;var n=vn(t,e),f=je(e),P=n?Wl(n,f):"single";if(window.focus(),f==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,f,n,P,e))return;f==1?n?Gl(t,n,P,e):_e(e)==i.scroller&&re(e):f==2?(n&&Fa(t.doc,n),setTimeout(function(){return i.input.focus()},20)):f==3&&(w?t.display.input.onContextMenu(e):Po(t))}function Hl(e,t,i,n,f){var P="Click";return n=="double"?P="Double"+P:n=="triple"&&(P="Triple"+P),P=(t==1?"Left":t==2?"Middle":"Right")+P,va(e,Ss(P,f),f,function(z){if(typeof z=="string"&&(z=ga[z]),!z)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=z(e,i)!=Pe}finally{e.state.suppressEdits=!1}return Z})}function Kl(e,t,i){var n=e.getOption("configureMouse"),f=n?n(e,t,i):{};if(f.unit==null){var P=d?i.shiftKey&&i.metaKey:i.altKey;f.unit=P?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||i.shiftKey),f.addNew==null&&(f.addNew=s?i.metaKey:i.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(s?i.altKey:i.ctrlKey)),f}function Gl(e,t,i,n){H?setTimeout(U(ko,e),0):e.curOp.focus=M();var f=Kl(e,i,n),P=e.doc.sel,z;e.options.dragDrop&&ot&&!e.isReadOnly()&&i=="single"&&(z=P.contains(t))>-1&&(Gt((z=P.ranges[z]).from(),t)<0||t.xRel>0)&&(Gt(z.to(),t)>0||t.xRel<0)?zl(e,n,t,f):Vl(e,n,t,f)}function zl(e,t,i,n){var f=e.display,P=!1,z=ni(e,function(ie){k&&(f.scroller.draggable=!1),e.state.draggingText=!1,rt(f.wrapper.ownerDocument,"mouseup",z),rt(f.wrapper.ownerDocument,"mousemove",Z),rt(f.scroller,"dragstart",q),rt(f.scroller,"drop",z),P||(re(ie),n.addNew||Fa(e.doc,i,null,null,n.extend),k&&!p||H&&F==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),Z=function(ie){P=P||Math.abs(t.clientX-ie.clientX)+Math.abs(t.clientY-ie.clientY)>=10},q=function(){return P=!0};k&&(f.scroller.draggable=!0),e.state.draggingText=z,z.copy=!n.moveOnDrag,f.scroller.dragDrop&&f.scroller.dragDrop(),Ce(f.wrapper.ownerDocument,"mouseup",z),Ce(f.wrapper.ownerDocument,"mousemove",Z),Ce(f.scroller,"dragstart",q),Ce(f.scroller,"drop",z),Po(e),setTimeout(function(){return f.input.focus()},20)}function Ps(e,t,i){if(i=="char")return new An(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new An(mt(t.line,0),S(e.doc,mt(t.line+1,0)));var n=i(e,t);return new An(n.from,n.to)}function Vl(e,t,i,n){var f=e.display,P=e.doc;re(t);var z,Z,q=P.sel,ie=q.ranges;if(n.addNew&&!n.extend?(Z=P.sel.contains(i),Z>-1?z=ie[Z]:z=new An(i,i)):(z=P.sel.primary(),Z=P.sel.primIndex),n.unit=="rectangle")n.addNew||(z=new An(i,i)),i=vn(e,t,!0,!0),Z=-1;else{var Ee=Ps(e,i,n.unit);n.extend?z=yo(z,Ee.anchor,Ee.head,n.extend):z=Ee}n.addNew?Z==-1?(Z=ie.length,hi(P,Yi(e,ie.concat([z]),Z),{scroll:!1,origin:"*mouse"})):ie.length>1&&ie[Z].empty()&&n.unit=="char"&&!n.extend?(hi(P,Yi(e,ie.slice(0,Z).concat(ie.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),q=P.sel):bo(P,Z,z,Re):(Z=0,hi(P,new Fi([z],0),Re),q=P.sel);var we=i;function Ve(Lt){if(Gt(we,Lt)==0)return;if(we=Lt,n.unit=="rectangle"){for(var jt=[],en=e.options.tabSize,Qt=X(Ot(P,i.line).text,i.ch,en),fn=X(Ot(P,Lt.line).text,Lt.ch,en),Ln=Math.min(Qt,fn),ri=Math.max(Qt,fn),Fn=Math.min(i.line,Lt.line),ki=Math.min(e.lastLine(),Math.max(i.line,Lt.line));Fn<=ki;Fn++){var Ti=Ot(P,Fn).text,Jn=Me(Ti,Ln,en);Ln==ri?jt.push(new An(mt(Fn,Jn),mt(Fn,Jn))):Ti.length>Jn&&jt.push(new An(mt(Fn,Jn),mt(Fn,Me(Ti,ri,en))))}jt.length||jt.push(new An(i,i)),hi(P,Yi(e,q.ranges.slice(0,Z).concat(jt),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Lt)}else{var Ci=z,li=Ps(e,Lt,n.unit),ti=Ci.anchor,Zn;Gt(li.anchor,ti)>0?(Zn=li.head,ti=Vn(Ci.from(),li.anchor)):(Zn=li.anchor,ti=Pn(Ci.to(),li.head));var Wn=q.ranges.slice(0);Wn[Z]=Yl(e,new An(S(P,ti),Zn)),hi(P,Yi(e,Wn,Z),Re)}}var We=f.wrapper.getBoundingClientRect(),lt=0;function yt(Lt){var jt=++lt,en=vn(e,Lt,!0,n.unit=="rectangle");if(!en)return;if(Gt(en,we)!=0){e.curOp.focus=M(),Ve(en);var Qt=Ma(f,P);(en.line>=Qt.to||en.line<Qt.from)&&setTimeout(ni(e,function(){lt==jt&&yt(Lt)}),150)}else{var fn=Lt.clientY<We.top?-20:Lt.clientY>We.bottom?20:0;fn&&setTimeout(ni(e,function(){if(lt!=jt)return;f.scroller.scrollTop+=fn,yt(Lt)}),50)}}function At(Lt){e.state.selectingText=!1,lt=Infinity,Lt&&(re(Lt),f.input.focus()),rt(f.wrapper.ownerDocument,"mousemove",It),rt(f.wrapper.ownerDocument,"mouseup",Ut),P.history.lastSelOrigin=null}var It=ni(e,function(Lt){Lt.buttons===0||!je(Lt)?At(Lt):yt(Lt)}),Ut=ni(e,At);e.state.selectingText=Ut,Ce(f.wrapper.ownerDocument,"mousemove",It),Ce(f.wrapper.ownerDocument,"mouseup",Ut)}function Yl(e,t){var i=t.anchor,n=t.head,f=Ot(e.doc,i.line);if(Gt(i,n)==0&&i.sticky==n.sticky)return t;var P=xt(f);if(!P)return t;var z=dt(P,i.ch,i.sticky),Z=P[z];if(Z.from!=i.ch&&Z.to!=i.ch)return t;var q=z+(Z.from==i.ch==(Z.level!=1)?0:1);if(q==0||q==P.length)return t;var ie;if(n.line!=i.line)ie=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ee=dt(P,n.ch,n.sticky),we=Ee-z||(n.ch-i.ch)*(Z.level==1?-1:1);Ee==q-1||Ee==q?ie=we<0:ie=we>0}var Ve=P[q+(ie?-1:0)],We=ie==(Ve.level==1),lt=We?Ve.from:Ve.to,yt=We?"after":"before";return i.ch==lt&&i.sticky==yt?t:new An(new mt(i.line,lt,yt),n)}function Ns(e,t,i,n){var f,P;if(t.touches)f=t.touches[0].clientX,P=t.touches[0].clientY;else try{f=t.clientX,P=t.clientY}catch(Ve){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&re(t);var z=e.display,Z=z.lineDiv.getBoundingClientRect();if(P>Z.bottom||!fe(e,i))return de(t);P-=Z.top-z.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var ie=z.gutters.childNodes[q];if(ie&&ie.getBoundingClientRect().right>=f){var Ee=nn(e.doc,P),we=e.display.gutterSpecs[q];return Be(e,i,e,Ee,we.className,t),de(t)}}}function So(e,t){return Ns(e,t,"gutterClick",!0)}function Us(e,t){if(er(e.display,t)||Xl(e,t))return;if(et(e,t,"contextmenu"))return;w||e.display.input.onContextMenu(t)}function Xl(e,t){return fe(e,"gutterContextMenu")?Ns(e,t,"gutterContextMenu",!1):!1}function Bs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),dr(e)}var jr={toString:function(){return"CodeMirror.Init"}},Fs={},Va={};function Ql(e){var t=e.optionHandlers;function i(n,f,P,z){e.defaults[n]=f,P&&(t[n]=z?function(Z,q,ie){ie!=jr&&P(Z,q,ie)}:P)}e.defineOption=i,e.Init=jr,i("value","",function(n,f){return n.setValue(f)},!0),i("mode",null,function(n,f){n.doc.modeOption=f,mo(n)},!0),i("indentUnit",2,mo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){sa(n),dr(n),dn(n)},!0),i("lineSeparator",null,function(n,f){if(n.doc.lineSep=f,!f)return;var P=[],z=n.doc.first;n.doc.iter(function(q){for(var ie=0;;){var Ee=q.text.indexOf(f,ie);if(Ee==-1)break;ie=Ee+f.length,P.push(mt(z,Ee))}z++});for(var Z=P.length-1;Z>=0;Z--)Nr(n.doc,f,P[Z],mt(P[Z].line,P[Z].ch+f.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,f,P){n.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),P!=jr&&n.refresh()}),i("specialCharPlaceholder",Sn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",r?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,f){return n.getInputField().spellcheck=f},!0),i("autocorrect",!1,function(n,f){return n.getInputField().autocorrect=f},!0),i("autocapitalize",!1,function(n,f){return n.getInputField().autocapitalize=f},!0),i("rtlMoveVisually",!R),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Bs(n),oa(n)},!0),i("keyMap","default",function(n,f,P){var z=Ga(f),Z=P!=jr&&Ga(P);Z&&Z.detach&&Z.detach(n,z),z.attach&&z.attach(n,Z||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,f){n.display.gutterSpecs=fo(f,n.options.lineNumbers),oa(n)},!0),i("fixedGutter",!0,function(n,f){n.display.gutters.style.left=f?Yt(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Dr(n)},!0),i("scrollbarStyle","native",function(n){Wo(n),Dr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,f){n.display.gutterSpecs=fo(n.options.gutters,f),oa(n)},!0),i("firstLineNumber",1,oa,!0),i("lineNumberFormatter",function(n){return n},oa,!0),i("showCursorWhenSelecting",!1,ea,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,f){f=="nocursor"&&(Ir(n),n.display.input.blur()),n.display.input.readOnlyChanged(f)}),i("screenReaderLabel",null,function(n,f){f=f===""?null:f,n.display.input.screenReaderLabelChanged(f)}),i("disableInput",!1,function(n,f){f||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ea,!0),i("singleCursorHeightPerLine",!0,ea,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,sa,!0),i("addModeClass",!1,sa,!0),i("pollInterval",100),i("undoDepth",200,function(n,f){return n.doc.history.undoDepth=f}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,sa,!0),i("moveInputWithCursor",!0,function(n,f){f||n.display.input.resetPosition()}),i("tabindex",null,function(n,f){return n.display.input.getField().tabIndex=f||""}),i("autofocus",null),i("direction","ltr",function(n,f){return n.doc.setDirection(f)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=jr;if(!t!=!n){var f=e.display.dragFunctions,P=t?Ce:rt;P(e.display.scroller,"dragstart",f.start),P(e.display.scroller,"dragenter",f.enter),P(e.display.scroller,"dragover",f.over),P(e.display.scroller,"dragleave",f.leave),P(e.display.scroller,"drop",f.drop)}}function Zl(e){e.options.lineWrapping?(E(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),Ji(e)),Xt(e),dn(e),dr(e),setTimeout(function(){return Dr(e)},100)}function Nn(e,t){var i=this;if(!(this instanceof Nn))return new Nn(e,t);this.options=t=t?O(t):{},O(Fs,t,!1);var n=t.value;typeof n=="string"?n=new xi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var f=new Nn.inputStyles[t.inputStyle](this),P=this.display=new dl(e,n,f,t);P.wrapper.CodeMirror=this,Bs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new $,keySeq:null,specialChars:null},t.autofocus&&!r&&P.input.focus(),H&&F<11&&setTimeout(function(){return i.display.input.reset(!0)},20),ql(this),Rl(),xr(this),this.curOp.forceUpdate=!0,Zo(this,n),t.autofocus&&!r||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ao(i)},20):Ir(this);for(var z in Va)Va.hasOwnProperty(z)&&Va[z](this,t[z],jr);Go(this),t.finishInit&&t.finishInit(this);for(var Z=0;Z<Ao.length;++Z)Ao[Z](this);Tr(this),k&&t.lineWrapping&&getComputedStyle(P.lineDiv).textRendering=="optimizelegibility"&&(P.lineDiv.style.textRendering="auto")}Nn.defaults=Fs,Nn.optionHandlers=Va;function ql(e){var t=e.display;Ce(t.scroller,"mousedown",ni(e,ks)),H&&F<11?Ce(t.scroller,"dblclick",ni(e,function(q){if(et(e,q))return;var ie=vn(e,q);if(!ie||So(e,q)||er(e.display,q))return;re(q);var Ee=e.findWordAt(ie);Fa(e.doc,Ee.anchor,Ee.head)})):Ce(t.scroller,"dblclick",function(q){return et(e,q)||re(q)}),Ce(t.scroller,"contextmenu",function(q){return Us(e,q)}),Ce(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||Us(e,q)});var i,n={end:0};function f(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function P(q){if(q.touches.length!=1)return!1;var ie=q.touches[0];return ie.radiusX<=1&&ie.radiusY<=1}function z(q,ie){if(ie.left==null)return!0;var Ee=ie.left-q.left,we=ie.top-q.top;return Ee*Ee+we*we>20*20}Ce(t.scroller,"touchstart",function(q){if(!et(e,q)&&!P(q)&&!So(e,q)){t.input.ensurePolled(),clearTimeout(i);var ie=+new Date;t.activeTouch={start:ie,moved:!1,prev:ie-n.end<=300?n:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Ce(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ce(t.scroller,"touchend",function(q){var ie=t.activeTouch;if(ie&&!er(t,q)&&ie.left!=null&&!ie.moved&&new Date-ie.start<300){var Ee=e.coordsChar(t.activeTouch,"page"),we;!ie.prev||z(ie,ie.prev)?we=new An(Ee,Ee):!ie.prev.prev||z(ie,ie.prev.prev)?we=e.findWordAt(Ee):we=new An(mt(Ee.line,0),S(e.doc,mt(Ee.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),re(q)}f()}),Ce(t.scroller,"touchcancel",f),Ce(t.scroller,"scroll",function(){t.scroller.clientHeight&&(na(e,t.scroller.scrollTop),_r(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Ce(t.scroller,"mousewheel",function(q){return Yo(e,q)}),Ce(t.scroller,"DOMMouseScroll",function(q){return Yo(e,q)}),Ce(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){et(e,q)||ye(q)},over:function(q){et(e,q)||(Ol(e,q),ye(q))},start:function(q){return wl(e,q)},drop:ni(e,Al),leave:function(q){et(e,q)||Es(e)}};var Z=t.input.getField();Ce(Z,"keyup",function(q){return Ds.call(e,q)}),Ce(Z,"keydown",ni(e,Ls)),Ce(Z,"keypress",ni(e,Ms)),Ce(Z,"focus",function(q){return ao(e,q)}),Ce(Z,"blur",function(q){return Ir(e,q)})}var Ao=[];Nn.defineInitHook=function(e){return Ao.push(e)};function _a(e,t,i,n){var f=e.doc,P;i==null&&(i="add"),i=="smart"&&(f.mode.indent?P=St(e,t).state:i="prev");var z=e.options.tabSize,Z=Ot(f,t),q=X(Z.text,null,z);Z.stateAfter&&(Z.stateAfter=null);var ie=Z.text.match(/^\s*/)[0],Ee;if(!n&&!/\S/.test(Z.text))Ee=0,i="not";else if(i=="smart"&&(Ee=f.mode.indent(P,Z.text.slice(ie.length),Z.text),Ee==Pe||Ee>150)){if(!n)return;i="prev"}i=="prev"?t>f.first?Ee=X(Ot(f,t-1).text,null,z):Ee=0:i=="add"?Ee=q+e.options.indentUnit:i=="subtract"?Ee=q-e.options.indentUnit:typeof i=="number"&&(Ee=q+i),Ee=Math.max(0,Ee);var we="",Ve=0;if(e.options.indentWithTabs)for(var We=Math.floor(Ee/z);We;--We)Ve+=z,we+=" ";if(Ve<Ee&&(we+=ue(Ee-Ve)),we!=ie)return Nr(f,we,mt(t,0),mt(t,ie.length),"+input"),Z.stateAfter=null,!0;for(var lt=0;lt<f.sel.ranges.length;lt++){var yt=f.sel.ranges[lt];if(yt.head.line==t&&yt.head.ch<ie.length){var At=mt(t,ie.length);bo(f,lt,new An(At,At));break}}}var Xi=null;function Ya(e){Xi=e}function wo(e,t,i,n,f){var P=e.doc;e.display.shift=!1,n||(n=P.sel);var z=+new Date-200,Z=f=="paste"||e.state.pasteIncoming>z,q=Xe(t),ie=null;if(Z&&n.ranges.length>1)if(Xi&&Xi.text.join(`
`)==t){if(n.ranges.length%Xi.text.length==0){ie=[];for(var Ee=0;Ee<Xi.text.length;Ee++)ie.push(P.splitLines(Xi.text[Ee]))}}else q.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(ie=ve(q,function(It){return[It]}));for(var we=e.curOp.updateInput,Ve=n.ranges.length-1;Ve>=0;Ve--){var We=n.ranges[Ve],lt=We.from(),yt=We.to();We.empty()&&(i&&i>0?lt=mt(lt.line,lt.ch-i):e.state.overwrite&&!Z?yt=mt(yt.line,Math.min(Ot(P,yt.line).text.length,yt.ch+ne(q).length)):Z&&Xi&&Xi.lineWise&&Xi.text.join(`
`)==q.join(`
`)&&(lt=yt=mt(lt.line,0)));var At={from:lt,to:yt,text:ie?ie[Ve%ie.length]:q,origin:f||(Z?"paste":e.state.cutIncoming>z?"cut":"+input")};Pr(e.doc,At),bn(e,"inputRead",e,At)}t&&!Z&&Ws(e,t),Lr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function js(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Mi(t,function(){return wo(t,i,0,null,"paste")}),!0}function Ws(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var f=i.ranges[n];if(f.head.ch>100||n&&i.ranges[n-1].head.line==f.head.line)continue;var P=e.getModeAt(f.head),z=!1;if(P.electricChars){for(var Z=0;Z<P.electricChars.length;Z++)if(t.indexOf(P.electricChars.charAt(Z))>-1){z=_a(e,f.head.line,"smart");break}}else P.electricInput&&(P.electricInput.test(Ot(e.doc,f.head.line).text.slice(0,f.head.ch))&&(z=_a(e,f.head.line,"smart")));z&&bn(e,"electricInput",e,f.head.line)}}function Hs(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var f=e.doc.sel.ranges[n].head.line,P={anchor:mt(f,0),head:mt(f+1,0)};i.push(P),t.push(e.getRange(P.anchor,P.head))}return{text:t,ranges:i}}function Ks(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Gs(){var e=u("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=u("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),l&&(e.style.border="1px solid black"),Ks(e),t}function $l(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,f){var P=this.options,z=P[n];if(P[n]==f&&n!="mode")return;P[n]=f,t.hasOwnProperty(n)&&ni(this,t[n])(this,f,z),Be(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,f){this.state.keyMaps[f?"push":"unshift"](Ga(n))},removeKeyMap:function(n){for(var f=this.state.keyMaps,P=0;P<f.length;++P)if(f[P]==n||f[P].name==n)return f.splice(P,1),!0},addOverlay:gi(function(n,f){var P=n.token?n:e.getMode(this.options,n);if(P.startState)throw new Error("Overlays may not be stateful.");le(this.state.overlays,{mode:P,modeSpec:n,opaque:f&&f.opaque,priority:f&&f.priority||0},function(z){return z.priority}),this.state.modeGen++,dn(this)}),removeOverlay:gi(function(n){for(var f=this.state.overlays,P=0;P<f.length;++P){var z=f[P].modeSpec;if(z==n||typeof n=="string"&&z.name==n){f.splice(P,1),this.state.modeGen++,dn(this);return}}}),indentLine:gi(function(n,f,P){typeof f!="string"&&typeof f!="number"&&(f==null?f=this.options.smartIndent?"smart":"prev":f=f?"add":"subtract"),Cn(this.doc,n)&&_a(this,n,f,P)}),indentSelection:gi(function(n){for(var f=this.doc.sel.ranges,P=-1,z=0;z<f.length;z++){var Z=f[z];if(Z.empty())Z.head.line>P&&(_a(this,Z.head.line,n,!0),P=Z.head.line,z==this.doc.sel.primIndex&&Lr(this));else{var q=Z.from(),ie=Z.to(),Ee=Math.max(P,q.line);P=Math.min(this.lastLine(),ie.line-(ie.ch?0:1))+1;for(var we=Ee;we<P;++we)_a(this,we,n);var Ve=this.doc.sel.ranges;q.ch==0&&f.length==Ve.length&&Ve[z].from().ch>0&&bo(this.doc,z,new An(q,Ve[z].to()),Se)}}}),getTokenAt:function(n,f){return Tn(this,n,f)},getLineTokens:function(n,f){return Tn(this,mt(n),f,!0)},getTokenTypeAt:function(n){n=S(this.doc,n);var f=at(this,Ot(this.doc,n.line)),P=0,z=(f.length-1)/2,Z=n.ch,q;if(Z==0)q=f[2];else for(;;){var ie=P+z>>1;if((ie?f[ie*2-1]:0)>=Z)z=ie;else if(f[ie*2+1]<Z)P=ie+1;else{q=f[ie*2+2];break}}var Ee=q?q.indexOf("overlay "):-1;return Ee<0?q:Ee==0?null:q.slice(0,Ee-1)},getModeAt:function(n){var f=this.doc.mode;return f.innerMode?e.innerMode(f,this.getTokenAt(n).state).mode:f},getHelper:function(n,f){return this.getHelpers(n,f)[0]},getHelpers:function(n,f){var P=[];if(!i.hasOwnProperty(f))return P;var z=i[f],Z=this.getModeAt(n);if(typeof Z[f]=="string")z[Z[f]]&&P.push(z[Z[f]]);else if(Z[f])for(var q=0;q<Z[f].length;q++){var ie=z[Z[f][q]];ie&&P.push(ie)}else Z.helperType&&z[Z.helperType]?P.push(z[Z.helperType]):z[Z.name]&&P.push(z[Z.name]);for(var Ee=0;Ee<z._global.length;Ee++){var we=z._global[Ee];we.pred(Z,this)&&se(P,we.val)==-1&&P.push(we.val)}return P},getStateAfter:function(n,f){var P=this.doc;return n=V(P,n==null?P.first+P.size-1:n),St(this,n+1,f).state},cursorCoords:function(n,f){var P,z=this.doc.sel.primary();return n==null?P=z.head:typeof n=="object"?P=S(this.doc,n):P=n?z.from():z.to(),ei(this,P,f||"page")},charCoords:function(n,f){return Zr(this,S(this.doc,n),f||"page")},coordsChar:function(n,f){return n=wa(this,n,f||"page"),$r(this,n.left,n.top)},lineAtHeight:function(n,f){return n=wa(this,{top:n,left:0},f||"page").top,nn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,f,P){var z=!1,Z;if(typeof n=="number"){var q=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>q&&(n=q,z=!0),Z=Ot(this.doc,n)}else Z=n;return Rr(this,Z,{top:0,left:0},f||"page",P||z).top+(z?this.doc.height-Ei(Z):0)},defaultTextHeight:function(){return Rt(this.display)},defaultCharWidth:function(){return kt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,f,P,z,Z){var q=this.display;n=ei(this,S(this.doc,n));var ie=n.bottom,Ee=n.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),q.sizer.appendChild(f),z=="over")ie=n.top;else if(z=="above"||z=="near"){var we=Math.max(q.wrapper.clientHeight,this.doc.height),Ve=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(z=="above"||n.bottom+f.offsetHeight>we)&&n.top>f.offsetHeight?ie=n.top-f.offsetHeight:n.bottom+f.offsetHeight<=we&&(ie=n.bottom),Ee+f.offsetWidth>Ve&&(Ee=Ve-f.offsetWidth)}f.style.top=ie+"px",f.style.left=f.style.right="",Z=="right"?(Ee=q.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(Z=="left"?Ee=0:Z=="middle"&&(Ee=(q.sizer.clientWidth-f.offsetWidth)/2),f.style.left=Ee+"px"),P&&Js(this,{left:Ee,top:ie,right:Ee+f.offsetWidth,bottom:ie+f.offsetHeight})},triggerOnKeyDown:gi(Ls),triggerOnKeyPress:gi(Ms),triggerOnKeyUp:Ds,triggerOnMouseDown:gi(ks),execCommand:function(n){if(ga.hasOwnProperty(n))return ga[n].call(null,this)},triggerElectric:gi(function(n){Ws(this,n)}),findPosH:function(n,f,P,z){var Z=1;f<0&&(Z=-1,f=-f);for(var q=S(this.doc,n),ie=0;ie<f&&!(q=Oo(this.doc,q,Z,P,z),q.hitSide);++ie);return q},moveH:gi(function(n,f){var P=this;this.extendSelectionsBy(function(z){return P.display.shift||P.doc.extend||z.empty()?Oo(P.doc,z.head,n,f,P.options.rtlMoveVisually):n<0?z.from():z.to()},Oe)}),deleteH:gi(function(n,f){var P=this.doc.sel,z=this.doc;P.somethingSelected()?z.replaceSelection("",null,"+delete"):Fr(this,function(Z){var q=Oo(z,Z.head,n,f,!1);return n<0?{from:q,to:Z.head}:{from:Z.head,to:q}})}),findPosV:function(n,f,P,z){var Z=1,q=z;f<0&&(Z=-1,f=-f);for(var ie=S(this.doc,n),Ee=0;Ee<f;++Ee){var we=ei(this,ie,"div");if(q==null?q=we.left:we.left=q,ie=zs(this,we,Z,P),ie.hitSide)break}return ie},moveV:gi(function(n,f){var P=this,z=this.doc,Z=[],q=!this.display.shift&&!z.extend&&z.sel.somethingSelected();if(z.extendSelectionsBy(function(Ee){if(q)return n<0?Ee.from():Ee.to();var we=ei(P,Ee.head,"div");Ee.goalColumn!=null&&(we.left=Ee.goalColumn),Z.push(we.left);var Ve=zs(P,we,n,f);return f=="page"&&Ee==z.sel.primary()&&so(P,Zr(P,Ve,"div").top-we.top),Ve},Oe),Z.length)for(var ie=0;ie<z.sel.ranges.length;ie++)z.sel.ranges[ie].goalColumn=Z[ie]}),findWordAt:function(n){var f=this.doc,P=Ot(f,n.line).text,z=n.ch,Z=n.ch;if(P){var q=this.getHelper(n,"wordChars");(n.sticky=="before"||Z==P.length)&&z?--z:++Z;for(var ie=P.charAt(z),Ee=$e(ie,q)?function(we){return $e(we,q)}:/\s/.test(ie)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!$e(we)};z>0&&Ee(P.charAt(z-1));)--z;for(;Z<P.length&&Ee(P.charAt(Z));)++Z}return new An(mt(n.line,z),mt(n.line,Z))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?E(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),Be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gi(function(n,f){ta(this,n,f)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-mi(this)-this.display.barHeight,width:n.scrollWidth-mi(this)-this.display.barWidth,clientHeight:yr(this),clientWidth:rr(this)}},scrollIntoView:gi(function(n,f){n==null?(n={from:this.doc.sel.primary().head,to:null},f==null&&(f=this.options.cursorScrollMargin)):typeof n=="number"?n={from:mt(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=f||0,n.from.line!=null?Zs(this,n):Uo(this,n.from,n.to,n.margin)}),setSize:gi(function(n,f){var P=this,z=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};n!=null&&(this.display.wrapper.style.width=z(n)),f!=null&&(this.display.wrapper.style.height=z(f)),this.options.lineWrapping&&Ca(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function(q){if(q.widgets){for(var ie=0;ie<q.widgets.length;ie++)if(q.widgets[ie].noHScroll){si(P,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,Be(this,"refresh",this)}),operation:function(n){return Mi(this,n)},startOperation:function(){return xr(this)},endOperation:function(){return Tr(this)},refresh:gi(function(){var n=this.display.cachedTextHeight;dn(this),this.curOp.forceUpdate=!0,dr(this),ta(this,this.doc.scrollLeft,this.doc.scrollTop),co(this.display),(n==null||Math.abs(n-Rt(this.display))>.5||this.options.lineWrapping)&&Xt(this),Be(this,"refresh",this)}),swapDoc:gi(function(n){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Zo(this,n),dr(this),this.display.input.reset(),ta(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,bn(this,"swapDoc",this,f),f}),phrase:function(n){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,n)?f[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ge(e),e.registerHelper=function(n,f,P){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][f]=P},e.registerGlobalHelper=function(n,f,P,z){e.registerHelper(n,f,z),i[n]._global.push({pred:P,val:z})}}function Oo(e,t,i,n,f){var P=t,z=i,Z=Ot(e,t.line),q=f&&e.direction=="rtl"?-i:i;function ie(){var Ut=t.line+q;return Ut<e.first||Ut>=e.first+e.size?!1:(t=new mt(Ut,t.ch,t.sticky),Z=Ot(e,Ut))}function Ee(Ut){var Lt;if(n=="codepoint"){var jt=Z.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(jt)?Lt=null:Lt=new mt(t.line,Math.max(0,Math.min(Z.text.length,t.ch+i*(jt>=55296&&jt<56320?2:1))),-i)}else f?Lt=kl(e.cm,Z,t,i):Lt=Eo(Z,t,i);if(Lt==null)if(!Ut&&ie())t=xo(f,e.cm,Z,t.line,q);else return!1;else t=Lt;return!0}if(n=="char"||n=="codepoint")Ee();else if(n=="column")Ee(!0);else if(n=="word"||n=="group")for(var we=null,Ve=n=="group",We=e.cm&&e.cm.getHelper(t,"wordChars"),lt=!0;!(i<0&&!Ee(!lt));lt=!1){var yt=Z.text.charAt(t.ch)||`
`,At=$e(yt,We)?"w":Ve&&yt==`
`?"n":!Ve||/\s/.test(yt)?null:"p";if(Ve&&!lt&&!At&&(At="s"),we&&we!=At){i<0&&(i=1,Ee(),t.sticky="after");break}if(At&&(we=At),i>0&&!Ee(!lt))break}var It=Wa(e,t,P,z,!0);return Mn(P,It)&&(It.hitSide=!0),It}function zs(e,t,i,n){var f=e.doc,P=t.left,z;if(n=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Z-.5*Rt(e.display),3);z=(i>0?t.bottom:t.top)+i*q}else n=="line"&&(z=i>0?t.bottom+3:t.top-3);for(var ie;!(ie=$r(e,P,z),!ie.outside);){if(i<0?z<=0:z>=f.height){ie.hitSide=!0;break}z+=i*5}return ie}var On=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new $,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};On.prototype.init=function(e){var t=this,i=this,n=i.cm,f=i.div=e.lineDiv;Ks(f,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function P(Z){for(var q=Z.target;q;q=q.parentNode){if(q==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Ce(f,"paste",function(Z){if(!P(Z)||et(n,Z)||js(Z,n))return;F<=11&&setTimeout(ni(n,function(){return t.updateFromDOM()}),20)}),Ce(f,"compositionstart",function(Z){t.composing={data:Z.data,done:!1}}),Ce(f,"compositionupdate",function(Z){t.composing||(t.composing={data:Z.data,done:!1})}),Ce(f,"compositionend",function(Z){t.composing&&(Z.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(f,"touchstart",function(){return i.forceCompositionEnd()}),Ce(f,"input",function(){t.composing||t.readFromDOMSoon()});function z(Z){if(!P(Z)||et(n,Z))return;if(n.somethingSelected())Ya({lineWise:!1,text:n.getSelections()}),Z.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var q=Hs(n);Ya({lineWise:!0,text:q.text}),Z.type=="cut"&&n.operation(function(){n.setSelections(q.ranges,0,Se),n.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var ie=Xi.text.join(`
`);if(Z.clipboardData.setData("Text",ie),Z.clipboardData.getData("Text")==ie){Z.preventDefault();return}}var Ee=Gs(),we=Ee.firstChild;n.display.lineSpace.insertBefore(Ee,n.display.lineSpace.firstChild),we.value=Xi.text.join(`
`);var Ve=document.activeElement;G(we),setTimeout(function(){n.display.lineSpace.removeChild(Ee),Ve.focus(),Ve==f&&i.showPrimarySelection()},50)}Ce(f,"copy",z),Ce(f,"cut",z)},On.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},On.prototype.prepareSelection=function(){var e=Do(this.cm,!1);return e.focus=document.activeElement==this.div,e},On.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},On.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},On.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),f=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||f.line<t.display.viewFrom){e.removeAllRanges();return}var P=Xa(t,e.anchorNode,e.anchorOffset),z=Xa(t,e.focusNode,e.focusOffset);if(P&&!P.bad&&z&&!z.bad&&Gt(Vn(P,z),n)==0&&Gt(Pn(P,z),f)==0)return;var Z=t.display.view,q=n.line>=t.display.viewFrom&&Vs(t,n)||{node:Z[0].measure.map[2],offset:0},ie=f.line<t.display.viewTo&&Vs(t,f);if(!ie){var Ee=Z[Z.length-1].measure,we=Ee.maps?Ee.maps[Ee.maps.length-1]:Ee.map;ie={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!q||!ie){e.removeAllRanges();return}var Ve=e.rangeCount&&e.getRangeAt(0),We;try{We=g(q.node,q.offset,ie.offset,ie.node)}catch(lt){}We&&(!N&&t.state.focused?(e.collapse(q.node,q.offset),We.collapsed||(e.removeAllRanges(),e.addRange(We))):(e.removeAllRanges(),e.addRange(We)),Ve&&e.anchorNode==null?e.addRange(Ve):N&&this.startGracePeriod()),this.rememberSelection()},On.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)},On.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},On.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},On.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return y(this.div,t)},On.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},On.prototype.blur=function(){this.div.blur()},On.prototype.getField=function(){return this.div},On.prototype.supportsTouch=function(){return!0},On.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Mi(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)},On.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},On.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(o&&_&&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 i=Xa(t,e.anchorNode,e.anchorOffset),n=Xa(t,e.focusNode,e.focusOffset);i&&n&&Mi(t,function(){hi(t.doc,hr(i,n),Se),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},On.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),f=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=mt(n.line-1,Ot(e.doc,n.line-1).length)),f.ch==Ot(e.doc,f.line).text.length&&f.line<e.lastLine()&&(f=mt(f.line+1,0)),n.line<t.viewFrom||f.line>t.viewTo-1)return!1;var P,z,Z;n.line==t.viewFrom||(P=xn(e,n.line))==0?(z=Nt(t.view[0].line),Z=t.view[0].node):(z=Nt(t.view[P].line),Z=t.view[P-1].node.nextSibling);var q=xn(e,f.line),ie,Ee;if(q==t.view.length-1?(ie=t.viewTo-1,Ee=t.lineDiv.lastChild):(ie=Nt(t.view[q+1].line)-1,Ee=t.view[q+1].node.previousSibling),!Z)return!1;for(var we=e.doc.splitLines(tu(e,Z,Ee,z,ie)),Ve=gn(e.doc,mt(z,0),mt(ie,Ot(e.doc,ie).text.length));we.length>1&&Ve.length>1;)if(ne(we)==ne(Ve))we.pop(),Ve.pop(),ie--;else if(we[0]==Ve[0])we.shift(),Ve.shift(),z++;else break;for(var We=0,lt=0,yt=we[0],At=Ve[0],It=Math.min(yt.length,At.length);We<It&&yt.charCodeAt(We)==At.charCodeAt(We);)++We;for(var Ut=ne(we),Lt=ne(Ve),jt=Math.min(Ut.length-(we.length==1?We:0),Lt.length-(Ve.length==1?We:0));lt<jt&&Ut.charCodeAt(Ut.length-lt-1)==Lt.charCodeAt(Lt.length-lt-1);)++lt;if(we.length==1&&Ve.length==1&&z==n.line)for(;We&&We>n.ch&&Ut.charCodeAt(Ut.length-lt-1)==Lt.charCodeAt(Lt.length-lt-1);)We--,lt++;we[we.length-1]=Ut.slice(0,Ut.length-lt).replace(/^\u200b+/,""),we[0]=we[0].slice(We).replace(/\u200b+$/,"");var en=mt(z,We),Qt=mt(ie,Ve.length?ne(Ve).length-lt:0);if(we.length>1||we[0]||Gt(en,Qt))return Nr(e.doc,we,en,Qt,"+input"),!0},On.prototype.ensurePolled=function(){this.forceCompositionEnd()},On.prototype.reset=function(){this.forceCompositionEnd()},On.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},On.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)},On.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Mi(this.cm,function(){return dn(e.cm)})},On.prototype.setUneditable=function(e){e.contentEditable="false"},On.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ni(this.cm,wo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},On.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},On.prototype.onContextMenu=function(){},On.prototype.resetPosition=function(){},On.prototype.needsContentAttribute=!0;function Vs(e,t){var i=ar(e,t.line);if(!i||i.hidden)return null;var n=Ot(e.doc,t.line),f=Qr(i,n,t.line),P=xt(n,e.doc.direction),z="left";if(P){var Z=dt(P,t.ch);z=Z%2?"right":"left"}var q=br(f.map,t.ch,z);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Wr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,f){var P="",z=!1,Z=e.doc.lineSeparator(),q=!1;function ie(We){return function(lt){return lt.id==We}}function Ee(){z&&(P+=Z,q&&(P+=Z),z=q=!1)}function we(We){We&&(Ee(),P+=We)}function Ve(We){if(We.nodeType==1){var lt=We.getAttribute("cm-text");if(lt){we(lt);return}var yt=We.getAttribute("cm-marker"),At;if(yt){var It=e.findMarks(mt(n,0),mt(f+1,0),ie(+yt));It.length&&(At=It[0].find(0))&&we(gn(e.doc,At.from,At.to).join(Z));return}if(We.getAttribute("contenteditable")=="false")return;var Ut=/^(pre|div|p|li|table|br)$/i.test(We.nodeName);if(!/^br$/i.test(We.nodeName)&&We.textContent.length==0)return;Ut&&Ee();for(var Lt=0;Lt<We.childNodes.length;Lt++)Ve(We.childNodes[Lt]);/^(pre|p)$/i.test(We.nodeName)&&(q=!0),Ut&&(z=!0)}else We.nodeType==3&&we(We.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Ve(t),t==i);)t=t.nextSibling,q=!1;return P}function Xa(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Wr(e.clipPos(mt(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var f=0;f<e.display.view.length;f++){var P=e.display.view[f];if(P.node==n)return nu(P,t,i)}}function nu(e,t,i){var n=e.text.firstChild,f=!1;if(!t||!y(n,t))return Wr(mt(Nt(e.line),0),!0);if(t==n&&(f=!0,t=n.childNodes[i],i=0,!t)){var P=e.rest?ne(e.rest):e.line;return Wr(mt(Nt(P),P.text.length),f)}var z=t.nodeType==3?t:null,Z=t;for(!z&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(z=t.firstChild,i&&(i=z.nodeValue.length));Z.parentNode!=n;)Z=Z.parentNode;var q=e.measure,ie=q.maps;function Ee(At,It,Ut){for(var Lt=-1;Lt<(ie?ie.length:0);Lt++)for(var jt=Lt<0?q.map:ie[Lt],en=0;en<jt.length;en+=3){var Qt=jt[en+2];if(Qt==At||Qt==It){var fn=Nt(Lt<0?e.line:e.rest[Lt]),Ln=jt[en]+Ut;return(Ut<0||Qt!=At)&&(Ln=jt[en+(Ut?1:0)]),mt(fn,Ln)}}}var we=Ee(z,Z,i);if(we)return Wr(we,f);for(var Ve=Z.nextSibling,We=z?z.nodeValue.length-i:0;Ve;Ve=Ve.nextSibling){if(we=Ee(Ve,Ve.firstChild,0),we)return Wr(mt(we.line,we.ch-We),f);We+=Ve.textContent.length}for(var lt=Z.previousSibling,yt=i;lt;lt=lt.previousSibling){if(we=Ee(lt,lt.firstChild,-1),we)return Wr(mt(we.line,we.ch+yt),f);yt+=lt.textContent.length}}var zn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new $,this.hasSelection=!1,this.composing=null};zn.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var f=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),l&&(f.style.width="0px"),Ce(f,"input",function(){H&&F>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ce(f,"paste",function(z){if(et(n,z)||js(z,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function P(z){if(et(n,z))return;if(n.somethingSelected())Ya({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var Z=Hs(n);Ya({lineWise:!0,text:Z.text}),z.type=="cut"?n.setSelections(Z.ranges,null,Se):(i.prevInput="",f.value=Z.text.join(`
`),G(f))}else return;z.type=="cut"&&(n.state.cutIncoming=+new Date)}Ce(f,"cut",P),Ce(f,"copy",P),Ce(e.scroller,"paste",function(z){if(er(e,z)||et(n,z))return;if(!f.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var Z=new Event("paste");Z.clipboardData=z.clipboardData,f.dispatchEvent(Z)}),Ce(e.lineSpace,"selectstart",function(z){er(e,z)||re(z)}),Ce(f,"compositionstart",function(){var z=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:z,range:n.markText(z,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ce(f,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},zn.prototype.createField=function(e){this.wrapper=Gs(),this.textarea=this.wrapper.firstChild},zn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},zn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Do(e);if(e.options.moveInputWithCursor){var f=ei(e,i.sel.primary().head,"div"),P=t.wrapper.getBoundingClientRect(),z=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,f.top+z.top-P.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,f.left+z.left-P.left))}return n},zn.prototype.showSelection=function(e){var t=this.cm,i=t.display;h(i.cursorDiv,e.cursors),h(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},zn.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&G(this.textarea),H&&F>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",H&&F>=9&&(this.hasSelection=null))},zn.prototype.getField=function(){return this.textarea},zn.prototype.supportsTouch=function(){return!1},zn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!r||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},zn.prototype.blur=function(){this.textarea.blur()},zn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zn.prototype.receivedFocus=function(){this.slowPoll()},zn.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()})},zn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},zn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ge(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var f=i.value;if(f==n&&!t.somethingSelected())return!1;if(H&&F>=9&&this.hasSelection===f||s&&/[\uf700-\uf7ff]/.test(f))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var P=f.charCodeAt(0);if(P==8203&&!n&&(n="\u200B"),P==8666)return this.reset(),this.cm.execCommand("undo")}for(var z=0,Z=Math.min(n.length,f.length);z<Z&&n.charCodeAt(z)==f.charCodeAt(z);)++z;return Mi(t,function(){wo(t,f.slice(z),n.length-z,null,e.composing?"*compose":null),f.length>1e3||f.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},zn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zn.prototype.onKeyPress=function(){H&&F>=9&&(this.hasSelection=null),this.fastPoll()},zn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,f=t.textarea;t.contextMenuPending&&t.contextMenuPending();var P=vn(i,e),z=n.scroller.scrollTop;if(!P||v)return;var Z=i.options.resetSelectionOnContextMenu;Z&&i.doc.sel.contains(P)==-1&&ni(i,hi)(i.doc,hr(P),Se);var q=f.style.cssText,ie=t.wrapper.style.cssText,Ee=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Ee.top-5)+"px; left: "+(e.clientX-Ee.left-5)+`px;
z-index: 1000; background: `+(H?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var we;k&&(we=window.scrollY),n.input.focus(),k&&window.scrollTo(null,we),n.input.reset(),i.somethingSelected()||(f.value=t.prevInput=" "),t.contextMenuPending=We,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ve(){if(f.selectionStart!=null){var yt=i.somethingSelected(),At="\u200B"+(yt?f.value:"");f.value="\u21DA",f.value=At,t.prevInput=yt?"":"\u200B",f.selectionStart=1,f.selectionEnd=At.length,n.selForContextMenu=i.doc.sel}}function We(){if(t.contextMenuPending!=We)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ie,f.style.cssText=q,H&&F<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=z),f.selectionStart!=null){(!H||H&&F<9)&&Ve();var yt=0,At=function(){n.selForContextMenu==i.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&t.prevInput=="\u200B"?ni(i,ds)(i):yt++<10?n.detectingSelectAll=setTimeout(At,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(At,200)}}if(H&&F>=9&&Ve(),w){ye(e);var lt=function(){rt(window,"mouseup",lt),setTimeout(We,20)};Ce(window,"mouseup",lt)}else setTimeout(We,50)},zn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},zn.prototype.setUneditable=function(){},zn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?O(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=M();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=Z.getValue()}var f;if(e.form&&(Ce(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var P=e.form;f=P.submit;try{var z=P.submit=function(){n(),P.submit=f,P.submit(),P.submit=z}}catch(q){}}t.finishInit=function(q){q.save=n,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,n(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var Z=Nn(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Z}function ru(e){e.off=rt,e.on=Ce,e.wheelEventPixels=cl,e.Doc=xi,e.splitLines=Xe,e.countColumn=X,e.findColumn=Me,e.isWordChar=He,e.Pass=Pe,e.signal=Be,e.Line=oi,e.changeEnd=fr,e.scrollbarModel=jo,e.Pos=mt,e.cmpPos=Gt,e.modes=Ze,e.mimeModes=Ue,e.resolveMode=Te,e.getMode=Ke,e.modeExtensions=st,e.extendMode=ft,e.copyState=Tt,e.startState=an,e.innerMode=Jt,e.commands=ga,e.keyMap=or,e.keyName=As,e.isModifierKey=Cs,e.lookupKey=Br,e.normalizeKeyMap=Ml,e.StringStream=Vt,e.SharedTextMarker=fa,e.TextMarker=mr,e.LineWidget=ha,e.e_preventDefault=re,e.e_stopPropagation=ae,e.e_stop=ye,e.addClass=E,e.contains=y,e.rmClass=b,e.keyNames=gr}Ql(Nn),$l(Nn);var au="iter insert remove copy getEditor constructor".split(" ");for(var Qa in xi.prototype)xi.prototype.hasOwnProperty(Qa)&&se(au,Qa)<0&&(Nn.prototype[Qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(xi.prototype[Qa]));return ge(xi),Nn.inputStyles={textarea:zn,contenteditable:On},Nn.defineMode=function(e){!Nn.defaults.mode&&e!="null"&&(Nn.defaults.mode=e),ze.apply(this,arguments)},Nn.defineMIME=ct,Nn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Nn.defineMIME("text/plain","null"),Nn.defineExtension=function(e,t){Nn.prototype[e]=t},Nn.defineDocExtension=function(e,t){xi.prototype[e]=t},Nn.fromTextArea=iu,ru(Nn),Nn.version="5.58.2",Nn})},W6BS:function(qe,Ne){qe.exports="data:image/png;base64,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"},WaYH:function(qe,Ne,K){"use strict";var te=K("rePB"),Q=K("Ff2n"),N=K("VTBJ"),J=K("1OyB"),B=K("vuIU"),D=K("JX7q"),H=K("Ji7U"),F=K("LK+K"),k=K("q1tI"),I=K("TSYQ"),_=K.n(I),v=K("sboe"),p=K("OZM5"),c=function(w){var C=w.prefixCls,b=w.level,m=w.isStart,h=w.isEnd;if(!b)return null;for(var u="".concat(C,"-indent-unit"),x=[],g=0;g<b;g+=1){var y;x.push(k.createElement("span",{key:g,className:_()(u,(y={},Object(te.a)(y,"".concat(u,"-start"),m[g+1]),Object(te.a)(y,"".concat(u,"-end"),h[g+1]),Object(te.a)(y,"".concat(u,"-end-first-level"),!g&&h[0]),y))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat(C,"-indent")},x)},a=c,l=K("815F"),o="open",r="close",s="---",d=function(T){Object(H.a)(C,T);var w=Object(F.a)(C);function C(){var b;return Object(J.a)(this,C),b=w.apply(this,arguments),b.state={dragNodeHighlight:!1},b.onSelectorClick=function(m){var h=b.props.context.onNodeClick;h(m,Object(l.b)(b.props)),b.isSelectable()?b.onSelect(m):b.onCheck(m)},b.onSelectorDoubleClick=function(m){var h=b.props.context.onNodeDoubleClick;h(m,Object(l.b)(b.props))},b.onSelect=function(m){if(b.isDisabled())return;var h=b.props.context.onNodeSelect;m.preventDefault(),h(m,Object(l.b)(b.props))},b.onCheck=function(m){if(b.isDisabled())return;var h=b.props,u=h.disableCheckbox,x=h.checked,g=b.props.context.onNodeCheck;if(!b.isCheckable()||u)return;m.preventDefault();var y=!x;g(m,Object(l.b)(b.props),y)},b.onMouseEnter=function(m){var h=b.props.context.onNodeMouseEnter;h(m,Object(l.b)(b.props))},b.onMouseLeave=function(m){var h=b.props.context.onNodeMouseLeave;h(m,Object(l.b)(b.props))},b.onContextMenu=function(m){var h=b.props.context.onNodeContextMenu;h(m,Object(l.b)(b.props))},b.onDragStart=function(m){var h=b.props.context.onNodeDragStart;m.stopPropagation(),b.setState({dragNodeHighlight:!0}),h(m,Object(D.a)(b));try{m.dataTransfer.setData("text/plain","")}catch(u){}},b.onDragEnter=function(m){var h=b.props.context.onNodeDragEnter;m.preventDefault(),m.stopPropagation(),h(m,Object(D.a)(b))},b.onDragOver=function(m){var h=b.props.context.onNodeDragOver;m.preventDefault(),m.stopPropagation(),h(m,Object(D.a)(b))},b.onDragLeave=function(m){var h=b.props.context.onNodeDragLeave;m.stopPropagation(),h(m,Object(D.a)(b))},b.onDragEnd=function(m){var h=b.props.context.onNodeDragEnd;m.stopPropagation(),b.setState({dragNodeHighlight:!1}),h(m,Object(D.a)(b))},b.onDrop=function(m){var h=b.props.context.onNodeDrop;m.preventDefault(),m.stopPropagation(),b.setState({dragNodeHighlight:!1}),h(m,Object(D.a)(b))},b.onExpand=function(m){var h=b.props.context.onNodeExpand;h(m,Object(l.b)(b.props))},b.setSelectHandle=function(m){b.selectHandle=m},b.getNodeState=function(){var m=b.props.expanded;return b.isLeaf()?null:m?o:r},b.hasChildren=function(){var m=b.props.eventKey,h=b.props.context.keyEntities,u=h[m]||{},x=u.children;return!!(x||[]).length},b.isLeaf=function(){var m=b.props,h=m.isLeaf,u=m.loaded,x=b.props.context.loadData,g=b.hasChildren();return h===!1?!1:h||!x&&!g||x&&u&&!g},b.isDisabled=function(){var m=b.props.disabled,h=b.props.context.disabled;return!!(h||m)},b.isCheckable=function(){var m=b.props.checkable,h=b.props.context.checkable;return!h||m===!1?!1:h},b.syncLoadData=function(m){var h=m.expanded,u=m.loading,x=m.loaded,g=b.props.context,y=g.loadData,M=g.onNodeLoad;if(u)return;y&&h&&!b.isLeaf()&&(!b.hasChildren()&&!x&&M(Object(l.b)(b.props)))},b.renderSwitcher=function(){var m=b.props,h=m.expanded,u=m.switcherIcon,x=b.props.context,g=x.prefixCls,y=x.switcherIcon,M=u||y;if(b.isLeaf())return k.createElement("span",{className:_()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof M=="function"?M(Object(N.a)(Object(N.a)({},b.props),{},{isLeaf:!0})):M);var E=_()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(h?o:r));return k.createElement("span",{onClick:b.onExpand,className:E},typeof M=="function"?M(Object(N.a)(Object(N.a)({},b.props),{},{isLeaf:!1})):M)},b.renderCheckbox=function(){var m=b.props,h=m.checked,u=m.halfChecked,x=m.disableCheckbox,g=b.props.context.prefixCls,y=b.isDisabled(),M=b.isCheckable();if(!M)return null;var E=typeof M!="boolean"?M:null;return k.createElement("span",{className:_()("".concat(g,"-checkbox"),h&&"".concat(g,"-checkbox-checked"),!h&&u&&"".concat(g,"-checkbox-indeterminate"),(y||x)&&"".concat(g,"-checkbox-disabled")),onClick:b.onCheck},E)},b.renderIcon=function(){var m=b.props.loading,h=b.props.context.prefixCls;return k.createElement("span",{className:_()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(b.getNodeState()||"docu"),m&&"".concat(h,"-icon_loading"))})},b.renderSelector=function(){var m=b.state.dragNodeHighlight,h=b.props,u=h.title,x=h.selected,g=h.icon,y=h.loading,M=h.data,E=b.props.context,j=E.prefixCls,G=E.showIcon,U=E.icon,O=E.draggable,X=E.loadData,$=E.titleRender,se=b.isDisabled(),ce="".concat(j,"-node-content-wrapper"),Pe;if(G){var Se=g||U;Pe=Se?k.createElement("span",{className:_()("".concat(j,"-iconEle"),"".concat(j,"-icon__customize"))},typeof Se=="function"?Se(b.props):Se):b.renderIcon()}else X&&y&&(Pe=b.renderIcon());var Re;typeof u=="function"?Re=u(M):$?Re=$(M):Re=u;var Oe=k.createElement("span",{className:"".concat(j,"-title")},Re);return k.createElement("span",{ref:b.setSelectHandle,title:typeof u=="string"?u:"",className:_()("".concat(ce),"".concat(ce,"-").concat(b.getNodeState()||"normal"),!se&&(x||m)&&"".concat(j,"-node-selected"),!se&&O&&"draggable"),draggable:!se&&O||void 0,"aria-grabbed":!se&&O||void 0,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,onContextMenu:b.onContextMenu,onClick:b.onSelectorClick,onDoubleClick:b.onSelectorDoubleClick,onDragStart:O?b.onDragStart:void 0},Pe,Oe)},b}return Object(B.a)(C,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var m=this.props.selectable,h=this.props.context.selectable;return typeof m=="boolean"?m:h}},{key:"render",value:function(){var m,h=this.props,u=h.eventKey,x=h.className,g=h.style,y=h.dragOver,M=h.dragOverGapTop,E=h.dragOverGapBottom,j=h.isLeaf,G=h.isStart,U=h.isEnd,O=h.expanded,X=h.selected,$=h.checked,se=h.halfChecked,ce=h.loading,Pe=h.domRef,Se=h.active,Re=h.onMouseMove,Oe=Object(Q.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Me=this.props.context,be=Me.prefixCls,ue=Me.filterTreeNode,ne=Me.draggable,ve=Me.keyEntities,le=this.isDisabled(),ke=Object(p.f)(Oe),Fe=ve[u]||{},Ie=Fe.level,He=U[U.length-1];return k.createElement("div",Object.assign({ref:Pe,className:_()(x,"".concat(be,"-treenode"),(m={},Object(te.a)(m,"".concat(be,"-treenode-disabled"),le),Object(te.a)(m,"".concat(be,"-treenode-switcher-").concat(O?"open":"close"),!j),Object(te.a)(m,"".concat(be,"-treenode-checkbox-checked"),$),Object(te.a)(m,"".concat(be,"-treenode-checkbox-indeterminate"),se),Object(te.a)(m,"".concat(be,"-treenode-selected"),X),Object(te.a)(m,"".concat(be,"-treenode-loading"),ce),Object(te.a)(m,"".concat(be,"-treenode-active"),Se),Object(te.a)(m,"".concat(be,"-treenode-leaf-last"),He),Object(te.a)(m,"drag-over",!le&&y),Object(te.a)(m,"drag-over-gap-top",!le&&M),Object(te.a)(m,"drag-over-gap-bottom",!le&&E),Object(te.a)(m,"filter-node",ue&&ue(Object(l.b)(this.props))),m)),style:g,onDragEnter:ne?this.onDragEnter:void 0,onDragOver:ne?this.onDragOver:void 0,onDragLeave:ne?this.onDragLeave:void 0,onDrop:ne?this.onDrop:void 0,onDragEnd:ne?this.onDragEnd:void 0,onMouseMove:Re},ke),k.createElement(a,{prefixCls:be,level:Ie,isStart:G,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),C}(k.Component),R=function(w){return k.createElement(v.a.Consumer,null,function(C){return k.createElement(d,Object.assign({},w,{context:C}))})};R.displayName="TreeNode",R.defaultProps={title:s},R.isTreeNode=1;var A=Ne.a=R},Xsq0:function(qe,Ne,K){qe.exports=K.p+"static/mainbanner.0a951716.jpg"},Y1PL:function(qe,Ne,K){"use strict";K.r(Ne),K.d(Ne,"ResizableTextArea",function(){return se});var te=K("wx14"),Q=K("1OyB"),N=K("vuIU"),J=K("Ji7U"),B=K("LK+K"),D=K("q1tI"),H=K("VTBJ"),F=K("rePB"),k=K("Zm9Q"),I=K("Kwbf"),_=K("c+Xe"),v=K("m+aA"),p=K("bdgK"),c=new Map;function a(Se){Se.forEach(function(Re){var Oe,Me=Re.target;(Oe=c.get(Me))===null||Oe===void 0||Oe.forEach(function(be){return be(Me)})})}var l=new p.default(a),o=null,r=null;function s(Se,Re){c.has(Se)||(c.set(Se,new Set),l.observe(Se)),c.get(Se).add(Re)}function d(Se,Re){c.has(Se)&&(c.get(Se).delete(Re),c.get(Se).size||(l.unobserve(Se),c.delete(Se)))}var R=function(Se){Object(J.a)(Oe,Se);var Re=Object(B.a)(Oe);function Oe(){return Object(Q.a)(this,Oe),Re.apply(this,arguments)}return Object(N.a)(Oe,[{key:"render",value:function(){return this.props.children}}]),Oe}(D.Component),A=D.createContext(null);function T(Se){var Re=Se.children,Oe=Se.onBatchResize,Me=D.useRef(0),be=D.useRef([]),ue=D.useContext(A),ne=D.useCallback(function(ve,le,ke){Me.current+=1;var Fe=Me.current;be.current.push({size:ve,element:le,data:ke}),Promise.resolve().then(function(){Fe===Me.current&&(Oe==null||Oe(be.current),be.current=[])}),ue==null||ue(ve,le,ke)},[Oe,ue]);return D.createElement(A.Provider,{value:ne},Re)}function w(Se){var Re=Se.children,Oe=Se.disabled,Me=D.useRef(null),be=D.useRef(null),ue=D.useContext(A),ne=D.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ve=D.isValidElement(Re)&&Object(_.c)(Re),le=ve?Re.ref:null,ke=D.useMemo(function(){return Object(_.a)(le,Me)},[le,Me]),Fe=D.useRef(Se);Fe.current=Se;var Ie=D.useCallback(function(He){var $e=Fe.current,tt=$e.onResize,Qe=$e.data,Je=He.getBoundingClientRect(),Ye=Je.width,gt=Je.height,_t=He.offsetWidth,vt=He.offsetHeight,dt=Math.floor(Ye),Ct=Math.floor(gt);if(ne.current.width!==dt||ne.current.height!==Ct||ne.current.offsetWidth!==_t||ne.current.offsetHeight!==vt){var xt={width:dt,height:Ct,offsetWidth:_t,offsetHeight:vt};ne.current=xt;var Le=_t===Math.round(Ye)?Ye:_t,Ce=vt===Math.round(gt)?gt:vt,nt=Object(H.a)(Object(H.a)({},xt),{},{offsetWidth:Le,offsetHeight:Ce});ue==null||ue(nt,He,Qe),tt&&Promise.resolve().then(function(){tt(nt,He)})}},[]);return D.useEffect(function(){var He=Object(v.a)(Me.current)||Object(v.a)(be.current);return He&&!Oe&&s(He,Ie),function(){return d(He,Ie)}},[Me.current,Oe]),D.createElement(R,{ref:be},ve?D.cloneElement(Re,{ref:ke}):Re)}var C="rc-observer-key";function b(Se){var Re=Se.children,Oe=Object(k.a)(Re);return Oe.map(function(Me,be){var ue=(Me==null?void 0:Me.key)||"".concat(C,"-").concat(be);return D.createElement(w,Object(te.a)({},Se,{key:ue}),Me)})}b.Collection=T;var m=b,h=K("bT9E"),u=K("TSYQ"),x=K.n(u),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
`,y=["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"],M={},E;function j(Se){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=Se.getAttribute("id")||Se.getAttribute("data-reactid")||Se.getAttribute("name");if(Re&&M[Oe])return M[Oe];var Me=window.getComputedStyle(Se),be=Me.getPropertyValue("box-sizing")||Me.getPropertyValue("-moz-box-sizing")||Me.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(Me.getPropertyValue("padding-bottom"))+parseFloat(Me.getPropertyValue("padding-top")),ne=parseFloat(Me.getPropertyValue("border-bottom-width"))+parseFloat(Me.getPropertyValue("border-top-width")),ve=y.map(function(ke){return"".concat(ke,":").concat(Me.getPropertyValue(ke))}).join(";"),le={sizingStyle:ve,paddingSize:ue,borderSize:ne,boxSizing:be};return Re&&Oe&&(M[Oe]=le),le}function G(Se){var Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;E||(E=document.createElement("textarea"),E.setAttribute("tab-index","-1"),E.setAttribute("aria-hidden","true"),document.body.appendChild(E)),Se.getAttribute("wrap")?E.setAttribute("wrap",Se.getAttribute("wrap")):E.removeAttribute("wrap");var be=j(Se,Re),ue=be.paddingSize,ne=be.borderSize,ve=be.boxSizing,le=be.sizingStyle;E.setAttribute("style","".concat(le,";").concat(g)),E.value=Se.value||Se.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,Fe=Number.MAX_SAFE_INTEGER,Ie=E.scrollHeight,He;if(ve==="border-box"?Ie+=ne:ve==="content-box"&&(Ie-=ue),Oe!==null||Me!==null){E.value=" ";var $e=E.scrollHeight-ue;Oe!==null&&(ke=$e*Oe,ve==="border-box"&&(ke=ke+ue+ne),Ie=Math.max(ke,Ie)),Me!==null&&(Fe=$e*Me,ve==="border-box"&&(Fe=Fe+ue+ne),He=Ie>Fe?"":"hidden",Ie=Math.min(Fe,Ie))}return{height:Ie,minHeight:ke,maxHeight:Fe,overflowY:He,resize:"none"}}var U=K("Gytx"),O=K.n(U),X;(function(Se){Se[Se.NONE=0]="NONE",Se[Se.RESIZING=1]="RESIZING",Se[Se.RESIZED=2]="RESIZED"})(X||(X={}));var $=function(Se){Object(J.a)(Oe,Se);var Re=Object(B.a)(Oe);function Oe(Me){var be;return Object(Q.a)(this,Oe),be=Re.call(this,Me),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(ue){be.textArea=ue},be.handleResize=function(ue){var ne=be.state.resizeStatus,ve=be.props,le=ve.autoSize,ke=ve.onResize;if(ne!==X.NONE)return;typeof ke=="function"&&ke(ue),le&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var ue=be.props.autoSize;if(!ue||!be.textArea)return;var ne=ue.minRows,ve=ue.maxRows,le=G(be.textArea,!1,ne,ve);be.setState({textareaStyles:le,resizeStatus:X.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:X.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:X.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var ue=be.props,ne=ue.prefixCls,ve=ne===void 0?"rc-textarea":ne,le=ue.autoSize,ke=ue.onResize,Fe=ue.className,Ie=ue.disabled,He=be.state,$e=He.textareaStyles,tt=He.resizeStatus,Qe=Object(h.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Je=x()(ve,Fe,Object(F.a)({},"".concat(ve,"-disabled"),Ie));"value"in Qe&&(Qe.value=Qe.value||"");var Ye=Object(H.a)(Object(H.a)(Object(H.a)({},be.props.style),$e),tt===X.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return D.createElement(m,{onResize:be.handleResize,disabled:!(le||ke)},D.createElement("textarea",Object(te.a)({},Qe,{className:Je,style:Ye,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:X.NONE},be}return Object(N.a)(Oe,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!O()(be.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 be=this.textArea.selectionStart,ue=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,ue)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Oe}(D.Component),se=$,ce=function(Se){Object(J.a)(Oe,Se);var Re=Object(B.a)(Oe);function Oe(Me){var be;Object(Q.a)(this,Oe),be=Re.call(this,Me),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(ne){be.resizableTextArea=ne},be.handleChange=function(ne){var ve=be.props.onChange;be.setValue(ne.target.value,function(){be.resizableTextArea.resizeTextarea()}),ve&&ve(ne)},be.handleKeyDown=function(ne){var ve=be.props,le=ve.onPressEnter,ke=ve.onKeyDown;ne.keyCode===13&&le&&le(ne),ke&&ke(ne)};var ue=typeof Me.value=="undefined"||Me.value===null?Me.defaultValue:Me.value;return be.state={value:ue},be}return Object(N.a)(Oe,[{key:"setValue",value:function(be,ue){"value"in this.props||this.setState({value:be},ue)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return D.createElement(se,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Oe}(D.Component),Pe=Ne.default=ce},ZW9T:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return G});var te=K("k1fw"),Q=K("miYZ"),N=K("tsqr"),J=K("rAM+"),B=K("tJVT"),D=K("PpiC"),H=K("q1tI"),F=K.n(H),k=K("bdgK"),I=K("oBTY"),_=K("9og8"),v=K("WmNS"),p=K.n(v),c={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"]},l={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","for","friend","gcnew","generic","goto","if","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:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $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 <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},o={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(`
`)}]},r=K("5VLF"),s=K.n(r),d={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"]}},R=function(O,X){return X.map(function($){return{label:$,kind:O.languages.CompletionItemKind.Keyword,insertText:$}})},A=function(O){return Object.keys(d.tables).map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Variable,insertText:X}})},T=function(O,X){var $=d.tables[O];return $?$.map(function(se){return{label:se,kind:X.languages.CompletionItemKind.Field,insertText:se}}):[]};function w(U,O,X,$,se){var ce=O.getWordUntilPosition(X),Pe={startLineNumber:X.lineNumber,endLineNumber:X.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},Se=$.map(function(Re){return{label:Re,kind:U.languages.CompletionItemKind.Keyword,insertText:Re,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Pe}});return se.map(function(Re){Se.push(Object(te.a)(Object(te.a)({},Re),{},{range:Pe}))}),Se}var C=function(U){d.languages.map(function(se){return U.languages.registerDocumentFormattingEditProvider(se,{provideDocumentFormattingEdits:function(Pe,Se,Re){return Object(_.a)(p.a.mark(function Oe(){var Me;return p.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return Me=s()(Pe.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}),ue.abrupt("return",[{range:Pe.getFullModelRange(),text:Me}]);case 2:case"end":return ue.stop()}},Oe)}))()}}),se});var O=l.quickKey.map(function(se){return{label:se.label,kind:U.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=o.quickKey.map(function(se){return{label:se.label,kind:U.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),$=a.quickKey.map(function(se){return{label:se.label,kind:U.languages.CompletionItemKind.Method,insertText:se.content,insertTextRules:U.languages.CompletionItemInsertTextRule.InsertAsSnippet}});U.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(I.a)(l.keywords),Object(I.a)(l.quickKey.map(function(se){return se.label}))),provideCompletionItems:function(ce,Pe){var Se=ce.getValueInRange({startLineNumber:Pe.lineNumber,startColumn:1,endLineNumber:Pe.lineNumber,endColumn:Pe.column}),Re=Se.match(/cu/gim);console.log("match:",Re,Pe,Se,ce);var Oe=[],Me=Pe.lineNumber,be=Pe.column,ue=ce.getValueInRange({startLineNumber:Me,startColumn:0,endLineNumber:Me,endColumn:be}),ne=ue.trim().split(/\s+/),ve=ne[ne.length-1];if(ve.endsWith(".")){var le=ve.slice(0,ve.length-1);Object.keys(d.tables).includes(le)&&(Oe=Object(I.a)(T(le,U)))}else ve==="."?Oe=[]:Oe=[].concat(Object(I.a)(A(U)),Object(I.a)(R(U,l.keywords)),Object(I.a)(O));return{suggestions:Oe}}}),U.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(I.a)(c.keywords)),provideCompletionItems:function(ce,Pe){var Se=ce.getValueInRange({startLineNumber:Pe.lineNumber,startColumn:1,endLineNumber:Pe.lineNumber,endColumn:Pe.column}),Re=Se.match(/cu/gim);console.log("match:",Re,Pe,Se,ce);var Oe=[],Me=Pe.lineNumber,be=Pe.column,ue=ce.getValueInRange({startLineNumber:Me,startColumn:0,endLineNumber:Me,endColumn:be}),ne=ue.trim().split(/\s+/),ve=ne[ne.length-1];if(ve.endsWith(".")){var le=ve.slice(0,ve.length-1);Object.keys(d.tables).includes(le)&&(Oe=Object(I.a)(T(le,U)))}else ve==="."?Oe=[]:Oe=[].concat(Object(I.a)(A(U)),Object(I.a)(R(U,c.keywords)));return{suggestions:Oe}}}),U.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(I.a)(a.keywords)),provideCompletionItems:function(ce,Pe){var Se=[],Re=Pe.lineNumber,Oe=Pe.column,Me=ce.getValueInRange({startLineNumber:Re,startColumn:0,endLineNumber:Re,endColumn:Oe}),be=Me.trim().split(/\s+/),ue=be[be.length-1];if(ue.endsWith(".")){var ne=ue.slice(0,ue.length-1);Object.keys(d.tables).includes(ne)&&(Se=Object(I.a)(T(ne,U)))}else ue==="."?Se=[]:Se=[].concat(Object(I.a)(A(U)),Object(I.a)(R(U,a.keywords)),Object(I.a)($));return{suggestions:Se}}}),U.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(I.a)(o.keywords)),provideCompletionItems:function(ce,Pe){var Se=[],Re=Pe.lineNumber,Oe=Pe.column,Me=ce.getValueInRange({startLineNumber:Re,startColumn:0,endLineNumber:Re,endColumn:Oe}),be=Me.trim().split(/\s+/),ue=be[be.length-1];if(ue.endsWith(".")){var ne=ue.slice(0,ue.length-1);Object.keys(d.tables).includes(ne)&&(Se=Object(I.a)(T(ne,U)))}else ue==="."?Se=[]:Se=[].concat(Object(I.a)(A(U)),Object(I.a)(R(U,o.keywords)),Object(I.a)(X));return{suggestions:Se}}})},b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",m=K("LvDl"),h=K("+ua5");function u(U){return/^\d+$/.test(U)?"".concat(U,"px"):U}function x(){}var g=!1,y={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function M(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],O=U;if(Array.isArray(U)){for(var X=0;X<U.length;X++){var $=y[U[X]];if($)return $}return O[0]}return y[O]||O}var E=null,j=Ne.b=function(U){var O=U.width,X=O===void 0?"100%":O,$=U.height,se=$===void 0?"100%":$,ce=U.value,Pe=U.language,Se=Pe===void 0?"javascript":Pe,Re=U.style,Oe=Re===void 0?{}:Re,Me=U.options,be=Me===void 0?{}:Me,ue=U.overrideServices,ne=ue===void 0?{}:ue,ve=U.theme,le=ve===void 0?"vs-dark":ve,ke=U.onEditBlur,Fe=U.onSave,Ie=U.autoHeight,He=Ie===void 0?!1:Ie,$e=U.forbidCopy,tt=$e===void 0?!1:$e,Qe=U.onChange,Je=Qe===void 0?x:Qe,Ye=U.editorDidMount,gt=Ye===void 0?x:Ye,_t=U.onFocus,vt=_t===void 0?x:_t,dt=U.filename,Ct=dt===void 0?"educoder.txt":dt,xt=U.errorLine,Le=U.errorContent,Ce=Le===void 0?"":Le,nt=Object(D.a)(U,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),rt=Object(H.useRef)(),Be=Object(H.useRef)({}),et=Object(H.useRef)(),xe=Object(H.useRef)(!1),fe=Object(H.useRef)(),ge=Object(H.useState)(!1),re=Object(B.a)(ge,2),ae=re[0],de=re[1];function ye(){var Te;return rt.current&&(Te=new k.default(function(Ke){var st=Object(J.a)(Ke),ft;try{for(st.s();!(ft=st.n()).done;){var Tt=ft.value;(Tt.target.offsetHeight>0||Tt.target.offsetWidth>0)&&Be.current.instance.layout()}}catch(Jt){st.e(Jt)}finally{st.f()}}),Te.observe(rt.current)),Te}function _e(){N.b.warn(decodeURIComponent(b))}var je=function(){var Ke=Be.current.instance;if(ce!=null&&Ke&&ae){var st=Ke.getModel();st&&ce!==st.getValue()&&(g=!0,st.setValue(ce),Ke.layout(),g=!1)}};Object(H.useEffect)(function(){et.current&&clearTimeout(et.current),et.current=setTimeout(function(){je()},500)},[ce,ae,Be.current]),Object(H.useEffect)(function(){if(xt&&Be.current&&Be.current.instance){var Te=Be.current.instance;Te.changeViewZones(function(st){var ft=document.createElement("div");ft.style.padding="10px 20px",ft.style.width="calc(100% - 20px)",ft.className="my-error-line-wrp",ft.innerHTML=Ce,st.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:ft})});var Ke={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}};Te.addOverlayWidget(Ke),Te.revealPositionInCenter({lineNumber:20,column:1})}},[xt,Be.current,ae]);function ot(){var Te=Be.current.instance;if(Te){var Ke=Te.getSelection(),st=Be.current.pastePos||{},ft=new E.Range(st.startLineNumber||Ke.endLineNumber,st.startColumn||Ke.endColumn,st.endLineNumber||Ke.endLineNumber,st.endColumn||Ke.endColumn);setTimeout(function(){Te.executeEdits("",[{range:ft,text:""}])},300)}}function bt(Te){(window.navigator.platform.match("Mac")?Te.metaKey:Te.ctrlKey)&&Te.keyCode==83&&(Te.preventDefault(),Fe())}var wt=function(){if(He&&Be.current.instance){var Ke=Be.current.instance.getContentHeight();ze(Ke<se?se:Ke)}else ze(se)};function Et(Te){var Ke=document.createEvent("MouseEvents");Ke.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Te.dispatchEvent(Ke)}function pt(Te,Ke){var st=window.URL||window.webkitURL||window,ft=new Blob([Ke]),Tt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Tt.href=st.createObjectURL(ft),Tt.download=Te,Et(Tt)}Object(H.useEffect)(function(){wt()},[wt]),Object(H.useEffect)(function(){rt.current&&!ae&&K.e(27).then(K.t.bind(null,"M/lh",7)).then(function(Te){try{E=Te,Be.current.instance=E.editor.create(rt.current,{value:ce,language:M(Se),theme:le,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},ne);var Ke=Be.current.instance;if(gt(Ke,E),setTimeout(function(){wt(),Be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){pt(Ct||"educoder.txt",Ke.getValue())}})},500),Be.current.subscription=Ke.onDidChangeModelContent(function(ft){xe.current?clearTimeout(fe.current):(wt(),Je(Ke.getValue(),ft)),fe.current=setTimeout(function(){xe.current=!1},500)}),window.Monaco||C(E),tt&&(Ke.addCommand(E.KeyMod.CtrlCmd|E.KeyMod.Shift|E.KeyCode.KEY_V,function(){return _e(),null}),Ke.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KEY_C,function(){return _e(),null})),window.Monaco=E,ke&&Ke.onDidBlurEditorWidget(function(){ke(Ke.getValue())}),vt&&Ke.onDidFocusEditorText(function(){vt(Ke.getValue())}),tt){Ke.addCommand(E.KeyMod.CtrlCmd|E.KeyCode.KEY_V,function(){return _e(),null}),Ke.onDidPaste(function(ft){Be.current.pastePos=ft});try{window.addEventListener("paste",ot)}catch(ft){}}var st=ye();return de(!0),function(){var ft=Be.current.instance;ft.dispose();var Tt=ft.getModel();Tt&&Tt.dispose(),Be.current.subscription&&Be.current.subscription.dispose(),tt&&window.removeEventListener("paste",ot),st.unobserve(rt.current)}}catch(ft){}})},[]),Object(H.useEffect)(function(){var Te=Be.current.instance;if(Te&&ae)return document.addEventListener("keydown",bt,!1),function(){document.removeEventListener("keydown",bt)}},[Fe,ae]),Object(H.useEffect)(function(){var Te=Be.current.instance;if(Te&&ae){var Ke=M(Se);E.editor.setModelLanguage(Te.getModel(),Ke),console.log("language:",Se,Te.getModel(),Ke)}},[Se,ae]),Object(H.useEffect)(function(){var Te=Be.current.instance;Te&&ae&&E.editor.setTheme(le)},[le,ae]),Object(H.useEffect)(function(){var Te=Be.current.instance;Te&&ae&&(Te.updateOptions(Object(te.a)({},be)),setTimeout(function(){Te.getModel().updateOptions(Object(te.a)({},be))},200))},[JSON.stringify(be),ae]),Object(H.useEffect)(function(){var Te=Be.current.instance;Te&&ae&&Te.layout()},[X,se,ae]);var Xe=Object(H.useState)(u(X)),Ge=Object(B.a)(Xe,2),De=Ge[0],oe=Ge[1],he=Object(H.useState)(u(se)),Ze=Object(B.a)(he,2),Ue=Ze[0],ze=Ze[1],ct=Object(te.a)(Object(te.a)({},Oe),{},{width:De,height:Ue});return F.a.createElement("div",{className:"my-monaco-editor",ref:rt,style:ct})};function G(U){var O=U.width,X=O===void 0?"100%":O,$=U.height,se=$===void 0?"100%":$,ce=U.original,Pe=U.modified,Se=U.language,Re=U.options,Oe=Re===void 0?{}:Re,Me=Object(H.useRef)(),be=Object(H.useState)(null),ue=Object(B.a)(be,2),ne=ue[0],ve=ue[1];function le(He){var $e;return Me.current&&($e=new k.default(function(tt){var Qe=Object(J.a)(tt),Je;try{for(Qe.s();!(Je=Qe.n()).done;){var Ye=Je.value;(Ye.target.offsetHeight>0||Ye.target.offsetWidth>0)&&He.layout()}}catch(gt){Qe.e(gt)}finally{Qe.f()}}),$e.observe(Me.current)),$e}Object(H.useEffect)(function(){Me.current&&K.e(27).then(K.t.bind(null,"M/lh",7)).then(function(He){E=He;var $e=E.editor.createDiffEditor(Me.current,Object(te.a)(Object(te.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},Oe),{},{wordWrap:!0}));ve($e);var tt=le($e);return function(){$e.dispose();var Qe=$e.getModel();Qe&&Qe.dispose(),tt.unobserve(Me.current)}})},[]),Object(H.useEffect)(function(){ne&&ne.setModel({original:E.editor.createModel(ce,Se),modified:E.editor.createModel(Pe,Se)})},[ce,Pe,Se,ne]);var ke=u(X),Fe=u(se),Ie={width:ke,height:Fe};return F.a.createElement("div",{className:"my-diff-editor",ref:Me,style:Ie})}},ZpRC:function(qe,Ne,K){"use strict";function te(_){return typeof _=="object"&&_!=null&&_.nodeType===1}function Q(_,v){return(!v||_!=="hidden")&&_!=="visible"&&_!=="clip"}function N(_,v){if(_.clientHeight<_.scrollHeight||_.clientWidth<_.scrollWidth){var p=getComputedStyle(_,null);return Q(p.overflowY,v)||Q(p.overflowX,v)||function(c){var a=function(l){if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch(o){return null}}(c);return!!a&&(a.clientHeight<c.scrollHeight||a.clientWidth<c.scrollWidth)}(_)}return!1}function J(_,v,p,c,a,l,o,r){return l<_&&o>v||l>_&&o<v?0:l<=_&&r<=p||o>=v&&r>=p?l-_-c:o>v&&r<p||l<_&&r>p?o-v+a:0}var B=function(_,v){var p=window,c=v.scrollMode,a=v.block,l=v.inline,o=v.boundary,r=v.skipOverflowHiddenElements,s=typeof o=="function"?o:function($e){return $e!==o};if(!te(_))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,R=[],A=_;te(A)&&s(A);){if((A=A.parentElement)===d){R.push(A);break}A!=null&&A===document.body&&N(A)&&!N(document.documentElement)||A!=null&&N(A,r)&&R.push(A)}for(var T=p.visualViewport?p.visualViewport.width:innerWidth,w=p.visualViewport?p.visualViewport.height:innerHeight,C=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,m=_.getBoundingClientRect(),h=m.height,u=m.width,x=m.top,g=m.right,y=m.bottom,M=m.left,E=a==="start"||a==="nearest"?x:a==="end"?y:x+h/2,j=l==="center"?M+u/2:l==="end"?g:M,G=[],U=0;U<R.length;U++){var O=R[U],X=O.getBoundingClientRect(),$=X.height,se=X.width,ce=X.top,Pe=X.right,Se=X.bottom,Re=X.left;if(c==="if-needed"&&x>=0&&M>=0&&y<=w&&g<=T&&x>=ce&&y<=Se&&M>=Re&&g<=Pe)return G;var Oe=getComputedStyle(O),Me=parseInt(Oe.borderLeftWidth,10),be=parseInt(Oe.borderTopWidth,10),ue=parseInt(Oe.borderRightWidth,10),ne=parseInt(Oe.borderBottomWidth,10),ve=0,le=0,ke="offsetWidth"in O?O.offsetWidth-O.clientWidth-Me-ue:0,Fe="offsetHeight"in O?O.offsetHeight-O.clientHeight-be-ne:0;if(d===O)ve=a==="start"?E:a==="end"?E-w:a==="nearest"?J(b,b+w,w,be,ne,b+E,b+E+h,h):E-w/2,le=l==="start"?j:l==="center"?j-T/2:l==="end"?j-T:J(C,C+T,T,Me,ue,C+j,C+j+u,u),ve=Math.max(0,ve+b),le=Math.max(0,le+C);else{ve=a==="start"?E-ce-be:a==="end"?E-Se+ne+Fe:a==="nearest"?J(ce,Se,$,be,ne+Fe,E,E+h,h):E-(ce+$/2)+Fe/2,le=l==="start"?j-Re-Me:l==="center"?j-(Re+se/2)+ke/2:l==="end"?j-Pe+ue+ke:J(Re,Pe,se,Me,ue+ke,j,j+u,u);var Ie=O.scrollLeft,He=O.scrollTop;E+=He-(ve=Math.max(0,Math.min(He+ve,O.scrollHeight-$+Fe))),j+=Ie-(le=Math.max(0,Math.min(Ie+le,O.scrollWidth-se+ke)))}G.push({el:O,top:ve,left:le})}return G};function D(_){return _===Object(_)&&Object.keys(_).length!==0}function H(_,v){v===void 0&&(v="auto");var p="scrollBehavior"in document.body.style;_.forEach(function(c){var a=c.el,l=c.top,o=c.left;a.scroll&&p?a.scroll({top:l,left:o,behavior:v}):(a.scrollTop=l,a.scrollLeft=o)})}function F(_){return _===!1?{block:"end",inline:"nearest"}:D(_)?_:{block:"start",inline:"nearest"}}function k(_,v){var p=!_.ownerDocument.documentElement.contains(_);if(D(v)&&typeof v.behavior=="function")return v.behavior(p?[]:B(_,v));if(p)return;var c=F(v);return H(B(_,c),c.behavior)}var I=Ne.a=k},Zss7:function(qe,Ne,K){var te;(function(Q){var N=/^\s+/,J=/\s+$/,B=0,D=Q.round,H=Q.min,F=Q.max,k=Q.random;function I(ne,ve){if(ne=ne||"",ve=ve||{},ne instanceof I)return ne;if(!(this instanceof I))return new I(ne,ve);var le=_(ne);this._originalInput=ne,this._r=le.r,this._g=le.g,this._b=le.b,this._a=le.a,this._roundA=D(100*this._a)/100,this._format=ve.format||le.format,this._gradientType=ve.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=le.ok,this._tc_id=B++}I.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),ve,le,ke,Fe,Ie,He;return ve=ne.r/255,le=ne.g/255,ke=ne.b/255,ve<=.03928?Fe=ve/12.92:Fe=Q.pow((ve+.055)/1.055,2.4),le<=.03928?Ie=le/12.92:Ie=Q.pow((le+.055)/1.055,2.4),ke<=.03928?He=ke/12.92:He=Q.pow((ke+.055)/1.055,2.4),.2126*Fe+.7152*Ie+.0722*He},setAlpha:function(ne){return this._a=G(ne),this._roundA=D(100*this._a)/100,this},toHsv:function(){var ne=a(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=a(this._r,this._g,this._b),ve=D(ne.h*360),le=D(ne.s*100),ke=D(ne.v*100);return this._a==1?"hsv("+ve+", "+le+"%, "+ke+"%)":"hsva("+ve+", "+le+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var ne=p(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=p(this._r,this._g,this._b),ve=D(ne.h*360),le=D(ne.s*100),ke=D(ne.l*100);return this._a==1?"hsl("+ve+", "+le+"%, "+ke+"%)":"hsla("+ve+", "+le+"%, "+ke+"%, "+this._roundA+")"},toHex:function(ne){return o(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return r(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(U(this._r,255)*100)+"%",g:D(U(this._g,255)*100)+"%",b:D(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+D(U(this._r,255)*100)+"%, "+D(U(this._g,255)*100)+"%, "+D(U(this._b,255)*100)+"%)":"rgba("+D(U(this._r,255)*100)+"%, "+D(U(this._g,255)*100)+"%, "+D(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:E[o(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var ve="#"+s(this._r,this._g,this._b,this._a),le=ve,ke=this._gradientType?"GradientType = 1, ":"";if(ne){var Fe=I(ne);le="#"+s(Fe._r,Fe._g,Fe._b,Fe._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+ve+",endColorstr="+le+")"},toString:function(ne){var ve=!!ne;ne=ne||this._format;var le=!1,ke=this._a<1&&this._a>=0,Fe=!ve&&ke&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return Fe?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(le=this.toRgbString()),ne==="prgb"&&(le=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(le=this.toHexString()),ne==="hex3"&&(le=this.toHexString(!0)),ne==="hex4"&&(le=this.toHex8String(!0)),ne==="hex8"&&(le=this.toHex8String()),ne==="name"&&(le=this.toName()),ne==="hsl"&&(le=this.toHslString()),ne==="hsv"&&(le=this.toHsvString()),le||this.toHexString())},clone:function(){return I(this.toString())},_applyModification:function(ne,ve){var le=ne.apply(null,[this].concat([].slice.call(ve)));return this._r=le._r,this._g=le._g,this._b=le._b,this.setAlpha(le._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(C,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(A,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(ne,ve){return ne.apply(null,[this].concat([].slice.call(ve)))},analogous:function(){return this._applyCombination(g,arguments)},complement:function(){return this._applyCombination(m,arguments)},monochromatic:function(){return this._applyCombination(y,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(h,arguments)},tetrad:function(){return this._applyCombination(u,arguments)}},I.fromRatio=function(ne,ve){if(typeof ne=="object"){var le={};for(var ke in ne)ne.hasOwnProperty(ke)&&(ke==="a"?le[ke]=ne[ke]:le[ke]=Pe(ne[ke]));ne=le}return I(ne,ve)};function _(ne){var ve={r:0,g:0,b:0},le=1,ke=null,Fe=null,Ie=null,He=!1,$e=!1;return typeof ne=="string"&&(ne=be(ne)),typeof ne=="object"&&(Me(ne.r)&&Me(ne.g)&&Me(ne.b)?(ve=v(ne.r,ne.g,ne.b),He=!0,$e=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):Me(ne.h)&&Me(ne.s)&&Me(ne.v)?(ke=Pe(ne.s),Fe=Pe(ne.v),ve=l(ne.h,ke,Fe),He=!0,$e="hsv"):Me(ne.h)&&Me(ne.s)&&Me(ne.l)&&(ke=Pe(ne.s),Ie=Pe(ne.l),ve=c(ne.h,ke,Ie),He=!0,$e="hsl"),ne.hasOwnProperty("a")&&(le=ne.a)),le=G(le),{ok:He,format:ne.format||$e,r:H(255,F(ve.r,0)),g:H(255,F(ve.g,0)),b:H(255,F(ve.b,0)),a:le}}function v(ne,ve,le){return{r:U(ne,255)*255,g:U(ve,255)*255,b:U(le,255)*255}}function p(ne,ve,le){ne=U(ne,255),ve=U(ve,255),le=U(le,255);var ke=F(ne,ve,le),Fe=H(ne,ve,le),Ie,He,$e=(ke+Fe)/2;if(ke==Fe)Ie=He=0;else{var tt=ke-Fe;He=$e>.5?tt/(2-ke-Fe):tt/(ke+Fe);switch(ke){case ne:Ie=(ve-le)/tt+(ve<le?6:0);break;case ve:Ie=(le-ne)/tt+2;break;case le:Ie=(ne-ve)/tt+4;break}Ie/=6}return{h:Ie,s:He,l:$e}}function c(ne,ve,le){var ke,Fe,Ie;ne=U(ne,360),ve=U(ve,100),le=U(le,100);function He(Qe,Je,Ye){return Ye<0&&(Ye+=1),Ye>1&&(Ye-=1),Ye<1/6?Qe+(Je-Qe)*6*Ye:Ye<1/2?Je:Ye<2/3?Qe+(Je-Qe)*(2/3-Ye)*6:Qe}if(ve===0)ke=Fe=Ie=le;else{var $e=le<.5?le*(1+ve):le+ve-le*ve,tt=2*le-$e;ke=He(tt,$e,ne+1/3),Fe=He(tt,$e,ne),Ie=He(tt,$e,ne-1/3)}return{r:ke*255,g:Fe*255,b:Ie*255}}function a(ne,ve,le){ne=U(ne,255),ve=U(ve,255),le=U(le,255);var ke=F(ne,ve,le),Fe=H(ne,ve,le),Ie,He,$e=ke,tt=ke-Fe;if(He=ke===0?0:tt/ke,ke==Fe)Ie=0;else{switch(ke){case ne:Ie=(ve-le)/tt+(ve<le?6:0);break;case ve:Ie=(le-ne)/tt+2;break;case le:Ie=(ne-ve)/tt+4;break}Ie/=6}return{h:Ie,s:He,v:$e}}function l(ne,ve,le){ne=U(ne,360)*6,ve=U(ve,100),le=U(le,100);var ke=Q.floor(ne),Fe=ne-ke,Ie=le*(1-ve),He=le*(1-Fe*ve),$e=le*(1-(1-Fe)*ve),tt=ke%6,Qe=[le,He,Ie,Ie,$e,le][tt],Je=[$e,le,le,He,Ie,Ie][tt],Ye=[Ie,Ie,$e,le,le,He][tt];return{r:Qe*255,g:Je*255,b:Ye*255}}function o(ne,ve,le,ke){var Fe=[ce(D(ne).toString(16)),ce(D(ve).toString(16)),ce(D(le).toString(16))];return ke&&Fe[0].charAt(0)==Fe[0].charAt(1)&&Fe[1].charAt(0)==Fe[1].charAt(1)&&Fe[2].charAt(0)==Fe[2].charAt(1)?Fe[0].charAt(0)+Fe[1].charAt(0)+Fe[2].charAt(0):Fe.join("")}function r(ne,ve,le,ke,Fe){var Ie=[ce(D(ne).toString(16)),ce(D(ve).toString(16)),ce(D(le).toString(16)),ce(Se(ke))];return Fe&&Ie[0].charAt(0)==Ie[0].charAt(1)&&Ie[1].charAt(0)==Ie[1].charAt(1)&&Ie[2].charAt(0)==Ie[2].charAt(1)&&Ie[3].charAt(0)==Ie[3].charAt(1)?Ie[0].charAt(0)+Ie[1].charAt(0)+Ie[2].charAt(0)+Ie[3].charAt(0):Ie.join("")}function s(ne,ve,le,ke){var Fe=[ce(Se(ke)),ce(D(ne).toString(16)),ce(D(ve).toString(16)),ce(D(le).toString(16))];return Fe.join("")}I.equals=function(ne,ve){return!ne||!ve?!1:I(ne).toRgbString()==I(ve).toRgbString()},I.random=function(){return I.fromRatio({r:k(),g:k(),b:k()})};function d(ne,ve){ve=ve===0?0:ve||10;var le=I(ne).toHsl();return le.s-=ve/100,le.s=O(le.s),I(le)}function R(ne,ve){ve=ve===0?0:ve||10;var le=I(ne).toHsl();return le.s+=ve/100,le.s=O(le.s),I(le)}function A(ne){return I(ne).desaturate(100)}function T(ne,ve){ve=ve===0?0:ve||10;var le=I(ne).toHsl();return le.l+=ve/100,le.l=O(le.l),I(le)}function w(ne,ve){ve=ve===0?0:ve||10;var le=I(ne).toRgb();return le.r=F(0,H(255,le.r-D(255*-(ve/100)))),le.g=F(0,H(255,le.g-D(255*-(ve/100)))),le.b=F(0,H(255,le.b-D(255*-(ve/100)))),I(le)}function C(ne,ve){ve=ve===0?0:ve||10;var le=I(ne).toHsl();return le.l-=ve/100,le.l=O(le.l),I(le)}function b(ne,ve){var le=I(ne).toHsl(),ke=(le.h+ve)%360;return le.h=ke<0?360+ke:ke,I(le)}function m(ne){var ve=I(ne).toHsl();return ve.h=(ve.h+180)%360,I(ve)}function h(ne){var ve=I(ne).toHsl(),le=ve.h;return[I(ne),I({h:(le+120)%360,s:ve.s,l:ve.l}),I({h:(le+240)%360,s:ve.s,l:ve.l})]}function u(ne){var ve=I(ne).toHsl(),le=ve.h;return[I(ne),I({h:(le+90)%360,s:ve.s,l:ve.l}),I({h:(le+180)%360,s:ve.s,l:ve.l}),I({h:(le+270)%360,s:ve.s,l:ve.l})]}function x(ne){var ve=I(ne).toHsl(),le=ve.h;return[I(ne),I({h:(le+72)%360,s:ve.s,l:ve.l}),I({h:(le+216)%360,s:ve.s,l:ve.l})]}function g(ne,ve,le){ve=ve||6,le=le||30;var ke=I(ne).toHsl(),Fe=360/le,Ie=[I(ne)];for(ke.h=(ke.h-(Fe*ve>>1)+720)%360;--ve;)ke.h=(ke.h+Fe)%360,Ie.push(I(ke));return Ie}function y(ne,ve){ve=ve||6;for(var le=I(ne).toHsv(),ke=le.h,Fe=le.s,Ie=le.v,He=[],$e=1/ve;ve--;)He.push(I({h:ke,s:Fe,v:Ie})),Ie=(Ie+$e)%1;return He}I.mix=function(ne,ve,le){le=le===0?0:le||50;var ke=I(ne).toRgb(),Fe=I(ve).toRgb(),Ie=le/100,He={r:(Fe.r-ke.r)*Ie+ke.r,g:(Fe.g-ke.g)*Ie+ke.g,b:(Fe.b-ke.b)*Ie+ke.b,a:(Fe.a-ke.a)*Ie+ke.a};return I(He)},I.readability=function(ne,ve){var le=I(ne),ke=I(ve);return(Q.max(le.getLuminance(),ke.getLuminance())+.05)/(Q.min(le.getLuminance(),ke.getLuminance())+.05)},I.isReadable=function(ne,ve,le){var ke=I.readability(ne,ve),Fe,Ie;Ie=!1,Fe=ue(le);switch(Fe.level+Fe.size){case"AAsmall":case"AAAlarge":Ie=ke>=4.5;break;case"AAlarge":Ie=ke>=3;break;case"AAAsmall":Ie=ke>=7;break}return Ie},I.mostReadable=function(ne,ve,le){var ke=null,Fe=0,Ie,He,$e,tt;le=le||{},He=le.includeFallbackColors,$e=le.level,tt=le.size;for(var Qe=0;Qe<ve.length;Qe++)Ie=I.readability(ne,ve[Qe]),Ie>Fe&&(Fe=Ie,ke=I(ve[Qe]));return I.isReadable(ne,ke,{level:$e,size:tt})||!He?ke:(le.includeFallbackColors=!1,I.mostReadable(ne,["#fff","#000"],le))};var M=I.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=I.hexNames=j(M);function j(ne){var ve={};for(var le in ne)ne.hasOwnProperty(le)&&(ve[ne[le]]=le);return ve}function G(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function U(ne,ve){$(ne)&&(ne="100%");var le=se(ne);return ne=H(ve,F(0,parseFloat(ne))),le&&(ne=parseInt(ne*ve,10)/100),Q.abs(ne-ve)<1e-6?1:ne%ve/parseFloat(ve)}function O(ne){return H(1,F(0,ne))}function X(ne){return parseInt(ne,16)}function $(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function se(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function ce(ne){return ne.length==1?"0"+ne:""+ne}function Pe(ne){return ne<=1&&(ne=ne*100+"%"),ne}function Se(ne){return Q.round(parseFloat(ne)*255).toString(16)}function Re(ne){return X(ne)/255}var Oe=function(){var ne="[-\\+]?\\d+%?",ve="[-\\+]?\\d*\\.\\d+%?",le="(?:"+ve+")|(?:"+ne+")",ke="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?",Fe="[\\s|\\(]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")[,|\\s]+("+le+")\\s*\\)?";return{CSS_UNIT:new RegExp(le),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+Fe),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+Fe),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+Fe),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Me(ne){return!!Oe.CSS_UNIT.exec(ne)}function be(ne){ne=ne.replace(N,"").replace(J,"").toLowerCase();var ve=!1;if(M[ne])ne=M[ne],ve=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var le;return(le=Oe.rgb.exec(ne))?{r:le[1],g:le[2],b:le[3]}:(le=Oe.rgba.exec(ne))?{r:le[1],g:le[2],b:le[3],a:le[4]}:(le=Oe.hsl.exec(ne))?{h:le[1],s:le[2],l:le[3]}:(le=Oe.hsla.exec(ne))?{h:le[1],s:le[2],l:le[3],a:le[4]}:(le=Oe.hsv.exec(ne))?{h:le[1],s:le[2],v:le[3]}:(le=Oe.hsva.exec(ne))?{h:le[1],s:le[2],v:le[3],a:le[4]}:(le=Oe.hex8.exec(ne))?{r:X(le[1]),g:X(le[2]),b:X(le[3]),a:Re(le[4]),format:ve?"name":"hex8"}:(le=Oe.hex6.exec(ne))?{r:X(le[1]),g:X(le[2]),b:X(le[3]),format:ve?"name":"hex"}:(le=Oe.hex4.exec(ne))?{r:X(le[1]+""+le[1]),g:X(le[2]+""+le[2]),b:X(le[3]+""+le[3]),a:Re(le[4]+""+le[4]),format:ve?"name":"hex8"}:(le=Oe.hex3.exec(ne))?{r:X(le[1]+""+le[1]),g:X(le[2]+""+le[2]),b:X(le[3]+""+le[3]),format:ve?"name":"hex"}:!1}function ue(ne){var ve,le;return ne=ne||{level:"AA",size:"small"},ve=(ne.level||"AA").toUpperCase(),le=(ne.size||"small").toLowerCase(),ve!=="AA"&&ve!=="AAA"&&(ve="AA"),le!=="small"&&le!=="large"&&(le="small"),{level:ve,size:le}}qe.exports?qe.exports=I:!(te=function(){return I}.call(Ne,K,Ne,qe),te!==void 0&&(qe.exports=te))})(Math)},bPs0:function(qe,Ne,K){"use strict";K.d(Ne,"b",function(){return d});var te=K("k1fw"),Q=K("9og8"),N=K("2qtc"),J=K("kLXV"),B=K("tJVT"),D=K("PpiC"),H=K("aHsQ"),F=K("sGsY"),k=K("WmNS"),I=K.n(k),_=K("q1tI"),v=K.n(_),p=K("bntm"),c=K("V0Rq"),a=K("wd/R"),l=K.n(a),o=K("Ty5D"),r=K("9kvl"),s=F.a.Countdown,d=["fullscreenchange","msfullscreenchange","webkitfullscreenchange","mozfullscreenchange"],R=function(T){var w=T.globalSetting,C=T.loading,b=T.user,m=T.exercise,h=T.socket,u=T.dispatch,x=Object(D.a)(T,["globalSetting","loading","user","exercise","socket","dispatch"]),g=Object(_.useState)({}),y=Object(B.a)(g,2),M=y[0],E=y[1],j=J.a.useModal(),G=Object(B.a)(j,2),U=G[0],O=G[1],X=Object(_.useRef)(),$=Object(_.useRef)(null),se=Object(_.useRef)(null),ce=Object(_.useState)(!0),Pe=Object(B.a)(ce,2),Se=Pe[0],Re=Pe[1],Oe=Object(o.h)().query,Me=Object(o.i)();Object(_.useEffect)(function(){var tt,Qe,Je,Ye,gt;if(clearTimeout($.current),document.addEventListener(Object(p.c)(),$e,!1),window.addEventListener("blur",Ie,!1),(tt=m.exerciseUserInfo)!==null&&tt!==void 0&&tt.screen_open&&Object(p.a)()&&(u({type:"globalSetting/headerFooterToggle",payload:!1}),Re(!1)),(Qe=m.exerciseUserInfo)!==null&&Qe!==void 0&&Qe.screen_at&&l()().diff(l()((Je=m.exerciseUserInfo)===null||Je===void 0?void 0:Je.screen_at),"seconds")>0)be();else if((Ye=m.exerciseUserInfo)!==null&&Ye!==void 0&&Ye.screen_open&&!Object(p.a)()){var _t=document.domain==="kepukehuan.educoder.net"?30:m.exerciseUserInfo.screen_sec+10+1;X.current=J.a.info({icon:null,content:v.a.createElement("div",{className:"tc font16"},"\u672C\u573A\u8003\u8BD5\u5DF2\u5F00\u542F\u9632\u5207\u5C4F\u9650\u5236\uFF0C",v.a.createElement("br",null),"\u5207\u6362\u9875\u9762 ",m.exerciseUserInfo.screen_num-m.exerciseUserInfo.used_screen_num," \u6B21\u540E\u5C06\u8FDB\u884C\u5F3A\u5236\u4EA4\u5377\uFF0C",v.a.createElement("br",null),"\u8BF7\u52FF\u5207\u5C4F\u53CA\u5237\u65B0\u9875\u9762"),okText:v.a.createElement("span",null,"\u5F00\u59CB\u8003\u8BD5\uFF08",v.a.createElement("span",{style:{display:"inline-block"}},v.a.createElement(s,{onFinish:function(){var dt;be(),(dt=X.current)===null||dt===void 0||dt.destroy()},valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+_t*1e3})),"S\uFF09"),onOk:function(){var dt;(dt=X.current)===null||dt===void 0||dt.destroy(),Re(!1),Object(p.d)(document.body),document.getElementById("root").addEventListener("click",ue,!1)}})}return(gt=m.exerciseUserInfo)!==null&&gt!==void 0&&gt.screen_open&&!Object(p.a)()||document.getElementById("root").addEventListener("click",ue,!1),function(){document.getElementById("root").removeEventListener("click",ue,!1),document.removeEventListener(Object(p.c)(),$e,!1),window.removeEventListener("blur",Ie,!1),clearTimeout($.current)}},[]),Object(_.useEffect)(function(){setTimeout(function(){m.actionTabs.removeEventListenerExitScreen&&(clearTimeout($.current),document.getElementById("root").removeEventListener("click",ue,!1),document.removeEventListener(Object(p.c)(),$e,!1))},500),ne()},[m.actionTabs]),Object(_.useEffect)(function(){setTimeout(function(){m.exerciseUserInfo.used_screen_num>m.exerciseUserInfo.screen_num?ke():!Se},500)},[m.exerciseUserInfo]);var be=function(){var tt=Object(Q.a)(I.a.mark(function Qe(){var Je;return I.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,He();case 2:Je=gt.sent,setTimeout(function(){var _t,vt;(_t=X.current)===null||_t===void 0||_t.destroy(),X.current=J.a.info({okText:v.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:v.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",v.a.createElement("span",{className:"c-red"},Je.used_screen_num),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",v.a.createElement("span",{className:"c-red"},(vt=m.exerciseUserInfo)===null||vt===void 0?void 0:vt.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377"),onOk:function(){var dt=Object(Q.a)(I.a.mark(function xt(){return I.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:Object(p.d)(document.body);case 1:case"end":return Ce.stop()}},xt)}));function Ct(){return dt.apply(this,arguments)}return Ct}()})},1e3);case 4:case"end":return gt.stop()}},Qe)}));return function(){return tt.apply(this,arguments)}}(),ue=function(Qe){!Object(p.a)()&&Qe.target.nodeName!=="A"&&Qe.target.nodeName!=="BUTTON"&&Qe.target.innerHTML!=="\u786E \u5B9A"&&(Object(p.d)(document.body),console.log("documentClick.full"))},ne=function(){var tt=Object(Q.a)(I.a.mark(function Qe(){return I.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.abrupt("return",new Promise(function(){var gt=Object(Q.a)(I.a.mark(function _t(vt){var dt;return I.a.wrap(function(xt){for(;;)switch(xt.prev=xt.next){case 0:return xt.next=2,u({type:"exercise/getExerciseUserInfo",payload:Object(te.a)({},Me)});case 2:return dt=xt.sent,vt(dt==null?void 0:dt.data),xt.abrupt("return",dt==null?void 0:dt.data);case 5:case"end":return xt.stop()}},_t)}));return function(_t){return gt.apply(this,arguments)}}()));case 1:case"end":return Ye.stop()}},Qe)}));return function(){return tt.apply(this,arguments)}}(),ve=function(){var tt=Object(Q.a)(I.a.mark(function Qe(Je){var Ye,gt,_t;return I.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:(Ye=X.current)===null||Ye===void 0||((gt=Ye.destroyAll)===null||gt===void 0)||gt.call(Ye),X.current=J.a.info({maskClosable:!1,keyboard:!1,okText:v.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5\uFF08",v.a.createElement("span",{style:{display:"inline-block"}},v.a.createElement(s,{onFinish:He,valueStyle:{fontSize:14,lineHeight:1.4,color:"#FFF",display:"inline-block"},format:"ss",value:Date.now()+(m.exerciseUserInfo.screen_sec+1)*1e3})),"S\uFF09"),content:v.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",v.a.createElement("span",{className:"c-red"},Je),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",v.a.createElement("span",{className:"c-red"},(_t=m.exerciseUserInfo)===null||_t===void 0?void 0:_t.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377,",v.a.createElement("span",{className:"c-red"},m.exerciseUserInfo.screen_sec),"\u79D2\u5185\u56DE\u5230",v.a.createElement("br",null),v.a.createElement("span",{style:{marginLeft:38}},"\u8003\u8BD5\u4E0D\u8BA1\u5207\u5C4F\u6B21\u6570\u3002")),onOk:function(){var Ct=Object(Q.a)(I.a.mark(function Le(){return I.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:clearTimeout(se.current),Object(p.d)(document.body),X.current.destroy();case 3:case"end":return nt.stop()}},Le)}));function xt(){return Ct.apply(this,arguments)}return xt}()}),se.current=setTimeout(function(){var Ct;X.current.update({okText:v.a.createElement("span",null,"\u56DE\u5230\u8003\u8BD5"),content:v.a.createElement("div",null,"\u60A8\u5DF2\u5207\u5C4F",v.a.createElement("span",{className:"c-red"},Je+1),"\u6B21\uFF0C\u5207\u5C4F\u8D85\u8FC7",v.a.createElement("span",{className:"c-red"},(Ct=m.exerciseUserInfo)===null||Ct===void 0?void 0:Ct.screen_num),"\u6B21\u5C06\u5F3A\u5236\u4EA4\u5377")})},(m.exerciseUserInfo.screen_sec+1)*1e3);case 3:case"end":return dt.stop()}},Qe)}));return function(Je){return tt.apply(this,arguments)}}(),le=function(){location.href="/classrooms/".concat(Me.coursesId,"/exercise/").concat(Me.categoryId,"/detail")},ke=function(){var tt=Object(Q.a)(I.a.mark(function Qe(){var Je,Ye,gt;return I.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return(Je=X.current)===null||Je===void 0||((Ye=Je.destroyAll)===null||Ye===void 0)||Ye.call(Je),vt.next=3,Object(c.Z)({categoryId:Me.categoryId,commit_method:1});case 3:if(gt=vt.sent,gt){try{h.send(JSON.stringify({type:"toggleLockExit",data:!1})),h.send(JSON.stringify({type:"network-open",data:""}))}catch(dt){}Fe()}case 5:case"end":return vt.stop()}},Qe)}));return function(){return tt.apply(this,arguments)}}(),Fe=function(){var Qe,Je;document.removeEventListener(Object(p.c)(),$e,!1),Object(p.b)(),(Qe=X.current)===null||Qe===void 0||((Je=Qe.destroyAll)===null||Je===void 0)||Je.call(Qe);try{h.send(JSON.stringify({type:"toggleLockExit",data:!1})),h.send(JSON.stringify({type:"network-open",data:""}))}catch(Ye){}U.info({content:v.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",v.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){le()}})},Ie=function(Qe){Object(p.a)()&&document.getElementById("iframeShixuns").style.display=="none"&&Object(p.b)()},He=function(){var tt=Object(Q.a)(I.a.mark(function Qe(){return I.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.abrupt("return",new Promise(function(){var gt=Object(Q.a)(I.a.mark(function _t(vt){var dt,Ct,xt;return I.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:if(!((dt=m.exerciseUserInfo)!==null&&dt!==void 0&&dt.screen_at)){Ce.next=3;break}return Ce.next=3,Object(c.h)(Object(te.a)(Object(te.a)({},Me),{},{reset:!0}));case 3:return Ce.next=5,Object(c.R)({id:Me.categoryId});case 5:if(Ct=Ce.sent,!(Ct!=null&&Ct.is_commit)){Ce.next=9;break}return Fe(),Ce.abrupt("return");case 9:return Ce.next=11,ne();case 11:xt=Ce.sent,vt(xt);case 13:case"end":return Ce.stop()}},_t)}));return function(_t){return gt.apply(this,arguments)}}()));case 1:case"end":return Ye.stop()}},Qe)}));return function(){return tt.apply(this,arguments)}}(),$e=function(){var tt=Object(Q.a)(I.a.mark(function Qe(){var Je,Ye,gt,_t;return I.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:if(Je=!1,console.log("fullscreen change"),!Object(p.a)()){dt.next=7;break}(Ye=m.exerciseUserInfo)!==null&&Ye!==void 0&&Ye.screen_at&&Object(c.h)(Object(te.a)(Object(te.a)({},Me),{},{reset:!0})),clearTimeout($.current),dt.next=17;break;case 7:return Je=!0,dt.next=10,Object(c.h)(Object(te.a)({},Me));case 10:return dt.next=12,ne();case 12:gt=dt.sent,ve(gt.used_screen_num),_t=setTimeout(Object(Q.a)(I.a.mark(function Ct(){return I.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:case"end":return Le.stop()}},Ct)})),m.exerciseUserInfo.screen_sec*1e3),window.frames.length!=parent.frames.length&&window.parent.postMessage("backExercise","*"),$.current=_t;case 17:u({type:"globalSetting/headerFooterToggle",payload:Je});case 18:case"end":return dt.stop()}},Qe)}));return function(){return tt.apply(this,arguments)}}();return v.a.createElement("div",null,O)};Ne.a=Object(r.a)(function(A){var T=A.loading,w=A.user,C=A.exercise,b=A.globalSetting;return{globalSetting:b,user:w,exercise:C,loading:T.effects}})(R)},bT9E:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return Q});var te=K("VTBJ");function Q(N,J){var B=Object(te.a)({},N);return Array.isArray(J)&&J.forEach(function(D){delete B[D]}),B}},biw7:function(qe,Ne,K){"use strict";var te=K("q1tI"),Q=K.n(te),N=te.createContext(null);Ne.a=N},c5Ni:function(qe,Ne,K){},cQPA:function(qe,Ne,K){"use strict";K.r(Ne);var te=K("T2oS"),Q=K("W9HT"),N=K("sPJy"),J=K("bE4q"),B=K("+L6B"),D=K("2/Rp"),H=K("14J3"),F=K("BMrR"),k=K("jCWc"),I=K("kPKH"),_=K("5Dmo"),v=K("3S7+"),p=K("sRBo"),c=K("kaz8"),a=K("7Kak"),l=K("9yH6"),o=K("MXD1"),r=K("CFYs"),s=K("miYZ"),d=K("tsqr"),R=K("2qtc"),A=K("kLXV"),T=K("k1fw"),w=K("9og8"),C=K("tJVT"),b=K("PpiC"),m=K("5NDa"),h=K("5rEg"),u=K("aHsQ"),x=K("sGsY"),g=K("WmNS"),y=K.n(g),M=K("q1tI"),E=K.n(M),j=K("Ty5D"),G=K("55Ip"),U=K("9kvl"),O=K("gUdW"),X=K("xGfz"),$=K("jhfD"),se=K("BlwA"),ce=K("bPs0"),Pe=K("wd/R"),Se=K.n(Pe),Re=K("9GDu"),Oe=K.n(Re),Me=K("1vsH"),be=K("s8TD"),ue=K("xKgJ"),ne=K("bntm"),ve=K("V0Rq"),le=K("HBuW"),ke=K("9Bee"),Fe=K("Ot1p"),Ie=function(Ge){var De,oe,he,Ze,Ue,ze=Ge.item,ct=Ge.answerData,Te=Ge.onBlur,Ke=Te===void 0?function(){}:Te,st=Object(M.useState)(),ft=Object(C.a)(st,2),Tt=ft[0],Jt=ft[1],an=Object(M.useState)(),Vt=Object(C.a)(an,2),Ot=Vt[0],gn=Vt[1],Kt=Object(M.useState)(),Zt=Object(C.a)(Kt,2),Nt=Zt[0],nn=Zt[1];return Object(M.useEffect)(function(){gn(ze==null?void 0:ze.a_flag)},[ze==null?void 0:ze.a_flag]),E.a.createElement("div",null,(ct==null||((De=ct.exercise)===null||De===void 0)?void 0:De.commit_status)===1?E.a.createElement("div",null,E.a.createElement("p",{className:"mt10 mb0"},"\u6211\u7684\u7B54\u6848\uFF1A"),E.a.createElement("div",{className:Oe.a.simpleText},E.a.createElement(ke.a,{value:ze==null||((oe=ze.user_answer)===null||oe===void 0)?void 0:oe[0]}))):E.a.createElement("div",{className:ze.user_score&&(ze.user_score===ze.question_score?"c-green":"c-red")},Nt?E.a.createElement(Fe.a,{height:150,isFocus:!0,defaultValue:ze==null||((he=ze.user_answer)===null||he===void 0)?void 0:he[0],id:ze==null?void 0:ze.question_id,onChange:function(wn){return Jt(wn)},onBlur:function(){return Ke(Tt)}}):E.a.createElement("div",{onClick:function(){var wn;if(!ze.repeat_answer&&(ze==null||((wn=ze.user_answer)===null||wn===void 0)?void 0:wn.length)>0)return;nn(!0)}},E.a.createElement(h.a,{disabled:!ze.repeat_answer&&(ze==null||((Ze=ze.user_answer)===null||Ze===void 0)?void 0:Ze.length)>0&&!ze.israp,size:"large",className:"current",placeholder:"\u70B9\u51FB\u5F00\u59CB\u4F5C\u7B54",readOnly:!0}))),(ze==null?void 0:ze.standard_answer)&&E.a.createElement("div",null,E.a.createElement("p",{className:"mt10 mb0"},"\u53C2\u8003\u7B54\u6848\uFF1A"),E.a.createElement("div",{style:{border:"1px solid #eee",background:"#f5f5f5",borderRadius:4,padding:5}},E.a.createElement(ke.a,{value:ze==null||((Ue=ze.standard_answer)===null||Ue===void 0)?void 0:Ue[0]}))))},He=Ie,$e=K("g9YV"),tt=K("wCAj"),Qe=K("5GOC"),Je=K("JsLm"),Ye=K("ZW9T"),gt=K("o/qq"),_t=K.n(gt),vt=function(Ge){var De,oe,he,Ze,Ue=Ge.item,ze=Ge.answerData,ct=Object(M.useState)([]),Te=Object(C.a)(ct,2),Ke=Te[0],st=Te[1],ft=Object(M.useState)([]),Tt=Object(C.a)(ft,2),Jt=Tt[0],an=Tt[1];Object(M.useEffect)(function(){var Kt;if(!(Ue!=null&&(Kt=Ue.shixun_details)!==null&&Kt!==void 0&&Kt.length))return;for(var Zt=[],Nt=[],nn=0;nn<(Ue==null||((Cn=Ue.shixun_details)===null||Cn===void 0)?void 0:Cn.length);nn++){for(var Cn,wn,mt,Gt=0;Gt<(Ue==null?void 0:Ue.shixun_details[nn].stage_list.length);Gt++){var Mn,Un,Pn,Vn,V=Ue==null?void 0:Ue.shixun_details[nn].stage_list[Gt];Zt.push(Object(T.a)(Object(T.a)({},V),{operation:Ue==null||((Mn=Ue.shixun_details)===null||Mn===void 0||((Un=Mn[nn])===null||Un===void 0||((Pn=Un.shixun_detail)===null||Pn===void 0||((Vn=Pn[0])===null||Vn===void 0))))?void 0:Vn.game_identifier}))}if(Ue!=null&&(wn=Ue.shixun_details)!==null&&wn!==void 0&&(mt=wn[nn])!==null&&mt!==void 0&&mt.shixun_detail){var S,L,W;Nt.push(Ue==null||((S=Ue.shixun_details)===null||S===void 0||((L=S[nn])===null||L===void 0||((W=L.shixun_detail)===null||W===void 0)))?void 0:W[0])}}an(Nt),st(Zt)},[Ue==null?void 0:Ue.shixun_details]);var Vt=[{title:"\u5173\u5361",dataIndex:"position",key:"position",align:"center"},{title:"\u4EFB\u52A1\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:function(Zt){return E.a.createElement("span",{className:"overflowHidden1",style:{maxWidth:"400px"},title:Zt&&Zt.length>25?Zt:""},Zt)}},{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"evaluate_count",key:"evaluate_count",align:"center",render:function(Zt,Nt){return E.a.createElement("span",null,Nt.evaluate_count?Nt.evaluate_count:E.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u5B8C\u6210\u65F6\u95F4",key:"endTime",dataIndex:"endTime",align:"center",render:function(Zt,Nt){var nn=!1;return Nt.finished_time&&ze!==null&&ze!==void 0&&ze.exercise&&ze!==null&&ze!==void 0&&ze.exercise_answer_user&&((ze==null?void 0:ze.exercise.time)===-1?nn=Se()(ze==null?void 0:ze.exercise.end_time).isBefore(Nt.finished_time):nn=Se()(ze==null?void 0:ze.exercise_answer_user.start_at).add(ze==null?void 0:ze.exercise.time,"m").isBefore(Nt.finished_time)),E.a.createElement("span",null,Nt.finished_time||E.a.createElement("span",{className:"c-grey-999"},"--"),E.a.createElement("span",{className:"c-orange-ff9 "},nn?"\uFF08\u5DF2\u8D85\u65F6\uFF09":""))}},{title:"\u8017\u65F6",dataIndex:"time_consuming",key:"time_consuming",align:"center",render:function(Zt,Nt){return E.a.createElement("span",null,Nt.time_consuming||E.a.createElement("span",{className:"color-grey-9"},"--"))}},{title:"\u67E5\u770B\u7B54\u6848",dataIndex:"view_answer",key:"view_answer",align:"center",render:function(Zt,Nt){return E.a.createElement("span",null,Nt.view_answer?"\u5DF2\u67E5\u770B":"\u672A\u67E5\u770B")}},{title:"\u64CD\u4F5C",dataIndex:"operation",key:"operation",align:"center",render:function(Zt,Nt,nn){return Zt?E.a.createElement(Je.a,{affix:!1,className:"mt10"},E.a.createElement(Je.a.Link,{href:"#challenge_".concat(Ue==null?void 0:Ue.question_id).concat(nn),title:E.a.createElement("span",{style:{color:"#0152d9"}},"\u67E5\u770B")})):E.a.createElement("span",{className:"c-grey-999"},"--")}}],Ot=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(Zt,Nt){return E.a.createElement("span",null,Nt.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(Zt,Nt){return E.a.createElement("span",null,Nt.error_msg?Nt.error_msg:"--")}}],gn={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return E.a.createElement("div",{className:"mt15 mb15"},(ze==null||((De=ze.exercise)===null||De===void 0)?void 0:De.commit_status)===0&&E.a.createElement("div",null,Ue.shixun.map(function(Kt,Zt){return E.a.createElement(F.a,{className:"font16",gutter:[0,20]},E.a.createElement(I.a,{flex:"1"},Kt.challenge_name," (",Kt.challenge_score,"\u5206)"),E.a.createElement(I.a,{flex:"100px",className:"tr"},Kt.answer_status===0&&E.a.createElement("span",{className:"font12 tag-style-border border-orange c-orange "},"\u672A\u5B8C\u6210"),Kt.answer_status===1&&E.a.createElement("span",{className:"font12 tag-style-border border-green c-green "},"\u5DF2\u5B8C\u6210")))})),(ze==null||((oe=ze.exercise)===null||oe===void 0)?void 0:oe.commit_status)!==0||(ze==null||((he=ze.exercise)===null||he===void 0)?void 0:he.user_exercise_status)!==0?E.a.createElement(E.a.Fragment,null,!!(Ke!=null&&Ke.length)&&E.a.createElement("div",null,E.a.createElement("p",{className:"font16 c-grey-666"},"\u9636\u6BB5\u6210\u7EE9"),E.a.createElement(tt.a,{columns:Vt,dataSource:Ke,pagination:!1})),!!(Jt!=null&&Jt.length)&&E.a.createElement("div",null,E.a.createElement("p",{className:"font16 c-grey-666 mt10"},"\u5B9E\u8BAD\u8BE6\u60C5"),Jt==null?void 0:Jt.map(function(Kt,Zt){return E.a.createElement("div",{id:"challenge_".concat(Ue==null?void 0:Ue.question_id).concat(Zt),className:"mt5"},E.a.createElement("div",null,E.a.createElement("span",{className:"font16 mr15"}," \u7B2C",Kt.position,"\u5173"),E.a.createElement(G.a,{className:"current c-black font16",to:"/tasks/".concat(Kt.game_identifier)},Kt.name)),(Kt==null?void 0:Kt.st)===0&&Kt.passed_code&&E.a.createElement("aside",{className:_t.a.shixunWrp},E.a.createElement("h2",null,"\u6700\u540E\u4E00\u6B21\u901A\u5173\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09",E.a.createElement("span",{className:"c-light-black"},Kt.path)),E.a.createElement(Ye.b,{height:300,language:"python",theme:"default",value:Kt.passed_code,options:gn})))}))):E.a.createElement(E.a.Fragment,null,E.a.createElement(ke.a,{className:"c-grey-999 mt20 mb20",value:Ue==null?void 0:Ue.question_title}),Ue==null||((Ze=Ue.shixun)===null||Ze===void 0)?void 0:Ze.map(function(Kt,Zt){return E.a.createElement("p",{className:"font16 c-grey-666 mb5",key:Zt},E.a.createElement("span",{className:"mr20"},"\u7B2C",Kt==null?void 0:Kt.challenge_position,"\u5173 ",Kt==null?void 0:Kt.challenge_name),E.a.createElement("span",null,Kt==null?void 0:Kt.challenge_score,"\u5206"))})))},dt=vt,Ct=K("J66h"),xt=function(Ge){var De=Ge.item,oe=Ge.answerData,he=Object(M.useState)([]),Ze=Object(C.a)(he,2),Ue=Ze[0],ze=Ze[1];Object(M.useEffect)(function(){var Ke;if((De==null||((Ke=De.evaluate_codes)===null||Ke===void 0)?void 0:Ke.length)>0){var st;ze(De==null||((st=De.evaluate_codes)===null||st===void 0)?void 0:st.map(function(ft,Tt){return{key:Tt+1,error_msg:ft!=null&&ft.error_msg?Ct.Base64.decode(ft==null?void 0:ft.error_msg):""}}))}else ze([{key:"--",error_msg:"--"}])},[De==null?void 0:De.evaluate_codes]);var ct=[{title:"\u8BC4\u6D4B\u6B21\u6570",dataIndex:"key",width:"127px",key:"key",align:"center",render:function(st,ft){return E.a.createElement("span",null,ft.key)}},{title:"\u8BE6\u7EC6\u4FE1\u606F",dataIndex:"error_msg",key:"error_msg",align:"center",render:function(st,ft){return E.a.createElement("span",null,ft.error_msg?ft.error_msg:"--")}}],Te={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1};return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{className:"mt15 mb15"},E.a.createElement(ke.a,{value:De==null?void 0:De.description})),!!(De!=null&&De.user_answer.length)&&(De==null?void 0:De.passed_code)&&E.a.createElement("aside",{className:_t.a.shixunWrp},E.a.createElement("h3",null,"\u7B2C\u4E00\u6B21\u8BC4\u6D4B\u901A\u8FC7\u7684\u4EE3\u7801\uFF08\u672A\u901A\u5173\u5219\u4E3A\u6700\u540E\u4E00\u6B21\u63D0\u4EA4\u8BC4\u6D4B\u7684\u4EE3\u7801\uFF09"),E.a.createElement(Ye.b,{style:{border:"1px solid #ccc"},height:300,language:"python",theme:"vs-light",value:De!=null&&De.passed_code?Ct.Base64.decode(De==null?void 0:De.passed_code):"",options:Te})))},Le=xt,Ce=K("oBTY"),nt=h.a.TextArea,rt=function(Ge){var De,oe,he=Ge.item,Ze=Ge.answerData,Ue=Ge.onBlur,ze=Ue===void 0?function(){}:Ue,ct=Object(M.useState)([]),Te=Object(C.a)(ct,2),Ke=Te[0],st=Te[1];return Object(M.useEffect)(function(){for(var ft=[],Tt=function(Vt){var Ot,gn=(he==null||((Ot=he.user_answer)===null||Ot===void 0)?void 0:Ot.find(function(Kt){return Kt.choice_id===Vt+1}))||{choice_id:Vt+1,answer_text:""};ft.push(Object(T.a)({},gn))},Jt=0;Jt<(he==null?void 0:he.multi_count);Jt++)Tt(Jt);st(ft)},[he==null?void 0:he.user_answer]),E.a.createElement("div",null,Ke==null?void 0:Ke.map(function(ft,Tt){var Jt;return E.a.createElement("div",{className:"mt10"},E.a.createElement("span",null,"\u6211\u7684\u7B54\u6848\uFF08\u586B\u7A7A",Tt+1,"\uFF09:"),E.a.createElement("div",null,E.a.createElement(nt,{autoSize:!0,rows:4,disabled:!he.repeat_answer&&(he==null||((Jt=he.user_answer)===null||Jt===void 0)?void 0:Jt.length)>0&&!he.israp||!!(Ze!=null&&Ze.exercise.commit_status),value:ft==null?void 0:ft.answer_text,onChange:function(Vt){Ke[Tt].answer_text=Vt.target.value,st(Object(Ce.a)(Ke))},onBlur:function(Vt){return ze(ft==null?void 0:ft.answer_text,Tt+1,Ke)},className:"overflow_hidden ".concat(he.user_score&&(he.user_score===he.question_score?"c-green":"c-red"))})))}),!!(he!=null&&(De=he.standard_answer)!==null&&De!==void 0&&De.length)&&E.a.createElement("div",null,he==null||((oe=he.standard_answer)===null||oe===void 0)?void 0:oe.map(function(ft,Tt){return E.a.createElement("div",null,E.a.createElement("span",null,"\u53C2\u8003\u7B54\u6848\uFF1A\uFF08\u586B\u7A7A",Tt+1,"\uFF09:"),E.a.createElement("div",null,E.a.createElement(nt,{autoSize:!0,disabled:!0,value:ft==null?void 0:ft.answer_text[0]})))})))},Be=rt,et=K("lzim"),xe=h.a.TextArea,fe=function(Ge){var De=Ge.data;return E.a.createElement("div",{className:"tc mt80"},E.a.createElement("img",{width:"486",src:et.l})," ",E.a.createElement("br",null),De.status===-1&&E.a.createElement("div",{className:"c-grey-999 mt60"},"\u60A8\u7684IP\u4E0D\u5728\u8003\u8BD5\u5141\u8BB8\u7684\u8303\u56F4\u5185\uFF01"),De.status===-2&&E.a.createElement("div",{className:" c-grey-999 mt60"},"\u60A8\u5DF2\u7ED1\u5B9A\u5F53\u524D\u8003\u8BD5IP\u5730\u5740\uFF1A",E.a.createElement("span",{className:"c-red"},De.ip),"\u8BF7\u4F7F\u7528\u8BE5IP\u5730\u5740\u8FDB\u5165\u8003\u8BD5\u3002"),E.a.createElement(D.a,{className:"mt40 pl20 pr20",type:"primary"},E.a.createElement("a",{href:"/"},"\u56DE\u5230\u9996\u9875")))},ge=fe,re=K("m3rI"),ae=K("LvDl"),de=x.a.Countdown,ye=h.a.TextArea,_e=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],je={1:"\u672A\u53D1\u5E03",2:"\u5DF2\u53D1\u5E03",3:"\u5DF2\u622A\u6B62"},ot={1:Oe.a.flagActive,2:Oe.a.flagHalf},bt={0:"c-red-ee4",1:"c-green"},wt=["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u5B9E\u8BAD\u9898","\u7F16\u7A0B\u9898"],Et=function(Ge){var De,oe,he,Ze,Ue,ze,ct,Te,Ke,st,ft,Tt,Jt,an,Vt,Ot,gn,Kt,Zt,Nt,nn,Cn,wn,mt,Gt,Mn,Un,Pn,Vn,V,S,L=Ge.globalSetting,W=Ge.loading,ee=Ge.user,Y=Ge.dispatch,Ae=Object(b.a)(Ge,["globalSetting","loading","user","dispatch"]),at=Object(j.i)(),St=Object(M.useState)({}),Bt=Object(C.a)(St,2),pe=Bt[0],Pt=Bt[1],qt=Object(M.useState)({}),Tn=Object(C.a)(qt,2),Hn=Tn[0],Kn=Tn[1],In=Object(M.useState)({}),pi=Object(C.a)(In,2),ui=pi[0],Bn=pi[1],di=Object(M.useState)(!1),Ai=Object(C.a)(di,2),wi=Ai[0],Yn=Ai[1],Wi=Object(M.useState)(!0),Pi=Object(C.a)(Wi,2),yi=Pi[0],Qi=Pi[1],bi=Object(M.useState)(!1),ci=Object(C.a)(bi,2),Ni=ci[0],Hi=ci[1],_i=Object(M.useState)(!1),_n=Object(C.a)(_i,2),on=_n[0],Dn=_n[1],un=Object(M.useState)(),Rn=Object(C.a)(un,2),yn=Rn[0],Oi=Rn[1],jn=Object(M.useState)(0),Xn=Object(C.a)(jn,2),Ki=Xn[0],Ri=Xn[1],Gi=Object(M.useState)(""),Ii=Object(C.a)(Gi,2),Li=Ii[0],ji=Ii[1],Ei=Object(M.useState)("none"),zi=Object(C.a)(Ei,2),Ji=zi[0],oi=zi[1],ir=Object(M.useState)(""),Ht=Object(C.a)(ir,2),$t=Ht[0],zt=Ht[1],sn=Object(M.useState)({status:0}),cn=Object(C.a)(sn,2),Sn=cn[0],hn=cn[1],kn=Object(M.useRef)(),qn=Object(M.useState)(0),ln=Object(C.a)(qn,2),tn=ln[0],pn=ln[1],Qn=Object(M.useState)(0),Gn=Object(C.a)(Qn,2),rn=Gn[0],Zi=Gn[1],En=Object(M.useState)(!1),mn=Object(C.a)(En,2),bn=mn[0],$n=mn[1],qi=Object(M.useState)(!1),Vi=Object(C.a)(qi,2),$i=Vi[0],Ar=Vi[1],Gr=Object(M.useState)(),wr=Object(C.a)(Gr,2),zr=wr[0],Vr=wr[1],Ja=Object(M.useState)(),Yr=Object(C.a)(Ja,2),Xr=Yr[0],Za=Yr[1];Object(M.useEffect)(function(){return(Object(ue.c)()||Object(ue.l)())&&tr(),window.addEventListener("message",lr),function(){window.removeEventListener("message",lr),window.removeEventListener("beforeunload",Or),location.pathname.indexOf("/detail")>-1&&Object(ne.b)()}},[at.categoryId,ee.userInfo.login]);var lr=function(me){me.data==="backExercise"&&(oi("none"),ji(""),tr())},er=function(){var Ft=Object(w.a)(y.a.mark(function me(){var ut,it,Dt,ht,Rt,kt,Mt,Yt,Wt,Xt,vn;return y.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return dn.next=2,Y({type:"exercise/getExerciseUserInfo",payload:Object(T.a)({},at)});case 2:if(it=dn.sent,Kn(Object(T.a)({},it.data)),!((it==null||((ut=it.data)===null||ut===void 0)?void 0:ut.ip_limit)!=="no")){dn.next=11;break}if(!((it==null||((Dt=it.data)===null||Dt===void 0)?void 0:Dt.ip_limit)==="inner")){dn.next=9;break}return dn.next=8,Object(be.a)({ip_limit:it==null||((ht=it.data)===null||ht===void 0)?void 0:ht.ip_limit});case 8:kt=dn.sent;case 9:return dn.next=11,Object(Me.s)({exerciseId:at.categoryId,ip:kt,errmsgHide:!0,ip_limit:it==null||((Rt=it.data)===null||Rt===void 0)?void 0:Rt.ip_limit}).catch(function(si){hn(si)});case 11:if(!((it==null?void 0:it.status)==0)){dn.next=18;break}if(!((it==null||((Mt=it.data)===null||Mt===void 0)?void 0:Mt.used_screen_num)>(it==null||((Yt=it.data)===null||Yt===void 0)?void 0:Yt.screen_num)&&it!==null&&it!==void 0&&(Wt=it.data)!==null&&Wt!==void 0&&Wt.screen_open)){dn.next=15;break}return br(),dn.abrupt("return",!1);case 15:Hi(it==null?void 0:it.data.check_camera),Dn(it==null||((Xt=it.data)===null||Xt===void 0)?void 0:Xt.screen_open),it!=null&&(vn=it.data)!==null&&vn!==void 0&&vn.check_camera||tr();case 18:case"end":return dn.stop()}},me)}));return function(){return Ft.apply(this,arguments)}}(),Or=function(me){var ut="\u786E\u5B9A\u79BB\u5F00\u6B64\u9875\u9762\u5417?\u6B64\u9875\u6570\u636E\u53EF\u80FD\u4F1A\u4E22\u5931";return(me||window.event).returnValue=ut,ut},tr=function(){var Ft=Object(w.a)(y.a.mark(function me(){var ut,it,Dt,ht,Rt;return y.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Yn(!0),Mt.next=3,Object(ve.Y)(Object(T.a)({},at)).catch(function(){return Yn(!1)});case 3:it=Mt.sent,((ut=it)===null||ut===void 0?void 0:ut.exercise)&&(it.exercise.user_exercise_status=1),Yn(!1),it&&(it.exercise_types=((Dt=it)===null||Dt===void 0?void 0:Dt.exercise_types)||((ht=it)===null||ht===void 0||((Rt=ht.exercise_scores)===null||Rt===void 0)?void 0:Rt.exercise_types),Pt(it));case 7:case"end":return Mt.stop()}},me)}));return function(){return Ft.apply(this,arguments)}}();Object(M.useEffect)(function(){var Ft,me,ut;((Ft=pe.exercise)===null||Ft===void 0?void 0:Ft.time)===0&&br(),((me=pe.exercise)===null||me===void 0?void 0:me.time)&&Oi(Date.now()+(pe==null||((ut=pe.exercise)===null||ut===void 0)?void 0:ut.time)*1e3*60)},[(De=pe.exercise)===null||De===void 0?void 0:De.time]);var qa=function(){var me;(pe==null||((me=pe.exercise)===null||me===void 0)?void 0:me.exercise_status)===3?A.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u622A\u6B62\u65F6\u95F4\u5DF2\u5230\uFF0C\u65E0\u6CD5\u6253\u56DE\u8BD5\u5377",E.a.createElement("br",null),"\u8BF7\u5728\u4FEE\u6539\u622A\u6B62\u65F6\u95F4\u540E\u518D\u64CD\u4F5C")}):A.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u5B66\u751F\u5C06\u5F97\u5230\u4E00\u6B21\u91CD\u65B0\u7B54\u9898\u7684\u673A\u4F1A\uFF0C\u73B0\u6709\u7684\u7B54\u9898\u60C5\u51B5\u5C06\u88AB\u6E05\u7A7A",E.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u56DE\u9000TA\u7684\u8BD5\u5377\u7B54\u9898"),onOk:function(){var ut=Object(w.a)(y.a.mark(function Dt(){var ht,Rt;return y.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(ve.S)({categoryId:at.categoryId,user_ids:[pe==null||((ht=pe.exercise_answer_user)===null||ht===void 0)?void 0:ht.user_id]});case 2:Rt=Mt.sent,Rt&&(d.b.info(Rt==null?void 0:Rt.message),mi());case 4:case"end":return Mt.stop()}},Dt)}));function it(){return ut.apply(this,arguments)}return it}()})},mi=function(){tr()},rr=function(){var Ft=Object(w.a)(y.a.mark(function me(){var ut,it;return y.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Object(ve.ab)({categoryId:at.categoryId,commit_method:2});case 2:ut=ht.sent,(ut==null?void 0:ut.status)===0&&(A.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:E.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",E.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Rt=Object(w.a)(y.a.mark(function Mt(){return y.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:mi();case 1:case"end":return Wt.stop()}},Mt)}));function kt(){return Rt.apply(this,arguments)}return kt}()}),d.b.info(ut==null?void 0:ut.message)),(ut==null?void 0:ut.status)===-3&&(it=parseInt(ut==null?void 0:ut.message),pe.exercise.time=it,Pt(Object(T.a)({},pe)));case 5:case"end":return ht.stop()}},me)}));return function(){return Ft.apply(this,arguments)}}(),yr=function(){var Ft=Object(w.a)(y.a.mark(function me(ut){var it;return y.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Object(le.E)({id:ut.shixun_identifier});case 2:it=ht.sent,it!=null&&it.game_identifier&&(ji("/tasks/".concat(it.game_identifier,"?type=exercises&exercisesId=").concat(at.categoryId,"&coursesId=").concat(at.coursesId,"&login=").concat(at.login,"&questionId=").concat(ut.question_id)),oi("block")),(it==null?void 0:it.status)===-3?Object(Me.q)():(it==null?void 0:it.status)===2?$a(it==null?void 0:it.message,ut.question_id):(it==null?void 0:it.status)===3&&Qr(it==null?void 0:it.message);case 5:case"end":return ht.stop()}},me)}));return function(ut){return Ft.apply(this,arguments)}}(),$a=function Ft(me,ut){var it;me=(it=me)!==null&&it!==void 0&&it.includes(".json")?me:"".concat(me,".json"),A.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u5B9E\u8BAD\u5DF2\u7ECF\u66F4\u65B0\u4E86\uFF0C\u6B63\u5728\u4E3A\u60A8\u91CD\u7F6E!"),onOk:function(){var Dt=Object(w.a)(y.a.mark(function Rt(){var kt,Mt;return y.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(ve.T)({url:me});case 2:if(kt=Wt.sent,kt){Wt.next=5;break}return Wt.abrupt("return");case 5:return d.b.success("\u91CD\u7F6E\u6210\u529F\uFF0C\u6B63\u5728\u8FDB\u5165\u5B9E\u8BAD\uFF01"),Wt.next=8,Object(le.E)({id:kt.shixun_identifier});case 8:if(Mt=Wt.sent,!(Mt!=null&&Mt.game_identifier)){Wt.next=12;break}return yr({shixun_identifier:Mt==null?void 0:Mt.game_identifier,question_id:ut}),Wt.abrupt("return");case 12:(Mt==null?void 0:Mt.status)===2?Ft(Mt==null?void 0:Mt.message,ut):(Mt==null?void 0:Mt.status)===3&&Qr(Mt==null?void 0:Mt.message);case 13:case"end":return Wt.stop()}},Rt)}));function ht(){return Dt.apply(this,arguments)}return ht}()})},Qr=function(me){A.a.confirm({centered:!0,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},"\u76EE\u524D\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5C1A\u5728\u5185\u6D4B\u4E2D\uFF0C\u5C06\u4E8E",me,"\u4E4B\u540E\u5F00\u653E\uFF0C\u8C22\u8C22\uFF01")})},eo=function(me){me.redo?A.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:E.a.createElement("div",{className:"tc font16"},"\u60A8\u4E4B\u524D\u5DF2\u7ECF\u6311\u6218\u8FC7\u8BE5\u5B9E\u8BAD\uFF0C\u8003\u8BD5\u8FC7\u7A0B\u4E2D\u9700\u8981\u91CD\u65B0\u6311\u6218"),onOk:function(){var ut=Object(w.a)(y.a.mark(function Dt(){var ht,Rt,kt,Mt;return y.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(ve.T)({id:me.myshixun_identifier,url:me.url});case 2:ht=Wt.sent,ht&&(Rt=Object(ae.cloneDeep)(pe==null?void 0:pe.exercise_question_types),kt=Rt==null?void 0:Rt.findIndex(function(Xt){return Xt.question_type===5}),Rt[kt].items.find(function(Xt){return Xt.question_id===me.question_id}).redo=!1,Rt[kt].items.find(function(Xt){return Xt.question_id===me.question_id}).shixun_identifier=ht.shixun_identifier,pe.exercise_question_types=Rt,Pt(pe),Mt=Object(T.a)(Object(T.a)({},me),{},{shixun_identifier:ht.shixun_identifier}),yr(Mt));case 4:case"end":return Wt.stop()}},Dt)}));function it(){return ut.apply(this,arguments)}return it}()}):yr(me)},Ea=function(){var Ft=Object(w.a)(y.a.mark(function me(ut){var it;return y.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(!ut.hack_identifier){ht.next=5;break}return ht.next=3,Object(ve.X)({id:ut.hack_identifier});case 3:it=ht.sent,(it==null?void 0:it.status)===0&&(ji("/myproblems/".concat(it.identifier,"?type=exercises&exercisesId=").concat(at.categoryId,"&coursesId=").concat(at.coursesId,"&login=").concat(at.login,"&questionId=").concat(ut.question_id)),oi("block"));case 5:case"end":return ht.stop()}},me)}));return function(ut){return Ft.apply(this,arguments)}}(),ar=function(){var Ft=Object(w.a)(y.a.mark(function me(ut,it,Dt,ht){var Rt,kt;return y.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(ut){Yt.next=3;break}return console.error("handleSave no questionId params"),Yt.abrupt("return");case 3:return Yt.next=5,Object(ve.cb)({questionId:ut,exercise_choice_id:it,answer_text:Dt});case 5:kt=Yt.sent,(kt==null?void 0:kt.status)===0&&(ht&&ht());case 7:case"end":return Yt.stop()}},me)}));return function(ut,it,Dt,ht){return Ft.apply(this,arguments)}}(),ur=function(){var Ft=Object(w.a)(y.a.mark(function me(ut){var it,Dt;return y.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return Rt.next=2,Object(ve.V)({id:at.categoryId});case 2:if(it=Rt.sent,it){Rt.next=5;break}return Rt.abrupt("return");case 5:it.question_undo!==0||it.oj_undo!==0?(Dt="",it.question_undo!==0&&it.oj_undo!==0?Dt="\u6709 ".concat(it.question_undo," \u9898\u672A\u5B8C\u6210\uFF0C\u5305\u542B ").concat(it.oj_undo," \u4E2A\u7F16\u7A0B\u9898"):it.question_undo!==0&&it.oj_undo===0?Dt="\u6709 ".concat(it.question_undo," \u9898\u672A\u5B8C\u6210"):it.question_undo===0&&it.oj_undo!==0&&(Dt="\u6709 ".concat(it.oj_undo," \u7F16\u7A0B\u9898\u672A\u5B8C\u6210")),A.a.confirm({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:E.a.createElement("div",{className:"tc font16"},Dt,E.a.createElement("br",null),ut?"\u5728".concat(Se()(it.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var kt=Object(w.a)(y.a.mark(function Yt(){return y.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:ut?mi():br();case 1:case"end":return Xt.stop()}},Yt)}));function Mt(){return kt.apply(this,arguments)}return Mt}()})):A.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u77E5\u9053\u5566",content:E.a.createElement("div",{className:"tc font16"},ut?"\u5728".concat(Se()(it.end_time).format("YYYY-MM-DD HH:mm"),"\u4E4B\u524D\uFF0C\u5141\u8BB8\u4FEE\u6539\u7B54\u9898"):"\u63D0\u4EA4\u540E\u65E0\u6CD5\u518D\u4FEE\u6539\u7B54\u9898\uFF0C\u662F\u5426\u786E\u8BA4\u63D0\u4EA4\uFF1F"),onOk:function(){var kt=Object(w.a)(y.a.mark(function Yt(){return y.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:ut?mi():br();case 1:case"end":return Xt.stop()}},Yt)}));function Mt(){return kt.apply(this,arguments)}return Mt}()});case 6:case"end":return Rt.stop()}},me)}));return function(ut){return Ft.apply(this,arguments)}}(),Ui=function(me){return E.a.createElement("div",null,E.a.createElement(r.a,{strokeColor:{from:"#108ee9",to:"#87d068"},status:"active",percent:me}),E.a.createElement("div",{className:"c-grey-c tc mt10 mb20"},"\u6B63\u5728\u5224\u5206\u4E2D\u2026"))},xa=function(){var me=0,ut=A.a.info({title:"\u4EA4\u5377\u4E2D",icon:null,className:"modal-footer-none",content:Ui(me)}),it=setInterval(function(){me<=100?(me+=2,ut.update({content:Ui(me)})):(ut.destroy(),clearInterval(it))},50)},br=function(){var Ft=Object(w.a)(y.a.mark(function me(){var ut;return y.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return xa(),Dt.next=3,Object(ve.ab)({categoryId:at.categoryId,commit_method:1});case 3:ut=Dt.sent,Object(ne.b)(),Y({type:"exercise/setActionTabs",payload:Object(T.a)({},{removeEventListenerExitScreen:!0})}),(ut==null?void 0:ut.status)===0&&(d.b.success(ut==null?void 0:ut.message),Hi(!1),setTimeout(function(){A.a.info({title:"\u4EA4\u5377\u6210\u529F\uFF01",okText:"\u786E\u5B9A",onOk:function(){mi()}})},3e3));case 7:case"end":return Dt.stop()}},me)}));return function(){return Ft.apply(this,arguments)}}(),to=function(){var Ft=Object(w.a)(y.a.mark(function me(ut,it,Dt,ht){return y.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:ar(it,ut,null,function(){pe.question_status.find(function(Mt){return Mt.ques_id===it}).ques_status=ut?1:0,ht.user_answer=[],ht.user_answer.push(ut),ht.repeat_answer||(ht.israp=!0),Pt(Object(T.a)({},pe))});case 1:case"end":return kt.stop()}},me)}));return function(ut,it,Dt,ht){return Ft.apply(this,arguments)}}(),no=function(){var Ft=Object(w.a)(y.a.mark(function me(ut,it,Dt,ht,Rt){return y.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:ar(ht.question_id,ut,null,function(){var Yt,Wt,Xt;ht.user_answer=[],ht.user_answer.push(ut);var vn=Rt==null||((Yt=Rt.sub_exercise_questions)===null||Yt===void 0)?void 0:Yt.filter(function(xn){var dn;return((dn=xn.user_answer)===null||dn===void 0?void 0:dn.length)===0});pe.question_status.find(function(xn){return xn.ques_id===it}).ques_status=(vn==null?void 0:vn.length)===(Rt==null||((Wt=Rt.sub_exercise_questions)===null||Wt===void 0)?void 0:Wt.length)?0:(vn==null?void 0:vn.length)>0&&(vn==null?void 0:vn.length)<(Rt==null||((Xt=Rt.sub_exercise_questions)===null||Xt===void 0)?void 0:Xt.length)?2:1,Pt(Object(T.a)({},pe))});case 1:case"end":return Mt.stop()}},me)}));return function(ut,it,Dt,ht,Rt){return Ft.apply(this,arguments)}}(),io=function(me,ut,it){ar(ut,me,null,function(){it.user_answer=me,it.repeat_answer||(it.israp=!0),pe.question_status.find(function(Dt){return Dt.ques_id===ut}).ques_status=me!=null&&me.length?1:0,Pt(Object(T.a)({},pe))})},Ta=function(me,ut,it,Dt,ht){ar(it,ut,me,function(){pe.question_status.find(function(kt){return kt.ques_id===it}).ques_status=Dt.every(function(kt){return!!kt.answer_text})?1:pe.question_status.find(function(kt){return kt.ques_id===it}).ques_status=Dt.some(function(kt){return!!kt.answer_text})?2:0;var Rt={choice_id:ut,answer_text:me};ht.user_answer.filter(function(kt){return kt.choice_id!=ut})?ht.user_answer.splice(ut-1,1,Rt):ht.user_answer.push(Rt),ht.repeat_answer||(ht.israp=!0),Pt(Object(T.a)({},pe))})},Ca=function(me,ut,it){ar(ut,null,me,function(){pe.question_status.find(function(Dt){return Dt.ques_id===ut}).ques_status=me?1:0,it.user_answer=[],it.user_answer.push(me),it.repeat_answer||(it.israp=!0),Pt(Object(T.a)({},pe))})},dr=function(me,ut){var it,Dt,ht,Rt,kt,Mt;return E.a.createElement("div",null,E.a.createElement(l.a.Group,{disabled:!!(pe!=null&&pe.exercise.commit_status),defaultValue:me==null||((it=me.user_answer)===null||it===void 0)?void 0:it[0],onChange:function(Wt){return to(Wt.target.value,me==null?void 0:me.question_id,ut,me)},className:me.user_score&&"edu-radio-".concat(me.user_score===me.question_score?"green":"red")},me==null||((Dt=me.question_choices)===null||Dt===void 0)?void 0:Dt.map(function(Yt,Wt){var Xt,vn=me.question_type==2,xn=vn?"":"".concat(_e[Wt],".");return E.a.createElement("div",{className:Oe.a.answerWrap,key:Wt},E.a.createElement(l.a,{disabled:!me.repeat_answer&&(me==null||((Xt=me.user_answer)===null||Xt===void 0)?void 0:Xt.length)>0&&!me.israp,value:Yt==null?void 0:Yt.choice_id},E.a.createElement("span",{className:"mr3"},xn),E.a.createElement(ke.a,{style:{width:740},className:Oe.a.renderHtml,value:Yt==null?void 0:Yt.choice_text})))})),Object(ue.s)()&&(pe==null||((ht=pe.exercise)===null||ht===void 0)?void 0:ht.answer_open)&&((pe==null||((Rt=pe.exercise)===null||Rt===void 0)?void 0:Rt.exercise_status)==3||(pe==null||((kt=pe.exercise)===null||kt===void 0)?void 0:kt.user_exercise_status)==1)&&E.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",me==null||((Mt=me.standard_answer)===null||Mt===void 0)?void 0:Mt.map(function(Yt,Wt){return E.a.createElement("span",null,_e[Number(Yt)-1])})))},Sa=function(me,ut,it){var Dt;return E.a.createElement("div",null,me==null||((Dt=me.sub_exercise_questions)===null||Dt===void 0)?void 0:Dt.map(function(ht,Rt){var kt,Mt,Yt,Wt,Xt,vn;return E.a.createElement("div",null,E.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},E.a.createElement("span",{style:{flexShrink:0},className:"font18"},it+1+"."+(Rt+1),"\uFF08\u5355\u9009\u9898\uFF09"),E.a.createElement(ke.a,{value:ht==null?void 0:ht.question_title}),E.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ht==null?void 0:ht.question_score,"\u5206\uFF09")),E.a.createElement(l.a.Group,{disabled:!!(pe!=null&&pe.exercise.commit_status),defaultValue:ht==null||((kt=ht.user_answer)===null||kt===void 0)?void 0:kt[0],onChange:function(dn){return no(dn.target.value,me==null?void 0:me.question_id,Rt,ht,me)},className:ht.user_score&&"edu-radio-".concat(ht.user_score===ht.question_score?"green":"red")},ht==null||((Mt=ht.question_choices)===null||Mt===void 0)?void 0:Mt.map(function(xn,dn){var si,Di=ht.question_type==2,cr=Di?"":"".concat(_e[dn],".");return E.a.createElement("div",{className:Oe.a.answerWrap,key:dn},E.a.createElement(l.a,{disabled:!ht.repeat_answer&&(ht==null||((si=ht.user_answer)===null||si===void 0)?void 0:si.length)>0,value:xn==null?void 0:xn.choice_id},E.a.createElement("span",{className:"mr3"},cr),E.a.createElement(ke.a,{style:{width:740},className:Oe.a.renderHtml,value:xn==null?void 0:xn.choice_text})))})),Object(ue.s)()&&(pe==null||((Yt=pe.exercise)===null||Yt===void 0)?void 0:Yt.answer_open)&&((pe==null||((Wt=pe.exercise)===null||Wt===void 0)?void 0:Wt.exercise_status)==3||(pe==null||((Xt=pe.exercise)===null||Xt===void 0)?void 0:Xt.user_exercise_status)==1)&&E.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",ht==null||((vn=ht.standard_answer)===null||vn===void 0)?void 0:vn.map(function(xn,dn){return E.a.createElement("span",null,_e[Number(xn)-1])})))}))},Aa=function(me,ut){var it,Dt,ht,Rt;return E.a.createElement("div",null,E.a.createElement(c.a.Group,{disabled:!!(pe!=null&&pe.exercise.commit_status),defaultValue:me==null?void 0:me.user_answer,onChange:function(Mt){return io(Mt,me==null?void 0:me.question_id,me)},className:me.user_score&&"edu-checkbox-".concat(me.user_score===me.question_score?"green":"red")},me==null||((it=me.question_choices)===null||it===void 0)?void 0:it.map(function(kt,Mt){var Yt,Wt="".concat(_e[Mt],".");return E.a.createElement("div",{className:Oe.a.answerWrap},E.a.createElement(c.a,{disabled:!me.repeat_answer&&(me==null||((Yt=me.user_answer)===null||Yt===void 0)?void 0:Yt.length)>0&&!me.israp,value:kt==null?void 0:kt.choice_id},E.a.createElement("span",{className:"mr3"},Wt),E.a.createElement(ke.a,{className:Oe.a.renderHtml,value:kt==null?void 0:kt.choice_text})))})),Object(ue.s)()&&(pe==null||((Dt=pe.exercise)===null||Dt===void 0)?void 0:Dt.answer_open)&&(pe==null||((ht=pe.exercise)===null||ht===void 0)?void 0:ht.exercise_status)==3&&E.a.createElement("div",null,"\u53C2\u8003\u7B54\u6848\uFF1A",me==null||((Rt=me.standard_answer)===null||Rt===void 0)?void 0:Rt.map(function(kt,Mt){return E.a.createElement("span",null,_e[Number(kt)-1])})))},Jr=function(me,ut){return E.a.createElement(Be,{item:me,answerData:pe,onBlur:function(Dt,ht,Rt){return Ta(Dt,ht,me==null?void 0:me.question_id,Rt,me)}})},Rr=function(me,ut){return E.a.createElement(He,{item:me,answerData:pe,onBlur:function(Dt){return Ca(Dt,me==null?void 0:me.question_id,me)}})},wa=function(me,ut){return E.a.createElement(dt,{item:me,answerData:pe})},Zr=function(me,ut){return E.a.createElement(Le,{item:me,answerData:pe})},ei=function(me,ut,it){var Dt,ht,Rt=pe==null||((Dt=pe.exercise_question_types)===null||Dt===void 0)?void 0:Dt.find(function(kt){return kt.question_type===ut});return E.a.createElement(E.a.Fragment,null,E.a.createElement("h1",{className:"font14 current",onClick:function(){ui[ut]=!ui[ut],Bn(Object(T.a)({},ui))}},!ui[ut]&&E.a.createElement(O.a,null),ui[ut]&&E.a.createElement(X.a,null),E.a.createElement("span",{className:"ml5 c-grey-666"},me)),E.a.createElement("ul",{className:Oe.a.answerSheet,key:ut},!ui[ut]&&(Rt==null||((ht=Rt.items)===null||ht===void 0)?void 0:ht.map(function(kt,Mt){if(kt.question_type===ut){var Yt,Wt;return E.a.createElement("li",{onClick:function(){var vn;if(pe.exercise_question_types[tn].items[rn].israp=!1,Pt(Object(T.a)({},pe)),!$i&&(pe==null||((vn=pe.exercise)===null||vn===void 0)?void 0:vn.user_exercise_status)===0&&Object(ue.s)()){var xn,dn,si,Di;if(!((xn=pe.exercise_question_types)!==null&&xn!==void 0&&(dn=xn[tn])!==null&&dn!==void 0&&(si=dn.items)!==null&&si!==void 0&&(Di=si[rn])!==null&&Di!==void 0&&Di.repeat_answer)){$n(!0),Vr(3),Za({oneindex:it,twoindex:Mt});return}}pn(it),Zi(Mt);var cr="Anchor_".concat(ut,"_").concat(Mt),Ia=document.getElementById(cr);Ia&&setTimeout(function(){return Ia.scrollIntoView({block:"start",behavior:"smooth"})})},key:Mt,className:(pe==null||((Yt=pe.question_status)===null||Yt===void 0)?void 0:Yt.some(function(Xt){return Xt.ques_id===kt.question_id&&(Xt==null?void 0:Xt.ques_status)===1}))&&Oe.a.active},Mt+1,(pe==null||((Wt=pe.question_status)===null||Wt===void 0)?void 0:Wt.some(function(Xt){return Xt.ques_id===kt.question_id&&(Xt==null?void 0:Xt.ques_status)===2}))&&E.a.createElement("div",{style:{height:3,background:"#0152d9",position:"absolute",width:26,bottom:0}}))}}))))},Oa=function(me,ut){var it,Dt,ht,Rt,kt,Mt,Yt=(me==null?void 0:me.question_type)==5?me==null?void 0:me.shixun_name:me==null?void 0:me.question_title;return E.a.createElement("div",{className:Oe.a.questionItem,id:"Anchor_".concat(me==null?void 0:me.question_type,"_").concat(ut)},E.a.createElement("div",{style:{display:"flex",marginTop:20,userSelect:"none"}},E.a.createElement("span",{style:{flexShrink:0},className:"font18"},ut+1,"."),E.a.createElement(ke.a,{value:me==null?void 0:me.question_title}),E.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",(me==null?void 0:me.question_type)===7?"\u5171".concat(me==null||((it=me.sub_exercise_questions)===null||it===void 0)?void 0:it.length,"\u5C0F\u9898\uFF0C"):"",me==null?void 0:me.question_score,"\u5206\uFF09"),!(me!=null&&me.repeat_answer)&&E.a.createElement("span",{style:{color:"#FA6400 ",marginLeft:10,fontSize:16}},"\u6CE8\u610F\uFF1A\u8BE5\u9898\u4E0D\u5141\u8BB8\u91CD\u590D\u7B54\u9898"),!!(me!=null&&(Dt=me.schools)!==null&&Dt!==void 0&&Dt.length)&&E.a.createElement(v.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},E.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 line24 font18 c-orange"}))),(me==null?void 0:me.question_type)==0&&dr(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==2&&dr(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==1&&Aa(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==3&&Jr(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==4&&Rr(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==5&&wa(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==6&&Zr(me,me==null?void 0:me.question_type),(me==null?void 0:me.question_type)==7&&Sa(me,me==null?void 0:me.question_type,ut),!!(me!=null&&(ht=me.answer_comments)!==null&&ht!==void 0&&ht.length)&&E.a.createElement("div",{className:"mt30"},me==null||((Rt=me.answer_comments)===null||Rt===void 0)?void 0:Rt.map(function(Wt,Xt){var vn,xn;return E.a.createElement("div",null,E.a.createElement(F.a,{align:"middle",gutter:[0,10]},E.a.createElement(I.a,{flex:"50px"},E.a.createElement("img",{src:re.a.API_SERVER+"/images/"+((vn=Wt.user)===null||vn===void 0?void 0:vn.image_url),width:"40",style:{borderRadius:40}})),E.a.createElement(I.a,{flex:"1"},Wt.updated_at,E.a.createElement("br",null),(xn=Wt.user)===null||xn===void 0?void 0:xn.name),E.a.createElement(I.a,{className:"c-grey-c"},Wt.shixun_chanllge_position&&E.a.createElement("span",null,"\u7B2C",Wt.shixun_chanllge_position,"\u5173"),me.question_type!==4&&E.a.createElement("span",null,"\u539F\u59CB\u5F97\u5206",Wt.origin_score,"\u5206 \uFF0C")," \u4FEE\u6B63\u4E3A",Wt.score,"\u5206")),Wt.comment&&E.a.createElement(F.a,{align:"middle",gutter:[0,10]},E.a.createElement(I.a,{flex:"50px"}),E.a.createElement(I.a,{flex:"1"},E.a.createElement(ye,{autoSize:!0,value:Wt.comment,disabled:!0}))))})),E.a.createElement("div",{className:Oe.a.itemType},E.a.createElement(F.a,null,E.a.createElement(I.a,{flex:"1"}),E.a.createElement(I.a,null,(me==null?void 0:me.question_type)<3&&(me==null?void 0:me.standard_answer_show)&&E.a.createElement("span",{className:"font16 ml20"},"\u6B63\u786E\u7B54\u6848\uFF1A",me==null?void 0:me.standard_answer_show),E.a.createElement("span",{className:"font16 ml20"},(me==null?void 0:me.user_score)!==null&&(me==null?void 0:me.user_score)>=0&&E.a.createElement("span",null,E.a.createElement("span",{className:bt[Number(me==null?void 0:me.answer_status)]||"c-orange-ff9"},me==null?void 0:me.user_score)," \u5206")),(me==null?void 0:me.question_type)==5&&!((kt=pe.exercise)!==null&&kt!==void 0&&kt.commit_status)&&E.a.createElement(D.a,{type:"primary",className:"font16 ml20",onClick:function(){return eo(me)}},"\u8FDB\u5165\u7B54\u9898"),(me==null?void 0:me.question_type)==6&&!((Mt=pe.exercise)!==null&&Mt!==void 0&&Mt.commit_status)&&E.a.createElement(D.a,{type:"primary",className:"font16 ml20",onClick:function(){return Ea(me)}},"\u8FDB\u5165\u7B54\u9898")))))},qr=function(me,ut){return E.a.createElement(M.Fragment,null,me.question_type===0&&ei("\u5355\u9009\u9898",0,ut),me.question_type===1&&ei("\u591A\u9009\u9898",1,ut),me.question_type===2&&ei("\u5224\u65AD\u9898",2,ut),me.question_type===3&&ei("\u586B\u7A7A\u9898",3,ut),me.question_type===4&&ei("\u7B80\u7B54\u9898",4,ut),me.question_type===5&&ei("\u5B9E\u8BAD\u9898",5,ut),me.question_type===6&&ei("\u7F16\u7A0B\u9898",6,ut),me.question_type===7&&ei("\u7EC4\u5408\u9898",7,ut))},$r=function(me){var ut=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],it=["","\u5341","\u767E","\u5343","\u4E07"];me=parseInt(me);var Dt=function(Mt){for(var Yt=Mt.toString().split("").reverse(),Wt="",Xt=0;Xt<Yt.length;Xt++)Wt=(Xt==0&&Yt[Xt]==0||Xt>0&&Yt[Xt]==0&&Yt[Xt-1]==0?"":ut[Yt[Xt]]+(Yt[Xt]==0?it[0]:it[Xt]))+Wt;return Wt},ht=Math.floor(me/1e4),Rt=me%1e4;return Rt.toString().length<4&&(Rt="0"+Rt),ht?Dt(ht)+"\u4E07"+Dt(Rt):Dt(me)},Ra=function(){var me,ut,it,Dt,ht,Rt,kt,Mt,Yt,Wt,Xt,vn,xn;return E.a.createElement(M.Fragment,{key:tn},E.a.createElement("div",{className:"pt20"},E.a.createElement("span",{className:"font16 c-light-primary"},$r(tn+1),"\u3001",pe==null||((me=pe.exercise_question_types)===null||me===void 0||((ut=me[tn])===null||ut===void 0))?void 0:ut.name),E.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",pe==null||((it=pe.exercise_question_types)===null||it===void 0||((Dt=it[tn])===null||Dt===void 0))?void 0:Dt.count,"\u9898\uFF1B",(pe==null||((ht=pe.exercise_question_types)===null||ht===void 0||((Rt=ht[tn])===null||Rt===void 0))?void 0:Rt.question_type)===7?"\u5305\u542B".concat(pe==null||((kt=pe.exercise_question_types)===null||kt===void 0||((Mt=kt[tn])===null||Mt===void 0))?void 0:Mt.sub_questions_count,"\u5C0F\u9898"):""," \u5171",pe==null||((Yt=pe.exercise_question_types)===null||Yt===void 0||((Wt=Yt[tn])===null||Wt===void 0))?void 0:Wt.score,"\u5206\uFF09")),E.a.createElement(M.Fragment,{key:rn},Oa(pe==null||((Xt=pe.exercise_question_types)===null||Xt===void 0||((vn=Xt[tn])===null||vn===void 0||((xn=vn.items)===null||xn===void 0)))?void 0:xn[rn],rn)))};return E.a.createElement(Q.a,{size:"large",spinning:wi},on&&E.a.createElement(ce.a,{iframe:kn}),E.a.createElement("iframe",{style:{display:Ji},id:"iframeShixuns",className:Oe.a.iframe,src:Li,ref:kn,frameBorder:"0"}),E.a.createElement("section",{className:"edu-container"},E.a.createElement("section",{className:"animated fadeIn"},E.a.createElement("aside",{className:"mt10"},L.showHeaderFooter&&at.coursesId!=="coursesId"&&E.a.createElement(J.a,{separator:">"},E.a.createElement(J.a.Item,null,E.a.createElement(G.a,{to:"/classrooms/".concat(at.coursesId,"/exercise")},(oe=ee.userInfo)===null||oe===void 0||((he=oe.course)===null||he===void 0)?void 0:he.course_name)),E.a.createElement(J.a.Item,null,E.a.createElement(G.a,{to:"/classrooms/".concat(at.coursesId,"/exercise")},"\u8BD5\u5377")),E.a.createElement(J.a.Item,null,E.a.createElement(G.a,{to:"/classrooms/".concat(at.coursesId,"/exercise/").concat(at.categoryId,"/detail")},"\u8BD5\u5377\u8BE6\u60C5")),E.a.createElement(J.a.Item,null,(Ze=ee.userInfo)===null||Ze===void 0?void 0:Ze.real_name)),L.showHeaderFooter&&at.coursesId==="coursesId"&&E.a.createElement(J.a,{separator:">"},E.a.createElement(J.a.Item,null,E.a.createElement(G.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),E.a.createElement(J.a.Item,null,(Ue=ee.userInfo)===null||Ue===void 0?void 0:Ue.real_name))),E.a.createElement("aside",{className:[Oe.a.title,"mt10"].join(" ")},E.a.createElement(F.a,{style:{width:"100%"},align:"middle"},E.a.createElement(I.a,{flex:"1"},E.a.createElement("div",{className:Oe.a.title},(L==null?void 0:L.showHeaderFooter)&&E.a.createElement(G.a,{to:at.coursesId==="coursesId"?"/paperlibrary":"/classrooms/".concat(at.coursesId,"/exercise/").concat(at.categoryId,"/detail")},E.a.createElement($.a,{className:"font16 c-black"})),E.a.createElement("strong",{className:"font24 ml5"},pe==null||((ze=pe.exercise)===null||ze===void 0)?void 0:ze.exercise_name),(pe==null||((ct=pe.exercise)===null||ct===void 0)?void 0:ct.is_random)&&E.a.createElement("span",{className:Oe.a.randomFlag},"\u968F\u673A"),E.a.createElement(Me.m,{status:[Me.c[99]]}))),E.a.createElement(I.a,{style:{display:"flex"}},(pe==null||((Te=pe.user_score)===null||Te===void 0)?void 0:Te.length)&&E.a.createElement("div",null,"\u6A21\u62DF\u8003\u8BD5\u603B\u5F97\u5206\uFF1A",E.a.createElement("span",{className:"c-red"},pe==null?void 0:pe.user_score)," \u5206"),!!(pe!=null&&(Ke=pe.exercise)!==null&&Ke!==void 0&&Ke.time)&&!(pe!=null&&(st=pe.exercise)!==null&&st!==void 0&&st.commit_status)&&E.a.createElement("aside",{className:"".concat(Oe.a.countDown," ").concat($t)},"\u5269\u4F59\u65F6\u95F4:",E.a.createElement(de,{value:yn,onFinish:rr})),!(pe!=null&&(ft=pe.exercise)!==null&&ft!==void 0&&ft.commit_status)&&E.a.createElement(D.a,{className:Oe.a.submitButton,style:{marginLeft:20},type:"primary",onClick:function(){return ur(!1)}},"\u4EA4\u5377"))))),Sn.status===0&&E.a.createElement(F.a,{className:"mt10"},E.a.createElement(I.a,{flex:yi?"316px":"16px"},E.a.createElement("section",{style:{position:"sticky",top:0,zIndex:1}},Ni&&E.a.createElement(se.a,{number:(pe==null||((Tt=pe.exercise)===null||Tt===void 0)?void 0:Tt.photo_count)-(pe==null||((Jt=pe.exercise)===null||Jt===void 0)?void 0:Jt.take_photo),time:(an=pe.exercise)===null||an===void 0?void 0:an.left_time,update:tr,supportCamera:function(me){me===2?(tr(),Dn(Hn==null?void 0:Hn.screen_open)):me===1&&setTimeout(function(){return Ae.history.push("/")},3e3)}}),E.a.createElement("div",{className:"relative",style:{minHeight:236}},yi&&E.a.createElement("aside",{className:"bg-white p16"},E.a.createElement(F.a,null,E.a.createElement(I.a,{span:8},E.a.createElement("span",{className:"font16 blod"},"\u7B54\u9898\u5361")),E.a.createElement(I.a,{span:16},E.a.createElement("div",{className:"tr",style:{display:"flex",alignItems:"center",justifyContent:"end"}},E.a.createElement("span",{className:Oe.a.answerYes}),"\u5DF2\u7B54",E.a.createElement("span",{style:{width:13,height:13,display:"flex",flexDirection:"column-reverse"},className:"".concat(Oe.a.answerNo," ml10")},E.a.createElement("div",{style:{height:"10%",background:"#0152d9"}})),"\u90E8\u5206\u7B54\u9898",E.a.createElement("span",{className:"".concat(Oe.a.answerNo," ml10")}),"\u672A\u7B54"))),E.a.createElement("aside",{className:Oe.a.answerInfo},E.a.createElement(F.a,null,E.a.createElement(E.a.Fragment,null,E.a.createElement(I.a,{span:12},"\u7B54\u9898\u8FDB\u5EA6"),E.a.createElement(I.a,{span:12,className:"tr c-blue"},pe==null||((Vt=pe.question_status)===null||Vt===void 0||((Ot=Vt.filter(function(Ft){return(Ft==null?void 0:Ft.ques_status)===1}))===null||Ot===void 0))?void 0:Ot.length," / ",pe==null||((gn=pe.exercise_types)===null||gn===void 0)?void 0:gn.q_counts),E.a.createElement(I.a,{span:24},E.a.createElement(r.a,{trailColor:"#c3ced2",percent:(pe==null||((Kt=pe.question_status)===null||Kt===void 0||((Zt=Kt.filter(function(Ft){return(Ft==null?void 0:Ft.ques_status)===1}))===null||Zt===void 0))?void 0:Zt.length)/(pe==null||((Nt=pe.exercise_types)===null||Nt===void 0)?void 0:Nt.q_counts)*100,showInfo:!1}))),E.a.createElement(I.a,null,E.a.createElement("span",{className:"c-grey-333"},"\u5171 ",E.a.createElement("span",{className:"c-blue-4ca"},(pe==null||((nn=pe.exercise_types)===null||nn===void 0)?void 0:nn.q_counts)||(pe==null||((Cn=pe.exercise_scores)===null||Cn===void 0||((wn=Cn.exercise_types)===null||wn===void 0))?void 0:wn.q_counts))," \u9898\uFF1A"),E.a.createElement("span",{className:"c-grey-333"},"\u6EE1\u5206 ",E.a.createElement("span",{className:"c-blue-4ca"},(pe==null||((mt=pe.exercise_types)===null||mt===void 0)?void 0:mt.q_scores)||(pe==null||((Gt=pe.exercise_scores)===null||Gt===void 0||((Mn=Gt.exercise_types)===null||Mn===void 0))?void 0:Mn.q_scores))," \u5206")))),E.a.createElement(F.a,null,E.a.createElement(I.a,{flex:"1"},E.a.createElement("aside",{className:Oe.a.cardList},pe==null||((Un=pe.exercise_question_types)===null||Un===void 0)?void 0:Un.map(function(Ft,me){return E.a.createElement(M.Fragment,{key:Ft.question_type},qr(Ft,me))}))))),E.a.createElement("div",{className:Oe.a.fold,onClick:function(){return Qi(!yi)}},yi&&E.a.createElement("span",{className:"icon-zuojiantou iconfont c-grey-c"}),!yi&&E.a.createElement("span",{className:"icon-youjiantou iconfont c-grey-c"}))))),E.a.createElement(I.a,{flex:"1"},E.a.createElement("section",{className:[Oe.a.bg,"pl30","pr30","pb30","mb50","ml20"].join(" ")},E.a.createElement("div",{style:{maxHeight:600,overflow:"hidden auto"}},Ra()),E.a.createElement("div",{style:{marginTop:60,textAlign:"center"}},(tn!=0||rn!=0)&&E.a.createElement(D.a,{className:"".concat(Oe.a.submitButton," mr10"),type:"default",onClick:function(){var me;if(pe.exercise_question_types[tn].items[rn].israp=!1,Pt(Object(T.a)({},pe)),!$i&&(pe==null||((me=pe.exercise)===null||me===void 0)?void 0:me.user_exercise_status)===0&&Object(ue.s)()){var ut,it,Dt,ht;if(!((ut=pe.exercise_question_types)!==null&&ut!==void 0&&(it=ut[tn])!==null&&it!==void 0&&(Dt=it.items)!==null&&Dt!==void 0&&(ht=Dt[rn])!==null&&ht!==void 0&&ht.repeat_answer)){$n(!0),Vr(1);return}}rn===0?(tn-=1,rn=pe.exercise_question_types[tn].items.length-1):rn-=1,pn(tn),Zi(rn)}},"\u4E0A\u4E00\u9898"),!(tn===(pe==null||((Pn=pe.exercise_question_types)===null||Pn===void 0)?void 0:Pn.length)-1&&rn===(pe==null||((Vn=pe.exercise_question_types)===null||Vn===void 0||((V=Vn[tn])===null||V===void 0||((S=V.items)===null||S===void 0)))?void 0:S.length)-1)&&E.a.createElement(D.a,{className:Oe.a.submitButton,type:"primary",onClick:function(){var me;if(pe.exercise_question_types[tn].items[rn].israp=!1,Pt(Object(T.a)({},pe)),!$i&&(pe==null||((me=pe.exercise)===null||me===void 0)?void 0:me.user_exercise_status)===0&&Object(ue.s)()){var ut,it,Dt,ht;if(!((ut=pe.exercise_question_types)!==null&&ut!==void 0&&(it=ut[tn])!==null&&it!==void 0&&(Dt=it.items)!==null&&Dt!==void 0&&(ht=Dt[rn])!==null&&ht!==void 0&&ht.repeat_answer)){$n(!0),Vr(2);return}}pe.exercise_question_types[tn].items.length-1===rn?(tn=tn+1,rn=0):rn=rn+1,pn(tn),Zi(rn)}},"\u4E0B\u4E00\u9898")))),E.a.createElement(A.a,{title:"\u6CE8\u610F",visible:bn,onCancel:function(){return $n(!1)},footer:!1},E.a.createElement("div",null,E.a.createElement("p",{style:{marginBottom:0}},"\u79BB\u5F00\u8BE5\u9898\u540E\u4E0D\u5141\u8BB8\u518D\u6B21\u4FEE\u6539\u7B54\u6848\uFF0C\u786E\u8BA4\u79BB\u5F00\u5417\uFF1F"),E.a.createElement("div",{style:{marginTop:60,display:"flex",justifyContent:"space-between"}},E.a.createElement(c.a,{checked:$i,onChange:function(me){Ar(me.target.checked)}},"\u4E0B\u6B21\u4E0D\u518D\u663E\u793A"),E.a.createElement("div",null,E.a.createElement(D.a,{onClick:function(){pe.exercise_question_types[tn].items[rn].israp?(pe.exercise_question_types[tn].items[rn].israp=!0,Pt(Object(T.a)({},pe))):pe.exercise_question_types[tn].items[rn].israp===""&&(pe.exercise_question_types[tn].items[rn].israp=!0,Pt(Object(T.a)({},pe)))}},"\u6211\u518D\u60F3\u60F3"),E.a.createElement(D.a,{onClick:function(){pe.exercise_question_types[tn].items[rn].israp=!1,Pt(Object(T.a)({},pe)),zr===1?(rn===0?(tn-=1,rn=pe.exercise_question_types[tn].items.length-1):rn-=1,console.log(pe.exercise_question_types[tn].items[rn],"-----"),pn(tn),Zi(rn)):zr===2?(pe.exercise_question_types[tn].items.length-1===rn?(tn=tn+1,rn=0):rn=rn+1,pn(tn),Zi(rn)):(pn(Xr.oneindex),Zi(Xr.twoindex)),$n(!1)},type:"primary",style:{marginLeft:30}},"\u786E\u8BA4")))))),Sn.status!==0&&E.a.createElement(ge,{data:Sn})))},pt=Ne.default=Object(U.a)(function(Xe){var Ge=Xe.loading,De=Xe.user,oe=Xe.globalSetting;return{globalSetting:oe,user:De,loading:Ge.effects}})(Et)},cRFk:function(qe,Ne,K){qe.exports=K.p+"static/RepositoryNoneData.828085a8.png"},csWT:function(qe,Ne,K){qe.exports=K.p+"static/choose.4ad1045f.svg"},dejd:function(qe,Ne,K){},djh8:function(qe,Ne,K){qe.exports=K.p+"static/qrCode.d852fdfc.png"},dmUQ:function(qe,Ne,K){"use strict";var te=K("Ff2n"),Q=K("rePB"),N=K("1OyB"),J=K("vuIU"),B=K("Ji7U"),D=K("md7G"),H=K("foSv"),F=K("q1tI"),k=K.n(F),I=K("TSYQ"),_=K.n(I),v=K("4IlW");function p(h,u){var x=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);u&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(h,y).enumerable})),x.push.apply(x,g)}return x}function c(h){for(var u=1;u<arguments.length;u++){var x=arguments[u]!=null?arguments[u]:{};u%2?p(Object(x),!0).forEach(function(g){Object(Q.a)(h,g,x[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(x)):p(Object(x)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(x,g))})}return h}function a(h){var u=l();return function(){var g=Object(H.a)(h),y;if(u){var M=Object(H.a)(this).constructor;y=Reflect.construct(g,arguments,M)}else y=g.apply(this,arguments);return Object(D.a)(this,y)}}function l(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function o(){}function r(h){h.preventDefault()}var s=function(u){return u.replace(/[^\w.-]+/g,"")},d=200,R=600,A=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(u){return u!=null},w=function(u,x){return x===u||typeof x=="number"&&typeof u=="number"&&isNaN(x)&&isNaN(u)},C=function(h){Object(B.a)(x,h);var u=a(x);function x(g){var y;Object(N.a)(this,x),y=u.call(this,g),y.onKeyDown=function(j){var G=y.props,U=G.onKeyDown,O=G.onPressEnter;if(j.keyCode===v.a.UP){var X=y.getRatio(j);y.up(j,X,null),y.stop()}else if(j.keyCode===v.a.DOWN){var $=y.getRatio(j);y.down(j,$,null),y.stop()}else j.keyCode===v.a.ENTER&&O&&O(j);if(y.recordCursorPosition(),y.lastKeyCode=j.keyCode,U){for(var se=arguments.length,ce=new Array(se>1?se-1:0),Pe=1;Pe<se;Pe++)ce[Pe-1]=arguments[Pe];U.apply(void 0,[j].concat(ce))}},y.onKeyUp=function(j){var G=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),G){for(var U=arguments.length,O=new Array(U>1?U-1:0),X=1;X<U;X++)O[X-1]=arguments[X];G.apply(void 0,[j].concat(O))}},y.onChange=function(j){var G=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(j)),y.setState({inputValue:y.rawInput}),G(y.toNumber(y.rawInput))},y.onMouseUp=function(){var j=y.props.onMouseUp;y.recordCursorPosition(),j&&j.apply(void 0,arguments)},y.onFocus=function(){var j;y.setState({focused:!0}),(j=y.props).onFocus.apply(j,arguments)},y.onBlur=function(){var j=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var G=y.getCurrentValidValue(y.state.inputValue),U=y.setValue(G,o);if(j){var O=y.input.value,X=y.getInputDisplayValue({focus:!1,value:U});y.input.value=X&&Number(X),j.apply(void 0,arguments),y.input.value=O}},y.getRatio=function(j){var G=1;return j.metaKey||j.ctrlKey?G=.1:j.shiftKey&&(G=10),G},y.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},y.getPrecision=function(j){if(T(y.props.precision))return y.props.precision;var G=String(j);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var U=0;return G.indexOf(".")>=0&&(U=G.length-G.indexOf(".")-1),U},y.getInputDisplayValue=function(j){var G=j||y.state,U=G.focused,O=G.inputValue,X=G.value,$;U?$=O:$=y.toPrecisionAsStep(X),$==null&&($="");var se=y.formatWrapper($);return T(y.props.decimalSeparator)&&(se=se.toString().replace(".",y.props.decimalSeparator)),se},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(j){}},y.restoreByAfter=function(j){if(j===void 0)return!1;var G=y.input.value,U=G.lastIndexOf(j);if(U===-1)return!1;var O=y.cursorBefore.length;return y.lastKeyCode===v.a.DELETE&&y.cursorBefore.charAt(O-1)===j[0]?(y.fixCaret(O,O),!0):U+j.length===G.length?(y.fixCaret(U,U),!0):!1},y.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(G,U){var O=j.substring(U);return y.restoreByAfter(O)})},y.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(j,G,U){y.pressingUpOrDown=!0,y.step("down",j,G,U)},y.up=function(j,G,U){y.pressingUpOrDown=!0,y.step("up",j,G,U)},y.saveInput=function(j){y.input=j};var M=g.value;M===void 0&&(M=g.defaultValue),y.state={focused:g.autoFocus};var E=y.getValidValue(y.toNumber(M));return y.state=c(c({},y.state),{},{inputValue:y.toPrecisionAsStep(E),value:E}),y}return Object(J.a)(x,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var M=this.props,E=M.value,j=M.onChange,G=M.max,U=M.min,O=this.state.focused;if(y){if(!w(y.value,E)||!w(y.max,G)||!w(y.min,U)){var X=O?E:this.getValidValue(E),$;this.pressingUpOrDown?$=X:this.inputting?$=this.rawInput:$=this.toPrecisionAsStep(X),this.setState({value:X,inputValue:$})}var se="value"in this.props?E:this.state.value;"max"in this.props&&y.max!==G&&typeof se=="number"&&se>G&&j&&j(G),"min"in this.props&&y.min!==U&&typeof se=="number"&&se<U&&j&&j(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ce=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===v.a.BACKSPACE?ce=this.cursorStart-1:this.lastKeyCode===v.a.DELETE&&(ce=this.cursorStart):ce=this.input.value.length,this.fixCaret(ce,ce)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case v.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case v.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Pe){}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(y){var M=y;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(y){var M=y.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(y);return isNaN(j)?y:(j<M&&(j=M),j>E&&(j=E),j)}},{key:"setValue",value:function(y,M){var E=this.props.precision,j=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),G=this.state.value,U=G===void 0?null:G,O=this.state.inputValue,X=O===void 0?null:O,$=typeof j=="number"?j.toFixed(E):"".concat(j),se=j!==U||$!=="".concat(X);return"value"in this.props?(X=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:X},M)):this.setState({value:j,inputValue:this.toPrecisionAsStep(y)},M),se&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,E=this.props,j=E.precision,G=E.step;if(T(j))return j;var U=this.getPrecision(M),O=this.getPrecision(G),X=this.getPrecision(y);return y?Math.max(X,U+O):U+O}},{key:"getPrecisionFactor",value:function(y){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,E=this.getMaxPrecision(y,M);return Math.pow(10,E)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var M=Math.abs(this.getMaxPrecision(y));return isNaN(M)?y.toString():Number(y).toFixed(M)}},{key:"toNumber",value:function(y){var M=this.props.precision,E=this.state.focused,j=y&&y.length>16&&E;return this.isNotCompleteNumber(y)||j?y:T(M)?Math.round(y*Math.pow(10,M))/Math.pow(10,M):Number(y)}},{key:"upStep",value:function(y,M){var E=this.props.step,j=this.getPrecisionFactor(y,M),G=Math.abs(this.getMaxPrecision(y,M)),U=((j*y+j*E*M)/j).toFixed(G);return this.toNumber(U)}},{key:"downStep",value:function(y,M){var E=this.props.step,j=this.getPrecisionFactor(y,M),G=Math.abs(this.getMaxPrecision(y,M)),U=((j*y-j*E*M)/j).toFixed(G);return this.toNumber(U)}},{key:"step",value:function(y,M){var E=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var U=this.props;if(U.disabled)return;var O=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(O))return;var X=this["".concat(y,"Step")](O,j),$=X>U.max||X<U.min;if(X>U.max?X=U.max:X<U.min&&(X=U.min),this.setValue(X,null),this.setState({focused:!0},function(){E.pressingUpOrDown=!1}),$)return;this.autoStepTimer=setTimeout(function(){E[y](M,j,!0)},G?d:R)}},{key:"fixCaret",value:function(y,M){if(y===void 0||M===void 0||!this.input||!this.input.value)return;try{var E=this.input.selectionStart,j=this.input.selectionEnd;(y!==E||M!==j)&&this.input.setSelectionRange(y,M)}catch(G){}}},{key:"render",value:function(){var y,M=this.props,E=M.prefixCls,j=M.disabled,G=M.readOnly,U=M.useTouch,O=M.autoComplete,X=M.upHandler,$=M.downHandler,se=M.className,ce=M.max,Pe=M.min,Se=M.style,Re=M.title,Oe=M.onMouseEnter,Me=M.onMouseLeave,be=M.onMouseOver,ue=M.onMouseOut,ne=M.required,ve=M.onClick,le=M.tabIndex,ke=M.type,Fe=M.placeholder,Ie=M.id,He=M.inputMode,$e=M.pattern,tt=M.step,Qe=M.maxLength,Je=M.autoFocus,Ye=M.name,gt=M.onPaste,_t=M.onInput,vt=Object(te.a)(M,["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"]),dt=this.state,Ct=dt.value,xt=dt.focused,Le=_()(E,(y={},Object(Q.a)(y,se,!!se),Object(Q.a)(y,"".concat(E,"-disabled"),j),Object(Q.a)(y,"".concat(E,"-focused"),xt),y)),Ce={};Object.keys(vt).forEach(function(ye){(ye.substr(0,5)==="data-"||ye.substr(0,5)==="aria-"||ye==="role")&&(Ce[ye]=vt[ye])});var nt=!G&&!j,rt=this.getInputDisplayValue(null),Be=(Ct||Ct===0)&&(isNaN(Ct)||Number(Ct)>=ce),et=(Ct||Ct===0)&&(isNaN(Ct)||Number(Ct)<=Pe),xe=Be||j||G,fe=et||j||G,ge=_()("".concat(E,"-handler"),"".concat(E,"-handler-up"),Object(Q.a)({},"".concat(E,"-handler-up-disabled"),xe)),re=_()("".concat(E,"-handler"),"".concat(E,"-handler-down"),Object(Q.a)({},"".concat(E,"-handler-down-disabled"),fe)),ae=U?{onTouchStart:xe?o:this.up,onTouchEnd:this.stop}:{onMouseDown:xe?o:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},de=U?{onTouchStart:fe?o:this.down,onTouchEnd:this.stop}:{onMouseDown:fe?o:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:Le,style:Se,title:Re,onMouseEnter:Oe,onMouseLeave:Me,onMouseOver:be,onMouseOut:ue,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(E,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},ae,{role:"button","aria-label":"Increase Value","aria-disabled":xe,className:ge}),X||k.a.createElement("span",{unselectable:"on",className:"".concat(E,"-handler-up-inner"),onClick:r})),k.a.createElement("span",Object.assign({unselectable:"on"},de,{role:"button","aria-label":"Decrease Value","aria-disabled":fe,className:re}),$||k.a.createElement("span",{unselectable:"on",className:"".concat(E,"-handler-down-inner"),onClick:r}))),k.a.createElement("div",{className:"".concat(E,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Pe,"aria-valuemax":ce,"aria-valuenow":Ct,required:ne,type:ke,placeholder:Fe,onPaste:gt,onClick:ve,onMouseUp:this.onMouseUp,className:"".concat(E,"-input"),tabIndex:le,autoComplete:O,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:o,onKeyUp:nt?this.onKeyUp:o,autoFocus:Je,maxLength:Qe,readOnly:G,disabled:j,max:ce,min:Pe,step:tt,name:Ye,title:Re,id:Ie,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:$e,inputMode:He,onInput:_t},Ce))))}}]),x}(k.a.Component);C.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:A,min:-A,step:1,style:{},onChange:o,onKeyDown:o,onPressEnter:o,onFocus:o,onBlur:o,parser:s,required:!1,autoComplete:"off"};var b=C,m=Ne.a=b},fyJ8:function(qe,Ne,K){"use strict";var te=K("rePB"),Q=K("VTBJ"),N=K("Ff2n"),J=K("U8pU"),B=K("q1tI"),D=K.n(B),H=K("TSYQ"),F=K.n(H),k=K("c+Xe"),I=K("sR1s");function _(l){return l&&Object(J.a)(l)==="object"&&!Array.isArray(l)&&!B.isValidElement(l)}function v(l){return typeof l=="string"?!0:Object(k.c)(l)}function p(l,o){var r,s=l.prefixCls,d=l.className,R=l.record,A=l.index,T=l.dataIndex,w=l.render,C=l.children,b=l.component,m=b===void 0?"td":b,h=l.colSpan,u=l.rowSpan,x=l.fixLeft,g=l.fixRight,y=l.firstFixLeft,M=l.lastFixLeft,E=l.firstFixRight,j=l.lastFixRight,G=l.appendNode,U=l.additionalProps,O=U===void 0?{}:U,X=l.ellipsis,$=l.align,se=l.rowType,ce=l.isSticky,Pe="".concat(s,"-cell"),Se,Re;if(C)Re=C;else{var Oe=Object(I.b)(R,T);if(Re=Oe,w){var Me=w(Oe,R,A);_(Me)?(Re=Me.children,Se=Me.props):Re=Me}}Object(J.a)(Re)==="object"&&!Array.isArray(Re)&&!B.isValidElement(Re)&&(Re=null),X&&(M||E)&&(Re=B.createElement("span",{className:"".concat(Pe,"-content")},Re));var be=Se||{},ue=be.colSpan,ne=be.rowSpan,ve=be.style,le=be.className,ke=Object(N.a)(be,["colSpan","rowSpan","style","className"]),Fe=ue!==void 0?ue:h,Ie=ne!==void 0?ne:u;if(Fe===0||Ie===0)return null;var He={},$e=typeof x=="number",tt=typeof g=="number";$e&&(He.position="sticky",He.left=x),tt&&(He.position="sticky",He.right=g);var Qe={};$&&(Qe.textAlign=$);var Je,Ye=X===!0?{showTitle:!0}:X;Ye&&(Ye.showTitle||se==="header")&&(typeof Re=="string"||typeof Re=="number"?Je=Re.toString():B.isValidElement(Re)&&typeof Re.props.children=="string"&&(Je=Re.props.children));var gt=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:Je},ke),O),{},{colSpan:Fe&&Fe!==1?Fe:null,rowSpan:Ie&&Ie!==1?Ie:null,className:F()(Pe,d,(r={},Object(te.a)(r,"".concat(Pe,"-fix-left"),$e),Object(te.a)(r,"".concat(Pe,"-fix-left-first"),y),Object(te.a)(r,"".concat(Pe,"-fix-left-last"),M),Object(te.a)(r,"".concat(Pe,"-fix-right"),tt),Object(te.a)(r,"".concat(Pe,"-fix-right-first"),E),Object(te.a)(r,"".concat(Pe,"-fix-right-last"),j),Object(te.a)(r,"".concat(Pe,"-ellipsis"),X),Object(te.a)(r,"".concat(Pe,"-with-append"),G),Object(te.a)(r,"".concat(Pe,"-fix-sticky"),($e||tt)&&ce),r),O.className,le),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},O.style),Qe),He),ve),ref:v(m)?o:null});return B.createElement(m,Object.assign({},gt),G,Re)}var c=B.forwardRef(p);c.displayName="Cell";var a=B.memo(c,function(l,o){return o.shouldCellUpdate?!o.shouldCellUpdate(o.record,l.record):!1});Ne.a=a},h78n:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return y});var te=K("q1tI"),Q=K.n(te),N=K("TSYQ"),J=K.n(N),B={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},D=function(j){var G=j.map(function(){return Object(te.useRef)()}),U=Object(te.useRef)();return Object(te.useEffect)(function(){var O=Date.now(),X=!1;Object.keys(G).forEach(function($){var se=G[$].current;if(!se)return;X=!0;var ce=se.style;ce.transitionDuration=".3s, .3s, .3s, .06s",U.current&&O-U.current<100&&(ce.transitionDuration="0s, 0s")}),X&&(U.current=Date.now())}),[G]};function H(){return H=Object.assign||function(E){for(var j=1;j<arguments.length;j++){var G=arguments[j];for(var U in G)Object.prototype.hasOwnProperty.call(G,U)&&(E[U]=G[U])}return E},H.apply(this,arguments)}function F(E,j){return p(E)||v(E,j)||I(E,j)||k()}function k(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I(E,j){if(!E)return;if(typeof E=="string")return _(E,j);var G=Object.prototype.toString.call(E).slice(8,-1);if(G==="Object"&&E.constructor&&(G=E.constructor.name),G==="Map"||G==="Set")return Array.from(E);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return _(E,j)}function _(E,j){(j==null||j>E.length)&&(j=E.length);for(var G=0,U=new Array(j);G<j;G++)U[G]=E[G];return U}function v(E,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(E)))return;var G=[],U=!0,O=!1,X=void 0;try{for(var $=E[Symbol.iterator](),se;!(U=(se=$.next()).done)&&!(G.push(se.value),j&&G.length===j);U=!0);}catch(ce){O=!0,X=ce}finally{try{!U&&$.return!=null&&$.return()}finally{if(O)throw X}}return G}function p(E){if(Array.isArray(E))return E}function c(E,j){if(E==null)return{};var G=a(E,j),U,O;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(E);for(O=0;O<X.length;O++){if(U=X[O],j.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(E,U))continue;G[U]=E[U]}}return G}function a(E,j){if(E==null)return{};var G={},U=Object.keys(E),O,X;for(X=0;X<U.length;X++){if(O=U[X],j.indexOf(O)>=0)continue;G[O]=E[O]}return G}var l=function(j){var G=j.className,U=j.percent,O=j.prefixCls,X=j.strokeColor,$=j.strokeLinecap,se=j.strokeWidth,ce=j.style,Pe=j.trailColor,Se=j.trailWidth,Re=j.transition,Oe=c(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Oe.gapPosition;var Me=Array.isArray(U)?U:[U],be=Array.isArray(X)?X:[X],ue=D(Me),ne=F(ue,1),ve=ne[0],le=se/2,ke=100-se/2,Fe="M ".concat($==="round"?le:0,",").concat(le,`
L `).concat($==="round"?ke:100,",").concat(le),Ie="0 0 100 ".concat(se),He=0;return Q.a.createElement("svg",H({className:J()("".concat(O,"-line"),G),viewBox:Ie,preserveAspectRatio:"none",style:ce},Oe),Q.a.createElement("path",{className:"".concat(O,"-line-trail"),d:Fe,strokeLinecap:$,stroke:Pe,strokeWidth:Se||se,fillOpacity:"0"}),Me.map(function($e,tt){var Qe={strokeDasharray:"".concat($e,"px, 100px"),strokeDashoffset:"-".concat(He,"px"),transition:Re||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Je=be[tt]||be[be.length-1];return He+=$e,Q.a.createElement("path",{key:tt,className:"".concat(O,"-line-path"),d:Fe,strokeLinecap:$,stroke:Je,strokeWidth:se,fillOpacity:"0",ref:ve[tt],style:Qe})}))};l.defaultProps=B;var o=l;function r(){return r=Object.assign||function(E){for(var j=1;j<arguments.length;j++){var G=arguments[j];for(var U in G)Object.prototype.hasOwnProperty.call(G,U)&&(E[U]=G[U])}return E},r.apply(this,arguments)}function s(E,j){return w(E)||T(E,j)||R(E,j)||d()}function d(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(E,j){if(!E)return;if(typeof E=="string")return A(E,j);var G=Object.prototype.toString.call(E).slice(8,-1);if(G==="Object"&&E.constructor&&(G=E.constructor.name),G==="Map"||G==="Set")return Array.from(E);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return A(E,j)}function A(E,j){(j==null||j>E.length)&&(j=E.length);for(var G=0,U=new Array(j);G<j;G++)U[G]=E[G];return U}function T(E,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(E)))return;var G=[],U=!0,O=!1,X=void 0;try{for(var $=E[Symbol.iterator](),se;!(U=(se=$.next()).done)&&!(G.push(se.value),j&&G.length===j);U=!0);}catch(ce){O=!0,X=ce}finally{try{!U&&$.return!=null&&$.return()}finally{if(O)throw X}}return G}function w(E){if(Array.isArray(E))return E}function C(E,j){if(E==null)return{};var G=b(E,j),U,O;if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(E);for(O=0;O<X.length;O++){if(U=X[O],j.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(E,U))continue;G[U]=E[U]}}return G}function b(E,j){if(E==null)return{};var G={},U=Object.keys(E),O,X;for(X=0;X<U.length;X++){if(O=U[X],j.indexOf(O)>=0)continue;G[O]=E[O]}return G}var m=0;function h(E){return+E.replace("%","")}function u(E){return Array.isArray(E)?E:[E]}function x(E,j,G,U){var O=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,X=arguments.length>5?arguments[5]:void 0,$=50-U/2,se=0,ce=-$,Pe=0,Se=-2*$;switch(X){case"left":se=-$,ce=0,Pe=2*$,Se=0;break;case"right":se=$,ce=0,Pe=-2*$,Se=0;break;case"bottom":ce=$,Se=2*$;break;default:}var Re="M 50,50 m ".concat(se,",").concat(ce,`
a `).concat($,",").concat($," 0 1 1 ").concat(Pe,",").concat(-Se,`
a `).concat($,",").concat($," 0 1 1 ").concat(-Pe,",").concat(Se),Oe=Math.PI*2*$,Me={stroke:G,strokeDasharray:"".concat(j/100*(Oe-O),"px ").concat(Oe,"px"),strokeDashoffset:"-".concat(O/2+E/100*(Oe-O),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Re,pathStyle:Me}}var g=function(j){var G=j.prefixCls,U=j.strokeWidth,O=j.trailWidth,X=j.gapDegree,$=j.gapPosition,se=j.trailColor,ce=j.strokeLinecap,Pe=j.style,Se=j.className,Re=j.strokeColor,Oe=j.percent,Me=C(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),be=Object(te.useMemo)(function(){return m+=1,m},[]),ue=x(0,100,se,U,X,$),ne=ue.pathString,ve=ue.pathStyle,le=u(Oe),ke=u(Re),Fe=ke.find(function(Qe){return Object.prototype.toString.call(Qe)==="[object Object]"}),Ie=D(le),He=s(Ie,1),$e=He[0],tt=function(){var Je=0;return le.map(function(Ye,gt){var _t=ke[gt]||ke[ke.length-1],vt=Object.prototype.toString.call(_t)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(be,")"):"",dt=x(Je,Ye,_t,U,X,$);return Je+=Ye,Q.a.createElement("path",{key:gt,className:"".concat(G,"-circle-path"),d:dt.pathString,stroke:vt,strokeLinecap:ce,strokeWidth:U,opacity:Ye===0?0:1,fillOpacity:"0",style:dt.pathStyle,ref:$e[gt]})})};return Q.a.createElement("svg",r({className:J()("".concat(G,"-circle"),Se),viewBox:"0 0 100 100",style:Pe},Me),Fe&&Q.a.createElement("defs",null,Q.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(be),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Fe).sort(function(Qe,Je){return h(Qe)-h(Je)}).map(function(Qe,Je){return Q.a.createElement("stop",{key:Je,offset:Qe,stopColor:Fe[Qe]})}))),Q.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:ne,stroke:se,strokeLinecap:ce,strokeWidth:O||U,fillOpacity:"0",style:ve}),tt().reverse())};g.defaultProps=B;var y=g,M={Line:o,Circle:y}},hW8S:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return J}),K.d(Ne,"c",function(){return B}),K.d(Ne,"b",function(){return D});var te=K("VTBJ"),Q=K("Ff2n"),N=K("Kwbf"),J="RC_TABLE_INTERNAL_COL_DEFINE";function B(H){var F=H.expandable,k=Object(Q.a)(H,["expandable"]);return"expandable"in H?Object(te.a)(Object(te.a)({},k),F):k}function D(H){return Object.keys(H).reduce(function(F,k){return(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-")&&(F[k]=H[k]),F},{})}},ji0R:function(qe,Ne,K){qe.exports=K.p+"static/douyu.3e6df9ee.jpg"},kPWJ:function(qe,Ne,K){qe.exports=K.p+"static/question.cb52bef9.gif"},kPYp:function(qe,Ne){qe.exports="data:image/png;base64,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"},kSUc:function(qe,Ne,K){},l2Kq:function(qe,Ne,K){qe.exports=K.p+"static/match_ad.24dc22fd.jpg"},lZu9:function(qe,Ne,K){(function(te){te(K("VrN/"),K("1eCo"),K("8EBN"))})(function(te){"use strict";te.defineMode("markdown",function(Q,N){var J=te.getMode(Q,"text/html"),B=J.name=="null";function D(U){if(te.findModeByName){var O=te.findModeByName(U);O&&(U=O.mime||O.mimes[0])}var X=te.getMode(Q,U);return X.name=="null"?null:X}N.highlightFormatting===void 0&&(N.highlightFormatting=!1),N.maxBlockquoteDepth===void 0&&(N.maxBlockquoteDepth=0),N.taskLists===void 0&&(N.taskLists=!1),N.strikethrough===void 0&&(N.strikethrough=!1),N.emoji===void 0&&(N.emoji=!1),N.fencedCodeBlockHighlighting===void 0&&(N.fencedCodeBlockHighlighting=!0),N.fencedCodeBlockDefaultMode===void 0&&(N.fencedCodeBlockDefaultMode="text/plain"),N.xml===void 0&&(N.xml=!0),N.tokenTypeOverrides===void 0&&(N.tokenTypeOverrides={});var H={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var F in H)H.hasOwnProperty(F)&&N.tokenTypeOverrides[F]&&(H[F]=N.tokenTypeOverrides[F]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,_=/^\[(x| )\](?=\s)/i,v=N.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,l=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,r=" ";function s(U,O,X){return O.f=O.inline=X,X(U,O)}function d(U,O,X){return O.f=O.block=X,X(U,O)}function R(U){return!U||!/\S/.test(U.string)}function A(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==w){var O=B;if(!O){var X=te.innerMode(J,U.htmlState);O=X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText}O&&(U.f=h,U.block=T,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function T(U,O){var X=U.column()===O.indentation,$=R(O.prevLine.stream),se=O.indentedCode,ce=O.prevLine.hr,Pe=O.list!==!1,Se=(O.listStack[O.listStack.length-1]||0)+3;O.indentedCode=!1;var Re=O.indentation;if(O.indentationDiff===null&&(O.indentationDiff=O.indentation,Pe)){for(O.list=null;Re<O.listStack[O.listStack.length-1];)O.listStack.pop(),O.listStack.length?O.indentation=O.listStack[O.listStack.length-1]:O.list=!1;O.list!==!1&&(O.indentationDiff=Re-O.listStack[O.listStack.length-1])}var Oe=!$&&!ce&&!O.prevLine.header&&(!Pe||!se)&&!O.prevLine.fencedCodeEnd,Me=(O.list===!1||ce||$)&&O.indentation<=Se&&U.match(k),be=null;if(O.indentationDiff>=4&&(se||O.prevLine.fencedCodeEnd||O.prevLine.header||$))return U.skipToEnd(),O.indentedCode=!0,H.code;if(U.eatSpace())return null;if(X&&O.indentation<=Se&&(be=U.match(v))&&be[1].length<=6)return O.quote=0,O.header=be[1].length,O.thisLine.header=!0,N.highlightFormatting&&(O.formatting="header"),O.f=O.inline,b(O);if(O.indentation<=Se&&U.eat(">"))return O.quote=X?1:O.quote+1,N.highlightFormatting&&(O.formatting="quote"),U.eatSpace(),b(O);if(!Me&&!O.setext&&X&&O.indentation<=Se&&(be=U.match(I))){var ue=be[1]?"ol":"ul";return O.indentation=Re+U.current().length,O.list=!0,O.quote=0,O.listStack.push(O.indentation),O.em=!1,O.strong=!1,O.code=!1,O.strikethrough=!1,N.taskLists&&U.match(_,!1)&&(O.taskList=!0),O.f=O.inline,N.highlightFormatting&&(O.formatting=["list","list-"+ue]),b(O)}else{if(X&&O.indentation<=Se&&(be=U.match(a,!0)))return O.quote=0,O.fencedEndRE=new RegExp(be[1]+"+ *$"),O.localMode=N.fencedCodeBlockHighlighting&&D(be[2]||N.fencedCodeBlockDefaultMode),O.localMode&&(O.localState=te.startState(O.localMode)),O.f=O.block=C,N.highlightFormatting&&(O.formatting="code-block"),O.code=-1,b(O);if(O.setext||(!Oe||!Pe)&&!O.quote&&O.list===!1&&!O.code&&!Me&&!l.test(U.string)&&(be=U.lookAhead(1))&&(be=be.match(p)))return O.setext?(O.header=O.setext,O.setext=0,U.skipToEnd(),N.highlightFormatting&&(O.formatting="header")):(O.header=be[0].charAt(0)=="="?1:2,O.setext=O.header),O.thisLine.header=!0,O.f=O.inline,b(O);if(Me)return U.skipToEnd(),O.hr=!0,O.thisLine.hr=!0,H.hr;if(U.peek()==="[")return s(U,O,M)}return s(U,O,O.inline)}function w(U,O){var X=J.token(U,O.htmlState);if(!B){var $=te.innerMode(J,O.htmlState);($.mode.name=="xml"&&$.state.tagStart===null&&!$.state.context&&$.state.tokenize.isInText||O.md_inside&&U.current().indexOf(">")>-1)&&(O.f=h,O.block=T,O.htmlState=null)}return X}function C(U,O){var X=O.listStack[O.listStack.length-1]||0,$=O.indentation<X,se=X+3;if(O.fencedEndRE&&O.indentation<=se&&($||U.match(O.fencedEndRE))){N.highlightFormatting&&(O.formatting="code-block");var ce;return $||(ce=b(O)),O.localMode=O.localState=null,O.block=T,O.f=h,O.fencedEndRE=null,O.code=0,O.thisLine.fencedCodeEnd=!0,$?d(U,O,O.block):ce}else return O.localMode?O.localMode.token(U,O.localState):(U.skipToEnd(),H.code)}function b(U){var O=[];if(U.formatting){O.push(H.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var X=0;X<U.formatting.length;X++)O.push(H.formatting+"-"+U.formatting[X]),U.formatting[X]==="header"&&O.push(H.formatting+"-"+U.formatting[X]+"-"+U.header),U.formatting[X]==="quote"&&(!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=U.quote?O.push(H.formatting+"-"+U.formatting[X]+"-"+U.quote):O.push("error"))}if(U.taskOpen)return O.push("meta"),O.length?O.join(" "):null;if(U.taskClosed)return O.push("property"),O.length?O.join(" "):null;if(U.linkHref?O.push(H.linkHref,"url"):(U.strong&&O.push(H.strong),U.em&&O.push(H.em),U.strikethrough&&O.push(H.strikethrough),U.emoji&&O.push(H.emoji),U.linkText&&O.push(H.linkText),U.code&&O.push(H.code),U.image&&O.push(H.image),U.imageAltText&&O.push(H.imageAltText,"link"),U.imageMarker&&O.push(H.imageMarker)),U.header&&O.push(H.header,H.header+"-"+U.header),U.quote&&(O.push(H.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=U.quote?O.push(H.quote+"-"+U.quote):O.push(H.quote+"-"+N.maxBlockquoteDepth)),U.list!==!1){var $=(U.listStack.length-1)%3;$?$===1?O.push(H.list2):O.push(H.list3):O.push(H.list1)}return U.trailingSpaceNewLine?O.push("trailing-space-new-line"):U.trailingSpace&&O.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),O.length?O.join(" "):null}function m(U,O){return U.match(c,!0)?b(O):void 0}function h(U,O){var X=O.text(U,O);if(typeof X!="undefined")return X;if(O.list)return O.list=null,b(O);if(O.taskList){var $=U.match(_,!0)[1]===" ";return $?O.taskOpen=!0:O.taskClosed=!0,N.highlightFormatting&&(O.formatting="task"),O.taskList=!1,b(O)}if(O.taskOpen=!1,O.taskClosed=!1,O.header&&U.match(/^#+$/,!0))return N.highlightFormatting&&(O.formatting="header"),b(O);var se=U.next();if(O.linkTitle){O.linkTitle=!1;var ce=se;se==="("&&(ce=")"),ce=(ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Pe="^\\s*(?:[^"+ce+"\\\\]+|\\\\\\\\|\\\\.)"+ce;if(U.match(new RegExp(Pe),!0))return H.linkHref}if(se==="`"){var Se=O.formatting;N.highlightFormatting&&(O.formatting="code"),U.eatWhile("`");var Re=U.current().length;if(O.code==0&&(!O.quote||Re==1))return O.code=Re,b(O);if(Re==O.code){var Oe=b(O);return O.code=0,Oe}else return O.formatting=Se,b(O)}else if(O.code)return b(O);if(se==="\\"&&(U.next(),N.highlightFormatting)){var Me=b(O),be=H.formatting+"-escape";return Me?Me+" "+be:be}if(se==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return O.imageMarker=!0,O.image=!0,N.highlightFormatting&&(O.formatting="image"),b(O);if(se==="["&&O.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return O.imageMarker=!1,O.imageAltText=!0,N.highlightFormatting&&(O.formatting="image"),b(O);if(se==="]"&&O.imageAltText){N.highlightFormatting&&(O.formatting="image");var Me=b(O);return O.imageAltText=!1,O.image=!1,O.inline=O.f=x,Me}if(se==="["&&!O.image)return O.linkText&&U.match(/^.*?\]/)||(O.linkText=!0,N.highlightFormatting&&(O.formatting="link")),b(O);if(se==="]"&&O.linkText){N.highlightFormatting&&(O.formatting="link");var Me=b(O);return O.linkText=!1,O.inline=O.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?x:h,Me}if(se==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=u,N.highlightFormatting&&(O.formatting="link");var Me=b(O);return Me?Me+=" ":Me="",Me+H.linkInline}if(se==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){O.f=O.inline=u,N.highlightFormatting&&(O.formatting="link");var Me=b(O);return Me?Me+=" ":Me="",Me+H.linkEmail}if(N.xml&&se==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ue=U.string.indexOf(">",U.pos);if(ue!=-1){var ne=U.string.substring(U.start,ue);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(O.md_inside=!0)}return U.backUp(1),O.htmlState=te.startState(J),d(U,O,w)}if(N.xml&&se==="<"&&U.match(/^\/\w*?>/))return O.md_inside=!1,"tag";if(se==="*"||se==="_"){for(var ve=1,le=U.pos==1?" ":U.string.charAt(U.pos-2);ve<3&&U.eat(se);)ve++;var ke=U.peek()||" ",Fe=!/\s/.test(ke)&&(!o.test(ke)||/\s/.test(le)||o.test(le)),Ie=!/\s/.test(le)&&(!o.test(le)||/\s/.test(ke)||o.test(ke)),He=null,$e=null;if(ve%2&&(!O.em&&Fe&&(se==="*"||!Ie||o.test(le))?He=!0:O.em==se&&Ie&&(se==="*"||!Fe||o.test(ke))&&(He=!1)),ve>1&&(!O.strong&&Fe&&(se==="*"||!Ie||o.test(le))?$e=!0:O.strong==se&&Ie&&(se==="*"||!Fe||o.test(ke))&&($e=!1)),$e!=null||He!=null){N.highlightFormatting&&(O.formatting=He==null?"strong":$e==null?"em":"strong em"),He===!0&&(O.em=se),$e===!0&&(O.strong=se);var Oe=b(O);return He===!1&&(O.em=!1),$e===!1&&(O.strong=!1),Oe}}else if(se===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return b(O);U.backUp(1)}if(N.strikethrough){if(se==="~"&&U.eatWhile(se)){if(O.strikethrough){N.highlightFormatting&&(O.formatting="strikethrough");var Oe=b(O);return O.strikethrough=!1,Oe}else if(U.match(/^[^\s]/,!1))return O.strikethrough=!0,N.highlightFormatting&&(O.formatting="strikethrough"),b(O)}else if(se===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return b(O);U.backUp(2)}}if(N.emoji&&se===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){O.emoji=!0,N.highlightFormatting&&(O.formatting="emoji");var tt=b(O);return O.emoji=!1,tt}return se===" "&&(U.match(/^ +$/,!1)?O.trailingSpace++:O.trailingSpace&&(O.trailingSpaceNewLine=!0)),b(O)}function u(U,O){var X=U.next();if(X===">"){O.f=O.inline=h,N.highlightFormatting&&(O.formatting="link");var $=b(O);return $?$+=" ":$="",$+H.linkInline}return U.match(/^[^>]+/,!0),H.linkInline}function x(U,O){if(U.eatSpace())return null;var X=U.next();return X==="("||X==="["?(O.f=O.inline=y(X==="("?")":"]"),N.highlightFormatting&&(O.formatting="link-string"),O.linkHref=!0,b(O)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(U){return function(O,X){var $=O.next();if($===U){X.f=X.inline=h,N.highlightFormatting&&(X.formatting="link-string");var se=b(X);return X.linkHref=!1,se}return O.match(g[U]),X.linkHref=!0,b(X)}}function M(U,O){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(O.f=E,U.next(),N.highlightFormatting&&(O.formatting="link"),O.linkText=!0,b(O)):s(U,O,h)}function E(U,O){if(U.match(/^\]:/,!0)){O.f=O.inline=j,N.highlightFormatting&&(O.formatting="link");var X=b(O);return O.linkText=!1,X}return U.match(/^([^\]\\]|\\.)+/,!0),H.linkText}function j(U,O){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?O.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),O.f=O.inline=h,H.linkHref+" url")}var G={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:h,text:m,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&te.copyState(J,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?te.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,O){if(O.formatting=!1,U!=O.thisLine.stream){if(O.header=0,O.hr=!1,U.match(/^\s*$/,!0))return A(O),null;if(O.prevLine=O.thisLine,O.thisLine={stream:U},O.taskList=!1,O.trailingSpace=0,O.trailingSpaceNewLine=!1,!O.localState&&(O.f=O.block,O.f!=w)){var X=U.match(/^\s*/,!0)[0].replace(/\t/g,r).length;if(O.indentation=X,O.indentationDiff=null,X>0)return null}}return O.f(U,O)},innerMode:function(U){return U.block==w?{state:U.htmlState,mode:J}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:G}},indent:function(U,O,X){return U.block==w&&J.indent?J.indent(U.htmlState,O,X):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,O,X):te.Pass},blankLine:A,getType:b,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),te.defineMIME("text/markdown","markdown"),te.defineMIME("text/x-markdown","markdown")})},lzim:function(qe,Ne,K){"use strict";var te=K("E7E6"),Q=K.n(te);K.d(Ne,"x",function(){return Q.a});var N=K("/GNS"),J=K.n(N);K.d(Ne,"w",function(){return J.a});var B=K("FOrL"),D=K.n(B);K.d(Ne,"q",function(){return D.a});var H=K("HpTS"),F=K.n(H);K.d(Ne,"y",function(){return F.a});var k=K("tWlo"),I=K.n(k);K.d(Ne,"a",function(){return I.a});var _=K("7ZXX"),v=K.n(_);K.d(Ne,"l",function(){return v.a});var p=K("GABl"),c=K.n(p);K.d(Ne,"e",function(){return c.a});var a=K("onxn"),l=K.n(a);K.d(Ne,"n",function(){return l.a});var o=K("nKGa"),r=K.n(o);K.d(Ne,"m",function(){return r.a});var s=K("4qgm"),d=K.n(s);K.d(Ne,"A",function(){return d.a});var R=K("JeFH"),A=K.n(R);K.d(Ne,"b",function(){return A.a});var T=K("ji0R"),w=K.n(T);K.d(Ne,"i",function(){return w.a});var C=K("W6BS"),b=K.n(C);K.d(Ne,"B",function(){return b.a});var m=K("kPYp"),h=K.n(m);K.d(Ne,"C",function(){return h.a});var u=K("nukY"),x=K.n(u),g=K("4u4S"),y=K.n(g),M=K("yslc"),E=K.n(M),j=K("l2Kq"),G=K.n(j),U=K("RMFE"),O=K.n(U);K.d(Ne,"o",function(){return O.a});var X=K("TGq3"),$=K.n(X),se=K("SMhR"),ce=K.n(se);K.d(Ne,"z",function(){return ce.a});var Pe=K("8/bI"),Se=K.n(Pe);K.d(Ne,"j",function(){return Se.a});var Re=K("JWDV"),Oe=K.n(Re),Me=K("Xsq0"),be=K.n(Me);K.d(Ne,"p",function(){return be.a});var ue=K("Ohmc"),ne=K.n(ue);K.d(Ne,"c",function(){return ne.a});var ve=K("csWT"),le=K.n(ve);K.d(Ne,"d",function(){return le.a});var ke=K("7v3h"),Fe=K.n(ke);K.d(Ne,"k",function(){return Fe.a});var Ie=K("cRFk"),He=K.n(Ie);K.d(Ne,"v",function(){return He.a});var $e=K("kPWJ"),tt=K.n($e);K.d(Ne,"u",function(){return tt.a});var Qe=K("qgvg"),Je=K.n(Qe);K.d(Ne,"r",function(){return Je.a});var Ye=K("FPkq"),gt=K.n(Ye);K.d(Ne,"t",function(){return gt.a});var _t=K("A/g1"),vt=K.n(_t);K.d(Ne,"f",function(){return vt.a});var dt=K("Nmxd"),Ct=K.n(dt);K.d(Ne,"g",function(){return Ct.a});var xt=K("5D2P"),Le=K.n(xt);K.d(Ne,"h",function(){return Le.a});var Ce=K("djh8"),nt=K.n(Ce);K.d(Ne,"s",function(){return nt.a});var rt=K("Jq4h"),Be=K.n(rt)},n6Qo:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return F});var te=K("q1tI"),Q=K("biw7"),N=K("fyJ8");function J(k){var I=k.className,_=k.index,v=k.children,p=k.colSpan,c=k.rowSpan,a=te.useContext(Q.a),l=a.prefixCls,o=a.fixedInfoList,r=o[_];return te.createElement(N.a,Object.assign({className:I,index:_,component:"td",prefixCls:l,record:null,dataIndex:null,render:function(){return{children:v,props:{colSpan:p,rowSpan:c}}}},r))}function B(k){return te.createElement("tr",Object.assign({},k))}function D(k){var I=k.children,_=te.useContext(Q.a),v=_.prefixCls;return te.createElement("tfoot",{className:"".concat(v,"-summary")},I)}var H=Ne.b=D,F={Cell:J,Row:B}},nKGa:function(qe,Ne,K){qe.exports=K.p+"static/export_exercise-template.f7655c19.png"},nukY:function(qe,Ne){qe.exports="data:image/png;base64,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"},"o/qq":function(qe,Ne,K){qe.exports={flex_box_center:"flex_box_center___1LYHS",flex_space_between:"flex_space_between___EmHgD",flex_box_vertical_center:"flex_box_vertical_center___8y-JO",flex_box_center_end:"flex_box_center_end___2Ow7E",flex_box_column:"flex_box_column___2_dIp",shixunWrp:"shixunWrp___2zw8A"}},onxn:function(qe,Ne){qe.exports="data:image/png;base64,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"},osHv:function(qe,Ne,K){(function(te){te(K("VrN/"))})(function(te){"use strict";var Q=te.Pos;function N(o,r){return o.line-r.line||o.ch-r.ch}var J="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",B=J+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",D=new RegExp("<(/?)(["+J+"]["+B+"]*)","g");function H(o,r,s,d){this.line=r,this.ch=s,this.cm=o,this.text=o.getLine(r),this.min=d?Math.max(d.from,o.firstLine()):o.firstLine(),this.max=d?Math.min(d.to-1,o.lastLine()):o.lastLine()}function F(o,r){var s=o.cm.getTokenTypeAt(Q(o.line,r));return s&&/\btag\b/.test(s)}function k(o){return o.line>=o.max?void 0:(o.ch=0,o.text=o.cm.getLine(++o.line),!0)}function I(o){return o.line<=o.min?void 0:(o.text=o.cm.getLine(--o.line),o.ch=o.text.length,!0)}function _(o){for(;;){var r=o.text.indexOf(">",o.ch);if(r==-1){if(k(o))continue;return}if(!F(o,r+1)){o.ch=r+1;continue}var s=o.text.lastIndexOf("/",r),d=s>-1&&!/\S/.test(o.text.slice(s+1,r));return o.ch=r+1,d?"selfClose":"regular"}}function v(o){for(;;){var r=o.ch?o.text.lastIndexOf("<",o.ch-1):-1;if(r==-1){if(I(o))continue;return}if(!F(o,r+1)){o.ch=r;continue}D.lastIndex=r,o.ch=r;var s=D.exec(o.text);if(s&&s.index==r)return s}}function p(o){for(;;){D.lastIndex=o.ch;var r=D.exec(o.text);if(!r){if(k(o))continue;return}if(!F(o,r.index+1)){o.ch=r.index+1;continue}return o.ch=r.index+r[0].length,r}}function c(o){for(;;){var r=o.ch?o.text.lastIndexOf(">",o.ch-1):-1;if(r==-1){if(I(o))continue;return}if(!F(o,r+1)){o.ch=r;continue}var s=o.text.lastIndexOf("/",r),d=s>-1&&!/\S/.test(o.text.slice(s+1,r));return o.ch=r+1,d?"selfClose":"regular"}}function a(o,r){for(var s=[];;){var d=p(o),R,A=o.line,T=o.ch-(d?d[0].length:0);if(!d||!(R=_(o)))return;if(R=="selfClose")continue;if(d[1]){for(var w=s.length-1;w>=0;--w)if(s[w]==d[2]){s.length=w;break}if(w<0&&(!r||r==d[2]))return{tag:d[2],from:Q(A,T),to:Q(o.line,o.ch)}}else s.push(d[2])}}function l(o,r){for(var s=[];;){var d=c(o);if(!d)return;if(d=="selfClose"){v(o);continue}var R=o.line,A=o.ch,T=v(o);if(!T)return;if(T[1])s.push(T[2]);else{for(var w=s.length-1;w>=0;--w)if(s[w]==T[2]){s.length=w;break}if(w<0&&(!r||r==T[2]))return{tag:T[2],from:Q(o.line,o.ch),to:Q(R,A)}}}}te.registerHelper("fold","xml",function(o,r){for(var s=new H(o,r.line,0);;){var d=p(s);if(!d||s.line!=r.line)return;var R=_(s);if(!R)return;if(!d[1]&&R!="selfClose"){var A=Q(s.line,s.ch),T=a(s,d[2]);return T&&N(T.from,A)>0?{from:A,to:T.from}:null}}}),te.findMatchingTag=function(o,r,s){var d=new H(o,r.line,r.ch,s);if(d.text.indexOf(">")==-1&&d.text.indexOf("<")==-1)return;var R=_(d),A=R&&Q(d.line,d.ch),T=R&&v(d);if(!R||!T||N(d,r)>0)return;var w={from:Q(d.line,d.ch),to:A,tag:T[2]};return R=="selfClose"?{open:w,close:null,at:"open"}:T[1]?{open:l(d,T[2]),close:w,at:"close"}:(d=new H(o,A.line,A.ch,s),{open:w,close:a(d,T[2]),at:"open"})},te.findEnclosingTag=function(o,r,s,d){for(var R=new H(o,r.line,r.ch,s);;){var A=l(R,d);if(!A)break;var T=new H(o,r.line,r.ch,s),w=a(T,A.tag);if(w)return{open:A,close:w}}},te.scanForClosingTag=function(o,r,s,d){var R=new H(o,r.line,r.ch,d?{from:0,to:d}:null);return a(R,s)}})},p5ED:function(qe,Ne,K){"use strict";var te=K("+L6B"),Q=K("2/Rp"),N=K("5Dmo"),J=K("3S7+"),B=K("k1fw"),D=K("tJVT"),H=K("q1tI"),F=K.n(H),k=K("vHTk"),I=K.n(k),_=K("yEEn"),v=K("ZW9T"),p=K("1vsH");Ne.a=function(c){var a=c.name,l=c.data,o=c.theme,r=c.type,s=c.filename,d=c.monacoEditor,R=c.className,A=c.style,T=c.close,w=c.onClose,C=c.hasMask,b=Object(H.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),m=Object(D.a)(b,2),h=m[0],u=m[1],x=Object(H.useState)(""),g=Object(D.a)(x,2),y=g[0],M=g[1],E,j=1024*1024,G=10*j,U=Object(H.useRef)();r==="office"&&(E=Object(p.T)(l).filesize,E>G&&(r="other")),s&&(d.filename=s),Object(H.useEffect)(function(){var $,se,ce=($=document.cookie)===null||$===void 0||((se=$.replace(/\s/g,""))===null||se===void 0)?void 0:se.split(";");ce==null||ce.map(function(Pe){var Se=Pe.split("=");Se[0]==="_educoder_session"&&M(Se[1])})},[]);var O=function(){if(l.startsWith("http")||l.startsWith("/")){X();return}Object(p.z)(s||"educoder",l,s)},X=function(){Object(p.x)(s||a,l)};return console.log("data:",l,"fileanme:",s," name:",a),F.a.createElement("div",{style:Object(B.a)({},A||{}),className:"".concat(C&&I.a.bgBlack," ").concat(r?I.a.wrp:"hide")},T&&F.a.createElement("div",{className:I.a.close,ref:U},F.a.createElement(J.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return U.current}},F.a.createElement("span",{onClick:X},F.a.createElement("i",{className:"icon-quxiaozhiding"}))),F.a.createElement(J.a,{title:"\u5173\u95ED",getPopupContainer:function(){return U.current}},F.a.createElement("span",{className:"",onClick:w},F.a.createElement("i",{className:"icon-guanbi1"})))),F.a.createElement("div",{className:"".concat(I.a[R]," ").concat(R," ").concat(I.a.monaco," ").concat(r==="txt"?"show":"hide")},r==="txt"&&F.a.createElement(v.b,d)),r==="audio"&&F.a.createElement("audio",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?l:"data:audio/mp3;base64,").concat(l),autoPlay:!0}),r==="video"&&F.a.createElement(F.a.Fragment,null,l!=null&&l.startsWith("/")?F.a.createElement("video",{controls:!0,src:"".concat(l),autoPlay:!0}):F.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(l),autoPlay:!0})),r==="html"&&F.a.createElement("iframe",{src:l+"&disposition=inline"}),r==="pdf"&&F.a.createElement("embed",{className:I.a.embed,src:l}),r==="image"&&F.a.createElement(F.a.Fragment,null,F.a.createElement("img",{src:"".concat(l!=null&&l.startsWith("/")||(l==null?void 0:l.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(l)})),r==="other"&&F.a.createElement("div",null,F.a.createElement(Q.a,{type:"primary",size:"large",onClick:O},F.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(r==="download"||r==="office")&&F.a.createElement(Q.a,{type:"primary",size:"large",onClick:O},F.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(qe,Ne,K){},psGv:function(qe,Ne,K){var te,Q;(function(){var N;(function(){"use strict";var H=[,,function(_){function v(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=[]}v.prototype.clone_empty=function(){var a=new v(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},v.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},v.prototype.has_match=function(a){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(a))return!0;return!1},v.prototype.set_indent=function(a,l){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},v.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)},v.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},v.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},v.prototype.is_empty=function(){return this.__items.length===0},v.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},v.prototype.push=function(a){this.__items.push(a);var l=a.lastIndexOf(`
`);l!==-1?this.__character_count=a.length-l:this.__character_count+=a.length},v.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},v.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},v.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},v.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},v.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 p(a,l){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)),l=l||"",a.indent_level>0&&(l=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}p.prototype.get_indent_size=function(a,l){var o=this.__base_string_length;return l=l||0,a<0&&(o=0),o+=a*this.__indent_size,o+=l,o},p.prototype.get_indent_string=function(a,l){var o=this.__base_string;return l=l||0,a<0&&(a=0,o=""),l+=a*this.__indent_size,this.__ensure_cache(l),o+=this.__cache[l],o},p.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var a=this.__cache.length,l=0,o="";this.__indent_size&&a>=this.__indent_size&&(l=Math.floor(a/this.__indent_size),a-=l*this.__indent_size,o=new Array(l+1).join(this.__indent_string)),a&&(o+=new Array(a+1).join(" ")),this.__cache.push(o)};function c(a,l){this.__indent_cache=new p(a,l),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 v(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}c.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},c.prototype.get_line_number=function(){return this.__lines.length},c.prototype.get_indent_string=function(a,l){return this.__indent_cache.get_indent_string(a,l)},c.prototype.get_indent_size=function(a,l){return this.__indent_cache.get_indent_size(a,l)},c.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},c.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},c.prototype.get_code=function(a){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return a!==`
`&&(o=o.replace(/[\n]/g,a)),o},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(a,l){return a=a||0,l=l||0,this.next_line.set_indent(a,l),this.__lines.length>1?(this.current_line.set_indent(a,l),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(a){for(var l=0;l<a.newlines;l++)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},c.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()},c.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(" "))},c.prototype.remove_indent=function(a){for(var l=this.__lines.length;a<l;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},c.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},c.prototype.just_added_newline=function(){return this.current_line.is_empty()},c.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},c.prototype.ensure_empty_line_above=function(a,l){for(var o=this.__lines.length-2;o>=0;){var r=this.__lines[o];if(r.is_empty())break;if(r.item(0).indexOf(a)!==0&&r.item(-1)!==l){this.__lines.splice(o+1,0,new v(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},_.exports.Output=c},function(_){function v(p,c,a,l){this.type=p,this.text=c,this.comments_before=null,this.newlines=a||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}_.exports.Token=v},,,function(_){function v(a,l){this.raw_options=p(a,l),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}v.prototype._get_array=function(a,l){var o=this.raw_options[a],r=l||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(r=o.concat()):typeof o=="string"&&(r=o.split(/[^a-zA-Z0-9_\/\-]+/)),r},v.prototype._get_boolean=function(a,l){var o=this.raw_options[a],r=o===void 0?!!l:!!o;return r},v.prototype._get_characters=function(a,l){var o=this.raw_options[a],r=l||"";return typeof o=="string"&&(r=o.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},v.prototype._get_number=function(a,l){var o=this.raw_options[a];l=parseInt(l,10),isNaN(l)&&(l=0);var r=parseInt(o,10);return isNaN(r)&&(r=l),r},v.prototype._get_selection=function(a,l,o){var r=this._get_selection_list(a,l,o);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[a]+"'");return r[0]},v.prototype._get_selection_list=function(a,l,o){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[l[0]],!this._is_valid_selection(o,l))throw new Error("Invalid Default Value!");var r=this._get_array(a,o);if(!this._is_valid_selection(r,l))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[a]+"'");return r},v.prototype._is_valid_selection=function(a,l){return a.length&&l.length&&!a.some(function(o){return l.indexOf(o)===-1})};function p(a,l){var o={};a=c(a);var r;for(r in a)r!==l&&(o[r]=a[r]);if(l&&a[l])for(r in a[l])o[r]=a[l][r];return o}function c(a){var l={},o;for(o in a){var r=o.replace(/-/g,"_");l[r]=a[o]}return l}_.exports.Options=v,_.exports.normalizeOpts=c,_.exports.mergeOpts=p},,function(_){var v=RegExp.prototype.hasOwnProperty("sticky");function p(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},p.prototype.peek=function(c){var a=null;return c=c||0,c+=this.__position,c>=0&&c<this.__input_length&&(a=this.__input.charAt(c)),a},p.prototype.__match=function(c,a){c.lastIndex=a;var l=c.exec(this.__input);return l&&!(v&&c.sticky)&&(l.index!==a&&(l=null)),l},p.prototype.test=function(c,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(c,a):!1},p.prototype.testChar=function(c,a){var l=this.peek(a);return c.lastIndex=0,l!==null&&c.test(l)},p.prototype.match=function(c){var a=this.__match(c,this.__position);return a?this.__position+=a[0].length:a=null,a},p.prototype.read=function(c,a,l){var o="",r;return c&&(r=this.match(c),r&&(o+=r[0])),a&&(r||!c)&&(o+=this.readUntil(a,l)),o},p.prototype.readUntil=function(c,a){var l="",o=this.__position;c.lastIndex=this.__position;var r=c.exec(this.__input);return r?(o=r.index,a&&(o+=r[0].length)):o=this.__input_length,l=this.__input.substring(this.__position,o),this.__position=o,l},p.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},p.prototype.get_regexp=function(c,a){var l=null,o="g";return a&&v&&(o="y"),typeof c=="string"&&c!==""?l=new RegExp(c,o):c&&(l=new RegExp(c.source,o)),l},p.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(c){var a=this.__position,l=this.readUntilAfter(c);return this.__position=a,l},p.prototype.lookBack=function(c){var a=this.__position-1;return a>=c.length&&this.__input.substring(a-c.length,a).toLowerCase()===c},_.exports.InputScanner=p},function(_,v,p){var c=p(8).InputScanner,a=p(3).Token,l=p(10).TokenStream,o=p(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(d,R){this._input=new c(d),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var d,R=new a(r.START,""),A=null,T=[],w=new l;R.type!==r.EOF;){for(d=this._get_next_token(R,A);this._is_comment(d);)w.add(d),d=this._get_next_token(R,A);w.isEmpty()||(d.comments_before=w,w=new l),d.parent=A,this._is_opening(d)?(T.push(A),A=d):A&&this._is_closing(d,A)&&(d.opened=A,A.closed=d,A=T.pop(),d.parent=A),d.previous=R,R.next=d,this.__tokens.add(d),R=d}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(d,R){this._readWhitespace();var A=this._input.read(/.+/g);return A?this._create_token(r.RAW,A):this._create_token(r.EOF,"")},s.prototype._is_comment=function(d){return!1},s.prototype._is_opening=function(d){return!1},s.prototype._is_closing=function(d,R){return!1},s.prototype._create_token=function(d,R){var A=new a(d,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return A},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},_.exports.Tokenizer=s,_.exports.TOKEN=r},function(_){function v(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}v.prototype.restart=function(){this.__position=0},v.prototype.isEmpty=function(){return this.__tokens_length===0},v.prototype.hasNext=function(){return this.__position<this.__tokens_length},v.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},v.prototype.peek=function(p){var c=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(c=this.__tokens[p]),c},v.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},_.exports.TokenStream=v},function(_,v,p){var c=p(12).Pattern;function a(l,o){c.call(this,l,o),o?this._line_regexp=this._input.get_regexp(o._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new c,a.prototype.__set_whitespace_patterns=function(l,o){l+="\\t ",o+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+o+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+o+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var o=this.__split(this._newline_regexp,l);this.newline_count=o.length-1,this.whitespace_before_token=o[this.newline_count]}return l},a.prototype.matching=function(l,o){var r=this._create();return r.__set_whitespace_patterns(l,o),r._update(),r},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(l,o){l.lastIndex=0;for(var r=0,s=[],d=l.exec(o);d;)s.push(o.substring(r,d.index)),r=d.index+d[0].length,d=l.exec(o);return r<o.length?s.push(o.substring(r,o.length)):s.push(""),s},_.exports.WhitespacePattern=a},function(_){function v(p,c){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,c&&(this._starting_pattern=this._input.get_regexp(c._starting_pattern,!0),this._match_pattern=this._input.get_regexp(c._match_pattern,!0),this._until_pattern=this._input.get_regexp(c._until_pattern),this._until_after=c._until_after)}v.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},v.prototype.read_match=function(){return this._input.match(this._match_pattern)},v.prototype.until_after=function(p){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(p),c._update(),c},v.prototype.until=function(p){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(p),c._update(),c},v.prototype.starting_with=function(p){var c=this._create();return c._starting_pattern=this._input.get_regexp(p,!0),c._update(),c},v.prototype.matching=function(p){var c=this._create();return c._match_pattern=this._input.get_regexp(p,!0),c._update(),c},v.prototype._create=function(){return new v(this._input,this)},v.prototype._update=function(){},_.exports.Pattern=v},function(_){function v(p,c){p=typeof p=="string"?p:p.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+c,"g")}v.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(p);a;)c[a[1]]=a[2],a=this.__directive_pattern.exec(p);return c},v.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},_.exports.Directives=v},function(_,v,p){var c=p(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(o,r){c.call(this,o,r),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var s=new c(o);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new c,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(o){var r=this._create();return r._disabled[o]=!0,r._update(),r},l.prototype.read_options=function(o){var r=this._create();for(var s in a)r._disabled[s]=o.templating.indexOf(s)===-1;return r._update(),r},l.prototype.exclude=function(o){var r=this._create();return r._excluded[o]=!0,r._update(),r},l.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),o+=r,r=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},l.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},l.prototype._read_template=function(){var o="",r=this._input.peek();if(r==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(o=o||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},_.exports.TemplatablePattern=l},,,,function(_,v,p){var c=p(19).Beautifier,a=p(20).Options;function l(o,r,s,d){var R=new c(o,r,s,d);return R.beautify()}_.exports=l,_.exports.defaultOptions=function(){return new a}},function(_,v,p){var c=p(20).Options,a=p(2).Output,l=p(21).Tokenizer,o=p(21).TOKEN,r=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,d=function(x,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=x.max_preserve_newlines,this.preserve_newlines=x.preserve_newlines,this._output=new a(x,g)};d.prototype.current_line_has_match=function(x){return this._output.current_line.has_match(x)},d.prototype.set_space_before_token=function(x,g){this._output.space_before_token=x,this._output.non_breaking_space=g},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(x){this._output.add_raw_token(x)},d.prototype.print_preserved_newlines=function(x){var g=0;x.type!==o.TEXT&&x.previous.type!==o.TEXT&&(g=x.newlines?1:0),this.preserve_newlines&&(g=x.newlines<this.max_preserve_newlines+1?x.newlines:this.max_preserve_newlines+1);for(var y=0;y<g;y++)this.print_newline(y>0);return g!==0},d.prototype.traverse_whitespace=function(x){return x.whitespace_before||x.newlines?(this.print_preserved_newlines(x)||(this._output.space_before_token=!0),!0):!1},d.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},d.prototype.print_newline=function(x){this._output.add_new_line(x)},d.prototype.print_token=function(x){x.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(x.text))},d.prototype.indent=function(){this.indent_level++},d.prototype.get_full_indent=function(x){return x=this.indent_level+(x||0),x<1?"":this._output.get_indent_string(x)};var R=function(x){for(var g=null,y=x.next;y.type!==o.EOF&&x.closed!==y;){if(y.type===o.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===o.EQUALS&&y.next.next&&y.next.next.type===o.VALUE&&(g=y.next.next.text);break}y=y.next}return g},A=function(x,g){var y=null,M=null;return g.closed?(x==="script"?y="text/javascript":x==="style"&&(y="text/css"),y=R(g)||y,y.search("text/css")>-1?M="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?M="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?M="html":y.search(/test\/null/)>-1&&(M="null"),M):null};function T(x,g){return g.indexOf(x)!==-1}function w(x,g,y){this.parent=x||null,this.tag=g?g.tag_name:"",this.indent_level=y||0,this.parser_token=g||null}function C(x){this._printer=x,this._current_frame=null}C.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},C.prototype.record_tag=function(x){var g=new w(this._current_frame,x,this._printer.indent_level);this._current_frame=g},C.prototype._try_pop_frame=function(x){var g=null;return x&&(g=x.parser_token,this._printer.indent_level=x.indent_level,this._current_frame=x.parent),g},C.prototype._get_frame=function(x,g){for(var y=this._current_frame;y&&!(x.indexOf(y.tag)!==-1);){if(g&&g.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},C.prototype.try_pop=function(x,g){var y=this._get_frame([x],g);return this._try_pop_frame(y)},C.prototype.indent_to_tag=function(x){var g=this._get_frame(x);g&&(this._printer.indent_level=g.indent_level)};function b(x,g,y,M){this._source_text=x||"",g=g||{},this._js_beautify=y,this._css_beautify=M,this._tag_stack=null;var E=new c(g,"html");this._options=E,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"}b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
`,x&&r.test(x)&&(g=x.match(r)[0])),x=x.replace(s,`
`);var y=x.match(/^[\t ]*/)[0],M={text:"",type:""},E=new m,j=new d(this._options,y),G=new l(x,this._options).tokenize();this._tag_stack=new C(j);for(var U=null,O=G.next();O.type!==o.EOF;)O.type===o.TAG_OPEN||O.type===o.COMMENT?(U=this._handle_tag_open(j,O,E,M),E=U):O.type===o.ATTRIBUTE||O.type===o.EQUALS||O.type===o.VALUE||O.type===o.TEXT&&!E.tag_complete?U=this._handle_inside_tag(j,O,E,G):O.type===o.TAG_CLOSE?U=this._handle_tag_close(j,O,E):O.type===o.TEXT?U=this._handle_text(j,O,E):j.add_raw_token(O),M=U,O=G.next();var X=j._output.get_code(g);return X},b.prototype._handle_tag_close=function(x,g,y){var M={text:g.text,type:g.type};return x.alignment_size=0,y.tag_complete=!0,x.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),y.is_unformatted?x.add_raw_token(g):(y.tag_start_char==="<"&&(x.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&x.print_newline(!1)),x.print_token(g)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(x.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&x.set_wrap_point(),M},b.prototype._handle_inside_tag=function(x,g,y,M){var E=y.has_wrapped_attrs,j={text:g.text,type:g.type};if(x.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),y.is_unformatted)x.add_raw_token(g);else if(y.tag_start_char==="{"&&g.type===o.TEXT)x.print_preserved_newlines(g)?(g.newlines=0,x.add_raw_token(g)):x.print_token(g);else{if(g.type===o.ATTRIBUTE?(x.set_space_before_token(!0),y.attr_count+=1):(g.type===o.EQUALS||g.type===o.VALUE&&g.previous.type===o.EQUALS)&&x.set_space_before_token(!1),g.type===o.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(x.traverse_whitespace(g),E=E||g.newlines!==0),this._is_wrap_attributes_force)){var G=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var U=!0,O=0,X;do{if(X=M.peek(O),X.type===o.ATTRIBUTE){U=!1;break}O+=1}while(O<4&&X.type!==o.EOF&&X.type!==o.TAG_CLOSE);G=!U}G&&(x.print_newline(!1),E=!0)}x.print_token(g),E=E||x.previous_token_wrapped(),y.has_wrapped_attrs=E}return j},b.prototype._handle_text=function(x,g,y){var M={text:g.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(x,g,y):y.is_unformatted||y.is_content_unformatted?x.add_raw_token(g):(x.traverse_whitespace(g),x.print_token(g)),M},b.prototype._print_custom_beatifier_text=function(x,g,y){var M=this;if(g.text!==""){var E=g.text,j,G=1,U="",O="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?j=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?j=this._css_beautify:y.custom_beautifier_name==="html"&&(j=function(Se,Re){var Oe=new b(Se,Re,M._js_beautify,M._css_beautify);return Oe.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-x.indent_level);var X=x.get_full_indent(G);if(E=E.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&E[0]==="<"&&E.match(/^(<!--|<!\[CDATA\[)/)){var $=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(E);if(!$){x.add_raw_token(g);return}U=X+$[1]+`
`,E=$[4],$[5]&&(O=X+$[5]),E=E.replace(/\n[ \t]*$/,""),($[2]||$[3].indexOf(`
`)!==-1)&&($=$[3].match(/[ \t]+$/),$&&(g.whitespace_before=$[0]))}if(E)if(j){var se=function(){this.eol=`
`};se.prototype=this._options.raw_options;var ce=new se;E=j(X+E,ce)}else{var Pe=g.whitespace_before;Pe&&(E=E.replace(new RegExp(`
(`+Pe+")?","g"),`
`)),E=X+E.replace(/\n/g,`
`+X)}U&&(E?E=U+E+`
`+O:E=U+O),x.print_newline(!1),E&&(g.text=E,g.whitespace_before="",g.newlines=0,x.add_raw_token(g),x.print_newline(!0))}},b.prototype._handle_tag_open=function(x,g,y,M){var E=this._get_tag_open_token(g);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&g.type===o.TAG_OPEN&&g.text.indexOf("</")===0?(x.add_raw_token(g),E.start_tag_token=this._tag_stack.try_pop(E.tag_name)):(x.traverse_whitespace(g),this._set_tag_position(x,g,E,y,M),E.is_inline_element||x.set_wrap_point(),x.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(E.alignment_size=g.text.length+1),!E.tag_complete&&!E.is_unformatted&&(x.alignment_size=E.alignment_size),E};var m=function(x,g){if(this.parent=x||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 y;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(y=g.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[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===o.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 M=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(M=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(M)))}};b.prototype._get_tag_open_token=function(x){var g=new m(this._tag_stack.get_parser_token(),x);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||T(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&&T(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&T(g.tag_check,this._options.content_unformatted),g.is_inline_element=T(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},b.prototype._set_tag_position=function(x,g,y,M,E){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||x.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=A(y.tag_check,g)))),T(y.tag_check,this._options.extra_liners)&&(x.print_newline(!1),x._output.just_added_blankline()||x.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var j=x.current_line_has_match(/{{#if/);j||x.print_newline(!1)}y.tag_name==="!--"&&E.type===o.TAG_CLOSE&&M.is_end_tag&&y.text.indexOf(`
`)===-1||(y.is_inline_element||y.is_unformatted||x.print_newline(!1),this._calcluate_parent_multiline(x,y))}else if(y.is_end_tag){var G=!1;G=y.start_tag_token&&y.start_tag_token.multiline_content,G=G||!y.is_inline_element&&!(M.is_inline_element||M.is_unformatted)&&!(E.type===o.TAG_CLOSE&&y.start_tag_token===M)&&E.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(G=!1),G&&x.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(E.type!=="TK_CONTENT"||y.is_content_unformatted)&&x.print_newline(!1),this._calcluate_parent_multiline(x,y)},b.prototype._calcluate_parent_multiline=function(x,g){g.parent&&x._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],u=["a","audio","del","ins","map","noscript","video"];b.prototype._do_optional_end_element=function(x){var g=null;if(x.is_empty_element||!x.is_start_tag||!x.parent)return;if(x.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(x.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(x.tag_name==="dd"||x.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(x.parent.tag_name==="p"&&h.indexOf(x.tag_name)!==-1){var y=x.parent.parent;(!y||u.indexOf(y.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else x.tag_name==="rp"||x.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):x.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):x.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):x.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):x.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):x.tag_name==="tbody"||x.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"])):x.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"])):(x.tag_name==="th"||x.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 x.parent=this._tag_stack.get_parser_token(),g},_.exports.Beautifier=b},function(_,v,p){var c=p(6).Options;function a(l){c.call(this,l,"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 c,_.exports.Options=a},function(_,v,p){var c=p(9).Tokenizer,a=p(9).TOKEN,l=p(13).Directives,o=p(14).TemplatablePattern,r=p(12).Pattern,s={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},d=new l(/<\!--/,/-->/),R=function(A,T){c.call(this,A,T),this._current_tag_name="";var w=new o(this._input).read_options(this._options),C=new r(this._input);if(this.__patterns={word:w.until(/[\n\r\t <]/),single_quote:w.until_after(/'/),double_quote:w.until_after(/"/),attribute:w.until(/[\n\r\t =>]|\/>/),element_name:w.until(/[\n\r\t >\/]/),handlebars_comment:C.starting_with(/{{!--/).until_after(/--}}/),handlebars:C.starting_with(/{{/).until_after(/}}/),handlebars_open:C.until(/[\n\r\t }]/),handlebars_raw_close:C.until(/}}/),comment:C.starting_with(/<!--/).until_after(/-->/),cdata:C.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:C.starting_with(/<!\[/).until_after(/]>/),processing:C.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 b=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=C.matching(b).until_after(b)}};R.prototype=new c,R.prototype._is_comment=function(A){return!1},R.prototype._is_opening=function(A){return A.type===s.TAG_OPEN},R.prototype._is_closing=function(A,T){return A.type===s.TAG_CLOSE&&T&&((A.text===">"||A.text==="/>")&&T.text[0]==="<"||A.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(A,T){var w=null;this._readWhitespace();var C=this._input.peek();return C===null?this._create_token(s.EOF,""):(w=w||this._read_open_handlebars(C,T),w=w||this._read_attribute(C,A,T),w=w||this._read_close(C,T),w=w||this._read_raw_content(C,A,T),w=w||this._read_content_word(C),w=w||this._read_comment_or_cdata(C),w=w||this._read_processing(C),w=w||this._read_open(C,T),w=w||this._create_token(s.UNKNOWN,this._input.next()),w)},R.prototype._read_comment_or_cdata=function(A){var T=null,w=null,C=null;if(A==="<"){var b=this._input.peek(1);b==="!"&&(w=this.__patterns.comment.read(),w?(C=d.get_directives(w),C&&C.ignore==="start"&&(w+=d.readIgnored(this._input))):w=this.__patterns.cdata.read()),w&&(T=this._create_token(s.COMMENT,w),T.directives=C)}return T},R.prototype._read_processing=function(A){var T=null,w=null,C=null;if(A==="<"){var b=this._input.peek(1);(b==="!"||b==="?")&&(w=this.__patterns.conditional_comment.read(),w=w||this.__patterns.processing.read()),w&&(T=this._create_token(s.COMMENT,w),T.directives=C)}return T},R.prototype._read_open=function(A,T){var w=null,C=null;return T||A==="<"&&(w=this._input.next(),this._input.peek()==="/"&&(w+=this._input.next()),w+=this.__patterns.element_name.read(),C=this._create_token(s.TAG_OPEN,w)),C},R.prototype._read_open_handlebars=function(A,T){var w=null,C=null;return T||this._options.indent_handlebars&&A==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(w=this.__patterns.handlebars_comment.read(),w=w||this.__patterns.handlebars.read(),C=this._create_token(s.COMMENT,w)):(w=this.__patterns.handlebars_open.read(),C=this._create_token(s.TAG_OPEN,w))),C},R.prototype._read_close=function(A,T){var w=null,C=null;return T&&(T.text[0]==="<"&&(A===">"||A==="/"&&this._input.peek(1)===">")?(w=this._input.next(),A==="/"&&(w+=this._input.next()),C=this._create_token(s.TAG_CLOSE,w)):T.text[0]==="{"&&A==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),C=this._create_token(s.TAG_CLOSE,"}}"))),C},R.prototype._read_attribute=function(A,T,w){var C=null,b="";if(w&&w.text[0]==="<")if(A==="=")C=this._create_token(s.EQUALS,this._input.next());else if(A==='"'||A==="'"){var m=this._input.next();A==='"'?m+=this.__patterns.double_quote.read():m+=this.__patterns.single_quote.read(),C=this._create_token(s.VALUE,m)}else b=this.__patterns.attribute.read(),b&&(T.type===s.EQUALS?C=this._create_token(s.VALUE,b):C=this._create_token(s.ATTRIBUTE,b));return C},R.prototype._is_content_unformatted=function(A){return this._options.void_elements.indexOf(A)===-1&&(this._options.content_unformatted.indexOf(A)!==-1||this._options.unformatted.indexOf(A)!==-1)},R.prototype._read_raw_content=function(A,T,w){var C="";if(w&&w.text[0]==="{")C=this.__patterns.handlebars_raw_close.read();else if(T.type===s.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var b=T.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var m=this._read_comment_or_cdata(A);if(m)return m.type=s.TEXT,m;C=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(b)&&(C=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig")))}return C?this._create_token(s.TEXT,C):null},R.prototype._read_content_word=function(A){var T="";if(this._options.unformatted_content_delimiter&&(A===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(s.TEXT,T)},_.exports.Tokenizer=R,_.exports.TOKEN=s}],F={};function k(_){var v=F[_];if(v!==void 0)return v.exports;var p=F[_]={exports:{}};return H[_](p,p.exports,k),p.exports}var I=k(18);N=I})();var J=N;if(!0)!(te=[K,K("6UM0"),K("TXwP")],Q=function(H){var F=K("6UM0"),k=K("TXwP");return{html_beautify:function(I,_){return J(I,_,F.js_beautify,k.css_beautify)}}}.apply(Ne,te),Q!==void 0&&(qe.exports=Q));else var B,D})()},qgvg:function(qe,Ne){qe.exports="data:image/gif;base64,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"},"rAM+":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return Q});var te=K("Qw5x");function Q(N,J){var B;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(B=Object(te.a)(N))||J&&N&&typeof N.length=="number"){B&&(N=B);var D=0,H=function(){};return{s:H,n:function(){return D>=N.length?{done:!0}:{done:!1,value:N[D++]}},e:function(v){throw v},f:H}}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 F=!0,k=!1,I;return{s:function(){B=N[Symbol.iterator]()},n:function(){var v=B.next();return F=v.done,v},e:function(v){k=!0,I=v},f:function(){try{!F&&B.return!=null&&B.return()}finally{if(k)throw I}}}}},rUJ1:function(qe,Ne){const K=/[&<>"']/,te=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,J={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},B=C=>J[C];function D(C,b){if(b){if(K.test(C))return C.replace(te,B)}else if(Q.test(C))return C.replace(N,B);return C}const H=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(C){return C.replace(H,(b,m)=>(m=m.toLowerCase(),m==="colon"?":":m.charAt(0)==="#"?m.charAt(1)==="x"?String.fromCharCode(parseInt(m.substring(2),16)):String.fromCharCode(+m.substring(1)):""))}const k=/(^|[^\[])\^/g;function I(C,b){C=C.source||C,b=b||"";const m={replace:(h,u)=>(u=u.source||u,u=u.replace(k,"$1"),C=C.replace(h,u),m),getRegex:()=>new RegExp(C,b)};return m}const _=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(C,b,m){if(C){let h;try{h=decodeURIComponent(F(m)).replace(_,"").toLowerCase()}catch(u){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}b&&!v.test(m)&&(m=r(b,m));try{m=encodeURI(m).replace(/%25/g,"%")}catch(h){return null}return m}const c={},a=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,o=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(C,b){c[" "+C]||(a.test(C)?c[" "+C]=C+"/":c[" "+C]=A(C,"/",!0)),C=c[" "+C];const m=C.indexOf(":")===-1;return b.substring(0,2)==="//"?m?b:C.replace(l,"$1")+b:b.charAt(0)==="/"?m?b:C.replace(o,"$1")+b:C+b}const s={exec:function(){}};function d(C){let b=1,m,h;for(;b<arguments.length;b++){m=arguments[b];for(h in m)Object.prototype.hasOwnProperty.call(m,h)&&(C[h]=m[h])}return C}function R(C,b){const m=C.replace(/\|/g,(x,g,y)=>{let M=!1,E=g;for(;--E>=0&&y[E]==="\\";)M=!M;return M?"|":" |"}),h=m.split(/ \|/);let u=0;if(h.length>b)h.splice(b);else for(;h.length<b;)h.push("");for(;u<h.length;u++)h[u]=h[u].trim().replace(/\\\|/g,"|");return h}function A(C,b,m){const h=C.length;if(h===0)return"";let u=0;for(;u<h;){const x=C.charAt(h-u-1);if(x===b&&!m)u++;else if(x!==b&&m)u++;else break}return C.substr(0,h-u)}function T(C,b){if(C.indexOf(b[1])===-1)return-1;const m=C.length;let h=0,u=0;for(;u<m;u++)if(C[u]==="\\")u++;else if(C[u]===b[0])h++;else if(C[u]===b[1]&&(h--,h<0))return u;return-1}function w(C){C&&C.sanitize&&!C.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")}qe.exports={escape:D,unescape:F,edit:I,cleanUrl:p,resolveUrl:r,noopTest:s,merge:d,splitCells:R,rtrim:A,findClosingBracket:T,checkSanitizeDeprecation:w}},sR1s:function(qe,Ne,K){"use strict";K.d(Ne,"b",function(){return J}),K.d(Ne,"a",function(){return B}),K.d(Ne,"c",function(){return D}),K.d(Ne,"d",function(){return H});var te=K("U8pU"),Q="RC_TABLE_KEY";function N(F){return F==null?[]:Array.isArray(F)?F:[F]}function J(F,k){if(!k&&typeof k!="number")return F;for(var I=N(k),_=F,v=0;v<I.length;v+=1){if(!_)return null;var p=I[v];_=_[p]}return _}function B(F){var k=[],I={};return F.forEach(function(_){for(var v=_||{},p=v.key,c=v.dataIndex,a=p||N(c).join("-")||Q;I[a];)a="".concat(a,"_next");I[a]=!0,k.push(a)}),k}function D(){var F={};function k(p,c){c&&Object.keys(c).forEach(function(a){var l=c[a];l&&Object(te.a)(l)==="object"?(p[a]=p[a]||{},k(p[a],l)):p[a]=l})}for(var I=arguments.length,_=new Array(I),v=0;v<I;v++)_[v]=arguments[v];return _.forEach(function(p){k(F,p)}),F}function H(F){return F!=null}},sboe:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return N});var te=K("q1tI"),Q=K.n(te),N=te.createContext(null)},t23M:function(qe,Ne,K){"use strict";var te=K("VTBJ"),Q=K("1OyB"),N=K("vuIU"),J=K("Ji7U"),B=K("LK+K"),D=K("q1tI"),H=K.n(D),F=K("m+aA"),k=K("Zm9Q"),I=K("Kwbf"),_=K("c+Xe"),v=K("bdgK"),p="rc-observer-key",c=function(a){Object(J.a)(o,a);var l=Object(B.a)(o);function o(){var r;return Object(Q.a)(this,o),r=l.apply(this,arguments),r.resizeObserver=null,r.childNode=null,r.currentElement=null,r.state={width:0,height:0,offsetHeight:0,offsetWidth:0},r.onResize=function(s){var d=r.props.onResize,R=s[0].target,A=R.getBoundingClientRect(),T=A.width,w=A.height,C=R.offsetWidth,b=R.offsetHeight,m=Math.floor(T),h=Math.floor(w);if(r.state.width!==m||r.state.height!==h||r.state.offsetWidth!==C||r.state.offsetHeight!==b){var u={width:m,height:h,offsetWidth:C,offsetHeight:b};r.setState(u),d&&Promise.resolve().then(function(){d(Object(te.a)(Object(te.a)({},u),{},{offsetWidth:C,offsetHeight:b}))})}},r.setChildNode=function(s){r.childNode=s},r}return Object(N.a)(o,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var s=this.props.disabled;if(s){this.destroyObserver();return}var d=Object(F.a)(this.childNode||this),R=d!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=d),!this.resizeObserver&&d&&(this.resizeObserver=new v.default(this.onResize),this.resizeObserver.observe(d))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,d=Object(k.a)(s);if(d.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(d.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=d[0];if(D.isValidElement(R)&&Object(_.c)(R)){var A=R.ref;d[0]=D.cloneElement(R,{ref:Object(_.a)(A,this.setChildNode)})}return d.length===1?d[0]:d.map(function(T,w){return!D.isValidElement(T)||"key"in T&&T.key!==null?T:D.cloneElement(T,{key:"".concat(p,"-").concat(w)})})}}]),o}(D.Component);c.displayName="ResizeObserver",Ne.a=c},tWlo:function(qe,Ne){qe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkVCNENBMTM0OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkVCNENBMTM1OENGMTExRTk4NzNCRkMxMzdBMjc5MEY5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6RUI0Q0ExMzI4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6RUI0Q0ExMzM4Q0YxMTFFOTg3M0JGQzEzN0EyNzkwRjkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7p3KzkAAAFvElEQVR42sRae0ybVRQ/peVRaFce8pwgj1Je5TFsEHGbMAkzmqiJyba4hYh/LJlxiRr9Z0aNGv8xvhKTGckM2zKWmGEgU7MsPnCZIrKBjMcKY9BCBMqjjEcLtFDwHPZVC12h934f8yS/P6Dfud/5nXvvueec+8neOPEuSCAxiDJEMSITkYKIRoQJv9sREwgTogfRjGhEjIt9sUKEbhSiEvEC4mGEbJNngxGRiAzEk8L/VhGtiPOIswgrjxEBHDrxiE8Qg4hPEYYtjPclMkGXxhhCfIFI2E4CNFtvIm4hXvdYHlJIKOIVRK/wjkCpCaQjWhAfIVSwfaIS3kHvypaKwLOI64hdcP+kAPEn4jmxBI4ivkXsgPsvNBt1gg1cBI4hvkLI4f8TuWDDMdYw+owQFdh3Y6gSCnL1oNOmQnxcHAQHB8HCwiLMzM7C8KgFjD23oN9khtXVVZZhyZZhxEV/CGQhalk9r1AoYO9jxfBokQGCgoK8SBHi42LBsCsfJq1TcOnHn+F2v4llJsimIoRx3Q8le0o9/6bwdRmRxGJ8ZEQ4vHjkEORkZYBcLvdrlvL0OeBwOuDv4RF/X0Ne2Y34GrHiaw+8ishnMT4tNRmOVlVCTPQDzKfY/vJ9kJWpY1Ej217ztYnpFHyH6UjGJXH4wPOgVIZw7VAi8XRFOSjkTKv1bc8T25PACdZDan95mV9LZjNRq1Wg02lZw+tbGwnQ/L/EMooyJASSkxIliZUp7ONUCTb/S+AI2cTqOZlMJgmBcI2GVUUp2LyOAJMwxvHN04EAnqQYDrsJUDFSyKrtdC5JRmDR4eBRoxokgQjs48nn5+fnJSNgt3ONRTaXEYFHeLSXlpd5Peclk1Yrr6ohQKhhuWR6ekYSAiOWMV7VDCKg5Z0/uwTLaNnlAssYd22fTgRieTRz9dmQlpIsmgCdwuWle3nVY4mAmkczLCxUsk0cEaHhVVUH8GqOT0xKRmB6ZpZX1UkE5ng0zeYhsNntkhBgqAs2yhwR4AoBrpUVaO/oEm38nelp6B/gJnCHCNzm1f79jxaWgsRLbDY7XKj/Dlb405I+ItDDqz2/sACnTp9DEqNc+qfO1MLwyKiYCewNEPov3EK+G59k39BOp3Nt+YiUViLQKNjBH8sV7EXNivhslgb4xb2J28SMtMSRmbrwBBYpZPOI+xw4J2aka23tzB4VETrdct6zoCECC7wjjWIy1tbewZT//9R4RYzxZOtZTwK0C2vEjHjT2Ov3sx2d3TA7ZxPzuhrB5nVdiQ8pNPPvKP+XkEjjbYKtXm0VOpHe5x01KDDI72dFtmI+EGz1IkDyOeIvnlETH/T/digqKoLXeLLts3UNgY0REXGQZpmpqtCmrjV1/ZWcrEzIzEhnTtwQhwQb/5vNDc1dkinak4gDsMUFSEhwMJQ9vhueqihnWhYBMhnokYRGowGLZRwcW9fWLsGxTV6HqA8F6sMfR5z0qiDUKsjQpoEuPQ1SsSILVPDd1FJTrDA/Fwry9NDX1w9dxh7MSs2+ytTjcI+7gc0IkHwpMD+JnpbnZGdCXk4WPJSUKFlHzj0bGTrtGqhZNjJqgQHzIHRjWMbzhd7/MqLaZxqzxfjVFU+UjhcZCs+gp7f9nowcszMhfg17SoptSKDyym9N9cbePt8O2GrQ5pbrDRMTkwbe6MQpN6hfFRUVWa+Qb+7je23ideLAtPdGZ/cUZpw1iTsTFtFLJcBwEc2RIryHqELvW2q/qQPT4JA4AmupL5aP/Saza8A0eDU2Jvr0DrWaNkEe3L32kULmhXV+cHHR8cOvV5tcDd9f8qvm9ouAW2Zm5yhpm5uwWi9HRoRXq1UqC9zt08cDe391VUiJPyaPo+F1zddaZy80XFyLRv52v2ViPrehiJSvz6Z7rthQpZI+t6E+K91yuj+3UXnkL+7PbYxCFdiIKfgYdTcohHZ23QTnEntd8Y8AAwCTubpzlq2wWAAAAABJRU5ErkJggg=="},ulZh:function(qe,Ne,K){typeof window!="undefined"&&function(Q,N){qe.exports=N()}(this,function(){return function(te){var Q={};function N(J){if(Q[J])return Q[J].exports;var B=Q[J]={i:J,l:!1,exports:{}};return te[J].call(B.exports,B,B.exports,N),B.l=!0,B.exports}return N.m=te,N.c=Q,N.d=function(J,B,D){N.o(J,B)||Object.defineProperty(J,B,{enumerable:!0,get:D})},N.r=function(J){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(J,"__esModule",{value:!0})},N.t=function(J,B){if(B&1&&(J=N(J)),B&8)return J;if(B&4&&typeof J=="object"&&J&&J.__esModule)return J;var D=Object.create(null);if(N.r(D),Object.defineProperty(D,"default",{enumerable:!0,value:J}),B&2&&typeof J!="string")for(var H in J)N.d(D,H,function(F){return J[F]}.bind(null,H));return D},N.n=function(J){var B=J&&J.__esModule?function(){return J.default}:function(){return J};return N.d(B,"a",B),B},N.o=function(J,B){return Object.prototype.hasOwnProperty.call(J,B)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,Q,N){"use strict";var J=Object.prototype.hasOwnProperty,B="~";function D(){}Object.create&&(D.prototype=Object.create(null),new D().__proto__||(B=!1));function H(_,v,p){this.fn=_,this.context=v,this.once=p||!1}function F(_,v,p,c,a){if(typeof p!="function")throw new TypeError("The listener must be a function");var l=new H(p,c||_,a),o=B?B+v:v;return _._events[o]?_._events[o].fn?_._events[o]=[_._events[o],l]:_._events[o].push(l):(_._events[o]=l,_._eventsCount++),_}function k(_,v){--_._eventsCount===0?_._events=new D:delete _._events[v]}function I(){this._events=new D,this._eventsCount=0}I.prototype.eventNames=function(){var v=[],p,c;if(this._eventsCount===0)return v;for(c in p=this._events)J.call(p,c)&&v.push(B?c.slice(1):c);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(p)):v},I.prototype.listeners=function(v){var p=B?B+v:v,c=this._events[p];if(!c)return[];if(c.fn)return[c.fn];for(var a=0,l=c.length,o=new Array(l);a<l;a++)o[a]=c[a].fn;return o},I.prototype.listenerCount=function(v){var p=B?B+v:v,c=this._events[p];return c?c.fn?1:c.length:0},I.prototype.emit=function(v,p,c,a,l,o){var r=B?B+v:v;if(!this._events[r])return!1;var s=this._events[r],d=arguments.length,R,A;if(s.fn){s.once&&this.removeListener(v,s.fn,void 0,!0);switch(d){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,p),!0;case 3:return s.fn.call(s.context,p,c),!0;case 4:return s.fn.call(s.context,p,c,a),!0;case 5:return s.fn.call(s.context,p,c,a,l),!0;case 6:return s.fn.call(s.context,p,c,a,l,o),!0}for(A=1,R=new Array(d-1);A<d;A++)R[A-1]=arguments[A];s.fn.apply(s.context,R)}else{var T=s.length,w;for(A=0;A<T;A++){s[A].once&&this.removeListener(v,s[A].fn,void 0,!0);switch(d){case 1:s[A].fn.call(s[A].context);break;case 2:s[A].fn.call(s[A].context,p);break;case 3:s[A].fn.call(s[A].context,p,c);break;case 4:s[A].fn.call(s[A].context,p,c,a);break;default:if(!R)for(w=1,R=new Array(d-1);w<d;w++)R[w-1]=arguments[w];s[A].fn.apply(s[A].context,R)}}}return!0},I.prototype.on=function(v,p,c){return F(this,v,p,c,!1)},I.prototype.once=function(v,p,c){return F(this,v,p,c,!0)},I.prototype.removeListener=function(v,p,c,a){var l=B?B+v:v;if(!this._events[l])return this;if(!p)return k(this,l),this;var o=this._events[l];if(o.fn)o.fn===p&&(!a||o.once)&&(!c||o.context===c)&&k(this,l);else{for(var r=0,s=[],d=o.length;r<d;r++)(o[r].fn!==p||a&&!o[r].once||c&&o[r].context!==c)&&s.push(o[r]);s.length?this._events[l]=s.length===1?s[0]:s:k(this,l)}return this},I.prototype.removeAllListeners=function(v){var p;return v?(p=B?B+v:v,this._events[p]&&k(this,p)):(this._events=new D,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=B,I.EventEmitter=I,te.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,Q,N){(function(J){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,D=/^([^\/?#]*)([^]*)$/,H=/(?:\/|^)\.(?=\/)/g,F=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,k={buildAbsoluteURL:function(I,_,v){if(v=v||{},I=I.trim(),_=_.trim(),!_){if(!v.alwaysNormalize)return I;var p=k.parseURL(I);if(!p)throw new Error("Error trying to parse base URL.");return p.path=k.normalizePath(p.path),k.buildURLFromParts(p)}var c=k.parseURL(_);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return v.alwaysNormalize?(c.path=k.normalizePath(c.path),k.buildURLFromParts(c)):_;var a=k.parseURL(I);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var l=D.exec(a.path);a.netLoc=l[1],a.path=l[2]}a.netLoc&&!a.path&&(a.path="/");var o={scheme:a.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(o.netLoc=a.netLoc,c.path[0]!=="/"))if(!c.path)o.path=a.path,c.params||(o.params=a.params,c.query||(o.query=a.query));else{var r=a.path,s=r.substring(0,r.lastIndexOf("/")+1)+c.path;o.path=k.normalizePath(s)}return o.path===null&&(o.path=v.alwaysNormalize?k.normalizePath(c.path):c.path),k.buildURLFromParts(o)},parseURL:function(I){var _=B.exec(I);return _?{scheme:_[1]||"",netLoc:_[2]||"",path:_[3]||"",params:_[4]||"",query:_[5]||"",fragment:_[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(H,"");I.length!==(I=I.replace(F,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};te.exports=k})(this)},"./node_modules/webworkify-webpack/index.js":function(te,Q,N){function J(v){var p={};function c(l){if(p[l])return p[l].exports;var o=p[l]={i:l,l:!1,exports:{}};return v[l].call(o.exports,o,o.exports,c),o.l=!0,o.exports}c.m=v,c.c=p,c.i=function(l){return l},c.d=function(l,o,r){c.o(l,o)||Object.defineProperty(l,o,{configurable:!1,enumerable:!0,get:r})},c.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},c.n=function(l){var o=l&&l.__esModule?function(){return l.default}:function(){return l};return c.d(o,"a",o),o},c.o=function(l,o){return Object.prototype.hasOwnProperty.call(l,o)},c.p="/",c.oe=function(l){throw console.error(l),l};var a=c(c.s=ENTRY_MODULE);return a.default||a}var B="[\\.|\\-|\\+|\\w|/|@]+",D="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function H(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function F(v){return!isNaN(1*v)}function k(v,p,c){var a={};a[c]=[];var l=p.toString(),o=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!o)return a;for(var r=o[1],s=new RegExp("(\\\\n|\\W)"+H(r)+D,"g"),d;d=s.exec(l);){if(d[3]==="dll-reference")continue;a[c].push(d[3])}for(s=new RegExp("\\("+H(r)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+D,"g");d=s.exec(l);)v[d[2]]||(a[c].push(d[1]),v[d[2]]=N(d[1]).m),a[d[2]]=a[d[2]]||[],a[d[2]].push(d[4]);for(var R=Object.keys(a),A=0;A<R.length;A++)for(var T=0;T<a[R[A]].length;T++)F(a[R[A]][T])&&(a[R[A]][T]=1*a[R[A]][T]);return a}function I(v){var p=Object.keys(v);return p.reduce(function(c,a){return c||v[a].length>0},!1)}function _(v,p){for(var c={main:[p]},a={main:[]},l={main:{}};I(c);)for(var o=Object.keys(c),r=0;r<o.length;r++){var s=o[r],d=c[s],R=d.pop();if(l[s]=l[s]||{},l[s][R]||!v[s][R])continue;l[s][R]=!0,a[s]=a[s]||[],a[s].push(R);for(var A=k(v,v[s][R],s),T=Object.keys(A),w=0;w<T.length;w++)c[T[w]]=c[T[w]]||[],c[T[w]]=c[T[w]].concat(A[T[w]])}return a}te.exports=function(v,p){p=p||{};var c={main:N.m},a=p.all?{main:Object.keys(c.main)}:_(c,v),l="";Object.keys(a).filter(function(R){return R!=="main"}).forEach(function(R){for(var A=0;a[R][A];)A++;a[R].push(A),c[R][A]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+R+" = ("+J.toString().replace("ENTRY_MODULE",JSON.stringify(A))+")({"+a[R].map(function(T){return""+JSON.stringify(T)+": "+c[R][T].toString()}).join(",")+`});
`}),l=l+"new (("+J.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+a.main.map(function(R){return""+JSON.stringify(R)+": "+c.main[R].toString()}).join(",")+"}))(self);";var o=new window.Blob([l],{type:"text/javascript"});if(p.bare)return o;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,s=r.createObjectURL(o),d=new window.Worker(s);return d.objectURL=s,d}},"./src/config.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"hlsDefaultConfig",function(){return w}),N.d(Q,"mergeConfig",function(){return b}),N.d(Q,"enableStreamingMode",function(){return m});var J=N("./src/controller/abr-controller.ts"),B=N("./src/controller/audio-stream-controller.ts"),D=N("./src/controller/audio-track-controller.ts"),H=N("./src/controller/subtitle-stream-controller.ts"),F=N("./src/controller/subtitle-track-controller.ts"),k=N("./src/controller/buffer-controller.ts"),I=N("./src/controller/timeline-controller.ts"),_=N("./src/controller/cap-level-controller.ts"),v=N("./src/controller/fps-controller.ts"),p=N("./src/controller/eme-controller.ts"),c=N("./src/controller/cmcd-controller.ts"),a=N("./src/utils/xhr-loader.ts"),l=N("./src/utils/fetch-loader.ts"),o=N("./src/utils/cues.ts"),r=N("./src/utils/mediakeys-helper.ts"),s=N("./src/utils/logger.ts");function d(){return d=Object.assign||function(h){for(var u=1;u<arguments.length;u++){var x=arguments[u];for(var g in x)Object.prototype.hasOwnProperty.call(x,g)&&(h[g]=x[g])}return h},d.apply(this,arguments)}function R(h,u){var x=Object.keys(h);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(h);u&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(h,y).enumerable})),x.push.apply(x,g)}return x}function A(h){for(var u=1;u<arguments.length;u++){var x=arguments[u]!=null?arguments[u]:{};u%2?R(Object(x),!0).forEach(function(g){T(h,g,x[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(x)):R(Object(x)).forEach(function(g){Object.defineProperty(h,g,Object.getOwnPropertyDescriptor(x,g))})}return h}function T(h,u,x){return u in h?Object.defineProperty(h,u,{value:x,enumerable:!0,configurable:!0,writable:!0}):h[u]=x,h}var w=A(A({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:J.default,bufferController:k.default,capLevelController:_.default,fpsController:v.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},C()),{},{subtitleStreamController:H.SubtitleStreamController,subtitleTrackController:F.default,timelineController:I.TimelineController,audioStreamController:B.default,audioTrackController:D.default,emeController:p.default,cmcdController:c.default});function C(){return{cueHandler:o.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 b(h,u){if((u.liveSyncDurationCount||u.liveMaxLatencyDurationCount)&&(u.liveSyncDuration||u.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(u.liveMaxLatencyDurationCount!==void 0&&(u.liveSyncDurationCount===void 0||u.liveMaxLatencyDurationCount<=u.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(u.liveMaxLatencyDuration!==void 0&&(u.liveSyncDuration===void 0||u.liveMaxLatencyDuration<=u.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return d({},h,u)}function m(h){var u=h.loader;if(u!==l.default&&u!==a.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var x=Object(l.fetchSupported)();x&&(h.loader=l.default,h.progressive=!0,h.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/polyfills/number.ts"),B=N("./src/utils/ewma-bandwidth-estimator.ts"),D=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),F=N("./src/errors.ts"),k=N("./src/types/loader.ts"),I=N("./src/utils/logger.ts");function _(c,a){for(var l=0;l<a.length;l++){var o=a[l];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function v(c,a,l){return a&&_(c.prototype,a),l&&_(c,l),c}var p=function(){function c(l){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=l;var o=l.config;this.bwEstimator=new B.default(o.abrEwmaSlowVoD,o.abrEwmaFastVoD,o.abrEwmaDefaultEstimate),this.registerListeners()}var a=c.prototype;return a.registerListeners=function(){var o=this.hls;o.on(D.Events.FRAG_LOADING,this.onFragLoading,this),o.on(D.Events.FRAG_LOADED,this.onFragLoaded,this),o.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.on(D.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var o=this.hls;o.off(D.Events.FRAG_LOADING,this.onFragLoading,this),o.off(D.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),o.off(D.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(o,r){var s=r.frag;if(s.type===k.PlaylistLevelType.MAIN&&!this.timer){var d;this.fragCurrent=s,this.partCurrent=(d=r.part)!=null?d:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(o,r){var s=this.hls.config;r.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var o=this.fragCurrent,r=this.partCurrent,s=this.hls,d=s.autoLevelEnabled,R=s.config,A=s.media;if(!o||!A)return;var T=r?r.stats:o.stats,w=r?r.duration:o.duration;if(T.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!d||A.paused||!A.playbackRate||!A.readyState)return;var C=performance.now()-T.loading.start,b=Math.abs(A.playbackRate);if(C<=500*w/b)return;var m=s.levels,h=s.minAutoLevel,u=m[o.level],x=T.total||Math.max(T.loaded,Math.round(w*u.maxBitrate/8)),g=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/C),y=(x-T.loaded)/g,M=A.currentTime,E=(H.BufferHelper.bufferInfo(A,M,R.maxBufferHole).end-M)/b;if(E>=2*w/b||y<=E)return;var j=Number.POSITIVE_INFINITY,G;for(G=o.level-1;G>h;G--){var U=m[G].maxBitrate;if(j=w*U/(8*.8*g),j<E)break}if(j>=y)return;var O=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+o.sn+(r?" part "+r.index:"")+" of level "+o.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
Current BW estimate: `+(Object(J.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+y.toFixed(3)+` s
Estimated load time for the next fragment: `+j.toFixed(3)+` s
Time to underbuffer: `+E.toFixed(3)+" s"),s.nextLoadLevel=G,this.bwEstimator.sample(C,T.loaded),this.clearTimer(),o.loader&&(this.fragCurrent=this.partCurrent=null,o.loader.abort()),s.trigger(D.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:r,stats:T})},a.onFragLoaded=function(o,r){var s=r.frag,d=r.part;if(s.type===k.PlaylistLevelType.MAIN&&Object(J.isFiniteNumber)(s.sn)){var R=d?d.stats:s.stats,A=d?d.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[s.level],w=(T.loaded?T.loaded.bytes:0)+R.loaded,C=(T.loaded?T.loaded.duration:0)+A;T.loaded={bytes:w,duration:C},T.realBitrate=Math.round(8*w/C)}if(s.bitrateTest){var b={stats:R,frag:s,part:d,id:s.type};this.onFragBuffered(D.Events.FRAG_BUFFERED,b),s.bitrateTest=!1}}},a.onFragBuffered=function(o,r){var s=r.frag,d=r.part,R=d?d.stats:s.stats;if(R.aborted)return;if(s.type!==k.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var A=R.parsing.end-R.loading.start;this.bwEstimator.sample(A,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0},a.onError=function(o,r){switch(r.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var o=this.fragCurrent,r=this.partCurrent,s=this.hls,d=s.maxAutoLevel,R=s.config,A=s.minAutoLevel,T=s.media,w=r?r.duration:o?o.duration:0,C=T?T.currentTime:0,b=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,m=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,h=(H.BufferHelper.bufferInfo(T,C,R.maxBufferHole).end-C)/b,u=this.findBestLevel(m,A,d,h,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(u>=0)return u;I.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var x=w?Math.min(w,R.maxStarvationDelay):R.maxStarvationDelay,g=R.abrBandWidthFactor,y=R.abrBandWidthUpFactor;if(!h){var M=this.bitrateTestDelay;if(M){var E=w?Math.min(w,R.maxLoadingDelay):R.maxLoadingDelay;x=E-M,I.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*x)+" ms"),g=y=1}}return u=this.findBestLevel(m,A,d,h+x,g,y),Math.max(u,0)},a.findBestLevel=function(o,r,s,d,R,A){for(var T,w=this.fragCurrent,C=this.partCurrent,b=this.lastLoadedFragLevel,m=this.hls.levels,h=m[b],u=!!(h!=null&&(T=h.details)!==null&&T!==void 0&&T.live),x=h==null?void 0:h.codecSet,g=C?C.duration:w?w.duration:0,y=s;y>=r;y--){var M=m[y];if(!M||x&&M.codecSet!==x)continue;var E=M.details,j=(C?E==null?void 0:E.partTarget:E==null?void 0:E.averagetargetduration)||g,G=void 0;y<=b?G=R*o:G=A*o;var U=m[y].maxBitrate,O=U*j/G;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(G)+"/"+U+"/"+j+"/"+d+"/"+O),G>U&&(!O||u&&!this.bitrateTestDelay||O<d))return y}return-1},v(c,[{key:"nextAutoLevel",get:function(){var o=this._nextAutoLevel,r=this.bwEstimator;if(o!==-1&&(!r||!r.canEstimate()))return o;var s=this.getNextABRAutoLevel();return o!==-1&&(s=Math.min(o,s)),s},set:function(o){this._nextAutoLevel=o}}]),c}();Q.default=p},"./src/controller/audio-stream-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/polyfills/number.ts"),B=N("./src/controller/base-stream-controller.ts"),D=N("./src/events.ts"),H=N("./src/utils/buffer-helper.ts"),F=N("./src/controller/fragment-tracker.ts"),k=N("./src/types/level.ts"),I=N("./src/types/loader.ts"),_=N("./src/loader/fragment.ts"),v=N("./src/demux/chunk-cache.ts"),p=N("./src/demux/transmuxer-interface.ts"),c=N("./src/types/transmuxer.ts"),a=N("./src/controller/fragment-finders.ts"),l=N("./src/utils/discontinuities.ts"),o=N("./src/errors.ts"),r=N("./src/utils/logger.ts");function s(){return s=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var b=arguments[C];for(var m in b)Object.prototype.hasOwnProperty.call(b,m)&&(w[m]=b[m])}return w},s.apply(this,arguments)}function d(w,C){w.prototype=Object.create(C.prototype),w.prototype.constructor=w,R(w,C)}function R(w,C){return R=Object.setPrototypeOf||function(m,h){return m.__proto__=h,m},R(w,C)}var A=100,T=function(w){d(C,w);function C(m,h){var u;return u=w.call(this,m,h,"[audio-stream-controller]")||this,u.videoBuffer=null,u.videoTrackCC=-1,u.waitingVideoCC=-1,u.audioSwitch=!1,u.trackId=-1,u.waitingData=null,u.mainDetails=null,u.bufferFlushed=!1,u._registerListeners(),u}var b=C.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var h=this.hls;h.on(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(D.Events.ERROR,this.onError,this),h.on(D.Events.BUFFER_RESET,this.onBufferReset,this),h.on(D.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var h=this.hls;h.off(D.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(D.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(D.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(D.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(D.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(D.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(D.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(D.Events.ERROR,this.onError,this),h.off(D.Events.BUFFER_RESET,this.onBufferReset,this),h.off(D.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(D.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(D.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(D.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(h,u){var x=u.frag,g=u.id,y=u.initPTS;if(g==="main"){var M=x.cc;this.initPTS[x.cc]=y,this.log("InitPTS for cc: "+M+" found from main: "+y),this.videoTrackCC=M,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=B.State.STOPPED;return}var u=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,u>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},b.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var h,u=this.levels,x=this.trackId,g=u==null||((h=u[x])===null||h===void 0)?void 0:h.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var y,M=performance.now(),E=this.retryDate;(!E||M>=E||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var G=j.frag,U=j.part,O=j.cache,X=j.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var $=O.flush(),se={frag:G,part:U,payload:$,networkDetails:null};this._handleFragmentLoadProgress(se),X&&w.prototype._handleFragmentLoadComplete.call(this,se)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ce=this.getLoadPosition(),Pe=H.BufferHelper.bufferInfo(this.mediaBuffer,ce,this.config.maxBufferHole),Se=Object(a.fragmentWithinToleranceTest)(Pe.end,this.config.maxFragLookUpTolerance,G);Se<0&&(r.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+Pe.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.IDLE)},b.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var u=this.mediaBuffer?this.mediaBuffer:h,x=u.buffered;!this.loadedmetadata&&x.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},b.doTickIdle=function(){var h,u,x=this.hls,g=this.levels,y=this.media,M=this.trackId,E=x.config;if(!g||!g[M])return;if(!y&&(this.startFragRequested||!E.startFragPrefetch))return;var j=g[M],G=j.details;if(!G||G.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(G)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,_.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(U===null)return;var O=U.len,X=this.getMaxBufferLength(),$=this.audioSwitch;if(O>=X&&!$)return;if(!$&&this._streamEnded(U,G)){x.trigger(D.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var se=G.fragments,ce=se[0].start,Pe=U.end;if($){var Se=this.getLoadPosition();Pe=Se,G.PTSKnown&&Se<ce&&((U.end>ce||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=ce+.05))}var Re=this.getNextFragment(Pe,G);if(!Re){this.bufferFlushed=!0;return}((h=Re.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((u=Re.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(Re,G):this.loadFragment(Re,G,Pe)},b.getMaxBufferLength=function(){var h=w.prototype.getMaxBufferLength.call(this),u=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return u===null?h:Math.max(h,u.len)},b.onMediaDetaching=function(){this.videoBuffer=null,w.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(h,u){var x=u.audioTracks;this.resetTransmuxer(),this.levels=x.map(function(g){return new k.Level(g)})},b.onAudioTrackSwitching=function(h,u){var x=!!u.url;this.trackId=u.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),x?this.setInterval(A):this.resetTransmuxer(),x?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(h,u){this.mainDetails=u.details},b.onAudioTrackLoaded=function(h,u){var x,g=this.levels,y=u.details,M=u.id;if(!g){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var E=g[M],j=0;if(y.live||(x=E.details)!==null&&x!==void 0&&x.live){var G=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!G)return;!E.details&&y.hasProgramDateTime&&G.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(y,G),j=y.fragments[0].start):j=this.alignPlaylists(y,E.details)}E.details=y,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(E.details,j),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=B.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(h){var u,x=h.frag,g=h.part,y=h.payload,M=this.config,E=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+x.sn+" of level "+x.level+" will not be buffered");return}var G=j[E];console.assert(G,"Audio track is defined on fragment load progress");var U=G.details;console.assert(U,"Audio track details are defined on fragment load progress");var O=M.defaultAudioCodec||G.audioCodec||"mp4a.40.2",X=this.transmuxer;X||(X=this.transmuxer=new p.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var $=this.initPTS[x.cc],se=(u=x.initSegment)===null||u===void 0?void 0:u.data;if($!==void 0){var ce=!1,Pe=g?g.index:-1,Se=Pe!==-1,Re=new c.ChunkMetadata(x.level,x.sn,x.stats.chunkCount,y.byteLength,Pe,Se);X.push(y,se,O,"",x,g,U.totalduration,ce,Re,$)}else{r.logger.log("Unknown video PTS for cc "+x.cc+", waiting for video PTS before demuxing audio frag "+x.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+E);var Oe=this.waitingData=this.waitingData||{frag:x,part:g,cache:new v.default,complete:!1},Me=Oe.cache;Me.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=B.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}w.prototype._handleFragmentLoadComplete.call(this,h)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(h,u){var x=u.tracks.audio;x&&(this.mediaBuffer=x.buffer),u.tracks.video&&(this.videoBuffer=u.tracks.video.buffer)},b.onFragBuffered=function(h,u){var x=u.frag,g=u.part;if(x.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(x)){this.warn("Fragment "+x.sn+(g?" p: "+g.index:"")+" of level "+x.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}x.sn!=="initSegment"&&(this.fragPrevious=x,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(x,g)},b.onError=function(h,u){switch(u.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,u);break;case o.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case o.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=u.fatal?B.State.ERROR:B.State.IDLE,this.warn(u.details+" while loading frag, switching to "+this.state+" state"));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var x=!0,g=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);g&&g.len>.5&&(x=!this.reduceMaxBufferLength(g.len)),x&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(h,u){var x=u.type;x===_.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(h){var u,x="audio",g=this.hls,y=h.remuxResult,M=h.chunkMeta,E=this.getCurrentContext(M);if(!E){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var j=E.frag,G=E.part,U=y.audio,O=y.text,X=y.id3,$=y.initSegment;if(this.fragContextChanged(j))return;if(this.state=B.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),$!=null&&$.tracks&&(this._bufferInitSegment($.tracks,j,M),g.trigger(D.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:x,tracks:$.tracks})),U){var se=U.startPTS,ce=U.endPTS,Pe=U.startDTS,Se=U.endDTS;G&&(G.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:se,endPTS:ce,startDTS:Pe,endDTS:Se}),j.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,se,ce,Pe,Se),this.bufferFragmentData(U,j,G,M)}if(X!=null&&(u=X.samples)!==null&&u!==void 0&&u.length){var Re=s({frag:j,id:x},X);g.trigger(D.Events.FRAG_PARSING_METADATA,Re)}if(O){var Oe=s({frag:j,id:x},O);g.trigger(D.Events.FRAG_PARSING_USERDATA,Oe)}},b._bufferInitSegment=function(h,u,x){if(this.state!==B.State.PARSING)return;h.video&&delete h.video;var g=h.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(D.Events.BUFFER_CODECS,h);var y=g.initSegment;if(y!=null&&y.byteLength){var M={type:"audio",frag:u,part:null,chunkMeta:x,parent:u.type,data:y};this.hls.trigger(D.Events.BUFFER_APPENDING,M)}this.tick()},b.loadFragment=function(h,u,x){var g=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||g===F.FragmentState.NOT_LOADED||g===F.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):u.live&&!Object(J.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,h,u,x)))},b.completeAudioSwitch=function(){var h=this.hls,u=this.media,x=this.trackId;u&&(this.log("Switching audio track : flushing all audio"),w.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(D.Events.AUDIO_TRACK_SWITCHED,{id:x})},C}(B.default);Q.default=T},"./src/controller/audio-track-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/events.ts"),B=N("./src/errors.ts"),D=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function F(p,c){for(var a=0;a<c.length;a++){var l=c[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}function k(p,c,a){return c&&F(p.prototype,c),a&&F(p,a),p}function I(p,c){p.prototype=Object.create(c.prototype),p.prototype.constructor=p,_(p,c)}function _(p,c){return _=Object.setPrototypeOf||function(l,o){return l.__proto__=o,l},_(p,c)}var v=function(p){I(c,p);function c(l){var o;return o=p.call(this,l,"[audio-track-controller]")||this,o.tracks=[],o.groupId=null,o.tracksInGroup=[],o.trackId=-1,o.trackName="",o.selectDefaultTrack=!0,o.registerListeners(),o}var a=c.prototype;return a.registerListeners=function(){var o=this.hls;o.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.on(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.on(J.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var o=this.hls;o.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),o.off(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),o.off(J.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.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(o,r){this.tracks=r.audioTracks||[]},a.onAudioTrackLoaded=function(o,r){var s=r.id,d=r.details,R=this.tracksInGroup[s];if(!R){this.warn("Invalid audio track id "+s);return}var A=R.details;R.details=r.details,this.log("audioTrack "+s+" loaded ["+d.startSN+"-"+d.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,r,A))},a.onLevelLoading=function(o,r){this.switchLevel(r.level)},a.onLevelSwitching=function(o,r){this.switchLevel(r.level)},a.switchLevel=function(o){var r=this.hls.levels[o];if(!(r!=null&&r.audioGroupIds))return;var s=r.audioGroupIds[r.urlId];if(this.groupId!==s){this.groupId=s;var d=this.tracks.filter(function(A){return!s||A.groupId===s});this.selectDefaultTrack&&!d.some(function(A){return A.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=d;var R={audioTracks:d};this.log("Updating audio tracks, "+d.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(J.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},a.onError=function(o,r){if(p.prototype.onError.call(this,o,r),r.fatal||!r.context)return;r.context.type===H.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},a.setAudioTrack=function(o){var r=this.tracksInGroup;if(o<0||o>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=r[this.trackId];this.log("Now switching to audio-track index "+o);var d=r[o],R=d.id,A=d.groupId,T=A===void 0?"":A,w=d.name,C=d.type,b=d.url;if(this.trackId=o,this.trackName=w,this.selectDefaultTrack=!1,this.hls.trigger(J.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:T,name:w,type:C,url:b}),d.details&&!d.details.live)return;var m=this.switchParams(d.url,s==null?void 0:s.details);this.loadPlaylist(m)},a.selectInitialTrack=function(){var o=this.tracksInGroup;console.assert(o.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,s=this.findTrackId(r)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(o){for(var r=this.tracksInGroup,s=0;s<r.length;s++){var d=r[s];if((!this.selectDefaultTrack||d.default)&&(!o||o===d.name))return d.id}return-1},a.loadPlaylist=function(o){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var s=r.id,d=r.groupId,R=r.url;if(o)try{R=o.addDirectives(R)}catch(A){this.warn("Could not construct new URL with HLS Delivery Directives: "+A)}this.log("loading audio-track playlist for id: "+s),this.clearTimer(),this.hls.trigger(J.Events.AUDIO_TRACK_LOADING,{url:R,id:s,groupId:d,deliveryDirectives:o||null})}},k(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(o){this.selectDefaultTrack=!1,this.setAudioTrack(o)}}]),c}(D.default);Q.default=v},"./src/controller/base-playlist-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return k});var J=N("./src/polyfills/number.ts"),B=N("./src/types/level.ts"),D=N("./src/controller/level-helper.ts"),H=N("./src/utils/logger.ts"),F=N("./src/errors.ts"),k=function(){function I(v,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=H.logger.log.bind(H.logger,p+":"),this.warn=H.logger.warn.bind(H.logger,p+":"),this.hls=v}var _=I.prototype;return _.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},_.onError=function(p,c){c.fatal&&c.type===F.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},_.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},_.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},_.stopLoad=function(){this.canLoad=!1,this.clearTimer()},_.switchParams=function(p,c){var a=c==null?void 0:c.renditionReports;if(a)for(var l=0;l<a.length;l++){var o=a[l],r=""+o.URI;if(r===p.substr(-r.length)){var s=parseInt(o["LAST-MSN"]),d=parseInt(o["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var R=Math.min(c.age-c.partTarget,c.targetduration);d!==void 0&&R>c.partTarget&&(d+=1)}if(Object(J.isFiniteNumber)(s))return new B.HlsUrlParameters(s,Object(J.isFiniteNumber)(d)?d:void 0,B.HlsSkip.No)}}},_.loadPlaylist=function(p){},_.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},_.playlistLoaded=function(p,c,a){var l=this,o=c.details,r=c.stats,s=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(o.advancedDateTime=Date.now()-s,o.live||a!=null&&a.live){if(o.reloaded(a),a&&this.log("live playlist "+p+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:"MISSED")),a&&o.fragments.length>0&&Object(D.mergeDetails)(a,o),!this.canLoad||!o.live)return;var d,R=void 0,A=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var T=this.hls.config.lowLatencyMode,w=o.lastPartSn,C=o.endSN,b=o.lastPartIndex,m=b!==-1,h=w===C,u=T?0:b;m?(R=h?C+1:w,A=h?u:b+1):R=C+1;var x=o.age,g=x+o.ageHeader,y=Math.min(g-o.partTarget,o.targetduration*1.5);if(y>0){if(a&&y>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+y+" with playlist age: "+o.age),y=0;else{var M=Math.floor(y/o.targetduration);if(R+=M,A!==void 0){var E=Math.round(y%o.targetduration/o.partTarget);A+=E}this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+x.toFixed(2)+"s goal: "+y+" skip sn "+M+" to part "+A)}o.tuneInGoal=y}if(d=this.getDeliveryDirectives(o,c.deliveryDirectives,R,A),T||!h){this.loadPlaylist(d);return}}else d=this.getDeliveryDirectives(o,c.deliveryDirectives,R,A);var j=Object(D.computeReloadInterval)(o,r);R!==void 0&&o.canBlockReload&&(j-=o.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(d)},j)}else this.clearTimer()},_.getDeliveryDirectives=function(p,c,a,l){var o=Object(B.getSkipValue)(p,a);return c!=null&&c.skip&&p.deltaUpdateFailed&&(a=c.msn,l=c.part,o=B.HlsSkip.No),new B.HlsUrlParameters(a,l,o)},_.retryLoadingOrFail=function(p){var c=this,a=this.hls.config,l=this.retryCount<a.levelLoadingMaxRetry;if(l){var o;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(o=p.context)!==null&&o!==void 0&&o.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var r=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return l},I}()},"./src/controller/base-stream-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"State",function(){return C}),N.d(Q,"default",function(){return b});var J=N("./src/polyfills/number.ts"),B=N("./src/task-loop.ts"),D=N("./src/controller/fragment-tracker.ts"),H=N("./src/utils/buffer-helper.ts"),F=N("./src/utils/logger.ts"),k=N("./src/events.ts"),I=N("./src/errors.ts"),_=N("./src/types/transmuxer.ts"),v=N("./src/utils/mp4-tools.ts"),p=N("./src/utils/discontinuities.ts"),c=N("./src/controller/fragment-finders.ts"),a=N("./src/controller/level-helper.ts"),l=N("./src/loader/fragment-loader.ts"),o=N("./src/crypt/decrypter.ts"),r=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function d(m,h){for(var u=0;u<h.length;u++){var x=h[u];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}function R(m,h,u){return h&&d(m.prototype,h),u&&d(m,u),m}function A(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function T(m,h){m.prototype=Object.create(h.prototype),m.prototype.constructor=m,w(m,h)}function w(m,h){return w=Object.setPrototypeOf||function(x,g){return x.__proto__=g,x},w(m,h)}var C={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"},b=function(m){T(h,m);function h(x,g,y){var M;return M=m.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=C.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=y,M.log=F.logger.log.bind(F.logger,y+":"),M.warn=F.logger.warn.bind(F.logger,y+":"),M.hls=x,M.fragmentLoader=new l.default(x.config),M.fragmentTracker=g,M.config=x.config,M.decrypter=new o.default(x,x.config),x.on(k.Events.KEY_LOADED,M.onKeyLoaded,A(M)),M}var u=h.prototype;return u.doTick=function(){this.onTickEnd()},u.onTickEnd=function(){},u.startLoad=function(g){},u.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=C.STOPPED},u._streamEnded=function(g,y){var M=this.fragCurrent,E=this.fragmentTracker;if(!y.live&&M&&M.sn===y.endSN&&!g.nextStart){var j=E.getState(M);return j===D.FragmentState.PARTIAL||j===D.FragmentState.OK}return!1},u.onMediaAttached=function(g,y){var M=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var E=this.config;this.levels&&E.autoStartLoad&&this.state===C.STOPPED&&this.startLoad(E.startPosition)},u.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()},u.onMediaSeeking=function(){var g=this.config,y=this.fragCurrent,M=this.media,E=this.mediaBuffer,j=this.state,G=M?M.currentTime:0,U=H.BufferHelper.bufferInfo(E||M,G,g.maxBufferHole);if(this.log("media seeking to "+(Object(J.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+j),j===C.ENDED)this.resetLoadingState();else if(y&&!U.len){var O=g.maxFragLookUpTolerance,X=y.start-O,$=y.start+y.duration+O,se=G>$;(G<X||se)&&(se&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=G),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},u.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},u.onKeyLoaded=function(g,y){if(this.state!==C.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=C.IDLE;var M=this.levels[y.frag.level].details;M&&this.loadFragment(y.frag,M,y.frag.start)},u.onHandlerDestroying=function(){this.stopLoad(),m.prototype.onHandlerDestroying.call(this)},u.onHandlerDestroyed=function(){this.state=C.STOPPED,this.hls.off(k.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,m.prototype.onHandlerDestroyed.call(this)},u.loadKey=function(g,y){this.log("Loading key for "+g.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=C.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(k.Events.KEY_LOADING,{frag:g})},u.loadFragment=function(g,y,M){this._loadFragForPlayback(g,y,M)},u._loadFragForPlayback=function(g,y,M){var E=this,j=function(U){if(E.fragContextChanged(g)){E.warn("Fragment "+g.sn+(U.part?" p: "+U.part.index:"")+" of level "+g.level+" was dropped during download."),E.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,E._handleFragmentLoadProgress(U)};this._doFragLoad(g,y,M,j).then(function(G){if(!G)return;E.fragLoadError=0;var U=E.state;if(E.fragContextChanged(g)){(U===C.FRAG_LOADING||U===C.BACKTRACKING||!E.fragCurrent&&U===C.PARSING)&&(E.fragmentTracker.removeFragment(g),E.state=C.IDLE);return}if("payload"in G&&(E.log("Loaded fragment "+g.sn+" of level "+g.level),E.hls.trigger(k.Events.FRAG_LOADED,G),E.state===C.BACKTRACKING)){E.fragmentTracker.backtrack(g,G),E.resetFragmentLoading(g);return}E._handleFragmentLoadComplete(G)}).catch(function(G){E.warn(G),E.resetFragmentLoading(g)})},u.flushMainBuffer=function(g,y,M){if(M===void 0&&(M=null),!(g-y))return;var E={startOffset:g,endOffset:y,type:M};this.fragLoadError=0,this.hls.trigger(k.Events.BUFFER_FLUSHING,E)},u._loadInitSegment=function(g){var y=this;this._doFragLoad(g).then(function(M){if(!M||y.fragContextChanged(g)||!y.levels)throw new Error("init load aborted");return M}).then(function(M){var E=y.hls,j=M.payload,G=g.decryptdata;if(j&&j.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var U=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(j),G.key.buffer,G.iv.buffer).then(function(O){var X=self.performance.now();return E.trigger(k.Events.FRAG_DECRYPTED,{frag:g,payload:O,stats:{tstart:U,tdecrypt:X}}),M.payload=O,M})}return M}).then(function(M){var E=y.fragCurrent,j=y.hls,G=y.levels;if(!G)throw new Error("init load aborted, missing levels");var U=G[g.level].details;console.assert(U,"Level details are defined when init segment is loaded");var O=g.stats;y.state=C.IDLE,y.fragLoadError=0,g.data=new Uint8Array(M.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),M.frag===E&&j.trigger(k.Events.FRAG_BUFFERED,{stats:O,frag:E,part:null,id:g.type}),y.tick()}).catch(function(M){y.warn(M),y.resetFragmentLoading(g)})},u.fragContextChanged=function(g){var y=this.fragCurrent;return!g||!y||g.level!==y.level||g.sn!==y.sn||g.urlId!==y.urlId},u.fragBufferedComplete=function(g,y){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+r.default.toString(H.BufferHelper.getBuffered(M))),this.state=C.IDLE,this.tick()},u._handleFragmentLoadComplete=function(g){var y=this.transmuxer;if(!y)return;var M=g.frag,E=g.part,j=g.partsLoaded,G=!j||j.length===0||j.some(function(O){return!O}),U=new _.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,E?E.index:-1,!G);y.flush(U)},u._handleFragmentLoadProgress=function(g){},u._doFragLoad=function(g,y,M,E){var j=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(g.start,M||0),this.config.lowLatencyMode&&y){var G=y.partList;if(G&&E){M>g.end&&y.fragmentHint&&(g=y.fragmentHint);var U=this.getNextPart(G,g,M);if(U>-1){var O=G[U];return this.log("Loading part sn: "+g.sn+" p: "+O.index+" cc: "+g.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+U+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=C.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:g,part:G[U],targetBufferTime:M}),this.doFragPartsLoad(g,G,U,E).catch(function(X){return j.handleFragLoadError(X)})}else if(!g.url||this.loadedEndOfParts(G,M))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(M.toFixed(3))),Object(J.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=C.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:g,targetBufferTime:M}),this.fragmentLoader.load(g,E).catch(function(X){return j.handleFragLoadError(X)})},u.doFragPartsLoad=function(g,y,M,E){var j=this;return new Promise(function(G,U){var O=[],X=function $(se){var ce=y[se];j.fragmentLoader.loadPart(g,ce,E).then(function(Pe){O[ce.index]=Pe;var Se=Pe.part;j.hls.trigger(k.Events.FRAG_LOADED,Pe);var Re=y[se+1];if(Re&&Re.fragment===g)$(se+1);else return G({frag:g,part:Se,partsLoaded:O})}).catch(U)};X(M)})},u.handleFragLoadError=function(g){var y=g.data;return y&&y.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(k.Events.ERROR,y),null},u._handleTransmuxerFlush=function(g){var y=this.getCurrentContext(g);if(!y||this.state!==C.PARSING){this.fragCurrent||(this.state=C.IDLE);return}var M=y.frag,E=y.part,j=y.level,G=self.performance.now();M.stats.parsing.end=G,E&&(E.stats.parsing.end=G),this.updateLevelTiming(M,E,j,g.partial)},u.getCurrentContext=function(g){var y=this.levels,M=g.level,E=g.sn,j=g.part;if(!y||!y[M])return this.warn("Levels object was unset while buffering fragment "+E+" of level "+M+". The current chunk will not be buffered."),null;var G=y[M],U=j>-1?Object(a.getPartWith)(G,E,j):null,O=U?U.fragment:Object(a.getFragmentWithSN)(G,E,this.fragCurrent);return O?{frag:O,part:U,level:G}:null},u.bufferFragmentData=function(g,y,M,E){if(!g||this.state!==C.PARSING)return;var j=g.data1,G=g.data2,U=j;if(j&&G&&(U=Object(v.appendUint8Array)(j,G)),!U||!U.length)return;var O={type:g.type,frag:y,part:M,chunkMeta:E,parent:y.type,data:U};this.hls.trigger(k.Events.BUFFER_APPENDING,O),g.dropped&&g.independent&&!M&&this.flushBufferGap(y)},u.flushBufferGap=function(g){var y=this.media;if(!y)return;if(!H.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,g.start);return}var M=y.currentTime,E=H.BufferHelper.bufferInfo(y,M,0),j=g.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),U=Math.max(Math.min(g.start-G,E.end-G),M+G);g.start-U>G&&this.flushMainBuffer(U,g.start)},u.getFwdBufferInfo=function(g,y){var M=this.config,E=this.getLoadPosition();if(!Object(J.isFiniteNumber)(E))return null;var j=H.BufferHelper.bufferInfo(g,E,M.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(E,y);if(G&&j.nextStart<G.end)return H.BufferHelper.bufferInfo(g,E,Math.max(j.nextStart,M.maxBufferHole))}return j},u.getMaxBufferLength=function(g){var y=this.config,M;return g?M=Math.max(8*y.maxBufferSize/g,y.maxBufferLength):M=y.maxBufferLength,Math.min(M,y.maxMaxBufferLength)},u.reduceMaxBufferLength=function(g){var y=this.config,M=g||y.maxBufferLength;return y.maxMaxBufferLength>=M?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},u.getNextFragment=function(g,y){var M,E,j=y.fragments,G=j.length;if(!G)return null;var U=this.config,O=j[0].start,X;if(y.live){var $=U.initialLiveManifestSize;if(G<$)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+$+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(X=this.getInitialLiveFragment(y,j),this.startPosition=X?this.hls.liveSyncPosition||X.start:g)}else g<=O&&(X=j[0]);if(!X){var se=U.lowLatencyMode?y.partEnd:y.fragmentEnd;X=this.getFragmentAtPosition(g,se,y)}return(M=X)!==null&&M!==void 0&&M.initSegment&&!((E=X)!==null&&E!==void 0&&E.initSegment.data)&&!this.bitrateTest&&(X=X.initSegment),X},u.getNextPart=function(g,y,M){for(var E=-1,j=!1,G=!0,U=0,O=g.length;U<O;U++){var X=g[U];if(G=G&&!X.independent,E>-1&&M<X.start)break;var $=X.loaded;!$&&(j||X.independent||G)&&X.fragment===y&&(E=U),j=$}return E},u.loadedEndOfParts=function(g,y){var M=g[g.length-1];return M&&y>M.start&&M.loaded},u.getInitialLiveFragment=function(g,y){var M=this.fragPrevious,E=null;if(M){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),E=Object(c.findFragmentByPDT)(y,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!E){var j=M.sn+1;if(j>=g.startSN&&j<=g.endSN){var G=y[j-g.startSN];M.cc===G.cc&&(E=G,this.log("Live playlist, switching playlist, load frag with next SN: "+E.sn))}E||(E=Object(c.findFragWithCC)(y,M.cc),E&&this.log("Live playlist, switching playlist, load frag with same CC: "+E.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(E=this.getFragmentAtPosition(U,this.bitrateTest?g.fragmentEnd:g.edge,g))}return E},u.getFragmentAtPosition=function(g,y,M){var E=this.config,j=this.fragPrevious,G=M.fragments,U=M.endSN,O=M.fragmentHint,X=E.maxFragLookUpTolerance,$=!!(E.lowLatencyMode&&M.partList&&O);$&&O&&!this.bitrateTest&&(G=G.concat(O),U=O.sn);var se;if(g<y){var ce=g>y-X?0:X;se=Object(c.findFragmentByPTS)(j,G,g,ce)}else se=G[G.length-1];if(se){var Pe=se.sn-M.startSN,Se=j&&se.level===j.level,Re=G[Pe+1],Oe=this.fragmentTracker.getState(se);if(Oe===D.FragmentState.BACKTRACKED){se=null;for(var Me=Pe;G[Me]&&this.fragmentTracker.getState(G[Me])===D.FragmentState.BACKTRACKED;)j?se=G[Me--]:se=G[--Me];se||(se=Re)}else j&&se.sn===j.sn&&!$&&(Se&&(se.sn<U&&this.fragmentTracker.getState(Re)!==D.FragmentState.OK?(this.log("SN "+se.sn+" just loaded, load next one: "+Re.sn),se=Re):se=null))}return se},u.synchronizeToLiveEdge=function(g){var y=this.config,M=this.media;if(!M)return;var E=this.hls.liveSyncPosition,j=M.currentTime,G=g.fragments[0].start,U=g.edge,O=j>=G-y.maxFragLookUpTolerance&&j<=U;if(E!==null&&M.duration>E&&(j<E||!O)){var X=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*g.targetduration;(!O&&M.readyState<4||j<U-X)&&(this.loadedmetadata||(this.nextLoadPosition=E),M.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+E.toFixed(3)),M.currentTime=E))}},u.alignPlaylists=function(g,y){var M=this.levels,E=this.levelLastLoaded,j=this.fragPrevious,G=E!==null?M[E]:null,U=g.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var O=g.fragments[0].start,X=!y,$=g.alignedSliding&&Object(J.isFiniteNumber)(O);if(X||!$&&!O){Object(p.alignStream)(j,G,g);var se=g.fragments[0].start;return this.log("Live playlist sliding: "+se.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+g.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+U),se}return O},u.waitForCdnTuneIn=function(g){var y=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*y)},u.setStartPosition=function(g,y){var M=this.startPosition;if(M<y&&(M=-1),M===-1||this.lastCurrentTime===-1){var E=g.startTimeOffset;Object(J.isFiniteNumber)(E)?(M=y+E,E<0&&(M+=g.totalduration),M=Math.min(Math.max(y,M),y+g.totalduration),this.log("Start time offset "+E+" found in playlist, adjust startPosition to "+M),this.startPosition=M):g.live?M=this.hls.liveSyncPosition||y:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},u.getLoadPosition=function(){var g=this.media,y=0;return this.loadedmetadata&&g?y=g.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},u.handleFragLoadAborted=function(g,y){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(y?" part"+y.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},u.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=C.IDLE)},u.onFragmentOrKeyLoadError=function(g,y){if(y.fatal)return;var M=y.frag;if(!M||M.type!==g)return;var E=this.fragCurrent;console.assert(E&&M.sn===E.sn&&M.level===E.level&&M.urlId===E.urlId,"Frag load error must match current frag to retry");var j=this.config;if(this.fragLoadError+1<=j.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+g+" "+M.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=C.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(g===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=C.IDLE):(F.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=C.ERROR)},u.afterBufferFlushed=function(g,y,M){if(!g)return;var E=H.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(y,E,M),this.state===C.ENDED&&this.resetLoadingState()},u.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=C.IDLE},u.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[g].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},u.updateLevelTiming=function(g,y,M,E){var j=this,G=M.details;console.assert(!!G,"level.details must be defined");var U=Object.keys(g.elementaryStreams).reduce(function(O,X){var $=g.elementaryStreams[X];if($){var se=$.endPTS-$.startPTS;if(se<=0)return j.warn("Could not parse fragment "+g.sn+" "+X+" duration reliably ("+se+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),O||!1;var ce=E?0:Object(a.updateFragPTSDTS)(G,g,$.startPTS,$.endPTS,$.startDTS,$.endDTS);return j.hls.trigger(k.Events.LEVEL_PTS_UPDATED,{details:G,level:M,drift:ce,type:X,frag:g,start:$.startPTS,end:$.endPTS}),!0}return O},!1);U?(this.state=C.PARSED,this.hls.trigger(k.Events.FRAG_PARSED,{frag:g,part:y})):this.resetLoadingState()},u.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(h,[{key:"state",get:function(){return this._state},set:function(g){var y=this._state;y!==g&&(this._state=g,this.log(y+"->"+g))}}]),h}(B.default)},"./src/controller/buffer-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return c});var J=N("./src/polyfills/number.ts"),B=N("./src/events.ts"),D=N("./src/utils/logger.ts"),H=N("./src/errors.ts"),F=N("./src/utils/buffer-helper.ts"),k=N("./src/utils/mediasource-helper.ts"),I=N("./src/loader/fragment.ts"),_=N("./src/controller/buffer-operation-queue.ts"),v=Object(k.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function a(o){var r=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var s=r.hls,d=r.media,R=r.mediaSource;D.logger.log("[buffer-controller]: Media source opened"),d&&(r.updateMediaElementDuration(),s.trigger(B.Events.MEDIA_ATTACHED,{media:d})),R&&R.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){D.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){D.logger.log("[buffer-controller]: Media source ended")},this.hls=o,this._initSourceBuffer(),this.registerListeners()}var l=a.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var r=this.hls;r.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(B.Events.BUFFER_RESET,this.onBufferReset,this),r.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(B.Events.BUFFER_EOS,this.onBufferEos,this),r.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(B.Events.FRAG_PARSED,this.onFragParsed,this),r.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var r=this.hls;r.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(B.Events.BUFFER_RESET,this.onBufferReset,this),r.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(B.Events.BUFFER_EOS,this.onBufferEos,this),r.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(B.Events.FRAG_PARSED,this.onFragParsed,this),r.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new _.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(r,s){var d=2;(s.audio&&!s.video||!s.altAudio)&&(d=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=d,this.details=null,D.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(r,s){var d=this.media=s.media;if(d&&v){var R=this.mediaSource=new v;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),d.src=self.URL.createObjectURL(R),this._objectUrl=d.src}},l.onMediaDetaching=function(){var r=this.media,s=this.mediaSource,d=this._objectUrl;if(s){if(D.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(R){D.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(d&&self.URL.revokeObjectURL(d),r.src===d?(r.removeAttribute("src"),r.load()):D.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(B.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(s){var d=r.sourceBuffer[s];try{d&&(r.removeBufferListeners(s),r.mediaSource&&r.mediaSource.removeSourceBuffer(d),r.sourceBuffer[s]=void 0)}catch(R){D.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",R)}}),this._initSourceBuffer()},l.onBufferCodecs=function(r,s){var d=this,R=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(A){if(R){var T=d.tracks[A];if(T&&typeof T.buffer.changeType=="function"){var w=s[A],C=w.codec,b=w.levelCodec,m=w.container,h=(T.levelCodec||T.codec).replace(p,"$1"),u=(b||C).replace(p,"$1");if(h!==u){var x=m+";codecs="+(b||C);d.appendChangeType(A,x)}}}else d.pendingTracks[A]=s[A]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(r,s){var d=this,R=this.operationQueue,A={execute:function(){var w=d.sourceBuffer[r];w&&(D.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+s),w.changeType(s)),R.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(w){D.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",w)}};R.append(A,r)},l.onBufferAppending=function(r,s){var d=this,R=this.hls,A=this.operationQueue,T=this.tracks,w=s.data,C=s.type,b=s.frag,m=s.part,h=s.chunkMeta,u=h.buffering[C],x=self.performance.now();u.start=x;var g=b.stats.buffering,y=m?m.stats.buffering:null;g.start===0&&(g.start=x),y&&y.start===0&&(y.start=x);var M=T.audio,E=C==="audio"&&h.id===1&&(M==null?void 0:M.container)==="audio/mpeg",j={execute:function(){if(u.executeStart=self.performance.now(),E){var U=d.sourceBuffer[C];if(U){var O=b.start-U.timestampOffset;Math.abs(O)>=.1&&(D.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+O+") sn: "+b.sn+")"),U.timestampOffset=b.start)}}d.appendExecutor(w,C)},onStart:function(){},onComplete:function(){var U=self.performance.now();u.executeEnd=u.end=U,g.first===0&&(g.first=U),y&&y.first===0&&(y.first=U);var O=d.sourceBuffer,X={};for(var $ in O)X[$]=F.BufferHelper.getBuffered(O[$]);d.appendError=0,d.hls.trigger(B.Events.BUFFER_APPENDED,{type:C,frag:b,part:m,chunkMeta:h,parent:b.type,timeRanges:X})},onError:function(U){D.logger.error("[buffer-controller]: Error encountered while trying to append to the "+C+" SourceBuffer",U);var O={type:H.ErrorTypes.MEDIA_ERROR,parent:b.type,details:H.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=H.ErrorDetails.BUFFER_FULL_ERROR:(d.appendError++,O.details=H.ErrorDetails.BUFFER_APPEND_ERROR,d.appendError>R.config.appendErrorMaxRetry&&(D.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),R.trigger(B.Events.ERROR,O)}};A.append(j,C)},l.onBufferFlushing=function(r,s){var d=this,R=this.operationQueue,A=function(w){return{execute:d.removeExecutor.bind(d,w,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){d.hls.trigger(B.Events.BUFFER_FLUSHED,{type:w})},onError:function(b){D.logger.warn("[buffer-controller]: Failed to remove from "+w+" SourceBuffer",b)}}};s.type?R.append(A(s.type),s.type):this.getSourceBufferTypes().forEach(function(T){R.append(A(T),T)})},l.onFragParsed=function(r,s){var d=this,R=s.frag,A=s.part,T=[],w=A?A.elementaryStreams:R.elementaryStreams;w[I.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(w[I.ElementaryStreamTypes.AUDIO]&&T.push("audio"),w[I.ElementaryStreamTypes.VIDEO]&&T.push("video"));var C=function(){var m=self.performance.now();R.stats.buffering.end=m,A&&(A.stats.buffering.end=m);var h=A?A.stats:R.stats;d.hls.trigger(B.Events.FRAG_BUFFERED,{frag:R,part:A,stats:h,id:R.type})};T.length===0&&D.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(C,T)},l.onFragChanged=function(r,s){this.flushBackBuffer()},l.onBufferEos=function(r,s){var d=this,R=this.getSourceBufferTypes().reduce(function(A,T){var w=d.sourceBuffer[T];return(!s.type||s.type===T)&&(w&&!w.ended&&(w.ended=!0,D.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),A&&!!(!w||w.ended)},!0);R&&this.blockBuffers(function(){var A=d.mediaSource;if(!A||A.readyState!=="open")return;A.endOfStream()})},l.onLevelUpdated=function(r,s){var d=s.details;if(!d.fragments.length)return;this.details=d,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var r=this.hls,s=this.details,d=this.media,R=this.sourceBuffer;if(!d||s===null)return;var A=this.getSourceBufferTypes();if(!A.length)return;var T=s.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(J.isFiniteNumber)(T)||T<0)return;var w=d.currentTime,C=s.levelTargetDuration,b=Math.max(T,C),m=Math.floor(w/C)*C-b;A.forEach(function(h){var u=R[h];if(u){var x=F.BufferHelper.getBuffered(u);x.length>0&&m>x.start(0)&&(r.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:m}),s.live&&r.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:m}),r.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:m,type:h}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var r=this.details,s=this.hls,d=this.media,R=this.mediaSource,A=r.fragments[0].start+r.totalduration,T=d.duration,w=Object(J.isFiniteNumber)(R.duration)?R.duration:0;r.live&&s.config.liveDurationInfinity?(D.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(r)):(A>w&&A>T||!Object(J.isFiniteNumber)(T))&&(D.logger.log("[buffer-controller]: Updating Media Source duration to "+A.toFixed(3)),R.duration=A)},l.updateSeekableRange=function(r){var s=this.mediaSource,d=r.fragments,R=d.length;if(R&&r.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var A=Math.max(0,d[0].start),T=Math.max(A,A+r.totalduration);s.setLiveSeekableRange(A,T)}},l.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,s=this.operationQueue,d=this.pendingTracks,R=Object.keys(d).length;if(R&&!r||R===2){this.createSourceBuffers(d),this.pendingTracks={};var A=this.getSourceBufferTypes();if(A.length===0){this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}A.forEach(function(T){s.executeNext(T)})}},l.createSourceBuffers=function(r){var s=this.sourceBuffer,d=this.mediaSource;if(!d)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var A in r)if(!s[A]){var T=r[A];if(!T)throw Error("source buffer exists for track "+A+", however track does not");var w=T.levelCodec||T.codec,C=T.container+";codecs="+w;D.logger.log("[buffer-controller]: creating sourceBuffer("+C+")");try{var b=s[A]=d.addSourceBuffer(C),m=A;this.addBufferListener(m,"updatestart",this._onSBUpdateStart),this.addBufferListener(m,"updateend",this._onSBUpdateEnd),this.addBufferListener(m,"error",this._onSBUpdateError),this.tracks[A]={buffer:b,codec:w,container:T.container,levelCodec:T.levelCodec,id:T.id},R++}catch(h){D.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:C})}}R&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(r){var s=this.operationQueue,d=s.current(r);d.onStart()},l._onSBUpdateEnd=function(r){var s=this.operationQueue,d=s.current(r);d.onComplete(),s.shiftAndExecuteNext(r)},l._onSBUpdateError=function(r,s){D.logger.error("[buffer-controller]: "+r+" SourceBuffer error",s),this.hls.trigger(B.Events.ERROR,{type:H.ErrorTypes.MEDIA_ERROR,details:H.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var d=this.operationQueue.current(r);d&&d.onError(s)},l.removeExecutor=function(r,s,d){var R=this.media,A=this.mediaSource,T=this.operationQueue,w=this.sourceBuffer,C=w[r];if(!R||!A||!C){D.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(r);return}var b=Object(J.isFiniteNumber)(R.duration)?R.duration:Infinity,m=Object(J.isFiniteNumber)(A.duration)?A.duration:Infinity,h=Math.max(0,s),u=Math.min(d,b,m);u>h?(D.logger.log("[buffer-controller]: Removing ["+h+","+u+"] from the "+r+" SourceBuffer"),console.assert(!C.updating,r+" sourceBuffer must not be updating"),C.remove(h,u)):T.shiftAndExecuteNext(r)},l.appendExecutor=function(r,s){var d=this.operationQueue,R=this.sourceBuffer,A=R[s];if(!A){D.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),d.shiftAndExecuteNext(s);return}A.ended=!1,console.assert(!A.updating,s+" sourceBuffer must not be updating"),A.appendBuffer(r)},l.blockBuffers=function(r,s){var d=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){D.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var R=this.operationQueue,A=s.map(function(T){return R.appendBlocker(T)});Promise.all(A).then(function(){r(),s.forEach(function(T){var w=d.sourceBuffer[T];(!w||!w.updating)&&R.shiftAndExecuteNext(T)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(r,s,d){var R=this.sourceBuffer[r];if(!R)return;var A=d.bind(this,r);this.listeners[r].push({event:s,listener:A}),R.addEventListener(s,A)},l.removeBufferListeners=function(r){var s=this.sourceBuffer[r];if(!s)return;this.listeners[r].forEach(function(d){s.removeEventListener(d.event,d.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return B});var J=N("./src/utils/logger.ts"),B=function(){function D(F){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=F}var H=D.prototype;return H.append=function(k,I){var _=this.queues[I];_.push(k),_.length===1&&this.buffers[I]&&this.executeNext(I)},H.insertAbort=function(k,I){var _=this.queues[I];_.unshift(k),this.executeNext(I)},H.appendBlocker=function(k){var I,_=new Promise(function(p){I=p}),v={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(v,k),_},H.executeNext=function(k){var I=this.buffers,_=this.queues,v=I[k],p=_[k];if(p.length){var c=p[0];try{c.execute()}catch(a){J.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(a),(!v||!v.updating)&&(p.shift(),this.executeNext(k))}}},H.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},H.current=function(k){return this.queues[k][0]},D}()},"./src/controller/cap-level-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/events.ts");function B(F,k){for(var I=0;I<k.length;I++){var _=k[I];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(F,_.key,_)}}function D(F,k,I){return k&&B(F.prototype,k),I&&B(F,I),F}var H=function(){function F(I){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=I,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var k=F.prototype;return k.setStreamController=function(_){this.streamController=_},k.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},k.registerListeners=function(){var _=this.hls;_.on(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.unregisterListener=function(){var _=this.hls;_.off(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),_.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),_.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.onFpsDropLevelCapping=function(_,v){F.isLevelAllowed(v.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(v.droppedLevel)},k.onMediaAttaching=function(_,v){this.media=v.media instanceof HTMLVideoElement?v.media:null},k.onManifestParsed=function(_,v){var p=this.hls;this.restrictedLevels=[],this.firstLevel=v.firstLevel,p.config.capLevelToPlayerSize&&v.video&&this.startCapping()},k.onBufferCodecs=function(_,v){var p=this.hls;p.config.capLevelToPlayerSize&&v.video&&this.startCapping()},k.onMediaDetaching=function(){this.stopCapping()},k.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var _=this.hls.levels;if(_.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(_.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},k.getMaxLevel=function(_){var v=this,p=this.hls.levels;if(!p.length)return-1;var c=p.filter(function(a,l){return F.isLevelAllowed(l,v.restrictedLevels)&&l<=_});return this.clientRect=null,F.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},k.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()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var _=this.media,v={width:0,height:0};if(_){var p=_.getBoundingClientRect();v.width=p.width,v.height=p.height,!v.width&&!v.height&&(v.width=p.right-p.left||_.width||0,v.height=p.bottom-p.top||_.height||0)}return this.clientRect=v,v},F.isLevelAllowed=function(_,v){return v===void 0&&(v=[]),v.indexOf(_)===-1},F.getMaxLevelByMediaSize=function(_,v,p){if(!_||!_.length)return-1;for(var c=function(s,d){return d?s.width!==d.width||s.height!==d.height:!0},a=_.length-1,l=0;l<_.length;l+=1){var o=_[l];if((o.width>=v||o.height>=p)&&c(o,_[l+1])){a=l;break}}return a},D(F,[{key:"mediaWidth",get:function(){return this.getDimensions().width*F.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*F.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var _=1;try{_=self.devicePixelRatio}catch(v){}return _}}]),F}();Q.default=H},"./src/controller/cmcd-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return c});var J=N("./src/events.ts"),B=N("./src/types/cmcd.ts"),D=N("./src/utils/buffer-helper.ts"),H=N("./src/utils/logger.ts");function F(a,l){for(var o=0;o<l.length;o++){var r=l[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(a,r.key,r)}}function k(a,l,o){return l&&F(a.prototype,l),o&&F(a,o),a}function I(a,l){var o=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(o)return(o=o.call(a)).next.bind(o);if(Array.isArray(a)||(o=_(a))||l&&a&&typeof a.length=="number"){o&&(a=o);var r=0;return function(){return r>=a.length?{done:!0}:{done:!1,value:a[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _(a,l){if(!a)return;if(typeof a=="string")return v(a,l);var o=Object.prototype.toString.call(a).slice(8,-1);if(o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set")return Array.from(a);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return v(a,l)}function v(a,l){(l==null||l>a.length)&&(l=a.length);for(var o=0,r=new Array(l);o<l;o++)r[o]=a[o];return r}function p(){return p=Object.assign||function(a){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(a[r]=o[r])}return a},p.apply(this,arguments)}var c=function(){function a(o){var r=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(R){try{r.apply(R,{ot:B.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(A){H.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(R){try{var A=R.frag,T=r.hls.levels[A.level],w=r.getObjectType(A),C={d:A.duration*1e3,ot:w};(w===B.CMCDObjectType.VIDEO||w===B.CMCDObjectType.AUDIO||w==B.CMCDObjectType.MUXED)&&(C.br=T.bitrate/1e3,C.tb=r.getTopBandwidth(w),C.bl=r.getBufferLength(w)),r.apply(R,C)}catch(b){H.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=o;var s=this.config=o.config,d=s.cmcd;d!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=d.sessionId||a.uuid(),this.cid=d.contentId,this.useHeaders=d.useHeaders===!0,this.registerListeners())}var l=a.prototype;return l.registerListeners=function(){var r=this.hls;r.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(J.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var r=this.hls;r.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(J.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(r,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(r,s){var d,R;this.audioBuffer=(d=s.tracks.audio)===null||d===void 0?void 0:d.buffer,this.videoBuffer=(R=s.tracks.video)===null||R===void 0?void 0:R.buffer},l.createData=function(){var r;return{v:B.CMCDVersion,sf:B.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(r,s){s===void 0&&(s={}),p(s,this.createData());var d=s.ot===B.CMCDObjectType.INIT||s.ot===B.CMCDObjectType.VIDEO||s.ot===B.CMCDObjectType.MUXED;if(this.starved&&d&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var R=a.toHeaders(s);if(!Object.keys(R).length)return;r.headers||(r.headers={}),p(r.headers,R)}else{var A=a.toQuery(s);if(!A)return;r.url=a.appendQueryToUri(r.url,A)}},l.getObjectType=function(r){var s=r.type;return s==="subtitle"?B.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?B.CMCDObjectType.INIT:s==="audio"?B.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(r){for(var s=0,d=r===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=I(d),A;!(A=R()).done;){var T=A.value;T.bitrate>s&&(s=T.bitrate)}return s>0?s:NaN},l.getBufferLength=function(r){var s=this.hls.media,d=r===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!d||!s)return NaN;var R=D.BufferHelper.bufferInfo(d,s.currentTime,this.config.maxBufferHole);return R.len*1e3},l.createPlaylistLoader=function(){var r=this.config.pLoader,s=this.applyPlaylistData,d=r||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new d(T)}var A=R.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(w,C,b){s(w),this.loader.load(w,C,b)},k(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},l.createFragmentLoader=function(){var r=this.config.fLoader,s=this.applyFragmentData,d=r||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new d(T)}var A=R.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(w,C,b){s(w),this.loader.load(w,C,b)},k(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},a.uuid=function(){var r=URL.createObjectURL(new Blob),s=r.toString();return URL.revokeObjectURL(r),s.substr(s.lastIndexOf("/")+1)},a.serialize=function(r){for(var s=[],d=function(E){return!Number.isNaN(E)&&E!=null&&E!==""&&E!==!1},R=function(E){return Math.round(E)},A=function(E){return R(E/100)*100},T=function(E){return encodeURIComponent(E)},w={br:R,d:R,bl:A,dl:A,mtp:A,nor:T,rtp:A,tb:R},C=Object.keys(r||{}).sort(),b=I(C),m;!(m=b()).done;){var h=m.value,u=r[h];if(!d(u))continue;if(h==="v"&&u===1)continue;if(h=="pr"&&u===1)continue;var x=w[h];x&&(u=x(u));var g=typeof u,y=void 0;h==="ot"||h==="sf"||h==="st"?y=h+"="+u:g==="boolean"?y=h:g==="number"?y=h+"="+u:y=h+"="+JSON.stringify(u),s.push(y)}return s.join(",")},a.toHeaders=function(r){for(var s=Object.keys(r),d={},R=["Object","Request","Session","Status"],A=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},w=0,C=s;w<C.length;w++){var b=C[w],m=T[b]!=null?T[b]:1;A[m][b]=r[b]}for(var h=0;h<A.length;h++){var u=a.serialize(A[h]);u&&(d["CMCD-"+R[h]]=u)}return d},a.toQuery=function(r){return"CMCD="+encodeURIComponent(a.serialize(r))},a.appendQueryToUri=function(r,s){if(!s)return r;var d=r.includes("?")?"&":"?";return""+r+d+s},a}()},"./src/controller/eme-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/events.ts"),B=N("./src/errors.ts"),D=N("./src/utils/logger.ts"),H=N("./src/utils/mediakeys-helper.ts");function F(c,a){for(var l=0;l<a.length;l++){var o=a[l];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function k(c,a,l){return a&&F(c.prototype,a),l&&F(c,l),c}var I=3,_=function(a,l,o){var r={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(s){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:o.audioRobustness||""})}),l.forEach(function(s){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:o.videoRobustness||""})}),[r]},v=function(a,l,o,r){switch(a){case H.KeySystems.WIDEVINE:return _(l,o,r);default:throw new Error("Unknown key-system: "+a)}},p=function(){function c(l){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=l,this._config=l.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=c.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(o){switch(o){case H.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+o+'"')},a._attemptKeySystemAccess=function(o,r,s){var d=this,R=v(o,r,s,this._drmSystemOptions);D.logger.log("Requesting encrypted media key-system access");var A=this.requestMediaKeySystemAccess(o,R);this.mediaKeysPromise=A.then(function(T){return d._onMediaKeySystemAccessObtained(o,T)}),A.catch(function(T){D.logger.error('Failed to obtain key-system "'+o+'" access:',T)})},a._onMediaKeySystemAccessObtained=function(o,r){var s=this;D.logger.log('Access for key-system "'+o+'" obtained');var d={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:o};this._mediaKeysList.push(d);var R=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(A){return d.mediaKeys=A,D.logger.log('Media-keys created for key-system "'+o+'"'),s._onMediaKeysCreated(),A});return R.catch(function(A){D.logger.error("Failed to create media-keys:",A)}),R},a._onMediaKeysCreated=function(){var o=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),o._onNewMediaKeySession(r.mediaKeysSession))})},a._onNewMediaKeySession=function(o){var r=this;D.logger.log("New key-system session "+o.sessionId),o.addEventListener("message",function(s){r._onKeySessionMessage(o,s.message)},!1)},a._onKeySessionMessage=function(o,r){D.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(s){D.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),o.update(s)})},a.onMediaEncrypted=function(o){var r=this;if(D.logger.log('Media is encrypted using "'+o.initDataType+'" init data type'),!this.mediaKeysPromise){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(R){if(!r._media)return;r._attemptSetMediaKeys(R),r._generateRequestWithPreferredKeySession(o.initDataType,o.initData)};this.mediaKeysPromise.then(s).catch(s)},a._attemptSetMediaKeys=function(o){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){D.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}D.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(o,r){var s=this,d=this._mediaKeysList[0];if(!d){D.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(d.mediaKeysSessionInitialized){D.logger.warn("Key-Session already initialized but requested again");return}var R=d.mediaKeysSession;if(!R){D.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){D.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}D.logger.log('Generating key-session request for "'+o+'" init data type'),d.mediaKeysSessionInitialized=!0,R.generateRequest(o,r).then(function(){D.logger.debug("Key-session generation succeeded")}).catch(function(A){D.logger.error("Error generating key-session request:",A),s.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(o,r,s){var d=new XMLHttpRequest;d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,o,r,s);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,d,o),R=void 0}catch(A){D.logger.error(A)}try{d.readyState||d.open("POST",o,!0),R&&R.call(this.hls,d,o)}catch(A){throw new Error("issue setting up KeySystem license XHR "+A)}return d},a._onLicenseRequestReadyStageChange=function(o,r,s,d){switch(o.readyState){case 4:if(o.status===200){this._requestLicenseFailureCount=0,D.logger.log("License request succeeded");var R=o.response,A=this._licenseResponseCallback;if(A)try{R=A.call(this.hls,o,r)}catch(w){D.logger.error(w)}d(R)}else{if(D.logger.error("License Request XHR failed ("+r+"). Status: "+o.status+" ("+o.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=I-this._requestLicenseFailureCount+1;D.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(s,d)}break}},a._generateLicenseRequestChallenge=function(o,r){switch(o.mediaKeySystemDomain){case H.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+o.mediaKeySystemDomain)},a._requestLicense=function(o,r){D.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){D.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var d=this.getLicenseServerUrl(s.mediaKeySystemDomain),R=this._createLicenseXhr(d,o,r);D.logger.log("Sending license request to URL: "+d);var A=this._generateLicenseRequestChallenge(s,o);R.send(A)}catch(T){D.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(o,r){if(!this._emeEnabled)return;var s=r.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var o=this._media,r=this._mediaKeysList;if(!o)return;o.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return o.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(o,r){if(!this._emeEnabled)return;var s=r.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),d=r.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(H.KeySystems.WIDEVINE,s,d)},k(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();Q.default=p},"./src/controller/fps-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/events.ts"),B=N("./src/utils/logger.ts"),D=function(){function H(k){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=k,this.registerListeners()}var F=H.prototype;return F.setStreamController=function(I){this.streamController=I},F.registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},F.unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching)},F.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},F.onMediaAttaching=function(I,_){var v=this.hls.config;if(v.capLevelOnFPSDrop){var p=_.media instanceof self.HTMLVideoElement?_.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),v.fpsDroppedMonitoringPeriod)}},F.checkFPS=function(I,_,v){var p=performance.now();if(_){if(this.lastTime){var c=p-this.lastTime,a=v-this.lastDroppedFrames,l=_-this.lastDecodedFrames,o=1e3*a/c,r=this.hls;if(r.trigger(J.Events.FPS_DROP,{currentDropped:a,currentDecoded:l,totalDroppedFrames:v}),o>0&&a>r.config.fpsDroppedMonitoringThreshold*l){var s=r.currentLevel;B.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=s)&&(s=s-1,r.trigger(J.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:r.currentLevel}),r.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=v,this.lastDecodedFrames=_}},F.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var _=I.getVideoPlaybackQuality();this.checkFPS(I,_.totalVideoFrames,_.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},H}();Q.default=D},"./src/controller/fragment-finders.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"findFragmentByPDT",function(){return D}),N.d(Q,"findFragmentByPTS",function(){return H}),N.d(Q,"fragmentWithinToleranceTest",function(){return F}),N.d(Q,"pdtWithinToleranceTest",function(){return k}),N.d(Q,"findFragWithCC",function(){return I});var J=N("./src/polyfills/number.ts"),B=N("./src/utils/binary-search.ts");function D(_,v,p){if(v===null||!Array.isArray(_)||!_.length||!Object(J.isFiniteNumber)(v))return null;var c=_[0].programDateTime;if(v<(c||0))return null;var a=_[_.length-1].endProgramDateTime;if(v>=(a||0))return null;p=p||0;for(var l=0;l<_.length;++l){var o=_[l];if(k(v,p,o))return o}return null}function H(_,v,p,c){p===void 0&&(p=0),c===void 0&&(c=0);var a=null;if(_?a=v[_.sn-v[0].sn+1]||null:p===0&&v[0].start===0&&(a=v[0]),a&&F(p,c,a)===0)return a;var l=B.default.search(v,F.bind(null,p,c));return l||a}function F(_,v,p){_===void 0&&(_=0),v===void 0&&(v=0);var c=Math.min(v,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-c<=_?1:p.start-c>_&&p.start?-1:0}function k(_,v,p){var c=Math.min(v,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,a=p.endProgramDateTime||0;return a-c>_}function I(_,v){return B.default.search(_,function(p){return p.cc<v?1:p.cc>v?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"FragmentState",function(){return D}),N.d(Q,"FragmentTracker",function(){return H});var J=N("./src/events.ts"),B=N("./src/types/loader.ts"),D;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(D||(D={}));var H=function(){function I(v){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=v,this._registerListeners()}var _=I.prototype;return _._registerListeners=function(){var p=this.hls;p.on(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(J.Events.FRAG_LOADED,this.onFragLoaded,this)},_._unregisterListeners=function(){var p=this.hls;p.off(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(J.Events.FRAG_LOADED,this.onFragLoaded,this)},_.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},_.getAppendedFrag=function(p,c){if(c===B.PlaylistLevelType.MAIN){var a=this.activeFragment,l=this.activeParts;if(!a)return null;if(l)for(var o=l.length;o--;){var r=l[o],s=r?r.end:a.appendedPTS;if(r.start<=p&&s!==void 0&&p<=s)return o>9&&(this.activeParts=l.slice(o-9)),r}else if(a.start<=p&&a.appendedPTS!==void 0&&p<=a.appendedPTS)return a}return this.getBufferedFrag(p,c)},_.getBufferedFrag=function(p,c){for(var a=this.fragments,l=Object.keys(a),o=l.length;o--;){var r=a[l[o]];if((r==null?void 0:r.body.type)===c&&r.buffered){var s=r.body;if(s.start<=p&&p<=s.end)return s}}return null},_.detectEvictedFragments=function(p,c,a){var l=this;Object.keys(this.fragments).forEach(function(o){var r=l.fragments[o];if(!r)return;if(!r.buffered){r.body.type===a&&l.removeFragment(r.body);return}var s=r.range[p];if(!s)return;s.time.some(function(d){var R=!l.isTimeBuffered(d.startPTS,d.endPTS,c);return R&&l.removeFragment(r.body),R})})},_.detectPartialFragments=function(p){var c=this,a=this.timeRanges,l=p.frag,o=p.part;if(!a||l.sn==="initSegment")return;var r=k(l),s=this.fragments[r];if(!s)return;Object.keys(a).forEach(function(d){var R=l.elementaryStreams[d];if(!R)return;var A=a[d],T=o!==null||R.partial===!0;s.range[d]=c.getBufferedTimes(l,o,T,A)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},_.fragBuffered=function(p){var c=k(p),a=this.fragments[c];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},_.getBufferedTimes=function(p,c,a,l){for(var o={time:[],partial:a},r=c?c.start:p.start,s=c?c.end:p.end,d=p.minEndPTS||s,R=p.maxStartPTS||r,A=0;A<l.length;A++){var T=l.start(A)-this.bufferPadding,w=l.end(A)+this.bufferPadding;if(R>=T&&d<=w){o.time.push({startPTS:Math.max(r,l.start(A)),endPTS:Math.min(s,l.end(A))});break}else if(r<w&&s>T)o.partial=!0,o.time.push({startPTS:Math.max(r,l.start(A)),endPTS:Math.min(s,l.end(A))});else if(s<=T)break}return o},_.getPartialFragment=function(p){var c=null,a,l,o,r=0,s=this.bufferPadding,d=this.fragments;return Object.keys(d).forEach(function(R){var A=d[R];if(!A)return;F(A)&&(l=A.body.start-s,o=A.body.end+s,p>=l&&p<=o&&(a=Math.min(p-l,o-p),r<=a&&(c=A.body,r=a)))}),c},_.getState=function(p){var c=k(p),a=this.fragments[c];return a?a.buffered?F(a)?D.PARTIAL:D.OK:a.backtrack?D.BACKTRACKED:D.APPENDING:D.NOT_LOADED},_.backtrack=function(p,c){var a=k(p),l=this.fragments[a];if(!l||l.backtrack)return null;var o=l.backtrack=c||l.loaded;return l.loaded=null,o},_.getBacktrackData=function(p){var c=k(p),a=this.fragments[c];if(a){var l,o=a.backtrack;if(o!=null&&(l=o.payload)!==null&&l!==void 0&&l.byteLength)return o;this.removeFragment(p)}return null},_.isTimeBuffered=function(p,c,a){for(var l,o,r=0;r<a.length;r++){if(l=a.start(r)-this.bufferPadding,o=a.end(r)+this.bufferPadding,p>=l&&c<=o)return!0;if(c<=l)return!1}return!1},_.onFragLoaded=function(p,c){var a=c.frag,l=c.part;if(a.sn==="initSegment"||a.bitrateTest||l)return;var o=k(a);this.fragments[o]={body:a,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},_.onBufferAppended=function(p,c){var a=this,l=c.frag,o=c.part,r=c.timeRanges;if(l.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=l,o){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(o)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(d){var R=r[d];if(a.detectEvictedFragments(d,R),!o)for(var A=0;A<R.length;A++)l.appendedPTS=Math.max(R.end(A),l.appendedPTS||0)})},_.onFragBuffered=function(p,c){this.detectPartialFragments(c)},_.hasFragment=function(p){var c=k(p);return!!this.fragments[c]},_.removeFragmentsInRange=function(p,c,a){var l=this;Object.keys(this.fragments).forEach(function(o){var r=l.fragments[o];if(!r)return;if(r.buffered){var s=r.body;s.type===a&&s.start<c&&s.end>p&&l.removeFragment(s)}})},_.removeFragment=function(p){var c=k(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[c]},_.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function F(I){var _,v;return I.buffered&&(((_=I.range.video)===null||_===void 0?void 0:_.partial)||((v=I.range.audio)===null||v===void 0?void 0:v.partial))}function k(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return F}),N.d(Q,"MAX_START_GAP_JUMP",function(){return k}),N.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),N.d(Q,"SKIP_BUFFER_RANGE_START",function(){return _}),N.d(Q,"default",function(){return v});var J=N("./src/utils/buffer-helper.ts"),B=N("./src/errors.ts"),D=N("./src/events.ts"),H=N("./src/utils/logger.ts"),F=250,k=2,I=.1,_=.05,v=function(){function p(a,l,o,r){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=a,this.media=l,this.fragmentTracker=o,this.hls=r}var c=p.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(l){var o=this.config,r=this.media,s=this.stalled,d=r.currentTime,R=r.seeking,A=this.seeking&&!R,T=!this.seeking&&R;if(this.seeking=R,d!==l){if(this.moved=!0,s!==null){if(this.stallReported){var w=self.performance.now()-s;H.logger.warn("playback not stuck anymore @"+d+", after "+Math.round(w)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||A)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!J.BufferHelper.getBuffered(r).length)return;var C=J.BufferHelper.bufferInfo(r,d,0),b=C.len>0,m=C.nextStart||0;if(!b&&!m)return;if(R){var h=C.len>k,u=!m||m-d>k&&!this.fragmentTracker.getPartialFragment(d);if(h||u)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var x,g=Math.max(m,C.start||0)-d,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=y==null||((x=y.details)===null||x===void 0)?void 0:x.live,E=M?y.details.targetduration*2:k;if(g>0&&g<=E){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(s===null){this.stalled=j;return}var G=j-s;!R&&G>=F&&this._reportStall(C.len);var U=J.BufferHelper.bufferInfo(r,d,o.maxBufferHole);this._tryFixBufferStall(U,G)},c._tryFixBufferStall=function(l,o){var r=this.config,s=this.fragmentTracker,d=this.media,R=d.currentTime,A=s.getPartialFragment(R);if(A){var T=this._trySkipBufferHole(A);if(T)return}l.len>r.maxBufferHole&&o>r.highBufferWatchdogPeriod*1e3&&(H.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(l){var o=this.hls,r=this.media,s=this.stallReported;s||(this.stallReported=!0,H.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+l+")"),o.trigger(D.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},c._trySkipBufferHole=function(l){for(var o=this.config,r=this.hls,s=this.media,d=s.currentTime,R=0,A=J.BufferHelper.getBuffered(s),T=0;T<A.length;T++){var w=A.start(T);if(d+o.maxBufferHole>=R&&d<w){var C=Math.max(w+_,s.currentTime+I);return H.logger.warn("skipping hole, adjusting currentTime from "+d+" to "+C),this.moved=!0,this.stalled=null,s.currentTime=C,l&&r.trigger(D.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+C,frag:l}),C}R=A.end(T)}return 0},c._tryNudgeBuffer=function(){var l=this.config,o=this.hls,r=this.media,s=r.currentTime,d=(this.nudgeRetry||0)+1;if(this.nudgeRetry=d,d<l.nudgeMaxRetry){var R=s+d*l.nudgeOffset;H.logger.warn("Nudging 'currentTime' from "+s+" to "+R),r.currentTime=R,o.trigger(D.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else H.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+l.nudgeMaxRetry+" nudges"),o.trigger(D.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/events.ts"),B=N("./src/utils/texttrack-utils.ts"),D=N("./src/demux/id3.ts"),H=.25,F=function(){function k(_){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=_,this._registerListeners()}var I=k.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var v=this.hls;v.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var v=this.hls;v.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(v,p){this.media=p.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(v){if(!this.media)return;for(var p=0;p<v.length;p++){var c=v[p];if(c.kind==="metadata"&&c.label==="id3")return Object(B.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(v,p){if(!this.media)return;var c=p.frag,a=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<a.length;o++){var r=D.getID3Frames(a[o].data);if(r){var s=a[o].pts,d=o<a.length-1?a[o+1].pts:c.end,R=d-s;R<=0&&(d=s+H);for(var A=0;A<r.length;A++){var T=r[A];if(!D.isTimeStampFrame(T)){var w=new l(s,d,"");w.value=T,this.id3Track.addCue(w)}}}}},I.onBufferFlushing=function(v,p){var c=p.startOffset,a=p.endOffset,l=p.type;if(!l||l==="audio"){var o=this.id3Track;o&&Object(B.removeCuesInRange)(o,c,a)}},k}();Q.default=F},"./src/controller/latency-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return k});var J=N("./src/errors.ts"),B=N("./src/events.ts"),D=N("./src/utils/logger.ts");function H(I,_){for(var v=0;v<_.length;v++){var p=_[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function F(I,_,v){return _&&H(I.prototype,_),v&&H(I,v),I}var k=function(){function I(v){var p=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 p.timeupdate()},this.hls=v,this.config=v.config,this.registerListeners()}var _=I.prototype;return _.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},_.registerListeners=function(){this.hls.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(B.Events.ERROR,this.onError,this)},_.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(B.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(B.Events.ERROR,this.onError)},_.onMediaAttached=function(p,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},_.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},_.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},_.onLevelUpdated=function(p,c){var a=c.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},_.onError=function(p,c){if(c.details!==J.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,D.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},_.timeupdate=function(){var p=this.media,c=this.levelDetails;if(!p||!c)return;this.currentTime=p.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var l=this.config,o=l.lowLatencyMode,r=l.maxLiveSyncPlaybackRate;if(!o||r===1)return;var s=this.targetLatency;if(s===null)return;var d=a-s,R=Math.min(this.maxLatency,s+c.targetduration),A=d<R;if(c.live&&A&&d>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,r)),w=Math.round(2/(1+Math.exp(-.75*d-this.edgeStalled))*20)/20;p.playbackRate=Math.min(T,Math.max(1,w))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},_.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},_.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},F(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,c=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:c?p.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var c=p.holdBack,a=p.partHoldBack,l=p.targetduration,o=this.config,r=o.liveSyncDuration,s=o.liveSyncDurationCount,d=o.lowLatencyMode,R=this.hls.userConfig,A=d&&a||c;(R.liveSyncDuration||R.liveSyncDurationCount||A===0)&&(A=r!==void 0?r:s*l);var T=l,w=1;return A+Math.min(this.stallCount*w,T)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),c=this.targetLatency,a=this.levelDetails;if(p===null||c===null||a===null)return null;var l=a.edge,o=p-c-this.edgeStalled,r=l-a.totalduration,s=l-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(r,o),s)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var c=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-c,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,c=this.levelDetails;if(!p||!c)return 0;var a=p.buffered.length;return a?p.buffered.end(a-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return o});var J=N("./src/types/level.ts"),B=N("./src/events.ts"),D=N("./src/errors.ts"),H=N("./src/utils/codecs.ts"),F=N("./src/controller/level-helper.ts"),k=N("./src/controller/base-playlist-controller.ts"),I=N("./src/types/loader.ts");function _(){return _=Object.assign||function(r){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var R in d)Object.prototype.hasOwnProperty.call(d,R)&&(r[R]=d[R])}return r},_.apply(this,arguments)}function v(r,s){for(var d=0;d<s.length;d++){var R=s[d];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(r,R.key,R)}}function p(r,s,d){return s&&v(r.prototype,s),d&&v(r,d),r}function c(r,s){r.prototype=Object.create(s.prototype),r.prototype.constructor=r,a(r,s)}function a(r,s){return a=Object.setPrototypeOf||function(R,A){return R.__proto__=A,R},a(r,s)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),o=function(r){c(s,r);function s(R){var A;return A=r.call(this,R,"[level-controller]")||this,A._levels=[],A._firstLevel=-1,A._startLevel=void 0,A.currentLevelIndex=-1,A.manualLevelIndex=-1,A.onParsedComplete=void 0,A._registerListeners(),A}var d=s.prototype;return d._registerListeners=function(){var A=this.hls;A.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(B.Events.ERROR,this.onError,this)},d._unregisterListeners=function(){var A=this.hls;A.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(B.Events.ERROR,this.onError,this)},d.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},d.startLoad=function(){var A=this._levels;A.forEach(function(T){T.loadError=0}),r.prototype.startLoad.call(this)},d.onManifestLoaded=function(A,T){var w=[],C=[],b=[],m,h={},u,x=!1,g=!1,y=!1;if(T.levels.forEach(function(G){var U=G.attrs;x=x||!!(G.width&&G.height),g=g||!!G.videoCodec,y=y||!!G.audioCodec,l&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var O=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;u=h[O],u?u.url.push(G.url):(u=new J.Level(G),h[O]=u,w.push(u)),U&&(U.AUDIO&&Object(F.addGroupId)(u,"audio",U.AUDIO),U.SUBTITLES&&Object(F.addGroupId)(u,"text",U.SUBTITLES))}),(x||g)&&y&&(w=w.filter(function(G){var U=G.videoCodec,O=G.width,X=G.height;return!!U||!!(O&&X)})),w=w.filter(function(G){var U=G.audioCodec,O=G.videoCodec;return(!U||Object(H.isCodecSupportedInMp4)(U,"audio"))&&(!O||Object(H.isCodecSupportedInMp4)(O,"video"))}),T.audioTracks&&(C=T.audioTracks.filter(function(G){return!G.audioCodec||Object(H.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(F.assignTrackIdsByGroup)(C)),T.subtitles&&(b=T.subtitles,Object(F.assignTrackIdsByGroup)(b)),w.length>0){m=w[0].bitrate,w.sort(function(G,U){return G.bitrate-U.bitrate}),this._levels=w;for(var M=0;M<w.length;M++)if(w[M].bitrate===m){this._firstLevel=M,this.log("manifest loaded, "+w.length+" level(s) found, first bitrate: "+m);break}var E=y&&!g,j={levels:w,audioTracks:C,subtitleTracks:b,firstLevel:this._firstLevel,stats:T.stats,audio:y,video:g,altAudio:!E&&C.some(function(G){return!!G.url})};this.hls.trigger(B.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(B.Events.ERROR,{type:D.ErrorTypes.MEDIA_ERROR,details:D.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},d.onError=function(A,T){if(r.prototype.onError.call(this,A,T),T.fatal)return;var w=T.context,C=this._levels[this.currentLevelIndex];if(w&&(w.type===I.PlaylistContextType.AUDIO_TRACK&&C.audioGroupIds&&w.groupId===C.audioGroupIds[C.urlId]||w.type===I.PlaylistContextType.SUBTITLE_TRACK&&C.textGroupIds&&w.groupId===C.textGroupIds[C.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,m=!0,h;switch(T.details){case D.ErrorDetails.FRAG_LOAD_ERROR:case D.ErrorDetails.FRAG_LOAD_TIMEOUT:case D.ErrorDetails.KEY_LOAD_ERROR:case D.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var u=this._levels[T.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=T.frag.level)):h=T.frag.level}break;case D.ErrorDetails.LEVEL_LOAD_ERROR:case D.ErrorDetails.LEVEL_LOAD_TIMEOUT:w&&(w.deliveryDirectives&&(m=!1),h=w.level),b=!0;break;case D.ErrorDetails.REMUX_ALLOC_ERROR:h=T.level,b=!0;break}h!==void 0&&this.recoverLevel(T,h,b,m)},d.recoverLevel=function(A,T,w,C){var b=A.details,m=this._levels[T];if(m.loadError++,w){var h=this.retryLoadingOrFail(A);if(h)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(C){var u=m.url.length;if(u>1&&m.loadError<u)A.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var x=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==x&&this._levels[x].loadError===0&&(this.warn(b+": switch to "+x),A.levelRetry=!0,this.hls.nextAutoLevel=x)}}},d.redundantFailover=function(A){var T=this._levels[A],w=T.url.length;if(w>1){var C=(T.urlId+1)%w;this.warn("Switching to redundant URL-id "+C),this._levels.forEach(function(b){b.urlId=C}),this.level=A}},d.onFragLoaded=function(A,T){var w=T.frag;if(w!==void 0&&w.type===I.PlaylistLevelType.MAIN){var C=this._levels[w.level];C!==void 0&&(C.fragmentError=0,C.loadError=0)}},d.onLevelLoaded=function(A,T){var w,C=T.level,b=T.details,m=this._levels[C];if(!m){var h;this.warn("Invalid level index "+C),(h=T.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(b.deltaUpdateFailed=!0);return}C===this.currentLevelIndex?(m.fragmentError===0&&(m.loadError=0,this.retryCount=0),this.playlistLoaded(C,T,m.details)):(w=T.deliveryDirectives)!==null&&w!==void 0&&w.skip&&(b.deltaUpdateFailed=!0)},d.onAudioTrackSwitched=function(A,T){var w=this.hls.levels[this.currentLevelIndex];if(!w)return;if(w.audioGroupIds){for(var C=-1,b=this.hls.audioTracks[T.id].groupId,m=0;m<w.audioGroupIds.length;m++)if(w.audioGroupIds[m]===b){C=m;break}C!==w.urlId&&(w.urlId=C,this.startLoad())}},d.loadPlaylist=function(A){var T=this.currentLevelIndex,w=this._levels[T];if(this.canLoad&&w&&w.url.length>0){var C=w.urlId,b=w.url[C];if(A)try{b=A.addDirectives(b)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Attempt loading level index "+T+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+C+" "+b),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:b,level:T,id:C,deliveryDirectives:A||null})}},d.removeLevel=function(A,T){var w=function(m,h){return h!==T},C=this._levels.filter(function(b,m){return m!==A?!0:b.url.length>1&&T!==void 0?(b.url=b.url.filter(w),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(w)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(w)),b.urlId=0,!0):!1}).map(function(b,m){var h=b.details;return h!=null&&h.fragments&&h.fragments.forEach(function(u){u.level=m}),b});this._levels=C,this.hls.trigger(B.Events.LEVELS_UPDATED,{levels:C})},p(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var T,w=this._levels;if(w.length===0)return;if(this.currentLevelIndex===A&&(T=w[A])!==null&&T!==void 0&&T.details)return;if(A<0||A>=w.length){var C=A<0;if(this.hls.trigger(B.Events.ERROR,{type:D.ErrorTypes.OTHER_ERROR,details:D.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:C,reason:"invalid level idx"}),C)return;A=Math.min(A,w.length-1)}this.clearTimer();var b=this.currentLevelIndex,m=w[b],h=w[A];this.log("switching to level "+A+" from "+b),this.currentLevelIndex=A;var u=_({},h,{level:A,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete u._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,u);var x=h.details;if(!x||x.live){var g=this.switchParams(h.uri,m==null?void 0:m.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(A){this.manualLevelIndex=A,this._startLevel===void 0&&(this._startLevel=A),A!==-1&&(this.level=A)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(A){this._firstLevel=A}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var A=this.hls.config.startLevel;return A!==void 0?A:this._firstLevel}else return this._startLevel},set:function(A){this._startLevel=A}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(A){this.level=A,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=A)}}]),s}(k.default)},"./src/controller/level-helper.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"addGroupId",function(){return D}),N.d(Q,"assignTrackIdsByGroup",function(){return H}),N.d(Q,"updatePTS",function(){return F}),N.d(Q,"updateFragPTSDTS",function(){return I}),N.d(Q,"mergeDetails",function(){return _}),N.d(Q,"mapPartIntersection",function(){return v}),N.d(Q,"mapFragmentIntersection",function(){return p}),N.d(Q,"adjustSliding",function(){return c}),N.d(Q,"addSliding",function(){return a}),N.d(Q,"computeReloadInterval",function(){return l}),N.d(Q,"getFragmentWithSN",function(){return o}),N.d(Q,"getPartWith",function(){return r});var J=N("./src/polyfills/number.ts"),B=N("./src/utils/logger.ts");function D(s,d,R){switch(d){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(R);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(R);break}}function H(s){var d={};s.forEach(function(R){var A=R.groupId||"";R.id=d[A]=d[A]||0,d[A]++})}function F(s,d,R){var A=s[d],T=s[R];k(A,T)}function k(s,d){var R=d.startPTS;if(Object(J.isFiniteNumber)(R)){var A=0,T;d.sn>s.sn?(A=R-s.start,T=s):(A=s.start-R,T=d),T.duration!==A&&(T.duration=A)}else if(d.sn>s.sn){var w=s.cc===d.cc;w&&s.minEndPTS?d.start=s.start+(s.minEndPTS-s.start):d.start=s.start+s.duration}else d.start=Math.max(s.start-d.duration,0)}function I(s,d,R,A,T,w){var C=A-R;C<=0&&(B.logger.warn("Fragment should have a positive duration",d),A=R+d.duration,w=T+d.duration);var b=R,m=A,h=d.startPTS,u=d.endPTS;if(Object(J.isFiniteNumber)(h)){var x=Math.abs(h-R);Object(J.isFiniteNumber)(d.deltaPTS)?d.deltaPTS=Math.max(x,d.deltaPTS):d.deltaPTS=x,b=Math.max(R,h),R=Math.min(R,h),T=Math.min(T,d.startDTS),m=Math.min(A,u),A=Math.max(A,u),w=Math.max(w,d.endDTS)}d.duration=A-R;var g=R-d.start;d.appendedPTS=A,d.start=d.startPTS=R,d.maxStartPTS=b,d.startDTS=T,d.endPTS=A,d.minEndPTS=m,d.endDTS=w;var y=d.sn;if(!s||y<s.startSN||y>s.endSN)return 0;var M,E=y-s.startSN,j=s.fragments;for(j[E]=d,M=E;M>0;M--)k(j[M],j[M-1]);for(M=E;M<j.length-1;M++)k(j[M],j[M+1]);return s.fragmentHint&&k(j[j.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,g}function _(s,d){for(var R=null,A=s.fragments,T=A.length-1;T>=0;T--){var w=A[T].initSegment;if(w){R=w;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var C=0,b;if(p(s,d,function(M,E){M.relurl&&(C=M.cc-E.cc),Object(J.isFiniteNumber)(M.startPTS)&&Object(J.isFiniteNumber)(M.endPTS)&&(E.start=E.startPTS=M.startPTS,E.startDTS=M.startDTS,E.appendedPTS=M.appendedPTS,E.maxStartPTS=M.maxStartPTS,E.endPTS=M.endPTS,E.endDTS=M.endDTS,E.minEndPTS=M.minEndPTS,E.duration=M.endPTS-M.startPTS,E.duration&&(b=E),d.PTSKnown=d.alignedSliding=!0),E.elementaryStreams=M.elementaryStreams,E.loader=M.loader,E.stats=M.stats,E.urlId=M.urlId,M.initSegment&&(E.initSegment=M.initSegment,R=M.initSegment)}),R){var m=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments;m.forEach(function(M){var E;(!M.initSegment||M.initSegment.relurl===((E=R)===null||E===void 0?void 0:E.relurl))&&(M.initSegment=R)})}if(d.skippedSegments&&(d.deltaUpdateFailed=d.fragments.some(function(M){return!M}),d.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=d.skippedSegments;h--;)d.fragments.shift();d.startSN=d.fragments[0].sn,d.startCC=d.fragments[0].cc}var u=d.fragments;if(C){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var x=0;x<u.length;x++)u[x].cc+=C}d.skippedSegments&&(d.startCC=d.fragments[0].cc),v(s.partList,d.partList,function(M,E){E.elementaryStreams=M.elementaryStreams,E.stats=M.stats}),b?I(d,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):c(s,d),u.length&&(d.totalduration=d.edge-u[0].start),d.driftStartTime=s.driftStartTime,d.driftStart=s.driftStart;var g=d.advancedDateTime;if(d.advanced&&g){var y=d.edge;d.driftStart||(d.driftStartTime=g,d.driftStart=y),d.driftEndTime=g,d.driftEnd=y}else d.driftEndTime=s.driftEndTime,d.driftEnd=s.driftEnd,d.advancedDateTime=s.advancedDateTime}function v(s,d,R){if(s&&d)for(var A=0,T=0,w=s.length;T<=w;T++){var C=s[T],b=d[T+A];C&&b&&C.index===b.index&&C.fragment.sn===b.fragment.sn?R(C,b):A--}}function p(s,d,R){for(var A=d.skippedSegments,T=Math.max(s.startSN,d.startSN)-d.startSN,w=(s.fragmentHint?1:0)+(A?d.endSN:Math.min(s.endSN,d.endSN))-d.startSN,C=d.startSN-s.startSN,b=d.fragmentHint?d.fragments.concat(d.fragmentHint):d.fragments,m=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,h=T;h<=w;h++){var u=m[C+h],x=b[h];A&&!x&&h<A&&(x=d.fragments[h]=u),u&&x&&R(u,x)}}function c(s,d){var R=d.startSN+d.skippedSegments-s.startSN,A=s.fragments;if(R<0||R>=A.length)return;a(d,A[R].start)}function a(s,d){if(d){for(var R=s.fragments,A=s.skippedSegments;A<R.length;A++)R[A].start+=d;s.fragmentHint&&(s.fragmentHint.start+=d)}}function l(s,d){var R=1e3*s.levelTargetDuration,A=R/2,T=s.age,w=T>0&&T<R*3,C=d.loading.end-d.loading.start,b,m=s.availabilityDelay;if(s.updated===!1)if(w){var h=333*s.misses;b=Math.max(Math.min(A,C*2),h),s.availabilityDelay=(s.availabilityDelay||0)+b}else b=A;else w?(m=Math.min(m||R/2,T),s.availabilityDelay=m,b=m+R-T):b=R-C;return Math.round(b)}function o(s,d,R){if(!s||!s.details)return null;var A=s.details,T=A.fragments[d-A.startSN];return T||(T=A.fragmentHint,T&&T.sn===d?T:d<A.startSN&&R&&R.sn===d?R:null)}function r(s,d,R){if(!s||!s.details)return null;var A=s.details.partList;if(A)for(var T=A.length;T--;){var w=A[T];if(w.index===R&&w.fragment.sn===d)return w}return null}},"./src/controller/stream-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return A});var J=N("./src/polyfills/number.ts"),B=N("./src/controller/base-stream-controller.ts"),D=N("./src/is-supported.ts"),H=N("./src/events.ts"),F=N("./src/utils/buffer-helper.ts"),k=N("./src/controller/fragment-tracker.ts"),I=N("./src/types/loader.ts"),_=N("./src/loader/fragment.ts"),v=N("./src/demux/transmuxer-interface.ts"),p=N("./src/types/transmuxer.ts"),c=N("./src/controller/gap-controller.ts"),a=N("./src/errors.ts"),l=N("./src/utils/logger.ts");function o(T,w){for(var C=0;C<w.length;C++){var b=w[C];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(T,b.key,b)}}function r(T,w,C){return w&&o(T.prototype,w),C&&o(T,C),T}function s(T,w){T.prototype=Object.create(w.prototype),T.prototype.constructor=T,d(T,w)}function d(T,w){return d=Object.setPrototypeOf||function(b,m){return b.__proto__=m,b},d(T,w)}var R=100,A=function(T){s(w,T);function w(b,m){var h;return h=T.call(this,b,m,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var C=w.prototype;return C._registerListeners=function(){var m=this.hls;m.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),m.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),m.on(H.Events.ERROR,this.onError,this),m.on(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.on(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this),m.on(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.on(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),m.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var m=this.hls;m.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),m.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),m.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),m.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(H.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),m.off(H.Events.ERROR,this.onError,this),m.off(H.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),m.off(H.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),m.off(H.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),m.off(H.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),m.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(m){if(this.levels){var h=this.lastCurrentTime,u=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var x=u.startLevel;x===-1&&(u.config.testBandwidth?(x=0,this.bitrateTest=!0):x=u.nextAutoLevel),this.level=u.nextLoadLevel=x,this.loadedmetadata=!1}h>0&&m===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),m=h),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=m,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var m,h=this.levels,u=this.level,x=h==null||((m=h[u])===null||m===void 0)?void 0:m.details;if(x&&(!x.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(x))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var g,y=self.performance.now(),M=this.retryDate;(!M||y>=M||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},C.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var m,h,u=this.hls,x=this.levelLastLoaded,g=this.levels,y=this.media,M=u.config,E=u.nextLoadLevel;if(x===null||!y&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[E])return;var j=g[E];this.level=u.nextLoadLevel=E;var G=j.details;if(!G||this.state===B.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==E){this.state=B.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,I.PlaylistLevelType.MAIN);if(U===null)return;var O=U.len,X=this.getMaxBufferLength(j.maxBitrate);if(O>=X)return;if(this._streamEnded(U,G)){var $={};this.altAudio&&($.type="video"),this.hls.trigger(H.Events.BUFFER_EOS,$),this.state=B.State.ENDED;return}var se=U.end,ce=this.getNextFragment(se,G);if(this.couldBacktrack&&!this.fragPrevious&&ce&&ce.sn!=="initSegment"){var Pe=ce.sn-G.startSN;Pe>1&&(ce=G.fragments[Pe-1],this.fragmentTracker.removeFragment(ce))}if(ce&&this.fragmentTracker.getState(ce)===k.FragmentState.OK&&this.nextLoadPosition>se){var Se=this.audioOnly&&!this.altAudio?_.ElementaryStreamTypes.AUDIO:_.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Se,I.PlaylistLevelType.MAIN),ce=this.getNextFragment(this.nextLoadPosition,G)}if(!ce)return;ce.initSegment&&!ce.initSegment.data&&!this.bitrateTest&&(ce=ce.initSegment),((m=ce.decryptdata)===null||m===void 0?void 0:m.keyFormat)==="identity"&&!((h=ce.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(ce,G):this.loadFragment(ce,G,se)},C.loadFragment=function(m,h,u){var x,g=this.fragmentTracker.getState(m);if(this.fragCurrent=m,g===k.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(m);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else g=k.FragmentState.NOT_LOADED}g===k.FragmentState.NOT_LOADED||g===k.FragmentState.PARTIAL?m.sn==="initSegment"?this._loadInitSegment(m):this.bitrateTest?(m.bitrateTest=!0,this.log("Fragment "+m.sn+" of level "+m.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(m)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,m,h,u)):g===k.FragmentState.APPENDING?this.reduceMaxBufferLength(m.duration)&&this.fragmentTracker.removeFragment(m):((x=this.media)===null||x===void 0?void 0:x.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(m){var h=this.fragmentTracker.getAppendedFrag(m,I.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},C.getBufferedFrag=function(m){return this.fragmentTracker.getBufferedFrag(m,I.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(m){return m?this.getBufferedFrag(m.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var m=this.levels,h=this.media;if(h!=null&&h.readyState){var u,x=this.getAppendedFrag(h.currentTime);if(x&&x.start>1&&this.flushMainBuffer(0,x.start-1),!h.paused&&m){var g=this.hls.nextLoadLevel,y=m[g],M=this.fragLastKbps;M&&this.fragCurrent?u=this.fragCurrent.duration*y.maxBitrate/(1e3*M)+1:u=0}else u=0;var E=this.getBufferedFrag(h.currentTime+u);if(E){var j=this.followingBufferedFrag(E);if(j){this.abortCurrentFrag();var G=j.maxStartPTS?j.maxStartPTS:j.start,U=j.duration,O=Math.max(E.end,G+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var m=this.fragCurrent;this.fragCurrent=null,m!=null&&m.loader&&m.loader.abort(),this.state===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(m,h){T.prototype.flushMainBuffer.call(this,m,h,this.altAudio?"video":null)},C.onMediaAttached=function(m,h){T.prototype.onMediaAttached.call(this,m,h);var u=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),u.addEventListener("playing",this.onvplaying),u.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,u,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var m=this.media;m&&(m.removeEventListener("playing",this.onvplaying),m.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var m=this.media,h=m?m.currentTime:null;Object(J.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(H.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},C.onManifestParsed=function(m,h){var u=!1,x=!1,g;h.levels.forEach(function(y){g=y.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(u=!0),g.indexOf("mp4a.40.5")!==-1&&(x=!0))}),this.audioCodecSwitch=u&&x&&!Object(D.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},C.onLevelLoading=function(m,h){var u=this.levels;if(!u||this.state!==B.State.IDLE)return;var x=u[h.level];(!x.details||x.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(x.details))&&(this.state=B.State.WAITING_LEVEL)},C.onLevelLoaded=function(m,h){var u,x=this.levels,g=h.level,y=h.details,M=y.totalduration;if(!x){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+M);var E=this.fragCurrent;E&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(E.level!==h.level&&E.loader&&(this.state=B.State.IDLE,E.loader.abort()));var j=x[g],G=0;if(y.live||(u=j.details)!==null&&u!==void 0&&u.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;G=this.alignPlaylists(y,j.details)}if(j.details=y,this.levelLastLoaded=g,this.hls.trigger(H.Events.LEVEL_UPDATED,{details:y,level:g}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=B.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,G),this.tick()},C._handleFragmentLoadProgress=function(m){var h,u=m.frag,x=m.part,g=m.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+u.sn+" of level "+u.level+" will not be buffered");return}var M=y[u.level],E=M.details;if(!E){this.warn("Dropping fragment "+u.sn+" of level "+u.level+" after level details were reset");return}var j=M.videoCodec,G=E.PTSKnown||!E.live,U=(h=u.initSegment)===null||h===void 0?void 0:h.data,O=this._getAudioCodec(M),X=this.transmuxer=this.transmuxer||new v.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),$=x?x.index:-1,se=$!==-1,ce=new p.ChunkMetadata(u.level,u.sn,u.stats.chunkCount,g.byteLength,$,se),Pe=this.initPTS[u.cc];X.push(g,U,O,j,u,x,E.totalduration,G,ce,Pe)},C.onAudioTrackSwitching=function(m,h){var u=this.altAudio,x=!!h.url,g=h.id;if(!x){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;u&&M.trigger(H.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(H.Events.AUDIO_TRACK_SWITCHED,{id:g})}},C.onAudioTrackSwitched=function(m,h){var u=h.id,x=!!this.hls.audioTracks[u].url;if(x){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=x,this.tick()},C.onBufferCreated=function(m,h){var u=h.tracks,x,g,y=!1;for(var M in u){var E=u[M];if(E.id==="main"){if(g=M,x=E,M==="video"){var j=u[M];j&&(this.videoBuffer=j.buffer)}}else y=!0}y&&x?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=x.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(m,h){var u=h.frag,x=h.part;if(u&&u.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(u)){this.warn("Fragment "+u.sn+(x?" p: "+x.index:"")+" of level "+u.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var g=x?x.stats:u.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),u.sn!=="initSegment"&&(this.fragPrevious=u),this.fragBufferedComplete(u,x)},C.onError=function(m,h){switch(h.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(I.PlaylistLevelType.MAIN,h);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==B.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=B.State.ERROR):!h.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var u=!0,x=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);x&&x.len>.5&&(u=!this.reduceMaxBufferLength(x.len)),u&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},C.checkBuffer=function(){var m=this.media,h=this.gapController;if(!m||!h||!m.readyState)return;var u=F.BufferHelper.getBuffered(m);!this.loadedmetadata&&u.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=m.currentTime},C.onFragLoadEmergencyAborted=function(){this.state=B.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(m,h){var u=h.type;if(u!==_.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var x=(u===_.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(x,u,I.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(m,h){this.levels=h.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var m=this.media,h=m.currentTime,u=this.startPosition;if(u>=0&&h<u){if(m.seeking){l.logger.log("could not seek to "+u+", already seeking at "+h);return}var x=F.BufferHelper.getBuffered(m),g=x.length?x.start(0):0,y=g-u;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+y+" to match buffer start"),u+=y,this.startPosition=u),this.log("seek to target start position "+u+" from current time "+h),m.currentTime=u}},C._getAudioCodec=function(m){var h=this.config.defaultAudioCodec||m.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},C._loadBitrateTestFrag=function(m){var h=this;this._doFragLoad(m).then(function(u){var x=h.hls;if(!u||x.nextLoadLevel||h.fragContextChanged(m))return;h.fragLoadError=0,h.state=B.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var g=m.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),x.trigger(H.Events.FRAG_LOADED,u)})},C._handleTransmuxComplete=function(m){var h,u="main",x=this.hls,g=m.remuxResult,y=m.chunkMeta,M=this.getCurrentContext(y);if(!M){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var E=M.frag,j=M.part,G=M.level,U=g.video,O=g.text,X=g.id3,$=g.initSegment,se=this.altAudio?void 0:g.audio;if(this.fragContextChanged(E))return;if(this.state=B.State.PARSING,$){$.tracks&&(this._bufferInitSegment(G,$.tracks,E,y),x.trigger(H.Events.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:u,tracks:$.tracks}));var ce=$.initPTS,Pe=$.timescale;Object(J.isFiniteNumber)(ce)&&(this.initPTS[E.cc]=ce,x.trigger(H.Events.INIT_PTS_FOUND,{frag:E,id:u,initPTS:ce,timescale:Pe}))}if(U&&g.independent!==!1){if(G.details){var Se=U.startPTS,Re=U.endPTS,Oe=U.startDTS,Me=U.endDTS;if(j)j.elementaryStreams[U.type]={startPTS:Se,endPTS:Re,startDTS:Oe,endDTS:Me};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<Se){this.backtrack(E);return}E.setElementaryStreamInfo(U.type,E.start,Re,E.start,Me,!0)}E.setElementaryStreamInfo(U.type,Se,Re,Oe,Me),this.bufferFragmentData(U,E,j,y)}}else if(g.independent===!1){this.backtrack(E);return}if(se){var ue=se.startPTS,ne=se.endPTS,ve=se.startDTS,le=se.endDTS;j&&(j.elementaryStreams[_.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:ne,startDTS:ve,endDTS:le}),E.setElementaryStreamInfo(_.ElementaryStreamTypes.AUDIO,ue,ne,ve,le),this.bufferFragmentData(se,E,j,y)}if(X!=null&&(h=X.samples)!==null&&h!==void 0&&h.length){var ke={frag:E,id:u,samples:X.samples};x.trigger(H.Events.FRAG_PARSING_METADATA,ke)}if(O){var Fe={frag:E,id:u,samples:O.samples};x.trigger(H.Events.FRAG_PARSING_USERDATA,Fe)}},C._bufferInitSegment=function(m,h,u,x){var g=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var y=h.audio,M=h.video,E=h.audiovideo;if(y){var j=m.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),y.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(j="mp4a.40.5")),G.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),m.audioCodec&&m.audioCodec!==j&&this.log('Swapping manifest audio codec "'+m.audioCodec+'" for "'+j+'"'),y.levelCodec=j,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(m.audioCodec||"")+"/"+y.codec+"]")}M&&(M.levelCodec=m.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(m.videoCodec||"")+"/"+M.codec+"]")),E&&this.log("Init audiovideo buffer, container:"+E.container+", codecs[level/parsed]=["+(m.attrs.CODECS||"")+"/"+E.codec+"]"),this.hls.trigger(H.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(U){var O=h[U],X=O.initSegment;X!=null&&X.byteLength&&g.hls.trigger(H.Events.BUFFER_APPENDING,{type:U,data:X,frag:u,part:null,chunkMeta:x,parent:u.type})}),this.tick()},C.backtrack=function(m){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(m);var h=this.fragmentTracker.backtrack(m);this.fragPrevious=null,this.nextLoadPosition=m.start,h?this.resetFragmentLoading(m):this.state=B.State.BACKTRACKING},C.checkFragmentChanged=function(){var m=this.media,h=null;if(m&&m.readyState>1&&m.seeking===!1){var u=m.currentTime;if(F.BufferHelper.isBuffered(m,u)?h=this.getAppendedFrag(u):F.BufferHelper.isBuffered(m,u+.1)&&(h=this.getAppendedFrag(u+.1)),h){var x=this.fragPlaying,g=h.level;(!x||h.sn!==x.sn||x.level!==g||h.urlId!==x.urlId)&&(this.hls.trigger(H.Events.FRAG_CHANGED,{frag:h}),(!x||x.level!==g)&&this.hls.trigger(H.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=h)}}},r(w,[{key:"nextLevel",get:function(){var m=this.nextBufferedFrag;return m?m.level:-1}},{key:"currentLevel",get:function(){var m=this.media;if(m){var h=this.getAppendedFrag(m.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var m=this.media;if(m){var h=this.getAppendedFrag(m.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),w}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"SubtitleStreamController",function(){return s});var J=N("./src/events.ts"),B=N("./src/utils/logger.ts"),D=N("./src/utils/buffer-helper.ts"),H=N("./src/controller/fragment-finders.ts"),F=N("./src/utils/discontinuities.ts"),k=N("./src/controller/level-helper.ts"),I=N("./src/controller/fragment-tracker.ts"),_=N("./src/controller/base-stream-controller.ts"),v=N("./src/types/loader.ts"),p=N("./src/types/level.ts");function c(d,R){for(var A=0;A<R.length;A++){var T=R[A];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(d,T.key,T)}}function a(d,R,A){return R&&c(d.prototype,R),A&&c(d,A),d}function l(d,R){d.prototype=Object.create(R.prototype),d.prototype.constructor=d,o(d,R)}function o(d,R){return o=Object.setPrototypeOf||function(T,w){return T.__proto__=w,T},o(d,R)}var r=500,s=function(d){l(R,d);function R(T,w){var C;return C=d.call(this,T,w,"[subtitle-stream-controller]")||this,C.levels=[],C.currentTrackId=-1,C.tracksBuffered=[],C.mainDetails=null,C._registerListeners(),C}var A=R.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var w=this.hls;w.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.on(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.on(J.Events.ERROR,this.onError,this),w.on(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.on(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.on(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var w=this.hls;w.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),w.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),w.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),w.off(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),w.off(J.Events.ERROR,this.onError,this),w.off(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),w.off(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),w.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),w.off(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),w.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.startLoad=function(){this.stopLoad(),this.state=_.State.IDLE,this.setInterval(r),this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(w,C){this.mainDetails=C.details},A.onSubtitleFragProcessed=function(w,C){var b=C.frag,m=C.success;if(this.fragPrevious=b,this.state=_.State.IDLE,!m)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var u,x=b.start,g=0;g<h.length;g++)if(x>=h[g].start&&x<=h[g].end){u=h[g];break}var y=b.start+b.duration;u?u.end=y:(u={start:x,end:y},h.push(u)),this.fragmentTracker.fragBuffered(b)},A.onBufferFlushing=function(w,C){var b=C.startOffset,m=C.endOffset;if(b===0&&m!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,u=this.levels;if(!u.length||!u[h]||!u[h].details)return;var x=u[h].details,g=x.targetduration,y=m-g;if(y<=0)return;C.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(M){for(var E=0;E<M.length;){if(M[E].end<=y){M.shift();continue}else if(M[E].start<y)M[E].start=y;else break;E++}}),this.fragmentTracker.removeFragmentsInRange(b,y,v.PlaylistLevelType.SUBTITLE)}},A.onError=function(w,C){var b,m=C.frag;if(!m||m.type!==v.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=_.State.IDLE},A.onSubtitleTracksUpdated=function(w,C){var b=this,m=C.subtitleTracks;this.tracksBuffered=[],this.levels=m.map(function(h){return new p.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){b.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(w,C){if(this.currentTrackId=C.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(r)},A.onSubtitleTrackLoaded=function(w,C){var b,m=C.details,h=C.id,u=this.currentTrackId,x=this.levels;if(!x.length)return;var g=x[u];if(h>=x.length||h!==u||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,m.live||(b=g.details)!==null&&b!==void 0&&b.live){var y=this.mainDetails;if(m.deltaUpdateFailed||!y)return;var M=y.fragments[0];if(!g.details)m.hasProgramDateTime&&y.hasProgramDateTime?Object(F.alignMediaPlaylistByPDT)(m,y):M&&Object(k.addSliding)(m,M.start);else{var E=this.alignPlaylists(m,g.details);E===0&&M&&Object(k.addSliding)(m,M.start)}}if(g.details=m,this.levelLastLoaded=h,this.tick(),m.live&&!this.fragCurrent&&this.media&&this.state===_.State.IDLE){var j=Object(H.findFragmentByPTS)(null,m.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},A._handleFragmentLoadComplete=function(w){var C=w.frag,b=w.payload,m=C.decryptdata,h=this.hls;if(this.fragContextChanged(C))return;if(b&&b.byteLength>0&&m&&m.key&&m.iv&&m.method==="AES-128"){var u=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),m.key.buffer,m.iv.buffer).then(function(x){var g=performance.now();h.trigger(J.Events.FRAG_DECRYPTED,{frag:C,payload:x,stats:{tstart:u,tdecrypt:g}})})}},A.doTick=function(){if(!this.media){this.state=_.State.IDLE;return}if(this.state===_.State.IDLE){var w,C=this.currentTrackId,b=this.levels;if(!b.length||!b[C]||!b[C].details)return;var m=b[C].details,h=m.targetduration,u=this.config,x=this.media,g=D.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,x.currentTime-h,u.maxBufferHole),y=g.end,M=g.len,E=this.getMaxBufferLength()+h;if(M>E)return;console.assert(m,"Subtitle track details are defined on idle subtitle stream controller tick");var j=m.fragments,G=j.length,U=m.edge,O,X=this.fragPrevious;if(y<U){var $=u.maxFragLookUpTolerance;X&&m.hasProgramDateTime&&(O=Object(H.findFragmentByPDT)(j,X.endProgramDateTime,$)),O||(O=Object(H.findFragmentByPTS)(X,j,y,$),!O&&X&&X.start<j[0].start&&(O=j[0]))}else O=j[G-1];(w=O)!==null&&w!==void 0&&w.encrypted?(B.logger.log("Loading key for "+O.sn),this.state=_.State.KEY_LOADING,this.hls.trigger(J.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===I.FragmentState.NOT_LOADED&&this.loadFragment(O,m,y)}},A.loadFragment=function(w,C,b){this.fragCurrent=w,d.prototype.loadFragment.call(this,w,C,b)},a(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(_.default)},"./src/controller/subtitle-track-controller.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/events.ts"),B=N("./src/utils/texttrack-utils.ts"),D=N("./src/controller/base-playlist-controller.ts"),H=N("./src/types/loader.ts");function F(c,a){for(var l=0;l<a.length;l++){var o=a[l];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(c,o.key,o)}}function k(c,a,l){return a&&F(c.prototype,a),l&&F(c,l),c}function I(c,a){c.prototype=Object.create(a.prototype),c.prototype.constructor=c,_(c,a)}function _(c,a){return _=Object.setPrototypeOf||function(o,r){return o.__proto__=r,o},_(c,a)}var v=function(c){I(a,c);function a(o){var r;return r=c.call(this,o,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var l=a.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},l.registerListeners=function(){var r=this.hls;r.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(J.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var r=this.hls;r.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(J.Events.ERROR,this.onError,this)},l.onMediaAttached=function(r,s){if(this.media=s.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)},l.pollTrackChange=function(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},l.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var r=p(this.media.textTracks);r.forEach(function(s){Object(B.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(r,s){this.tracks=s.subtitleTracks},l.onSubtitleTrackLoaded=function(r,s){var d=s.id,R=s.details,A=this.trackId,T=this.tracksInGroup[A];if(!T){this.warn("Invalid subtitle track id "+d);return}var w=T.details;T.details=s.details,this.log("subtitle track "+d+" loaded ["+R.startSN+"-"+R.endSN+"]"),d===this.trackId&&(this.retryCount=0,this.playlistLoaded(d,s,w))},l.onLevelLoading=function(r,s){this.switchLevel(s.level)},l.onLevelSwitching=function(r,s){this.switchLevel(s.level)},l.switchLevel=function(r){var s=this.hls.levels[r];if(!(s!=null&&s.textGroupIds))return;var d=s.textGroupIds[s.urlId];if(this.groupId!==d){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,A=this.tracks.filter(function(C){return!d||C.groupId===d});this.tracksInGroup=A;var T=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=d;var w={subtitleTracks:A};this.log("Updating subtitle tracks, "+A.length+' track(s) found in "'+d+'" group-id'),this.hls.trigger(J.Events.SUBTITLE_TRACKS_UPDATED,w),T!==-1&&this.setSubtitleTrack(T,R)}},l.findTrackId=function(r){for(var s=this.tracksInGroup,d=0;d<s.length;d++){var R=s[d];if((!this.selectDefaultTrack||R.default)&&(!r||r===R.name))return R.id}return-1},l.onError=function(r,s){if(c.prototype.onError.call(this,r,s),s.fatal||!s.context)return;s.context.type===H.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},l.loadPlaylist=function(r){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var d=s.id,R=s.groupId,A=s.url;if(r)try{A=r.addDirectives(A)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+d),this.hls.trigger(J.Events.SUBTITLE_TRACK_LOADING,{url:A,id:d,groupId:R,deliveryDirectives:r||null})}},l.toggleTrackModes=function(r){var s=this,d=this.media,R=this.subtitleDisplay,A=this.trackId;if(!d)return;var T=p(d.textTracks),w=T.filter(function(m){return m.groupId===s.groupId});if(r===-1)[].slice.call(T).forEach(function(m){m.mode="disabled"});else{var C=w[A];C&&(C.mode="disabled")}var b=w[r];b&&(b.mode=R?"showing":"hidden")},l.setSubtitleTrack=function(r,s){var d,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(d=R[r])!==null&&d!==void 0&&d.details)||r<-1||r>=R.length)return;this.clearTimer();var A=R[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,A){var T=A.id,w=A.groupId,C=w===void 0?"":w,b=A.name,m=A.type,h=A.url;this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:C,name:b,type:m,url:h});var u=this.switchParams(A.url,s==null?void 0:s.details);this.loadPlaylist(u)}else this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:r})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,s=p(this.media.textTracks),d=0;d<s.length;d++)if(s[d].mode==="hidden")r=d;else if(s[d].mode==="showing"){r=d;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},k(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,s)}}]),a}(D.default);function p(c){for(var a=[],l=0;l<c.length;l++){var o=c[l];o.kind==="subtitles"&&o.label&&a.push(c[l])}return a}Q.default=v},"./src/controller/timeline-controller.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"TimelineController",function(){return p});var J=N("./src/polyfills/number.ts"),B=N("./src/events.ts"),D=N("./src/utils/cea-608-parser.ts"),H=N("./src/utils/output-filter.ts"),F=N("./src/utils/webvtt-parser.ts"),k=N("./src/utils/texttrack-utils.ts"),I=N("./src/utils/imsc1-ttml-parser.ts"),_=N("./src/types/loader.ts"),v=N("./src/utils/logger.ts"),p=function(){function o(s){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=l(),this.captionsProperties=void 0,this.hls=s,this.config=s.config,this.Cues=s.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 d=new H.default(this,"textTrack1"),R=new H.default(this,"textTrack2"),A=new H.default(this,"textTrack3"),T=new H.default(this,"textTrack4");this.cea608Parser1=new D.default(1,d,R),this.cea608Parser2=new D.default(3,A,T)}s.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(B.Events.FRAG_LOADING,this.onFragLoading,this),s.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=o.prototype;return r.destroy=function(){var d=this.hls;d.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),d.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),d.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),d.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),d.off(B.Events.FRAG_LOADING,this.onFragLoading,this),d.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),d.off(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),d.off(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),d.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),d.off(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),d.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(d,R,A,T,w){for(var C=!1,b=w.length;b--;){var m=w[b],h=a(m[0],m[1],R,A);if(h>=0&&(m[0]=Math.min(m[0],R),m[1]=Math.max(m[1],A),C=!0,h/(A-R)>.5))return}if(C||w.push([R,A]),this.config.renderTextTracksNatively){var u=this.captionsTracks[d];this.Cues.newCue(u,R,A,T)}else{var x=this.Cues.newCue(null,R,A,T);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:x,track:d})}},r.onInitPtsFound=function(d,R){var A=this,T=R.frag,w=R.id,C=R.initPTS,b=R.timescale,m=this.unparsedVttFrags;w==="main"&&(this.initPTS[T.cc]=C,this.timescale[T.cc]=b),m.length&&(this.unparsedVttFrags=[],m.forEach(function(h){A.onFragLoaded(B.Events.FRAG_LOADED,h)}))},r.getExistingTrack=function(d){var R=this.media;if(R)for(var A=0;A<R.textTracks.length;A++){var T=R.textTracks[A];if(T[d])return T}return null},r.createCaptionsTrack=function(d){this.config.renderTextTracksNatively?this.createNativeTrack(d):this.createNonNativeTrack(d)},r.createNativeTrack=function(d){if(this.captionsTracks[d])return;var R=this.captionsProperties,A=this.captionsTracks,T=this.media,w=R[d],C=w.label,b=w.languageCode,m=this.getExistingTrack(d);if(m)A[d]=m,Object(k.clearCurrentCues)(A[d]),Object(k.sendAddTrackEvent)(A[d],T);else{var h=this.createTextTrack("captions",C,b);h&&(h[d]=!0,A[d]=h)}},r.createNonNativeTrack=function(d){if(this.nonNativeCaptionsTracks[d])return;var R=this.captionsProperties[d];if(!R)return;var A=R.label,T={_id:d,label:A,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[d]=T,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},r.createTextTrack=function(d,R,A){var T=this.media;return T?T.addTextTrack(d,R,A):void 0},r.onMediaAttaching=function(d,R){this.media=R.media,this._cleanTracks()},r.onMediaDetaching=function(){var d=this.captionsTracks;Object.keys(d).forEach(function(R){Object(k.clearCurrentCues)(d[R]),delete d[R]}),this.nonNativeCaptionsTracks={}},r.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},r._cleanTracks=function(){var d=this.media;if(!d)return;var R=d.textTracks;if(R)for(var A=0;A<R.length;A++)Object(k.clearCurrentCues)(R[A])},r.onSubtitleTracksUpdated=function(d,R){var A=this;this.textTracks=[];var T=R.subtitleTracks||[],w=T.some(function(h){return h.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||w&&this.config.enableIMSC1){var C=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,u){var x;if(u<b.length){for(var g=null,y=0;y<b.length;y++)if(c(b[y],h)){g=b[y];break}g&&(x=g)}x?Object(k.clearCurrentCues)(x):(x=A.createTextTrack("subtitles",h.name,h.lang),x&&(x.mode="disabled")),x&&(x.groupId=h.groupId,A.textTracks.push(x))})}else if(!C&&this.tracks&&this.tracks.length){var m=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:m})}}},r.onManifestLoaded=function(d,R){var A=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(T){var w=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!w)return;var C="textTrack"+w[1],b=A.captionsProperties[C];if(!b)return;b.label=T.name,T.lang&&(b.languageCode=T.lang),b.media=T})},r.onFragLoading=function(d,R){var A=this.cea608Parser1,T=this.cea608Parser2,w=this.lastSn,C=this.lastPartIndex;if(!this.enabled||!(A&&T))return;if(R.frag.type===_.PlaylistLevelType.MAIN){var b,m,h=R.frag.sn,u=(b=R==null||((m=R.part)===null||m===void 0)?void 0:m.index)!=null?b:-1;h===w+1||h===w&&u===C+1||(A.reset(),T.reset()),this.lastSn=h,this.lastPartIndex=u}},r.onFragLoaded=function(d,R){var A=R.frag,T=R.payload,w=this.initPTS,C=this.unparsedVttFrags;if(A.type===_.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(J.isFiniteNumber)(w[A.cc])){C.push(R),w.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Missing initial subtitle PTS")});return}var b=A.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var m=this.tracks[A.level],h=this.vttCCs;h[A.cc]||(h[A.cc]={start:A.start,prevCC:this.prevCC,new:!0},this.prevCC=A.cc),m&&m.textCodec===I.IMSC1_CODEC?this._parseIMSC1(A,T):this._parseVTTs(A,T,h)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(d,R){var A=this,T=this.hls;Object(I.parseIMSC1)(R,this.initPTS[d.cc],this.timescale[d.cc],function(w){A._appendCues(w,d.level),T.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(w){v.logger.log("Failed to parse IMSC1: "+w),T.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:w})})},r._parseVTTs=function(d,R,A){var T=this,w=this.hls;Object(F.parseWebVTT)(R,this.initPTS[d.cc],this.timescale[d.cc],A,d.cc,d.start,function(C){T._appendCues(C,d.level),w.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:d})},function(C){T._fallbackToIMSC1(d,R),v.logger.log("Failed to parse VTT cue: "+C),w.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:d,error:C})})},r._fallbackToIMSC1=function(d,R){var A=this,T=this.tracks[d.level];T.textCodec||Object(I.parseIMSC1)(R,this.initPTS[d.cc],this.timescale[d.cc],function(){T.textCodec=I.IMSC1_CODEC,A._parseIMSC1(d,R)},function(){T.textCodec="wvtt"})},r._appendCues=function(d,R){var A=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[R];if(T.mode==="disabled")return;d.forEach(function(b){return Object(k.addCueToTrack)(T,b)})}else{var w=this.tracks[R],C=w.default?"default":"subtitles"+R;A.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:d,track:C})}},r.onFragDecrypted=function(d,R){var A=R.frag;if(A.type===_.PlaylistLevelType.SUBTITLE){if(!Object(J.isFiniteNumber)(this.initPTS[A.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(B.Events.FRAG_LOADED,R)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(d,R){var A=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(A&&T))return;for(var w=0;w<R.samples.length;w++){var C=R.samples[w].bytes;if(C){var b=this.extractCea608Data(C);A.addData(R.samples[w].pts,b[0]),T.addData(R.samples[w].pts,b[1])}}},r.onBufferFlushing=function(d,R){var A=R.startOffset,T=R.endOffset,w=R.endOffsetSubtitles,C=R.type,b=this.media;if(!b||b.currentTime<T)return;if(!C||C==="video"){var m=this.captionsTracks;Object.keys(m).forEach(function(u){return Object(k.removeCuesInRange)(m[u],A,T)})}if(this.config.renderTextTracksNatively&&(A===0&&w!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(u){return Object(k.removeCuesInRange)(h[u],A,w)})}},r.extractCea608Data=function(d){for(var R=d[0]&31,A=2,T=[[],[]],w=0;w<R;w++){var C=d[A++],b=127&d[A++],m=127&d[A++],h=(4&C)!==0,u=3&C;if(b===0&&m===0)continue;h&&((u===0||u===1)&&(T[u].push(b),T[u].push(m)))}return T},o}();function c(o,r){return o&&o.label===r.name&&!(o.textTrack1||o.textTrack2)}function a(o,r,s,d){return Math.min(r,d)-Math.max(o,s)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return J});var J=function(){function B(H,F){this.subtle=void 0,this.aesIV=void 0,this.subtle=H,this.aesIV=F}var D=B.prototype;return D.decrypt=function(F,k){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},k,F)},B}()},"./src/crypt/aes-decryptor.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"removePadding",function(){return B}),N.d(Q,"default",function(){return D});var J=N("./src/utils/typed-array.ts");function B(H){var F=H.byteLength,k=F&&new DataView(H.buffer).getUint8(F-1);return k?Object(J.sliceUint8)(H,0,F-k):H}var D=function(){function H(){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 F=H.prototype;return F.uint8ArrayToUint32Array_=function(I){for(var _=new DataView(I),v=new Uint32Array(4),p=0;p<4;p++)v[p]=_.getUint32(p*4);return v},F.initTable=function(){var I=this.sBox,_=this.invSBox,v=this.subMix,p=v[0],c=v[1],a=v[2],l=v[3],o=this.invSubMix,r=o[0],s=o[1],d=o[2],R=o[3],A=new Uint32Array(256),T=0,w=0,C=0;for(C=0;C<256;C++)C<128?A[C]=C<<1:A[C]=C<<1^283;for(C=0;C<256;C++){var b=w^w<<1^w<<2^w<<3^w<<4;b=b>>>8^b&255^99,I[T]=b,_[b]=T;var m=A[T],h=A[m],u=A[h],x=A[b]*257^b*16843008;p[T]=x<<24|x>>>8,c[T]=x<<16|x>>>16,a[T]=x<<8|x>>>24,l[T]=x,x=u*16843009^h*65537^m*257^T*16843008,r[b]=x<<24|x>>>8,s[b]=x<<16|x>>>16,d[b]=x<<8|x>>>24,R[b]=x,T?(T=m^A[A[A[u^m]]],w^=A[A[w]]):T=w=1}},F.expandKey=function(I){for(var _=this.uint8ArrayToUint32Array_(I),v=!0,p=0;p<_.length&&v;)v=_[p]===this.key[p],p++;if(v)return;this.key=_;var c=this.keySize=_.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var a=this.ksRows=(c+6+1)*4,l,o,r=this.keySchedule=new Uint32Array(a),s=this.invKeySchedule=new Uint32Array(a),d=this.sBox,R=this.rcon,A=this.invSubMix,T=A[0],w=A[1],C=A[2],b=A[3],m,h;for(l=0;l<a;l++){if(l<c){m=r[l]=_[l];continue}h=m,l%c===0?(h=h<<8|h>>>24,h=d[h>>>24]<<24|d[h>>>16&255]<<16|d[h>>>8&255]<<8|d[h&255],h^=R[l/c|0]<<24):c>6&&l%c===4&&(h=d[h>>>24]<<24|d[h>>>16&255]<<16|d[h>>>8&255]<<8|d[h&255]),r[l]=m=(r[l-c]^h)>>>0}for(o=0;o<a;o++)l=a-o,o&3?h=r[l]:h=r[l-4],o<4||l<=4?s[o]=h:s[o]=T[d[h>>>24]]^w[d[h>>>16&255]]^C[d[h>>>8&255]]^b[d[h&255]],s[o]=s[o]>>>0},F.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},F.decrypt=function(I,_,v){for(var p=this.keySize+6,c=this.invKeySchedule,a=this.invSBox,l=this.invSubMix,o=l[0],r=l[1],s=l[2],d=l[3],R=this.uint8ArrayToUint32Array_(v),A=R[0],T=R[1],w=R[2],C=R[3],b=new Int32Array(I),m=new Int32Array(b.length),h,u,x,g,y,M,E,j,G,U,O,X,$,se,ce=this.networkToHostOrderSwap;_<b.length;){for(G=ce(b[_]),U=ce(b[_+1]),O=ce(b[_+2]),X=ce(b[_+3]),y=G^c[0],M=X^c[1],E=O^c[2],j=U^c[3],$=4,se=1;se<p;se++)h=o[y>>>24]^r[M>>16&255]^s[E>>8&255]^d[j&255]^c[$],u=o[M>>>24]^r[E>>16&255]^s[j>>8&255]^d[y&255]^c[$+1],x=o[E>>>24]^r[j>>16&255]^s[y>>8&255]^d[M&255]^c[$+2],g=o[j>>>24]^r[y>>16&255]^s[M>>8&255]^d[E&255]^c[$+3],y=h,M=u,E=x,j=g,$=$+4;h=a[y>>>24]<<24^a[M>>16&255]<<16^a[E>>8&255]<<8^a[j&255]^c[$],u=a[M>>>24]<<24^a[E>>16&255]<<16^a[j>>8&255]<<8^a[y&255]^c[$+1],x=a[E>>>24]<<24^a[j>>16&255]<<16^a[y>>8&255]<<8^a[M&255]^c[$+2],g=a[j>>>24]<<24^a[y>>16&255]<<16^a[M>>8&255]<<8^a[E&255]^c[$+3],m[_]=ce(h^A),m[_+1]=ce(g^T),m[_+2]=ce(x^w),m[_+3]=ce(u^C),A=G,T=U,w=O,C=X,_=_+4}return m.buffer},H}()},"./src/crypt/decrypter.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return _});var J=N("./src/crypt/aes-crypto.ts"),B=N("./src/crypt/fast-aes-key.ts"),D=N("./src/crypt/aes-decryptor.ts"),H=N("./src/utils/logger.ts"),F=N("./src/utils/mp4-tools.ts"),k=N("./src/utils/typed-array.ts"),I=16,_=function(){function v(c,a,l){var o=l===void 0?{}:l,r=o.removePKCS7Padding,s=r===void 0?!0:r;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=c,this.config=a,this.removePKCS7Padding=s,s)try{var d=self.crypto;d&&(this.subtle=d.subtle||d.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=v.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var l=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(D.removePadding)(l):l},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(a,l,o,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),l,o);var s=this.flush();s&&r(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),l,o).then(r)},p.softwareDecrypt=function(a,l,o){var r=this.currentIV,s=this.currentResult,d=this.remainderData;this.logOnce("JS AES decrypt"),d&&(a=Object(F.appendUint8Array)(d,a),this.remainderData=null);var R=this.getValidChunk(a);if(!R.length)return null;r&&(o=r);var A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new D.default),A.expandKey(l);var T=s;return this.currentResult=A.decrypt(R.buffer,0,o),this.currentIV=Object(k.sliceUint8)(R,-16).buffer,T||null},p.webCryptoDecrypt=function(a,l,o){var r=this,s=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new B.default(s,l)),this.fastAesKey.expandKey().then(function(d){if(!s)return Promise.reject(new Error("web crypto not initialized"));var R=new J.default(s,o);return R.decrypt(a.buffer,d)}).catch(function(d){return r.onWebCryptoError(d,a,l,o)})},p.onWebCryptoError=function(a,l,o,r){return H.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,o,r)},p.getValidChunk=function(a){var l=a,o=a.length-a.length%I;return o!==a.length&&(l=Object(k.sliceUint8)(a,0,o),this.remainderData=Object(k.sliceUint8)(a,o)),l},p.logOnce=function(a){if(!this.logEnabled)return;H.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},v}()},"./src/crypt/fast-aes-key.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return J});var J=function(){function B(H,F){this.subtle=void 0,this.key=void 0,this.subtle=H,this.key=F}var D=B.prototype;return D.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},B}()},"./src/demux/aacdemuxer.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/demux/base-audio-demuxer.ts"),B=N("./src/demux/adts.ts"),D=N("./src/utils/logger.ts"),H=N("./src/demux/id3.ts");function F(_,v){_.prototype=Object.create(v.prototype),_.prototype.constructor=_,k(_,v)}function k(_,v){return k=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},k(_,v)}var I=function(_){F(v,_);function v(c,a){var l;return l=_.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=c,l.config=a,l}var p=v.prototype;return p.resetInitSegment=function(a,l,o){_.prototype.resetInitSegment.call(this,a,l,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:o,inputTimeScale:9e4,dropped:0}},v.probe=function(a){if(!a)return!1;for(var l=H.getID3Data(a,0)||[],o=l.length,r=a.length;o<r;o++)if(B.probe(a,o))return D.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(a,l){return B.canParse(a,l)},p.appendFrame=function(a,l,o){B.initTrackConfig(a,this.observer,l,o,a.manifestCodec);var r=B.appendFrame(a,l,o,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},v}(J.default);I.minProbeByteLength=9,Q.default=I},"./src/demux/adts.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"getAudioConfig",function(){return H}),N.d(Q,"isHeaderPattern",function(){return F}),N.d(Q,"getHeaderLength",function(){return k}),N.d(Q,"getFullFrameLength",function(){return I}),N.d(Q,"canGetFrameLength",function(){return _}),N.d(Q,"isHeader",function(){return v}),N.d(Q,"canParse",function(){return p}),N.d(Q,"probe",function(){return c}),N.d(Q,"initTrackConfig",function(){return a}),N.d(Q,"getFrameDuration",function(){return l}),N.d(Q,"parseFrameHeader",function(){return o}),N.d(Q,"appendFrame",function(){return r});var J=N("./src/utils/logger.ts"),B=N("./src/errors.ts"),D=N("./src/events.ts");function H(s,d,R,A){var T,w,C,b,m=navigator.userAgent.toLowerCase(),h=A,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((d[R+2]&192)>>>6)+1;var x=(d[R+2]&60)>>>2;if(x>u.length-1){s.trigger(D.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+x});return}return C=(d[R+2]&1)<<2,C|=(d[R+3]&192)>>>6,J.logger.log("manifest codec:"+A+", ADTS type:"+T+", samplingIndex:"+x),/firefox/i.test(m)?x>=6?(T=5,b=new Array(4),w=x-3):(T=2,b=new Array(2),w=x):m.indexOf("android")!==-1?(T=2,b=new Array(2),w=x):(T=5,b=new Array(4),A&&(A.indexOf("mp4a.40.29")!==-1||A.indexOf("mp4a.40.5")!==-1)||!A&&x>=6?w=x-3:((A&&A.indexOf("mp4a.40.2")!==-1&&(x>=6&&C===1||/vivaldi/i.test(m))||!A&&C===1)&&(T=2,b=new Array(2)),w=x)),b[0]=T<<3,b[0]|=(x&14)>>1,b[1]|=(x&1)<<7,b[1]|=C<<3,T===5&&(b[1]|=(w&14)>>1,b[2]=(w&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:u[x],channelCount:C,codec:"mp4a.40."+T,manifestCodec:h}}function F(s,d){return s[d]===255&&(s[d+1]&246)===240}function k(s,d){return s[d+1]&1?7:9}function I(s,d){return(s[d+3]&3)<<11|s[d+4]<<3|(s[d+5]&224)>>>5}function _(s,d){return d+5<s.length}function v(s,d){return d+1<s.length&&F(s,d)}function p(s,d){return _(s,d)&&F(s,d)&&I(s,d)<=s.length-d}function c(s,d){if(v(s,d)){var R=k(s,d);if(d+R>=s.length)return!1;var A=I(s,d);if(A<=R)return!1;var T=d+A;return T===s.length||v(s,T)}return!1}function a(s,d,R,A,T){if(!s.samplerate){var w=H(d,R,A,T);if(!w)return;s.config=w.config,s.samplerate=w.samplerate,s.channelCount=w.channelCount,s.codec=w.codec,s.manifestCodec=w.manifestCodec,J.logger.log("parsed codec:"+s.codec+", rate:"+w.samplerate+", channels:"+w.channelCount)}}function l(s){return 1024*9e4/s}function o(s,d,R,A,T){var w=k(s,d),C=I(s,d);if(C-=w,C>0){var b=R+A*T;return{headerLength:w,frameLength:C,stamp:b}}}function r(s,d,R,A,T){var w=l(s.samplerate),C=o(d,R,A,T,w);if(C){var b=C.frameLength,m=C.headerLength,h=C.stamp,u=m+b,x=Math.max(0,R+u-d.length),g;x?(g=new Uint8Array(u-m),g.set(d.subarray(R+m,d.length),0)):g=d.subarray(R+m,R+u);var y={unit:g,pts:h};return x||s.samples.push(y),{sample:y,length:u,missing:x}}}},"./src/demux/base-audio-demuxer.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"initPTSFn",function(){return I});var J=N("./src/polyfills/number.ts"),B=N("./src/demux/id3.ts"),D=N("./src/demux/dummy-demuxed-track.ts"),H=N("./src/utils/mp4-tools.ts"),F=N("./src/utils/typed-array.ts"),k=function(){function _(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var v=_.prototype;return v.resetInitSegment=function(c,a,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},v.resetTimeStamp=function(){},v.resetContiguity=function(){},v.canParse=function(c,a){return!1},v.appendFrame=function(c,a,l){},v.demux=function(c,a){this.cachedData&&(c=Object(H.appendUint8Array)(this.cachedData,c),this.cachedData=null);var l=B.getID3Data(c,0),o=l?l.length:0,r,s,d=this._audioTrack,R=this._id3Track,A=l?B.getTimeStamp(l):void 0,T=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(A,a)),l&&l.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),s=this.initPTS;o<T;){if(this.canParse(c,o)){var w=this.appendFrame(d,c,o);w?(this.frameIndex++,s=w.sample.pts,o+=w.length,r=o):o=T}else B.canParse(c,o)?(l=B.getID3Data(c,o),R.samples.push({pts:s,dts:s,data:l}),o+=l.length,r=o):o++;if(o===T&&r!==T){var C=Object(F.sliceUint8)(c,r);this.cachedData?this.cachedData=Object(H.appendUint8Array)(this.cachedData,C):this.cachedData=C}}return{audioTrack:d,avcTrack:Object(D.dummyTrack)(),id3Track:R,textTrack:Object(D.dummyTrack)()}},v.demuxSampleAes=function(c,a,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},v.flush=function(c){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(D.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(D.dummyTrack)()}},v.destroy=function(){},_}(),I=function(v,p){return Object(J.isFiniteNumber)(v)?v*90:p*9e4};Q.default=k},"./src/demux/chunk-cache.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return J});var J=function(){function D(){this.chunks=[],this.dataLength=0}var H=D.prototype;return H.push=function(k){this.chunks.push(k),this.dataLength+=k.length},H.flush=function(){var k=this.chunks,I=this.dataLength,_;if(k.length)k.length===1?_=k[0]:_=B(k,I);else return new Uint8Array(0);return this.reset(),_},H.reset=function(){this.chunks.length=0,this.dataLength=0},D}();function B(D,H){for(var F=new Uint8Array(H),k=0,I=0;I<D.length;I++){var _=D[I];F.set(_,k),k+=_.length}return F}},"./src/demux/dummy-demuxed-track.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"dummyTrack",function(){return J});function J(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/utils/logger.ts"),B=function(){function D(F){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=F,this.bytesAvailable=F.byteLength,this.word=0,this.bitsAvailable=0}var H=D.prototype;return H.loadWord=function(){var k=this.data,I=this.bytesAvailable,_=k.byteLength-I,v=new Uint8Array(4),p=Math.min(4,I);if(p===0)throw new Error("no bytes available");v.set(k.subarray(_,_+p)),this.word=new DataView(v.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},H.skipBits=function(k){var I;this.bitsAvailable>k?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,I=k>>3,k-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},H.readBits=function(k){var I=Math.min(this.bitsAvailable,k),_=this.word>>>32-I;return k>32&&J.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=I,this.bitsAvailable>0?this.word<<=I:this.bytesAvailable>0&&this.loadWord(),I=k-I,I>0&&this.bitsAvailable?_<<I|this.readBits(I):_},H.skipLZ=function(){var k;for(k=0;k<this.bitsAvailable;++k)if((this.word&2147483648>>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},H.skipUEG=function(){this.skipBits(1+this.skipLZ())},H.skipEG=function(){this.skipBits(1+this.skipLZ())},H.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},H.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>1)},H.readBoolean=function(){return this.readBits(1)===1},H.readUByte=function(){return this.readBits(8)},H.readUShort=function(){return this.readBits(16)},H.readUInt=function(){return this.readBits(32)},H.skipScalingList=function(k){for(var I=8,_=8,v,p=0;p<k;p++)_!==0&&(v=this.readEG(),_=(I+v+256)%256),I=_===0?I:_},H.readSPS=function(){var k=0,I=0,_=0,v=0,p,c,a,l=this.readUByte.bind(this),o=this.readBits.bind(this),r=this.readUEG.bind(this),s=this.readBoolean.bind(this),d=this.skipBits.bind(this),R=this.skipEG.bind(this),A=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);l();var w=l();if(o(5),d(3),l(),A(),w===100||w===110||w===122||w===244||w===44||w===83||w===86||w===118||w===128){var C=r();if(C===3&&d(1),A(),A(),d(1),s())for(c=C!==3?8:12,a=0;a<c;a++)s()&&(a<6?T(16):T(64))}A();var b=r();if(b===0)r();else if(b===1)for(d(1),R(),R(),p=r(),a=0;a<p;a++)R();A(),d(1);var m=r(),h=r(),u=o(1);u===0&&d(1),d(1),s()&&(k=r(),I=r(),_=r(),v=r());var x=[1,1];if(s()&&s()){var g=l();switch(g){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:{x=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((m+1)*16-k*2-I*2),height:(2-u)*(h+1)*16-(u?2:4)*(_+v),pixelRatio:x}},H.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},D}();Q.default=B},"./src/demux/id3.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"isHeader",function(){return J}),N.d(Q,"isFooter",function(){return B}),N.d(Q,"getID3Data",function(){return D}),N.d(Q,"canParse",function(){return F}),N.d(Q,"getTimeStamp",function(){return k}),N.d(Q,"isTimeStampFrame",function(){return I}),N.d(Q,"getID3Frames",function(){return v}),N.d(Q,"decodeFrame",function(){return p}),N.d(Q,"utf8ArrayToStr",function(){return r}),N.d(Q,"testables",function(){return s});var J=function(T,w){return w+10<=T.length&&(T[w]===73&&T[w+1]===68&&T[w+2]===51&&(T[w+3]<255&&T[w+4]<255&&(T[w+6]<128&&T[w+7]<128&&T[w+8]<128&&T[w+9]<128)))},B=function(T,w){return w+10<=T.length&&(T[w]===51&&T[w+1]===68&&T[w+2]===73&&(T[w+3]<255&&T[w+4]<255&&(T[w+6]<128&&T[w+7]<128&&T[w+8]<128&&T[w+9]<128)))},D=function(T,w){for(var C=w,b=0;J(T,w);){b+=10;var m=H(T,w+6);b+=m,B(T,w+10)&&(b+=10),w+=b}return b>0?T.subarray(C,C+b):void 0},H=function(T,w){var C=0;return C=(T[w]&127)<<21,C|=(T[w+1]&127)<<14,C|=(T[w+2]&127)<<7,C|=T[w+3]&127,C},F=function(T,w){return J(T,w)&&H(T,w+6)+10<=T.length-w},k=function(T){for(var w=v(T),C=0;C<w.length;C++){var b=w[C];if(I(b))return o(b)}return},I=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},_=function(T){var w=String.fromCharCode(T[0],T[1],T[2],T[3]),C=H(T,4),b=10;return{type:w,size:C,data:T.subarray(b,b+C)}},v=function(T){for(var w=0,C=[];J(T,w);){var b=H(T,w+6);w+=10;for(var m=w+b;w+8<m;){var h=_(T.subarray(w)),u=p(h);u&&C.push(u),w+=h.size+10}B(T,w)&&(w+=10)}return C},p=function(T){return T.type==="PRIV"?c(T):T.type[0]==="W"?l(T):a(T)},c=function(T){if(T.size<2)return;var w=r(T.data,!0),C=new Uint8Array(T.data.subarray(w.length+1));return{key:T.type,info:w,data:C.buffer}},a=function(T){if(T.size<2)return;if(T.type==="TXXX"){var w=1,C=r(T.data.subarray(w),!0);w+=C.length+1;var b=r(T.data.subarray(w));return{key:T.type,info:C,data:b}}var m=r(T.data.subarray(1));return{key:T.type,data:m}},l=function(T){if(T.type==="WXXX"){if(T.size<2)return;var w=1,C=r(T.data.subarray(w),!0);w+=C.length+1;var b=r(T.data.subarray(w));return{key:T.type,info:C,data:b}}var m=r(T.data);return{key:T.type,data:m}},o=function(T){if(T.data.byteLength===8){var w=new Uint8Array(T.data),C=w[3]&1,b=(w[4]<<23)+(w[5]<<15)+(w[6]<<7)+w[7];return b/=45,C&&(b+=4772185884e-2),Math.round(b)}return},r=function(T,w){w===void 0&&(w=!1);var C=R();if(C){var b=C.decode(T);if(w){var m=b.indexOf("\0");return m!==-1?b.substring(0,m):b}return b.replace(/\0/g,"")}for(var h=T.length,u,x,g,y="",M=0;M<h;){if(u=T[M++],u===0&&w)return y;if(u===0||u===3)continue;switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(u);break;case 12:case 13:x=T[M++],y+=String.fromCharCode((u&31)<<6|x&63);break;case 14:x=T[M++],g=T[M++],y+=String.fromCharCode((u&15)<<12|(x&63)<<6|(g&63)<<0);break;default:}}return y},s={decodeTextFrame:a},d;function R(){return!d&&typeof self.TextDecoder!="undefined"&&(d=new self.TextDecoder("utf-8")),d}},"./src/demux/mp3demuxer.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/demux/base-audio-demuxer.ts"),B=N("./src/demux/id3.ts"),D=N("./src/utils/logger.ts"),H=N("./src/demux/mpegaudio.ts");function F(_,v){_.prototype=Object.create(v.prototype),_.prototype.constructor=_,k(_,v)}function k(_,v){return k=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},k(_,v)}var I=function(_){F(v,_);function v(){return _.apply(this,arguments)||this}var p=v.prototype;return p.resetInitSegment=function(a,l,o){_.prototype.resetInitSegment.call(this,a,l,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:o,inputTimeScale:9e4,dropped:0}},v.probe=function(a){if(!a)return!1;for(var l=B.getID3Data(a,0)||[],o=l.length,r=a.length;o<r;o++)if(H.probe(a,o))return D.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(a,l){return H.canParse(a,l)},p.appendFrame=function(a,l,o){return this.initPTS===null?void 0:H.appendFrame(a,l,o,this.initPTS,this.frameIndex)},v}(J.default);I.minProbeByteLength=4,Q.default=I},"./src/demux/mp4demuxer.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/utils/mp4-tools.ts"),B=N("./src/demux/dummy-demuxed-track.ts"),D=function(){function H(k,I){this.remainderData=null,this.config=void 0,this.config=I}var F=H.prototype;return F.resetTimeStamp=function(){},F.resetInitSegment=function(){},F.resetContiguity=function(){},H.probe=function(I){return Object(J.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},F.demux=function(I){var _=I,v=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(_=Object(J.appendUint8Array)(this.remainderData,I));var p=Object(J.segmentValidRange)(_);this.remainderData=p.remainder,v.samples=p.valid||new Uint8Array}else v.samples=_;return{audioTrack:Object(B.dummyTrack)(),avcTrack:v,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},F.flush=function(){var I=Object(B.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:I,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},F.demuxSampleAes=function(I,_,v){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},F.destroy=function(){},H}();D.minProbeByteLength=1024,Q.default=D},"./src/demux/mpegaudio.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"appendFrame",function(){return k}),N.d(Q,"parseHeader",function(){return I}),N.d(Q,"isHeaderPattern",function(){return _}),N.d(Q,"isHeader",function(){return v}),N.d(Q,"canParse",function(){return p}),N.d(Q,"probe",function(){return c});var J=null,B=[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],D=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],H=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],F=[0,1,1,4];function k(a,l,o,r,s){if(o+24>l.length)return;var d=I(l,o);if(d&&o+d.frameLength<=l.length){var R=d.samplesPerFrame*9e4/d.sampleRate,A=r+s*R,T={unit:l.subarray(o,o+d.frameLength),pts:A,dts:A};return a.config=[],a.channelCount=d.channelCount,a.samplerate=d.sampleRate,a.samples.push(T),{sample:T,length:d.frameLength,missing:0}}}function I(a,l){var o=a[l+1]>>3&3,r=a[l+1]>>1&3,s=a[l+2]>>4&15,d=a[l+2]>>2&3;if(o!==1&&s!==0&&s!==15&&d!==3){var R=a[l+2]>>1&1,A=a[l+3]>>6,T=o===3?3-r:r===3?3:4,w=B[T*14+s-1]*1e3,C=o===3?0:o===2?1:2,b=D[C*3+d],m=A===3?1:2,h=H[o][r],u=F[r],x=h*8*u,g=Math.floor(h*w/b+R)*u;if(J===null){var y=navigator.userAgent||"",M=y.match(/Chrome\/(\d+)/i);J=M?parseInt(M[1]):0}var E=!!J&&J<=87;return E&&r===2&&w>=224e3&&A===0&&(a[l+3]=a[l+3]|128),{sampleRate:b,channelCount:m,frameLength:g,samplesPerFrame:x}}}function _(a,l){return a[l]===255&&(a[l+1]&224)===224&&(a[l+1]&6)!==0}function v(a,l){return l+1<a.length&&_(a,l)}function p(a,l){var o=4;return _(a,l)&&o<=a.length-l}function c(a,l){if(l+1<a.length&&_(a,l)){var o=4,r=I(a,l),s=o;r!=null&&r.frameLength&&(s=r.frameLength);var d=l+s;return d===a.length||v(a,d)}return!1}},"./src/demux/sample-aes.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/crypt/decrypter.ts"),B=N("./src/demux/tsdemuxer.ts"),D=function(){function H(k,I,_){this.keyData=void 0,this.decrypter=void 0,this.keyData=_,this.decrypter=new J.default(k,I,{removePKCS7Padding:!1})}var F=H.prototype;return F.decryptBuffer=function(I,_){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,_)},F.decryptAacSample=function(I,_,v,p){var c=I[_].unit,a=c.subarray(16,c.length-c.length%16),l=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),o=this;this.decryptBuffer(l,function(r){var s=new Uint8Array(r);c.set(s,16),p||o.decryptAacSamples(I,_+1,v)})},F.decryptAacSamples=function(I,_,v){for(;;_++){if(_>=I.length){v();return}if(I[_].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(I,_,v,p),!p)return}},F.getAvcEncryptedData=function(I){for(var _=Math.floor((I.length-48)/160)*16+16,v=new Int8Array(_),p=0,c=32;c<=I.length-16;c+=160,p+=16)v.set(I.subarray(c,c+16),p);return v},F.getAvcDecryptedUnit=function(I,_){for(var v=new Uint8Array(_),p=0,c=32;c<=I.length-16;c+=160,p+=16)I.set(v.subarray(p,p+16),c);return I},F.decryptAvcSample=function(I,_,v,p,c,a){var l=Object(B.discardEPB)(c.data),o=this.getAvcEncryptedData(l),r=this;this.decryptBuffer(o.buffer,function(s){c.data=r.getAvcDecryptedUnit(l,s),a||r.decryptAvcSamples(I,_,v+1,p)})},F.decryptAvcSamples=function(I,_,v,p){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;_++,v=0){if(_>=I.length){p();return}for(var c=I[_].units;!(v>=c.length);v++){var a=c[v];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(I,_,v,p,a,l),!l)return}}},H}();Q.default=D},"./src/demux/transmuxer-interface.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return c});var J=N("./node_modules/webworkify-webpack/index.js"),B=N.n(J),D=N("./src/events.ts"),H=N("./src/demux/transmuxer.ts"),F=N("./src/utils/logger.ts"),k=N("./src/errors.ts"),I=N("./src/utils/mediasource-helper.ts"),_=N("./node_modules/eventemitter3/index.js"),v=N.n(_),p=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function a(o,r,s,d){var R=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=o,this.id=r,this.onTransmuxComplete=s,this.onFlush=d;var A=o.config,T=function(h,u){u=u||{},u.frag=R.frag,u.id=R.id,o.trigger(h,u)};this.observer=new _.EventEmitter,this.observer.on(D.Events.FRAG_DECRYPTED,T),this.observer.on(D.Events.ERROR,T);var w={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},C=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){F.logger.log("demuxing in webworker");var b;try{b=this.worker=J("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(m){o.trigger(D.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(m.message+" ("+m.filename+":"+m.lineno+")")})},b.postMessage({cmd:"init",typeSupported:w,vendor:C,id:r,config:JSON.stringify(A)})}catch(m){F.logger.warn("Error in worker:",m),F.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new H.default(this.observer,w,A,C,r),this.worker=null}}else this.transmuxer=new H.default(this.observer,w,A,C,r)}var l=a.prototype;return l.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var d=this.observer;d&&d.removeAllListeners(),this.observer=null},l.push=function(r,s,d,R,A,T,w,C,b,m){var h=this;b.transmuxing.start=self.performance.now();var u=this.transmuxer,x=this.worker,g=T?T.start:A.start,y=A.decryptdata,M=this.frag,E=!(M&&A.cc===M.cc),j=!(M&&b.level===M.level),G=M?b.sn-M.sn:-1,U=this.part?b.part-this.part.index:1,O=!j&&(G===1||G===0&&U===1),X=self.performance.now();(j||G||A.stats.parsing.start===0)&&(A.stats.parsing.start=X),T&&(U||!O)&&(T.stats.parsing.start=X);var $=new H.TransmuxState(E,O,C,j,g);if(!O||E){F.logger.log("[transmuxer-interface, "+A.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
discontinuity: `+E+`
trackSwitch: `+j+`
contiguous: `+O+`
accurateTimeOffset: `+C+`
timeOffset: `+g);var se=new H.TransmuxConfig(d,R,s,w,m);this.configureTransmuxer(se)}if(this.frag=A,this.part=T,x)x.postMessage({cmd:"demux",data:r,decryptdata:y,chunkMeta:b,state:$},r instanceof ArrayBuffer?[r]:[]);else if(u){var ce=u.push(r,y,b,$);Object(H.isPromise)(ce)?ce.then(function(Pe){h.handleTransmuxComplete(Pe)}):this.handleTransmuxComplete(ce)}},l.flush=function(r){var s=this;r.transmuxing.start=self.performance.now();var d=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:r});else if(d){var A=d.flush(r);Object(H.isPromise)(A)?A.then(function(T){s.handleFlushResult(T,r)}):this.handleFlushResult(A,r)}},l.handleFlushResult=function(r,s){var d=this;r.forEach(function(R){d.handleTransmuxComplete(R)}),this.onFlush(s)},l.onWorkerMessage=function(r){var s=r.data,d=this.hls;switch(s.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(s.data);break}case"flush":{this.onFlush(s.data);break}default:{s.data=s.data||{},s.data.frag=this.frag,s.data.id=this.id,d.trigger(s.event,s.data);break}}},l.configureTransmuxer=function(r){var s=this.worker,d=this.transmuxer;s?s.postMessage({cmd:"configure",config:r}):d&&d.configure(r)},l.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},a}()},"./src/demux/transmuxer-worker.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return k});var J=N("./src/demux/transmuxer.ts"),B=N("./src/events.ts"),D=N("./src/utils/logger.ts"),H=N("./node_modules/eventemitter3/index.js"),F=N.n(H);function k(c){var a=new H.EventEmitter,l=function(r,s){c.postMessage({event:r,data:s})};a.on(B.Events.FRAG_DECRYPTED,l),a.on(B.Events.ERROR,l),c.addEventListener("message",function(o){var r=o.data;switch(r.cmd){case"init":{var s=JSON.parse(r.config);c.transmuxer=new J.default(a,r.typeSupported,s,r.vendor,r.id),Object(D.enableLogs)(s.debug),l("init",null);break}case"configure":{c.transmuxer.configure(r.config);break}case"demux":{var d=c.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(J.isPromise)(d)?d.then(function(T){I(c,T)}):I(c,d);break}case"flush":{var R=r.chunkMeta,A=c.transmuxer.flush(R);Object(J.isPromise)(A)?A.then(function(T){v(c,T,R)}):v(c,A,R);break}default:break}})}function I(c,a){if(p(a.remuxResult))return;var l=[],o=a.remuxResult,r=o.audio,s=o.video;r&&_(l,r),s&&_(l,s),c.postMessage({event:"transmuxComplete",data:a},l)}function _(c,a){a.data1&&c.push(a.data1.buffer),a.data2&&c.push(a.data2.buffer)}function v(c,a,l){a.forEach(function(o){I(c,o)}),c.postMessage({event:"flush",data:l})}function p(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return s}),N.d(Q,"isPromise",function(){return A}),N.d(Q,"TransmuxConfig",function(){return T}),N.d(Q,"TransmuxState",function(){return w});var J=N("./src/events.ts"),B=N("./src/errors.ts"),D=N("./src/crypt/decrypter.ts"),H=N("./src/demux/aacdemuxer.ts"),F=N("./src/demux/mp4demuxer.ts"),k=N("./src/demux/tsdemuxer.ts"),I=N("./src/demux/mp3demuxer.ts"),_=N("./src/remux/mp4-remuxer.ts"),v=N("./src/remux/passthrough-remuxer.ts"),p=N("./src/demux/chunk-cache.ts"),c=N("./src/utils/mp4-tools.ts"),a=N("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(C){a.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var o=[{demux:k.default,remux:_.default},{demux:F.default,remux:v.default},{demux:H.default,remux:_.default},{demux:I.default,remux:_.default}],r=1024;o.forEach(function(C){var b=C.demux;r=Math.max(r,b.minProbeByteLength)});var s=function(){function C(m,h,u,x,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 p.default,this.observer=m,this.typeSupported=h,this.config=u,this.vendor=x,this.id=g}var b=C.prototype;return b.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},b.push=function(h,u,x,g){var y=this,M=x.transmuxing;M.executeStart=l();var E=new Uint8Array(h),j=this.cache,G=this.config,U=this.currentTransmuxState,O=this.transmuxConfig;g&&(this.currentTransmuxState=g);var X=d(E,u);if(X&&X.method==="AES-128"){var $=this.getDecrypter();if(G.enableSoftwareAES){var se=$.softwareDecrypt(E,X.key.buffer,X.iv.buffer);if(!se)return M.executeEnd=l(),R(x);E=new Uint8Array(se)}else return this.decryptionPromise=$.webCryptoDecrypt(E,X.key.buffer,X.iv.buffer).then(function(He){var $e=y.push(He,null,x);return y.decryptionPromise=null,$e}),this.decryptionPromise}var ce=g||U,Pe=ce.contiguous,Se=ce.discontinuity,Re=ce.trackSwitch,Oe=ce.accurateTimeOffset,Me=ce.timeOffset,be=O.audioCodec,ue=O.videoCodec,ne=O.defaultInitPts,ve=O.duration,le=O.initSegmentData;if((Se||Re)&&this.resetInitSegment(le,be,ue,ve),Se&&this.resetInitialTimestamp(ne),Pe||this.resetContiguity(),this.needsProbing(E,Se,Re)){if(j.dataLength){var ke=j.flush();E=Object(c.appendUint8Array)(ke,E)}this.configureTransmuxer(E,O)}var Fe=this.transmux(E,X,Me,Oe,x),Ie=this.currentTransmuxState;return Ie.contiguous=!0,Ie.discontinuity=!1,Ie.trackSwitch=!1,M.executeEnd=l(),Fe},b.flush=function(h){var u=this,x=h.transmuxing;x.executeStart=l();var g=this.decrypter,y=this.cache,M=this.currentTransmuxState,E=this.decryptionPromise;if(E)return E.then(function(){return u.flush(h)});var j=[],G=M.timeOffset;if(g){var U=g.flush();U&&j.push(this.push(U,null,h))}var O=y.dataLength;y.reset();var X=this.demuxer,$=this.remuxer;if(!X||!$)return O>=r&&this.observer.emit(J.Events.ERROR,J.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),x.executeEnd=l(),[R(h)];var se=X.flush(G);return A(se)?se.then(function(ce){return u.flushRemux(j,ce,h),j}):(this.flushRemux(j,se,h),j)},b.flushRemux=function(h,u,x){var g=u.audioTrack,y=u.avcTrack,M=u.id3Track,E=u.textTrack,j=this.currentTransmuxState,G=j.accurateTimeOffset,U=j.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+x.sn+(x.part>-1?" p: "+x.part:"")+" of level "+x.level);var O=this.remuxer.remux(g,y,M,E,U,G,!0,this.id);h.push({remuxResult:O,chunkMeta:x}),x.transmuxing.executeEnd=l()},b.resetInitialTimestamp=function(h){var u=this.demuxer,x=this.remuxer;if(!u||!x)return;u.resetTimeStamp(h),x.resetTimeStamp(h)},b.resetContiguity=function(){var h=this.demuxer,u=this.remuxer;if(!h||!u)return;h.resetContiguity(),u.resetNextTimestamp()},b.resetInitSegment=function(h,u,x,g){var y=this.demuxer,M=this.remuxer;if(!y||!M)return;y.resetInitSegment(u,x,g),M.resetInitSegment(h,u,x)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(h,u,x,g,y){var M;return u&&u.method==="SAMPLE-AES"?M=this.transmuxSampleAes(h,u,x,g,y):M=this.transmuxUnencrypted(h,x,g,y),M},b.transmuxUnencrypted=function(h,u,x,g){var y=this.demuxer.demux(h,u,!1,!this.config.progressive),M=y.audioTrack,E=y.avcTrack,j=y.id3Track,G=y.textTrack,U=this.remuxer.remux(M,E,j,G,u,x,!1,this.id);return{remuxResult:U,chunkMeta:g}},b.transmuxSampleAes=function(h,u,x,g,y){var M=this;return this.demuxer.demuxSampleAes(h,u,x).then(function(E){var j=M.remuxer.remux(E.audioTrack,E.avcTrack,E.id3Track,E.textTrack,x,g,!1,M.id);return{remuxResult:j,chunkMeta:y}})},b.configureTransmuxer=function(h,u){for(var x=this.config,g=this.observer,y=this.typeSupported,M=this.vendor,E=u.audioCodec,j=u.defaultInitPts,G=u.duration,U=u.initSegmentData,O=u.videoCodec,X,$=0,se=o.length;$<se;$++)if(o[$].demux.probe(h)){X=o[$];break}X||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),X={demux:F.default,remux:v.default});var ce=this.demuxer,Pe=this.remuxer,Se=X.remux,Re=X.demux;(!Pe||!(Pe instanceof Se))&&(this.remuxer=new Se(g,x,y,M)),(!ce||!(ce instanceof Re))&&(this.demuxer=new Re(g,x,y),this.probe=Re.probe),this.resetInitSegment(U,E,O,G),this.resetInitialTimestamp(j)},b.needsProbing=function(h,u,x){return!this.demuxer||!this.remuxer||u||x},b.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new D.default(this.observer,this.config)),h},C}();function d(C,b){var m=null;return C.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(m=b),m}var R=function(b){return{remuxResult:{},chunkMeta:b}};function A(C){return"then"in C&&C.then instanceof Function}var T=function(b,m,h,u,x){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=m,this.initSegmentData=h,this.duration=u,this.defaultInitPts=x},w=function(b,m,h,u,x){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=m,this.accurateTimeOffset=h,this.trackSwitch=u,this.timeOffset=x}},"./src/demux/tsdemuxer.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"discardEPB",function(){return R});var J=N("./src/demux/adts.ts"),B=N("./src/demux/mpegaudio.ts"),D=N("./src/demux/exp-golomb.ts"),H=N("./src/demux/id3.ts"),F=N("./src/demux/sample-aes.ts"),k=N("./src/events.ts"),I=N("./src/utils/mp4-tools.ts"),_=N("./src/utils/logger.ts"),v=N("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},c=function(){function A(w,C,b){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=w,this.config=C,this.typeSupported=b}A.probe=function(C){var b=A.syncOffset(C);return b<0?!1:(b&&_.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},A.syncOffset=function(C){for(var b=Math.min(1e3,C.length-3*188),m=0;m<b;){if(C[m]===71&&C[m+188]===71&&C[m+2*188]===71)return m;m++}return-1},A.createTrack=function(C,b){return{container:C==="video"||C==="audio"?"video/mp2t":void 0,type:C,id:p[C],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:C==="audio"?b:void 0}};var T=A.prototype;return T.resetInitSegment=function(C,b,m){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=A.createTrack("video",m),this._audioTrack=A.createTrack("audio",m),this._id3Track=A.createTrack("id3",m),this._txtTrack=A.createTrack("text",m),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=C,this.videoCodec=b,this._duration=m},T.resetTimeStamp=function(){},T.resetContiguity=function(){var C=this._audioTrack,b=this._avcTrack,m=this._id3Track;C&&(C.pesData=null),b&&(b.pesData=null),m&&(m.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(C,b,m,h){m===void 0&&(m=!1),h===void 0&&(h=!1),m||(this.sampleAes=null);var u,x=this._avcTrack,g=this._audioTrack,y=this._id3Track,M=x.pid,E=x.pesData,j=g.pid,G=y.pid,U=g.pesData,O=y.pesData,X=!1,$=this.pmtParsed,se=this._pmtId,ce=C.length;if(this.remainderData&&(C=Object(I.appendUint8Array)(this.remainderData,C),ce=C.length,this.remainderData=null),ce<188&&!h)return this.remainderData=C,{audioTrack:g,avcTrack:x,id3Track:y,textTrack:this._txtTrack};var Pe=Math.max(0,A.syncOffset(C));ce-=(ce+Pe)%188,ce<C.byteLength&&!h&&(this.remainderData=new Uint8Array(C.buffer,ce,C.buffer.byteLength-ce));for(var Se=Pe;Se<ce;Se+=188)if(C[Se]===71){var Re=!!(C[Se+1]&64),Oe=((C[Se+1]&31)<<8)+C[Se+2],Me=(C[Se+3]&48)>>4,be=void 0;if(Me>1){if(be=Se+5+C[Se+4],be===Se+188)continue}else be=Se+4;switch(Oe){case M:Re&&(E&&(u=r(E))&&this.parseAVCPES(u,!1),E={data:[],size:0}),E&&(E.data.push(C.subarray(be,Se+188)),E.size+=Se+188-be);break;case j:Re&&(U&&(u=r(U))&&(g.isAAC?this.parseAACPES(u):this.parseMPEGPES(u)),U={data:[],size:0}),U&&(U.data.push(C.subarray(be,Se+188)),U.size+=Se+188-be);break;case G:Re&&(O&&(u=r(O))&&this.parseID3PES(u),O={data:[],size:0}),O&&(O.data.push(C.subarray(be,Se+188)),O.size+=Se+188-be);break;case 0:Re&&(be+=C[be]+1),se=this._pmtId=l(C,be);break;case se:{Re&&(be+=C[be]+1);var ue=o(C,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,m);M=ue.avc,M>0&&(x.pid=M),j=ue.audio,j>0&&(g.pid=j,g.isAAC=ue.isAAC),G=ue.id3,G>0&&(y.pid=G),X&&!$&&(_.logger.log("reparse from beginning"),X=!1,Se=Pe-188),$=this.pmtParsed=!0;break}case 17:case 8191:break;default:X=!0;break}}else this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});x.pesData=E,g.pesData=U,y.pesData=O;var ne={audioTrack:g,avcTrack:x,id3Track:y,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(ne),ne},T.flush=function(){var C=this.remainderData;this.remainderData=null;var b;return C?b=this.demux(C,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},T.extractRemainingSamples=function(C){var b=C.audioTrack,m=C.avcTrack,h=C.id3Track,u=m.pesData,x=b.pesData,g=h.pesData,y;u&&(y=r(u))?(this.parseAVCPES(y,!0),m.pesData=null):m.pesData=u,x&&(y=r(x))?(b.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),b.pesData=null):(x!=null&&x.size&&_.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=x),g&&(y=r(g))?(this.parseID3PES(y),h.pesData=null):h.pesData=g},T.demuxSampleAes=function(C,b,m){var h=this.demux(C,m,!0,!this.config.progressive),u=this.sampleAes=new F.default(this.observer,this.config,b);return this.decrypt(h,u)},T.decrypt=function(C,b){return new Promise(function(m){var h=C.audioTrack,u=C.avcTrack;h.samples&&h.isAAC?b.decryptAacSamples(h.samples,0,function(){u.samples?b.decryptAvcSamples(u.samples,0,0,function(){m(C)}):m(C)}):u.samples&&b.decryptAvcSamples(u.samples,0,0,function(){m(C)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(C,b){var m=this,h=this._avcTrack,u=this.parseAVCNALu(C.data),x=!1,g=this.avcSample,y,M=!1;C.data=null,g&&u.length&&!h.audFound&&(s(g,h),g=this.avcSample=a(!1,C.pts,C.dts,"")),u.forEach(function(E){switch(E.type){case 1:{y=!0,g||(g=m.avcSample=a(!0,C.pts,C.dts,"")),x&&(g.debug+="NDR "),g.frame=!0;var j=E.data;if(M&&j.length>4){var G=new D.default(j).readSliceType();(G===2||G===4||G===7||G===9)&&(g.key=!0)}break}case 5:y=!0,g||(g=m.avcSample=a(!0,C.pts,C.dts,"")),x&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{y=!0,x&&g&&(g.debug+="SEI ");var U=new D.default(R(E.data));U.readUByte();for(var O=0,X=0,$=!1,se=0;!$&&U.bytesAvailable>1;){O=0;do se=U.readUByte(),O+=se;while(se===255);X=0;do se=U.readUByte(),X+=se;while(se===255);if(O===4&&U.bytesAvailable!==0){$=!0;var ce=U.readUByte();if(ce===181){var Pe=U.readUShort();if(Pe===49){var Se=U.readUInt();if(Se===1195456820){var Re=U.readUByte();if(Re===3){for(var Oe=U.readUByte(),Me=U.readUByte(),be=31&Oe,ue=[Oe,Me],ne=0;ne<be;ne++)ue.push(U.readUByte()),ue.push(U.readUByte()),ue.push(U.readUByte());d(m._txtTrack.samples,{type:3,pts:C.pts,bytes:ue})}}}}}else if(O===5&&U.bytesAvailable!==0){if($=!0,X>16){for(var ve=[],le=0;le<16;le++)ve.push(U.readUByte().toString(16)),(le===3||le===5||le===7||le===9)&&ve.push("-");for(var ke=X-16,Fe=new Uint8Array(ke),Ie=0;Ie<ke;Ie++)Fe[Ie]=U.readUByte();d(m._txtTrack.samples,{pts:C.pts,payloadType:O,uuid:ve.join(""),userData:Object(H.utf8ArrayToStr)(Fe),userDataBytes:Fe})}}else if(X<U.bytesAvailable)for(var He=0;He<X;He++)U.readUByte()}break}case 7:if(y=!0,M=!0,x&&g&&(g.debug+="SPS "),!h.sps){var $e=new D.default(E.data),tt=$e.readSPS();h.width=tt.width,h.height=tt.height,h.pixelRatio=tt.pixelRatio,h.sps=[E.data],h.duration=m._duration;for(var Qe=E.data.subarray(1,4),Je="avc1.",Ye=0;Ye<3;Ye++){var gt=Qe[Ye].toString(16);gt.length<2&&(gt="0"+gt),Je+=gt}h.codec=Je}break;case 8:y=!0,x&&g&&(g.debug+="PPS "),h.pps||(h.pps=[E.data]);break;case 9:y=!1,h.audFound=!0,g&&s(g,h),g=m.avcSample=a(!1,C.pts,C.dts,x?"AUD ":"");break;case 12:y=!1;break;default:y=!1,g&&(g.debug+="unknown NAL "+E.type+" ");break}if(g&&y){var _t=g.units;_t.push(E)}}),b&&g&&(s(g,h),this.avcSample=null)},T.getLastNalUnit=function(){var C,b=this.avcSample,m;if(!b||b.units.length===0){var h=this._avcTrack.samples;b=h[h.length-1]}if((C=b)!==null&&C!==void 0&&C.units){var u=b.units;m=u[u.length-1]}return m},T.parseAVCNALu=function(C){var b=C.byteLength,m=this._avcTrack,h=m.naluState||0,u=h,x=[],g=0,y,M,E,j=-1,G=0;for(h===-1&&(j=0,G=C[0]&31,h=0,g=1);g<b;){if(y=C[g++],!h){h=y?0:1;continue}if(h===1){h=y?0:2;continue}if(!y)h=3;else if(y===1){if(j>=0){var U={data:C.subarray(j,g-h-1),type:G};x.push(U)}else{var O=this.getLastNalUnit();if(O&&(u&&g<=4-u&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-u))),M=g-h-1,M>0)){var X=new Uint8Array(O.data.byteLength+M);X.set(O.data,0),X.set(C.subarray(0,M),O.data.byteLength),O.data=X,O.state=0}}g<b?(E=C[g]&31,j=g,G=E,h=0):h=-1}else h=0}if(j>=0&&h>=0){var $={data:C.subarray(j,b),type:G,state:h};x.push($)}if(x.length===0){var se=this.getLastNalUnit();if(se){var ce=new Uint8Array(se.data.byteLength+C.byteLength);ce.set(se.data,0),ce.set(C,se.data.byteLength),se.data=ce}}return m.naluState=h,x},T.parseAACPES=function(C){var b=0,m=this._audioTrack,h=this.aacOverFlow,u=C.data;if(h){this.aacOverFlow=null;var x=h.sample.unit.byteLength,g=Math.min(h.missing,x),y=x-g;h.sample.unit.set(u.subarray(0,g),y),m.samples.push(h.sample),b=h.missing}var M,E;for(M=b,E=u.length;M<E-1&&!J.isHeader(u,M);M++);if(M!==b){var j,G;if(M<E-1?(j="AAC PES did not start with ADTS header,offset:"+M,G=!1):(j="no ADTS header found in AAC PES",G=!0),_.logger.warn("parsing error:"+j),this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:j}),G)return}J.initTrackConfig(m,this.observer,u,M,this.audioCodec);var U;if(C.pts!==void 0)U=C.pts;else if(h){var O=J.getFrameDuration(m.samplerate);U=h.sample.pts+O}else{_.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var X=0;M<E;)if(J.isHeader(u,M)){if(M+5<E){var $=J.appendFrame(m,u,M,U,X);if($)if($.missing)this.aacOverFlow=$;else{M+=$.length,X++;continue}}break}else M++},T.parseMPEGPES=function(C){var b=C.data,m=b.length,h=0,u=0,x=C.pts;if(x===void 0){_.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;u<m;)if(B.isHeader(b,u)){var g=B.appendFrame(this._audioTrack,b,u,x,h);if(g)u+=g.length,h++;else break}else u++},T.parseID3PES=function(C){if(C.pts===void 0){_.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(C)},A}();c.minProbeByteLength=188;function a(A,T,w,C){return{key:A,frame:!1,pts:T,dts:w,units:[],debug:C,length:0}}function l(A,T){return(A[T+10]&31)<<8|A[T+11]}function o(A,T,w,C){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},m=(A[T+1]&15)<<8|A[T+2],h=T+3+m-4,u=(A[T+10]&15)<<8|A[T+11];for(T+=12+u;T<h;){var x=(A[T+1]&31)<<8|A[T+2];switch(A[T]){case 207:if(!C){_.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=x);break;case 21:b.id3===-1&&(b.id3=x);break;case 219:if(!C){_.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=x);break;case 3:case 4:w?b.audio===-1&&(b.audio=x,b.isAAC=!1):_.logger.log("MPEG audio found, not supported in this browser");break;case 36:_.logger.warn("Unsupported HEVC stream type found");break;default:break}T+=((A[T+3]&15)<<8|A[T+4])+5}return b}function r(A){var T=0,w,C,b,m,h,u=A.data;if(!A||A.size===0)return null;for(;u[0].length<19&&u.length>1;){var x=new Uint8Array(u[0].length+u[1].length);x.set(u[0]),x.set(u[1],u[0].length),u[0]=x,u.splice(1,1)}w=u[0];var g=(w[0]<<16)+(w[1]<<8)+w[2];if(g===1){if(C=(w[4]<<8)+w[5],C&&C>A.size-6)return null;var y=w[7];y&192&&(m=(w[9]&14)*536870912+(w[10]&255)*4194304+(w[11]&254)*16384+(w[12]&255)*128+(w[13]&254)/2,y&64?(h=(w[14]&14)*536870912+(w[15]&255)*4194304+(w[16]&254)*16384+(w[17]&255)*128+(w[18]&254)/2,m-h>60*9e4&&(_.logger.warn(Math.round((m-h)/9e4)+"s delta between PTS and DTS, align them"),m=h)):h=m),b=w[8];var M=b+9;if(A.size<=M)return null;A.size-=M;for(var E=new Uint8Array(A.size),j=0,G=u.length;j<G;j++){w=u[j];var U=w.byteLength;if(M)if(M>U){M-=U;continue}else w=w.subarray(M),U-=M,M=0;E.set(w,T),T+=U}return C&&(C-=b+3),{data:E,pts:m,dts:h,len:C}}return null}function s(A,T){if(A.units.length&&A.frame){if(A.pts===void 0){var w=T.samples,C=w.length;if(C){var b=w[C-1];A.pts=b.pts,A.dts=b.dts}else{T.dropped++;return}}T.samples.push(A)}A.debug.length&&_.logger.log(A.pts+"/"+A.dts+":"+A.debug)}function d(A,T){var w=A.length;if(w>0){if(T.pts>=A[w-1].pts)A.push(T);else for(var C=w-1;C>=0;C--)if(T.pts<A[C].pts){A.splice(C,0,T);break}}else A.push(T)}function R(A){for(var T=A.byteLength,w=[],C=1;C<T-2;)A[C]===0&&A[C+1]===0&&A[C+2]===3?(w.push(C+2),C+=2):C++;if(w.length===0)return A;var b=T-w.length,m=new Uint8Array(b),h=0;for(C=0;C<b;h++,C++)h===w[0]&&(h++,w.shift()),m[C]=A[h];return m}Q.default=c},"./src/errors.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"ErrorTypes",function(){return J}),N.d(Q,"ErrorDetails",function(){return B});var J;(function(D){D.NETWORK_ERROR="networkError",D.MEDIA_ERROR="mediaError",D.KEY_SYSTEM_ERROR="keySystemError",D.MUX_ERROR="muxError",D.OTHER_ERROR="otherError"})(J||(J={}));var B;(function(D){D.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",D.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",D.KEY_SYSTEM_NO_SESSION="keySystemNoSession",D.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",D.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",D.MANIFEST_LOAD_ERROR="manifestLoadError",D.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",D.MANIFEST_PARSING_ERROR="manifestParsingError",D.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",D.LEVEL_EMPTY_ERROR="levelEmptyError",D.LEVEL_LOAD_ERROR="levelLoadError",D.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",D.LEVEL_SWITCH_ERROR="levelSwitchError",D.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",D.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",D.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",D.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",D.FRAG_LOAD_ERROR="fragLoadError",D.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",D.FRAG_DECRYPT_ERROR="fragDecryptError",D.FRAG_PARSING_ERROR="fragParsingError",D.REMUX_ALLOC_ERROR="remuxAllocError",D.KEY_LOAD_ERROR="keyLoadError",D.KEY_LOAD_TIMEOUT="keyLoadTimeOut",D.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",D.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",D.BUFFER_APPEND_ERROR="bufferAppendError",D.BUFFER_APPENDING_ERROR="bufferAppendingError",D.BUFFER_STALLED_ERROR="bufferStalledError",D.BUFFER_FULL_ERROR="bufferFullError",D.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",D.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",D.INTERNAL_EXCEPTION="internalException",D.INTERNAL_ABORTED="aborted",D.UNKNOWN="unknown"})(B||(B={}))},"./src/events.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"Events",function(){return J});var J;(function(B){B.MEDIA_ATTACHING="hlsMediaAttaching",B.MEDIA_ATTACHED="hlsMediaAttached",B.MEDIA_DETACHING="hlsMediaDetaching",B.MEDIA_DETACHED="hlsMediaDetached",B.BUFFER_RESET="hlsBufferReset",B.BUFFER_CODECS="hlsBufferCodecs",B.BUFFER_CREATED="hlsBufferCreated",B.BUFFER_APPENDING="hlsBufferAppending",B.BUFFER_APPENDED="hlsBufferAppended",B.BUFFER_EOS="hlsBufferEos",B.BUFFER_FLUSHING="hlsBufferFlushing",B.BUFFER_FLUSHED="hlsBufferFlushed",B.MANIFEST_LOADING="hlsManifestLoading",B.MANIFEST_LOADED="hlsManifestLoaded",B.MANIFEST_PARSED="hlsManifestParsed",B.LEVEL_SWITCHING="hlsLevelSwitching",B.LEVEL_SWITCHED="hlsLevelSwitched",B.LEVEL_LOADING="hlsLevelLoading",B.LEVEL_LOADED="hlsLevelLoaded",B.LEVEL_UPDATED="hlsLevelUpdated",B.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",B.LEVELS_UPDATED="hlsLevelsUpdated",B.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",B.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",B.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",B.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",B.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",B.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",B.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",B.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",B.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",B.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",B.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",B.CUES_PARSED="hlsCuesParsed",B.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",B.INIT_PTS_FOUND="hlsInitPtsFound",B.FRAG_LOADING="hlsFragLoading",B.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",B.FRAG_LOADED="hlsFragLoaded",B.FRAG_DECRYPTED="hlsFragDecrypted",B.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",B.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",B.FRAG_PARSING_METADATA="hlsFragParsingMetadata",B.FRAG_PARSED="hlsFragParsed",B.FRAG_BUFFERED="hlsFragBuffered",B.FRAG_CHANGED="hlsFragChanged",B.FPS_DROP="hlsFpsDrop",B.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",B.ERROR="hlsError",B.DESTROYING="hlsDestroying",B.KEY_LOADING="hlsKeyLoading",B.KEY_LOADED="hlsKeyLoaded",B.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",B.BACK_BUFFER_REACHED="hlsBackBufferReached"})(J||(J={}))},"./src/hls.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return A});var J=N("./node_modules/url-toolkit/src/url-toolkit.js"),B=N.n(J),D=N("./src/loader/playlist-loader.ts"),H=N("./src/loader/key-loader.ts"),F=N("./src/controller/id3-track-controller.ts"),k=N("./src/controller/latency-controller.ts"),I=N("./src/controller/level-controller.ts"),_=N("./src/controller/fragment-tracker.ts"),v=N("./src/controller/stream-controller.ts"),p=N("./src/is-supported.ts"),c=N("./src/utils/logger.ts"),a=N("./src/config.ts"),l=N("./node_modules/eventemitter3/index.js"),o=N.n(l),r=N("./src/events.ts"),s=N("./src/errors.ts");function d(T,w){for(var C=0;C<w.length;C++){var b=w[C];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(T,b.key,b)}}function R(T,w,C){return w&&d(T.prototype,w),C&&d(T,C),T}var A=function(){T.isSupported=function(){return Object(p.isSupported)()};function T(C){C===void 0&&(C={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.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 b=this.config=Object(a.mergeConfig)(T.DefaultConfig,C);this.userConfig=C,Object(c.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(a.enableStreamingMode)(b);var m=b.abrController,h=b.bufferController,u=b.capLevelController,x=b.fpsController,g=this.abrController=new m(this),y=this.bufferController=new h(this),M=this.capLevelController=new u(this),E=new x(this),j=new D.default(this),G=new H.default(this),U=new F.default(this),O=this.levelController=new I.default(this),X=new _.FragmentTracker(this),$=this.streamController=new v.default(this,X);M.setStreamController($),E.setStreamController($);var se=[O,$];this.networkControllers=se;var ce=[j,G,g,y,M,E,U,X];this.audioTrackController=this.createController(b.audioTrackController,null,se),this.createController(b.audioStreamController,X,se),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,se),this.createController(b.subtitleStreamController,X,se),this.createController(b.timelineController,null,ce),this.emeController=this.createController(b.emeController,null,ce),this.cmcdController=this.createController(b.cmcdController,null,ce),this.latencyController=this.createController(k.default,null,ce),this.coreComponents=ce}var w=T.prototype;return w.createController=function(b,m,h){if(b){var u=m?new b(this,m):new b(this);return h&&h.push(u),u}return null},w.on=function(b,m,h){h===void 0&&(h=this),this._emitter.on(b,m,h)},w.once=function(b,m,h){h===void 0&&(h=this),this._emitter.once(b,m,h)},w.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},w.off=function(b,m,h,u){h===void 0&&(h=this),this._emitter.off(b,m,h,u)},w.listeners=function(b){return this._emitter.listeners(b)},w.emit=function(b,m,h){return this._emitter.emit(b,m,h)},w.trigger=function(b,m){if(this.config.debug)return this.emit(b,b,m);try{return this.emit(b,b,m)}catch(h){c.logger.error("An internal error happened while handling event "+b+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(r.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:h})}return!1},w.listenerCount=function(b){return this._emitter.listenerCount(b)},w.destroy=function(){c.logger.log("destroy"),this.trigger(r.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},w.attachMedia=function(b){c.logger.log("attachMedia"),this._media=b,this.trigger(r.Events.MEDIA_ATTACHING,{media:b})},w.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},w.loadSource=function(b){this.stopLoad();var m=this.media,h=this.url,u=this.url=J.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});c.logger.log("loadSource:"+u),m&&h&&h!==u&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(m)),this.trigger(r.Events.MANIFEST_LOADING,{url:b})},w.startLoad=function(b){b===void 0&&(b=-1),c.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(m){m.startLoad(b)})},w.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},w.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},w.recoverMediaError=function(){c.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},w.removeLevel=function(b,m){m===void 0&&(m=0),this.levelController.removeLevel(b,m)},R(T,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){c.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){c.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){c.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){c.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){c.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var m=!!b;m!==this.config.capLevelToPlayerSize&&(m?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=m)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(c.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,m=this.config.minAutoBitrate;if(!b)return 0;for(var h=b.length,u=0;u<h;u++)if(b[u].maxBitrate>m)return u;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,m=this.autoLevelCapping,h;return m===-1&&b&&b.length?h=b.length-1:h=m,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var m=this.audioTrackController;m&&(m.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var m=this.subtitleTrackController;m&&(m.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return r.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:a.hlsDefaultConfig},set:function(b){T.defaultConfig=b}}]),T}();A.defaultConfig=void 0},"./src/is-supported.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"isSupported",function(){return D}),N.d(Q,"changeTypeSupported",function(){return H});var J=N("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function D(){var F=Object(J.getMediaSource)();if(!F)return!1;var k=B(),I=F&&typeof F.isTypeSupported=="function"&&F.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),_=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!I&&!!_}function H(){var F,k=B();return typeof(k==null||((F=k.prototype)===null||F===void 0)?void 0:F.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return c}),N.d(Q,"LoadError",function(){return l});var J=N("./src/polyfills/number.ts"),B=N("./src/errors.ts");function D(o,r){o.prototype=Object.create(r.prototype),o.prototype.constructor=o,_(o,r)}function H(o){var r=typeof Map=="function"?new Map:void 0;return H=function(d){if(d===null||!I(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(d))return r.get(d);r.set(d,R)}function R(){return F(d,arguments,v(this).constructor)}return R.prototype=Object.create(d.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),_(R,d)},H(o)}function F(o,r,s){return k()?F=Reflect.construct:F=function(R,A,T){var w=[null];w.push.apply(w,A);var C=Function.bind.apply(R,w),b=new C;return T&&_(b,T.prototype),b},F.apply(null,arguments)}function k(){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(o){return!1}}function I(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function _(o,r){return _=Object.setPrototypeOf||function(d,R){return d.__proto__=R,d},_(o,r)}function v(o){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},v(o)}var p=Math.pow(2,17),c=function(){function o(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var r=o.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(d,R){var A=this,T=d.url;if(!T)return Promise.reject(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var w=this.config,C=w.fLoader,b=w.loader;return new Promise(function(m,h){A.loader&&A.loader.destroy();var u=A.loader=d.loader=C?new C(w):new b(w),x=a(d),g={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:p};d.stats=u.stats,u.load(x,g,{onSuccess:function(M,E,j,G){A.resetLoader(d,u),m({frag:d,part:null,payload:M.data,networkDetails:G})},onError:function(M,E,j){A.resetLoader(d,u),h(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,response:M,networkDetails:j}))},onAbort:function(M,E,j){A.resetLoader(d,u),h(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,networkDetails:j}))},onTimeout:function(M,E,j){A.resetLoader(d,u),h(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,networkDetails:j}))},onProgress:function(M,E,j,G){R&&R({frag:d,part:null,payload:j,networkDetails:G})}})})},r.loadPart=function(d,R,A){var T=this;this.abort();var w=this.config,C=w.fLoader,b=w.loader;return new Promise(function(m,h){T.loader&&T.loader.destroy();var u=T.loader=d.loader=C?new C(w):new b(w),x=a(d,R),g={timeout:w.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:w.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=u.stats,u.load(x,g,{onSuccess:function(M,E,j,G){T.resetLoader(d,u),T.updateStatsFromPart(d,R);var U={frag:d,part:R,payload:M.data,networkDetails:G};A(U),m(U)},onError:function(M,E,j){T.resetLoader(d,u),h(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:d,part:R,response:M,networkDetails:j}))},onAbort:function(M,E,j){d.stats.aborted=R.stats.aborted,T.resetLoader(d,u),h(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:d,part:R,networkDetails:j}))},onTimeout:function(M,E,j){T.resetLoader(d,u),h(new l({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:d,part:R,networkDetails:j}))}})})},r.updateStatsFromPart=function(d,R){var A=d.stats,T=R.stats,w=T.total;if(A.loaded+=T.loaded,w){var C=Math.round(d.duration/R.duration),b=Math.min(Math.round(A.loaded/w),C),m=C-b,h=m*Math.round(A.loaded/b);A.total=A.loaded+h}else A.total=Math.max(A.loaded,A.total);var u=A.loading,x=T.loading;u.start?u.first+=x.first-x.start:(u.start=x.start,u.first=x.first),u.end=x.end},r.resetLoader=function(d,R){d.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},o}();function a(o,r){r===void 0&&(r=null);var s=r||o,d={frag:o,part:r,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},R=s.byteRangeStartOffset,A=s.byteRangeEndOffset;return Object(J.isFiniteNumber)(R)&&Object(J.isFiniteNumber)(A)&&(d.rangeStart=R,d.rangeEnd=A),d}var l=function(o){D(r,o);function r(s){for(var d,R=arguments.length,A=new Array(R>1?R-1:0),T=1;T<R;T++)A[T-1]=arguments[T];return d=o.call.apply(o,[this].concat(A))||this,d.data=void 0,d.data=s,d}return r}(H(Error))},"./src/loader/fragment.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"ElementaryStreamTypes",function(){return c}),N.d(Q,"BaseSegment",function(){return a}),N.d(Q,"Fragment",function(){return l}),N.d(Q,"Part",function(){return o});var J=N("./src/polyfills/number.ts"),B=N("./node_modules/url-toolkit/src/url-toolkit.js"),D=N.n(B),H=N("./src/utils/logger.ts"),F=N("./src/loader/level-key.ts"),k=N("./src/loader/load-stats.ts");function I(r,s){r.prototype=Object.create(s.prototype),r.prototype.constructor=r,_(r,s)}function _(r,s){return _=Object.setPrototypeOf||function(R,A){return R.__proto__=A,R},_(r,s)}function v(r,s){for(var d=0;d<s.length;d++){var R=s[d];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(r,R.key,R)}}function p(r,s,d){return s&&v(r.prototype,s),d&&v(r,d),r}var c;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(c||(c={}));var a=function(){function r(d){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[c.AUDIO]=null,R[c.VIDEO]=null,R[c.AUDIOVIDEO]=null,R),this.baseurl=d}var s=r.prototype;return s.setByteRange=function(R,A){var T=R.split("@",2),w=[];T.length===1?w[0]=A?A.byteRangeEndOffset:0:w[0]=parseInt(T[1]),w[1]=parseInt(T[0])+w[0],this._byteRange=w},p(r,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(B.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),r}(),l=function(r){I(s,r);function s(R,A){var T;return T=r.call(this,A)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new k.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=R,T}var d=s.prototype;return d.createInitializationVector=function(A){for(var T=new Uint8Array(16),w=12;w<16;w++)T[w]=A>>8*(15-w)&255;return T},d.setDecryptDataFromLevelKey=function(A,T){var w=A;return(A==null?void 0:A.method)==="AES-128"&&A.uri&&!A.iv&&(w=F.LevelKey.fromURI(A.uri),w.method=A.method,w.iv=this.createInitializationVector(T),w.keyFormat="identity"),w},d.setElementaryStreamInfo=function(A,T,w,C,b,m){m===void 0&&(m=!1);var h=this.elementaryStreams,u=h[A];if(!u){h[A]={startPTS:T,endPTS:w,startDTS:C,endDTS:b,partial:m};return}u.startPTS=Math.min(u.startPTS,T),u.endPTS=Math.max(u.endPTS,w),u.startDTS=Math.min(u.startDTS,C),u.endDTS=Math.max(u.endDTS,b)},d.clearElementaryStreamInfo=function(){var A=this.elementaryStreams;A[c.AUDIO]=null,A[c.VIDEO]=null,A[c.AUDIOVIDEO]=null},p(s,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var A=this.sn;typeof A!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&H.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),A=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,A)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(J.isFiniteNumber)(this.programDateTime))return null;var A=Object(J.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+A*1e3}},{key:"encrypted",get:function(){var A;return!!((A=this.decryptdata)!==null&&A!==void 0&&A.keyFormat&&this.decryptdata.uri)}}]),s}(a),o=function(r){I(s,r);function s(d,R,A,T,w){var C;C=r.call(this,A)||this,C.fragOffset=0,C.duration=0,C.gap=!1,C.independent=!1,C.relurl=void 0,C.fragment=void 0,C.index=void 0,C.stats=new k.LoadStats,C.duration=d.decimalFloatingPoint("DURATION"),C.gap=d.bool("GAP"),C.independent=d.bool("INDEPENDENT"),C.relurl=d.enumeratedString("URI"),C.fragment=R,C.index=T;var b=d.enumeratedString("BYTERANGE");return b&&C.setByteRange(b,w),w&&(C.fragOffset=w.fragOffset+w.duration),C}return p(s,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),s}(a)},"./src/loader/key-loader.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return H});var J=N("./src/events.ts"),B=N("./src/errors.ts"),D=N("./src/utils/logger.ts"),H=function(){function F(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var k=F.prototype;return k._registerListeners=function(){this.hls.on(J.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(J.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var _ in this.loaders){var v=this.loaders[_];v&&v.destroy()}this.loaders={}},k.onKeyLoading=function(_,v){var p=v.frag,c=p.type,a=this.loaders[c];if(!p.decryptdata){D.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=p.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var o=this.hls.config;if(a&&(D.logger.warn("abort previous key loader for type:"+c),a.abort()),!l){D.logger.warn("key uri is falsy");return}var r=o.loader,s=p.loader=this.loaders[c]=new r(o);this.decrypturl=l,this.decryptkey=null;var d={url:l,frag:p,responseType:"arraybuffer"},R={timeout:o.fragLoadingTimeOut,maxRetry:0,retryDelay:o.fragLoadingRetryDelay,maxRetryDelay:o.fragLoadingMaxRetryTimeout,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(d,R,A)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(J.Events.KEY_LOADED,{frag:p}))},k.loadsuccess=function(_,v,p){var c=p.frag;if(!c.decryptdata){D.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(_.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(J.Events.KEY_LOADED,{frag:c})},k.loaderror=function(_,v){var p=v.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:_})},k.loadtimeout=function(_,v){var p=v.frag,c=p.loader;c&&c.abort(),delete this.loaders[p.type],this.hls.trigger(J.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},F}()},"./src/loader/level-details.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"LevelDetails",function(){return F});var J=N("./src/polyfills/number.ts");function B(k,I){for(var _=0;_<I.length;_++){var v=I[_];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(k,v.key,v)}}function D(k,I,_){return I&&B(k.prototype,I),_&&B(k,_),k}var H=10,F=function(){function k(_){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=_}var I=k.prototype;return I.reloaded=function(v){if(!v){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-v.lastPartSn,c=this.lastPartIndex-v.lastPartIndex;this.updated=this.endSN!==v.endSN||!!c||!!p,this.advanced=this.endSN>v.endSN||p>0||p===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(v.misses*.6):this.misses=v.misses+1,this.availabilityDelay=v.availabilityDelay},D(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(J.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||H}},{key:"drift",get:function(){var v=this.driftEndTime-this.driftStartTime;if(v>0){var p=this.driftEnd-this.driftStart;return p*1e3/v}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var v;return(v=this.fragments)!==null&&v!==void 0&&v.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),k}()},"./src/loader/level-key.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"LevelKey",function(){return F});var J=N("./node_modules/url-toolkit/src/url-toolkit.js"),B=N.n(J);function D(k,I){for(var _=0;_<I.length;_++){var v=I[_];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(k,v.key,v)}}function H(k,I,_){return I&&D(k.prototype,I),_&&D(k,_),k}var F=function(){k.fromURL=function(_,v){return new k(_,v)},k.fromURI=function(_){return new k(_)};function k(I,_){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,_?this._uri=Object(J.buildAbsoluteURL)(I,_,{alwaysNormalize:!0}):this._uri=I}return H(k,[{key:"uri",get:function(){return this._uri}}]),k}()},"./src/loader/load-stats.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"LoadStats",function(){return J});var J=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(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return s});var J=N("./src/polyfills/number.ts"),B=N("./node_modules/url-toolkit/src/url-toolkit.js"),D=N.n(B),H=N("./src/loader/fragment.ts"),F=N("./src/loader/level-details.ts"),k=N("./src/loader/level-key.ts"),I=N("./src/utils/attr-list.ts"),_=N("./src/utils/logger.ts"),v=N("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,c=/#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"),l=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("|")),o=/\.(mp4|m4s|m4v|m4a)$/i;function r(w){var C,b;return o.test((C=(b=B.parseURL(w))===null||b===void 0?void 0:b.path)!=null?C:"")}var s=function(){function w(){}return w.findGroup=function(b,m){for(var h=0;h<b.length;h++){var u=b[h];if(u.id===m)return u}},w.convertAVC1ToAVCOTI=function(b){var m=b.split(".");if(m.length>2){var h=m.shift()+".";return h+=parseInt(m.shift()).toString(16),h+=("000"+parseInt(m.shift()).toString(16)).substr(-4),h}return b},w.resolve=function(b,m){return B.buildAbsoluteURL(m,b,{alwaysNormalize:!0})},w.parseMasterPlaylist=function(b,m){var h=[],u={},x=!1;p.lastIndex=0;for(var g;(g=p.exec(b))!=null;)if(g[1]){var y=new I.AttrList(g[1]),M={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:w.resolve(g[2],m)},E=y.decimalResolution("RESOLUTION");E&&(M.width=E.width,M.height=E.height),d((y.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=w.convertAVC1ToAVCOTI(M.videoCodec)),h.push(M)}else if(g[3]){var j=new I.AttrList(g[3]);j["DATA-ID"]&&(x=!0,u[j["DATA-ID"]]=j)}return{levels:h,sessionData:x?u:null}},w.parseMasterPlaylistMedia=function(b,m,h,u){u===void 0&&(u=[]);var x,g=[],y=0;for(c.lastIndex=0;(x=c.exec(b))!==null;){var M=new I.AttrList(x[1]);if(M.TYPE===h){var E={attrs:M,bitrate:0,id:y++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:h,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?w.resolve(M.URI,m):""};if(u.length){var j=w.findGroup(u,E.groupId)||u[0];R(E,j,"audioCodec"),R(E,j,"textCodec")}g.push(E)}}return g},w.parseLevelPlaylist=function(b,m,h,u,x){var g=new F.LevelDetails(m),y=g.fragments,M=null,E=0,j=0,G=0,U=0,O=null,X=new H.Fragment(u,m),$,se,ce,Pe=-1,Se=!1;for(a.lastIndex=0,g.m3u8=b;($=a.exec(b))!==null;){Se&&(Se=!1,X=new H.Fragment(u,m),X.start=G,X.sn=E,X.cc=U,X.level=h,M&&(X.initSegment=M,X.rawProgramDateTime=M.rawProgramDateTime));var Re=$[1];if(Re){X.duration=parseFloat(Re);var Oe=(" "+$[2]).slice(1);X.title=Oe||null,X.tagList.push(Oe?["INF",Re,Oe]:["INF",Re])}else if($[3])Object(J.isFiniteNumber)(X.duration)&&(X.start=G,ce&&(X.levelkey=ce),X.sn=E,X.level=h,X.cc=U,X.urlId=x,y.push(X),X.relurl=(" "+$[3]).slice(1),T(X,O),O=X,G+=X.duration,E++,j=0,Se=!0);else if($[4]){var Me=(" "+$[4]).slice(1);O?X.setByteRange(Me,O):X.setByteRange(Me)}else if($[5])X.rawProgramDateTime=(" "+$[5]).slice(1),X.tagList.push(["PROGRAM-DATE-TIME",X.rawProgramDateTime]),Pe===-1&&(Pe=y.length);else{if($=$[0].match(l),!$){_.logger.warn("No matches on slow regex match for level playlist!");continue}for(se=1;se<$.length&&!(typeof $[se]!="undefined");se++);var be=(" "+$[se]).slice(1),ue=(" "+$[se+1]).slice(1),ne=$[se+2]?(" "+$[se+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":g.type=ue.toUpperCase();break;case"MEDIA-SEQUENCE":E=g.startSN=parseInt(ue);break;case"SKIP":{var ve=new I.AttrList(ue),le=ve.decimalInteger("SKIPPED-SEGMENTS");if(Object(J.isFiniteNumber)(le)){g.skippedSegments=le;for(var ke=le;ke--;)y.unshift(null);E+=le}var Fe=ve.enumeratedString("RECENTLY-REMOVED-DATERANGES");Fe&&(g.recentlyRemovedDateranges=Fe.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(ue);break;case"VERSION":g.version=parseInt(ue);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(ue||ne)&&X.tagList.push(ne?[ue,ne]:[ue]);break;case"DIS":U++;case"GAP":X.tagList.push([be]);break;case"BITRATE":X.tagList.push([be,ue]);break;case"DISCONTINUITY-SEQ":U=parseInt(ue);break;case"KEY":{var Ie,He=new I.AttrList(ue),$e=He.enumeratedString("METHOD"),tt=He.URI,Qe=He.hexadecimalInteger("IV"),Je=He.enumeratedString("KEYFORMATVERSIONS"),Ye=He.enumeratedString("KEYID"),gt=(Ie=He.enumeratedString("KEYFORMAT"))!=null?Ie:"identity",_t=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(_t.indexOf(gt)>-1){_.logger.warn("Keyformat "+gt+" is not supported from the manifest");continue}else if(gt!=="identity")continue;$e&&(ce=k.LevelKey.fromURL(m,tt),tt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(ce.method=$e,ce.keyFormat=gt,Ye&&(ce.keyID=Ye),Je&&(ce.keyFormatVersions=Je),ce.iv=Qe));break}case"START":{var vt=new I.AttrList(ue),dt=vt.decimalFloatingPoint("TIME-OFFSET");Object(J.isFiniteNumber)(dt)&&(g.startTimeOffset=dt);break}case"MAP":{var Ct=new I.AttrList(ue);X.relurl=Ct.URI,Ct.BYTERANGE&&X.setByteRange(Ct.BYTERANGE),X.level=h,X.sn="initSegment",ce&&(X.levelkey=ce),X.initSegment=null,M=X,Se=!0;break}case"SERVER-CONTROL":{var xt=new I.AttrList(ue);g.canBlockReload=xt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=xt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&xt.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=xt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=xt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Le=new I.AttrList(ue);g.partTarget=Le.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ce=g.partList;Ce||(Ce=g.partList=[]);var nt=j>0?Ce[Ce.length-1]:void 0,rt=j++,Be=new H.Part(new I.AttrList(ue),X,m,rt,nt);Ce.push(Be),X.duration+=Be.duration;break}case"PRELOAD-HINT":{var et=new I.AttrList(ue);g.preloadHint=et;break}case"RENDITION-REPORT":{var xe=new I.AttrList(ue);g.renditionReports=g.renditionReports||[],g.renditionReports.push(xe);break}default:_.logger.warn("line parsed but not handled: "+$);break}}}O&&!O.relurl?(y.pop(),G-=O.duration,g.partList&&(g.fragmentHint=O)):g.partList&&(T(X,O),X.cc=U,g.fragmentHint=X);var fe=y.length,ge=y[0],re=y[fe-1];if(G+=g.skippedSegments*g.targetduration,G>0&&fe&&re){g.averagetargetduration=G/fe;var ae=re.sn;g.endSN=ae!=="initSegment"?ae:0,ge&&(g.startCC=ge.cc,ge.initSegment||g.fragments.every(function(de){return de.relurl&&r(de.relurl)})&&(_.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),X=new H.Fragment(u,m),X.relurl=re.relurl,X.level=h,X.sn="initSegment",ge.initSegment=X,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(G+=g.fragmentHint.duration),g.totalduration=G,g.endCC=U,Pe>0&&A(y,Pe),g},w}();function d(w,C){["video","audio","text"].forEach(function(b){var m=w.filter(function(u){return Object(v.isCodecType)(u,b)});if(m.length){var h=m.filter(function(u){return u.lastIndexOf("avc1",0)===0||u.lastIndexOf("mp4a",0)===0});C[b+"Codec"]=h.length>0?h[0]:m[0],w=w.filter(function(u){return m.indexOf(u)===-1})}}),C.unknownCodecs=w}function R(w,C,b){var m=C[b];m&&(w[b]=m)}function A(w,C){for(var b=w[C],m=C;m--;){var h=w[m];if(!h)return;h.programDateTime=b.programDateTime-h.duration*1e3,b=h}}function T(w,C){w.rawProgramDateTime?w.programDateTime=Date.parse(w.rawProgramDateTime):C!=null&&C.programDateTime&&(w.programDateTime=C.endProgramDateTime),Object(J.isFiniteNumber)(w.programDateTime)||(w.programDateTime=null,w.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/polyfills/number.ts"),B=N("./src/events.ts"),D=N("./src/errors.ts"),H=N("./src/utils/logger.ts"),F=N("./src/utils/mp4-tools.ts"),k=N("./src/loader/m3u8-parser.ts"),I=N("./src/types/loader.ts"),_=N("./src/utils/attr-list.ts");function v(a){var l=a.type;switch(l){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function p(a,l){var o=a.url;return(o===void 0||o.indexOf("data:")===0)&&(o=l.url),o}var c=function(){function a(o){this.hls=void 0,this.loaders=Object.create(null),this.hls=o,this.registerListeners()}var l=a.prototype;return l.registerListeners=function(){var r=this.hls;r.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var r=this.hls;r.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(r){var s=this.hls.config,d=s.pLoader,R=s.loader,A=d||R,T=new A(s);return r.loader=T,this.loaders[r.type]=T,T},l.getInternalLoader=function(r){return this.loaders[r.type]},l.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},l.destroyInternalLoaders=function(){for(var r in this.loaders){var s=this.loaders[r];s&&s.destroy(),this.resetInternalLoader(r)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(r,s){var d=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:d,deliveryDirectives:null})},l.onLevelLoading=function(r,s){var d=s.id,R=s.level,A=s.url,T=s.deliveryDirectives;this.load({id:d,groupId:null,level:R,responseType:"text",type:I.PlaylistContextType.LEVEL,url:A,deliveryDirectives:T})},l.onAudioTrackLoading=function(r,s){var d=s.id,R=s.groupId,A=s.url,T=s.deliveryDirectives;this.load({id:d,groupId:R,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:A,deliveryDirectives:T})},l.onSubtitleTrackLoading=function(r,s){var d=s.id,R=s.groupId,A=s.url,T=s.deliveryDirectives;this.load({id:d,groupId:R,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:A,deliveryDirectives:T})},l.load=function(r){var s,d=this.hls.config,R=this.getInternalLoader(r);if(R){var A=R.context;if(A&&A.url===r.url){H.logger.trace("[playlist-loader]: playlist request ongoing");return}H.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),R.abort()}var T,w,C,b;switch(r.type){case I.PlaylistContextType.MANIFEST:T=d.manifestLoadingMaxRetry,w=d.manifestLoadingTimeOut,C=d.manifestLoadingRetryDelay,b=d.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:T=0,w=d.levelLoadingTimeOut;break;default:T=d.levelLoadingMaxRetry,w=d.levelLoadingTimeOut,C=d.levelLoadingRetryDelay,b=d.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(r),(s=r.deliveryDirectives)!==null&&s!==void 0&&s.part){var m;if(r.type===I.PlaylistContextType.LEVEL&&r.level!==null?m=this.hls.levels[r.level].details:r.type===I.PlaylistContextType.AUDIO_TRACK&&r.id!==null?m=this.hls.audioTracks[r.id].details:r.type===I.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(m=this.hls.subtitleTracks[r.id].details),m){var h=m.partTarget,u=m.targetduration;h&&u&&(w=Math.min(Math.max(h*3,u*.8)*1e3,w))}}var x={timeout:w,maxRetry:T,retryDelay:C,maxRetryDelay:b,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(r,x,g)},l.loadsuccess=function(r,s,d,R){if(R===void 0&&(R=null),d.isSidxRequest){this.handleSidxRequest(r,d),this.handlePlaylistLoaded(r,s,d,R);return}this.resetInternalLoader(d.type);var A=r.data;if(A.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,d,"no EXTM3U delimiter",R);return}s.parsing.start=performance.now(),A.indexOf("#EXTINF:")>0||A.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,s,d,R):this.handleMasterPlaylist(r,s,d,R)},l.loaderror=function(r,s,d){d===void 0&&(d=null),this.handleNetworkError(s,d,!1,r)},l.loadtimeout=function(r,s,d){d===void 0&&(d=null),this.handleNetworkError(s,d,!0)},l.handleMasterPlaylist=function(r,s,d,R){var A=this.hls,T=r.data,w=p(r,d),C=k.default.parseMasterPlaylist(T,w),b=C.levels,m=C.sessionData;if(!b.length){this.handleManifestParsingError(r,d,"no level found in manifest",R);return}var h=b.map(function(E){return{id:E.attrs.AUDIO,audioCodec:E.audioCodec}}),u=b.map(function(E){return{id:E.attrs.SUBTITLES,textCodec:E.textCodec}}),x=k.default.parseMasterPlaylistMedia(T,w,"AUDIO",h),g=k.default.parseMasterPlaylistMedia(T,w,"SUBTITLES",u),y=k.default.parseMasterPlaylistMedia(T,w,"CLOSED-CAPTIONS");if(x.length){var M=x.some(function(E){return!E.url});!M&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(H.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),x.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new _.AttrList({}),bitrate:0,url:""}))}A.trigger(B.Events.MANIFEST_LOADED,{levels:b,audioTracks:x,subtitles:g,captions:y,url:w,stats:s,networkDetails:R,sessionData:m})},l.handleTrackOrLevelPlaylist=function(r,s,d,R){var A=this.hls,T=d.id,w=d.level,C=d.type,b=p(r,d),m=Object(J.isFiniteNumber)(T)?T:0,h=Object(J.isFiniteNumber)(w)?w:m,u=v(d),x=k.default.parseLevelPlaylist(r.data,b,h,u,m);if(!x.fragments.length){A.trigger(B.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof d.level=="number"?d.level:void 0});return}if(C===I.PlaylistContextType.MANIFEST){var g={attrs:new _.AttrList({}),bitrate:0,details:x,name:"",url:b};A.trigger(B.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:b,stats:s,networkDetails:R,sessionData:null})}if(s.parsing.end=performance.now(),x.needSidxRanges){var y,M=(y=x.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:M,isSidxRequest:!0,type:C,level:w,levelDetails:x,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}d.levelDetails=x,this.handlePlaylistLoaded(r,s,d,R)},l.handleSidxRequest=function(r,s){var d=Object(F.parseSegmentIndex)(new Uint8Array(r.data));if(!d)return;var R=d.references,A=s.levelDetails;R.forEach(function(T,w){var C=T.info,b=A.fragments[w];b.byteRange.length===0&&b.setByteRange(String(1+C.end-C.start)+"@"+String(C.start)),b.initSegment&&b.initSegment.setByteRange(String(d.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(r,s,d,R){this.hls.trigger(B.Events.ERROR,{type:D.ErrorTypes.NETWORK_ERROR,details:D.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===I.PlaylistContextType.MANIFEST,url:r.url,reason:d,response:r,context:s,networkDetails:R})},l.handleNetworkError=function(r,s,d,R){d===void 0&&(d=!1),H.logger.warn("[playlist-loader]: A network "+(d?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var A=D.ErrorDetails.UNKNOWN,T=!1,w=this.getInternalLoader(r);switch(r.type){case I.PlaylistContextType.MANIFEST:A=d?D.ErrorDetails.MANIFEST_LOAD_TIMEOUT:D.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case I.PlaylistContextType.LEVEL:A=d?D.ErrorDetails.LEVEL_LOAD_TIMEOUT:D.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case I.PlaylistContextType.AUDIO_TRACK:A=d?D.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:D.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:A=d?D.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:D.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}w&&this.resetInternalLoader(r.type);var C={type:D.ErrorTypes.NETWORK_ERROR,details:A,fatal:T,url:r.url,loader:w,context:r,networkDetails:s};R&&(C.response=R),this.hls.trigger(B.Events.ERROR,C)},l.handlePlaylistLoaded=function(r,s,d,R){var A=d.type,T=d.level,w=d.id,C=d.groupId,b=d.loader,m=d.levelDetails,h=d.deliveryDirectives;if(!(m!=null&&m.targetduration)){this.handleManifestParsingError(r,d,"invalid target duration",R);return}if(!b)return;m.live&&(b.getCacheAge&&(m.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(m.ageHeader))&&(m.ageHeader=0));switch(A){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:m,level:T||0,id:w||0,stats:s,networkDetails:R,deliveryDirectives:h});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:m,id:w||0,groupId:C||"",stats:s,networkDetails:R,deliveryDirectives:h});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:m,id:w||0,groupId:C||"",stats:s,networkDetails:R,deliveryDirectives:h});break}},a}();Q.default=c},"./src/polyfills/number.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"isFiniteNumber",function(){return J}),N.d(Q,"MAX_SAFE_INTEGER",function(){return B});var J=Number.isFinite||function(D){return typeof D=="number"&&isFinite(D)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,Q,N){"use strict";N.r(Q);var J=function(){function B(){}return B.getSilentFrame=function(H,F){switch(H){case"mp4a.40.2":if(F===1)return new Uint8Array([0,200,0,128,35,128]);if(F===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(F===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(F===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(F===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(F===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(F===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(F===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(F===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},B}();Q.default=J},"./src/remux/mp4-generator.ts":function(te,Q,N){"use strict";N.r(Q);var J=Math.pow(2,32)-1,B=function(){function D(){}return D.init=function(){D.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 F;for(F in D.types)D.types.hasOwnProperty(F)&&(D.types[F]=[F.charCodeAt(0),F.charCodeAt(1),F.charCodeAt(2),F.charCodeAt(3)]);var k=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]),I=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]);D.HDLR_TYPES={video:k,audio:I};var _=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),v=new Uint8Array([0,0,0,0,0,0,0,0]);D.STTS=D.STSC=D.STCO=v,D.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),D.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),D.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),D.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);D.FTYP=D.box(D.types.ftyp,p,a,p,c),D.DINF=D.box(D.types.dinf,D.box(D.types.dref,_))},D.box=function(F){for(var k=8,I=arguments.length,_=new Array(I>1?I-1:0),v=1;v<I;v++)_[v-1]=arguments[v];for(var p=_.length,c=p;p--;)k+=_[p].byteLength;var a=new Uint8Array(k);for(a[0]=k>>24&255,a[1]=k>>16&255,a[2]=k>>8&255,a[3]=k&255,a.set(F,4),p=0,k=8;p<c;p++)a.set(_[p],k),k+=_[p].byteLength;return a},D.hdlr=function(F){return D.box(D.types.hdlr,D.HDLR_TYPES[F])},D.mdat=function(F){return D.box(D.types.mdat,F)},D.mdhd=function(F,k){k*=F;var I=Math.floor(k/(J+1)),_=Math.floor(k%(J+1));return D.box(D.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,I>>24,I>>16&255,I>>8&255,I&255,_>>24,_>>16&255,_>>8&255,_&255,85,196,0,0]))},D.mdia=function(F){return D.box(D.types.mdia,D.mdhd(F.timescale,F.duration),D.hdlr(F.type),D.minf(F))},D.mfhd=function(F){return D.box(D.types.mfhd,new Uint8Array([0,0,0,0,F>>24,F>>16&255,F>>8&255,F&255]))},D.minf=function(F){return F.type==="audio"?D.box(D.types.minf,D.box(D.types.smhd,D.SMHD),D.DINF,D.stbl(F)):D.box(D.types.minf,D.box(D.types.vmhd,D.VMHD),D.DINF,D.stbl(F))},D.moof=function(F,k,I){return D.box(D.types.moof,D.mfhd(F),D.traf(I,k))},D.moov=function(F){for(var k=F.length,I=[];k--;)I[k]=D.trak(F[k]);return D.box.apply(null,[D.types.moov,D.mvhd(F[0].timescale,F[0].duration)].concat(I).concat(D.mvex(F)))},D.mvex=function(F){for(var k=F.length,I=[];k--;)I[k]=D.trex(F[k]);return D.box.apply(null,[D.types.mvex].concat(I))},D.mvhd=function(F,k){k*=F;var I=Math.floor(k/(J+1)),_=Math.floor(k%(J+1)),v=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,F>>24&255,F>>16&255,F>>8&255,F&255,I>>24,I>>16&255,I>>8&255,I&255,_>>24,_>>16&255,_>>8&255,_&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return D.box(D.types.mvhd,v)},D.sdtp=function(F){var k=F.samples||[],I=new Uint8Array(4+k.length),_,v;for(_=0;_<k.length;_++)v=k[_].flags,I[_+4]=v.dependsOn<<4|v.isDependedOn<<2|v.hasRedundancy;return D.box(D.types.sdtp,I)},D.stbl=function(F){return D.box(D.types.stbl,D.stsd(F),D.box(D.types.stts,D.STTS),D.box(D.types.stsc,D.STSC),D.box(D.types.stsz,D.STSZ),D.box(D.types.stco,D.STCO))},D.avc1=function(F){var k=[],I=[],_,v,p;for(_=0;_<F.sps.length;_++)v=F.sps[_],p=v.byteLength,k.push(p>>>8&255),k.push(p&255),k=k.concat(Array.prototype.slice.call(v));for(_=0;_<F.pps.length;_++)v=F.pps[_],p=v.byteLength,I.push(p>>>8&255),I.push(p&255),I=I.concat(Array.prototype.slice.call(v));var c=D.box(D.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|F.sps.length].concat(k).concat([F.pps.length]).concat(I))),a=F.width,l=F.height,o=F.pixelRatio[0],r=F.pixelRatio[1];return D.box(D.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,l>>8&255,l&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]),c,D.box(D.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),D.box(D.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,r>>24,r>>16&255,r>>8&255,r&255])))},D.esds=function(F){var k=F.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(F.config).concat([6,1,2]))},D.mp4a=function(F){var k=F.samplerate;return D.box(D.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),D.box(D.types.esds,D.esds(F)))},D.mp3=function(F){var k=F.samplerate;return D.box(D.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,F.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},D.stsd=function(F){return F.type==="audio"?!F.isAAC&&F.codec==="mp3"?D.box(D.types.stsd,D.STSD,D.mp3(F)):D.box(D.types.stsd,D.STSD,D.mp4a(F)):D.box(D.types.stsd,D.STSD,D.avc1(F))},D.tkhd=function(F){var k=F.id,I=F.duration*F.timescale,_=F.width,v=F.height,p=Math.floor(I/(J+1)),c=Math.floor(I%(J+1));return D.box(D.types.tkhd,new Uint8Array([1,0,0,7,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,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,c>>24,c>>16&255,c>>8&255,c&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,_>>8&255,_&255,0,0,v>>8&255,v&255,0,0]))},D.traf=function(F,k){var I=D.sdtp(F),_=F.id,v=Math.floor(k/(J+1)),p=Math.floor(k%(J+1));return D.box(D.types.traf,D.box(D.types.tfhd,new Uint8Array([0,0,0,0,_>>24,_>>16&255,_>>8&255,_&255])),D.box(D.types.tfdt,new Uint8Array([1,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,p>>24,p>>16&255,p>>8&255,p&255])),D.trun(F,I.length+16+20+8+16+8+8),I)},D.trak=function(F){return F.duration=F.duration||4294967295,D.box(D.types.trak,D.tkhd(F),D.mdia(F))},D.trex=function(F){var k=F.id;return D.box(D.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},D.trun=function(F,k){var I=F.samples||[],_=I.length,v=12+16*_,p=new Uint8Array(v),c,a,l,o,r,s;for(k+=8+v,p.set([0,0,15,1,_>>>24&255,_>>>16&255,_>>>8&255,_&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),c=0;c<_;c++)a=I[c],l=a.duration,o=a.size,r=a.flags,s=a.cts,p.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*c);return D.box(D.types.trun,p)},D.initSegment=function(F){D.types||D.init();var k=D.moov(F),I=new Uint8Array(D.FTYP.byteLength+k.byteLength);return I.set(D.FTYP),I.set(k,D.FTYP.byteLength),I},D}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,Q.default=B},"./src/remux/mp4-remuxer.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return s}),N.d(Q,"normalizePts",function(){return d});var J=N("./src/polyfills/number.ts"),B=N("./src/remux/aac-helper.ts"),D=N("./src/remux/mp4-generator.ts"),H=N("./src/events.ts"),F=N("./src/errors.ts"),k=N("./src/utils/logger.ts"),I=N("./src/types/loader.ts"),_=N("./src/utils/timescale-conversion.ts");function v(){return v=Object.assign||function(w){for(var C=1;C<arguments.length;C++){var b=arguments[C];for(var m in b)Object.prototype.hasOwnProperty.call(b,m)&&(w[m]=b[m])}return w},v.apply(this,arguments)}var p=10*1e3,c=1024,a=1152,l=null,o=null,r=!1,s=function(){function w(b,m,h,u){if(u===void 0&&(u=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=b,this.config=m,this.typeSupported=h,this.ISGenerated=!1,l===null){var x=navigator.userAgent||"",g=x.match(/Chrome\/(\d+)/i);l=g?parseInt(g[1]):0}if(o===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);o=y?parseInt(y[1]):0}r=!!l&&l<75||!!o&&o<600}var C=w.prototype;return C.destroy=function(){},C.resetTimeStamp=function(m){k.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=m},C.resetNextTimestamp=function(){k.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},C.resetInitSegment=function(){k.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},C.getVideoStartPts=function(m){var h=!1,u=m.reduce(function(x,g){var y=g.pts-x;return y<-4294967296?(h=!0,d(x,g.pts)):y>0?x:g.pts},m[0].pts);return h&&k.logger.debug("PTS rollover detected"),u},C.remux=function(m,h,u,x,g,y,M,E){var j,G,U,O,X,$,se=g,ce=g,Pe=m.pid>-1,Se=h.pid>-1,Re=h.samples.length,Oe=m.samples.length>0,Me=Re>1,be=(!Pe||Oe)&&(!Se||Me)||this.ISGenerated||M;if(be){this.ISGenerated||(U=this.generateIS(m,h,g));var ue=this.isVideoContiguous,ne=-1;if(Me&&(ne=R(h.samples),!ue&&this.config.forceKeyFrameOnDiscontinuity))if($=!0,ne>0){k.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Re+" video samples due to a missing keyframe");var ve=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(ne),h.dropped+=ne,ce+=(h.samples[0].pts-ve)/(h.timescale||9e4)}else ne===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+Re+" video samples"),$=!1);if(this.ISGenerated){if(Oe&&Me){var le=this.getVideoStartPts(h.samples),ke=d(m.samples[0].pts,le)-le,Fe=ke/h.inputTimeScale;se+=Math.max(0,Fe),ce+=Math.max(0,-Fe)}if(Oe){if(m.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(m,h,g)),G=this.remuxAudio(m,se,this.isAudioContiguous,y,Se||Me||E===I.PlaylistLevelType.AUDIO?ce:void 0),Me){var Ie=G?G.endPTS-G.startPTS:0;h.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(m,h,g)),j=this.remuxVideo(h,ce,ue,Ie)}}else Me&&(j=this.remuxVideo(h,ce,ue,0));j&&(j.firstKeyFrame=ne,j.independent=ne!==-1)}}return this.ISGenerated&&(u.samples.length&&(X=this.remuxID3(u,g)),x.samples.length&&(O=this.remuxText(x,g))),{audio:G,video:j,initSegment:U,independent:$,text:O,id3:X}},C.generateIS=function(m,h,u){var x=m.samples,g=h.samples,y=this.typeSupported,M={},E=!Object(J.isFiniteNumber)(this._initPTS),j="audio/mp4",G,U,O;if(E&&(G=U=Infinity),m.config&&x.length&&(m.timescale=m.samplerate,m.isAAC||(y.mpeg?(j="audio/mpeg",m.codec=""):y.mp3&&(m.codec="mp3")),M.audio={id:"audio",container:j,codec:m.codec,initSegment:!m.isAAC&&y.mpeg?new Uint8Array(0):D.default.initSegment([m]),metadata:{channelCount:m.channelCount}},E&&(O=m.inputTimeScale,G=U=x[0].pts-Math.round(O*u))),h.sps&&h.pps&&g.length&&(h.timescale=h.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:D.default.initSegment([h]),metadata:{width:h.width,height:h.height}},E)){O=h.inputTimeScale;var X=this.getVideoStartPts(g),$=Math.round(O*u);U=Math.min(U,d(g[0].dts,X)-$),G=Math.min(G,X-$)}if(Object.keys(M).length)return this.ISGenerated=!0,E&&(this._initPTS=G,this._initDTS=U),{tracks:M,initPTS:G,timescale:O}},C.remuxVideo=function(m,h,u,x){var g=m.inputTimeScale,y=m.samples,M=[],E=y.length,j=this._initPTS,G=this.nextAvcDts,U=8,O,X,$,se=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,Pe=0,Se=!1;if(!u||G===null){var Re=h*g,Oe=y[0].pts-d(y[0].dts,y[0].pts);G=Re-Oe}for(var Me=0;Me<E;Me++){var be=y[Me];if(be.pts=d(be.pts-j,G),be.dts=d(be.dts-j,G),be.dts>be.pts){var ue=9e4*.2;Pe=Math.max(Math.min(Pe,be.pts-be.dts),-1*ue)}be.dts<y[Me>0?Me-1:Me].dts&&(Se=!0)}Se&&y.sort(function(pt,Xe){var Ge=pt.dts-Xe.dts,De=pt.pts-Xe.pts;return Ge||De}),X=y[0].dts,$=y[y.length-1].dts;var ne=Math.round(($-X)/(E-1));if(Pe<0){if(Pe<ne*-2){k.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(_.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var ve=Pe,le=0;le<E;le++)y[le].dts=ve=Math.max(ve,y[le].pts-ne),y[le].pts=Math.max(ve,y[le].pts)}else{k.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(_.toMsFromMpegTsClock)(Pe,!0)+" ms to overcome this issue");for(var ke=0;ke<E;ke++)y[ke].dts=y[ke].dts+Pe}X=y[0].dts}if(u){var Fe=X-G,Ie=Fe>ne,He=Fe<-1;if(Ie||He){Ie?k.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(Fe,!0)+" ms ("+Fe+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(_.toMsFromMpegTsClock)(-Fe,!0)+" ms ("+Fe+"dts) overlapping between fragments detected"),X=G;var $e=y[0].pts-Fe;y[0].dts=X,y[0].pts=$e,k.logger.log("Video: First PTS/DTS adjusted: "+Object(_.toMsFromMpegTsClock)($e,!0)+"/"+Object(_.toMsFromMpegTsClock)(X,!0)+", delta: "+Object(_.toMsFromMpegTsClock)(Fe,!0)+" ms")}}r&&(X=Math.max(0,X));for(var tt=0,Qe=0,Je=0;Je<E;Je++){for(var Ye=y[Je],gt=Ye.units,_t=gt.length,vt=0,dt=0;dt<_t;dt++)vt+=gt[dt].data.length;Qe+=vt,tt+=_t,Ye.length=vt,Ye.dts=Math.max(Ye.dts,X),Ye.pts=Math.max(Ye.pts,Ye.dts,0),se=Math.min(Ye.pts,se),ce=Math.max(Ye.pts,ce)}$=y[E-1].dts;var Ct=Qe+4*tt+8,xt;try{xt=new Uint8Array(Ct)}catch(pt){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ct,reason:"fail allocating video mdat "+Ct});return}var Le=new DataView(xt.buffer);Le.setUint32(0,Ct),xt.set(D.default.types.mdat,4);for(var Ce=0;Ce<E;Ce++){for(var nt=y[Ce],rt=nt.units,Be=0,et=0,xe=rt.length;et<xe;et++){var fe=rt[et],ge=fe.data,re=fe.data.byteLength;Le.setUint32(U,re),U+=4,xt.set(ge,U),U+=re,Be+=4+re}if(Ce<E-1)O=y[Ce+1].dts-nt.dts;else{var ae=this.config,de=nt.dts-y[Ce>0?Ce-1:Ce].dts;if(ae.stretchShortVideoTrack&&this.nextAudioPts!==null){var ye=Math.floor(ae.maxBufferHole*g),_e=(x?se+x*g:this.nextAudioPts)-nt.pts;_e>ye?(O=_e-de,O<0&&(O=de),k.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=de}else O=de}var je=Math.round(nt.pts-nt.dts);M.push(new A(nt.key,O,Be,je))}if(M.length&&l&&l<70){var ot=M[0].flags;ot.dependsOn=2,ot.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=$+O,this.isVideoContiguous=!0;var bt=D.default.moof(m.sequenceNumber++,X,v({},m,{samples:M})),wt="video",Et={data1:bt,data2:xt,startPTS:se/g,endPTS:(ce+O)/g,startDTS:X/g,endDTS:G/g,type:wt,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:m.dropped};return m.samples=[],m.dropped=0,console.assert(xt.length,"MDAT length must not be zero"),Et},C.remuxAudio=function(m,h,u,x,g){var y=m.inputTimeScale,M=m.samplerate?m.samplerate:y,E=y/M,j=m.isAAC?c:a,G=j*E,U=this._initPTS,O=!m.isAAC&&this.typeSupported.mpeg,X=[],$=m.samples,se=O?0:8,ce=this.nextAudioPts||-1,Pe=h*y;if(this.isAudioContiguous=u=u||$.length&&ce>0&&(x&&Math.abs(Pe-ce)<9e3||Math.abs(d($[0].pts-U,Pe)-ce)<20*G),$.forEach(function(ge){ge.pts=d(ge.pts-U,Pe)}),!u||ce<0){if($=$.filter(function(ge){return ge.pts>=0}),!$.length)return;g===0?ce=0:x?ce=Math.max(0,Pe):ce=$[0].pts}if(m.isAAC)for(var Se=g!==void 0,Re=this.config.maxAudioFramesDrift,Oe=0,Me=ce;Oe<$.length;Oe++){var be=$[Oe],ue=be.pts,ne=ue-Me,ve=Math.abs(1e3*ne/y);if(ne<=-Re*G&&Se)Oe===0&&(k.logger.warn("Audio frame @ "+(ue/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/y)+" ms."),this.nextAudioPts=ce=Me=ue);else if(ne>=Re*G&&ve<p&&Se){var le=Math.round(ne/G);Me=ue-le*G,Me<0&&(le--,Me+=G),Oe===0&&(this.nextAudioPts=ce=Me),k.logger.warn("[mp4-remuxer]: Injecting "+le+" audio frame @ "+(Me/y).toFixed(3)+"s due to "+Math.round(1e3*ne/y)+" ms gap.");for(var ke=0;ke<le;ke++){var Fe=Math.max(Me,0),Ie=B.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);Ie||(k.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ie=be.unit.subarray()),$.splice(Oe,0,{unit:Ie,pts:Fe}),Me+=G,Oe++}}be.pts=Me,Me+=G}for(var He=null,$e=null,tt,Qe=0,Je=$.length;Je--;)Qe+=$[Je].unit.byteLength;for(var Ye=0,gt=$.length;Ye<gt;Ye++){var _t=$[Ye],vt=_t.unit,dt=_t.pts;if($e!==null){var Ct=X[Ye-1];Ct.duration=Math.round((dt-$e)/E)}else if(u&&m.isAAC&&(dt=ce),He=dt,Qe>0){Qe+=se;try{tt=new Uint8Array(Qe)}catch(ge){this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:F.ErrorTypes.MUX_ERROR,details:F.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Qe,reason:"fail allocating audio mdat "+Qe});return}if(!O){var xt=new DataView(tt.buffer);xt.setUint32(0,Qe),tt.set(D.default.types.mdat,4)}}else return;tt.set(vt,se);var Le=vt.byteLength;se+=Le,X.push(new A(!0,j,Le,0)),$e=dt}var Ce=X.length;if(!Ce)return;var nt=X[X.length-1];this.nextAudioPts=ce=$e+E*nt.duration;var rt=O?new Uint8Array(0):D.default.moof(m.sequenceNumber++,He/E,v({},m,{samples:X}));m.samples=[];var Be=He/y,et=ce/y,xe="audio",fe={data1:rt,data2:tt,startPTS:Be,endPTS:et,startDTS:Be,endDTS:et,type:xe,hasAudio:!0,hasVideo:!1,nb:Ce};return this.isAudioContiguous=!0,console.assert(tt.length,"MDAT length must not be zero"),fe},C.remuxEmptyAudio=function(m,h,u,x){var g=m.inputTimeScale,y=m.samplerate?m.samplerate:g,M=g/y,E=this.nextAudioPts,j=(E!==null?E:x.startDTS*g)+this._initDTS,G=x.endDTS*g+this._initDTS,U=M*c,O=Math.ceil((G-j)/U),X=B.default.getSilentFrame(m.manifestCodec||m.codec,m.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!X){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var $=[],se=0;se<O;se++){var ce=j+se*U;$.push({unit:X,pts:ce,dts:ce})}return m.samples=$,this.remuxAudio(m,h,u,!1)},C.remuxID3=function(m,h){var u=m.samples.length;if(!u)return;for(var x=m.inputTimeScale,g=this._initPTS,y=this._initDTS,M=0;M<u;M++){var E=m.samples[M];E.pts=d(E.pts-g,h*x)/x,E.dts=d(E.dts-y,h*x)/x}var j=m.samples;return m.samples=[],{samples:j}},C.remuxText=function(m,h){var u=m.samples.length;if(!u)return;for(var x=m.inputTimeScale,g=this._initPTS,y=0;y<u;y++){var M=m.samples[y];M.pts=d(M.pts-g,h*x)/x}m.samples.sort(function(j,G){return j.pts-G.pts});var E=m.samples;return m.samples=[],{samples:E}},w}();function d(w,C){var b;if(C===null)return w;for(C<w?b=-8589934592:b=8589934592;Math.abs(w-C)>4294967296;)w+=b;return w}function R(w){for(var C=0;C<w.length;C++)if(w[C].key)return C;return-1}var A=function(C,b,m,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=m,this.cts=h,this.flags=new T(C)},T=function(C){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=C?2:1,this.isNonSync=C?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/polyfills/number.ts"),B=N("./src/utils/mp4-tools.ts"),D=N("./src/loader/fragment.ts"),H=N("./src/utils/logger.ts"),F=function(){function _(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var v=_.prototype;return v.destroy=function(){},v.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},v.resetNextTimestamp=function(){this.lastEndDTS=null},v.resetInitSegment=function(c,a,l){this.audioCodec=a,this.videoCodec=l,this.generateInitSegment(c),this.emitInitSegment=!0},v.generateInitSegment=function(c){var a=this.audioCodec,l=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=Object(B.parseInitSegment)(c);a||(a=I(o.audio,D.ElementaryStreamTypes.AUDIO)),l||(l=I(o.video,D.ElementaryStreamTypes.VIDEO));var r={};o.audio&&o.video?r.audiovideo={container:"video/mp4",codec:a+","+l,initSegment:c,id:"main"}:o.audio?r.audio={container:"audio/mp4",codec:a,initSegment:c,id:"audio"}:o.video?r.video={container:"video/mp4",codec:l,initSegment:c,id:"main"}:H.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},v.remux=function(c,a,l,o,r){var s=this.initPTS,d=this.lastEndDTS,R={audio:void 0,video:void 0,text:o,id3:l,initSegment:void 0};Object(J.isFiniteNumber)(d)||(d=this.lastEndDTS=r||0);var A=a.samples;if(!A||!A.length)return R;var T={initPTS:void 0,timescale:1},w=this.initData;if((!w||!w.length)&&(this.generateInitSegment(A),w=this.initData),!w||!w.length)return H.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(J.isFiniteNumber)(s)||(this.initPTS=T.initPTS=s=k(w,A,d));var C=Object(B.getDuration)(A,w),b=d,m=C+b;Object(B.offsetStartDTS)(w,A,s),C>0?this.lastEndDTS=m:(H.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!w.audio,u=!!w.video,x="";h&&(x+="audio"),u&&(x+="video");var g={data1:A,startPTS:b,startDTS:b,endPTS:m,endDTS:m,type:x,hasAudio:h,hasVideo:u,nb:1,dropped:0};return R.audio=g.type==="audio"?g:void 0,R.video=g.type!=="audio"?g:void 0,R.text=o,R.id3=l,R.initSegment=T,R},_}(),k=function(v,p,c){return Object(B.getStartDTS)(v,p)-c};function I(_,v){var p=_==null?void 0:_.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||v===D.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=F},"./src/task-loop.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return J});var J=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var D=B.prototype;return D.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},D.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},D.onHandlerDestroyed=function(){},D.hasInterval=function(){return!!this._tickInterval},D.hasNextTick=function(){return!!this._tickTimer},D.setInterval=function(F){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,F),!0)},D.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},D.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},D.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},D.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},D.doTick=function(){},B}()},"./src/types/cmcd.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"CMCDVersion",function(){return J}),N.d(Q,"CMCDObjectType",function(){return B}),N.d(Q,"CMCDStreamingFormat",function(){return D}),N.d(Q,"CMCDStreamType",function(){return H});var J=1,B;(function(F){F.MANIFEST="m",F.AUDIO="a",F.VIDEO="v",F.MUXED="av",F.INIT="i",F.CAPTION="c",F.TIMED_TEXT="tt",F.KEY="k",F.OTHER="o"})(B||(B={}));var D;(function(F){F.DASH="d",F.HLS="h",F.SMOOTH="s",F.OTHER="o"})(D||(D={}));var H;(function(F){F.VOD="v",F.LIVE="l"})(H||(H={}))},"./src/types/level.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"HlsSkip",function(){return D}),N.d(Q,"getSkipValue",function(){return H}),N.d(Q,"HlsUrlParameters",function(){return F}),N.d(Q,"Level",function(){return k});function J(I,_){for(var v=0;v<_.length;v++){var p=_[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(I,p.key,p)}}function B(I,_,v){return _&&J(I.prototype,_),v&&J(I,v),I}var D;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(D||(D={}));function H(I,_){var v=I.canSkipUntil,p=I.canSkipDateRanges,c=I.endSN,a=_!==void 0?_-c:0;return v&&a<v?p?D.v2:D.Yes:D.No}var F=function(){function I(v,p,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=v,this.part=p,this.skip=c}var _=I.prototype;return _.addDirectives=function(p){var c=new self.URL(p);return this.msn!==void 0&&c.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&c.searchParams.set("_HLS_part",this.part.toString()),this.skip&&c.searchParams.set("_HLS_skip",this.skip),c.toString()},I}(),k=function(){function I(_){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=[_.url],this.attrs=_.attrs,this.bitrate=_.bitrate,_.details&&(this.details=_.details),this.id=_.id||0,this.name=_.name,this.width=_.width||0,this.height=_.height||0,this.audioCodec=_.audioCodec,this.videoCodec=_.videoCodec,this.unknownCodecs=_.unknownCodecs,this.codecSet=[_.videoCodec,_.audioCodec].filter(function(v){return v}).join(",").replace(/\.[^.,]+/g,"")}return B(I,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(v){var p=v%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),I}()},"./src/types/loader.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"PlaylistContextType",function(){return J}),N.d(Q,"PlaylistLevelType",function(){return B});var J;(function(D){D.MANIFEST="manifest",D.LEVEL="level",D.AUDIO_TRACK="audioTrack",D.SUBTITLE_TRACK="subtitleTrack"})(J||(J={}));var B;(function(D){D.MAIN="main",D.AUDIO="audio",D.SUBTITLE="subtitle"})(B||(B={}))},"./src/types/transmuxer.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"ChunkMetadata",function(){return J});var J=function(H,F,k,I,_,v){I===void 0&&(I=0),_===void 0&&(_=-1),v===void 0&&(v=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=B(),this.buffering={audio:B(),video:B(),audiovideo:B()},this.level=H,this.sn=F,this.id=k,this.size=I,this.part=_,this.partial=v};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"AttrList",function(){return D});var J=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,D=function(){function H(k){typeof k=="string"&&(k=H.parseAttrList(k));for(var I in k)k.hasOwnProperty(I)&&(this[I]=k[I])}var F=H.prototype;return F.decimalInteger=function(I){var _=parseInt(this[I],10);return _>Number.MAX_SAFE_INTEGER?Infinity:_},F.hexadecimalInteger=function(I){if(this[I]){var _=(this[I]||"0x").slice(2);_=(_.length&1?"0":"")+_;for(var v=new Uint8Array(_.length/2),p=0;p<_.length/2;p++)v[p]=parseInt(_.slice(p*2,p*2+2),16);return v}else return null},F.hexadecimalIntegerAsNumber=function(I){var _=parseInt(this[I],16);return _>Number.MAX_SAFE_INTEGER?Infinity:_},F.decimalFloatingPoint=function(I){return parseFloat(this[I])},F.optionalFloat=function(I,_){var v=this[I];return v?parseFloat(v):_},F.enumeratedString=function(I){return this[I]},F.bool=function(I){return this[I]==="YES"},F.decimalResolution=function(I){var _=J.exec(this[I]);return _===null?void 0:{width:parseInt(_[1],10),height:parseInt(_[2],10)}},H.parseAttrList=function(I){var _,v={},p='"';for(B.lastIndex=0;(_=B.exec(I))!==null;){var c=_[2];c.indexOf(p)===0&&c.lastIndexOf(p)===c.length-1&&(c=c.slice(1,-1)),v[_[1]]=c}return v},H}()},"./src/utils/binary-search.ts":function(te,Q,N){"use strict";N.r(Q);var J={search:function(D,H){for(var F=0,k=D.length-1,I=null,_=null;F<=k;){I=(F+k)/2|0,_=D[I];var v=H(_);if(v>0)F=I+1;else if(v<0)k=I-1;else return _}return null}};Q.default=J},"./src/utils/buffer-helper.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"BufferHelper",function(){return D});var J=N("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},D=function(){function H(){}return H.isBuffered=function(k,I){try{if(k){for(var _=H.getBuffered(k),v=0;v<_.length;v++)if(I>=_.start(v)&&I<=_.end(v))return!0}}catch(p){}return!1},H.bufferInfo=function(k,I,_){try{if(k){var v=H.getBuffered(k),p=[],c;for(c=0;c<v.length;c++)p.push({start:v.start(c),end:v.end(c)});return this.bufferedInfo(p,I,_)}}catch(a){}return{len:0,start:I,end:I,nextStart:void 0}},H.bufferedInfo=function(k,I,_){I=Math.max(0,I),k.sort(function(T,w){var C=T.start-w.start;return C||w.end-T.end});var v=[];if(_)for(var p=0;p<k.length;p++){var c=v.length;if(c){var a=v[c-1].end;k[p].start-a<_?k[p].end>a&&(v[c-1].end=k[p].end):v.push(k[p])}else v.push(k[p])}else v=k;for(var l=0,o,r=I,s=I,d=0;d<v.length;d++){var R=v[d].start,A=v[d].end;if(I+_>=R&&I<A)r=R,s=A,l=s-I;else if(I+_<R){o=R;break}}return{len:l,start:r||0,end:s||0,nextStart:o}},H.getBuffered=function(k){try{return k.buffered}catch(I){return J.logger.log("failed to get media.buffered",I),B}},H}()},"./src/utils/cea-608-parser.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"Row",function(){return s}),N.d(Q,"CaptionScreen",function(){return d});var J=N("./src/utils/logger.ts"),B={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},D=function(m){var h=m;return B.hasOwnProperty(m)&&(h=B[m]),String.fromCharCode(h)},H=15,F=100,k={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},I={17:2,18:4,21:6,22:8,23:10,19:13,20:15},_={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},v={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(c||(c={}));var a=function(){function b(){this.time=null,this.verboseLevel=c.ERROR}var m=b.prototype;return m.log=function(u,x){this.verboseLevel>=u&&J.logger.log(this.time+" ["+u+"] "+x)},b}(),l=function(m){for(var h=[],u=0;u<m.length;u++)h.push(m[u].toString(16));return h},o=function(){function b(h,u,x,g,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=u||!1,this.italics=x||!1,this.background=g||"black",this.flash=y||!1}var m=b.prototype;return m.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},m.setStyles=function(u){for(var x=["foreground","underline","italics","background","flash"],g=0;g<x.length;g++){var y=x[g];u.hasOwnProperty(y)&&(this[y]=u[y])}},m.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},m.equals=function(u){return this.foreground===u.foreground&&this.underline===u.underline&&this.italics===u.italics&&this.background===u.background&&this.flash===u.flash},m.copy=function(u){this.foreground=u.foreground,this.underline=u.underline,this.italics=u.italics,this.background=u.background,this.flash=u.flash},m.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),r=function(){function b(h,u,x,g,y,M){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new o(u,x,g,y,M)}var m=b.prototype;return m.reset=function(){this.uchar=" ",this.penState.reset()},m.setChar=function(u,x){this.uchar=u,this.penState.copy(x)},m.setPenState=function(u){this.penState.copy(u)},m.equals=function(u){return this.uchar===u.uchar&&this.penState.equals(u.penState)},m.copy=function(u){this.uchar=u.uchar,this.penState.copy(u.penState)},m.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),s=function(){function b(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var u=0;u<F;u++)this.chars.push(new r);this.logger=h,this.pos=0,this.currPenState=new o}var m=b.prototype;return m.equals=function(u){for(var x=!0,g=0;g<F;g++)if(!this.chars[g].equals(u.chars[g])){x=!1;break}return x},m.copy=function(u){for(var x=0;x<F;x++)this.chars[x].copy(u.chars[x])},m.isEmpty=function(){for(var u=!0,x=0;x<F;x++)if(!this.chars[x].isEmpty()){u=!1;break}return u},m.setCursor=function(u){this.pos!==u&&(this.pos=u),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>F&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=F)},m.moveCursor=function(u){var x=this.pos+u;if(u>1)for(var g=this.pos+1;g<x+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(x)},m.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},m.insertChar=function(u){u>=144&&this.backSpace();var x=D(u);if(this.pos>=F){this.logger.log(c.ERROR,"Cannot insert "+u.toString(16)+" ("+x+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(x,this.currPenState),this.moveCursor(1)},m.clearFromPos=function(u){var x;for(x=u;x<F;x++)this.chars[x].reset()},m.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},m.clearToEndOfRow=function(){this.clearFromPos(this.pos)},m.getTextString=function(){for(var u=[],x=!0,g=0;g<F;g++){var y=this.chars[g].uchar;y!==" "&&(x=!1),u.push(y)}return x?"":u.join("")},m.setPenStyles=function(u){this.currPenState.setStyles(u);var x=this.chars[this.pos];x.setPenState(this.currPenState)},b}(),d=function(){function b(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var u=0;u<H;u++)this.rows.push(new s(h));this.logger=h,this.currRow=H-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var m=b.prototype;return m.reset=function(){for(var u=0;u<H;u++)this.rows[u].clear();this.currRow=H-1},m.equals=function(u){for(var x=!0,g=0;g<H;g++)if(!this.rows[g].equals(u.rows[g])){x=!1;break}return x},m.copy=function(u){for(var x=0;x<H;x++)this.rows[x].copy(u.rows[x])},m.isEmpty=function(){for(var u=!0,x=0;x<H;x++)if(!this.rows[x].isEmpty()){u=!1;break}return u},m.backSpace=function(){var u=this.rows[this.currRow];u.backSpace()},m.clearToEndOfRow=function(){var u=this.rows[this.currRow];u.clearToEndOfRow()},m.insertChar=function(u){var x=this.rows[this.currRow];x.insertChar(u)},m.setPen=function(u){var x=this.rows[this.currRow];x.setPenStyles(u)},m.moveCursor=function(u){var x=this.rows[this.currRow];x.moveCursor(u)},m.setCursor=function(u){this.logger.log(c.INFO,"setCursor: "+u);var x=this.rows[this.currRow];x.setCursor(u)},m.setPAC=function(u){this.logger.log(c.INFO,"pacData = "+JSON.stringify(u));var x=u.row-1;if(this.nrRollUpRows&&x<this.nrRollUpRows-1&&(x=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==x){for(var g=0;g<H;g++)this.rows[g].clear();var y=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var E=M.rows[y].cueStartTime,j=this.logger.time;if(E&&j!==null&&E<j)for(var G=0;G<this.nrRollUpRows;G++)this.rows[x-this.nrRollUpRows+G+1].copy(M.rows[y+G])}}this.currRow=x;var U=this.rows[this.currRow];if(u.indent!==null){var O=u.indent,X=Math.max(O-1,0);U.setCursor(u.indent),u.color=U.chars[X].penState.foreground}var $={foreground:u.color,underline:u.underline,italics:u.italics,background:"black",flash:!1};this.setPen($)},m.setBkgData=function(u){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(u)),this.backSpace(),this.setPen(u),this.insertChar(32)},m.setRollUpRows=function(u){this.nrRollUpRows=u},m.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(c.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(c.TEXT,this.getDisplayText());var u=this.currRow+1-this.nrRollUpRows,x=this.rows.splice(u,1)[0];x.clear(),this.rows.splice(this.currRow,0,x),this.logger.log(c.INFO,"Rolling up")},m.getDisplayText=function(u){u=u||!1;for(var x=[],g="",y=-1,M=0;M<H;M++){var E=this.rows[M].getTextString();E&&(y=M+1,u?x.push("Row "+y+": '"+E+"'"):x.push(E.trim()))}return x.length>0&&(u?g="["+x.join(" | ")+"]":g=x.join(`
`)),g},m.getTextAndFormat=function(){return this.rows},b}(),R=function(){function b(h,u,x){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=h,this.outputFilter=u,this.mode=null,this.verbose=0,this.displayedMemory=new d(x),this.nonDisplayedMemory=new d(x),this.lastOutputScreen=new d(x),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=x}var m=b.prototype;return m.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[H-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},m.getHandler=function(){return this.outputFilter},m.setHandler=function(u){this.outputFilter=u},m.setPAC=function(u){this.writeScreen.setPAC(u)},m.setBkgData=function(u){this.writeScreen.setBkgData(u)},m.setMode=function(u){if(u===this.mode)return;this.mode=u,this.logger.log(c.INFO,"MODE="+u),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=u},m.insertChars=function(u){for(var x=0;x<u.length;x++)this.writeScreen.insertChar(u[x]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(c.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},m.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},m.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},m.ccAOF=function(){},m.ccAON=function(){},m.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},m.ccRU=function(u){this.logger.log(c.INFO,"RU("+u+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(u)},m.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},m.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},m.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},m.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},m.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},m.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},m.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},m.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var u=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=u,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},m.ccTO=function(u){this.logger.log(c.INFO,"TO("+u+") - Tab Offset"),this.writeScreen.moveCursor(u)},m.ccMIDROW=function(u){var x={flash:!1};if(x.underline=u%2===1,x.italics=u>=46,x.italics)x.foreground="white";else{var g=Math.floor(u/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];x.foreground=y[g]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(x)),this.writeScreen.setPen(x)},m.outputDataUpdate=function(u){u===void 0&&(u=!1);var x=this.logger.time;if(x===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=x:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,x,this.lastOutputScreen),u&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:x),this.lastOutputScreen.copy(this.displayedMemory))},m.cueSplitAtTime=function(u){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,u,this.displayedMemory),this.cueStartTime=u))},b}(),A=function(){function b(h,u,x){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new a;this.channels=[null,new R(h,u,g),new R(h+1,x,g)],this.cmdHistory=C(),this.logger=g}var m=b.prototype;return m.getHandler=function(u){return this.channels[u].getHandler()},m.setHandler=function(u,x){this.channels[u].setHandler(x)},m.addData=function(u,x){var g,y,M,E=!1;this.logger.time=u;for(var j=0;j<x.length;j+=2){if(y=x[j]&127,M=x[j+1]&127,y===0&&M===0)continue;if(this.logger.log(c.DATA,"["+l([x[j],x[j+1]])+"] -> ("+l([y,M])+")"),g=this.parseCmd(y,M),g||(g=this.parseMidrow(y,M)),g||(g=this.parsePAC(y,M)),g||(g=this.parseBackgroundAttributes(y,M)),!g&&(E=this.parseChars(y,M),E)){var G=this.currentChannel;if(G&&G>0){var U=this.channels[G];U.insertChars(E)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!E&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+l([y,M])+" orig: "+l([x[j],x[j+1]]))}},m.parseCmd=function(u,x){var g=this.cmdHistory,y=(u===20||u===28||u===21||u===29)&&x>=32&&x<=47,M=(u===23||u===31)&&x>=33&&x<=35;if(!(y||M))return!1;if(w(u,x,g))return T(null,null,g),this.logger.log(c.DEBUG,"Repeated command ("+l([u,x])+") is dropped"),!0;var E=u===20||u===21||u===23?1:2,j=this.channels[E];return u===20||u===21||u===28||u===29?x===32?j.ccRCL():x===33?j.ccBS():x===34?j.ccAOF():x===35?j.ccAON():x===36?j.ccDER():x===37?j.ccRU(2):x===38?j.ccRU(3):x===39?j.ccRU(4):x===40?j.ccFON():x===41?j.ccRDC():x===42?j.ccTR():x===43?j.ccRTD():x===44?j.ccEDM():x===45?j.ccCR():x===46?j.ccENM():x===47&&j.ccEOC():j.ccTO(x-32),T(u,x,g),this.currentChannel=E,!0},m.parseMidrow=function(u,x){var g=0;if((u===17||u===25)&&x>=32&&x<=47){if(u===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[g];return y?(y.ccMIDROW(x),this.logger.log(c.DEBUG,"MIDROW ("+l([u,x])+")"),!0):!1}return!1},m.parsePAC=function(u,x){var g,y=this.cmdHistory,M=(u>=17&&u<=23||u>=25&&u<=31)&&x>=64&&x<=127,E=(u===16||u===24)&&x>=64&&x<=95;if(!(M||E))return!1;if(w(u,x,y))return T(null,null,y),!0;var j=u<=23?1:2;x>=64&&x<=95?g=j===1?k[u]:_[u]:g=j===1?I[u]:v[u];var G=this.channels[j];return G?(G.setPAC(this.interpretPAC(g,x)),T(u,x,y),this.currentChannel=j,!0):!1},m.interpretPAC=function(u,x){var g,y={color:null,italics:!1,indent:null,underline:!1,row:u};return x>95?g=x-96:g=x-64,y.underline=(g&1)===1,g<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((g-16)/2)*4,y},m.parseChars=function(u,x){var g,y=null,M=null;if(u>=25?(g=2,M=u-8):(g=1,M=u),M>=17&&M<=19){var E;M===17?E=x+80:M===18?E=x+112:E=x+144,this.logger.log(c.INFO,"Special char '"+D(E)+"' in channel "+g),y=[E]}else u>=32&&u<=127&&(y=x===0?[u]:[u,x]);if(y){var j=l(y);this.logger.log(c.DEBUG,"Char codes = "+j.join(",")),T(u,x,this.cmdHistory)}return y},m.parseBackgroundAttributes=function(u,x){var g=(u===16||u===24)&&x>=32&&x<=47,y=(u===23||u===31)&&x>=45&&x<=47;if(!(g||y))return!1;var M,E={};u===16||u===24?(M=Math.floor((x-32)/2),E.background=p[M],x%2===1&&(E.background=E.background+"_semi")):x===45?E.background="transparent":(E.foreground="black",x===47&&(E.underline=!0));var j=u<=23?1:2,G=this.channels[j];return G.setBkgData(E),T(u,x,this.cmdHistory),!0},m.reset=function(){for(var u=0;u<Object.keys(this.channels).length;u++){var x=this.channels[u];x&&x.reset()}this.cmdHistory=C()},m.cueSplitAtTime=function(u){for(var x=0;x<this.channels.length;x++){var g=this.channels[x];g&&g.cueSplitAtTime(u)}},b}();function T(b,m,h){h.a=b,h.b=m}function w(b,m,h){return h.a===b&&h.b===m}function C(){return{a:null,b:null}}Q.default=A},"./src/utils/codecs.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"isCodecType",function(){return B}),N.d(Q,"isCodecSupportedInMp4",function(){return D});var J={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 B(H,F){var k=J[F];return!!k&&k[H.slice(0,4)]===!0}function D(H,F){return MediaSource.isTypeSupported((F||"video")+'/mp4;codecs="'+H+'"')}},"./src/utils/cues.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/utils/vttparser.ts"),B=N("./src/utils/webvtt-parser.ts"),D=N("./src/utils/texttrack-utils.ts"),H=/\s/,F={newCue:function(I,_,v,p){for(var c=[],a,l,o,r,s,d=self.VTTCue||self.TextTrackCue,R=0;R<p.rows.length;R++)if(a=p.rows[R],o=!0,r=0,s="",!a.isEmpty()){for(var A=0;A<a.chars.length;A++)H.test(a.chars[A].uchar)&&o?r++:(s+=a.chars[A].uchar,o=!1);a.cueStartTime=_,_===v&&(v+=1e-4),r>=16?r--:r++;var T=Object(J.fixLineBreaks)(s.trim()),w=Object(B.generateCueId)(_,v,T);(!I||!I.cues||!I.cues.getCueById(w))&&(l=new d(_,v,T),l.id=w,l.line=R+1,l.align="left",l.position=10+Math.min(80,Math.floor(r*8/32)*10),c.push(l))}return I&&c.length&&(c.sort(function(C,b){return C.line==="auto"||b.line==="auto"?0:C.line>8&&b.line>8?b.line-C.line:C.line-b.line}),c.forEach(function(C){return Object(D.addCueToTrack)(I,C)})),c}};Q.default=F},"./src/utils/discontinuities.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"findFirstFragWithCC",function(){return H}),N.d(Q,"shouldAlignOnDiscontinuities",function(){return F}),N.d(Q,"findDiscontinuousReferenceFrag",function(){return k}),N.d(Q,"adjustSlidingStart",function(){return _}),N.d(Q,"alignStream",function(){return v}),N.d(Q,"alignPDT",function(){return c}),N.d(Q,"alignFragmentByPDTDelta",function(){return a}),N.d(Q,"alignMediaPlaylistByPDT",function(){return l});var J=N("./src/polyfills/number.ts"),B=N("./src/utils/logger.ts"),D=N("./src/controller/level-helper.ts");function H(o,r){for(var s=null,d=0,R=o.length;d<R;d++){var A=o[d];if(A&&A.cc===r){s=A;break}}return s}function F(o,r,s){return!!(r.details&&(s.endCC>s.startCC||o&&o.cc<s.startCC))}function k(o,r){var s=o.fragments,d=r.fragments;if(!d.length||!s.length){B.logger.log("No fragments to align");return}var R=H(s,d[0].cc);if(!R||R&&!R.startPTS){B.logger.log("No frag in previous level to align on");return}return R}function I(o,r){if(o){var s=o.start+r;o.start=o.startPTS=s,o.endPTS=s+o.duration}}function _(o,r){for(var s=r.fragments,d=0,R=s.length;d<R;d++)I(s[d],o);r.fragmentHint&&I(r.fragmentHint,o),r.alignedSliding=!0}function v(o,r,s){if(!r)return;p(o,s,r),!s.alignedSliding&&r.details&&c(s,r.details),!s.alignedSliding&&r.details&&!s.skippedSegments&&Object(D.adjustSliding)(r.details,s)}function p(o,r,s){if(F(o,s,r)){var d=k(s.details,r);d&&Object(J.isFiniteNumber)(d.start)&&(B.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),_(d.start,r))}}function c(o,r){if(!r.fragments.length||!o.hasProgramDateTime||!r.hasProgramDateTime)return;var s=r.fragments[0].programDateTime,d=o.fragments[0].programDateTime,R=(d-s)/1e3+r.fragments[0].start;R&&Object(J.isFiniteNumber)(R)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(d-s)+"ms, sliding:"+R.toFixed(3)+" "+o.url+" "),_(R,o))}function a(o,r){var s=o.programDateTime;if(!s)return;var d=(s-r)/1e3;o.start=o.startPTS=d,o.endPTS=d+o.duration}function l(o,r){if(!r.fragments.length||!o.hasProgramDateTime||!r.hasProgramDateTime)return;var s=r.fragments[0].programDateTime,d=r.fragments[0].start,R=s-d*1e3;o.fragments.forEach(function(A){a(A,R)}),o.fragmentHint&&a(o.fragmentHint,R),o.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/utils/ewma.ts"),B=function(){function D(F,k,I){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=I,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new J.default(F),this.fast_=new J.default(k)}var H=D.prototype;return H.update=function(k,I){var _=this.slow_,v=this.fast_;this.slow_.halfLife!==k&&(this.slow_=new J.default(k,_.getEstimate(),_.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new J.default(I,v.getEstimate(),v.getTotalWeight()))},H.sample=function(k,I){k=Math.max(k,this.minDelayMs_);var _=8*I,v=k/1e3,p=_/v;this.fast_.sample(v,p),this.slow_.sample(v,p)},H.canEstimate=function(){var k=this.fast_;return k&&k.getTotalWeight()>=this.minWeight_},H.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},H.destroy=function(){},D}();Q.default=B},"./src/utils/ewma.ts":function(te,Q,N){"use strict";N.r(Q);var J=function(){function B(H,F,k){F===void 0&&(F=0),k===void 0&&(k=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=H,this.alpha_=H?Math.exp(Math.log(.5)/H):0,this.estimate_=F,this.totalWeight_=k}var D=B.prototype;return D.sample=function(F,k){var I=Math.pow(this.alpha_,F);this.estimate_=k*(1-I)+I*this.estimate_,this.totalWeight_+=F},D.getTotalWeight=function(){return this.totalWeight_},D.getEstimate=function(){if(this.alpha_){var F=1-Math.pow(this.alpha_,this.totalWeight_);if(F)return this.estimate_/F}return this.estimate_},B}();Q.default=J},"./src/utils/fetch-loader.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"fetchSupported",function(){return a});var J=N("./src/polyfills/number.ts"),B=N("./src/loader/load-stats.ts"),D=N("./src/demux/chunk-cache.ts");function H(d,R){d.prototype=Object.create(R.prototype),d.prototype.constructor=d,v(d,R)}function F(d){var R=typeof Map=="function"?new Map:void 0;return F=function(T){if(T===null||!_(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(T))return R.get(T);R.set(T,w)}function w(){return k(T,arguments,p(this).constructor)}return w.prototype=Object.create(T.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),v(w,T)},F(d)}function k(d,R,A){return I()?k=Reflect.construct:k=function(w,C,b){var m=[null];m.push.apply(m,C);var h=Function.bind.apply(w,m),u=new h;return b&&v(u,b.prototype),u},k.apply(null,arguments)}function I(){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(d){return!1}}function _(d){return Function.toString.call(d).indexOf("[native code]")!==-1}function v(d,R){return v=Object.setPrototypeOf||function(T,w){return T.__proto__=w,T},v(d,R)}function p(d){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},p(d)}function c(){return c=Object.assign||function(d){for(var R=1;R<arguments.length;R++){var A=arguments[R];for(var T in A)Object.prototype.hasOwnProperty.call(A,T)&&(d[T]=A[T])}return d},c.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(d){}return!1}var l=function(){function d(A){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=A.fetchSetup||r,this.controller=new self.AbortController,this.stats=new B.LoadStats}var R=d.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(T,w,C){var b=this,m=this.stats;if(m.loading.start)throw new Error("Loader can only be used once.");m.loading.start=self.performance.now();var h=o(T,this.controller.signal),u=C.onProgress,x=T.responseType==="arraybuffer",g=x?"byteLength":"length";this.context=T,this.config=w,this.callbacks=C,this.request=this.fetchSetup(T,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),C.onTimeout(m,T,b.response)},w.timeout),self.fetch(this.request).then(function(y){if(b.response=b.loader=y,!y.ok){var M=y.status,E=y.statusText;throw new s(E||"fetch, bad network response",M,y)}return m.loading.first=Math.max(self.performance.now(),m.loading.start),m.total=parseInt(y.headers.get("Content-Length")||"0"),u&&Object(J.isFiniteNumber)(w.highWaterMark)?b.loadProgressively(y,m,T,w.highWaterMark,u):x?y.arrayBuffer():y.text()}).then(function(y){var M=b.response;self.clearTimeout(b.requestTimeout),m.loading.end=Math.max(self.performance.now(),m.loading.first),m.loaded=m.total=y[g];var E={url:M.url,data:y};u&&!Object(J.isFiniteNumber)(w.highWaterMark)&&u(m,T,y,M),C.onSuccess(E,m,T,M)}).catch(function(y){if(self.clearTimeout(b.requestTimeout),m.aborted)return;var M=y.code||0;C.onError({code:M,text:y.message},T,y.details)})},R.getCacheAge=function(){var T=null;if(this.response){var w=this.response.headers.get("age");T=w?parseFloat(w):null}return T},R.loadProgressively=function(T,w,C,b,m){b===void 0&&(b=0);var h=new D.default,u=T.body.getReader(),x=function g(){return u.read().then(function(y){if(y.done)return h.dataLength&&m(w,C,h.flush(),T),Promise.resolve(new ArrayBuffer(0));var M=y.value,E=M.length;return w.loaded+=E,E<b||h.dataLength?(h.push(M),h.dataLength>=b&&m(w,C,h.flush(),T)):m(w,C,M,T),g()}).catch(function(){return Promise.reject()})};return x()},d}();function o(d,R){var A={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(c({},d.headers))};return d.rangeEnd&&A.headers.set("Range","bytes="+d.rangeStart+"-"+String(d.rangeEnd-1)),A}function r(d,R){return new self.Request(d.url,R)}var s=function(d){H(R,d);function R(A,T,w){var C;return C=d.call(this,A)||this,C.code=void 0,C.details=void 0,C.code=T,C.details=w,C}return R}(F(Error));Q.default=l},"./src/utils/imsc1-ttml-parser.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"IMSC1_CODEC",function(){return _}),N.d(Q,"parseIMSC1",function(){return a});var J=N("./src/utils/mp4-tools.ts"),B=N("./src/utils/vttparser.ts"),D=N("./src/utils/vttcue.ts"),H=N("./src/demux/id3.ts"),F=N("./src/utils/timescale-conversion.ts"),k=N("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(b){for(var m=1;m<arguments.length;m++){var h=arguments[m];for(var u in h)Object.prototype.hasOwnProperty.call(h,u)&&(b[u]=h[u])}return b},I.apply(this,arguments)}var _="stpp.ttml.im1t",v=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(b,m,h,u,x){var g=Object(J.findBox)(new Uint8Array(b),["mdat"]);if(g.length===0){x(new Error("Could not parse IMSC1 mdat"));return}var y=g[0],M=Object(H.utf8ArrayToStr)(new Uint8Array(b,y.start,y.end-y.start)),E=Object(F.toTimescaleFromScale)(m,1,h);try{u(l(M,E))}catch(j){x(j)}}function l(b,m){var h=new DOMParser,u=h.parseFromString(b,"text/xml"),x=u.getElementsByTagName("tt")[0];if(!x)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(g).reduce(function(U,O){return U[O]=x.getAttribute("ttp:"+O)||g[O],U},{}),M=x.getAttribute("xml:space")!=="preserve",E=r(o(x,"styling","style")),j=r(o(x,"layout","region")),G=o(x,"body","[begin]");return[].map.call(G,function(U){var O=s(U,M);if(!O||!U.hasAttribute("begin"))return null;var X=T(U.getAttribute("begin"),y),$=T(U.getAttribute("dur"),y),se=T(U.getAttribute("end"),y);if(X===null)throw A(U);if(se===null){if($===null)throw A(U);se=X+$}var ce=new D.default(X-m,se-m,O);ce.id=Object(k.generateCueId)(ce.startTime,ce.endTime,ce.text);var Pe=j[U.getAttribute("region")],Se=E[U.getAttribute("style")];ce.position=10,ce.size=80;var Re=d(Pe,Se),Oe=Re.textAlign;if(Oe){var Me=c[Oe];Me&&(ce.lineAlign=Me),ce.align=Oe}return I(ce,Re),ce}).filter(function(U){return U!==null})}function o(b,m,h){var u=b.getElementsByTagName(m)[0];return u?[].slice.call(u.querySelectorAll(h)):[]}function r(b){return b.reduce(function(m,h){var u=h.getAttribute("xml:id");return u&&(m[u]=h),m},{})}function s(b,m){return[].slice.call(b.childNodes).reduce(function(h,u,x){var g;return u.nodeName==="br"&&x?h+`
`:(g=u.childNodes)!==null&&g!==void 0&&g.length?s(u,m):m?h+u.textContent.trim().replace(/\s+/g," "):h+u.textContent},"")}function d(b,m){var h="http://www.w3.org/ns/ttml#styling",u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return u.reduce(function(x,g){var y=R(m,h,g)||R(b,h,g);return y&&(x[g]=y),x},{})}function R(b,m,h){return b.hasAttributeNS(m,h)?b.getAttributeNS(m,h):null}function A(b){return new Error("Could not parse ttml timestamp "+b)}function T(b,m){if(!b)return null;var h=Object(B.parseTimeStamp)(b);return h===null&&(v.test(b)?h=w(b,m):p.test(b)&&(h=C(b,m))),h}function w(b,m){var h=v.exec(b),u=(h[4]|0)+(h[5]|0)/m.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+u/m.frameRate}function C(b,m){var h=p.exec(b),u=Number(h[1]),x=h[2];switch(x){case"h":return u*3600;case"m":return u*60;case"ms":return u*1e3;case"f":return u/m.frameRate;case"t":return u/m.tickRate}return u}},"./src/utils/logger.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"enableLogs",function(){return k}),N.d(Q,"logger",function(){return I});var J=function(){},B={trace:J,debug:J,log:J,warn:J,info:J,error:J},D=B;function H(_){var v=self.console[_];return v?v.bind(self.console,"["+_+"] >"):J}function F(_){for(var v=arguments.length,p=new Array(v>1?v-1:0),c=1;c<v;c++)p[c-1]=arguments[c];p.forEach(function(a){D[a]=_[a]?_[a].bind(_):H(a)})}function k(_){if(self.console&&_===!0||typeof _=="object"){F(_,"debug","log","info","warn","error");try{D.log()}catch(v){D=B}}else D=B}var I=D},"./src/utils/mediakeys-helper.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"KeySystems",function(){return J}),N.d(Q,"requestMediaKeySystemAccess",function(){return B});var J;(function(D){D.WIDEVINE="com.widevine.alpha",D.PLAYREADY="com.microsoft.playready"})(J||(J={}));var B=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"getMediaSource",function(){return J});function J(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"bin2str",function(){return F}),N.d(Q,"readUint16",function(){return k}),N.d(Q,"readUint32",function(){return I}),N.d(Q,"writeUint32",function(){return _}),N.d(Q,"findBox",function(){return v}),N.d(Q,"parseSegmentIndex",function(){return p}),N.d(Q,"parseInitSegment",function(){return c}),N.d(Q,"getStartDTS",function(){return a}),N.d(Q,"getDuration",function(){return l}),N.d(Q,"computeRawDurationFromSamples",function(){return o}),N.d(Q,"offsetStartDTS",function(){return r}),N.d(Q,"segmentValidRange",function(){return s}),N.d(Q,"appendUint8Array",function(){return d});var J=N("./src/utils/typed-array.ts"),B=N("./src/loader/fragment.ts"),D=Math.pow(2,32)-1,H=[].push;function F(R){return String.fromCharCode.apply(null,R)}function k(R,A){"data"in R&&(A+=R.start,R=R.data);var T=R[A]<<8|R[A+1];return T<0?65536+T:T}function I(R,A){"data"in R&&(A+=R.start,R=R.data);var T=R[A]<<24|R[A+1]<<16|R[A+2]<<8|R[A+3];return T<0?4294967296+T:T}function _(R,A,T){"data"in R&&(A+=R.start,R=R.data),R[A]=T>>24,R[A+1]=T>>16&255,R[A+2]=T>>8&255,R[A+3]=T&255}function v(R,A){var T=[];if(!A.length)return T;var w,C,b;"data"in R?(w=R.data,C=R.start,b=R.end):(w=R,C=0,b=w.byteLength);for(var m=C;m<b;){var h=I(w,m),u=F(w.subarray(m+4,m+8)),x=h>1?m+h:b;if(u===A[0])if(A.length===1)T.push({data:w,start:m+8,end:x});else{var g=v({data:w,start:m+8,end:x},A.slice(1));g.length&&H.apply(T,g)}m=x}return T}function p(R){var A=v(R,["moov"]),T=A[0],w=T?T.end:null,C=v(R,["sidx"]);if(!C||!C[0])return null;var b=[],m=C[0],h=m.data[0],u=h===0?8:16,x=I(m,u);u+=4;var g=0,y=0;h===0?u+=8:u+=16,u+=2;var M=m.end+y,E=k(m,u);u+=2;for(var j=0;j<E;j++){var G=u,U=I(m,G);G+=4;var O=U&2147483647,X=(U&2147483648)>>>31;if(X===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var $=I(m,G);G+=4,b.push({referenceSize:O,subsegmentDuration:$,info:{duration:$/x,start:M,end:M+O-1}}),M+=O,G+=4,u=G}return{earliestPresentationTime:g,timescale:x,version:h,referencesCount:E,references:b,moovEndOffset:w}}function c(R){for(var A=[],T=v(R,["moov","trak"]),w=0;w<T.length;w++){var C=T[w],b=v(C,["tkhd"])[0];if(b){var m=b.data[b.start],h=m===0?12:20,u=I(b,h),x=v(C,["mdia","mdhd"])[0];if(x){m=x.data[x.start],h=m===0?12:20;var g=I(x,h),y=v(C,["mdia","hdlr"])[0];if(y){var M=F(y.data.subarray(y.start+8,y.start+12)),E={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[M];if(E){var j=v(C,["mdia","minf","stbl","stsd"])[0],G=void 0;j&&(G=F(j.data.subarray(j.start+12,j.start+16))),A[u]={timescale:g,type:E},A[E]={timescale:g,id:u,codec:G}}}}}}var U=v(R,["moov","mvex","trex"]);return U.forEach(function(O){var X=I(O,4),$=A[X];$&&($.default={duration:I(O,12),flags:I(O,20)})}),A}function a(R,A){return v(A,["moof","traf"]).reduce(function(T,w){var C=v(w,["tfdt"])[0],b=C.data[C.start],m=v(w,["tfhd"]).reduce(function(h,u){var x=I(u,4),g=R[x];if(g){var y=I(C,4);b===1&&(y*=Math.pow(2,32),y+=I(C,8));var M=g.timescale||9e4,E=y/M;if(isFinite(E)&&(h===null||E<h))return E}return h},null);return m!==null&&isFinite(m)&&(T===null||m<T)?m:T},null)||0}function l(R,A){for(var T=0,w=0,C=0,b=v(R,["moof","traf"]),m=0;m<b.length;m++){var h=b[m],u=v(h,["tfhd"])[0],x=I(u,4),g=A[x];if(!g)continue;var y=g.default,M=I(u,0)|(y==null?void 0:y.flags),E=y==null?void 0:y.duration;M&8&&(M&2?E=I(u,12):E=I(u,8));for(var j=g.timescale||9e4,G=v(h,["trun"]),U=0;U<G.length;U++){if(E){var O=I(G[U],4);T=E*O}else T=o(G[U]);g.type===B.ElementaryStreamTypes.VIDEO?w+=T/j:g.type===B.ElementaryStreamTypes.AUDIO&&(C+=T/j)}}if(w===0&&C===0){var X=p(R);if(X!=null&&X.references)return X.references.reduce(function($,se){return $+se.info.duration||0},0)}return w||C}function o(R){var A=I(R,0),T=8;A&1&&(T+=4),A&4&&(T+=4);for(var w=0,C=I(R,4),b=0;b<C;b++){if(A&256){var m=I(R,T);w+=m,T+=4}A&512&&(T+=4),A&1024&&(T+=4),A&2048&&(T+=4)}return w}function r(R,A,T){v(A,["moof","traf"]).forEach(function(w){v(w,["tfhd"]).forEach(function(C){var b=I(C,4),m=R[b];if(!m)return;var h=m.timescale||9e4;v(w,["tfdt"]).forEach(function(u){var x=u.data[u.start],g=I(u,4);if(x===0)_(u,4,g-T*h);else{g*=Math.pow(2,32),g+=I(u,8),g-=T*h,g=Math.max(g,0);var y=Math.floor(g/(D+1)),M=Math.floor(g%(D+1));_(u,4,y),_(u,8,M)}})})})}function s(R){var A={valid:null,remainder:null},T=v(R,["moof"]);if(T){if(T.length<2)return A.remainder=R,A}else return A;var w=T[T.length-1];return A.valid=Object(J.sliceUint8)(R,0,w.start-8),A.remainder=Object(J.sliceUint8)(R,w.start-8),A}function d(R,A){var T=new Uint8Array(R.length+A.length);return T.set(R),T.set(A,R.length),T}},"./src/utils/output-filter.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"default",function(){return J});var J=function(){function B(H,F){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=H,this.trackName=F}var D=B.prototype;return D.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},D.newCue=function(F,k,I){(this.startTime===null||this.startTime>F)&&(this.startTime=F),this.endTime=k,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},D.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"sendAddTrackEvent",function(){return B}),N.d(Q,"addCueToTrack",function(){return D}),N.d(Q,"clearCurrentCues",function(){return H}),N.d(Q,"removeCuesInRange",function(){return F}),N.d(Q,"getCuesInRange",function(){return I});var J=N("./src/utils/logger.ts");function B(_,v){var p;try{p=new Event("addtrack")}catch(c){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=_,v.dispatchEvent(p)}function D(_,v){var p=_.mode;if(p==="disabled"&&(_.mode="hidden"),_.cues&&!_.cues.getCueById(v.id))try{if(_.addCue(v),!_.cues.getCueById(v.id))throw new Error("addCue is failed for: "+v)}catch(a){J.logger.debug("[texttrack-utils]: "+a);var c=new self.TextTrackCue(v.startTime,v.endTime,v.text);c.id=v.id,_.addCue(c)}p==="disabled"&&(_.mode=p)}function H(_){var v=_.mode;if(v==="disabled"&&(_.mode="hidden"),_.cues)for(var p=_.cues.length;p--;)_.removeCue(_.cues[p]);v==="disabled"&&(_.mode=v)}function F(_,v,p){var c=_.mode;if(c==="disabled"&&(_.mode="hidden"),_.cues&&_.cues.length>0)for(var a=I(_.cues,v,p),l=0;l<a.length;l++)_.removeCue(a[l]);c==="disabled"&&(_.mode=c)}function k(_,v){if(v<_[0].startTime)return 0;var p=_.length-1;if(v>_[p].endTime)return-1;for(var c=0,a=p;c<=a;){var l=Math.floor((a+c)/2);if(v<_[l].startTime)a=l-1;else if(v>_[l].startTime&&c<p)c=l+1;else return l}return _[c].startTime-v<v-_[a].startTime?c:a}function I(_,v,p){var c=[],a=k(_,v);if(a>-1)for(var l=a,o=_.length;l<o;l++){var r=_[l];if(r.startTime>=v&&r.endTime<=p)c.push(r);else if(r.startTime>p)return c}return c}},"./src/utils/time-ranges.ts":function(te,Q,N){"use strict";N.r(Q);var J={toString:function(D){for(var H="",F=D.length,k=0;k<F;k++)H+="["+D.start(k).toFixed(3)+","+D.end(k).toFixed(3)+"]";return H}};Q.default=J},"./src/utils/timescale-conversion.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"toTimescaleFromBase",function(){return B}),N.d(Q,"toTimescaleFromScale",function(){return D}),N.d(Q,"toMsFromMpegTsClock",function(){return H}),N.d(Q,"toMpegTsClockFromTimescale",function(){return F});var J=9e4;function B(k,I,_,v){_===void 0&&(_=1),v===void 0&&(v=!1);var p=k*I*_;return v?Math.round(p):p}function D(k,I,_,v){return _===void 0&&(_=1),v===void 0&&(v=!1),B(k,I,1/_,v)}function H(k,I){return I===void 0&&(I=!1),B(k,1e3,1/J,I)}function F(k,I){return I===void 0&&(I=1),B(k,J,1/I)}},"./src/utils/typed-array.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"sliceUint8",function(){return J});function J(B,D,H){return Uint8Array.prototype.slice?B.slice(D,H):new Uint8Array(Array.prototype.slice.call(B,D,H))}},"./src/utils/vttcue.ts":function(te,Q,N){"use strict";N.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var J=["","lr","rl"],B=["start","middle","end","left","right"];function D(_,v){if(typeof v!="string")return!1;if(!Array.isArray(_))return!1;var p=v.toLowerCase();return~_.indexOf(p)?p:!1}function H(_){return D(J,_)}function F(_){return D(B,_)}function k(_){for(var v=arguments.length,p=new Array(v>1?v-1:0),c=1;c<v;c++)p[c-1]=arguments[c];for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var o in l)_[o]=l[o]}return _}function I(_,v,p){var c=this,a={enumerable:!0};c.hasBeenReset=!1;var l="",o=!1,r=_,s=v,d=p,R=null,A="",T=!0,w="auto",C="start",b=50,m="middle",h=50,u="middle";Object.defineProperty(c,"id",k({},a,{get:function(){return l},set:function(g){l=""+g}})),Object.defineProperty(c,"pauseOnExit",k({},a,{get:function(){return o},set:function(g){o=!!g}})),Object.defineProperty(c,"startTime",k({},a,{get:function(){return r},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");r=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",k({},a,{get:function(){return s},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",k({},a,{get:function(){return d},set:function(g){d=""+g,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",k({},a,{get:function(){return R},set:function(g){R=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",k({},a,{get:function(){return A},set:function(g){var y=H(g);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");A=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",k({},a,{get:function(){return T},set:function(g){T=!!g,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",k({},a,{get:function(){return w},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");w=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",k({},a,{get:function(){return C},set:function(g){var y=F(g);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");C=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",k({},a,{get:function(){return b},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");b=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",k({},a,{get:function(){return m},set:function(g){var y=F(g);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");m=y,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",k({},a,{get:function(){return h},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");h=g,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",k({},a,{get:function(){return u},set:function(g){var y=F(g);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");u=y,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var _=self.WebVTT;return _.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"parseTimeStamp",function(){return D}),N.d(Q,"fixLineBreaks",function(){return v}),N.d(Q,"VTTParser",function(){return p});var J=N("./src/utils/vttcue.ts"),B=function(){function c(){}var a=c.prototype;return a.decode=function(o,r){if(!o)return"";if(typeof o!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(o))},c}();function D(c){function a(o,r,s,d){return(o|0)*3600+(r|0)*60+(s|0)+parseFloat(d||0)}var l=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?a(l[2],l[3],0,l[4]):a(l[1],l[2],l[3],l[4]):null}var H=function(){function c(){this.values=Object.create(null)}var a=c.prototype;return a.set=function(o,r){!this.get(o)&&r!==""&&(this.values[o]=r)},a.get=function(o,r,s){return s?this.has(o)?this.values[o]:r[s]:this.has(o)?this.values[o]:r},a.has=function(o){return o in this.values},a.alt=function(o,r,s){for(var d=0;d<s.length;++d)if(r===s[d]){this.set(o,r);break}},a.integer=function(o,r){/^-?\d+$/.test(r)&&this.set(o,parseInt(r,10))},a.percent=function(o,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var s=parseFloat(r);if(s>=0&&s<=100)return this.set(o,s),!0}return!1},c}();function F(c,a,l,o){var r=o?c.split(o):[c];for(var s in r){if(typeof r[s]!="string")continue;var d=r[s].split(l);if(d.length!==2)continue;var R=d[0],A=d[1];a(R,A)}}var k=new J.default(0,0,""),I=k.align==="middle"?"middle":"center";function _(c,a,l){var o=c;function r(){var R=D(c);if(R===null)throw new Error("Malformed timestamp: "+o);return c=c.replace(/^[^\sa-zA-Z-]+/,""),R}function s(R,A){var T=new H;F(R,function(b,m){var h;switch(b){case"region":for(var u=l.length-1;u>=0;u--)if(l[u].id===m){T.set(b,l[u].region);break}break;case"vertical":T.alt(b,m,["rl","lr"]);break;case"line":h=m.split(","),T.integer(b,h[0]),T.percent(b,h[0])&&T.set("snapToLines",!1),T.alt(b,h[0],["auto"]),h.length===2&&T.alt("lineAlign",h[1],["start",I,"end"]);break;case"position":h=m.split(","),T.percent(b,h[0]),h.length===2&&T.alt("positionAlign",h[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":T.percent(b,m);break;case"align":T.alt(b,m,["start",I,"end","left","right"]);break}},/:/,/\s/),A.region=T.get("region",null),A.vertical=T.get("vertical","");var w=T.get("line","auto");w==="auto"&&k.line===-1&&(w=-1),A.line=w,A.lineAlign=T.get("lineAlign","start"),A.snapToLines=T.get("snapToLines",!0),A.size=T.get("size",100),A.align=T.get("align",I);var C=T.get("position","auto");C==="auto"&&k.position===50&&(C=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=C}function d(){c=c.replace(/^\s+/,"")}if(d(),a.startTime=r(),d(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+o);c=c.substr(3),d(),a.endTime=r(),d(),s(c,a)}function v(c){return c.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new B,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=c.prototype;return a.parse=function(o){var r=this;o&&(r.buffer+=r.decoder.decode(o,{stream:!0}));function s(){var C=r.buffer,b=0;for(C=v(C);b<C.length&&C[b]!=="\r"&&C[b]!==`
`;)++b;var m=C.substr(0,b);return C[b]==="\r"&&++b,C[b]===`
`&&++b,r.buffer=C.substr(b),m}function d(C){F(C,function(b,m){},/:/)}try{var R="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;R=s();var A=R.match(/^()?WEBVTT([ \t].*)?$/);if(!A||!A[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var T=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;T?T=!1:R=s();switch(r.state){case"HEADER":/:/.test(R)?d(R):R||(r.state="ID");continue;case"NOTE":R||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){r.state="NOTE";break}if(!R)continue;if(r.cue=new J.default(0,0,""),r.state="CUE",R.indexOf("-->")===-1){r.cue.id=R;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{_(R,r.cue,r.regionList)}catch(C){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var w=R.indexOf("-->")!==-1;if(!R||w&&(T=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
`),r.cue.text+=R}continue;case"BADCUE":R||(r.state="ID")}}}catch(C){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var o=this;try{if((o.cue||o.state==="HEADER")&&(o.buffer+=`
`,o.parse()),o.state==="INITIAL"||o.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(r){o.onparsingerror&&o.onparsingerror(r)}return o.onflush&&o.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(te,Q,N){"use strict";N.r(Q),N.d(Q,"generateCueId",function(){return p}),N.d(Q,"parseWebVTT",function(){return a});var J=N("./src/polyfills/number.ts"),B=N("./src/utils/vttparser.ts"),D=N("./src/demux/id3.ts"),H=N("./src/utils/timescale-conversion.ts"),F=N("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,I=function(o,r,s){return s===void 0&&(s=0),o.substr(s,r.length)===r},_=function(o){var r=parseInt(o.substr(-3)),s=parseInt(o.substr(-6,2)),d=parseInt(o.substr(-9,2)),R=o.length>9?parseInt(o.substr(0,o.indexOf(":"))):0;if(!Object(J.isFiniteNumber)(r)||!Object(J.isFiniteNumber)(s)||!Object(J.isFiniteNumber)(d)||!Object(J.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+o);return r+=1e3*s,r+=60*1e3*d,r+=60*60*1e3*R,r},v=function(o){for(var r=5381,s=o.length;s;)r=r*33^o.charCodeAt(--s);return(r>>>0).toString()};function p(l,o,r){return v(l.toString())+v(o.toString())+v(r)}var c=function(o,r,s){var d=o[r],R=o[d.prevCC];if(!R||!R.new&&d.new){o.ccOffset=o.presentationOffset=d.start,d.new=!1;return}for(;(A=R)!==null&&A!==void 0&&A.new;){var A;o.ccOffset+=d.start-R.start,d.new=!1,d=R,R=o[d.prevCC]}o.presentationOffset=s};function a(l,o,r,s,d,R,A,T){var w=new B.VTTParser,C=Object(D.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(k,`
`).split(`
`),b=[],m=Object(H.toMpegTsClockFromTimescale)(o,r),h="00:00.000",u=0,x=0,g,y=!0,M=!1;w.oncue=function(E){var j=s[d],G=s.ccOffset,U=(u-m)/9e4;if(j!=null&&j.new&&(x!==void 0?G=s.ccOffset=j.start:c(s,d,U)),U&&(G=U-s.presentationOffset),M){var O=E.endTime-E.startTime,X=Object(F.normalizePts)((E.startTime+G-x)*9e4,R*9e4)/9e4;E.startTime=X,E.endTime=X+O}var $=E.text.trim();E.text=decodeURIComponent(encodeURIComponent($)),E.id||(E.id=p(E.startTime,E.endTime,$)),E.endTime>0&&b.push(E)},w.onparsingerror=function(E){g=E},w.onflush=function(){if(g){T(g);return}A(b)},C.forEach(function(E){if(y)if(I(E,"X-TIMESTAMP-MAP=")){y=!1,M=!0,E.substr(16).split(",").forEach(function(j){I(j,"LOCAL:")?h=j.substr(6):I(j,"MPEGTS:")&&(u=parseInt(j.substr(7)))});try{x=_(h)/1e3}catch(j){M=!1,g=j}return}else E===""&&(y=!1);w.parse(E+`
`)}),w.flush()}},"./src/utils/xhr-loader.ts":function(te,Q,N){"use strict";N.r(Q);var J=N("./src/utils/logger.ts"),B=N("./src/loader/load-stats.ts"),D=/^age:\s*[\d.]+\s*$/m,H=function(){function F(I){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=I?I.xhrSetup:null,this.stats=new B.LoadStats,this.retryDelay=0}var k=F.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.abortInternal=function(){var _=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),_&&(_.onreadystatechange=null,_.onprogress=null,_.readyState!==4&&(this.stats.aborted=!0,_.abort()))},k.abort=function(){var _;this.abortInternal(),(_=this.callbacks)!==null&&_!==void 0&&_.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(_,v,p){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=_,this.config=v,this.callbacks=p,this.retryDelay=v.retryDelay,this.loadInternal()},k.loadInternal=function(){var _=this.config,v=this.context;if(!_)return;var p=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var a=this.xhrSetup;try{if(a)try{a(p,v.url)}catch(r){p.open("GET",v.url,!0),a(p,v.url)}p.readyState||p.open("GET",v.url,!0);var l=this.context.headers;if(l)for(var o in l)p.setRequestHeader(o,l[o])}catch(r){this.callbacks.onError({code:p.status,text:r.message},v,p);return}v.rangeEnd&&p.setRequestHeader("Range","bytes="+v.rangeStart+"-"+(v.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=v.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),_.timeout),p.send()},k.readystatechange=function(){var _=this.context,v=this.loader,p=this.stats;if(!_||!v)return;var c=v.readyState,a=this.config;if(p.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),c===4){v.onreadystatechange=null,v.onprogress=null;var l=v.status;if(l>=200&&l<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var o,r;if(_.responseType==="arraybuffer"?(o=v.response,r=o.byteLength):(o=v.responseText,r=o.length),p.loaded=p.total=r,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(p,_,o,v),!this.callbacks)return;var d={url:v.responseURL,data:o};this.callbacks.onSuccess(d,p,_,v)}else p.retry>=a.maxRetry||l>=400&&l<499?(J.logger.error(l+" while loading "+_.url),this.callbacks.onError({code:l,text:v.statusText},_,v)):(J.logger.warn(l+" while loading "+_.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),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},k.loadtimeout=function(){J.logger.warn("timeout while loading "+this.context.url);var _=this.callbacks;_&&(this.abortInternal(),_.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(_){var v=this.stats;v.loaded=_.loaded,_.lengthComputable&&(v.total=_.total)},k.getCacheAge=function(){var _=null;if(this.loader&&D.test(this.loader.getAllResponseHeaders())){var v=this.loader.getResponseHeader("age");_=v?parseFloat(v):null}return _},F}();Q.default=H}}).default})},vHTk:function(qe,Ne,K){qe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return vt});var te=K("rePB"),Q=K("VTBJ"),N=K("KQm4"),J=K("U8pU"),B=K("ODXe"),D=K("q1tI"),H=K("TSYQ"),F=K.n(H),k=K("Gytx"),I=K.n(k),_=K("Kwbf"),v=K("t23M"),p=K("qx4F"),c=K("6eGT"),a=K("IBYe"),l=K("Ff2n"),o=K("c+Xe"),r=K("fyJ8"),s=K("biw7");function d(Le,Ce,nt,rt,Be){var et=nt[Le]||{},xe=nt[Ce]||{},fe,ge;et.fixed==="left"?fe=rt.left[Le]:xe.fixed==="right"&&(ge=rt.right[Ce]);var re=!1,ae=!1,de=!1,ye=!1,_e=nt[Ce+1],je=nt[Le-1];if(Be==="rtl"){if(fe!==void 0){var ot=je&&je.fixed==="left";ye=!ot}else if(ge!==void 0){var bt=_e&&_e.fixed==="right";de=!bt}}else if(fe!==void 0){var wt=_e&&_e.fixed==="left";re=!wt}else if(ge!==void 0){var Et=je&&je.fixed==="right";ae=!Et}return{fixLeft:fe,fixRight:ge,lastFixLeft:re,firstFixRight:ae,lastFixRight:de,firstFixLeft:ye,isSticky:rt.isSticky}}var R=K("sR1s");function A(Le){var Ce=Le.cells,nt=Le.stickyOffsets,rt=Le.flattenColumns,Be=Le.rowComponent,et=Le.cellComponent,xe=Le.onHeaderRow,fe=Le.index,ge=D.useContext(s.a),re=ge.prefixCls,ae=ge.direction,de;xe&&(de=xe(Ce.map(function(_e){return _e.column}),fe));var ye=Object(R.a)(Ce.map(function(_e){return _e.column}));return D.createElement(Be,Object.assign({},de),Ce.map(function(_e,je){var ot=_e.column,bt=d(_e.colStart,_e.colEnd,rt,nt,ae),wt;return ot&&ot.onHeaderCell&&(wt=_e.column.onHeaderCell(ot)),D.createElement(r.a,Object.assign({},_e,{ellipsis:ot.ellipsis,align:ot.align,component:et,prefixCls:re,key:ye[je]},bt,{additionalProps:wt,rowType:"header"}))}))}A.displayName="HeaderRow";var T=A;function w(Le){var Ce=[];function nt(xe,fe){var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ce[ge]=Ce[ge]||[];var re=fe,ae=xe.filter(Boolean).map(function(de){var ye={key:de.key,className:de.className||"",children:de.title,column:de,colStart:re},_e=1,je=de.children;return je&&je.length>0&&(_e=nt(je,re,ge+1).reduce(function(ot,bt){return ot+bt},0),ye.hasSubColumns=!0),"colSpan"in de&&(_e=de.colSpan),"rowSpan"in de&&(ye.rowSpan=de.rowSpan),ye.colSpan=_e,ye.colEnd=ye.colStart+_e-1,Ce[ge].push(ye),re+=_e,_e});return ae}nt(Le,0);for(var rt=Ce.length,Be=function(fe){Ce[fe].forEach(function(ge){!("rowSpan"in ge)&&!ge.hasSubColumns&&(ge.rowSpan=rt-fe)})},et=0;et<rt;et+=1)Be(et);return Ce}function C(Le){var Ce=Le.stickyOffsets,nt=Le.columns,rt=Le.flattenColumns,Be=Le.onHeaderRow,et=D.useContext(s.a),xe=et.prefixCls,fe=et.getComponent,ge=D.useMemo(function(){return w(nt)},[nt]),re=fe(["header","wrapper"],"thead"),ae=fe(["header","row"],"tr"),de=fe(["header","cell"],"th");return D.createElement(re,{className:"".concat(xe,"-thead")},ge.map(function(ye,_e){var je=D.createElement(T,{key:_e,flattenColumns:rt,cells:ye,stickyOffsets:Ce,rowComponent:ae,cellComponent:de,onHeaderRow:Be,index:_e});return je}))}var b=C,m=K("hW8S");function h(Le){for(var Ce=Le.colWidths,nt=Le.columns,rt=Le.columCount,Be=[],et=rt||nt.length,xe=!1,fe=et-1;fe>=0;fe-=1){var ge=Ce[fe],re=nt&&nt[fe],ae=re&&re[m.a];(ge||ae||xe)&&(Be.unshift(D.createElement("col",Object.assign({key:fe,style:{width:ge,minWidth:ge}},ae))),xe=!0)}return D.createElement("colgroup",null,Be)}var u=h;function x(Le,Ce){return Object(D.useMemo)(function(){for(var nt=[],rt=0;rt<Ce;rt+=1){var Be=Le[rt];if(Be!==void 0)nt[rt]=Be;else return null}return nt},[Le.join("_"),Ce])}var g=D.forwardRef(function(Le,Ce){var nt=Le.noData,rt=Le.columns,Be=Le.flattenColumns,et=Le.colWidths,xe=Le.columCount,fe=Le.stickyOffsets,ge=Le.direction,re=Le.fixHeader,ae=Le.offsetHeader,de=Le.stickyClassName,ye=Le.onScroll,_e=Object(l.a)(Le,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),je=D.useContext(s.a),ot=je.prefixCls,bt=je.scrollbarSize,wt=je.isSticky,Et=wt&&!re?0:bt,pt=D.useRef(null),Xe=D.useCallback(function(ze){Object(o.b)(Ce,ze),Object(o.b)(pt,ze)},[]);D.useEffect(function(){var ze;function ct(Te){var Ke=Te.currentTarget,st=Te.deltaX;st&&(ye({currentTarget:Ke,scrollLeft:Ke.scrollLeft+st}),Te.preventDefault())}return(ze=pt.current)===null||ze===void 0||ze.addEventListener("wheel",ct),function(){var Te;(Te=pt.current)===null||Te===void 0||Te.removeEventListener("wheel",ct)}},[]);var Ge=Be[Be.length-1],De={fixed:Ge?Ge.fixed:null,onHeaderCell:function(){return{className:"".concat(ot,"-cell-scrollbar")}}},oe=Object(D.useMemo)(function(){return Et?[].concat(Object(N.a)(rt),[De]):rt},[Et,rt]),he=Object(D.useMemo)(function(){return Et?[].concat(Object(N.a)(Be),[De]):Be},[Et,Be]),Ze=Object(D.useMemo)(function(){var ze=fe.right,ct=fe.left;return Object(Q.a)(Object(Q.a)({},fe),{},{left:ge==="rtl"?[].concat(Object(N.a)(ct.map(function(Te){return Te+Et})),[0]):ct,right:ge==="rtl"?ze:[].concat(Object(N.a)(ze.map(function(Te){return Te+Et})),[0]),isSticky:wt})},[Et,fe,wt]),Ue=x(et,xe);return D.createElement("div",{style:Object(Q.a)({overflow:"hidden"},wt?{top:ae}:{}),ref:Xe,className:F()("".concat(ot,"-header"),Object(te.a)({},de,!!de))},D.createElement("table",{style:{tableLayout:"fixed",visibility:nt||Ue?null:"hidden"}},D.createElement(u,{colWidths:Ue?[].concat(Object(N.a)(Ue),[Et]):[],columCount:xe+1,columns:he}),D.createElement(b,Object.assign({},_e,{stickyOffsets:Ze,columns:oe,flattenColumns:he}))))});g.displayName="FixedHeader";var y=g,M=D.createContext(null),E=M;function j(Le){var Ce=Le.prefixCls,nt=Le.children,rt=Le.component,Be=Le.cellComponent,et=Le.fixHeader,xe=Le.fixColumn,fe=Le.horizonScroll,ge=Le.className,re=Le.expanded,ae=Le.componentWidth,de=Le.colSpan,ye=D.useContext(s.a),_e=ye.scrollbarSize;return D.useMemo(function(){var je=nt;return xe&&(je=D.createElement("div",{style:{width:ae-(et?_e:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ce,"-expanded-row-fixed")},je)),D.createElement(rt,{className:ge,style:{display:re?null:"none"}},D.createElement(r.a,{component:Be,prefixCls:Ce,colSpan:de},je))},[nt,rt,et,fe,ge,re,ae,de,_e])}var G=j;function U(Le){var Ce=Le.className,nt=Le.style,rt=Le.record,Be=Le.index,et=Le.rowKey,xe=Le.getRowKey,fe=Le.rowExpandable,ge=Le.expandedKeys,re=Le.onRow,ae=Le.indent,de=ae===void 0?0:ae,ye=Le.rowComponent,_e=Le.cellComponent,je=Le.childrenColumnName,ot=D.useContext(s.a),bt=ot.prefixCls,wt=ot.fixedInfoList,Et=D.useContext(E),pt=Et.fixHeader,Xe=Et.fixColumn,Ge=Et.horizonScroll,De=Et.componentWidth,oe=Et.flattenColumns,he=Et.expandableType,Ze=Et.expandRowByClick,Ue=Et.onTriggerExpand,ze=Et.rowClassName,ct=Et.expandedRowClassName,Te=Et.indentSize,Ke=Et.expandIcon,st=Et.expandedRowRender,ft=Et.expandIconColumnIndex,Tt=D.useState(!1),Jt=Object(B.a)(Tt,2),an=Jt[0],Vt=Jt[1],Ot=ge&&ge.has(Le.recordKey);D.useEffect(function(){Ot&&Vt(!0)},[Ot]);var gn=he==="row"&&(!fe||fe(rt)),Kt=he==="nest",Zt=je&&rt&&rt[je],Nt=gn||Kt,nn;re&&(nn=re(rt,Be));var Cn=function(S){if(Ze&&Nt&&Ue(rt,S),nn&&nn.onClick){for(var L,W=arguments.length,ee=new Array(W>1?W-1:0),Y=1;Y<W;Y++)ee[Y-1]=arguments[Y];(L=nn).onClick.apply(L,[S].concat(ee))}},wn;typeof ze=="string"?wn=ze:typeof ze=="function"&&(wn=ze(rt,Be,de));var mt=Object(R.a)(oe),Gt=D.createElement(ye,Object.assign({},nn,{"data-row-key":et,className:F()(Ce,"".concat(bt,"-row"),"".concat(bt,"-row-level-").concat(de),wn,nn&&nn.className),style:Object(Q.a)(Object(Q.a)({},nt),nn?nn.style:null),onClick:Cn}),oe.map(function(V,S){var L=V.render,W=V.dataIndex,ee=V.className,Y=mt[S],Ae=wt[S],at;S===(ft||0)&&Kt&&(at=D.createElement(D.Fragment,null,D.createElement("span",{style:{paddingLeft:"".concat(Te*de,"px")},className:"".concat(bt,"-row-indent indent-level-").concat(de)}),Ke({prefixCls:bt,expanded:Ot,expandable:Zt,record:rt,onExpand:Ue})));var St;return V.onCell&&(St=V.onCell(rt,Be)),D.createElement(r.a,Object.assign({className:ee,ellipsis:V.ellipsis,align:V.align,component:_e,prefixCls:bt,key:Y,record:rt,index:Be,dataIndex:W,render:L,shouldCellUpdate:V.shouldCellUpdate},Ae,{appendNode:at,additionalProps:St}))})),Mn;if(gn&&(an||Ot)){var Un=st(rt,Be,de+1,Ot),Pn=ct&&ct(rt,Be,de);Mn=D.createElement(G,{expanded:Ot,className:F()("".concat(bt,"-expanded-row"),"".concat(bt,"-expanded-row-level-").concat(de+1),Pn),prefixCls:bt,fixHeader:pt,fixColumn:Xe,horizonScroll:Ge,component:ye,componentWidth:De,cellComponent:_e,colSpan:oe.length},Un)}var Vn;return Zt&&Ot&&(Vn=(rt[je]||[]).map(function(V,S){var L=xe(V,S);return D.createElement(U,Object.assign({},Le,{key:L,rowKey:L,record:V,recordKey:L,index:S,indent:de+1}))})),D.createElement(D.Fragment,null,Gt,Mn,Vn)}U.displayName="BodyRow";var O=U,X=D.createContext(null),$=X;function se(Le){var Ce=Le.columnKey,nt=Le.onColumnResize,rt=D.useRef();return D.useEffect(function(){rt.current&&nt(Ce,rt.current.offsetWidth)},[]),D.createElement(v.a,{onResize:function(et){var xe=et.offsetWidth;nt(Ce,xe)}},D.createElement("td",{ref:rt,style:{padding:0,border:0,height:0}},D.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ce(Le){var Ce=Le.data,nt=Le.getRowKey,rt=Le.measureColumnWidth,Be=Le.expandedKeys,et=Le.onRow,xe=Le.rowExpandable,fe=Le.emptyNode,ge=Le.childrenColumnName,re=D.useContext($),ae=re.onColumnResize,de=D.useContext(s.a),ye=de.prefixCls,_e=de.getComponent,je=D.useContext(E),ot=je.fixHeader,bt=je.horizonScroll,wt=je.flattenColumns,Et=je.componentWidth;return D.useMemo(function(){var pt=_e(["body","wrapper"],"tbody"),Xe=_e(["body","row"],"tr"),Ge=_e(["body","cell"],"td"),De;Ce.length?De=Ce.map(function(he,Ze){var Ue=nt(he,Ze);return D.createElement(O,{key:Ue,rowKey:Ue,record:he,recordKey:Ue,index:Ze,rowComponent:Xe,cellComponent:Ge,expandedKeys:Be,onRow:et,getRowKey:nt,rowExpandable:xe,childrenColumnName:ge})}):De=D.createElement(G,{expanded:!0,className:"".concat(ye,"-placeholder"),prefixCls:ye,fixHeader:ot,fixColumn:bt,horizonScroll:bt,component:Xe,componentWidth:Et,cellComponent:Ge,colSpan:wt.length},fe);var oe=Object(R.a)(wt);return D.createElement(pt,{className:"".concat(ye,"-tbody")},rt&&D.createElement("tr",{"aria-hidden":"true",className:"".concat(ye,"-measure-row"),style:{height:0}},oe.map(function(he){return D.createElement(se,{key:he,columnKey:he,onColumnResize:ae})})),De)},[Ce,ye,et,rt,Be,nt,_e,Et,fe,wt])}var Pe=D.memo(ce);Pe.displayName="Body";var Se=Pe,Re=K("wRmb"),Oe=K("xEkU"),Me=K.n(Oe);function be(Le){var Ce=Object(D.useRef)(Le),nt=Object(D.useState)({}),rt=Object(B.a)(nt,2),Be=rt[1],et=Object(D.useRef)(null),xe=Object(D.useRef)([]);function fe(ge){et.current===null&&(xe.current=[],et.current=Me()(function(){xe.current.forEach(function(re){Ce.current=re(Ce.current)}),et.current=null,Be({})})),xe.current.push(ge)}return Object(D.useEffect)(function(){return function(){Me.a.cancel(et.current)}},[]),[Ce.current,fe]}function ue(Le){var Ce=Object(D.useRef)(Le),nt=Object(D.useRef)(null);function rt(){window.clearTimeout(nt.current)}function Be(xe){Ce.current=xe,rt(),nt.current=window.setTimeout(function(){Ce.current=null,nt.current=null},100)}function et(){return Ce.current}return Object(D.useEffect)(function(){return rt},[]),[Be,et]}function ne(Le,Ce,nt){var rt=Object(D.useMemo)(function(){for(var Be=[],et=[],xe=0,fe=0,ge=0;ge<Ce;ge+=1)if(nt==="rtl"){et[ge]=fe,fe+=Le[ge]||0;var re=Ce-ge-1;Be[re]=xe,xe+=Le[re]||0}else{Be[ge]=xe,xe+=Le[ge]||0;var ae=Ce-ge-1;et[ae]=fe,fe+=Le[ae]||0}return{left:Be,right:et}},[Le,Ce,nt]);return rt}var ve=ne;function le(Le){var Ce=Le.className,nt=Le.children;return D.createElement("div",{className:Ce},nt)}var ke=le,Fe=K("n6Qo");function Ie(Le){var Ce,nt=Le.prefixCls,rt=Le.record,Be=Le.onExpand,et=Le.expanded,xe=Le.expandable,fe="".concat(nt,"-row-expand-icon");if(!xe)return D.createElement("span",{className:F()(fe,"".concat(nt,"-row-spaced"))});var ge=function(ae){Be(rt,ae),ae.stopPropagation()};return D.createElement("span",{className:F()(fe,(Ce={},Object(te.a)(Ce,"".concat(nt,"-row-expanded"),et),Object(te.a)(Ce,"".concat(nt,"-row-collapsed"),!et),Ce)),onClick:ge})}function He(Le,Ce,nt){var rt=[];function Be(et){(et||[]).forEach(function(xe,fe){rt.push(Ce(xe,fe)),Be(xe[nt])})}return Be(Le),rt}var $e=K("zT1h"),tt=K("y0+3"),Qe=function(Ce,nt){var rt,Be,et=Ce.scrollBodyRef,xe=Ce.onScroll,fe=Ce.offsetScroll,ge=D.useContext(s.a),re=ge.prefixCls,ae=((rt=et.current)===null||rt===void 0?void 0:rt.scrollWidth)||0,de=((Be=et.current)===null||Be===void 0?void 0:Be.clientWidth)||0,ye=ae&&de*(de/ae),_e=D.useRef(),je=be({scrollLeft:0,isHiddenScrollBar:!1}),ot=Object(B.a)(je,2),bt=ot[0],wt=ot[1],Et=D.useRef({delta:0,x:0}),pt=D.useState(!1),Xe=Object(B.a)(pt,2),Ge=Xe[0],De=Xe[1],oe=function(){De(!1)},he=function(Te){Te.persist(),Et.current.delta=Te.pageX-bt.scrollLeft,Et.current.x=0,De(!0),Te.preventDefault()},Ze=function(Te){var Ke,st=Te||((Ke=window)===null||Ke===void 0?void 0:Ke.event),ft=st.buttons;if(!Ge||ft===0){Ge&&De(!1);return}var Tt=Et.current.x+Te.pageX-Et.current.x-Et.current.delta;Tt<=0&&(Tt=0),Tt+ye>=de&&(Tt=de-ye),xe({scrollLeft:Tt/de*(ae+2)}),Et.current.x=Te.pageX},Ue=function(){var Te=Object(tt.b)(et.current).top,Ke=Te+et.current.offsetHeight,st=document.documentElement.scrollTop+window.innerHeight;Ke-Object(p.a)()<=st||Te>=st-fe?wt(function(ft){return Object(Q.a)(Object(Q.a)({},ft),{},{isHiddenScrollBar:!0})}):wt(function(ft){return Object(Q.a)(Object(Q.a)({},ft),{},{isHiddenScrollBar:!1})})},ze=function(Te){wt(function(Ke){return Object(Q.a)(Object(Q.a)({},Ke),{},{scrollLeft:Te/ae*de||0})})};return D.useImperativeHandle(nt,function(){return{setScrollLeft:ze}}),D.useEffect(function(){var ct=Object($e.a)(document.body,"mouseup",oe,!1),Te=Object($e.a)(document.body,"mousemove",Ze,!1);return Ue(),function(){ct.remove(),Te.remove()}},[ye,Ge]),D.useEffect(function(){var ct=Object($e.a)(window,"scroll",Ue,!1),Te=Object($e.a)(window,"resize",Ue,!1);return function(){ct.remove(),Te.remove()}},[]),D.useEffect(function(){bt.isHiddenScrollBar||wt(function(ct){var Te,Ke;return Object(Q.a)(Object(Q.a)({},ct),{},{scrollLeft:et.current.scrollLeft/((Te=et.current)===null||Te===void 0?void 0:Te.scrollWidth)*((Ke=et.current)===null||Ke===void 0?void 0:Ke.clientWidth)})})},[bt.isHiddenScrollBar]),ae<=de||!ye||bt.isHiddenScrollBar?null:D.createElement("div",{style:{height:Object(p.a)(),width:de,bottom:fe},className:"".concat(re,"-sticky-scroll")},D.createElement("div",{onMouseDown:he,ref:_e,className:F()("".concat(re,"-sticky-scroll-bar"),Object(te.a)({},"".concat(re,"-sticky-scroll-bar-active"),Ge)),style:{width:"".concat(ye,"px"),transform:"translate3d(".concat(bt.scrollLeft,"px, 0, 0)")}}))},Je=D.forwardRef(Qe);function Ye(Le,Ce){return D.useMemo(function(){var nt=!!Le;return{isSticky:nt,stickyClassName:nt?"".concat(Ce,"-sticky-header"):"",offsetHeader:Object(J.a)(Le)==="object"&&Le.offsetHeader||0,offsetScroll:Object(J.a)(Le)==="object"&&Le.offsetScroll||0}},[Le,Ce])}var gt=[],_t={},vt="rc-table-internal-hook",dt=D.memo(function(Le){var Ce=Le.children;return Ce},function(Le,Ce){return I()(Le.props,Ce.props)?Le.pingLeft!==Ce.pingLeft||Le.pingRight!==Ce.pingRight:!1});function Ct(Le){var Ce,nt=Le.prefixCls,rt=Le.className,Be=Le.rowClassName,et=Le.style,xe=Le.data,fe=Le.rowKey,ge=Le.scroll,re=Le.tableLayout,ae=Le.direction,de=Le.title,ye=Le.footer,_e=Le.summary,je=Le.id,ot=Le.showHeader,bt=Le.components,wt=Le.emptyText,Et=Le.onRow,pt=Le.onHeaderRow,Xe=Le.internalHooks,Ge=Le.transformColumns,De=Le.internalRefs,oe=Le.sticky,he=xe||gt,Ze=!!he.length,Ue=D.useState(0),ze=Object(B.a)(Ue,2),ct=ze[0],Te=ze[1];D.useEffect(function(){Te(Object(p.a)())});var Ke=D.useMemo(function(){return Object(R.c)(bt,{})},[bt]),st=D.useCallback(function(En,mn){return Object(R.b)(Ke,En)||mn},[Ke]),ft=D.useMemo(function(){return typeof fe=="function"?fe:function(En){var mn=En&&En[fe];return mn}},[fe]),Tt=Object(m.c)(Le),Jt=Tt.expandIcon,an=Tt.expandedRowKeys,Vt=Tt.defaultExpandedRowKeys,Ot=Tt.defaultExpandAllRows,gn=Tt.expandedRowRender,Kt=Tt.onExpand,Zt=Tt.onExpandedRowsChange,Nt=Tt.expandRowByClick,nn=Tt.rowExpandable,Cn=Tt.expandIconColumnIndex,wn=Tt.expandedRowClassName,mt=Tt.childrenColumnName,Gt=Tt.indentSize,Mn=Jt||Ie,Un=mt||"children",Pn=D.useMemo(function(){return gn?"row":Le.expandable&&Xe===vt&&Le.expandable.__PARENT_RENDER_ICON__||he.some(function(En){return En&&Object(J.a)(En)==="object"&&En[Un]})?"nest":!1},[!!gn,he]),Vn=D.useState(function(){return Vt||(Ot?He(he,ft,Un):[])}),V=Object(B.a)(Vn,2),S=V[0],L=V[1],W=D.useMemo(function(){return new Set(an||S||[])},[an,S]),ee=D.useCallback(function(En){var mn=ft(En,he.indexOf(En)),bn,$n=W.has(mn);$n?(W.delete(mn),bn=Object(N.a)(W)):bn=[].concat(Object(N.a)(W),[mn]),L(bn),Kt&&Kt(!$n,En),Zt&&Zt(bn)},[ft,W,he,Kt,Zt]),Y=D.useState(0),Ae=Object(B.a)(Y,2),at=Ae[0],St=Ae[1],Bt=Object(Re.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},Le),Tt),{},{expandable:!!gn,expandedKeys:W,getRowKey:ft,onTriggerExpand:ee,expandIcon:Mn,expandIconColumnIndex:Cn,direction:ae}),Xe===vt?Ge:null),pe=Object(B.a)(Bt,2),Pt=pe[0],qt=pe[1],Tn=D.useMemo(function(){return{columns:Pt,flattenColumns:qt}},[Pt,qt]),Hn=D.useRef(),Kn=D.useRef(),In=D.useRef(),pi=D.useState(!1),ui=Object(B.a)(pi,2),Bn=ui[0],di=ui[1],Ai=D.useState(!1),wi=Object(B.a)(Ai,2),Yn=wi[0],Wi=wi[1],Pi=be(new Map),yi=Object(B.a)(Pi,2),Qi=yi[0],bi=yi[1],ci=Object(R.a)(qt),Ni=ci.map(function(En){return Qi.get(En)}),Hi=D.useMemo(function(){return Ni},[Ni.join("_")]),_i=ve(Hi,qt.length,ae),_n=ge&&Object(R.d)(ge.y),on=ge&&Object(R.d)(ge.x),Dn=on&&qt.some(function(En){var mn=En.fixed;return mn}),un=D.useRef(),Rn=Ye(oe,nt),yn=Rn.isSticky,Oi=Rn.offsetHeader,jn=Rn.offsetScroll,Xn=Rn.stickyClassName,Ki,Ri,Gi;_n&&(Ri={overflowY:"scroll",maxHeight:ge.y}),on&&(Ki={overflowX:"auto"},_n||(Ri={overflowY:"hidden"}),Gi={width:ge.x===!0?"auto":ge.x,minWidth:"100%"});var Ii=D.useCallback(function(En,mn){bi(function(bn){var $n=new Map(bn);return $n.set(En,mn),$n})},[]),Li=ue(null),ji=Object(B.a)(Li,2),Ei=ji[0],zi=ji[1];function Ji(En,mn){if(!mn)return;typeof mn=="function"?mn(En):mn.scrollLeft!==En&&(mn.scrollLeft=En)}var oi=function(mn){var bn=mn.currentTarget,$n=mn.scrollLeft,qi=typeof $n=="number"?$n:bn.scrollLeft,Vi=bn||_t;if(!zi()||zi()===Vi){var $i;Ei(Vi),Ji(qi,Kn.current),Ji(qi,In.current),Ji(qi,($i=un.current)===null||$i===void 0?void 0:$i.setScrollLeft)}if(bn){var Ar=bn.scrollWidth,Gr=bn.clientWidth;di(qi>0),Wi(qi<Ar-Gr)}},ir=function(){In.current&&oi({currentTarget:In.current})},Ht=function(mn){var bn=mn.width;ir(),St(Hn.current?Hn.current.offsetWidth:bn)};D.useEffect(function(){return ir},[]),D.useEffect(function(){on&&ir()},[on]),D.useEffect(function(){Xe===vt&&De&&(De.body.current=In.current)});var $t=st(["table"],"table"),zt=D.useMemo(function(){return re||(Dn?ge.x==="max-content"?"auto":"fixed":_n||qt.some(function(En){var mn=En.ellipsis;return mn})?"fixed":"auto")},[_n,Dn,qt,re]),sn,cn={colWidths:Hi,columCount:qt.length,stickyOffsets:_i,onHeaderRow:pt,fixHeader:_n},Sn=D.useMemo(function(){return Ze?null:typeof wt=="function"?wt():wt},[Ze,wt]),hn=D.createElement(Se,{data:he,measureColumnWidth:_n||on||yn,expandedKeys:W,rowExpandable:nn,getRowKey:ft,onRow:Et,emptyNode:Sn,childrenColumnName:Un}),kn=D.createElement(u,{colWidths:qt.map(function(En){var mn=En.width;return mn}),columns:qt}),qn=_e&&D.createElement(Fe.b,null,_e(he)),ln=st(["body"]);if(_n||yn){var tn;typeof ln=="function"?(tn=ln(he,{scrollbarSize:ct,ref:In,onScroll:oi}),cn.colWidths=qt.map(function(En,mn){var bn=En.width,$n=mn===Pt.length-1?bn-ct:bn;return typeof $n=="number"&&!Number.isNaN($n)?$n:(Object(_.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):tn=D.createElement("div",{style:Object(Q.a)(Object(Q.a)({},Ki),Ri),onScroll:oi,ref:In,className:F()("".concat(nt,"-body"))},D.createElement($t,{style:Object(Q.a)(Object(Q.a)({},Gi),{},{tableLayout:zt})},kn,hn,qn),yn&&D.createElement(Je,{ref:un,offsetScroll:jn,scrollBodyRef:In,onScroll:oi})),sn=D.createElement(D.Fragment,null,ot!==!1&&D.createElement(y,Object.assign({noData:!he.length},cn,Tn,{direction:ae,offsetHeader:Oi,stickyClassName:Xn,ref:Kn,onScroll:oi})),tn)}else sn=D.createElement("div",{style:Object(Q.a)(Object(Q.a)({},Ki),Ri),className:F()("".concat(nt,"-content")),onScroll:oi,ref:In},D.createElement($t,{style:Object(Q.a)(Object(Q.a)({},Gi),{},{tableLayout:zt})},kn,ot!==!1&&D.createElement(b,Object.assign({},cn,Tn)),hn,qn));var pn=Object(m.b)(Le),Qn=D.createElement("div",Object.assign({className:F()(nt,rt,(Ce={},Object(te.a)(Ce,"".concat(nt,"-rtl"),ae==="rtl"),Object(te.a)(Ce,"".concat(nt,"-ping-left"),Bn),Object(te.a)(Ce,"".concat(nt,"-ping-right"),Yn),Object(te.a)(Ce,"".concat(nt,"-layout-fixed"),re==="fixed"),Object(te.a)(Ce,"".concat(nt,"-fixed-header"),_n),Object(te.a)(Ce,"".concat(nt,"-fixed-column"),Dn),Object(te.a)(Ce,"".concat(nt,"-scroll-horizontal"),on),Object(te.a)(Ce,"".concat(nt,"-has-fix-left"),qt[0]&&qt[0].fixed),Object(te.a)(Ce,"".concat(nt,"-has-fix-right"),qt[qt.length-1]&&qt[qt.length-1].fixed==="right"),Ce)),style:et,id:je,ref:Hn},pn),D.createElement(dt,{pingLeft:Bn,pingRight:Yn,props:Object(Q.a)(Object(Q.a)({},Le),{},{stickyOffsets:_i,mergedExpandedKeys:W})},de&&D.createElement(ke,{className:"".concat(nt,"-title")},de(he)),D.createElement("div",{className:"".concat(nt,"-container")},sn),ye&&D.createElement(ke,{className:"".concat(nt,"-footer")},ye(he))));on&&(Qn=D.createElement(v.a,{onResize:Ht},Qn));var Gn=D.useMemo(function(){return{prefixCls:nt,getComponent:st,scrollbarSize:ct,direction:ae,fixedInfoList:qt.map(function(En,mn){return d(mn,mn,qt,_i,ae)}),isSticky:yn}},[nt,st,ct,ae,qt,_i,ae,yn]),rn=D.useMemo(function(){return Object(Q.a)(Object(Q.a)({},Tn),{},{tableLayout:zt,rowClassName:Be,expandedRowClassName:wn,componentWidth:at,fixHeader:_n,fixColumn:Dn,horizonScroll:on,expandIcon:Mn,expandableType:Pn,expandRowByClick:Nt,expandedRowRender:gn,onTriggerExpand:ee,expandIconColumnIndex:Cn,indentSize:Gt})},[Tn,zt,Be,wn,at,_n,Dn,on,Mn,Pn,Nt,gn,ee,Cn,Gt]),Zi=D.useMemo(function(){return{onColumnResize:Ii}},[Ii]);return D.createElement(s.a.Provider,{value:Gn},D.createElement(E.Provider,{value:rn},D.createElement($.Provider,{value:Zi},Qn)))}Ct.Column=a.a,Ct.ColumnGroup=c.a,Ct.Summary=Fe.a,Ct.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var xt=Ne.b=Ct},wRmb:function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return I});var te=K("rePB"),Q=K("KQm4"),N=K("VTBJ"),J=K("Ff2n"),B=K("q1tI"),D=K.n(B),H=K("Kwbf"),F=K("Zm9Q"),k=K("hW8S");function I(a){return Object(F.a)(a).filter(function(l){return B.isValidElement(l)}).map(function(l){var o=l.key,r=l.props,s=r.children,d=Object(J.a)(r,["children"]),R=Object(N.a)({key:o},d);return s&&(R.children=I(s)),R})}function _(a){return a.reduce(function(l,o){var r=o.fixed,s=r===!0?"left":r,d=o.children;return d&&d.length>0?[].concat(Object(Q.a)(l),Object(Q.a)(_(d).map(function(R){return Object(N.a)({fixed:s},R)}))):[].concat(Object(Q.a)(l),[Object(N.a)(Object(N.a)({},o),{},{fixed:s})])},[])}function v(a){for(var l=!0,o=0;o<a.length;o+=1){var r=a[o];if(l&&r.fixed!=="left")l=!1;else if(!l&&r.fixed==="left"){Object(H.a)(!1,"Index ".concat(o-1," of `columns` missing `fixed='left'` prop."));break}}for(var s=!0,d=a.length-1;d>=0;d-=1){var R=a[d];if(s&&R.fixed!=="right")s=!1;else if(!s&&R.fixed==="right"){Object(H.a)(!1,"Index ".concat(d+1," of `columns` missing `fixed='right'` prop."));break}}}function p(a){return a.map(function(l){var o=l.fixed,r=Object(J.a)(l,["fixed"]),s=o;return o==="left"?s="right":o==="right"&&(s="left"),Object(N.a)({fixed:s},r)})}function c(a,l){var o=a.prefixCls,r=a.columns,s=a.children,d=a.expandable,R=a.expandedKeys,A=a.getRowKey,T=a.onTriggerExpand,w=a.expandIcon,C=a.rowExpandable,b=a.expandIconColumnIndex,m=a.direction,h=a.expandRowByClick,u=B.useMemo(function(){return r||I(s)},[r,s]),x=B.useMemo(function(){if(d){var M,E=b||0,j=u[E],G=(M={},Object(te.a)(M,k.a,{className:"".concat(o,"-expand-icon-col")}),Object(te.a)(M,"title",""),Object(te.a)(M,"fixed",j?j.fixed:null),Object(te.a)(M,"className","".concat(o,"-row-expand-icon-cell")),Object(te.a)(M,"render",function(X,$,se){var ce=A($,se),Pe=R.has(ce),Se=C?C($):!0,Re=w({prefixCls:o,expanded:Pe,expandable:Se,record:$,onExpand:T});return h?B.createElement("span",{onClick:function(Me){return Me.stopPropagation()}},Re):Re}),M),U=u.slice();return E>=0&&U.splice(E,0,G),U}return u},[d,u,A,R,w,m]),g=B.useMemo(function(){var M=x;return l&&(M=l(M)),M.length||(M=[{render:function(){return null}}]),M},[l,x,m]),y=B.useMemo(function(){return m==="rtl"?p(_(g)):_(g)},[g,m]);return[g,y]}Ne.b=c},"y0+3":function(qe,Ne,K){"use strict";K.d(Ne,"a",function(){return _}),K.d(Ne,"b",function(){return p});var te=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},N={cssFloat:1,styleFloat:1,float:1};function J(c){return c.nodeType===1?c.ownerDocument.defaultView.getComputedStyle(c,null):{}}function B(c,a,l){if(a=a.toLowerCase(),l==="auto"){if(a==="height")return c.offsetHeight;if(a==="width")return c.offsetWidth}return a in Q||(Q[a]=te.test(a)),Q[a]?parseFloat(l)||0:l}function D(c,a){var l=arguments.length,o=J(c);return a=N[a]?"cssFloat"in c.style?"cssFloat":"styleFloat":a,l===1?o:B(c,a,o[a]||c.style[a])}function H(c,a,l){var o=arguments.length;if(a=N[a]?"cssFloat"in c.style?"cssFloat":"styleFloat":a,o===3)return typeof l=="number"&&te.test(a)&&(l="".concat(l,"px")),c.style[a]=l,l;for(var r in a)a.hasOwnProperty(r)&&H(c,r,a[r]);return J(c)}function F(c){return c===document.body?document.documentElement.clientWidth:c.offsetWidth}function k(c){return c===document.body?window.innerHeight||document.documentElement.clientHeight:c.offsetHeight}function I(){var c=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:c,height:a}}function _(){var c=document.documentElement.clientWidth,a=window.innerHeight||document.documentElement.clientHeight;return{width:c,height:a}}function v(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(c){var a=c.getBoundingClientRect(),l=document.documentElement;return{left:a.left+(window.pageXOffset||l.scrollLeft)-(l.clientLeft||document.body.clientLeft||0),top:a.top+(window.pageYOffset||l.scrollTop)-(l.clientTop||document.body.clientTop||0)}}},yslc:function(qe,Ne){qe.exports="data:image/png;base64,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"}}]);