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__Problemset__index.14b72f...

439 lines
1.4 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[212,5,7,8,14],{"+NIl":function(ut,ve,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";ne.defineMode("stex",function(Y,M){"use strict";function z(c,a){c.cmdState.push(a)}function P(c){return c.cmdState.length>0?c.cmdState[c.cmdState.length-1]:null}function F(c){var a=c.cmdState.pop();a&&a.closeBracket()}function G(c){for(var a=c.cmdState,p=a.length-1;p>=0;p--){var l=a[p];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function K(c,a,p){return function(){this.name=c,this.bracketNo=0,this.style=a,this.styles=p,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var n={};n.importmodule=K("importmodule","tag",["string","builtin"]),n.documentclass=K("documentclass","tag",["","atom"]),n.usepackage=K("usepackage","tag",["atom"]),n.begin=K("begin","tag",["atom"]),n.end=K("end","tag",["atom"]),n.label=K("label","tag",["atom"]),n.ref=K("ref","tag",["atom"]),n.eqref=K("eqref","tag",["atom"]),n.cite=K("cite","tag",["atom"]),n.bibitem=K("bibitem","tag",["atom"]),n.Bibitem=K("Bibitem","tag",["atom"]),n.RBibitem=K("RBibitem","tag",["atom"]),n.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(c,a){c.f=a}function b(c,a){var p;if(c.match(/^\\[a-zA-Z@]+/)){var l=c.current().slice(1);return p=n.hasOwnProperty(l)?n[l]:n.DEFAULT,p=new p,z(a,p),I(a,y),p.style}if(c.match(/^\\[$&%#{}_]/))return"tag";if(c.match(/^\\[,;!\/\\]/))return"tag";if(c.match("\\["))return I(a,function(s,i){return f(s,i,"\\]")}),"keyword";if(c.match("\\("))return I(a,function(s,i){return f(s,i,"\\)")}),"keyword";if(c.match("$$"))return I(a,function(s,i){return f(s,i,"$$")}),"keyword";if(c.match("$"))return I(a,function(s,i){return f(s,i,"$")}),"keyword";var u=c.next();if(u=="%")return c.skipToEnd(),"comment";if(u=="}"||u=="]"){if(p=P(a),p)p.closeBracket(u),I(a,y);else return"error";return"bracket"}else return u=="{"||u=="["?(p=n.DEFAULT,p=new p,z(a,p),"bracket"):/\d/.test(u)?(c.eatWhile(/[\w.%]/),"atom"):(c.eatWhile(/[\w\-_]/),p=G(a),p.name=="begin"&&(p.argument=c.current()),p.styleIdentifier())}function f(c,a,p){if(c.eatSpace())return null;if(p&&c.match(p))return I(a,b),"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 l=c.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(c.skipToEnd(),"comment"):"error"}function y(c,a){var p=c.peek(),l;return p=="{"||p=="["?(l=P(a),l.openBracket(p),c.eat(p),I(a,b),"bracket"):/[ \t\r]/.test(p)?(c.eat(p),null):(I(a,b),F(a),b(c,a))}return{startState:function(){var c=M.inMathMode?function(a,p){return f(a,p)}:b;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=b,c.cmdState.length=0},lineComment:"%"}}),ne.defineMIME("text/x-stex","stex"),ne.defineMIME("text/x-latex","stex")})},"+ua5":function(ut,ve,U){},"+vTd":function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___37CPQ",flex_space_between:"flex_space_between___1yzV5",flex_box_vertical_center:"flex_box_vertical_center___2QH_C",flex_box_center_end:"flex_box_center_end___22kLi",flex_box_column:"flex_box_column___1Y3On",line:"line___-rzSr",b1:"b1___1zz_c",b2:"b2___1dAOW",list:"list___1gpez",title:"title___21uOv",tr:"tr___3kTJL",itemDetail:"itemDetail___8QmqJ",answerWrapper:"answerWrapper___3guKO",decoration:"decoration___1rcYW",row:"row___3uQSh",typeRow:"typeRow___ADZSj",type:"type___2pfNZ",typeName:"typeName___8ZhPv",typeIcon:"typeIcon___1Xniv",unpublished:"unpublished___dTXTI",private:"private___XQiDx",public:"public___iIFou",reviewFlag:"reviewFlag___YP4vk",typeRightAction:"typeRightAction___1PQjp",actionLink:"actionLink___2E5q_",actionIcon:"actionIcon___GCvNK",topicTitle:"topicTitle___3fJds",topicTitleContent:"topicTitleContent___35cf9",judgmentContent:"judgmentContent___SU5rV",programContent:"programContent___3G6-D",otherContent:"otherContent___1JHnX",combinationContent:"combinationContent___6ZXO-",con:"con___1_qCl",otherContentItem:"otherContentItem___18WrV",otehrContentHtml:"otehrContentHtml___LW3nV",difficultyRow:"difficultyRow___3HvT0",updateTimeRow:"updateTimeRow___1dNd0",updateTimeWrap:"updateTimeWrap___2PKks",updateTimeContent:"updateTimeContent___1mNBy",programLanguage:"programLanguage___3CnaJ",updateTimeRowAction:"updateTimeRowAction___1DaMt",bottomAction:"bottomAction___Y-BNC",borderColorBlue:"borderColorBlue___2Xd-0",borderColorRed:"borderColorRed___2zA_q",borderColorFFF:"borderColorFFF___2R5-5",borderColorGray:"borderColorGray___nZnDe",selectIcon:"selectIcon___2byLd",colorGreen:"colorGreen___1iOKR",parseAnswerBorder:"parseAnswerBorder___1LTYn",answer:"answer___2L9lv",answerHtml:"answerHtml___3zrOk",parse:"parse___3d3dm",parseText:"parseText___1C_VL",parseAnswer:"parseAnswer___QMVPC",parseAnswerHtml:"parseAnswerHtml___2TCVz",actionBar:"actionBar___2ItMN",know:"know___y8QKK",menu:"menu___SYdg7",bottom:"bottom___2dFIa",textBtn:"textBtn___1y00f"}},"+z73":function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___3WSrc",flex_space_between:"flex_space_between___1fpCp",flex_box_vertical_center:"flex_box_vertical_center___3Wy8W",flex_box_center_end:"flex_box_center_end___3YIs2",flex_box_column:"flex_box_column___3CNwR",pWrap:"pWrap___2jVbQ",few:"few___3Eebn"}},"/cxE":function(ut,ve,U){"use strict";U.d(ve,"f",function(){return M}),U.d(ve,"g",function(){return z}),U.d(ve,"h",function(){return P}),U.d(ve,"e",function(){return G}),U.d(ve,"b",function(){return K}),U.d(ve,"c",function(){return n}),U.d(ve,"d",function(){return I}),U.d(ve,"a",function(){return b});class ne{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(y=>{y(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const Y=new ne;function M(f){G(f)||Y.onUnexpectedError(f);return}function z(f){G(f)||Y.onUnexpectedExternalError(f);return}function P(f){if(f instanceof Error){let{name:y,message:c}=f;const a=f.stacktrace||f.stack;return{$isError:!0,name:y,message:c,stack:a}}return f}const F="Canceled";function G(f){return f instanceof Error&&f.name===F&&f.message===F}function K(){const f=new Error(F);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function I(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class b extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(ut,ve,U){(function(ne){ne(U("VrN/"))})(function(ne){ne.defineOption("placeholder","",function(K,n,I){var b=I&&I!=ne.Init;if(n&&!b)K.on("blur",P),K.on("change",F),K.on("swapDoc",F),ne.on(K.getInputField(),"compositionupdate",K.state.placeholderCompose=function(){z(K)}),F(K);else if(!n&&b){K.off("blur",P),K.off("change",F),K.off("swapDoc",F),ne.off(K.getInputField(),"compositionupdate",K.state.placeholderCompose),Y(K);var f=K.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!K.hasFocus()&&P(K)});function Y(K){K.state.placeholder&&(K.state.placeholder.parentNode.removeChild(K.state.placeholder),K.state.placeholder=null)}function M(K){Y(K);var n=K.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=K.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var I=K.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),n.appendChild(I),K.display.lineSpace.insertBefore(n,K.display.lineSpace.firstChild)}function z(K){setTimeout(function(){var n=!1,I=K.getInputField();I.nodeName=="TEXTAREA"?n=!I.value:K.lineCount()==1&&(n=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),n?M(K):Y(K)},20)}function P(K){G(K)&&M(K)}function F(K){var n=K.getWrapperElement(),I=G(K);n.className=n.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?M(K):Y(K)}function G(K){return K.lineCount()===1&&K.getLine(0)===""}})},"1eCo":function(ut,ve,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";var Y={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ne.defineMode("xml",function(z,P){var F=z.indentUnit,G={},K=P.htmlMode?Y:M;for(var n in K)G[n]=K[n];for(var n in P)G[n]=P[n];var I,b;function f(d,C){function E(W){return C.tokenize=W,W(d,C)}var w=d.next();if(w=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?E(a("atom","]]>")):null:d.match("--")?E(a("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),E(p(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),C.tokenize=a("meta","?>"),"meta"):(I=d.eat("/")?"closeTag":"openTag",C.tokenize=y,"tag bracket");if(w=="&"){var j;return d.eat("#")?d.eat("x")?j=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):j=d.eatWhile(/[\d]/)&&d.eat(";"):j=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),j?"atom":"error"}else return d.eatWhile(/[^&<]/),null}f.isInText=!0;function y(d,C){var E=d.next();if(E==">"||E=="/"&&d.eat(">"))return C.tokenize=f,I=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return I="equals",null;if(E=="<"){C.tokenize=f,C.state=i,C.tagName=C.tagStart=null;var w=C.tokenize(d,C);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=c(E),C.stringStartCol=d.column(),C.tokenize(d,C)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function c(d){var C=function(E,w){for(;!E.eol();)if(E.next()==d){w.tokenize=y;break}return"string"};return C.isInAttribute=!0,C}function a(d,C){return function(E,w){for(;!E.eol();){if(E.match(C)){w.tokenize=f;break}E.next()}return d}}function p(d){return function(C,E){for(var w;(w=C.next())!=null;){if(w=="<")return E.tokenize=p(d+1),E.tokenize(C,E);if(w==">")if(d==1){E.tokenize=f;break}else return E.tokenize=p(d-1),E.tokenize(C,E)}return"meta"}}function l(d,C,E){this.prev=d.context,this.tagName=C,this.indent=d.indented,this.startOfLine=E,(G.doNotIndent.hasOwnProperty(C)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function u(d){d.context&&(d.context=d.context.prev)}function s(d,C){for(var E;;){if(!d.context)return;if(E=d.context.tagName,!G.contextGrabbers.hasOwnProperty(E)||!G.contextGrabbers[E].hasOwnProperty(C))return;u(d)}}function i(d,C,E){return d=="openTag"?(E.tagStart=C.column(),D):d=="closeTag"?A:i}function D(d,C,E){return d=="word"?(E.tagName=C.current(),b="tag",O):G.allowMissingTagName&&d=="endTag"?(b="tag bracket",O(d,C,E)):(b="error",D)}function A(d,C,E){if(d=="word"){var w=C.current();return E.context&&E.context.tagName!=w&&G.implicitlyClosed.hasOwnProperty(E.context.tagName)&&u(E),E.context&&E.context.tagName==w||G.matchClosing===!1?(b="tag",S):(b="tag error",R)}else return G.allowMissingTagName&&d=="endTag"?(b="tag bracket",S(d,C,E)):(b="error",R)}function S(d,C,E){return d!="endTag"?(b="error",S):(u(E),i)}function R(d,C,E){return b="error",S(d,C,E)}function O(d,C,E){if(d=="word")return b="attribute",m;if(d=="endTag"||d=="selfcloseTag"){var w=E.tagName,j=E.tagStart;return E.tagName=E.tagStart=null,d=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(w)?s(E,w):(s(E,w),E.context=new l(E,w,j==E.indented)),i}return b="error",O}function m(d,C,E){return d=="equals"?v:(G.allowMissing||(b="error"),O(d,C,E))}function v(d,C,E){return d=="string"?h:d=="word"&&G.allowUnquoted?(b="string",O):(b="error",O(d,C,E))}function h(d,C,E){return d=="string"?h:O(d,C,E)}return{startState:function(d){var C={tokenize:f,state:i,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(C.baseIndent=d),C},token:function(d,C){if(!C.tagName&&d.sol()&&(C.indented=d.indentation()),d.eatSpace())return null;I=null;var E=C.tokenize(d,C);return(E||I)&&E!="comment"&&(b=null,C.state=C.state(I||E,d,C),b&&(E=b=="error"?E+" error":b)),E},indent:function(d,C,E){var w=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+F;if(w&&w.noIndent)return ne.Pass;if(d.tokenize!=y&&d.tokenize!=f)return E?E.match(/^(\s*)/)[0].length:0;if(d.tagName)return G.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+F*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var j=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(j&&j[1])for(;w;)if(w.tagName==j[2]){w=w.prev;break}else if(G.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(j)for(;w;){var W=G.contextGrabbers[w.tagName];if(W&&W.hasOwnProperty(j[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+F:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(d){d.state==v&&(d.state=O)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var C=[],E=d.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),ne.defineMIME("text/xml","xml"),ne.defineMIME("application/xml","xml"),ne.mimeModes.hasOwnProperty("text/html")||ne.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(ut,ve,U){ut.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return Y});class ne{constructor(M){this.element=M,this.next=ne.Undefined,this.prev=ne.Undefined}}ne.Undefined=new ne(void 0);class Y{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let M=this._first;for(;M!==ne.Undefined;){const z=M.next;M.prev=ne.Undefined,M.next=ne.Undefined,M=z}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(M){return this._insert(M,!1)}push(M){return this._insert(M,!0)}_insert(M,z){const P=new ne(M);if(this._first===ne.Undefined)this._first=P,this._last=P;else if(z){const G=this._last;this._last=P,P.prev=G,G.next=P}else{const G=this._first;this._first=P,P.next=G,G.prev=P}this._size+=1;let F=!1;return()=>{F||(F=!0,this._remove(P))}}shift(){if(this._first===ne.Undefined)return;{const M=this._first.element;return this._remove(this._first),M}}pop(){if(this._last===ne.Undefined)return;{const M=this._last.element;return this._remove(this._last),M}}_remove(M){if(M.prev!==ne.Undefined&&M.next!==ne.Undefined){const z=M.prev;z.next=M.next,M.next.prev=z}else M.prev===ne.Undefined&&M.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):M.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):M.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let M=this._first;for(;M!==ne.Undefined;)yield M.element,M=M.next}}},"3/fG":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return Y});function ne(M,z){let P;return z.length===0?P=M:P=M.replace(/\{(\d+)\}/g,function(F,G){const K=G[0];return typeof z[K]!="undefined"?z[K]:F}),P}function Y(M,z,...P){return ne(z,P)}},"55Ip":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return s});var ne=U("Ty5D"),Y=U("dI71"),M=U("q1tI"),z=U.n(M),P=U("YS25"),F=U("17x9"),G=U.n(F),K=U("wx14"),n=U("zLVn"),I=U("9R94"),b=function(v){Object(Y.a)(h,v);function h(){for(var C,E=arguments.length,w=new Array(E),j=0;j<E;j++)w[j]=arguments[j];return C=v.call.apply(v,[this].concat(w))||this,C.history=Object(P.a)(C.props),C}var d=h.prototype;return d.render=function(){return z.a.createElement(ne.c,{history:this.history,children:this.props.children})},h}(z.a.Component),f=function(v){Object(Y.a)(h,v);function h(){for(var C,E=arguments.length,w=new Array(E),j=0;j<E;j++)w[j]=arguments[j];return C=v.call.apply(v,[this].concat(w))||this,C.history=Object(P.b)(C.props),C}var d=h.prototype;return d.render=function(){return z.a.createElement(ne.c,{history:this.history,children:this.props.children})},h}(z.a.Component),y=function(h,d){return typeof h=="function"?h(d):h},c=function(h,d){return typeof h=="string"?Object(P.c)(h,null,null,d):h},a=function(h){return h},p=z.a.forwardRef;typeof p=="undefined"&&(p=a);function l(v){return!!(v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)}var u=p(function(v,h){var d=v.innerRef,C=v.navigate,E=v.onClick,w=Object(n.a)(v,["innerRef","navigate","onClick"]),j=w.target,W=Object(K.a)({},w,{onClick:function(N){try{E&&E(N)}catch(_){throw N.preventDefault(),_}!N.defaultPrevented&&N.button===0&&(!j||j==="_self")&&!l(N)&&(N.preventDefault(),C())}});return a!==p?W.ref=h||d:W.ref=d,z.a.createElement("a",W)}),s=p(function(v,h){var d=v.component,C=d===void 0?u:d,E=v.replace,w=v.to,j=v.innerRef,W=Object(n.a)(v,["component","replace","to","innerRef"]);return z.a.createElement(ne.e.Consumer,null,function(T){T||Object(I.a)(!1);var N=T.history,_=c(y(w,T.location),T.location),x=_?N.createHref(_):"",H=Object(K.a)({},W,{href:x,navigate:function(){var ee=y(w,T.location),J=E?N.replace:N.push;J(ee)}});return a!==p?H.ref=h||j:H.innerRef=j,z.a.createElement(C,H)})});if(!1)var i,D;var A=function(h){return h},S=z.a.forwardRef;typeof S=="undefined"&&(S=A);function R(){for(var v=arguments.length,h=new Array(v),d=0;d<v;d++)h[d]=arguments[d];return h.filter(function(C){return C}).join(" ")}var O=S(function(v,h){var d=v["aria-current"],C=d===void 0?"page":d,E=v.activeClassName,w=E===void 0?"active":E,j=v.activeStyle,W=v.className,T=v.exact,N=v.isActive,_=v.location,x=v.sensitive,H=v.strict,X=v.style,ee=v.to,J=v.innerRef,ce=Object(n.a)(v,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return z.a.createElement(ne.e.Consumer,null,function(me){me||Object(I.a)(!1);var ue=_||me.location,pe=c(y(ee,ue),ue),xe=pe.pathname,se=xe&&xe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ae=se?Object(ne.f)(ue.pathname,{path:se,exact:T,sensitive:x,strict:H}):null,Ce=!!(N?N(ae,ue):ae),ze=Ce?R(W,w):W,Ye=Ce?Object(K.a)({},X,{},j):X,He=Object(K.a)({"aria-current":Ce&&C||null,className:ze,style:Ye,to:pe},ce);return A!==S?He.ref=h||J:He.innerRef=J,z.a.createElement(s,He)})});if(!1)var m},"5VLF":function(ut,ve,U){"use strict";var ne,Y;function M(z,P,F){var G=function(K,n){return z.js_beautify(K,n)};return G.js=z.js_beautify,G.css=P.css_beautify,G.html=F.html_beautify,G.js_beautify=z.js_beautify,G.css_beautify=P.css_beautify,G.html_beautify=F.html_beautify,G}!(ne=[U("6UM0"),U("TXwP"),U("psGv")],Y=function(z,P,F){return M(z,P,F)}.apply(ve,ne),Y!==void 0&&(ut.exports=Y))},"5Y4S":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return M});var ne=U("MNsG");const Y=ne.b.performance&&typeof ne.b.performance.now=="function";class M{constructor(z){this._highResolution=Y&&z,this._startTime=this._now(),this._stopTime=-1}static create(z=!0){return new M(z)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?ne.b.performance.now():Date.now()}}},"6+eU":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return S});var ne=U("wx14"),Y=U("rePB"),M=U("VTBJ"),z=U("1OyB"),P=U("vuIU"),F=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U.n(K),I=U("TSYQ"),b=U.n(I),f=function(O){var m,v="".concat(O.rootPrefixCls,"-item"),h=b()(v,"".concat(v,"-").concat(O.page),(m={},Object(Y.a)(m,"".concat(v,"-active"),O.active),Object(Y.a)(m,O.className,!!O.className),Object(Y.a)(m,"".concat(v,"-disabled"),!O.page),m)),d=function(){O.onClick(O.page)},C=function(w){O.onKeyPress(w,O.onClick,O.page)};return n.a.createElement("li",{title:O.showTitle?O.page:null,className:h,onClick:d,onKeyPress:C,tabIndex:"0"},O.itemRender(O.page,"page",n.a.createElement("a",{rel:"nofollow"},O.page)))},y=f,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(R){Object(F.a)(m,R);var O=Object(G.a)(m);function m(){var v;Object(z.a)(this,m);for(var h=arguments.length,d=new Array(h),C=0;C<h;C++)d[C]=arguments[C];return v=O.call.apply(O,[this].concat(d)),v.state={goInputText:""},v.buildOptionText=function(E){return"".concat(E," ").concat(v.props.locale.items_per_page)},v.changeSize=function(E){v.props.changeSize(Number(E))},v.handleChange=function(E){v.setState({goInputText:E.target.value})},v.handleBlur=function(E){var w=v.props,j=w.goButton,W=w.quickGo,T=w.rootPrefixCls,N=v.state.goInputText;if(j||N==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(T,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(T,"-next"))>=0))return;v.setState({goInputText:""}),W(v.getValidValue())},v.go=function(E){var w=v.state.goInputText;if(w==="")return;(E.keyCode===c.ENTER||E.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(P.a)(m,[{key:"getValidValue",value:function(){var h=this.state,d=h.goInputText,C=h.current;return!d||isNaN(d)?C:Number(d)}},{key:"getPageSizeOptions",value:function(){var h=this.props,d=h.pageSize,C=h.pageSizeOptions;return C.some(function(E){return E.toString()===d.toString()})?C:C.concat([d.toString()]).sort(function(E,w){var j=isNaN(Number(E))?0:Number(E),W=isNaN(Number(w))?0:Number(w);return j-W})}},{key:"render",value:function(){var h=this,d=this.props,C=d.pageSize,E=d.locale,w=d.rootPrefixCls,j=d.changeSize,W=d.quickGo,T=d.goButton,N=d.selectComponentClass,_=d.buildOptionText,x=d.selectPrefixCls,H=d.disabled,X=this.state.goInputText,ee="".concat(w,"-options"),J=N,ce=null,me=null,ue=null;if(!j&&!W)return null;var pe=this.getPageSizeOptions();if(j&&J){var xe=pe.map(function(se,ae){return n.a.createElement(J.Option,{key:ae,value:se.toString()},(_||h.buildOptionText)(se))});ce=n.a.createElement(J,{disabled:H,prefixCls:x,showSearch:!1,className:"".concat(ee,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||pe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ae){return ae.parentNode}},xe)}return W&&(T&&(ue=typeof T=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(ee,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},T)),me=n.a.createElement("div",{className:"".concat(ee,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:H,type:"text",value:X,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ue)),n.a.createElement("li",{className:"".concat(ee)},ce,me)}}]),m}(n.a.Component);a.defaultProps={pageSizeOptions:["10","20","50","100"]};var p=a,l=U("N2Kk");function u(){}function s(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function i(R,O,m){return m}function D(R,O,m){var v=typeof R=="undefined"?O.pageSize:R;return Math.floor((m.total-1)/v)+1}var A=function(R){Object(F.a)(m,R);var O=Object(G.a)(m);function m(v){var h;Object(z.a)(this,m),h=O.call(this,v),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(D(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(j,W){var T=h.props.prefixCls,N=j||n.a.createElement("button",{type:"button","aria-label":W,className:"".concat(T,"-item-link")});return typeof j=="function"&&(N=n.a.createElement(j,Object(M.a)({},h.props))),N},h.savePaginationNode=function(j){h.paginationNode=j},h.isValid=function(j){return s(j)&&j!==h.state.current},h.shouldDisplayQuickJumper=function(){var j=h.props,W=j.showQuickJumper,T=j.pageSize,N=j.total;return N<=T?!1:W},h.handleKeyDown=function(j){(j.keyCode===c.ARROW_UP||j.keyCode===c.ARROW_DOWN)&&j.preventDefault()},h.handleKeyUp=function(j){var W=h.getValidValue(j),T=h.state.currentInputValue;W!==T&&h.setState({currentInputValue:W}),j.keyCode===c.ENTER?h.handleChange(W):j.keyCode===c.ARROW_UP?h.handleChange(W-1):j.keyCode===c.ARROW_DOWN&&h.handleChange(W+1)},h.changePageSize=function(j){var W=h.state.current,T=D(j,h.state,h.props);W=W>T?T:W,T===0&&(W=h.state.current),typeof j=="number"&&("pageSize"in h.props||h.setState({pageSize:j}),"current"in h.props||h.setState({current:W,currentInputValue:W})),h.props.onShowSizeChange(W,j),"onChange"in h.props&&h.props.onChange&&h.props.onChange(W,j)},h.handleChange=function(j){var W=h.props.disabled,T=j;if(h.isValid(T)&&!W){var N=D(void 0,h.state,h.props);T>N?T=N:T<1&&(T=1),"current"in h.props||h.setState({current:T,currentInputValue:T});var _=h.state.pageSize;return h.props.onChange(T,_),T}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<D(void 0,h.state,h.props)},h.runIfEnter=function(j,W){if(j.key==="Enter"||j.charCode===13){for(var T=arguments.length,N=new Array(T>2?T-2:0),_=2;_<T;_++)N[_-2]=arguments[_];W.apply(void 0,N)}},h.runIfEnterPrev=function(j){h.runIfEnter(j,h.prev)},h.runIfEnterNext=function(j){h.runIfEnter(j,h.next)},h.runIfEnterJumpPrev=function(j){h.runIfEnter(j,h.jumpPrev)},h.runIfEnterJumpNext=function(j){h.runIfEnter(j,h.jumpNext)},h.handleGoTO=function(j){(j.keyCode===c.ENTER||j.type==="click")&&h.handleChange(h.state.currentInputValue)};var d=v.onChange!==u,C="current"in v;C&&!d&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=v.defaultCurrent;"current"in v&&(E=v.current);var w=v.defaultPageSize;return"pageSize"in v&&(w=v.pageSize),E=Math.min(E,D(w,void 0,v)),h.state={current:E,currentInputValue:E,pageSize:w},h}return Object(P.a)(m,[{key:"componentDidUpdate",value:function(h,d){var C=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(d.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(h){var d=h.target.value,C=D(void 0,this.state,this.props),E=this.state.currentInputValue,w;return d===""?w=d:isNaN(Number(d))?w=E:d>=C?w=C:w=Number(d),w}},{key:"getShowSizeChanger",value:function(){var h=this.props,d=h.showSizeChanger,C=h.total,E=h.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:C>E}},{key:"renderPrev",value:function(h){var d=this.props,C=d.prevIcon,E=d.itemRender,w=E(h,"prev",this.getItemIcon(C,"prev page")),j=!this.hasPrev();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:j}):w}},{key:"renderNext",value:function(h){var d=this.props,C=d.nextIcon,E=d.itemRender,w=E(h,"next",this.getItemIcon(C,"next page")),j=!this.hasNext();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:j}):w}},{key:"render",value:function(){var h=this,d=this.props,C=d.prefixCls,E=d.className,w=d.style,j=d.disabled,W=d.hideOnSinglePage,T=d.total,N=d.locale,_=d.showQuickJumper,x=d.showLessItems,H=d.showTitle,X=d.showTotal,ee=d.simple,J=d.itemRender,ce=d.showPrevNextJumpers,me=d.jumpPrevIcon,ue=d.jumpNextIcon,pe=d.selectComponentClass,xe=d.selectPrefixCls,se=d.pageSizeOptions,ae=this.state,Ce=ae.current,ze=ae.pageSize,Ye=ae.currentInputValue;if(W===!0&&T<=ze)return null;var He=D(void 0,this.state,this.props),Ve=[],Fe=null,Ke=null,nt=null,he=null,Re=null,Ne=_&&_.goButton,Ue=x?1:2,rt=Ce-1>0?Ce-1:0,st=Ce+1<He?Ce+1:He,dt=Object.keys(this.props).reduce(function(de,fe){return(fe.substr(0,5)==="data-"||fe.substr(0,5)==="aria-"||fe==="role")&&(de[fe]=h.props[fe]),de},{});if(ee)return Ne&&(typeof Ne=="boolean"?Re=n.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},N.jump_to_confirm):Re=n.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Ne),Re=n.a.createElement("li",{title:H?"".concat(N.jump_to).concat(Ce,"/").concat(He):null,className:"".concat(C,"-simple-pager")},Re)),n.a.createElement("ul",Object(ne.a)({className:b()(C,"".concat(C,"-simple"),Object(Y.a)({},"".concat(C,"-disabled"),j),E),style:w,ref:this.savePaginationNode},dt),n.a.createElement("li",{title:H?N.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:b()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(rt)),n.a.createElement("li",{title:H?"".concat(Ce,"/").concat(He):null,className:"".concat(C,"-simple-pager")},n.a.createElement("input",{type:"text",value:Ye,disabled:j,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),n.a.createElement("span",{className:"".concat(C,"-slash")},"/"),He),n.a.createElement("li",{title:H?N.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:b()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(st)),Re);if(He<=3+Ue*2){var at={locale:N,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:J};He||Ve.push(n.a.createElement(y,Object(ne.a)({},at,{key:"noPager",page:He,className:"".concat(C,"-disabled")})));for(var bt=1;bt<=He;bt+=1){var gt=Ce===bt;Ve.push(n.a.createElement(y,Object(ne.a)({},at,{key:bt,page:bt,active:gt})))}}else{var xt=x?N.prev_3:N.prev_5,Je=x?N.next_3:N.next_5;ce&&(Fe=n.a.createElement("li",{title:H?xt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:b()("".concat(C,"-jump-prev"),Object(Y.a)({},"".concat(C,"-jump-prev-custom-icon"),!!me))},J(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(me,"prev page"))),Ke=n.a.createElement("li",{title:H?Je:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:b()("".concat(C,"-jump-next"),Object(Y.a)({},"".concat(C,"-jump-next-custom-icon"),!!ue))},J(this.getJumpNextPage(),"jump-next",this.getItemIcon(ue,"next page")))),he=n.a.createElement(y,{locale:N,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:!1,showTitle:H,itemRender:J}),nt=n.a.createElement(y,{locale:N,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:J});var kt=Math.max(1,Ce-Ue),Ot=Math.min(Ce+Ue,He);Ce-1<=Ue&&(Ot=1+Ue*2),He-Ce<=Ue&&(kt=He-Ue*2);for(var tt=kt;tt<=Ot;tt+=1){var ft=Ce===tt;Ve.push(n.a.createElement(y,{locale:N,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:tt,page:tt,active:ft,showTitle:H,itemRender:J}))}Ce-1>=Ue*2&&Ce!==1+2&&(Ve[0]=Object(K.cloneElement)(Ve[0],{className:"".concat(C,"-item-after-jump-prev")}),Ve.unshift(Fe)),He-Ce>=Ue*2&&Ce!==He-2&&(Ve[Ve.length-1]=Object(K.cloneElement)(Ve[Ve.length-1],{className:"".concat(C,"-item-before-jump-next")}),Ve.push(Ke)),kt!==1&&Ve.unshift(nt),Ot!==He&&Ve.push(he)}var be=null;X&&(be=n.a.createElement("li",{className:"".concat(C,"-total-text")},X(T,[T===0?0:(Ce-1)*ze+1,Ce*ze>T?T:Ce*ze])));var Ee=!this.hasPrev()||!He,ge=!this.hasNext()||!He;return n.a.createElement("ul",Object(ne.a)({className:b()(C,E,Object(Y.a)({},"".concat(C,"-disabled"),j)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},dt),be,n.a.createElement("li",{title:H?N.prev_page:null,onClick:this.prev,tabIndex:Ee?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),Ee)),"aria-disabled":Ee},this.renderPrev(rt)),Ve,n.a.createElement("li",{title:H?N.next_page:null,onClick:this.next,tabIndex:ge?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),ge)),"aria-disabled":ge},this.renderNext(st)),n.a.createElement(p,{disabled:j,locale:N,rootPrefixCls:C,selectComponentClass:pe,selectPrefixCls:xe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ce,pageSize:ze,pageSizeOptions:se,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ne}))}}],[{key:"getDerivedStateFromProps",value:function(h,d){var C={};if("current"in h&&(C.current=h.current,h.current!==d.current&&(C.currentInputValue=C.current)),"pageSize"in h&&h.pageSize!==d.pageSize){var E=d.current,w=D(h.pageSize,d,h);E=E>w?w:E,"current"in h||(C.current=E,C.currentInputValue=E),C.pageSize=h.pageSize}return C}}]),m}(n.a.Component);A.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:u,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:u,locale:l.a,style:{},itemRender:i,totalBoundaryShowSizeChanger:50};var S=A},"6UM0":function(ut,ve,U){var ne,Y;(function(){var M;(function(){"use strict";var P=[function(n,I,b){var f=b(1).Beautifier,y=b(5).Options;function c(a,p){var l=new f(a,p);return l.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new y}},function(n,I,b){var f=b(2).Output,y=b(3).Token,c=b(4),a=b(5).Options,p=b(7).Tokenizer,l=b(7).line_starters,u=b(7).positionable_operators,s=b(7).TOKEN;function i(x,H){return H.indexOf(x)!==-1}function D(x){return x.replace(/^\s+/g,"")}function A(x){for(var H={},X=0;X<x.length;X++)H[x[X].replace(/-/g,"_")]=x[X];return H}function S(x,H){return x&&x.type===s.RESERVED&&x.text===H}function R(x,H){return x&&x.type===s.RESERVED&&i(x.text,H)}var O=["case","return","do","if","throw","else","await","break","continue","async"],m=["before-newline","after-newline","preserve-newline"],v=A(m),h=[v.before_newline,v.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(x,H){if(H.multiline_frame||H.mode===d.ForInitializer||H.mode===d.Conditional)return;x.remove_indent(H.start_line_index)}function E(x){x=x.replace(c.allLineBreaks,`
`);for(var H=[],X=x.indexOf(`
`);X!==-1;)H.push(x.substring(0,X)),x=x.substring(X+1),X=x.indexOf(`
`);return x.length&&H.push(x),H}function w(x){return x===d.ArrayLiteral}function j(x){return i(x,[d.Expression,d.ForInitializer,d.Conditional])}function W(x,H){for(var X=0;X<x.length;X++){var ee=x[X].trim();if(ee.charAt(0)!==H)return!1}return!0}function T(x,H){for(var X=0,ee=x.length,J;X<ee;X++)if(J=x[X],J&&J.indexOf(H)!==0)return!1;return!0}function N(x,H){H=H||{},this._source_text=x||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(H)}N.prototype.create_flags=function(x,H){var X=0;x&&(X=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>X&&(X=x.line_indent_level));var ee={mode:H,parent:x,last_token:x?x.last_token:new y(s.START_BLOCK,""),last_word:x?x.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:X,alignment:0,line_indent_level:x?x.line_indent_level:X,start_line_index:this._output.get_line_number(),ternary_depth:0};return ee},N.prototype._reset=function(x){var H=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var X=new p(x,this._options);return this._tokens=X.tokenize(),x},N.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,H=this._reset(this._source_text),X=this._options.eol;this._options.eol==="auto"&&(X=`
`,H&&c.lineBreak.test(H||"")&&(X=H.match(c.lineBreak)[0]));for(var ee=this._tokens.next();ee;)this.handle_token(ee),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ee,ee=this._tokens.next();return x=this._output.get_code(X),x},N.prototype.handle_token=function(x,H){x.type===s.START_EXPR?this.handle_start_expr(x):x.type===s.END_EXPR?this.handle_end_expr(x):x.type===s.START_BLOCK?this.handle_start_block(x):x.type===s.END_BLOCK?this.handle_end_block(x):x.type===s.WORD?this.handle_word(x):x.type===s.RESERVED?this.handle_word(x):x.type===s.SEMICOLON?this.handle_semicolon(x):x.type===s.STRING?this.handle_string(x):x.type===s.EQUALS?this.handle_equals(x):x.type===s.OPERATOR?this.handle_operator(x):x.type===s.COMMA?this.handle_comma(x):x.type===s.BLOCK_COMMENT?this.handle_block_comment(x,H):x.type===s.COMMENT?this.handle_comment(x,H):x.type===s.DOT?this.handle_dot(x):x.type===s.EOF?this.handle_eof(x):x.type===s.UNKNOWN?this.handle_unknown(x,H):this.handle_unknown(x,H)},N.prototype.handle_whitespace_and_comments=function(x,H){var X=x.newlines,ee=this._options.keep_array_indentation&&w(this._flags.mode);if(x.comments_before)for(var J=x.comments_before.next();J;)this.handle_whitespace_and_comments(J,H),this.handle_token(J,H),J=x.comments_before.next();if(ee)for(var ce=0;ce<X;ce+=1)this.print_newline(ce>0,H);else if(this._options.max_preserve_newlines&&X>this._options.max_preserve_newlines&&(X=this._options.max_preserve_newlines),this._options.preserve_newlines&&X>1){this.print_newline(!1,H);for(var me=1;me<X;me+=1)this.print_newline(!0,H)}};var _=["async","break","continue","return","throw","yield"];N.prototype.allow_wrap_or_preserved_newline=function(x,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var X=this._options.preserve_newlines&&x.newlines||H,ee=i(this._flags.last_token.text,u)||i(x.text,u);if(ee){var J=i(this._flags.last_token.text,u)&&i(this._options.operator_position,h)||i(x.text,u);X=X&&J}if(X)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,_))return;this._output.set_wrap_point()}},N.prototype.print_newline=function(x,H){if(!H&&(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 X=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(X,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},N.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||w(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(x.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},N.prototype.print_token=function(x){if(this._output.raw){this._output.add_raw_token(x);return}if(this._options.comma_first&&x.previous&&x.previous.type===s.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(x),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(x),this._output.non_breaking_space=!0,this._output.add_token(x.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},N.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.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))},N.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},N.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},N.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},N.prototype.start_of_statement=function(x){var H=!1;return H=H||R(this._flags.last_token,["var","let","const"])&&x.type===s.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&R(this._flags.last_token,_)&&!x.newlines,H=H||S(this._flags.last_token,"else")&&!(S(x,"if")&&!x.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==s.WORD&&x.type!==s.RESERVED,H=H||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),H?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,R(x,["do","for","if","while"])),!0):!1},N.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var H=d.Expression;if(x.text==="["){if(this._flags.last_token.type===s.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=d.ArrayLiteral,w(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),i(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,H=d.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=d.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(i(this._flags.last_token.text,l)||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(x);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var X=this._tokens.peek(-3);if(this._options.space_after_named_function&&X){var ee=this._tokens.peek(-4);R(X,["async","function"])||X.text==="*"&&R(ee,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(X.text==="{"||X.text===","||X.text==="*"&&(ee.text==="{"||ee.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(x);(this._flags.last_token.type===s.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&i(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(x,x.newlines),this.print_token(x),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},N.prototype.handle_end_expr=function(x){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&w(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===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(x),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},N.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var H=this._tokens.peek(),X=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):X&&(i(X.text,[":",","])&&i(H.type,[s.STRING,s.WORD,s.RESERVED])||i(H.text,["get","set","..."])&&i(X.type,[s.WORD,s.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(X.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):i(this._flags.last_token.type,[s.EQUALS,s.START_EXPR,s.COMMA,s.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ee=!H.comments_before&&H.text==="}",J=ee&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var ce=0,me=null;this._flags.inline_frame=!0;do if(ce+=1,me=this._tokens.peek(ce-1),me.newlines){this._flags.inline_frame=!1;break}while(me.type!==s.EOF&&!(me.type===s.END_BLOCK&&me.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(J||this._flags.last_token.type===s.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(w(this._previous_flags.mode)&&(this._flags.last_token.type===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(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==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(x),this.indent(),!ee&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},N.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===d.Statement;)this.restore_mode();var H=this._flags.last_token.type===s.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(w(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},N.prototype.handle_word=function(x){if(x.type===s.RESERVED){if(i(x.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)x.type=s.WORD;else if(x.text==="import"&&i(this._tokens.peek().text,["(","."]))x.type=s.WORD;else if(i(x.text,["as","from"])&&!this._flags.import_block)x.type=s.WORD;else if(this._flags.mode===d.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(x.type=s.WORD)}}if(this.start_of_statement(x)?R(this._flags.last_token,["var","let","const"])&&x.type===s.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!j(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||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(S(x,"while")){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&S(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(x,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===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(x)),S(x,"function")){(i(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(i(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===s.OPERATOR))&&(!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,_)?this._output.space_before_token=!0:S(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&&(j(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var X="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?X="SPACE":R(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?X="NEWLINE":(X="SPACE",this._output.space_before_token=!0):X="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===d.BlockStatement?X="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&j(this._flags.mode)?X="SPACE":this._flags.last_token.type===s.STRING?X="NEWLINE":this._flags.last_token.type===s.RESERVED||this._flags.last_token.type===s.WORD||this._flags.last_token.text==="*"&&(i(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&i(this._last_last_text,["{",","]))?X="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?X="SPACE":X="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,X="NEWLINE"),R(x,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?X="SPACE":X="NEWLINE"),R(x,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ee=this._output.current_line;ee.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else X==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==s.END_EXPR?(this._flags.last_token.type!==s.START_EXPR||!R(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(x,"if")&&S(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(x,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&w(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():X==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===s.WORD||x.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===s.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(x,"from")&&(this._flags.import_block=!1))},N.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var H=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},N.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),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(x):x.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},N.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},N.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(j(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},N.prototype.handle_operator=function(x){var H=x.text==="*"&&(R(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),X=i(x.text,["-","+"])&&(i(this._flags.last_token.type,[s.START_BLOCK,s.START_EXPR,s.EQUALS,s.OPERATOR])||i(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var ee=!H;this.handle_whitespace_and_comments(x,ee)}if(x.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(this._flags.last_token.type===s.OPERATOR&&i(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==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 J=!0,ce=!0,me=!1;if(x.text===":"?this._flags.ternary_depth===0?J=!1:(this._flags.ternary_depth-=1,me=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!X&&!H&&this._options.preserve_newlines&&i(x.text,u)){var ue=x.text===":",pe=ue&&me,xe=ue&&!me;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!xe,this.print_token(x),(!ue||pe)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!ue||pe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case v.preserve_newline:xe||this.allow_wrap_or_preserved_newline(x),J=!(this._output.just_added_newline()||xe),this._output.space_before_token=J,this.print_token(x),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(x),J=!1;var se=this._tokens.peek();ce=se&&i(se.type,[s.WORD,s.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),J=this._flags.last_token.type===s.START_BLOCK,ce=!1;else if(i(x.text,["--","++","!","~"])||X){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),J=!1,ce=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var ae=R(this._flags.last_token,O)&&x.newlines;ae&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ae,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(J=!0),this._flags.last_token.type===s.RESERVED?J=!0:this._flags.last_token.type===s.END_EXPR?J=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===s.OPERATOR&&(J=i(x.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(x.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(ce=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||J,this.print_token(x),this._output.space_before_token=ce},N.prototype.handle_block_comment=function(x,H){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,H),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!c.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,H)},N.prototype.print_block_commment=function(x,H){var X=E(x.text),ee,J=!1,ce=!1,me=x.whitespace_before,ue=me.length;if(this.print_newline(!1,H),this.print_token_line_indentation(x),this._output.add_token(X[0]),this.print_newline(!1,H),X.length>1){for(X=X.slice(1),J=W(X,"*"),ce=T(X,me),J&&(this._flags.alignment=1),ee=0;ee<X.length;ee++)J?(this.print_token_line_indentation(x),this._output.add_token(D(X[ee]))):ce&&X[ee]?(this.print_token_line_indentation(x),this._output.add_token(X[ee].substring(ue))):(this._output.current_line.set_indent(-1),this._output.add_token(X[ee])),this.print_newline(!1,H);this._flags.alignment=0}},N.prototype.handle_comment=function(x,H){x.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,H)},N.prototype.handle_dot=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(x,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(x)},N.prototype.handle_unknown=function(x,H){this.print_token(x),x.text[x.text.length-1]===`
`&&this.print_newline(!1,H)},N.prototype.handle_eof=function(x){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},n.exports.Beautifier=N},function(n){function I(y){this.__parent=y,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 y=new I(this.__parent);return y.set_indent(this.__indent_count,this.__alignment_count),y},I.prototype.item=function(y){return y<0?this.__items[this.__items.length+y]:this.__items[y]},I.prototype.has_match=function(y){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(y))return!0;return!1},I.prototype.set_indent=function(y,c){this.is_empty()&&(this.__indent_count=y||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 y=this.__parent.current_line;return y.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),y.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),y.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,y.__items[0]===" "&&(y.__items.splice(0,1),y.__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(y){this.__items.push(y);var c=y.lastIndexOf(`
`);c!==-1?this.__character_count=y.length-c:this.__character_count+=y.length},I.prototype.pop=function(){var y=null;return this.is_empty()||(y=this.__items.pop(),this.__character_count-=y.length),y},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 y="";return this.is_empty()?this.__parent.indent_empty_lines&&(y=this.__parent.get_indent_string(this.__indent_count)):(y=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),y+=this.__items.join("")),y};function b(y,c){this.__cache=[""],this.__indent_size=y.indent_size,this.__indent_string=y.indent_char,y.indent_with_tabs||(this.__indent_string=new Array(y.indent_size+1).join(y.indent_char)),c=c||"",y.indent_level>0&&(c=new Array(y.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}b.prototype.get_indent_size=function(y,c){var a=this.__base_string_length;return c=c||0,y<0&&(a=0),a+=y*this.__indent_size,a+=c,a},b.prototype.get_indent_string=function(y,c){var a=this.__base_string;return c=c||0,y<0&&(y=0,a=""),c+=y*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},b.prototype.__ensure_cache=function(y){for(;y>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var y=this.__cache.length,c=0,a="";this.__indent_size&&y>=this.__indent_size&&(c=Math.floor(y/this.__indent_size),y-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),y&&(a+=new Array(y+1).join(" ")),this.__cache.push(a)};function f(y,c){this.__indent_cache=new b(y,c),this.raw=!1,this._end_with_newline=y.end_with_newline,this.indent_size=y.indent_size,this.wrap_line_length=y.wrap_line_length,this.indent_empty_lines=y.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()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(y,c){return this.__indent_cache.get_indent_string(y,c)},f.prototype.get_indent_size=function(y,c){return this.__indent_cache.get_indent_size(y,c)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(y){return this.is_empty()||!y&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(y){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 y!==`
`&&(a=a.replace(/[\n]/g,y)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(y,c){return y=y||0,c=c||0,this.next_line.set_indent(y,c),this.__lines.length>1?(this.current_line.set_indent(y,c),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(y){for(var c=0;c<y.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(y.whitespace_before),this.current_line.push(y.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(y){this.__add_space_before_token(),this.current_line.push(y),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(y){for(var c=this.__lines.length;y<c;)this.__lines[y]._remove_indent(),y++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(y){for(y=y===void 0?!1:y,this.current_line.trim();y&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(y,c){for(var a=this.__lines.length-2;a>=0;){var p=this.__lines[a];if(p.is_empty())break;if(p.item(0).indexOf(y)!==0&&p.item(-1)!==c){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},n.exports.Output=f},function(n){function I(b,f,y,c){this.type=b,this.text=f,this.comments_before=null,this.newlines=y||0,this.whitespace_before=c||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=I},function(n,I){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",y="\\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}|["+b+y+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+f+y+c+"])*";I.identifier=new RegExp(a+p,"g"),I.identifierStart=new RegExp(a),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+y+c+"])+");var l=/[\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(n,I,b){var f=b(6).Options,y=["before-newline","after-newline","preserve-newline"];function c(a){f.call(this,a,"js");var p=this.raw_options.brace_style||null;p==="expand-strict"?this.raw_options.brace_style="expand":p==="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 l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var u=0;u<l.length;u++)l[u]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=l[u];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",y),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}c.prototype=new f,n.exports.Options=c},function(n){function I(y,c){this.raw_options=b(y,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(y,c){var a=this.raw_options[y],p=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(p=a.concat()):typeof a=="string"&&(p=a.split(/[^a-zA-Z0-9_\/\-]+/)),p},I.prototype._get_boolean=function(y,c){var a=this.raw_options[y],p=a===void 0?!!c:!!a;return p},I.prototype._get_characters=function(y,c){var a=this.raw_options[y],p=c||"";return typeof a=="string"&&(p=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},I.prototype._get_number=function(y,c){var a=this.raw_options[y];c=parseInt(c,10),isNaN(c)&&(c=0);var p=parseInt(a,10);return isNaN(p)&&(p=c),p},I.prototype._get_selection=function(y,c,a){var p=this._get_selection_list(y,c,a);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+y+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[y]+"'");return p[0]},I.prototype._get_selection_list=function(y,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 p=this._get_array(y,a);if(!this._is_valid_selection(p,c))throw new Error("Invalid Option Value: The option '"+y+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[y]+"'");return p},I.prototype._is_valid_selection=function(y,c){return y.length&&c.length&&!y.some(function(a){return c.indexOf(a)===-1})};function b(y,c){var a={};y=f(y);var p;for(p in y)p!==c&&(a[p]=y[p]);if(c&&y[c])for(p in y[c])a[p]=y[c][p];return a}function f(y){var c={},a;for(a in y){var p=a.replace(/-/g,"_");c[p]=y[a]}return c}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=b},function(n,I,b){var f=b(8).InputScanner,y=b(9).Tokenizer,c=b(9).TOKEN,a=b(13).Directives,p=b(4),l=b(12).Pattern,u=b(14).TemplatablePattern;function s(W,T){return T.indexOf(W)!==-1}var i={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},D=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_]+)?/,S=/[0-9]/,R=/[^\d\.]/,O=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var v=new RegExp(m),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+d.join("|")+")$"),E,w=function(W,T){y.call(this,W,T),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var N=new l(this._input),_=new u(this._input).read_options(this._options);this.__patterns={template:_,identifier:_.starting_with(p.identifier).matching(p.identifierMatch),number:N.matching(A),punct:N.matching(v),comment:N.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:N.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:N.matching(/<!--/),html_comment_end:N.matching(/-->/),include:N.starting_with(/#include/).until_after(p.lineBreak),shebang:N.starting_with(/#!/).until_after(p.lineBreak),xml:N.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:_.until(/['\\\n\r\u2028\u2029]/),double_quote:_.until(/["\\\n\r\u2028\u2029]/),template_text:_.until(/[`\\$]/),template_expression:_.until(/[`}\\]/)}};w.prototype=new y,w.prototype._is_comment=function(W){return W.type===i.COMMENT||W.type===i.BLOCK_COMMENT||W.type===i.UNKNOWN},w.prototype._is_opening=function(W){return W.type===i.START_BLOCK||W.type===i.START_EXPR},w.prototype._is_closing=function(W,T){return(W.type===i.END_BLOCK||W.type===i.END_EXPR)&&T&&(W.text==="]"&&T.text==="["||W.text===")"&&T.text==="("||W.text==="}"&&T.text==="{")},w.prototype._reset=function(){E=!1},w.prototype._get_next_token=function(W,T){var N=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(i.EOF,""):(N=N||this._read_non_javascript(_),N=N||this._read_string(_),N=N||this._read_word(W),N=N||this._read_singles(_),N=N||this._read_comment(_),N=N||this._read_regexp(_,W),N=N||this._read_xml(_,W),N=N||this._read_punctuation(),N=N||this._create_token(i.UNKNOWN,this._input.next()),N)},w.prototype._read_word=function(W){var T;if(T=this.__patterns.identifier.read(),T!=="")return T=T.replace(p.allLineBreaks,`
`),!(W.type===i.DOT||W.type===i.RESERVED&&(W.text==="set"||W.text==="get"))&&C.test(T)?(T==="in"||T==="of")&&(W.type===i.WORD||W.type===i.STRING)?this._create_token(i.OPERATOR,T):this._create_token(i.RESERVED,T):this._create_token(i.WORD,T);if(T=this.__patterns.number.read(),T!=="")return this._create_token(i.WORD,T)},w.prototype._read_singles=function(W){var T=null;return W==="("||W==="["?T=this._create_token(i.START_EXPR,W):W===")"||W==="]"?T=this._create_token(i.END_EXPR,W):W==="{"?T=this._create_token(i.START_BLOCK,W):W==="}"?T=this._create_token(i.END_BLOCK,W):W===";"?T=this._create_token(i.SEMICOLON,W):W==="."&&R.test(this._input.peek(1))?T=this._create_token(i.DOT,W):W===","&&(T=this._create_token(i.COMMA,W)),T&&this._input.next(),T},w.prototype._read_punctuation=function(){var W=this.__patterns.punct.read();if(W!=="")return W==="="?this._create_token(i.EQUALS,W):W==="?."?this._create_token(i.DOT,W):this._create_token(i.OPERATOR,W)},w.prototype._read_non_javascript=function(W){var T="";if(W==="#"){if(this._is_first_token()&&(T=this.__patterns.shebang.read(),T))return this._create_token(i.UNKNOWN,T.trim()+`
`);if(T=this.__patterns.include.read(),T)return this._create_token(i.UNKNOWN,T.trim()+`
`);W=this._input.next();var N="#";if(this._input.hasNext()&&this._input.testChar(S)){do W=this._input.next(),N+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(N+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(N+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,N)}this._input.back()}else if(W==="<"&&this._is_first_token()){if(T=this.__patterns.html_comment_start.read(),T){for(;this._input.hasNext()&&!this._input.testChar(p.newline);)T+=this._input.next();return E=!0,this._create_token(i.COMMENT,T)}}else if(E&&W==="-"&&(T=this.__patterns.html_comment_end.read(),T))return E=!1,this._create_token(i.COMMENT,T);return null},w.prototype._read_comment=function(W){var T=null;if(W==="/"){var N="";if(this._input.peek(1)==="*"){N=this.__patterns.block_comment.read();var _=D.get_directives(N);_&&_.ignore==="start"&&(N+=D.readIgnored(this._input)),N=N.replace(p.allLineBreaks,`
`),T=this._create_token(i.BLOCK_COMMENT,N),T.directives=_}else this._input.peek(1)==="/"&&(N=this.__patterns.comment.read(),T=this._create_token(i.COMMENT,N))}return T},w.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var T=this._input.next();return this.has_char_escapes=!1,W==="`"?T+=this._read_string_recursive("`",!0,"${"):T+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(T=j(T)),this._input.peek()===W&&(T+=this._input.next()),T=T.replace(p.allLineBreaks,`
`),this._create_token(i.STRING,T)}return null},w.prototype._allow_regexp_or_xml=function(W){return W.type===i.RESERVED&&s(W.text,["return","case","throw","else","do","typeof","yield"])||W.type===i.END_EXPR&&W.text===")"&&W.opened.previous.type===i.RESERVED&&s(W.opened.previous.text,["if","while","for"])||s(W.type,[i.COMMENT,i.START_EXPR,i.START_BLOCK,i.START,i.END_BLOCK,i.OPERATOR,i.EQUALS,i.EOF,i.SEMICOLON,i.COMMA])},w.prototype._read_regexp=function(W,T){if(W==="/"&&this._allow_regexp_or_xml(T)){for(var N=this._input.next(),_=!1,x=!1;this._input.hasNext()&&(_||x||this._input.peek()!==W)&&!this._input.testChar(p.newline);)N+=this._input.peek(),_?_=!1:(_=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===W&&(N+=this._input.next(),N+=this._input.read(p.identifier)),this._create_token(i.STRING,N)}return null},w.prototype._read_xml=function(W,T){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(T)){var N="",_=this.__patterns.xml.read_match();if(_){for(var x=_[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=x.indexOf("{")===0,X=0;_;){var ee=!!_[1],J=_[2],ce=!!_[_.length-1]||J.slice(0,8)==="![CDATA[";if(!ce&&(J===x||H&&J.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ee?--X:++X),N+=_[0],X<=0)break;_=this.__patterns.xml.read_match()}return _||(N+=this._input.match(/[\s\S]*/g)[0]),N=N.replace(p.allLineBreaks,`
`),this._create_token(i.STRING,N)}}return null};function j(W){for(var T="",N=0,_=new f(W),x=null;_.hasNext();)if(x=_.match(/([\s]|[^\\]|\\\\)+/g),x&&(T+=x[0]),_.peek()==="\\"){if(_.next(),_.peek()==="x")x=_.match(/x([0-9A-Fa-f]{2})/g);else if(_.peek()==="u")x=_.match(/u([0-9A-Fa-f]{4})/g);else{T+="\\",_.hasNext()&&(T+=_.next());continue}if(!x)return W;if(N=parseInt(x[1],16),N>126&&N<=255&&x[0].indexOf("x")===0)return W;if(N>=0&&N<32){T+="\\"+x[0];continue}else N===34||N===39||N===92?T+="\\"+String.fromCharCode(N):T+=String.fromCharCode(N)}return T}w.prototype._read_string_recursive=function(W,T,N){var _,x;W==="'"?x=this.__patterns.single_quote:W==='"'?x=this.__patterns.double_quote:W==="`"?x=this.__patterns.template_text:W==="}"&&(x=this.__patterns.template_expression);for(var H=x.read(),X="";this._input.hasNext();){if(X=this._input.next(),X===W||!T&&p.newline.test(X)){this._input.back();break}else X==="\\"&&this._input.hasNext()?(_=this._input.peek(),_==="x"||_==="u"?this.has_char_escapes=!0:_==="\r"&&this._input.peek(1)===`
`&&this._input.next(),X+=this._input.next()):N&&(N==="${"&&X==="$"&&this._input.peek()==="{"&&(X+=this._input.next()),N===X&&(W==="`"?X+=this._read_string_recursive("}",T,"`"):X+=this._read_string_recursive("`",T,"${"),this._input.hasNext()&&(X+=this._input.next())));X+=x.read(),H+=X}return H},n.exports.Tokenizer=w,n.exports.TOKEN=i,n.exports.positionable_operators=O.slice(),n.exports.line_starters=h.slice()},function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function b(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},b.prototype.peek=function(f){var y=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(y=this.__input.charAt(f)),y},b.prototype.__match=function(f,y){f.lastIndex=y;var c=f.exec(this.__input);return c&&!(I&&f.sticky)&&(c.index!==y&&(c=null)),c},b.prototype.test=function(f,y){return y=y||0,y+=this.__position,y>=0&&y<this.__input_length?!!this.__match(f,y):!1},b.prototype.testChar=function(f,y){var c=this.peek(y);return f.lastIndex=0,c!==null&&f.test(c)},b.prototype.match=function(f){var y=this.__match(f,this.__position);return y?this.__position+=y[0].length:y=null,y},b.prototype.read=function(f,y,c){var a="",p;return f&&(p=this.match(f),p&&(a+=p[0])),y&&(p||!f)&&(a+=this.readUntil(y,c)),a},b.prototype.readUntil=function(f,y){var c="",a=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(a=p.index,y&&(a+=p[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},b.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},b.prototype.get_regexp=function(f,y){var c=null,a="g";return y&&I&&(a="y"),typeof f=="string"&&f!==""?c=new RegExp(f,a):f&&(c=new RegExp(f.source,a)),c},b.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(f){var y=this.__position,c=this.readUntilAfter(f);return this.__position=y,c},b.prototype.lookBack=function(f){var y=this.__position-1;return y>=f.length&&this.__input.substring(y-f.length,y).toLowerCase()===f},n.exports.InputScanner=b},function(n,I,b){var f=b(8).InputScanner,y=b(3).Token,c=b(10).TokenStream,a=b(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(u,s){this._input=new f(u),this._options=s||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new c,this._reset();for(var u,s=new y(p.START,""),i=null,D=[],A=new c;s.type!==p.EOF;){for(u=this._get_next_token(s,i);this._is_comment(u);)A.add(u),u=this._get_next_token(s,i);A.isEmpty()||(u.comments_before=A,A=new c),u.parent=i,this._is_opening(u)?(D.push(i),i=u):i&&this._is_closing(u,i)&&(u.opened=i,i.closed=u,i=D.pop(),u.parent=i),u.previous=s,s.next=u,this.__tokens.add(u),s=u}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(u,s){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(p.RAW,i):this._create_token(p.EOF,"")},l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return!1},l.prototype._is_closing=function(u,s){return!1},l.prototype._create_token=function(u,s){var i=new y(u,s,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return i},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},n.exports.Tokenizer=l,n.exports.TOKEN=p},function(n){function I(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}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 b=null;return this.hasNext()&&(b=this.__tokens[this.__position],this.__position+=1),b},I.prototype.peek=function(b){var f=null;return b=b||0,b+=this.__position,b>=0&&b<this.__tokens_length&&(f=this.__tokens[b]),f},I.prototype.add=function(b){this.__parent_token&&(b.parent=this.__parent_token),this.__tokens.push(b),this.__tokens_length+=1},n.exports.TokenStream=I},function(n,I,b){var f=b(12).Pattern;function y(c,a){f.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=""}y.prototype=new f,y.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+"]")},y.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},y.prototype.matching=function(c,a){var p=this._create();return p.__set_whitespace_patterns(c,a),p._update(),p},y.prototype._create=function(){return new y(this._input,this)},y.prototype.__split=function(c,a){c.lastIndex=0;for(var p=0,l=[],u=c.exec(a);u;)l.push(a.substring(p,u.index)),p=u.index+u[0].length,u=c.exec(a);return p<a.length?l.push(a.substring(p,a.length)):l.push(""),l},n.exports.WhitespacePattern=y},function(n){function I(b,f){this._input=b,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}I.prototype.read=function(){var b=this._input.read(this._starting_pattern);return(!this._starting_pattern||b)&&(b+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),b},I.prototype.read_match=function(){return this._input.match(this._match_pattern)},I.prototype.until_after=function(b){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(b),f._update(),f},I.prototype.until=function(b){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(b),f._update(),f},I.prototype.starting_with=function(b){var f=this._create();return f._starting_pattern=this._input.get_regexp(b,!0),f._update(),f},I.prototype.matching=function(b){var f=this._create();return f._match_pattern=this._input.get_regexp(b,!0),f._update(),f},I.prototype._create=function(){return new I(this._input,this)},I.prototype._update=function(){},n.exports.Pattern=I},function(n){function I(b,f){b=typeof b=="string"?b:b.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var y=this.__directive_pattern.exec(b);y;)f[y[1]]=y[2],y=this.__directive_pattern.exec(b);return f},I.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},function(n,I,b){var f=b(12).Pattern,y={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function c(a,p){f.call(this,a,p),this.__template_pattern=null,this._disabled=Object.assign({},y),this._excluded=Object.assign({},y),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var l=new f(a);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}c.prototype=new f,c.prototype._create=function(){return new c(this._input,this)},c.prototype._update=function(){this.__set_templated_pattern()},c.prototype.disable=function(a){var p=this._create();return p._disabled[a]=!0,p._update(),p},c.prototype.read_options=function(a){var p=this._create();for(var l in y)p._disabled[l]=a.templating.indexOf(l)===-1;return p._update(),p},c.prototype.exclude=function(a){var p=this._create();return p._excluded[a]=!0,p._update(),p},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 p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),a+=p,p=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="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(a=a||this.__patterns.erb.read())}else p==="{"&&(!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},n.exports.TemplatablePattern=c}],F={};function G(n){var I=F[n];if(I!==void 0)return I.exports;var b=F[n]={exports:{}};return P[n](b,b.exports,G),b.exports}var K=G(0);M=K})();var z=M;!(ne=[],Y=function(){return{js_beautify:z}}.apply(ve,ne),Y!==void 0&&(ut.exports=Y))})()},"746U":function(ut,ve,U){"use strict";U.d(ve,"f",function(){return ne}),U.d(ve,"l",function(){return Y}),U.d(ve,"k",function(){return M}),U.d(ve,"j",function(){return z}),U.d(ve,"g",function(){return P}),U.d(ve,"m",function(){return F}),U.d(ve,"h",function(){return G}),U.d(ve,"n",function(){return K}),U.d(ve,"c",function(){return n}),U.d(ve,"a",function(){return I}),U.d(ve,"i",function(){return b}),U.d(ve,"o",function(){return f}),U.d(ve,"e",function(){return a}),U.d(ve,"d",function(){return p}),U.d(ve,"p",function(){return l}),U.d(ve,"b",function(){return u});function ne(s){return Array.isArray(s)}function Y(s){return typeof s=="string"}function M(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&!(s instanceof RegExp)&&!(s instanceof Date)}function z(s){return typeof s=="number"&&!isNaN(s)}function P(s){return s===!0||s===!1}function F(s){return typeof s=="undefined"}function G(s){return!K(s)}function K(s){return F(s)||s===null}function n(s,i){if(!s)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function I(s){if(K(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function b(s){return typeof s=="function"}function f(s,i){const D=Math.min(s.length,i.length);for(let A=0;A<D;A++)y(s[A],i[A])}function y(s,i){if(Y(i)){if(typeof s!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(b(i)){try{if(s instanceof i)return}catch(D){}if(!K(s)&&s.constructor===i)return;if(i.length===1&&i.call(void 0,s)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function c(s){let i=[],D=Object.getPrototypeOf(s);for(;Object.prototype!==D;)i=i.concat(Object.getOwnPropertyNames(D)),D=Object.getPrototypeOf(D);return i}function a(s){const i=[];for(const D of c(s))typeof s[D]=="function"&&i.push(D);return i}function p(s,i){const D=S=>function(){const R=Array.prototype.slice.call(arguments,0);return i(S,R)};let A={};for(const S of s)A[S]=D(S);return A}function l(s){return s===null?void 0:s}function u(s,i="Unreachable"){throw new Error(i)}},"7Cbv":function(ut,ve,U){"use strict";var ne=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function M(){if(!ne)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ne(Y)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function P(y){return typeof y=="string"&&z.test(y)}for(var F=P,G=[],K=0;K<256;++K)G.push((K+256).toString(16).substr(1));function n(y){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(G[y[c+0]]+G[y[c+1]]+G[y[c+2]]+G[y[c+3]]+"-"+G[y[c+4]]+G[y[c+5]]+"-"+G[y[c+6]]+G[y[c+7]]+"-"+G[y[c+8]]+G[y[c+9]]+"-"+G[y[c+10]]+G[y[c+11]]+G[y[c+12]]+G[y[c+13]]+G[y[c+14]]+G[y[c+15]]).toLowerCase();if(!F(a))throw TypeError("Stringified UUID is invalid");return a}var I=n;function b(y,c,a){y=y||{};var p=y.random||(y.rng||M)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,c){a=a||0;for(var l=0;l<16;++l)c[a+l]=p[l];return c}return I(p)}var f=ve.a=b},"7ahc":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return D});var ne=U("k1fw"),Y=U("0Owb"),M=U("+L6B"),z=U("2/Rp"),P=U("y8nQ"),F=U("Vl3Y"),G=U("tJVT"),K=U("OaEy"),n=U("2fM7"),I=U("q1tI"),b=U.n(I),f=U("VrN/"),y=U.n(f),c=U("p77/"),a=U.n(c),p=U("c5Ni"),l=U.n(p),u=n.a.Option,s={labelCol:{span:4},wrapperCol:{span:20}},i={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"]};ve.b=function(A){var S=A.callback,R=A.onCancel,O=Object(I.useState)("python"),m=Object(G.a)(O,2),v=m[0],h=m[1];function d(E){h(i[E][1])}function C(E){S(E)}return b.a.createElement(F.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),b.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(n.a,{onChange:d},Object.keys(i).map(function(E){return b.a.createElement(u,{key:E,value:E},i[E][0])}))),b.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(D,{mode:v})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(z.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function D(A){var S=A.value,R=A.onChange,O=A.mode,m=A.options,v=m===void 0?{}:m,h=Object(I.useRef)(),d=Object(I.useState)(),C=Object(G.a)(d,2),E=C[0],w=C[1];return Object(I.useEffect)(function(){if(E){function j(W){var T=W.getValue();R&&R(T)}return E.on("change",j),function(){E.off("change",j)}}},[E,R]),Object(I.useEffect)(function(){E&&E.setOption("mode",O)},[E,O]),Object(I.useEffect)(function(){E&&((S!==E.getValue()||S==="")&&setTimeout(function(){E.setValue(S||" ")},300))},[E,S]),Object(I.useEffect)(function(){if(h.current&&!E){var j=y.a.fromTextArea(h.current,Object(ne.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));w(j)}},[h.current,E]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:h}))}},"815F":function(ut,ve,U){"use strict";U.d(ve,"e",function(){return G}),U.d(ve,"c",function(){return n}),U.d(ve,"d",function(){return I}),U.d(ve,"a",function(){return f}),U.d(ve,"f",function(){return y}),U.d(ve,"b",function(){return c});var ne=U("KQm4"),Y=U("VTBJ"),M=U("Ff2n"),z=U("Zm9Q"),P=U("Kwbf"),F=U("OZM5");function G(a,p){return a!=null?a:p}function K(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=new Map;function l(u){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(u||[]).forEach(function(i){var D=i.key,A=i.children;Object(P.a)(D!=null,"Tree node must have a certain key: [".concat(s).concat(D,"]"));var S=String(D);Object(P.a)(!p.has(S)||D===null||D===void 0,"Same 'key' exist in the Tree: ".concat(S)),p.set(S,!0),l(A,"".concat(s).concat(S," > "))})}l(a)}function n(a){function p(l){var u=Object(z.a)(l);return u.map(function(s){if(!Object(F.i)(s))return Object(P.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var i=s.key,D=s.props,A=D.children,S=Object(M.a)(D,["children"]),R=Object(Y.a)({key:i},S),O=p(A);return O.length&&(R.children=O),R}).filter(function(s){return s})}return p(a)}function I(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(p===!0?[]:p),u=[];function s(i){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return i.map(function(A,S){var R=Object(F.h)(D?D.pos:"0",S),O=G(A.key,R),m=Object(Y.a)(Object(Y.a)({},A),{},{parent:D,pos:R,children:null,data:A,isStart:[].concat(Object(ne.a)(D?D.isStart:[]),[S===0]),isEnd:[].concat(Object(ne.a)(D?D.isEnd:[]),[S===i.length-1])});return u.push(m),p===!0||l.has(O)?m.children=s(A.children||[],m):m.children=[],m})}return s(a),u}function b(a,p,l){var u;l?typeof l=="string"?u=function(D){return D[l]}:typeof l=="function"&&(u=function(D){return l(D)}):u=function(D,A){return G(D.key,A)};function s(i,D,A){var S=i?i.children:a,R=i?Object(F.h)(A.pos,D):"0";if(i){var O=u(i,R),m={node:i,index:D,pos:R,key:O,parentPos:A.node?A.pos:null,level:A.level+1};p(m)}S&&S.forEach(function(v,h){s(v,h,{node:i,pos:R,level:A?A.level+1:-1})})}s(null)}function f(a){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=p.initWrapper,u=p.processEntity,s=p.onProcessFinished,i=arguments.length>2?arguments[2]:void 0,D={},A={},S={posEntities:D,keyEntities:A};return l&&(S=l(S)||S),b(a,function(R){var O=R.node,m=R.index,v=R.pos,h=R.key,d=R.parentPos,C=R.level,E={node:O,index:m,key:h,pos:v,level:C},w=G(h,v);D[v]=E,A[w]=E,E.parent=D[d],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),u&&u(E,S)},i),s&&s(S),S}function y(a,p){var l=p.expandedKeys,u=p.selectedKeys,s=p.loadedKeys,i=p.loadingKeys,D=p.checkedKeys,A=p.halfCheckedKeys,S=p.dragOverNodeKey,R=p.dropPosition,O=p.keyEntities,m=O[a],v={eventKey:a,expanded:l.indexOf(a)!==-1,selected:u.indexOf(a)!==-1,loaded:s.indexOf(a)!==-1,loading:i.indexOf(a)!==-1,checked:D.indexOf(a)!==-1,halfChecked:A.indexOf(a)!==-1,pos:String(m?m.pos:""),dragOver:S===a&&R===0,dragOverGapTop:S===a&&R===-1,dragOverGapBottom:S===a&&R===1};return v}function c(a){var p=a.data,l=a.expanded,u=a.selected,s=a.checked,i=a.loaded,D=a.loading,A=a.halfChecked,S=a.dragOver,R=a.dragOverGapTop,O=a.dragOverGapBottom,m=a.pos,v=a.active,h=Object(Y.a)(Object(Y.a)({},p),{},{expanded:l,selected:u,checked:s,loaded:i,loading:D,halfChecked:A,dragOver:S,dragOverGapTop:R,dragOverGapBottom:O,pos:m,active:v});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(P.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),h}},"8EBN":function(ut,ve,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";ne.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 Y=0;Y<ne.modeInfo.length;Y++){var M=ne.modeInfo[Y];M.mimes&&(M.mime=M.mimes[0])}ne.findModeByMIME=function(z){z=z.toLowerCase();for(var P=0;P<ne.modeInfo.length;P++){var F=ne.modeInfo[P];if(F.mime==z)return F;if(F.mimes){for(var G=0;G<F.mimes.length;G++)if(F.mimes[G]==z)return F}}if(/\+xml$/.test(z))return ne.findModeByMIME("application/xml");if(/\+json$/.test(z))return ne.findModeByMIME("application/json")},ne.findModeByExtension=function(z){z=z.toLowerCase();for(var P=0;P<ne.modeInfo.length;P++){var F=ne.modeInfo[P];if(F.ext){for(var G=0;G<F.ext.length;G++)if(F.ext[G]==z)return F}}},ne.findModeByFileName=function(z){for(var P=0;P<ne.modeInfo.length;P++){var F=ne.modeInfo[P];if(F.file&&F.file.test(z))return F}var G=z.lastIndexOf("."),K=G>-1&&z.substring(G+1,z.length);if(K)return ne.findModeByExtension(K)},ne.findModeByName=function(z){z=z.toLowerCase();for(var P=0;P<ne.modeInfo.length;P++){var F=ne.modeInfo[P];if(F.name.toLowerCase()==z)return F;if(F.alias){for(var G=0;G<F.alias.length;G++)if(F.alias[G].toLowerCase()==z)return F}}}})},"8HAY":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return P}),U.d(ve,"b",function(){return F}),U.d(ve,"d",function(){return G}),U.d(ve,"e",function(){return K}),U.d(ve,"c",function(){return n});var ne=U("MI8n"),Y=U("pmY6"),M=U("3/fG"),z=function(I,b,f,y){function c(a){return a instanceof f?a:new f(function(p){p(a)})}return new(f||(f=Promise))(function(a,p){function l(i){try{s(y.next(i))}catch(D){p(D)}}function u(i){try{s(y.throw(i))}catch(D){p(D)}}function s(i){i.done?a(i.value):c(i.value).then(l,u)}s((y=y.apply(I,b||[])).next())})};class P extends Y.a{constructor(I,b="",f="",y=!0,c){super();this._onDidChange=this._register(new ne.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=I,this._label=b,this._cssClass=f,this._enabled=y,this._actionCallback=c}get id(){return this._id}get label(){return this._label}set label(I){this._setLabel(I)}_setLabel(I){this._label!==I&&(this._label=I,this._onDidChange.fire({label:I}))}get tooltip(){return this._tooltip||""}set tooltip(I){this._setTooltip(I)}_setTooltip(I){this._tooltip!==I&&(this._tooltip=I,this._onDidChange.fire({tooltip:I}))}get class(){return this._cssClass}set class(I){this._setClass(I)}_setClass(I){this._cssClass!==I&&(this._cssClass=I,this._onDidChange.fire({class:I}))}get enabled(){return this._enabled}set enabled(I){this._setEnabled(I)}_setEnabled(I){this._enabled!==I&&(this._enabled=I,this._onDidChange.fire({enabled:I}))}get checked(){return this._checked}set checked(I){this._setChecked(I)}_setChecked(I){this._checked!==I&&(this._checked=I,this._onDidChange.fire({checked:I}))}run(I,b){return z(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(I))})}}class F extends Y.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new ne.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new ne.b),this.onDidRun=this._onDidRun.event}run(I,b){return z(this,void 0,void 0,function*(){if(!I.enabled)return;this._onBeforeRun.fire({action:I});let f;try{yield this.runAction(I,b)}catch(y){f=y}this._onDidRun.fire({action:I,error:f})})}runAction(I,b){return z(this,void 0,void 0,function*(){yield I.run(b)})}}class G extends P{constructor(I){super(G.ID,I,I?"separator text":"separator");this.checked=!1,this.enabled=!1}}G.ID="vs.actions.separator";class K{constructor(I,b,f,y){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=I,this.label=b,this.class=y,this._actions=f}get actions(){return this._actions}dispose(){}run(){return z(this,void 0,void 0,function*(){})}}class n extends P{constructor(){super(n.ID,M.a("submenu.empty","(empty)"),void 0,!1)}}n.ID="vs.actions.empty"},"8hTe":function(ut,ve,U){ut.exports={button:"button___1wy9m"}},"9Bee":function(ut,ve,U){"use strict";var ne=U("DYRE"),Y=U("zeV3"),M=U("+L6B"),z=U("2/Rp"),P=U("k1fw"),F=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),I=U("q1tI"),b=U.n(I),f=U("vg9a"),y=U("DlQD"),c=U.n(y),a=U("rUJ1");function p(Z,L){var k=Z.match(/^(\s+)(?:```)/);if(k===null)return L;var V=k[1];return L.split(`
`).map(function(re){var Q=re.match(/^\s+/);if(Q===null)return re;var Pe=Object(G.a)(Q,1),pt=Pe[0];return pt.length>=V.length?re.slice(V.length):re}).join(`
`)}var l=[],u=["<ul>"],s=new c.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){l.length=0,u=["<ul>"]}var A={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(Z,L,k,V){if(L>=Z.length||Z[L].level<=k)return L;var re=Z[L];V.push("<li><a href='#"+re.anchor+"'>"+re.text+"</a>"),L++;var Q=[];return L=S(Z,L,re.level,Q),Q.length>0&&(V.push("<ul>"),Q.forEach(function(Pe){V.push(Pe)}),V.push("</ul>")),V.push("</li>"),L=S(Z,L,k,V),L}function R(){return S(l,0,0,u),u.push("</ul>"),u.join("")}var O={heading:function(L){var k=i.exec(L);if(k)return{type:"heading",raw:k[0],depth:k[1].length,text:k[2]}},fences:function(L){var k=this.rules.block.fences.exec(L);if(k){var V=k[0],re=p(V,k[3]||""),Q=k[2]?k[2].trim():k[2];if(["latex","katex","math"].indexOf(Q)>=0){var Pe=h(),pt=re;re=Pe,d[Pe]={type:"block",expression:pt}}return{type:"code",raw:V,lang:Q,text:re}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,h=function(){return"__special_katext_id_".concat(v++,"__")},d={};function C(){return d}function E(){v=0,d={}}function w(Z){return Z=Z.replace(m,function(L,k){var V=h();return d[V]={type:"inline",expression:k},V}),Z}var j=s.listitem;s.listitem=function(Z){return j(w(Z))};var W=s.paragraph;s.paragraph=function(Z){return W(w(Z))};var T=s.tablecell;s.tablecell=function(Z,L){return T(w(Z),L)},s.code=function(Z,L,k){var V=(L||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(Z,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(L,'">').concat(k?Z:Object(a.escape)(Z,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(k?Z:Object(a.escape)(Z,!0))+"</code></pre>"},s.heading=function(Z,L,k){var V=this.options.headerPrefix+k.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:V,level:L,text:Z}),"<h"+L+' id="'+V+'">'+Z+"</h"+L+">"},c.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),c.a.use({tokenizer:O,renderer:s});var N=c.a,_=U("SJMd"),x=U("ulZh"),H=U.n(x),X=U("m3rI"),ee=U("Oy/b"),J=U("p5ED"),ce=U("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 me=function(Z,L){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,V){k.__proto__=V}||function(k,V){for(var re in V)Object.prototype.hasOwnProperty.call(V,re)&&(k[re]=V[re])})(Z,L)};function ue(Z,L){function k(){this.constructor=Z}me(Z,L),Z.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}function pe(Z,L,k,V){return new(k||(k=Promise))(function(re,Q){function Pe(rn){try{Lt(V.next(rn))}catch(vt){Q(vt)}}function pt(rn){try{Lt(V.throw(rn))}catch(vt){Q(vt)}}function Lt(rn){var vt;rn.done?re(rn.value):(vt=rn.value,vt instanceof k?vt:new k(function(Vt){Vt(vt)})).then(Pe,pt)}Lt((V=V.apply(Z,L||[])).next())})}function xe(Z,L){var k,V,re,Q,Pe={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return Q={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function pt(Lt){return function(rn){return function(vt){if(k)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(k=1,V&&(re=2&vt[0]?V.return:vt[0]?V.throw||((re=V.return)&&re.call(V),0):V.next)&&!(re=re.call(V,vt[1])).done)return re;switch(V=0,re&&(vt=[2&vt[0],re.value]),vt[0]){case 0:case 1:re=vt;break;case 4:return Pe.label++,{value:vt[1],done:!1};case 5:Pe.label++,V=vt[1],vt=[0];continue;case 7:vt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(re=Pe.trys,(re=re.length>0&&re[re.length-1])||vt[0]!==6&&vt[0]!==2)){Pe=0;continue}if(vt[0]===3&&(!re||vt[1]>re[0]&&vt[1]<re[3])){Pe.label=vt[1];break}if(vt[0]===6&&Pe.label<re[1]){Pe.label=re[1],re=vt;break}if(re&&Pe.label<re[2]){Pe.label=re[2],Pe.ops.push(vt);break}re[2]&&Pe.ops.pop(),Pe.trys.pop();continue}vt=L.call(Z,Pe)}catch(Vt){vt=[6,Vt],V=0}finally{k=re=0}if(5&vt[0])throw vt[1];return{value:vt[0]?vt[1]:void 0,done:!0}}([Lt,rn])}}}function se(){for(var Z=0,L=0,k=arguments.length;L<k;L++)Z+=arguments[L].length;var V=Array(Z),re=0;for(L=0;L<k;L++)for(var Q=arguments[L],Pe=0,pt=Q.length;Pe<pt;Pe++,re++)V[re]=Q[Pe];return V}var ae=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(L,k){for(var V=0,re=k;V<re.length;V++){var Q=re[V],Pe=Q[0],pt=Q[1];L.setAttribute(Pe,pt)}},Z.createRect=function(L,k,V){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",L.toString()),re.setAttribute("height",k.toString()),V&&Z.setAttributes(re,V),re},Z.createLine=function(L,k,V,re,Q){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",L.toString()),Pe.setAttribute("y1",k.toString()),Pe.setAttribute("x2",V.toString()),Pe.setAttribute("y2",re.toString()),Q&&Z.setAttributes(Pe,Q),Pe},Z.createPolygon=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",L),k&&Z.setAttributes(V,k),V},Z.createCircle=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(L/2).toString()),V.setAttribute("cy",(L/2).toString()),V.setAttribute("r",L.toString()),k&&Z.setAttributes(V,k),V},Z.createEllipse=function(L,k,V){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(L/2).toString()),re.setAttribute("cy",(k/2).toString()),re.setAttribute("rx",(L/2).toString()),re.setAttribute("ry",(k/2).toString()),V&&Z.setAttributes(re,V),re},Z.createGroup=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&Z.setAttributes(k,L),k},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(L,k,V,re,Q,Pe,pt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(Lt,[["id",L],["orient",k],["markerWidth",V.toString()],["markerHeight",re.toString()],["refX",Q.toString()],["refY",Pe.toString()]]),Lt.appendChild(pt),Lt},Z.createText=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),L&&Z.setAttributes(k,L),k},Z.createTSpan=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=L,k&&Z.setAttributes(V,k),V},Z.createImage=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&Z.setAttributes(k,L),k},Z.createPoint=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=L,V.y=k,V},Z.createPath=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",L),k&&Z.setAttributes(V,k),V},Z}(),Ce=function(){function Z(){}return Z.addKey=function(L){Z.key=L},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),ze=function(){function Z(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Z.prototype.rasterize=function(L,k,V){var re=this;return new Promise(function(Q){var Pe=V!==void 0?V:document.createElement("canvas");L===null&&(re.markersOnly=!0,re.naturalSize=!1);var pt=document.createElementNS("http://www.w3.org/2000/svg","svg");pt.setAttribute("xmlns","http://www.w3.org/2000/svg"),pt.setAttribute("width",k.width.baseVal.valueAsString),pt.setAttribute("height",k.height.baseVal.valueAsString),pt.setAttribute("viewBox","0 0 "+k.viewBox.baseVal.width.toString()+" "+k.viewBox.baseVal.height.toString()),pt.innerHTML=k.innerHTML,re.naturalSize===!0?(pt.width.baseVal.value=L.naturalWidth,pt.height.baseVal.value=L.naturalHeight):re.width!==void 0&&re.height!==void 0&&(pt.width.baseVal.value=re.width,pt.height.baseVal.value=re.height),Pe.width=pt.width.baseVal.value,Pe.height=pt.height.baseVal.value;var Lt=pt.outerHTML,rn=Pe.getContext("2d");re.markersOnly!==!0&&rn.drawImage(L,0,0,Pe.width,Pe.height);var vt=window.URL,Vt=new Image(Pe.width,Pe.height);Vt.setAttribute("crossOrigin","anonymous");var fr=new Blob([Lt],{type:"image/svg+xml"}),Lr=vt.createObjectURL(fr);Vt.onload=function(){rn.drawImage(Vt,0,0),vt.revokeObjectURL(Lr);var Zt=Pe.toDataURL(re.imageType,re.imageQuality);Q(Zt)},Vt.src=Lr})},Z}(),Ye=function(){},He=function(){function Z(L){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.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(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},Z.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new Ve("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ve("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Fe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Fe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Z.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),Ve=function(Z,L){this.selector=Z,this.style=L},Fe=function(Z,L){this.localName=Z,this.style=L},Ke=function(){function Z(L,k,V,re,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=L,this.displayMode=k,this.markerItems=V,this.uiStyleSettings=re,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Z.prototype.show=function(L){var k=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(V,'<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(Q){var Pe=document.createElement("div");Pe.className=""+k.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",Q.typeName),Pe.innerHTML=Q.icon,Pe.addEventListener("click",function(){k.markerToolbarButtonClicked(Pe,Q)}),k.buttons.push(Pe),k.markerButtons.push(Pe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var re=document.createElement("div");re.className=this.toolbarBlockStyleClass.name,re.style.whiteSpace="nowrap",re.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(re),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(re,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Z.prototype.addButtonClickListener=function(L){this.buttonClickListeners.push(L)},Z.prototype.removeButtonClickListener=function(L){this.buttonClickListeners.indexOf(L)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(L),1)},Z.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Z.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var L=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var k=0;k<this.markerButtons.length;k++)k<L||k===L&&this.markerButtons.length-1===L?this.markerButtonBlock.appendChild(this.markerButtons[k]):(k===L&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[k]))}},Z.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")},Z.prototype.resetButtonStyles=function(){var L=this;this.buttons.forEach(function(k){k.className=k.className.replace(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name,"").trim(),k.className=k.className.replace(L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?L.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:L.toolbarActiveButtonStyleColorsClass.name,"").trim(),k.className+=" "+(L.uiStyleSettings.toolbarButtonStyleColorsClassName?L.uiStyleSettings.toolbarButtonStyleColorsClassName:L.toolbarButtonStyleColorsClass.name)})},Z.prototype.addActionButton=function(L,k,V){var re=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=k,Q.setAttribute("data-action",V),Q.addEventListener("click",function(){re.actionToolbarButtonClicked(Q,V)}),V){case"select":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Q.style.fill=this.uiStyleSettings.closeButtonColor}L.appendChild(Q),this.buttons.push(Q)},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Fe("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 Fe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Fe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Fe("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 Fe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Fe("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Fe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Fe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ve("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Z.prototype.markerToolbarButtonClicked=function(L,k){this.setActiveButton(L),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",k)}),this.markerButtonOverflowBlock.style.display="none"},Z.prototype.actionToolbarButtonClicked=function(L,k){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",k)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Z.prototype.setActiveButton=function(L){this.resetButtonStyles(),L.className=L.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),L.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Z.prototype.setActiveMarkerButton=function(L){var k=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===L});k&&this.setActiveButton(k)},Z.prototype.setCurrentMarker=function(L){var k=this;this.currentMarker=L,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){k.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},Z}(),nt=function(){function Z(L,k,V,re){this.panels=[],this.panelButtons=[],this.markerjsContainer=L,this.displayMode=k,this.uiStyleSettings=V,this.styles=re,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Z.prototype.addStyles=function(){var L;this.toolboxStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var k=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Fe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Fe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Fe("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 Fe("toolbox-panel-row_colors",`
background-color: `+((L=this.uiStyleSettings.toolboxBackgroundColor)!==null&&L!==void 0?L:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Fe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*k)+`px;
padding: `+k+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Fe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Fe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Z.prototype.show=function(L){var k;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=L,this.uiContainer.className=this.toolboxStyleClass.name+" "+((k=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Z.prototype.setPanelButtons=function(L){var k,V,re=this;this.panels=L,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var Pe;Q.uiStyleSettings=re.uiStyleSettings;var pt=document.createElement("div");pt.className=re.toolboxButtonStyleClass.name+" "+((Pe=re.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:re.toolboxButtonStyleColorsClass.name),pt.innerHTML=Q.icon,pt.title=Q.title,pt.addEventListener("click",function(){re.panelButtonClick(Q)}),re.panelButtons.push(pt),re.buttonRow.appendChild(pt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Z.prototype.panelButtonClick=function(L){var k=this,V=-1;if(L!==this.activePanel){V=this.panels.indexOf(L),this.panelRow.innerHTML="";var re=L.getUi();re.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(re),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=L}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){k.displayMode==="inline"?k.panelRow.style.display="none":k.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,Pe){var pt,Lt;Q.className=k.toolboxButtonStyleClass.name+" "+(Pe===V?""+((pt=k.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&pt!==void 0?pt:k.toolboxActiveButtonStyleColorsClass.name):""+((Lt=k.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Lt!==void 0?Lt:k.toolboxButtonStyleColorsClass.name))})},Z}(),he=function(Z,L){this.title=Z,this.icon=L},Re=function(Z){function L(k,V,re,Q){var Pe=Z.call(this,k,Q||'<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 Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=V,Pe.currentColor=re,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(re){var Q=k.getColorBox(re);V.appendChild(Q),k.colorBoxes.push(Q)}),V},L.prototype.getColorBox=function(k){var V=this,re=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-re,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=Q-2+"px",Pe.style.height=Q-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(Q+2)/2+"px",Pe.style.borderColor=k===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){V.setCurrentColor(k,Pe)});var pt=document.createElement("div");return pt.style.display="inline-block",pt.style.width=Q-2+"px",pt.style.height=Q-2+"px",pt.style.backgroundColor=k,pt.style.borderRadius=Q/2+"px",k==="transparent"&&(pt.style.fill=this.uiStyleSettings.toolboxAccentColor,pt.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>`),Pe.appendChild(pt),Pe},L.prototype.setCurrentColor=function(k,V){var re=this;this.currentColor=k,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===V?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(k)},L}(he),Ne=function(){function Z(L,k,V){this._state="new",this._isSelected=!1,this._container=L,this._overlayContainer=k,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Z.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Z.prototype.ownsTarget=function(L){return!1},Object.defineProperty(Z.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Z.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Z.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Z.prototype.pointerDown=function(L,k){},Z.prototype.dblClick=function(L,k){},Z.prototype.manipulate=function(L){},Z.prototype.pointerUp=function(L){this.stateChanged()},Z.prototype.dispose=function(){},Z.prototype.addMarkerVisualToContainer=function(L){this.container.childNodes.length>0?this.container.insertBefore(L,this.container.childNodes[0]):this.container.appendChild(L)},Z.prototype.getState=function(){return{typeName:Z.typeName,state:this.state,notes:this.notes}},Z.prototype.restoreState=function(L){this._state=L.state,this.notes=L.notes},Z.prototype.scale=function(L,k){},Z.prototype.colorChanged=function(L){this.onColorChanged&&this.onColorChanged(L),this.stateChanged()},Z.prototype.fillColorChanged=function(L){this.onFillColorChanged&&this.onFillColorChanged(L),this.stateChanged()},Z.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var L=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),L.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(L)&&this.onStateChanged(this)}},Z.typeName="MarkerBase",Z}(),Ue=function(){function Z(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Z.prototype.findGripByVisual=function(L){return this.topLeft.ownsTarget(L)?this.topLeft:this.topCenter.ownsTarget(L)?this.topCenter:this.topRight.ownsTarget(L)?this.topRight:this.centerLeft.ownsTarget(L)?this.centerLeft:this.centerRight.ownsTarget(L)?this.centerRight:this.bottomLeft.ownsTarget(L)?this.bottomLeft:this.bottomCenter.ownsTarget(L)?this.bottomCenter:this.bottomRight.ownsTarget(L)?this.bottomRight:void 0},Z}(),rt=function(){function Z(){this.GRIP_SIZE=10,this.visual=ae.createGroup(),this.visual.appendChild(ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ae.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},Z}(),st=function(){function Z(){}return Z.toITransformMatrix=function(L){return{a:L.a,b:L.b,c:L.c,d:L.d,e:L.e,f:L.f}},Z.toSVGMatrix=function(L,k){return L.a=k.a,L.b=k.b,L.c=k.c,L.d=k.d,L.e=k.e,L.f=k.f,L},Z}(),dt=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(ae.createTransform()),Q.setupControlBox(),Q}return ue(L,Z),Object.defineProperty(L.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"visual",{get:function(){return this._visual},set:function(k){this._visual=k;var V=ae.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(k){return!!Z.prototype.ownsTarget.call(this,k)||!!(this.controlGrips.findGripByVisual(k)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k))},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.left=k.x,this.top=k.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var re=this.unrotatePoint(k);if(this.manipulationStartX=re.x,this.manipulationStartY=re.y,this.offsetX=re.x-this.left,this.offsetY=re.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},L.prototype.pointerUp=function(k){var V=this.state;Z.prototype.pointerUp.call(this,k),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(k),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},L.prototype.moveVisual=function(k){this.visual.style.transform="translate("+k.x+"px, "+k.y+"px)"},L.prototype.manipulate=function(k){var V=this.unrotatePoint(k);this.state==="creating"?this.resize(k):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(k)},L.prototype.resize=function(k){var V=this.manipulationStartLeft,re=this.manipulationStartWidth,Q=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+k.x-this.manipulationStartX,re=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:re=this.manipulationStartWidth+k.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+k.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+k.y-this.manipulationStartY}re>=0?(this.left=V,this.width=re):(this.left=V+re,this.width=-re),Pe>=0?(this.top=Q,this.height=Pe):(this.top=Q+Pe,this.height=-Pe),this.setSize()},L.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},L.prototype.rotate=function(k){if(Math.abs(k.x-this.centerX)>.1){var V=Math.sign(k.x-this.centerX);this.rotationAngle=180*Math.atan((k.y-this.centerY)/(k.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},L.prototype.applyRotation=function(){var k=this.container.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(k,0)},L.prototype.rotatePoint=function(k){if(this.rotationAngle===0)return k;var V=this.container.getCTM(),re=ae.createPoint(k.x,k.y);return{x:(re=re.matrixTransform(V)).x,y:re.y}},L.prototype.unrotatePoint=function(k){if(this.rotationAngle===0)return k;var V=this.container.getCTM();V=V.inverse();var re=ae.createPoint(k.x,k.y);return{x:(re=re.matrixTransform(V)).x,y:re.y}},L.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=ae.createGroup();var k=ae.createTransform();k.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(k),this.container.appendChild(this.controlBox),this.controlRect=ae.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=ae.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 Ue,this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){var k=this.controlBox.transform.baseVal.getItem(0);k.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(k,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},L.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},L.prototype.createGrip=function(){var k=new rt;return k.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(k.visual),k},L.prototype.positionGrips=function(){var k=this.controlGrips.topLeft.GRIP_SIZE,V=-k/2,re=V,Q=(this.width+this.CB_DISTANCE)/2-k/2,Pe=(this.height+this.CB_DISTANCE)/2-k/2,pt=this.height+this.CB_DISTANCE-k/2,Lt=this.width+this.CB_DISTANCE-k/2;this.positionGrip(this.controlGrips.topLeft.visual,V,re),this.positionGrip(this.controlGrips.topCenter.visual,Q,re),this.positionGrip(this.controlGrips.topRight.visual,Lt,re),this.positionGrip(this.controlGrips.centerLeft.visual,V,Pe),this.positionGrip(this.controlGrips.centerRight.visual,Lt,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,V,pt),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,pt),this.positionGrip(this.controlGrips.bottomRight.visual,Lt,pt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,re-3*this.CB_DISTANCE)},L.prototype.positionGrip=function(k,V,re){var Q=k.transform.baseVal.getItem(0);Q.setTranslate(V,re),k.transform.baseVal.replaceItem(Q,0)},L.prototype.hideControlBox=function(){this.controlBox.style.display="none"},L.prototype.showControlBox=function(){this.controlBox.style.display=""},L.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:st.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:st.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Z.prototype.getState.call(this))},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V);var re=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:re.x*k,y:re.y*V});this.left=Q.x,this.top=Q.y,this.width=this.width*k,this.height=this.height*V,this.adjustControlBox()},L}(Ne),at=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual)},L.prototype.createVisual=function(){this.visual=ae.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.manipulate=function(k){Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.setSize()},L.prototype.setSize=function(){Z.prototype.setSize.call(this),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(k){Z.prototype.pointerUp.call(this,k),this.setSize()},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},L.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this))},L.prototype.restoreState=function(k){var V=k;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),Z.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setSize()},L.title="Rectangle marker",L}(dt),bt=function(Z){function L(k,V,re,Q){var Pe=Z.call(this,k,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=V,Pe.currentWidth=re,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(re){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=re===k.currentWidth?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentWidth(re,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.innerText=re.toString(),Pe.style.marginRight="5px",Q.appendChild(Pe);var pt=document.createElement("div");pt.style.minHeight="20px",pt.style.flexGrow="2",pt.style.display="flex",pt.style.alignItems="center";var Lt=document.createElement("hr");Lt.style.minWidth="20px",Lt.style.border="0px",Lt.style.borderTop=re+"px solid "+k.uiStyleSettings.toolboxColor,Lt.style.flexGrow="2",pt.appendChild(Lt),Q.appendChild(pt),k.widthBoxes.push(Q)}),V},L.prototype.setCurrentWidth=function(k,V){var re=this;this.currentWidth=k,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===V?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},L}(he),gt=function(Z){function L(k,V,re,Q){var Pe=Z.call(this,k,Q||'<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 Pe.styles=[],Pe.styleBoxes=[],Pe.styles=V,Pe.currentStyle=re,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(re){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/k.styles.length-5+"%",Q.style.borderColor=re===k.currentStyle?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentStyle(re,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var pt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+k.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(re!==""?'stroke-dasharray="'+re+'"':"")+` />
</svg>`;Pe.innerHTML=pt,Q.appendChild(Pe),k.styleBoxes.push(Q)}),V},L.prototype.setCurrentStyle=function(k,V){var re=this;this.currentStyle=k,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===V?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},L}(he),xt=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.strokeColor=re.defaultColor,Q.strokeWidth=re.defaultStrokeWidth,Q.strokeDasharray=re.defaultStrokeDasharray,Q.strokePanel=new Re("Line color",re.defaultColorSet,re.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new bt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return ue(L,Z),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="FrameMarker",L.title="Frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',L}(at),Je=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},kt=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!!Z.prototype.ownsTarget.call(this,k)||!(!this.grip1.ownsTarget(k)&&!this.grip2.ownsTarget(k))},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.manipulationStartX=k.x,this.manipulationStartY=k.y,this.state==="new"&&(this.x1=k.x,this.y1=k.y,this.x2=k.x,this.y2=k.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},L.prototype.pointerUp=function(k){var V=this.state;Z.prototype.pointerUp.call(this,k),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(k),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},L.prototype.adjustVisual=function(){},L.prototype.manipulate=function(k){this.state==="creating"?this.resize(k):this.state==="move"?(this.x1=this.manipulationStartX1+k.x-this.manipulationStartX,this.y1=this.manipulationStartY1+k.y-this.manipulationStartY,this.x2=this.manipulationStartX2+k.x-this.manipulationStartX,this.y2=this.manipulationStartY2+k.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(k)},L.prototype.resize=function(k){switch(this.activeGrip){case this.grip1:this.x1=k.x,this.y1=k.y;break;case this.grip2:case void 0:this.x2=k.x,this.y2=k.y}this.adjustVisual(),this.adjustControlBox()},L.prototype.select=function(){Z.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},L.prototype.deselect=function(){Z.prototype.deselect.call(this),this.controlBox.style.display="none"},L.prototype.setupControlBox=function(){this.controlBox=ae.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},L.prototype.adjustControlBox=function(){this.positionGrips()},L.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},L.prototype.createGrip=function(){var k=new rt;return k.visual.transform.baseVal.appendItem(ae.createTransform()),this.controlBox.appendChild(k.visual),k},L.prototype.positionGrips=function(){var k=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-k/2,this.y1-k/2),this.positionGrip(this.grip2.visual,this.x2-k/2,this.y2-k/2)},L.prototype.positionGrip=function(k,V,re){var Q=k.transform.baseVal.getItem(0);Q.setTranslate(V,re),k.transform.baseVal.replaceItem(Q,0)},L.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Z.prototype.getState.call(this))},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.x1=this.x1*k,this.y1=this.y1*V,this.x2=this.x2*k,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},L}(Ne),Ot=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=re.defaultColor,Q.strokeWidth=re.defaultStrokeWidth,Q.strokeDasharray=re.defaultStrokeDasharray,Q.strokePanel=new Re("Line color",re.defaultColorSet,re.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new bt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorLine&&k!==this.visibleLine)},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},L.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},L.typeName="LineMarker",L.title="Line marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',L}(kt),tt=function(Z){function L(k,V,re,Q){var Pe=Z.call(this,k,Q||'<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 Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=V,Pe.currentFont=re,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(re){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/k.fonts.length-5+"%",Q.style.borderColor=re===k.currentFont?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentFont(re,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=re,Pe.style.overflow="hidden";var pt=document.createElement("div");pt.style.whiteSpace="nowrap",pt.style.overflow="hidden",pt.style.textOverflow="ellipsis",pt.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(pt),Q.appendChild(Pe),k.fontBoxes.push(Q)}),V},L.prototype.setCurrentFont=function(k,V){var re=this;this.currentFont=k,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===V?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},L}(he),ft=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=re.defaultColor,Q.fontFamily=re.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new Re("Color",re.defaultColorSet,re.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new tt("Font",re.defaultFontFamilies,re.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){if(Z.prototype.ownsTarget.call(this,k)||k===this.visual||k===this.textElement||k===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(re){re===k&&(V=!0)}),V},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.bgRectangle=ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.textElement.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.isMoved=!1,this.pointerDownPoint=k,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.renderText=function(){var k=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(V){k.textElement.appendChild(ae.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},L.prototype.getTextScale=function(){var k=this.textElement.getBBox(),V=1;if(k.width>0&&k.height>0){var re=(1*this.width-this.width*this.padding*2/100)/k.width,Q=(1*this.height-this.height*this.padding*2/100)/k.height;V=Math.min(re,Q)}return V},L.prototype.getTextPosition=function(k){var V=this.textElement.getBBox(),re=0,Q=0;return V.width>0&&V.height>0&&(re=(this.width-V.width*k)/2,Q=this.height/2-V.height*k/2),{x:re,y:Q}},L.prototype.sizeText=function(){var k=this.textElement.getBBox(),V=this.getTextScale(),re=this.getTextPosition(V);re.y-=k.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+re.x+"px, "+re.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(re.x,re.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},L.prototype.manipulate=function(k){Z.prototype.manipulate.call(this,k),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(k.x-this.pointerDownPoint.x)>5||Math.abs(k.y-this.pointerDownPoint.y)>5)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.isMoved=!0,this.setSize(),this.sizeText()},L.prototype.setSize=function(){Z.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},L.prototype.pointerUp=function(k){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),Z.prototype.pointerUp.call(this,k),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},L.prototype.showTextEditor=function(){var k=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(k.textEditor.style.fontSize);k.textEditor.clientWidth>=Number.parseInt(k.textEditor.style.maxWidth)&&V>.9;)V-=.1,k.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var re=V.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(re)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){k.textEditDivClicked(k.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},L.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var k=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),re=this.textElement.getBBox(),Q={x:re.width*k,y:re.height*k};V.x-=Q.x/2,V.y-=Q.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*k,12)+"px",this.textElement.style.display="none"}},L.prototype.textEditDivClicked=function(k){this.text=k.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},L.prototype.select=function(){Z.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},L.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Z.prototype.deselect.call(this)},L.prototype.dblClick=function(k,V){Z.prototype.dblClick.call(this,k,V),this.showTextEditor()},L.prototype.setColor=function(k){this.textElement&&ae.setAttributes(this.textElement,[["fill",k]]),this.color=k,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(k)},L.prototype.setFont=function(k){this.textElement&&ae.setAttributes(this.textElement,[["font-family",k]]),this.fontFamily=k,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},L.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},L.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var V=k;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),Z.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setSize(),this.sizeText(),this.positionTextEditor()},L.typeName="TextMarker",L.title="Text marker",L.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',L}(dt),be=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=re.defaultColor,Q.lineWidth=re.defaultStrokeWidth,Q.pixelRatio=re.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new Re("Color",re.defaultColorSet,re.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new bt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.drawingImage)},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.drawingImage=ae.createImage(),this.visual.appendChild(this.drawingImage);var k=ae.createTransform();this.visual.transform.baseVal.appendItem(k),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(k.x,k.y),this.drawing=!0):Z.prototype.pointerDown.call(this,k,V)},L.prototype.manipulate=function(k){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(k.x,k.y),this.canvasContext.stroke()):Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},L.prototype.pointerUp=function(k){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Z.prototype.pointerUp.call(this,k)},L.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},L.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.select.call(this)},L.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Z.prototype.deselect.call(this)},L.prototype.finishCreation=function(){for(var k=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],re=V[0],Q=V[1],Pe=V[2],pt=V[3],Lt=!1,rn=0;rn<this.canvasElement.height;rn++)for(var vt=0;vt<this.canvasElement.width;vt++)k.data[rn*this.canvasElement.width*4+4*vt+3]>0&&(Lt=!0,rn<Q&&(Q=rn),vt<re&&(re=vt),rn>pt&&(pt=rn),vt>Pe&&(Pe=vt));if(Lt){this.left=re/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Pe-re)/this.pixelRatio,this.height=(pt-Q)/this.pixelRatio;var Vt=document.createElement("canvas");Vt.width=Pe-re,Vt.height=pt-Q,Vt.getContext("2d").putImageData(this.canvasContext.getImageData(re,Q,Pe-re,pt-Q),0,0),this.drawingImgUrl=Vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},L.prototype.setDrawingImage=function(){ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ae.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},L.prototype.setColor=function(k){this.color=k,this.colorChanged(k)},L.prototype.setLineWidth=function(k){this.lineWidth=k},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({drawingImgUrl:this.drawingImgUrl},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){this.createVisual(),Z.prototype.restoreState.call(this,k),this.drawingImgUrl=k.drawingImgUrl,this.setDrawingImage()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setDrawingImage()},L.typeName="FreehandMarker",L.title="Freehand marker",L.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',L}(dt),Ee=function(Z){function L(k,V,re){var Q=Z.call(this,k,re||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Q.typeBoxes=[],Q.currentType=V,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var re=function(pt){var Lt="both";switch(pt){case 0:Lt="both";break;case 1:Lt="start";break;case 2:Lt="end";break;case 3:Lt="none"}var rn=document.createElement("div");if(rn.style.display="flex",rn.style.flexGrow="2",rn.style.alignItems="center",rn.style.justifyContent="space-between",rn.style.padding="5px",rn.style.borderWidth="2px",rn.style.borderStyle="solid",rn.style.borderColor=Lt===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",rn.addEventListener("click",function(){k.setCurrentType(Lt,rn)}),V.appendChild(rn),Lt==="both"||Lt==="start"){var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,vt.style.marginLeft="5px",rn.appendChild(vt)}var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.style.flexGrow="2";var fr=document.createElement("hr");if(fr.style.minWidth="20px",fr.style.border="0px",fr.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),fr.style.flexGrow="2",Vt.appendChild(fr),rn.appendChild(Vt),Lt==="both"||Lt==="end"){var Lr=document.createElement("div");Lr.style.display="flex",Lr.style.alignItems="center",Lr.style.minHeight="20px",Lr.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Lr.style.marginRight="5px",rn.appendChild(Lr)}Q.typeBoxes.push(rn)},Q=this,Pe=0;Pe<4;Pe++)re(Pe);return V},L.prototype.setCurrentType=function(k,V){var re=this;this.currentType=k,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===V?re.uiStyleSettings!==void 0?re.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},L}(he),ge=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new Ee("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.arrow1&&k!==this.arrow2)},L.prototype.getArrowPoints=function(k,V){var re=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return k-re/2+","+(V+Q/2)+" "+k+","+(V-Q/2)+" "+(k+re/2)+","+(V+Q/2)},L.prototype.createTips=function(){this.arrow1=ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ae.createTransform()),this.visual.appendChild(this.arrow2)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(Z.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",ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ae.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(k,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var re=this.arrow2.transform.baseVal.getItem(0);re.setRotate(k+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(re,0)}},L.prototype.setArrowType=function(k){this.arrowType=k,this.adjustVisual(),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({arrowType:this.arrowType},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},L.typeName="ArrowMarker",L.title="Arrow marker",L.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',L}(Ot),de=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.fillColor=re.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new Re("Color",re.defaultColorSet,re.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return ue(L,Z),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="CoverMarker",L.title="Cover marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',L}(at),fe=function(Z){function L(k,V,re,Q){var Pe=Z.call(this,k,Q||'<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 Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=V,Pe.currentOpacity=re,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return ue(L,Z),L.prototype.getUi=function(){var k=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(re){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=re===k.currentOpacity?k.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){k.setCurrentOpacity(re,Q)}),V.appendChild(Q);var Pe=document.createElement("div");Pe.innerText=100*re+"%",Q.appendChild(Pe),k.opacityBoxes.push(Q)}),V},L.prototype.setCurrentOpacity=function(k,V){var re=this;this.currentOpacity=k,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===V?re.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},L}(he),we=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=re.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=re.defaultHighlightOpacity,Q.fillPanel=new Re("Color",re.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new fe("Opacity",re.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return ue(L,Z),L.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="HighlightMarker",L.title="Highlight marker",L.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',L}(de),De='<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>',ke=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=re.defaultStrokeColor,Q.bgColor=re.defaultFillColor,Q.fontFamily=re.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new Re("Text color",re.defaultColorSet,Q.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>'),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new Re("Fill color",re.defaultColorSet,Q.bgColor,De),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new tt("Font",re.defaultFontFamilies,re.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new rt,Q.tipGrip.visual.transform.baseVal.appendItem(ae.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return Z.prototype.ownsTarget.call(this,k)||this.tipGrip.ownsTarget(k)||this.tip===k},L.prototype.createTip=function(){ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ae.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},L.prototype.pointerDown=function(k,V){this.state==="new"&&Z.prototype.pointerDown.call(this,k,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Z.prototype.pointerDown.call(this,k,V)},L.prototype.pointerUp=function(k){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Z.prototype.pointerUp.call(this,k);else{var V=this.state==="creating";Z.prototype.pointerUp.call(this,k),this.setTipPoints(V),this.positionTip()}},L.prototype.manipulate=function(k){if(this.tipMoving){var V=this.unrotatePoint(k);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else Z.prototype.manipulate.call(this,k)},L.prototype.setBgColor=function(k){this.bgRectangle&&this.tip&&(ae.setAttributes(this.bgRectangle,[["fill",k]]),ae.setAttributes(this.tip,[["fill",k]])),this.bgColor=k,this.fillColorChanged(k)},L.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},L.prototype.setTipPoints=function(k){k===void 0&&(k=!1);var V=Math.min(this.height/2,15),re=this.height/5;k&&(this.tipPosition={x:V+re/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(re=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+re,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(re=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-re,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+re}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(re=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-re,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-re},this.tipBase2Position={x:this.width,y:this.height-V}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(re=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+re,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-re})},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.positionTip()},L.prototype.positionTip=function(){ae.setAttributes(this.tip,[["points",this.getTipPoints()]]);var k=this.tipGrip.visual.transform.baseVal.getItem(0);k.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(k,0)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),L.prototype.select=function(){this.positionTip(),Z.prototype.select.call(this)},L.prototype.getState=function(){var k=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var V=k;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,Z.prototype.restoreState.call(this,k),this.createTip(),this.setTipPoints()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.tipPosition={x:this.tipPosition.x*k,y:this.tipPosition.y*V},this.positionTip()},L.typeName="CalloutMarker",L.title="Callout marker",L.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',L}(ft),Ze=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=re.defaultColor,Q.strokeWidth=re.defaultStrokeWidth,Q.strokeDasharray=re.defaultStrokeDasharray,Q.fillColor=re.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new Re("Line color",se(re.defaultColorSet,["transparent"]),re.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new Re("Fill color",se(re.defaultColorSet,["transparent"]),Q.fillColor,De),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new bt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new fe("Opacity",re.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual)},L.prototype.createVisual=function(){this.visual=ae.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="new"&&(this.createVisual(),this.moveVisual(k),this._state="creating")},L.prototype.manipulate=function(k){Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){Z.prototype.resize.call(this,k),this.setSize()},L.prototype.setSize=function(){Z.prototype.setSize.call(this),ae.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},L.prototype.pointerUp=function(k){Z.prototype.pointerUp.call(this,k),this.setSize()},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.visual&&ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(k),this.stateChanged()},L.prototype.setFillColor=function(k){this.fillColor=k,this.visual&&ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(k),this.stateChanged()},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.visual&&ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.visual&&ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},L.prototype.setOpacity=function(k){this.opacity=k,this.visual&&ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){var V=k;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),Z.prototype.restoreState.call(this,k),this.setSize()},L.prototype.scale=function(k,V){Z.prototype.scale.call(this,k,V),this.setSize()},L.typeName="EllipseMarker",L.title="Ellipse marker",L.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',L}(dt),ht=function(Z){function L(k,V,re){return Z.call(this,k,V,re)||this}return ue(L,Z),Object.defineProperty(L.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.tip1&&k!==this.tip2)},L.prototype.createTips=function(){this.tip1=ae.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(ae.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ae.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(ae.createTransform()),this.visual.appendChild(this.tip2)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.state==="creating"&&this.createTips()},L.prototype.adjustVisual=function(){if(Z.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ae.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()]]),ae.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var k=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(k,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var re=this.tip2.transform.baseVal.getItem(0);re.setRotate(k+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(re,0)}},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k),this.createTips(),this.adjustVisual()},L.typeName="MeasurementMarker",L.title="Measurement marker",L.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',L}(Ot),Ut=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.strokePanel.colors=re.defaultColorSet,Q.fillColor="transparent",Q}return ue(L,Z),Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Z.prototype.getState.call(this);return k.typeName=L.typeName,k},L.typeName="EllipseFrameMarker",L.title="Ellipse frame marker",L.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',L}(Ze),nn=function(){function Z(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Z.prototype.addUndoStep=function(L){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(L)||(this.undoStack.push(L),JSON.stringify(this.lastRedoStep)!==JSON.stringify(L)&&this.redoStack.splice(0,this.redoStack.length))},Z.prototype.replaceLastUndoStep=function(L){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=L)},Z.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Z.prototype.undo=function(){if(this.undoStack.length>1){var L=this.undoStack.pop();return L!==void 0&&this.redoStack.push(L),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Z.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Z}(),tn=function(Z){function L(k,V,re){var Q=Z.call(this,k,V,re)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=re.defaultColor,Q.strokeWidth=re.defaultStrokeWidth,Q.strokeDasharray=re.defaultStrokeDasharray,Q.strokePanel=new Re("Line color",re.defaultColorSet,re.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new bt("Line width",re.defaultStrokeWidths,re.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new gt("Line style",re.defaultStrokeDasharrays,re.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return ue(L,Z),L.prototype.ownsTarget=function(k){return!(!Z.prototype.ownsTarget.call(this,k)&&k!==this.visual&&k!==this.selectorCurve&&k!==this.visibleCurve&&!this.curveGrip.ownsTarget(k))},L.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},L.prototype.createVisual=function(){this.visual=ae.createGroup(),this.selectorCurve=ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ae.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},L.prototype.pointerDown=function(k,V){Z.prototype.pointerDown.call(this,k,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=k.x,this.curveY=k.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},L.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},L.prototype.setupControlBox=function(){Z.prototype.setupControlBox.call(this),this.curveControlLine1=ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ae.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},L.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Z.prototype.addControlGrips.call(this)},L.prototype.positionGrips=function(){Z.prototype.positionGrips.call(this);var k=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-k/2,this.curveY-k/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},L.prototype.manipulate=function(k){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+k.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+k.y-this.manipulationStartY),Z.prototype.manipulate.call(this,k)},L.prototype.resize=function(k){this.activeGrip===this.curveGrip&&(this.curveX=k.x,this.curveY=k.y),Z.prototype.resize.call(this,k),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},L.prototype.setStrokeColor=function(k){this.strokeColor=k,this.adjustVisual(),this.colorChanged(k)},L.prototype.setStrokeWidth=function(k){this.strokeWidth=k,this.adjustVisual()},L.prototype.setStrokeDasharray=function(k){this.strokeDasharray=k,this.adjustVisual()},L.prototype.scale=function(k,V){this.curveX=this.curveX*k,this.curveY=this.curveY*V,Z.prototype.scale.call(this,k,V)},Object.defineProperty(L.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),L.prototype.getState=function(){var k=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Z.prototype.getState.call(this));return k.typeName=L.typeName,k},L.prototype.restoreState=function(k){Z.prototype.restoreState.call(this,k);var V=k;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},L.typeName="CurveMarker",L.title="Curve marker",L.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',L}(kt),_n=function(){function Z(L,k){k===void 0&&(k=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=L,this.cancelable=k}return Object.defineProperty(Z.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Z.prototype.preventDefault=function(){this._defaultPrevented=!0},Z}(),bn=function(Z){function L(k,V,re){var Q=Z.call(this,k,!1)||this;return Q.dataUrl=V,Q.state=re,Q}return ue(L,Z),L}(_n),Kt=function(Z){function L(k,V,re){re===void 0&&(re=!1);var Q=Z.call(this,k,re)||this;return Q.marker=V,Q}return ue(L,Z),L}(_n),rr=function(){function Z(){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 Z.prototype.addEventListener=function(L,k){this[L].push(k)},Z.prototype.removeEventListener=function(L,k){var V=this[L].indexOf(k);V>-1&&this[L].splice(V,1)},Z}(),Ln=function(){function Z(L){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Je,this._isOpen=!1,this.undoRedoManager=new nn,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 rr,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Z.instanceCounter++,this.styles=new He(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=L,this.targetRoot=document.body,this.width=L.clientWidth,this.height=L.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Z.prototype,"ALL_MARKER_TYPES",{get:function(){return[xt,be,ge,ft,Ut,Ze,we,ke,ht,de,Ot,tn]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[xt,be,ge,ft,Ze,we,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"BASIC_MARKER_TYPES",{get:function(){return[xt,be,ge,ft,we]},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(L){var k=this;this._availableMarkerTypes.splice(0),L.forEach(function(V){if(typeof V=="string"){var re=k.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===V});re!==void 0&&k._availableMarkerTypes.push(re)}else k._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(L){this._zoomLevel=L,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Z.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ce.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Z.prototype.show=function(){var L=this;this.styles.styleSheetRoot===void 0&&Ye.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ye.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(k){return k(new _n(L))})},Z.prototype.render=function(){return pe(this,void 0,void 0,function(){var L;return xe(this,function(k){switch(k.label){case 0:return this.setCurrentMarker(),(L=new ze).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.markersOnly=this.renderMarkersOnly,L.width=this.renderWidth,L.height=this.renderHeight,[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return k.sent(),[4,L.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,k.sent()]}})})},Z.prototype.close=function(L){var k=this;if(L===void 0&&(L=!1),this.isOpen){var V=!1;L||this.eventListeners.beforeclose.forEach(function(re){var Q=new _n(k,!0);re(Q),Q.defaultPrevented&&(V=!0)}),V||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(re){return re(new _n(k))}),this.detachEvents(),this._isOpen=!1)}},Z.prototype.addMarkersToToolbar=function(){for(var L,k=[],V=0;V<arguments.length;V++)k[V]=arguments[V];(L=this._availableMarkerTypes).push.apply(L,k)},Z.prototype.addRenderEventListener=function(L){this.addEventListener("render",function(k){L(k.dataUrl,k.state)})},Z.prototype.removeRenderEventListener=function(L){},Z.prototype.addCloseEventListener=function(L){this.addEventListener("close",function(){L()})},Z.prototype.removeCloseEventListener=function(L){},Z.prototype.setupResizeObserver=function(){var L=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return L.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupTargetResize=function(){var L=1*this.target.clientWidth/this.target.clientHeight,k=this.editorCanvas.clientWidth/L>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*L:this.editorCanvas.clientWidth,V=k<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/L;this.resize(k,V)},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.prototype.resize=function(L,k){this._isResizing=!0;var V=L/this.imageWidth,re=k/this.imageHeight;this.imageWidth=Math.round(L),this.imageHeight=Math.round(k),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(V,re),this._isResizing=!1},Z.prototype.scaleMarkers=function(L,k){var V,re=this;this._currentMarker&&this._currentMarker instanceof ft?this._currentMarker.scale(L,k):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==re._currentMarker&&Q.scale(L,k)}),V!==void 0&&this.setCurrentMarker(V)},Z.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"},Z.prototype.setTopLeft=function(){var L=this.editingTarget.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=L.left-k.left,this.top=L.top-k.top},Z.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)},Z.prototype.addDefs=function(){for(var L,k=[],V=0;V<arguments.length;V++)k[V]=arguments[V];this.defs=ae.createDefs(),this.addDefsToImage(),(L=this.defs).append.apply(L,k)},Z.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Z.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)},Z.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Z.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Z.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)},Z.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Z.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)},Z.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var L=document.createElement("a");L.href="https://markerjs.com/",L.target="_blank",L.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',L.title="Powered by marker.js",L.style.display="grid",L.style.alignItems="center",L.style.justifyItems="center",L.style.padding="3px",L.style.width="20px",L.style.height="20px",this.logoUI.appendChild(L),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Z.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")},Z.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"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ke(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 nt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Z.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.removeMarker=function(L){this.markerImage.removeChild(L.container),this.markers.indexOf(L)>-1&&this.markers.splice(this.markers.indexOf(L),1),L.dispose()},Z.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())},Z.prototype.toolbarButtonClicked=function(L,k){if(L==="marker"&&k!==void 0)this.createNewMarker(k);else if(L==="action")switch(k){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Z.prototype.deleteSelectedMarker=function(){var L=this;if(this._currentMarker!==void 0){var k=!1;if(this.eventListeners.markerbeforedelete.forEach(function(re){var Q=new Kt(L,L._currentMarker,!0);re(Q),Q.defaultPrevented&&(k=!0)}),!k){var V=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(re){return re(new Kt(L,V))})}}},Z.prototype.clear=function(){var L=this,k=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var pt=new Kt(L,void 0,!0);Pe(pt),pt.defaultPrevented&&(k=!0)}),!k)){this.setCurrentMarker();for(var V=function(Pe){var pt=re.markers[Pe];re.setCurrentMarker(re.markers[Pe]),re._currentMarker.dispose(),re.markerImage.removeChild(re._currentMarker.container),re.markers.splice(re.markers.indexOf(re._currentMarker),1),re.eventListeners.markerdelete.forEach(function(Lt){return Lt(new Kt(L,pt))})},re=this,Q=this.markers.length-1;Q>=0;Q--)V(Q);this.addUndoStep()}},Object.defineProperty(Z.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Z.prototype.showNotesEditor=function(){var L;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(L=this._currentMarker.notes)!==null&&L!==void 0?L:"",this.overlayContainer.appendChild(this.notesArea))},Z.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)},Z.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Z.prototype.addUndoStep=function(){var L=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var k=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===k.width&&V.height===k.height){var re=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(k),re<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new _n(L))})}else this.undoRedoManager.replaceLastUndoStep(k),this.eventListeners.statechange.forEach(function(Q){return Q(new _n(L))})}},Z.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Z.prototype.undoStep=function(){var L=this,k=this.undoRedoManager.undo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new _n(L))}))},Z.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Z.prototype.redoStep=function(){var L=this,k=this.undoRedoManager.redo();k!==void 0&&(this.restoreState(k),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new _n(L))}))},Z.prototype.stepZoom=function(){var L=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=L<this.zoomSteps.length-1?this.zoomSteps[L+1]:this.zoomSteps[0]},Z.prototype.panTo=function(L){this.contentDiv.scrollBy({left:this.prevPanPoint.x-L.x,top:this.prevPanPoint.y-L.y}),this.prevPanPoint=L},Z.prototype.startRenderAndClose=function(){return pe(this,void 0,void 0,function(){var L,k,V=this;return xe(this,function(re){switch(re.label){case 0:return[4,this.render()];case 1:return L=re.sent(),k=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new bn(V,L,k))}),this.close(!0),[2]}})})},Z.prototype.getState=function(L){L===!0&&this.setCurrentMarker();var k={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return k.markers.push(V.getState())}),k},Z.prototype.restoreState=function(L){var k=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);L.markers.forEach(function(V){var re=k._availableMarkerTypes.find(function(Pe){return Pe.typeName===V.typeName});if(re!==void 0){var Q=k.addNewMarker(re);Q.restoreState(V),k.markers.push(Q)}}),L.width&&L.height&&(L.width!==this.imageWidth||L.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/L.width,this.imageHeight/L.height),this.eventListeners.restorestate.forEach(function(V){return V(new _n(k))})},Z.prototype.addNewMarker=function(L){var k=ae.createGroup();return this.markerImage.appendChild(k),new L(k,this.overlayContainer,this.settings)},Z.prototype.createNewMarker=function(L){var k,V=this;(k=typeof L=="string"?this._availableMarkerTypes.find(function(re){return re.typeName===L}):L)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(k),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(k.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(re){return re(new Kt(V,V._currentMarker))}))},Z.prototype.markerCreated=function(L){var k=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(L),this.setCurrentMarker(L),L instanceof be&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(be):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new Kt(k,k._currentMarker))})},Z.prototype.colorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=L,this.settings.defaultStrokeColor=L)},Z.prototype.fillColorChanged=function(L){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=L)},Z.prototype.markerStateChanged=function(L){var k=this;this.eventListeners.markerchange.forEach(function(V){return V(new Kt(k,L))})},Z.prototype.setCurrentMarker=function(L){var k=this;this._currentMarker!==L&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new Kt(k,k._currentMarker))})),this._currentMarker=L,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(V){return V(new Kt(k,k._currentMarker))}))},Z.prototype.onPointerDown=function(L){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||L.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var k=this.markers.find(function(V){return V.ownsTarget(L.target)});k!==void 0?(this.setCurrentMarker(k),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:L.clientX,y:L.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(L.clientX,L.clientY))},Z.prototype.onDblClick=function(L){if(this._isFocused||this.focus(),this.mode==="select"){var k=this.markers.find(function(V){return V.ownsTarget(L.target)});k!==void 0&&k!==this._currentMarker&&this.setCurrentMarker(k),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(L.clientX,L.clientY),L.target):this.setCurrentMarker()}},Z.prototype.onPointerMove=function(L){this.touchPoints!==1&&L.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||L.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(L.clientX,L.clientY)):this.zoomLevel>1&&this.panTo({x:L.clientX,y:L.clientY}))},Z.prototype.onPointerUp=function(L){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(L.clientX,L.clientY)),this.isDragging=!1,this.addUndoStep()},Z.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Z.prototype.onKeyUp=function(L){this._currentMarker===void 0||this.notesArea!==void 0||L.key!=="Delete"&&L.key!=="Backspace"||this.deleteSelectedMarker()},Z.prototype.clientToLocalCoordinates=function(L,k){var V=this.markerImage.getBoundingClientRect();return{x:(L-V.left)/this.zoomLevel,y:(k-V.top)/this.zoomLevel}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var L=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Z.prototype.addLicenseKey=function(L){Ce.addKey(L)},Z.prototype.addEventListener=function(L,k){this.eventListeners.addEventListener(L,k)},Z.prototype.removeEventListener=function(L,k){this.eventListeners.removeEventListener(L,k)},Z.prototype.renderState=function(L){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(L),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Z.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Z.prototype.focus=function(){var L=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(k){return k(new _n(L))}))},Z.prototype.blur=function(){var L=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(k){return k(new _n(L))}))},Z.instanceCounter=0,Z}();/* **********************************
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 Cr=function(Z,L){return(Cr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,V){k.__proto__=V}||function(k,V){for(var re in V)Object.prototype.hasOwnProperty.call(V,re)&&(k[re]=V[re])})(Z,L)};function pr(Z,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function k(){this.constructor=Z}Cr(Z,L),Z.prototype=L===null?Object.create(L):(k.prototype=L.prototype,new k)}function kn(Z,L,k,V){return new(k||(k=Promise))(function(re,Q){function Pe(rn){try{Lt(V.next(rn))}catch(vt){Q(vt)}}function pt(rn){try{Lt(V.throw(rn))}catch(vt){Q(vt)}}function Lt(rn){var vt;rn.done?re(rn.value):(vt=rn.value,vt instanceof k?vt:new k(function(Vt){Vt(vt)})).then(Pe,pt)}Lt((V=V.apply(Z,L||[])).next())})}function Mr(Z,L){var k,V,re,Q,Pe={label:0,sent:function(){if(1&re[0])throw re[1];return re[1]},trys:[],ops:[]};return Q={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function pt(Lt){return function(rn){return function(vt){if(k)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(k=1,V&&(re=2&vt[0]?V.return:vt[0]?V.throw||((re=V.return)&&re.call(V),0):V.next)&&!(re=re.call(V,vt[1])).done)return re;switch(V=0,re&&(vt=[2&vt[0],re.value]),vt[0]){case 0:case 1:re=vt;break;case 4:return Pe.label++,{value:vt[1],done:!1};case 5:Pe.label++,V=vt[1],vt=[0];continue;case 7:vt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(re=Pe.trys,(re=re.length>0&&re[re.length-1])||vt[0]!==6&&vt[0]!==2)){Pe=0;continue}if(vt[0]===3&&(!re||vt[1]>re[0]&&vt[1]<re[3])){Pe.label=vt[1];break}if(vt[0]===6&&Pe.label<re[1]){Pe.label=re[1],re=vt;break}if(re&&Pe.label<re[2]){Pe.label=re[2],Pe.ops.push(vt);break}re[2]&&Pe.ops.pop(),Pe.trys.pop();continue}vt=L.call(Z,Pe)}catch(Vt){vt=[6,Vt],V=0}finally{k=re=0}if(5&vt[0])throw vt[1];return{value:vt[0]?vt[1]:void 0,done:!0}}([Lt,rn])}}}var Or=function(){function Z(){}return Z.addKey=function(L){Z.key=L},Object.defineProperty(Z,"isLicensed",{get:function(){return!!Z.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Z.key)},enumerable:!1,configurable:!0}),Z}(),ln=function(){function Z(){}return Z.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Z.setAttributes=function(L,k){for(var V=0,re=k;V<re.length;V++){var Q=re[V],Pe=Q[0],pt=Q[1];L.setAttribute(Pe,pt)}},Z.createRect=function(L,k,V){var re=document.createElementNS("http://www.w3.org/2000/svg","rect");return re.setAttribute("width",L.toString()),re.setAttribute("height",k.toString()),V&&Z.setAttributes(re,V),re},Z.createLine=function(L,k,V,re,Q){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",L.toString()),Pe.setAttribute("y1",k.toString()),Pe.setAttribute("x2",V.toString()),Pe.setAttribute("y2",re.toString()),Q&&Z.setAttributes(Pe,Q),Pe},Z.createPolygon=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",L),k&&Z.setAttributes(V,k),V},Z.createCircle=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(L/2).toString()),V.setAttribute("cy",(L/2).toString()),V.setAttribute("r",L.toString()),k&&Z.setAttributes(V,k),V},Z.createEllipse=function(L,k,V){var re=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return re.setAttribute("cx",(L/2).toString()),re.setAttribute("cy",(k/2).toString()),re.setAttribute("rx",(L/2).toString()),re.setAttribute("ry",(k/2).toString()),V&&Z.setAttributes(re,V),re},Z.createGroup=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","g");return L&&Z.setAttributes(k,L),k},Z.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Z.createMarker=function(L,k,V,re,Q,Pe,pt){var Lt=document.createElementNS("http://www.w3.org/2000/svg","marker");return Z.setAttributes(Lt,[["id",L],["orient",k],["markerWidth",V.toString()],["markerHeight",re.toString()],["refX",Q.toString()],["refY",Pe.toString()]]),Lt.appendChild(pt),Lt},Z.createText=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","text");return k.setAttribute("x","0"),k.setAttribute("y","0"),L&&Z.setAttributes(k,L),k},Z.createTSpan=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=L,k&&Z.setAttributes(V,k),V},Z.createImage=function(L){var k=document.createElementNS("http://www.w3.org/2000/svg","image");return L&&Z.setAttributes(k,L),k},Z.createPoint=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=L,V.y=k,V},Z.createPath=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",L),k&&Z.setAttributes(V,k),V},Z.createElement=function(L,k){var V=document.createElementNS("http://www.w3.org/2000/svg",L);return k&&Z.setAttributes(V,k),V},Z.getHollowRectanglePath=function(L,k,V,re,Q,Pe,pt,Lt){return"M"+L+","+k+"V"+(k+re)+"H"+(L+V)+"V"+k+"H"+Q+"V"+Pe+"H"+(Q+pt)+"V"+(Pe+Lt)+"H"+Q+"V"+k+"Z"},Z}(),Xr=function(){function Z(L){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+L+"_"}return Object.defineProperty(Z.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Z.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(Z.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Z.prototype.addClass=function(L){return this.styleSheet===void 0&&this.addStyleSheet(),L.name=""+this.classNamePrefix+L.localName,this.classes.push(L),this.styleSheet.sheet.insertRule("."+L.name+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length),L},Z.prototype.addRule=function(L){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(L),this.styleSheet.sheet.insertRule(L.selector+" {"+L.style+"}",this.styleSheet.sheet.cssRules.length)},Z.prototype.addStyleSheet=function(){var L;this.styleSheet=document.createElement("style"),((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).appendChild(this.styleSheet),this.addRule(new hr("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new hr("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new hr("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Sr("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Sr("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Z.prototype.removeStyleSheet=function(){var L;this.styleSheet&&(((L=this.styleSheetRoot)!==null&&L!==void 0?L:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Z}(),hr=function(Z,L){this.selector=Z,this.style=L},Sr=function(Z,L){this.localName=Z,this.style=L},vn=function(){function Z(){this.blocks=[],this.display=""}return Z.prototype.addButtonBlock=function(L){L.className=this.blockClassName,L.buttonClassName=this.buttonClassName,L.buttonColorsClassName=this.buttonColorsClassName,L.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(L)},Z.prototype.addElementBlock=function(L){L.className===void 0&&(L.className=this.blockClassName),this.blocks.push(L)},Z.prototype.getUI=function(){var L=document.createElement("div");return L.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,L.style.display=this.display,this.blocks.forEach(function(k){return L.appendChild(k.getUI())}),L},Z}(),fn=function(){function Z(){}return Z.prototype.getUI=function(){var L=document.createElement("div");if(L.className=this.className,this.minWidth!==void 0&&(L.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":L.style.justifyContent="flex-start";break;case"center":L.style.justifyContent="center";break;case"end":L.style.justifyContent="flex-end"}return L.style.whiteSpace="nowrap",L},Z}(),Jn=function(Z){function L(){var k=Z!==null&&Z.apply(this,arguments)||this;return k.buttons=[],k}return pr(L,Z),L.prototype.addButton=function(k){k.className=this.buttonClassName,k.colorsClassName=this.buttonColorsClassName,k.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(k)},L.prototype.getUI=function(){var k=Z.prototype.getUI.call(this);return this.buttons.forEach(function(V){return k.appendChild(V.getUI())}),k},L}(fn),en=function(){function Z(L,k){this._isActive=!1,this._isHidden=!1,this._icon=L,this.title=k,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Z.prototype,"icon",{get:function(){return this._icon},set:function(L){this._icon=L,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isActive",{get:function(){return this._isActive},set:function(L){this._isActive=L,this.adjustClassName()},enumerable:!1,configurable:!0}),Z.prototype.getUI=function(){var L=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return L.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Z.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,"")))},Z.prototype.hide=function(){this._isHidden=!0},Z}(),jt=function(Z){function L(){var k=Z!==null&&Z.apply(this,arguments)||this;return k.elements=[],k}return pr(L,Z),L.prototype.addElement=function(k){this.elements.push(k)},L.prototype.getUI=function(){var k=Z.prototype.getUI.call(this);return this.elements.forEach(function(V){return k.appendChild(V)}),k},L}(fn),Fr=function(){function Z(L,k){this.horizontal=L,this.vertical=k}return Object.defineProperty(Z.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Z.prototype.getVerticalLength=function(L){return L/this.ratio},Z.prototype.getHorizontalLength=function(L){return L*this.ratio},Z}(),ri=function(){function Z(){}return Z.getIcon=function(L,k){if(L>0&&k>0){var V=new Fr(L,k),re=V.ratio>=1?20:V.getHorizontalLength(20),Q=V.ratio<1?20:V.getVerticalLength(20),Pe=document.createElementNS("http://www.w3.org/2000/svg","svg");Pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Pe);var pt=ln.createDefs();Pe.appendChild(pt);var Lt=ln.createElement("clipPath",[["id","text-bg-clip"]]);pt.appendChild(Lt);var rn=ln.createPath(ln.getHollowRectanglePath((24-re)/2,(24-Q)/2,re,Q,(24-re)/2+2,(24-Q)/2+2,re-4,Q-4));Pe.appendChild(rn);var vt=ln.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);vt.appendChild(ln.createTSpan(L+":"+k)),Pe.appendChild(vt);var Vt=vt.getBBox();ln.setAttributes(vt,[["x",((24-Vt.width)/2).toString()],["y",((24-Vt.height)/2-Vt.y).toString()]]);var fr=ln.createPath(ln.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Vt.width))/2,(24-Math.ceil(Vt.height))/2,Math.ceil(Vt.width),Math.ceil(Vt.height)));return Lt.appendChild(fr),ln.setAttributes(rn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Pe),Pe.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>'},Z}(),qr=function(Z){function L(k,V,re){var Q=Z.call(this,k,V)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=re,Q}return pr(L,Z),L.prototype.setupDropdown=function(){var k=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=k.className,V.colorsClassName=k.colorsClassName,k.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},L.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},L.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},L.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},L.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},L.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},L}(en),un=function(){function Z(L,k){this.GRIP_SIZE=10,this.color=L,this.fillColor=k,this.visual=ln.createGroup(),this.visual.appendChild(ln.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ln.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Z.prototype.ownsTarget=function(L){return L===this.visual||L===this.visual.childNodes[0]||L===this.visual.childNodes[1]},Z.prototype.setCenter=function(L,k){this.visual.childNodes.forEach(function(V){return ln.setAttributes(V,[["cx",L.toString()],["cy",k.toString()]])})},Z}(),Rr=function(){function Z(L,k,V,re){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=L,this.canvasHeight=k,this.margin=V,this.container=re,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(Z.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(L){this._aspectRatio=L,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.gridContainer&&ln.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(L){this._zoomFactor=L,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Z.prototype.open=function(){var L=this;this.cropShadeElement=ln.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ln.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var k=0;k<this.numberOfGridLines;k++)this.horizontalGridLines.push(ln.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ln.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(V){return L.gridContainer.appendChild(V)}),this.verticalGridLines.forEach(function(V){return L.gridContainer.appendChild(V)}),this.cropRectElement=ln.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new un(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new un(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new un(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new un(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Z.prototype.setCropRectangle=function(L){this.cropRect=L;var k=Object.assign({},this.cropRect);this.zoomFactor!==1&&(k.width=this.cropRect.width*this.zoomFactor,k.height=this.cropRect.height*this.zoomFactor,k.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-k.width/2,k.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-k.height/2),ln.setAttributes(this.cropRectElement,[["x",k.x.toString()],["y",k.y.toString()],["width",k.width.toString()],["height",k.height.toString()]]);var V=k.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,Pe){var pt=k.y+V*(Pe+1);ln.setAttributes(Q,[["x1",""+k.x],["y1",""+pt],["x2",""+(k.x+k.width)],["y2",""+pt]])});var re=k.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,Pe){var pt=k.x+re*(Pe+1);ln.setAttributes(Q,[["x1",""+pt],["y1",""+k.y],["x2",""+pt],["y2",""+(k.y+k.height)]])}),ln.setAttributes(this.cropShadeElement,[["d",ln.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,k.x,k.y,k.width,k.height)]]),this.topLeftGrip.setCenter(k.x,k.y),this.topRightGrip.setCenter(k.x+k.width,k.y),this.bottomLeftGrip.setCenter(k.x,k.y+k.height),this.bottomRightGrip.setCenter(k.x+k.width,k.y+k.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Z.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)},Z.prototype.clientToLocalCoordinates=function(L,k){var V=this.container.getBoundingClientRect();return{x:L-V.left+this.margin,y:k-V.top+this.margin}},Z.prototype.onPointerDown=function(L){this.container.setPointerCapture(L.pointerId),this.previousPoint=this.clientToLocalCoordinates(L.clientX,L.clientY),this.cropRectElement===L.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(L.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(L.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(L.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(L.target)&&(this.activeGrip=this.bottomRightGrip)},Z.prototype.onPointerMove=function(L){if(this.isMoving)this.move(this.clientToLocalCoordinates(L.clientX,L.clientY));else if(this.activeGrip){var k=this.clientToLocalCoordinates(L.clientX,L.clientY);this.resize(k)}L.preventDefault()},Z.prototype.onPointerUp=function(L){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(L.pointerId)},Z.prototype.move=function(L){var k=L.x-this.previousPoint.x,V=L.y-this.previousPoint.y;this.zoomFactor!==1&&(k=-k/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+k),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=L},Z.prototype.resize=function(L){var k=Object.assign({},this.cropRect),V=L.x-this.previousPoint.x,re=L.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:k.x+V<this.margin&&(V=this.margin-k.x),k.x+=V,k.width=this.cropRect.x+this.cropRect.width-k.x;break;case this.bottomRightGrip:case this.topRightGrip:k.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-k.width),k.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(k.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),k.height=this.aspectRatio.getVerticalLength(k.width)):(k.y+=re,k.height=this.cropRect.y+this.cropRect.height-k.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?k.height=this.aspectRatio.getVerticalLength(k.width):k.height+=re}k.width<10&&(k.x=this.cropRect.x,k.width=10),k.height<10&&(k.y=this.cropRect.y,k.height=10),this.previousPoint=L,k.x>=this.margin&&k.y>=this.margin&&k.x-this.margin+k.width<=this.canvasWidth&&k.y-this.margin+k.height<=this.canvasHeight&&(this.cropRect=k,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Z.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var L=this.cropRect.x+this.cropRect.width/2,k=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),re=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidth<re/this.canvasHeight?this.cropRect.width=V:this.cropRect.height=re,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=L-this.cropRect.width/2,this.cropRect.y=k-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},Z.prototype.getRescaledRect=function(L,k,V,re,Q,Pe){var pt=V/L,Lt=re/k;return{x:(Q.x-Pe)*pt+Pe,y:(Q.y-Pe)*Lt+Pe,width:Q.width*pt,height:Q.height*Lt}},Z.prototype.scaleCanvas=function(L,k){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,L,k,this.cropRect,this.margin);this.canvasWidth=L,this.canvasHeight=k,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},Z}(),yi=function(){function Z(L){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=L,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(Z.prototype,"angle",{get:function(){return this._angle},set:function(L){this._angle=L,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Z.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},Z.prototype.onPointerDown=function(L){this.controlContainer.setPointerCapture(L.pointerId),this.isDragging=!0,this.previousPoint={x:L.clientX,y:L.clientY}},Z.prototype.onPointerMove=function(L){this.isDragging&&(this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.previousPoint.x=L.clientX)},Z.prototype.onPointerUp=function(L){this.isDragging&&this.onAngleChange&&this.onAngleChange((L.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(L.pointerId)},Z.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var L=this.angleLabelText.getBBox();ln.setAttributes(this.angleLabelElement,[["x",((this.width-L.width)/2).toString()],["y",(this.height/2).toString()]])}},Z.prototype.positionScaleShape=function(){if(this.scaleShape){var L=this.scaleShape.transform.baseVal.getItem(0);L.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(L,0)}},Z.prototype.getVisual=function(){var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.setAttribute("xmlns","http://www.w3.org/2000/svg"),L.setAttribute("width",this.width+"px"),L.setAttribute("height",this.height+"px"),L.setAttribute("viewBox","0 0 "+this.width+" "+this.height),L.style.flexShrink="0",document.body.appendChild(L);for(var k="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var re=V%5==0?this.height/3:this.height/6;k+="h4v"+-re+"h1v"+re}k+="v1H0Z",this.scaleShape=ln.createPath(k);var Q=ln.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),L.appendChild(this.scaleShape),this.angleLabelElement=ln.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ln.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Pe=ln.createTSpan("");return Pe.innerHTML="&deg;",this.angleLabelElement.appendChild(Pe),L.appendChild(this.angleLabelElement),document.body.removeChild(L),L},Z}(),fi=function(){function Z(){this.naturalSize=!1,this.imageType="image/png"}return Z.prototype.rasterize=function(L,k,V,re,Q,Pe,pt){var Lt=this;return new Promise(function(rn){var vt=document.createElement("canvas");vt.width=L.width.baseVal.value-2*re,vt.height=L.height.baseVal.value-2*re;var Vt=1,fr=1;Lt.naturalSize===!0?(Vt=k.naturalWidth/(L.width.baseVal.value-2*re)/Pe,fr=k.naturalHeight/(L.height.baseVal.value-2*re)/pt,vt.width=k.naturalWidth/Pe,vt.height=k.naturalHeight/pt):Lt.width!==void 0&&Lt.height!==void 0&&(Vt=Lt.width/V.width,fr=Lt.height/V.height,vt.width*=Vt,vt.height*=fr);var Lr=vt.getContext("2d");Lr.translate(vt.width/2,vt.height/2),Lr.rotate(Q*Math.PI/180),Lr.scale(Pe,pt),Lr.translate(-vt.width/2,-vt.height/2),Lr.drawImage(k,0,0,vt.width,vt.height);var Zt=document.createElement("canvas");Zt.width=V.width*Vt,Zt.height=V.height*fr,Zt.getContext("2d").putImageData(Lr.getImageData((V.x-re)*Vt,(V.y-re)*fr,V.width*Vt,V.height*fr),0,0),rn(Zt.toDataURL(Lt.imageType,Lt.imageQuality))})},Z}(),_t=function(){function Z(L){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=Z.instanceCounter++,this.styles=new Xr(this.instanceNo),this.target=L,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(Z.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(L){this._zoomToCropEnabled=L,L?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(L){this._isGridVisible=L,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"gridLines",{get:function(){return this._gridLines},set:function(L){this._gridLines=L,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(L){this._rotationAngle=L,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"aspectRatio",{get:function(){var L;return(L=this._aspectRatio)!==null&&L!==void 0?L:this.aspectRatios[0]},set:function(L){this._aspectRatio=L},enumerable:!1,configurable:!0}),Z.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},Z.prototype.show=function(){this.showUI(),this.open()},Z.prototype.close=function(L){L===void 0&&(L=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),L||this.closeEventListeners.forEach(function(k){return k()}),this._isOpen=!1)},Z.prototype.addRenderEventListener=function(L){this.renderEventListeners.push(L)},Z.prototype.removeRenderEventListener=function(L){this.renderEventListeners.indexOf(L)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(L),1)},Z.prototype.addCloseEventListener=function(L){this.closeEventListeners.push(L)},Z.prototype.removeCloseEventListener=function(L){this.closeEventListeners.indexOf(L)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(L),1)},Z.prototype.setupResizeObserver=function(){var L=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){L.resize(L.target.clientWidth,L.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},Z.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var L=1*this.target.clientWidth/this.target.clientHeight,k=this.contentDiv.clientWidth/L>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*L:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=k+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/L;this.resize(k,V)}},Z.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Z.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",ln.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Z.prototype.resize=function(L,k){this.imageWidth=Math.round(L),this.imageHeight=Math.round(k),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()},Z.prototype.setEditingTarget=function(){var L=document.createElement("canvas");L.width=this.target.naturalWidth,L.height=this.target.naturalHeight,L.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var k=L.toDataURL();ln.setAttributes(this.editingTarget,[["href",k]]),this.setEditingTargetSize()},Z.prototype.setTopLeft=function(){var L=this.target.getBoundingClientRect(),k=this.editorCanvas.getBoundingClientRect();this.left=L.left-k.left-this.CANVAS_MARGIN,this.top=L.top-k.top-this.CANVAS_MARGIN},Z.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=ln.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ln.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ln.createGroup(),this.editingTargetRotationScaleContainer=ln.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var L=ln.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(L);var k=ln.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(k),this.editingTargetContainer=ln.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)},Z.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Z.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=ln.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Rr(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()},Z.prototype.zoomToCrop=function(){if(this.cropRect){var L=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,k=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=L+"px "+k+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-L+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-k+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Z.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)},Z.prototype.cropRectChanged=function(L){this.cropRect=L,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Z.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Z.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"},Z.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Z.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var L=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,k=this.target.offsetTop>L+this.CANVAS_MARGIN?this.target.offsetTop-(L+this.CANVAS_MARGIN):0;this.coverDiv.style.top=k+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},Z.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Z.prototype.addTopToolbar=function(){var L=this;this.topToolbar=new vn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new Jn;k.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(k);var V=[];this.aspectRatios.forEach(function(fr){var Lr=new en(ri.getIcon(fr.horizontal,fr.vertical),fr.horizontal===0&&fr.vertical===0?"FREE":fr.horizontal+":"+fr.vertical);Lr.onClick=function(){return L.ratioButtonClicked(fr)},V.push(Lr)}),this.aspectRatioButton=new qr(ri.getIcon(0,0),"Aspect ratio",V),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,k.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var re=new en('<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");re.isActive=this.isGridVisible,re.onClick=function(){L.isGridVisible=!L.isGridVisible,re.isActive=L.isGridVisible},k.addButton(re);var Q=new en('<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(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){L.zoomToCropEnabled=!L.zoomToCropEnabled,Q.isActive=L.zoomToCropEnabled},k.addButton(Q),!Or.isLicensed){var Pe=new jt;this.topToolbar.addElementBlock(Pe);var pt=document.createElement("div");pt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Lt=document.createElement("a");Lt.style.color="currentColor",Lt.href="https://markerjs.com/products/cropro",Lt.target="_blank",Lt.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>',pt.appendChild(Lt),Pe.addElement(pt)}var rn=new Jn;rn.minWidth=3*this.toolbarHeight+"px",rn.contentAlign="end",this.topToolbar.addButtonBlock(rn);var vt=new en('<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");vt.onClick=this.startRenderAndClose,rn.addButton(vt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Vt=new en('<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");Vt.onClick=this.close,rn.addButton(Vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Z.prototype.addBottomToolbar=function(){var L=this;this.bottomToolbar=new vn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var k=new Jn;k.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(k);var V=new en('<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");V.onClick=this.rotateLeftButtonClicked,k.addButton(V);var re=new en('<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");re.onClick=this.rotateRightButtonClicked,k.addButton(re);var Q=new jt;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new yi("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(rn){L.rotateBy(rn),L.straightener.angle=L.rotationAngle},Q.addElement(this.straightener.getUI());var Pe=new Jn;Pe.minWidth=2*this.toolbarHeight+"px",Pe.contentAlign="end",this.bottomToolbar.addButtonBlock(Pe);var pt=new en('<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");pt.onClick=this.flipHorizontallyButtonClicked,Pe.addButton(pt);var Lt=new en('<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");Lt.onClick=this.flipVerticallyButtonClicked,Pe.addButton(Lt)},Z.prototype.ratioButtonClicked=function(L){this.aspectRatio=L,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Z.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ri.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Z.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Fr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Z.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Z.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Z.prototype.restoreState=function(L){if(L){var k=this.cropLayer.getRescaledRect(L.width,L.height,this.imageWidth,this.imageHeight,L.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(k),this.cropRectChanged(k),this.flippedHorizontally=L.flippedHorizontally,this.flippedVertically=L.flippedVertically,this.applyFlip(),this.rotationAngle=L.rotationAngle,this.applyRotation()}},Z.prototype.clientToLocalCoordinates=function(L,k){var V=this.cropImage.getBoundingClientRect();return{x:L-V.left,y:k-V.top}},Z.prototype.onWindowResize=function(){this.positionUI()},Z.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var L=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},Z.prototype.rotateLeftButtonClicked=function(){var L=this.rotationAngle-90;this.rotationAngle%90!=0&&(L+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(L)},Z.prototype.rotateRightButtonClicked=function(){var L=this.rotationAngle+90;this.rotationAngle%90!=0&&(L-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(L)},Z.prototype.rotateTo=function(L){L=(L=L>180?L-360:L)<=-180?L+360:L,this.rotationAngle=L,this.applyRotation()},Z.prototype.rotateBy=function(L){this.rotateTo((this.rotationAngle+L)%360)},Z.prototype.applyRotation=function(){var L=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var k=this.editingTargetRotationContainer.transform.baseVal.getItem(0);k.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(k,0);var V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=L},Z.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Z.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Z.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Z.prototype.startRenderAndClose=function(){return kn(this,void 0,void 0,function(){var L,k;return Mr(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return L=V.sent(),k=this.getState(),this.renderEventListeners.forEach(function(re){return re(L,k)}),this.close(!0),[2]}})})},Z.prototype.render=function(){return kn(this,void 0,void 0,function(){var L;return Mr(this,function(k){switch(k.label){case 0:return(L=new fi).naturalSize=this.renderAtNaturalSize,L.imageType=this.renderImageType,L.imageQuality=this.renderImageQuality,L.width=this.renderWidth,L.height=this.renderHeight,this.unzoomFromCrop(),ln.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,L.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return k.sent(),[4,L.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,k.sent()]}})})},Z.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Sr("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 Sr("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Sr("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var L=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Sr("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*L)+`px;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Sr("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Sr("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new hr("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Sr("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 Sr("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Sr("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 Sr("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*L)+`px;
padding: `+L+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Sr("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Z.instanceCounter=0,Z}(),sn=U("8hTe"),Ii=U.n(sn),zi=/<pre[^>]*>/g;function na(Z){var L=document.createElement("div");return L.innerHTML=Z,L.childNodes.length===0?"":L.childNodes[0].nodeValue}var Vi=ve.a=function(Z){var L=Z.value,k=L===void 0?"":L,V=Z.edit,re=V===void 0?!1:V,Q=Z.className,Pe=Z.showTextOnly,pt=Z.showLines,Lt=Z.replaces,rn=Z.zoomImg,vt=Z.hasMask,Vt=Z.style,fr=Vt===void 0?{}:Vt,Lr=Z.stylesPrev,Zt=Lr===void 0?{}:Lr,mt=String(k),Pt=Object(I.useRef)(),Rt=Object(I.useRef)(),Gt=Object(I.useState)(""),cn=Object(G.a)(Gt,2),Tn=cn[0],Sn=cn[1],mn=Object(I.useState)("office"),In=Object(G.a)(mn,2),Kn=In[0],hn=In[1],An=function(){var Bt=new _t(Rt.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var yn=Object(F.a)(n.a.mark(function Ct(Mt){var Dt;return n.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Pt.current.style.display="none",Yt.next=3,Object(ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt}});case 3:Dt=Yt.sent,Dt!=null&&Dt.id&&Lt(Rt.current.getAttribute("src").replace(X.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 5:case"end":return Yt.stop()}},Ct)}));return function(Ct){return yn.apply(this,arguments)}}()),Bt.show()},dr=function(){var Bt=new Ln(Rt.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var yn=Object(F.a)(n.a.mark(function Ct(Mt){var Dt;return n.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(Pt.current.style.display="none",!Rt.current){Yt.next=6;break}return Yt.next=4,Object(ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Mt.dataUrl}});case 4:Dt=Yt.sent,Dt!=null&&Dt.id&&Lt(Rt.current.getAttribute("src").replace(X.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 6:case"end":return Yt.stop()}},Ct)}));return function(Ct){return yn.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Nn=Object(I.useMemo)(function(){Pt.current&&(Pt.current.style.zIndex=-1);try{var Xt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,yn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;mt=mt.replace(Xt,"("+X.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+X.a.API_SERVER+"/api/attachments/").replace(yn,'"'+X.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(Me){}var Ct=N(mt),Mt=C();if(mt.match(/\[TOC\]/)&&(Ct=Ct.replace("<p>[TOC]</p>",R()),D()),Ct=Ct.replace(/(__special_katext_id_\d+__)/g,function(Me,Yt){var wn=Mt[Yt],mr=wn.type,Rn=wn.expression;return Object(ee.renderToString)(na(Rn)||"",{displayMode:mr==="block",throwOnError:!1,output:"html"})}),Ct=Ct.replace(/▁/g,"\u2581\u2581\u2581"),E(),Pe){var Dt=document.createElement("div");return Dt.innerHTML=Ct,Dt.innerText}return setTimeout(function(){return sr()},500),Ct},[mt]),zt=Object(I.useRef)();A.WebkitLineClamp=pt,pt&&(fr=Object(P.a)(Object(P.a)({},fr),A));function On(Xt){var Bt=Xt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(rn){var yn=Bt.getAttribute("src");Sn(yn),hn("image")}}else if(Bt.tagName.toUpperCase()==="A"){var Ct=Bt.getAttribute("href");if(Ct.indexOf("office")>-1)Xt.preventDefault(),Sn(Ct),hn("office");else if(Ct.indexOf("application/pdf")>-1)Xt.preventDefault(),Sn(Ct),hn("pdf");else if(Ct.indexOf("text/html")>-1)Xt.preventDefault(),Sn(Ct),hn("html");else if(Ct.startsWith("#")){Xt.preventDefault();var Mt=document.getElementById(Ct.replace("#",""));Mt&&Mt.scrollIntoView(!0)}}}var sr=function(){var Bt,yn=(Bt=zt.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");yn==null||yn.forEach(function(Ct){if(Ct.oncontextmenu=function(){return!1},Ct.src.indexOf(".m3u8")>-1&&!Ct.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var Mt=new H.a;Mt.loadSource(Ct.src),Mt.attachMedia(Ct)}}})};Object(I.useEffect)(function(){if(zt.current&&Nn&&(Nn.match(zi)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",On),function(){zt.current.removeEventListener("click",On),E(),D()}},[Nn,zt.current,On]);var Un=function(Bt){if(!re)return;Bt.target.nodeName==="IMG"?(Pt.current.style.zIndex=1,Pt.current.style.display="flex",Pt.current.style.width=Bt.target.clientWidth+"px",Pt.current.style.height=Bt.target.clientHeight+"px",Pt.current.style.top=Bt.target.offsetTop+"px",Pt.current.style.left=Bt.target.offsetLeft+"px",Rt.current.src=Bt.target.getAttribute("src")):Pt.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:zt,style:Object(P.a)({},fr),className:"".concat(Q||""," markdown-body ").concat(Ii.a.mdBody),onMouseOver:Un,dangerouslySetInnerHTML:{__html:Nn}}),b.a.createElement("div",{ref:Pt,className:Ii.a.button},b.a.createElement(Y.a,null,b.a.createElement(z.a,{onClick:function(){return An()}},"\u88C1\u526A"),b.a.createElement(z.a,{onClick:function(){return dr()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Rt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(J.a,{close:!0,data:Tn,type:Tn!=null&&Tn.length?Kn:"",style:Object(P.a)({},Zt),onClose:function(){return Sn("")}}))}},"9VGf":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return M});var ne=U("q1tI"),Y=U.n(ne);function M(z,P){var F=Object(ne.useRef)();Object(ne.useEffect)(function(){F.current=z}),Object(ne.useEffect)(function(){function G(){F.current()}if(P!==null){var K=setInterval(G,P);return function(){return clearInterval(K)}}},[P])}},"A60/":function(ut,ve,U){ut.exports={wrap:"wrap___37dvp",right20:"right20___2yZBe",right180:"right180___14fSn",basket:"basket___32ZdA",count:"count___2ydNT",iconWrap:"iconWrap___2cEp5",icon:"icon___3fYs3",name:"name___7IPYm"}},BU3w:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return F});var ne=U("MNnm"),Y="rc-util-key";function M(G){if(G.attachTo)return G.attachTo;var K=document.querySelector("head");return K||document.body}function z(G){var K,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ne.a)())return null;var I=document.createElement("style");if((K=n.csp)===null||K===void 0?void 0:K.nonce){var b;I.nonce=(b=n.csp)===null||b===void 0?void 0:b.nonce}I.innerHTML=G;var f=M(n),y=f.firstChild;return n.prepend&&f.prepend?f.prepend(I):n.prepend&&y?f.insertBefore(I,y):f.appendChild(I),I}var P=new Map;function F(G,K){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=M(n);if(!P.has(I)){var b=z("",n),f=b.parentNode;P.set(I,f),f.removeChild(b)}var y=Array.from(P.get(I).children).find(function(u){return u.tagName==="STYLE"&&u[Y]===K});if(y){var c,a;if(((c=n.csp)===null||c===void 0?void 0:c.nonce)&&y.nonce!==((a=n.csp)===null||a===void 0?void 0:a.nonce)){var p;y.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return y.innerHTML!==G&&(y.innerHTML=G),y}var l=z(G,n);return l[Y]=K,l}},Bd2K:function(ut,ve,U){(function(ne){ne(U("VrN/"),U("osHv"))})(function(ne){ne.defineOption("autoCloseTags",!1,function(n,I,b){if(b!=ne.Init&&b&&n.removeKeyMap("autoCloseTags"),!I)return;var f={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(f["'/'"]=function(y){return F(y)}),(typeof I!="object"||I.whenOpening!==!1)&&(f["'>'"]=function(y){return z(y)}),n.addKeyMap(f)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function z(n){if(n.getOption("disableInput"))return ne.Pass;for(var I=n.listSelections(),b=[],f=n.getOption("autoCloseTags"),y=0;y<I.length;y++){if(!I[y].empty())return ne.Pass;var c=I[y].head,a=n.getTokenAt(c),p=ne.innerMode(n.getMode(),a.state),l=p.state,u=p.mode.xmlCurrentTag&&p.mode.xmlCurrentTag(l),s=u&&u.name;if(!s)return ne.Pass;var i=p.mode.configuration=="html",D=typeof f=="object"&&f.dontCloseTags||i&&Y,A=typeof f=="object"&&f.indentTags||i&&M;a.end>c.ch&&(s=s.slice(0,s.length-a.end+c.ch));var S=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"&&u.close||a.string.indexOf("/")==c.ch-a.start-1||D&&G(D,S)>-1||K(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(l)||[],s,c,!0))return ne.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&G(R,s)>-1){b[y]={text:"/>",newPos:ne.Pos(c.line,c.ch+2)};continue}var O=A&&G(A,S)>-1;b[y]={indent:O,text:">"+(O?`
`:"")+"</"+s+">",newPos:O?ne.Pos(c.line+1,0):ne.Pos(c.line,c.ch+1)}}for(var m=typeof f=="object"&&f.dontIndentOnAutoClose,y=I.length-1;y>=0;y--){var v=b[y];n.replaceRange(v.text,I[y].head,I[y].anchor,"+insert");var h=n.listSelections().slice(0);h[y]={head:v.newPos,anchor:v.newPos},n.setSelections(h),!m&&v.indent&&(n.indentLine(v.newPos.line,null,!0),n.indentLine(v.newPos.line+1,null,!0))}}function P(n,I){for(var b=n.listSelections(),f=[],y=I?"/":"</",c=n.getOption("autoCloseTags"),a=typeof c=="object"&&c.dontIndentOnSlash,p=0;p<b.length;p++){if(!b[p].empty())return ne.Pass;var l=b[p].head,u=n.getTokenAt(l),s=ne.innerMode(n.getMode(),u.state),i=s.state;if(I&&(u.type=="string"||u.string.charAt(0)!="<"||u.start!=l.ch-1))return ne.Pass;var D,A=s.mode.name!="xml"&&n.getMode().name=="htmlmixed";if(A&&s.mode.name=="javascript")D=y+"script";else if(A&&s.mode.name=="css")D=y+"style";else{var S=s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i);if(!S||S.length&&K(n,S,S[S.length-1],l))return ne.Pass;D=y+S[S.length-1]}n.getLine(l.line).charAt(u.end)!=">"&&(D+=">"),f[p]=D}if(n.replaceSelections(f),b=n.listSelections(),!a)for(var p=0;p<b.length;p++)(p==b.length-1||b[p].head.line<b[p+1].head.line)&&n.indentLine(b[p].head.line)}function F(n){return n.getOption("disableInput")?ne.Pass:P(n,!0)}ne.commands.closeTag=function(n){return P(n)};function G(n,I){if(n.indexOf)return n.indexOf(I);for(var b=0,f=n.length;b<f;++b)if(n[b]==I)return b;return-1}function K(n,I,b,f,y){if(!ne.scanForClosingTag)return!1;var c=Math.min(n.lastLine()+1,f.line+500),a=ne.scanForClosingTag(n,f,null,c);if(!a||a.tag!=b)return!1;for(var p=y?1:0,l=I.length-1;l>=0&&I[l]==b;l--)++p;f=a.to;for(var l=1;l<p;l++){var u=ne.scanForClosingTag(n,f,null,c);if(!u||u.tag!=b)return!1;f=u.to}return!0}})},BdwD:function(ut,ve,U){"use strict";var ne=U("+L6B"),Y=U("2/Rp"),M=U("0Owb"),z=U("k1fw"),P=U("q1tI"),F=U.n(P),G=U("FOrL"),K=U.n(G),n=function(b){var f=b.buttonProps,y=f===void 0?{}:f,c=b.styles,a=c===void 0?{}:c,p=b.customText,l=b.ButtonText,u=b.ButtonClick,s=b.Buttonclass,i=b.ButtonTwo;return F.a.createElement("section",{className:"tc animated fadeIn",style:Object(z.a)(Object(z.a)({},{color:"#999",margin:"200px auto"}),a)},F.a.createElement("img",{src:K.a}),F.a.createElement("p",{className:"mt20 font14"},p||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),l&&F.a.createElement(Y.a,Object(M.a)({className:s,onClick:u},y),l),i&&i)};ve.a=n},BjJ7:function(ut,ve,U){"use strict";U.d(ve,"d",function(){return Y}),U.d(ve,"c",function(){return M}),U.d(ve,"e",function(){return z}),U.d(ve,"b",function(){return P}),U.d(ve,"a",function(){return G});var ne=U("m3rI");function Y(K){var n=!0;if(K.length>0){for(var I=0;I<K.length;I++)if(K[I].compile_success==0||!K[I].compile_success){n=!1;break}}else n=!1;return n}function M(K){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",I=[],b=0;b<K.length;b++){var f=K[b],y=n?"".concat(n,"/").concat(f.name):"".concat(f.name);I.push({title:f.name,isLeaf:!(f.type==="tree"),key:y})}return I}function z(K,n,I){for(var b=0;b<K.length;b++){var f=K[b];if(f.key===n){f.children=I;break}f.children&&z(f.children,n,I)}return K}function P(K,n,I){var b;return function(){var f=this,y=arguments,c=function(){b=null,I||K.apply(f,y)},a=I&&!b;clearTimeout(b),b=setTimeout(c,n),a&&K.apply(f,y)}}var F=!0,G=ne.a.API_SERVER},"C+DQ":function(ut,ve,U){},"C/vA":function(ut,ve,U){"use strict";U.d(ve,"a",function(){return ne});function ne(Y){const M=this;let z=!1,P;return function(){return z||(z=!0,P=Y.apply(M,arguments)),P}}},"Cg/j":function(ut,ve,U){"use strict";U.d(ve,"b",function(){return ne}),U.d(ve,"a",function(){return Y}),U.d(ve,"c",function(){return z}),U.d(ve,"d",function(){return P});var ne;(function(F){F.serviceIds=new Map,F.DI_TARGET="$di$target",F.DI_DEPENDENCIES="$di$dependencies";function G(K){return K[F.DI_DEPENDENCIES]||[]}F.getServiceDependencies=G})(ne||(ne={}));const Y=z("instantiationService");function M(F,G,K,n){G[ne.DI_TARGET]===G?G[ne.DI_DEPENDENCIES].push({id:F,index:K,optional:n}):(G[ne.DI_DEPENDENCIES]=[{id:F,index:K,optional:n}],G[ne.DI_TARGET]=G)}function z(F){if(ne.serviceIds.has(F))return ne.serviceIds.get(F);const G=function(K,n,I){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");M(G,K,I,!1)};return G.toString=()=>F,ne.serviceIds.set(F,G),G}function P(F){return function(G,K,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");M(F,G,n,!0)}}},DlQD:function(ut,ve,U){(function(ne,Y){ut.exports=Y()})(this,function(){"use strict";function ne(be,Ee){for(var ge=0;ge<Ee.length;ge++){var de=Ee[ge];de.enumerable=de.enumerable||!1,de.configurable=!0,"value"in de&&(de.writable=!0),Object.defineProperty(be,de.key,de)}}function Y(be,Ee,ge){return Ee&&ne(be.prototype,Ee),ge&&ne(be,ge),be}function M(be,Ee){if(!be)return;if(typeof be=="string")return z(be,Ee);var ge=Object.prototype.toString.call(be).slice(8,-1);if(ge==="Object"&&be.constructor&&(ge=be.constructor.name),ge==="Map"||ge==="Set")return Array.from(be);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return z(be,Ee)}function z(be,Ee){(Ee==null||Ee>be.length)&&(Ee=be.length);for(var ge=0,de=new Array(Ee);ge<Ee;ge++)de[ge]=be[ge];return de}function P(be,Ee){var ge;if(typeof Symbol=="undefined"||be[Symbol.iterator]==null){if(Array.isArray(be)||(ge=M(be))||Ee&&be&&typeof be.length=="number"){ge&&(be=ge);var de=0;return function(){return de>=be.length?{done:!0}:{done:!1,value:be[de++]}}}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=be[Symbol.iterator](),ge.next.bind(ge)}function F(be,Ee){return Ee={exports:{}},be(Ee,Ee.exports),Ee.exports}var G=F(function(be){function Ee(){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(de){be.exports.defaults=de}be.exports={defaults:Ee(),getDefaults:Ee,changeDefaults:ge}}),K=G.defaults,n=G.getDefaults,I=G.changeDefaults,b=/[&<>"']/,f=/[&<>"']/g,y=/[<>"']|&(?!#?\w+;)/,c=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(Ee){return a[Ee]};function l(be,Ee){if(Ee){if(b.test(be))return be.replace(f,p)}else if(y.test(be))return be.replace(c,p);return be}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(be){return be.replace(u,function(Ee,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 i=/(^|[^\[])\^/g;function D(be,Ee){be=be.source||be,Ee=Ee||"";var ge={replace:function(fe,we){return we=we.source||we,we=we.replace(i,"$1"),be=be.replace(fe,we),ge},getRegex:function(){return new RegExp(be,Ee)}};return ge}var A=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(be,Ee,ge){if(be){var de;try{de=decodeURIComponent(s(ge)).replace(A,"").toLowerCase()}catch(fe){return null}if(de.indexOf("javascript:")===0||de.indexOf("vbscript:")===0||de.indexOf("data:")===0)return null}Ee&&!S.test(ge)&&(ge=d(Ee,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(fe){return null}return ge}var O={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(be,Ee){O[" "+be]||(m.test(be)?O[" "+be]=be+"/":O[" "+be]=j(be,"/",!0)),be=O[" "+be];var ge=be.indexOf(":")===-1;return Ee.substring(0,2)==="//"?ge?Ee:be.replace(v,"$1")+Ee:Ee.charAt(0)==="/"?ge?Ee:be.replace(h,"$1")+Ee:be+Ee}var C={exec:function(){}};function E(be){for(var Ee=1,ge,de;Ee<arguments.length;Ee++){ge=arguments[Ee];for(de in ge)Object.prototype.hasOwnProperty.call(ge,de)&&(be[de]=ge[de])}return be}function w(be,Ee){var ge=be.replace(/\|/g,function(we,De,ke){for(var Ze=!1,ht=De;--ht>=0&&ke[ht]==="\\";)Ze=!Ze;return Ze?"|":" |"}),de=ge.split(/ \|/),fe=0;if(de.length>Ee)de.splice(Ee);else for(;de.length<Ee;)de.push("");for(;fe<de.length;fe++)de[fe]=de[fe].trim().replace(/\\\|/g,"|");return de}function j(be,Ee,ge){var de=be.length;if(de===0)return"";for(var fe=0;fe<de;){var we=be.charAt(de-fe-1);if(we===Ee&&!ge)fe++;else if(we!==Ee&&ge)fe++;else break}return be.substr(0,de-fe)}function W(be,Ee){if(be.indexOf(Ee[1])===-1)return-1;for(var ge=be.length,de=0,fe=0;fe<ge;fe++)if(be[fe]==="\\")fe++;else if(be[fe]===Ee[0])de++;else if(be[fe]===Ee[1]&&(de--,de<0))return fe;return-1}function T(be){be&&be.sanitize&&!be.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 N={escape:l,unescape:s,edit:D,cleanUrl:R,resolveUrl:d,noopTest:C,merge:E,splitCells:w,rtrim:j,findClosingBracket:W,checkSanitizeDeprecation:T},_=G.defaults,x=N.rtrim,H=N.splitCells,X=N.escape,ee=N.findClosingBracket;function J(be,Ee,ge){var de=Ee.href,fe=Ee.title?X(Ee.title):null,we=be[1].replace(/\\([\[\]])/g,"$1");return be[0].charAt(0)!=="!"?{type:"link",raw:ge,href:de,title:fe,text:we}:{type:"image",raw:ge,href:de,title:fe,text:X(we)}}function ce(be,Ee){var ge=be.match(/^(\s+)(?:```)/);if(ge===null)return Ee;var de=ge[1];return Ee.split(`
`).map(function(fe){var we=fe.match(/^\s+/);if(we===null)return fe;var De=we[0];return De.length>=de.length?fe.slice(de.length):fe}).join(`
`)}var me=function(){function be(ge){this.options=ge||_}var Ee=be.prototype;return Ee.space=function(de){var fe=this.rules.block.newline.exec(de);if(fe)return fe[0].length>1?{type:"space",raw:fe[0]}:{raw:`
`}},Ee.code=function(de,fe){var we=this.rules.block.code.exec(de);if(we){var De=fe[fe.length-1];if(De&&De.type==="paragraph")return{raw:we[0],text:we[0].trimRight()};var ke=we[0].replace(/^ {4}/gm,"");return{type:"code",raw:we[0],codeBlockStyle:"indented",text:this.options.pedantic?ke:x(ke,`
`)}}},Ee.fences=function(de){var fe=this.rules.block.fences.exec(de);if(fe){var we=fe[0],De=ce(we,fe[3]||"");return{type:"code",raw:we,lang:fe[2]?fe[2].trim():fe[2],text:De}}},Ee.heading=function(de){var fe=this.rules.block.heading.exec(de);if(fe)return{type:"heading",raw:fe[0],depth:fe[1].length,text:fe[2]}},Ee.nptable=function(de){var fe=this.rules.block.nptable.exec(de);if(fe){var we={type:"table",header:H(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(`
`):[],raw:fe[0]};if(we.header.length===we.align.length){var De=we.align.length,ke;for(ke=0;ke<De;ke++)/^ *-+: *$/.test(we.align[ke])?we.align[ke]="right":/^ *:-+: *$/.test(we.align[ke])?we.align[ke]="center":/^ *:-+ *$/.test(we.align[ke])?we.align[ke]="left":we.align[ke]=null;for(De=we.cells.length,ke=0;ke<De;ke++)we.cells[ke]=H(we.cells[ke],we.header.length);return we}}},Ee.hr=function(de){var fe=this.rules.block.hr.exec(de);if(fe)return{type:"hr",raw:fe[0]}},Ee.blockquote=function(de){var fe=this.rules.block.blockquote.exec(de);if(fe){var we=fe[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:fe[0],text:we}}},Ee.list=function(de){var fe=this.rules.block.list.exec(de);if(fe){for(var we=fe[0],De=fe[2],ke=De.length>1,Ze=De[De.length-1]===")",ht={type:"list",raw:we,ordered:ke,start:ke?+De.slice(0,-1):"",loose:!1,items:[]},Ut=fe[0].match(this.rules.block.item),nn=!1,tn,_n,bn,Kt,rr,Ln,Cr,pr=Ut.length,kn=0;kn<pr;kn++)tn=Ut[kn],we=tn,_n=tn.length,tn=tn.replace(/^ *([*+-]|\d+[.)]) */,""),~tn.indexOf(`
`)&&(_n-=tn.length,tn=this.options.pedantic?tn.replace(/^ {1,4}/gm,""):tn.replace(new RegExp("^ {1,"+_n+"}","gm"),"")),kn!==pr-1&&(bn=this.rules.block.bullet.exec(Ut[kn+1])[0],(ke?bn.length===1||!Ze&&bn[bn.length-1]===")":bn.length>1||this.options.smartLists&&bn!==De)&&(Kt=Ut.slice(kn+1).join(`
`),ht.raw=ht.raw.substring(0,ht.raw.length-Kt.length),kn=pr-1)),rr=nn||/\n\n(?!\s*$)/.test(tn),kn!==pr-1&&(nn=tn.charAt(tn.length-1)===`
`,rr||(rr=nn)),rr&&(ht.loose=!0),Ln=/^\[[ xX]\] /.test(tn),Cr=void 0,Ln&&(Cr=tn[1]!==" ",tn=tn.replace(/^\[[ xX]\] +/,"")),ht.items.push({type:"list_item",raw:we,task:Ln,checked:Cr,loose:rr,text:tn});return ht}},Ee.html=function(de){var fe=this.rules.block.html.exec(de);if(fe)return{type:this.options.sanitize?"paragraph":"html",raw:fe[0],pre:!this.options.sanitizer&&(fe[1]==="pre"||fe[1]==="script"||fe[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):X(fe[0]):fe[0]}},Ee.def=function(de){var fe=this.rules.block.def.exec(de);if(fe){fe[3]&&(fe[3]=fe[3].substring(1,fe[3].length-1));var we=fe[1].toLowerCase().replace(/\s+/g," ");return{tag:we,raw:fe[0],href:fe[2],title:fe[3]}}},Ee.table=function(de){var fe=this.rules.block.table.exec(de);if(fe){var we={type:"table",header:H(fe[1].replace(/^ *| *\| *$/g,"")),align:fe[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:fe[3]?fe[3].replace(/\n$/,"").split(`
`):[]};if(we.header.length===we.align.length){we.raw=fe[0];var De=we.align.length,ke;for(ke=0;ke<De;ke++)/^ *-+: *$/.test(we.align[ke])?we.align[ke]="right":/^ *:-+: *$/.test(we.align[ke])?we.align[ke]="center":/^ *:-+ *$/.test(we.align[ke])?we.align[ke]="left":we.align[ke]=null;for(De=we.cells.length,ke=0;ke<De;ke++)we.cells[ke]=H(we.cells[ke].replace(/^ *\| *| *\| *$/g,""),we.header.length);return we}}},Ee.lheading=function(de){var fe=this.rules.block.lheading.exec(de);if(fe)return{type:"heading",raw:fe[0],depth:fe[2].charAt(0)==="="?1:2,text:fe[1]}},Ee.paragraph=function(de){var fe=this.rules.block.paragraph.exec(de);if(fe)return{type:"paragraph",raw:fe[0],text:fe[1].charAt(fe[1].length-1)===`
`?fe[1].slice(0,-1):fe[1]}},Ee.text=function(de,fe){var we=this.rules.block.text.exec(de);if(we){var De=fe[fe.length-1];return De&&De.type==="text"?{raw:we[0],text:we[0]}:{type:"text",raw:we[0],text:we[0]}}},Ee.escape=function(de){var fe=this.rules.inline.escape.exec(de);if(fe)return{type:"escape",raw:fe[0],text:X(fe[1])}},Ee.tag=function(de,fe,we){var De=this.rules.inline.tag.exec(de);if(De)return!fe&&/^<a /i.test(De[0])?fe=!0:fe&&/^<\/a>/i.test(De[0])&&(fe=!1),!we&&/^<(pre|code|kbd|script)(\s|>)/i.test(De[0])?we=!0:we&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(De[0])&&(we=!1),{type:this.options.sanitize?"text":"html",raw:De[0],inLink:fe,inRawBlock:we,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):X(De[0]):De[0]}},Ee.link=function(de){var fe=this.rules.inline.link.exec(de);if(fe){var we=ee(fe[2],"()");if(we>-1){var De=fe[0].indexOf("!")===0?5:4,ke=De+fe[1].length+we;fe[2]=fe[2].substring(0,we),fe[0]=fe[0].substring(0,ke).trim(),fe[3]=""}var Ze=fe[2],ht="";if(this.options.pedantic){var Ut=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ze);Ut?(Ze=Ut[1],ht=Ut[3]):ht=""}else ht=fe[3]?fe[3].slice(1,-1):"";Ze=Ze.trim().replace(/^<([\s\S]*)>$/,"$1");var nn=J(fe,{href:Ze&&Ze.replace(this.rules.inline._escapes,"$1"),title:ht&&ht.replace(this.rules.inline._escapes,"$1")},fe[0]);return nn}},Ee.reflink=function(de,fe){var we;if((we=this.rules.inline.reflink.exec(de))||(we=this.rules.inline.nolink.exec(de))){var De=(we[2]||we[1]).replace(/\s+/g," ");if(De=fe[De.toLowerCase()],!De||!De.href){var ke=we[0].charAt(0);return{type:"text",raw:ke,text:ke}}var Ze=J(we,De,we[0]);return Ze}},Ee.strong=function(de,fe,we){we===void 0&&(we="");var De=this.rules.inline.strong.start.exec(de);if(De&&(!De[1]||De[1]&&(we===""||this.rules.inline.punctuation.exec(we)))){fe=fe.slice(-1*de.length);var ke=De[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ke.lastIndex=0;for(var Ze;(De=ke.exec(fe))!=null;)if(Ze=this.rules.inline.strong.middle.exec(fe.slice(0,De.index+3)),Ze)return{type:"strong",raw:de.slice(0,Ze[0].length),text:de.slice(2,Ze[0].length-2)}}},Ee.em=function(de,fe,we){we===void 0&&(we="");var De=this.rules.inline.em.start.exec(de);if(De&&(!De[1]||De[1]&&(we===""||this.rules.inline.punctuation.exec(we)))){fe=fe.slice(-1*de.length);var ke=De[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ke.lastIndex=0;for(var Ze;(De=ke.exec(fe))!=null;)if(Ze=this.rules.inline.em.middle.exec(fe.slice(0,De.index+2)),Ze)return{type:"em",raw:de.slice(0,Ze[0].length),text:de.slice(1,Ze[0].length-1)}}},Ee.codespan=function(de){var fe=this.rules.inline.code.exec(de);if(fe){var we=fe[2].replace(/\n/g," "),De=/[^ ]/.test(we),ke=we.startsWith(" ")&&we.endsWith(" ");return De&&ke&&(we=we.substring(1,we.length-1)),we=X(we,!0),{type:"codespan",raw:fe[0],text:we}}},Ee.br=function(de){var fe=this.rules.inline.br.exec(de);if(fe)return{type:"br",raw:fe[0]}},Ee.del=function(de){var fe=this.rules.inline.del.exec(de);if(fe)return{type:"del",raw:fe[0],text:fe[1]}},Ee.autolink=function(de,fe){var we=this.rules.inline.autolink.exec(de);if(we){var De,ke;return we[2]==="@"?(De=X(this.options.mangle?fe(we[1]):we[1]),ke="mailto:"+De):(De=X(we[1]),ke=De),{type:"link",raw:we[0],text:De,href:ke,tokens:[{type:"text",raw:De,text:De}]}}},Ee.url=function(de,fe){var we;if(we=this.rules.inline.url.exec(de)){var De,ke;if(we[2]==="@")De=X(this.options.mangle?fe(we[0]):we[0]),ke="mailto:"+De;else{var Ze;do Ze=we[0],we[0]=this.rules.inline._backpedal.exec(we[0])[0];while(Ze!==we[0]);De=X(we[0]),we[1]==="www."?ke="http://"+De:ke=De}return{type:"link",raw:we[0],text:De,href:ke,tokens:[{type:"text",raw:De,text:De}]}}},Ee.inlineText=function(de,fe,we){var De=this.rules.inline.text.exec(de);if(De){var ke;return fe?ke=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(De[0]):X(De[0]):De[0]:ke=X(this.options.smartypants?we(De[0]):De[0]),{type:"text",raw:De[0],text:ke}}},be}(),ue=N.noopTest,pe=N.edit,xe=N.merge,se={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:ue,table:ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=pe(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,se.item=pe(se.item,"gm").replace(/bull/g,se.bullet).getRegex(),se.list=pe(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._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",se._comment=/<!--(?!-?>)[\s\S]*?-->/,se.html=pe(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=pe(se._paragraph).replace("hr",se.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",se._tag).getRegex(),se.blockquote=pe(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=xe({},se),se.gfm=xe({},se.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*|$)"}),se.gfm.nptable=pe(se.gfm.nptable).replace("hr",se.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",se._tag).getRegex(),se.gfm.table=pe(se.gfm.table).replace("hr",se.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",se._tag).getRegex(),se.pedantic=xe({},se.normal,{html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._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:ue,paragraph:pe(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ue,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:ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ae._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ae.punctuation=pe(ae.punctuation).replace(/punctuation/g,ae._punctuation).getRegex(),ae._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ae._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ae.em.start=pe(ae.em.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.middle=pe(ae.em.middle).replace(/punctuation/g,ae._punctuation).replace(/overlapSkip/g,ae._overlapSkip).getRegex(),ae.em.endAst=pe(ae.em.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.em.endUnd=pe(ae.em.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.start=pe(ae.strong.start).replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.middle=pe(ae.strong.middle).replace(/punctuation/g,ae._punctuation).replace(/blockSkip/g,ae._blockSkip).getRegex(),ae.strong.endAst=pe(ae.strong.endAst,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.strong.endUnd=pe(ae.strong.endUnd,"g").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=pe(ae._blockSkip,"g").getRegex(),ae.overlapSkip=pe(ae._overlapSkip,"g").getRegex(),ae._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._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])?)+(?![-_])/,ae.autolink=pe(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=pe(ae.tag).replace("comment",se._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=pe(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=pe(ae.reflink).replace("label",ae._label).getRegex(),ae.reflinkSearch=pe(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal=xe({},ae),ae.pedantic=xe({},ae.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()}),ae.gfm=xe({},ae.normal,{escape:pe(ae.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ae.gfm.url=pe(ae.gfm.url,"i").replace("email",ae.gfm._extended_email).getRegex(),ae.breaks=xe({},ae.gfm,{br:pe(ae.br).replace("{2,}","*").getRegex(),text:pe(ae.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ce={block:se,inline:ae},ze=G.defaults,Ye=Ce.block,He=Ce.inline;function Ve(be){return be.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 Fe(be){var Ee="",ge,de,fe=be.length;for(ge=0;ge<fe;ge++)de=be.charCodeAt(ge),Math.random()>.5&&(de="x"+de.toString(16)),Ee+="&#"+de+";";return Ee}var Ke=function(){function be(ge){this.tokens=[],this.tokens.links=Object.create(null),this.options=ge||ze,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var de={block:Ye.normal,inline:He.normal};this.options.pedantic?(de.block=Ye.pedantic,de.inline=He.pedantic):this.options.gfm&&(de.block=Ye.gfm,this.options.breaks?de.inline=He.breaks:de.inline=He.gfm),this.tokenizer.rules=de}be.lex=function(de,fe){var we=new be(fe);return we.lex(de)};var Ee=be.prototype;return Ee.lex=function(de){return de=de.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(de,this.tokens,!0),this.inline(this.tokens),this.tokens},Ee.blockTokens=function(de,fe,we){fe===void 0&&(fe=[]),we===void 0&&(we=!0),de=de.replace(/^ +$/gm,"");for(var De,ke,Ze,ht;de;){if(De=this.tokenizer.space(de)){de=de.substring(De.raw.length),De.type&&fe.push(De);continue}if(De=this.tokenizer.code(de,fe)){de=de.substring(De.raw.length),De.type?fe.push(De):(ht=fe[fe.length-1],ht.raw+=`
`+De.raw,ht.text+=`
`+De.text);continue}if(De=this.tokenizer.fences(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(De=this.tokenizer.heading(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(De=this.tokenizer.nptable(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(De=this.tokenizer.hr(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(De=this.tokenizer.blockquote(de)){de=de.substring(De.raw.length),De.tokens=this.blockTokens(De.text,[],we),fe.push(De);continue}if(De=this.tokenizer.list(de)){for(de=de.substring(De.raw.length),Ze=De.items.length,ke=0;ke<Ze;ke++)De.items[ke].tokens=this.blockTokens(De.items[ke].text,[],!1);fe.push(De);continue}if(De=this.tokenizer.html(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(we&&(De=this.tokenizer.def(de))){de=de.substring(De.raw.length),this.tokens.links[De.tag]||(this.tokens.links[De.tag]={href:De.href,title:De.title});continue}if(De=this.tokenizer.table(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(De=this.tokenizer.lheading(de)){de=de.substring(De.raw.length),fe.push(De);continue}if(we&&(De=this.tokenizer.paragraph(de))){de=de.substring(De.raw.length),fe.push(De);continue}if(De=this.tokenizer.text(de,fe)){de=de.substring(De.raw.length),De.type?fe.push(De):(ht=fe[fe.length-1],ht.raw+=`
`+De.raw,ht.text+=`
`+De.text);continue}if(de){var Ut="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(Ut);break}else throw new Error(Ut)}}return fe},Ee.inline=function(de){var fe,we,De,ke,Ze,ht,Ut=de.length;for(fe=0;fe<Ut;fe++){ht=de[fe];switch(ht.type){case"paragraph":case"text":case"heading":{ht.tokens=[],this.inlineTokens(ht.text,ht.tokens);break}case"table":{for(ht.tokens={header:[],cells:[]},ke=ht.header.length,we=0;we<ke;we++)ht.tokens.header[we]=[],this.inlineTokens(ht.header[we],ht.tokens.header[we]);for(ke=ht.cells.length,we=0;we<ke;we++)for(Ze=ht.cells[we],ht.tokens.cells[we]=[],De=0;De<Ze.length;De++)ht.tokens.cells[we][De]=[],this.inlineTokens(Ze[De],ht.tokens.cells[we][De]);break}case"blockquote":{this.inline(ht.tokens);break}case"list":{for(ke=ht.items.length,we=0;we<ke;we++)this.inline(ht.items[we].tokens);break}}}return de},Ee.inlineTokens=function(de,fe,we,De,ke){fe===void 0&&(fe=[]),we===void 0&&(we=!1),De===void 0&&(De=!1),ke===void 0&&(ke="");var Ze,ht=de,Ut;if(this.tokens.links){var nn=Object.keys(this.tokens.links);if(nn.length>0)for(;(Ut=this.tokenizer.rules.inline.reflinkSearch.exec(ht))!=null;)nn.includes(Ut[0].slice(Ut[0].lastIndexOf("[")+1,-1))&&(ht=ht.slice(0,Ut.index)+"["+"a".repeat(Ut[0].length-2)+"]"+ht.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ut=this.tokenizer.rules.inline.blockSkip.exec(ht))!=null;)ht=ht.slice(0,Ut.index)+"["+"a".repeat(Ut[0].length-2)+"]"+ht.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;de;){if(Ze=this.tokenizer.escape(de)){de=de.substring(Ze.raw.length),fe.push(Ze);continue}if(Ze=this.tokenizer.tag(de,we,De)){de=de.substring(Ze.raw.length),we=Ze.inLink,De=Ze.inRawBlock,fe.push(Ze);continue}if(Ze=this.tokenizer.link(de)){de=de.substring(Ze.raw.length),Ze.type==="link"&&(Ze.tokens=this.inlineTokens(Ze.text,[],!0,De)),fe.push(Ze);continue}if(Ze=this.tokenizer.reflink(de,this.tokens.links)){de=de.substring(Ze.raw.length),Ze.type==="link"&&(Ze.tokens=this.inlineTokens(Ze.text,[],!0,De)),fe.push(Ze);continue}if(Ze=this.tokenizer.strong(de,ht,ke)){de=de.substring(Ze.raw.length),Ze.tokens=this.inlineTokens(Ze.text,[],we,De),fe.push(Ze);continue}if(Ze=this.tokenizer.em(de,ht,ke)){de=de.substring(Ze.raw.length),Ze.tokens=this.inlineTokens(Ze.text,[],we,De),fe.push(Ze);continue}if(Ze=this.tokenizer.codespan(de)){de=de.substring(Ze.raw.length),fe.push(Ze);continue}if(Ze=this.tokenizer.br(de)){de=de.substring(Ze.raw.length),fe.push(Ze);continue}if(Ze=this.tokenizer.del(de)){de=de.substring(Ze.raw.length),Ze.tokens=this.inlineTokens(Ze.text,[],we,De),fe.push(Ze);continue}if(Ze=this.tokenizer.autolink(de,Fe)){de=de.substring(Ze.raw.length),fe.push(Ze);continue}if(!we&&(Ze=this.tokenizer.url(de,Fe))){de=de.substring(Ze.raw.length),fe.push(Ze);continue}if(Ze=this.tokenizer.inlineText(de,De,Ve)){de=de.substring(Ze.raw.length),ke=Ze.raw.slice(-1),fe.push(Ze);continue}if(de){var tn="Infinite loop on byte: "+de.charCodeAt(0);if(this.options.silent){console.error(tn);break}else throw new Error(tn)}}return fe},Y(be,null,[{key:"rules",get:function(){return{block:Ye,inline:He}}}]),be}(),nt=G.defaults,he=N.cleanUrl,Re=N.escape,Ne=function(){function be(ge){this.options=ge||nt}var Ee=be.prototype;return Ee.code=function(de,fe,we){var De=(fe||"").match(/\S*/)[0];if(this.options.highlight){var ke=this.options.highlight(de,De);ke!=null&&ke!==de&&(we=!0,de=ke)}return De?'<pre><code class="'+this.options.langPrefix+Re(De,!0)+'">'+(we?de:Re(de,!0))+`</code></pre>
`:"<pre><code>"+(we?de:Re(de,!0))+`</code></pre>
`},Ee.blockquote=function(de){return`<blockquote>
`+de+`</blockquote>
`},Ee.html=function(de){return de},Ee.heading=function(de,fe,we,De){return this.options.headerIds?"<h"+fe+' id="'+this.options.headerPrefix+De.slug(we)+'">'+de+"</h"+fe+`>
`:"<h"+fe+">"+de+"</h"+fe+`>
`},Ee.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Ee.list=function(de,fe,we){var De=fe?"ol":"ul",ke=fe&&we!==1?' start="'+we+'"':"";return"<"+De+ke+`>
`+de+"</"+De+`>
`},Ee.listitem=function(de){return"<li>"+de+`</li>
`},Ee.checkbox=function(de){return"<input "+(de?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ee.paragraph=function(de){return"<p>"+de+`</p>
`},Ee.table=function(de,fe){return fe&&(fe="<tbody>"+fe+"</tbody>"),`<table>
<thead>
`+de+`</thead>
`+fe+`</table>
`},Ee.tablerow=function(de){return`<tr>
`+de+`</tr>
`},Ee.tablecell=function(de,fe){var we=fe.header?"th":"td",De=fe.align?"<"+we+' align="'+fe.align+'">':"<"+we+">";return De+de+"</"+we+`>
`},Ee.strong=function(de){return"<strong>"+de+"</strong>"},Ee.em=function(de){return"<em>"+de+"</em>"},Ee.codespan=function(de){return"<code>"+de+"</code>"},Ee.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ee.del=function(de){return"<del>"+de+"</del>"},Ee.link=function(de,fe,we){if(de=he(this.options.sanitize,this.options.baseUrl,de),de===null)return we;var De='<a href="'+Re(de)+'"';return fe&&(De+=' title="'+fe+'"'),De+=">"+we+"</a>",De},Ee.image=function(de,fe,we){if(de=he(this.options.sanitize,this.options.baseUrl,de),de===null)return we;var De='<img src="'+de+'" alt="'+we+'"';return fe&&(De+=' title="'+fe+'"'),De+=this.options.xhtml?"/>":">",De},Ee.text=function(de){return de},be}(),Ue=function(){function be(){}var Ee=be.prototype;return Ee.strong=function(de){return de},Ee.em=function(de){return de},Ee.codespan=function(de){return de},Ee.del=function(de){return de},Ee.html=function(de){return de},Ee.text=function(de){return de},Ee.link=function(de,fe,we){return""+we},Ee.image=function(de,fe,we){return""+we},Ee.br=function(){return""},be}(),rt=function(){function be(){this.seen={}}var Ee=be.prototype;return Ee.slug=function(de){var fe=de.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(fe)){var we=fe;do this.seen[we]++,fe=we+"-"+this.seen[we];while(this.seen.hasOwnProperty(fe))}return this.seen[fe]=0,fe},be}(),st=G.defaults,dt=N.unescape,at=function(){function be(ge){this.options=ge||st,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new rt}be.parse=function(de,fe){var we=new be(fe);return we.parse(de)};var Ee=be.prototype;return Ee.parse=function(de,fe){fe===void 0&&(fe=!0);var we="",De,ke,Ze,ht,Ut,nn,tn,_n,bn,Kt,rr,Ln,Cr,pr,kn,Mr,Or,ln,Xr=de.length;for(De=0;De<Xr;De++){Kt=de[De];switch(Kt.type){case"space":continue;case"hr":{we+=this.renderer.hr();continue}case"heading":{we+=this.renderer.heading(this.parseInline(Kt.tokens),Kt.depth,dt(this.parseInline(Kt.tokens,this.textRenderer)),this.slugger);continue}case"code":{we+=this.renderer.code(Kt.text,Kt.lang,Kt.escaped);continue}case"table":{for(_n="",tn="",ht=Kt.header.length,ke=0;ke<ht;ke++)tn+=this.renderer.tablecell(this.parseInline(Kt.tokens.header[ke]),{header:!0,align:Kt.align[ke]});for(_n+=this.renderer.tablerow(tn),bn="",ht=Kt.cells.length,ke=0;ke<ht;ke++){for(nn=Kt.tokens.cells[ke],tn="",Ut=nn.length,Ze=0;Ze<Ut;Ze++)tn+=this.renderer.tablecell(this.parseInline(nn[Ze]),{header:!1,align:Kt.align[Ze]});bn+=this.renderer.tablerow(tn)}we+=this.renderer.table(_n,bn);continue}case"blockquote":{bn=this.parse(Kt.tokens),we+=this.renderer.blockquote(bn);continue}case"list":{for(rr=Kt.ordered,Ln=Kt.start,Cr=Kt.loose,ht=Kt.items.length,bn="",ke=0;ke<ht;ke++)kn=Kt.items[ke],Mr=kn.checked,Or=kn.task,pr="",kn.task&&(ln=this.renderer.checkbox(Mr),Cr?kn.tokens.length>0&&kn.tokens[0].type==="text"?(kn.tokens[0].text=ln+" "+kn.tokens[0].text,kn.tokens[0].tokens&&kn.tokens[0].tokens.length>0&&kn.tokens[0].tokens[0].type==="text"&&(kn.tokens[0].tokens[0].text=ln+" "+kn.tokens[0].tokens[0].text)):kn.tokens.unshift({type:"text",text:ln}):pr+=ln),pr+=this.parse(kn.tokens,Cr),bn+=this.renderer.listitem(pr,Or,Mr);we+=this.renderer.list(bn,rr,Ln);continue}case"html":{we+=this.renderer.html(Kt.text);continue}case"paragraph":{we+=this.renderer.paragraph(this.parseInline(Kt.tokens));continue}case"text":{for(bn=Kt.tokens?this.parseInline(Kt.tokens):Kt.text;De+1<Xr&&de[De+1].type==="text";)Kt=de[++De],bn+=`
`+(Kt.tokens?this.parseInline(Kt.tokens):Kt.text);we+=fe?this.renderer.paragraph(bn):bn;continue}default:{var hr='Token with "'+Kt.type+'" type was not found.';if(this.options.silent){console.error(hr);return}else throw new Error(hr)}}}return we},Ee.parseInline=function(de,fe){fe=fe||this.renderer;var we="",De,ke,Ze=de.length;for(De=0;De<Ze;De++){ke=de[De];switch(ke.type){case"escape":{we+=fe.text(ke.text);break}case"html":{we+=fe.html(ke.text);break}case"link":{we+=fe.link(ke.href,ke.title,this.parseInline(ke.tokens,fe));break}case"image":{we+=fe.image(ke.href,ke.title,ke.text);break}case"strong":{we+=fe.strong(this.parseInline(ke.tokens,fe));break}case"em":{we+=fe.em(this.parseInline(ke.tokens,fe));break}case"codespan":{we+=fe.codespan(ke.text);break}case"br":{we+=fe.br();break}case"del":{we+=fe.del(this.parseInline(ke.tokens,fe));break}case"text":{we+=fe.text(ke.text);break}default:{var ht='Token with "'+ke.type+'" type was not found.';if(this.options.silent){console.error(ht);return}else throw new Error(ht)}}}return we},be}(),bt=N.merge,gt=N.checkSanitizeDeprecation,xt=N.escape,Je=G.getDefaults,kt=G.changeDefaults,Ot=G.defaults;function tt(be,Ee,ge){if(typeof be=="undefined"||be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(be)+", string expected");if(typeof Ee=="function"&&(ge=Ee,Ee=null),Ee=bt({},tt.defaults,Ee||{}),gt(Ee),ge){var de=Ee.highlight,fe;try{fe=Ke.lex(be,Ee)}catch(Ze){return ge(Ze)}var we=function(ht){var Ut;if(!ht)try{Ut=at.parse(fe,Ee)}catch(nn){ht=nn}return Ee.highlight=de,ht?ge(ht):ge(null,Ut)};if(!de||de.length<3)return we();if(delete Ee.highlight,!fe.length)return we();var De=0;tt.walkTokens(fe,function(Ze){Ze.type==="code"&&(De++,setTimeout(function(){de(Ze.text,Ze.lang,function(ht,Ut){if(ht)return we(ht);Ut!=null&&Ut!==Ze.text&&(Ze.text=Ut,Ze.escaped=!0),De--,De===0&&we()})},0))}),De===0&&we();return}try{var ke=Ke.lex(be,Ee);return Ee.walkTokens&&tt.walkTokens(ke,Ee.walkTokens),at.parse(ke,Ee)}catch(Ze){if(Ze.message+=`
Please report this to https://github.com/markedjs/marked.`,Ee.silent)return"<p>An error occurred:</p><pre>"+xt(Ze.message+"",!0)+"</pre>";throw Ze}}tt.options=tt.setOptions=function(be){return bt(tt.defaults,be),kt(tt.defaults),tt},tt.getDefaults=Je,tt.defaults=Ot,tt.use=function(be){var Ee=bt({},be);if(be.renderer&&function(){var de=tt.defaults.renderer||new Ne,fe=function(ke){var Ze=de[ke];de[ke]=function(){for(var ht=arguments.length,Ut=new Array(ht),nn=0;nn<ht;nn++)Ut[nn]=arguments[nn];var tn=be.renderer[ke].apply(de,Ut);return tn===!1&&(tn=Ze.apply(de,Ut)),tn}};for(var we in be.renderer)fe(we);Ee.renderer=de}(),be.tokenizer&&function(){var de=tt.defaults.tokenizer||new me,fe=function(ke){var Ze=de[ke];de[ke]=function(){for(var ht=arguments.length,Ut=new Array(ht),nn=0;nn<ht;nn++)Ut[nn]=arguments[nn];var tn=be.tokenizer[ke].apply(de,Ut);return tn===!1&&(tn=Ze.apply(de,Ut)),tn}};for(var we in be.tokenizer)fe(we);Ee.tokenizer=de}(),be.walkTokens){var ge=tt.defaults.walkTokens;Ee.walkTokens=function(de){be.walkTokens(de),ge&&ge(de)}}tt.setOptions(Ee)},tt.walkTokens=function(be,Ee){for(var ge=P(be),de;!(de=ge()).done;){var fe=de.value;Ee(fe);switch(fe.type){case"table":{for(var we=P(fe.tokens.header),De;!(De=we()).done;){var ke=De.value;tt.walkTokens(ke,Ee)}for(var Ze=P(fe.tokens.cells),ht;!(ht=Ze()).done;)for(var Ut=ht.value,nn=P(Ut),tn;!(tn=nn()).done;){var _n=tn.value;tt.walkTokens(_n,Ee)}break}case"list":{tt.walkTokens(fe.items,Ee);break}default:fe.tokens&&tt.walkTokens(fe.tokens,Ee)}}},tt.Parser=at,tt.parser=at.parse,tt.Renderer=Ne,tt.TextRenderer=Ue,tt.Lexer=Ke,tt.lexer=Ke.lex,tt.Tokenizer=me,tt.Slugger=rt,tt.parse=tt;var ft=tt;return ft})},EJTS:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return A});var ne=U("qVdP"),Y=U("jsC+"),M=U("lUTK"),z=U("BvKs"),P=U("sRBo"),F=U("kaz8"),G=U("oBTY"),K=U("7Kak"),n=U("9yH6"),I=U("tJVT"),b=U("q1tI"),f=U.n(b),y=U("9Bee"),c=U("+vTd"),a=U.n(c),p=U("xKgJ"),l=U("Is5a"),u=U.n(l),s=["A\uFF0E","B\uFF0E","C\uFF0E","D\uFF0E","E\uFF0E","F\uFF0E","G\uFF0E","H\uFF0E","I\uFF0E","J\uFF0E","K\uFF0E","L\uFF0E","M\uFF0E","N\uFF0E","O\uFF0E","P\uFF0E","Q\uFF0E","R\uFF0E","S\uFF0E","T\uFF0E","U\uFF0E","V\uFF0E","W\uFF0E","X\uFF0E","Y\uFF0E","Z\uFF0E"],i=["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"],D=function(R){var O,m=R.data,v=R.selectIds,h=R.onSelectCheckBox,d=h===void 0?function(){}:h,C=R.showCheckbox,E=C===void 0?!0:C,w=Object(b.useState)(!1),j=Object(I.a)(w,2),W=j[0],T=j[1],N=function(){if(m.item_type==="JUDGMENT")return f.a.createElement("div",{className:a.a.judgmentContent},m.choices.map(function(ce,me){return f.a.createElement(n.a,{key:me,disabled:!0},ce.choice_text)}));if(m.item_type==="PROGRAM"){var ee;return f.a.createElement("div",{className:a.a.programContent},f.a.createElement(y.a,{value:(ee=m.program_attr)===null||ee===void 0?void 0:ee.description}))}if(m.item_type==="COMBINATION"){var J;return f.a.createElement("div",{className:a.a.combinationContent},m==null||((J=m.sub_item_banks)===null||J===void 0)?void 0:J.map(function(ce,me){var ue,pe="(\u9898\u76EE".concat(me+1,"-\u5355\u9009\u9898) ");return f.a.createElement(b.Fragment,null,f.a.createElement("div",{style:{marginTop:10,marginBottom:10}},f.a.createElement(y.a,{value:pe+ce.name})),ce.choices.map(function(xe,se){return f.a.createElement("div",{key:se,className:a.a.otherContentItem},f.a.createElement("p",null,s[se]),f.a.createElement(y.a,{className:a.a.otehrContentHtml,value:xe.choice_text}))}),f.a.createElement("div",{className:a.a.con},f.a.createElement("b",{className:"c-grey-333 font14"}," ","\u7B54\u6848\uFF1A",i==null?void 0:i[ce==null||((ue=ce.choices)===null||ue===void 0)?void 0:ue.findIndex(function(xe){return xe==null?void 0:xe.is_answer})]," "),f.a.createElement("div",null,f.a.createElement("span",null,"\u89E3\u6790\uFF1A"),f.a.createElement(y.a,{className:a.a.parseAnswerHtml,value:ce.analysis||"\u6682\u65E0\u89E3\u6790"}))))}))}return f.a.createElement("div",{className:a.a.otherContent},m.choices.map(function(ce,me){return f.a.createElement("div",{key:me,className:a.a.otherContentItem},f.a.createElement("p",null,s[me]),f.a.createElement(y.a,{className:a.a.otehrContentHtml,value:ce.choice_text}))}))},_=function(){var ee;return f.a.createElement("div",null,(ee=m.standard_answer)===null||ee===void 0?void 0:ee.map(function(J,ce){return f.a.createElement(y.a,{key:ce,className:a.a.answerHtml,value:"\u7B54\u6848\uFF08\u586B\u7A7A".concat(J.position,"\uFF09\uFF1A").concat(J.answer_text.join("\u3001"))})}))},x=function(){var ee,J,ce,me={SUBJECTIVE:(ee=m.answer_texts)===null||ee===void 0?void 0:ee[0],JUDGMENT:(J=m.choices)===null||J===void 0||((ce=J.find(function(ze){return ze.is_answer}))===null||ce===void 0)?void 0:ce.choice_text},ue=m.choices.map(function(ze){return ze.is_answer}).findIndex(function(ze){return ze}),pe=ue>-1?i[ue]:"",xe="";m.choices.map(function(ze,Ye){ze.is_answer&&(xe+=i[Ye])});var se=me[m.item_type],ae={SINGLE:f.a.createElement(y.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(pe||"\u65E0")}),MULTIPLE:f.a.createElement(y.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(xe||"\u65E0")}),COMPLETION:_()},Ce=f.a.createElement(y.a,{className:a.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(se||"\u65E0")});return ae[m.item_type]||Ce},H=function(ee){var J=Object(G.a)(v);ee.target.checked?J.push(m.id):J=J.filter(function(ce){return ce!==m.id}),d(J)};return f.a.createElement("div",{className:a.a.itemWrap},f.a.createElement("div",{className:a.a.list},E&&f.a.createElement(F.a,{className:"mr10",onChange:H,checked:v.includes(m.id)}),f.a.createElement("div",{className:a.a.title},f.a.createElement(y.a,{key:1,showLines:1,showTextOnly:!0,className:a.a.topicTitleContent,value:m.name})),f.a.createElement("div",{className:a.a.line},f.a.createElement("b",{className:a.a.b1}),f.a.createElement("b",{className:a.a.b2})),f.a.createElement("div",{onClick:function(){return T(!W)},className:a.a.tr},W?"\u6536\u8D77":"\u5C55\u5F00",f.a.createElement("i",{style:{transform:W?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),f.a.createElement("aside",{style:W?{display:"block"}:{display:"none"},className:a.a.itemDetail},f.a.createElement("div",{style:{marginBottom:44}},f.a.createElement(y.a,{key:2,className:a.a.topicTitleContent,value:m.name}),f.a.createElement("div",{className:"".concat(a.a.row," mt15")},N()),f.a.createElement("div",{className:a.a.row},f.a.createElement("div",{className:a.a.updateTimeRow},f.a.createElement("div",{className:a.a.updateTimeWrap},m.item_type==="PROGRAM"&&f.a.createElement("p",{className:a.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(O=m.program_attr)===null||O===void 0?void 0:O.language))))),m.item_type!=="PROGRAM"&&m.item_type!=="COMBINATION"&&f.a.createElement("div",{className:a.a.answerWrapper},f.a.createElement("img",{src:u.a,alt:"",className:a.a.decoration}),f.a.createElement("div",{className:a.a.answer},x()),f.a.createElement("div",{className:a.a.parse},f.a.createElement("div",{className:a.a.parseText},"\u89E3\u6790\uFF1A"),f.a.createElement("div",{className:a.a.parseAnswer},m.analysis?f.a.createElement(y.a,{className:a.a.parseAnswerHtml,value:m.analysis}):"\u6682\u65E0\u89E3\u6790")))))},A=function(R){var O,m,v,h,d,C,E,w,j,W,T,N,_,x,H,X,ee=R.isProblemset,J=R.data,ce=R.user,me=R.activeTabsKey,ue=R.onPublicReview,pe=ue===void 0?function(){}:ue,xe=R.onStartExperience,se=xe===void 0?function(){}:xe,ae=R.onSetPrivate,Ce=ae===void 0?function(){}:ae,ze=R.onCorrection,Ye=ze===void 0?function(){}:ze,He=R.onCollect,Ve=He===void 0?function(){}:He,Fe=R.onSetPublic,Ke=Fe===void 0?function(){}:Fe,nt=R.onDelete,he=nt===void 0?function(){}:nt,Re=R.onCancel,Ne=Re===void 0?function(){}:Re,Ue=R.onSelect,rt=Ue===void 0?function(){}:Ue,st=R.onMoveTo,dt=st===void 0?function(){}:st,at=R.onSetShare,bt=at===void 0?function(){}:at,gt=R.onCancelShare,xt=gt===void 0?function(){}:gt,Je=R.onPublish,kt=Je===void 0?function(){}:Je,Ot=R.onCancelPublish,tt=Ot===void 0?function(){}:Ot,ft=J.item_type==="PROGRAM"?"/problems/".concat((O=J.program_attr)===null||O===void 0?void 0:O.identifier,"/edit"):"/problemset/edit/".concat(J.id),be=me==="0"&&!J.public&&!J.apply&&(J.item_type==="PROGRAM"&&((m=J.program_attr)===null||m===void 0?void 0:m.status)!==0||J.item_type!=="PROGRAM"),Ee=f.a.createElement(z.a,{forceSubMenuRender:!0,className:a.a.menu},me==="0"&&!J.public&&f.a.createElement(z.a.Item,{key:"-1"},f.a.createElement("a",{className:a.a.actionLink,target:"_blank",href:ft},"\u7F16\u8F91")),(me==="0"||me==="3")&&J.item_type==="PROGRAM"&&((v=J.program_attr)===null||v===void 0?void 0:v.status)!==0&&!J.public&&((h=J.author)===null||h===void 0?void 0:h.login)===((d=ce.userInfo)===null||d===void 0?void 0:d.login)&&f.a.createElement(z.a.Item,{key:"0"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){var we;return tt(J==null||((we=J.program_attr)===null||we===void 0)?void 0:we.identifier)}},"\u64A4\u9500\u53D1\u5E03")),me==="0"&&f.a.createElement(z.a.Item,{key:"1"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return dt(J.id)}},"\u79FB\u52A8\u5230")),me==="0"&&!(J!=null&&J.is_share)&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return bt(J.id)}},"\u5171\u4EAB")),(me==="0"&&(J==null?void 0:J.is_share)||me==="3"&&((C=J.author)===null||C===void 0?void 0:C.login)===((E=ce.userInfo)===null||E===void 0?void 0:E.login))&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return xt(J.id)}},"\u64A4\u9500\u5171\u4EAB")),be&&f.a.createElement(z.a.Item,{key:"4"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ke(J.id)}},"\u516C\u5F00")),me==="0"&&!J.public&&J.apply&&(J.item_type==="PROGRAM"&&J.program_attr.status!==0||J.item_type!=="PROGRAM")&&f.a.createElement(z.a.Item,{key:"5"},f.a.createElement("a",{className:a.a.reviewFlag,onClick:pe},"\u5BA1\u6838\u4E2D")),(me==="0"||me==="1")&&J.public&&((w=J.author)===null||w===void 0?void 0:w.login)===((j=ce.userInfo)===null||j===void 0?void 0:j.login)&&f.a.createElement(z.a.Item,{key:"6"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ce(J.id)}},"\u64A4\u9500\u516C\u5F00")),me==="2"&&f.a.createElement(z.a.Item,{key:"7"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ve(J.id,J.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(me==="0"||me==="3")&&J.item_type==="PROGRAM"&&((W=J.program_attr)===null||W===void 0?void 0:W.status)===0&&!J.public&&((T=J.author)===null||T===void 0?void 0:T.login)===((N=ce.userInfo)===null||N===void 0?void 0:N.login)&&f.a.createElement(z.a.Item,{key:"8"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){var we;return kt(J==null||((we=J.program_attr)===null||we===void 0)?void 0:we.identifier)}},"\u53D1\u5E03")),(me==="1"||me==="3")&&!Object(p.o)()&&!Object(p.m)()&&((_=J.author)===null||_===void 0?void 0:_.login)!==((x=ce.userInfo)===null||x===void 0?void 0:x.login)&&f.a.createElement(z.a.Item,{key:"9"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ve(J.id,J.is_collected)}},J.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),me!=="0"&&!Object(p.o)()&&!Object(p.m)()&&f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ye(J.id)}},"\u7EA0\u9519")),(me==="0"&&!J.public||me==="1"&&Object(p.o)()&&((H=J.author)===null||H===void 0?void 0:H.login)!==((X=ce.userInfo)===null||X===void 0?void 0:X.login))&&f.a.createElement(z.a.Item,{key:"11"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return he(J.id)}},"\u5220\u9664"))),ge=f.a.createElement(z.a,{forceSubMenuRender:!0,className:a.a.menu},f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:a.a.actionLink,onClick:function(){return Ye(J.id)}},"\u7EA0\u9519"))),de=me!=="0"&&!Object(p.o)()&&!Object(p.m)();return f.a.createElement(f.a.Fragment,null,ee?f.a.createElement(f.a.Fragment,null,J.item_type!=="SUBJECTIVE"&&J.item_type!=="COMBINATION"&&f.a.createElement("span",{className:a.a.textBtn,style:{cursor:"pointer"},onClick:function(){return se(J)}},"\u4F53\u9A8C"),f.a.createElement(Y.a,{overlay:Ee},f.a.createElement("span",{style:{cursor:"default"},onClick:function(we){return we.preventDefault()}},f.a.createElement("span",{className:a.a.textBtn},"\u66F4\u591A")))):de?f.a.createElement(Y.a,{className:"ml40",overlay:ge},f.a.createElement("span",{style:{cursor:"default"},onClick:function(we){return we.preventDefault()}},f.a.createElement("span",null,"\u66F4\u591A"))):f.a.createElement("span",null))};ve.b=D},ELLl:function(ut,ve,U){(function(ne){ne(U("VrN/"))})(function(ne){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=ne.Pos;ne.defineOption("autoCloseBrackets",!1,function(a,p,l){l&&l!=ne.Init&&(a.removeKeyMap(P),a.state.closeBrackets=null),p&&(F(z(p,"pairs")),a.state.closeBrackets=p,a.addKeyMap(P))});function z(a,p){return p=="pairs"&&typeof a=="string"?a:typeof a=="object"&&a[p]!=null?a[p]:Y[p]}var P={Backspace:n,Enter:I};function F(a){for(var p=0;p<a.length;p++){var l=a.charAt(p),u="'"+l+"'";P[u]||(P[u]=G(l))}}F(Y.pairs+"`");function G(a){return function(p){return f(p,a)}}function K(a){var p=a.state.closeBrackets;if(!p||p.override)return p;var l=a.getModeAt(a.getCursor());return l.closeBrackets||p}function n(a){var p=K(a);if(!p||a.getOption("disableInput"))return ne.Pass;for(var l=z(p,"pairs"),u=a.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return ne.Pass;var i=y(a,u[s].head);if(!i||l.indexOf(i)%2!=0)return ne.Pass}for(var s=u.length-1;s>=0;s--){var D=u[s].head;a.replaceRange("",M(D.line,D.ch-1),M(D.line,D.ch+1),"+delete")}}function I(a){var p=K(a),l=p&&z(p,"explode");if(!l||a.getOption("disableInput"))return ne.Pass;for(var u=a.listSelections(),s=0;s<u.length;s++){if(!u[s].empty())return ne.Pass;var i=y(a,u[s].head);if(!i||l.indexOf(i)%2!=0)return ne.Pass}a.operation(function(){var D=a.lineSeparator()||`
`;a.replaceSelection(D+D,null),a.execCommand("goCharLeft"),u=a.listSelections();for(var A=0;A<u.length;A++){var S=u[A].head.line;a.indentLine(S,null,!0),a.indentLine(S+1,null,!0)}})}function b(a){var p=ne.cmpPos(a.anchor,a.head)>0;return{anchor:new M(a.anchor.line,a.anchor.ch+(p?-1:1)),head:new M(a.head.line,a.head.ch+(p?1:-1))}}function f(a,p){var l=K(a);if(!l||a.getOption("disableInput"))return ne.Pass;var u=z(l,"pairs"),s=u.indexOf(p);if(s==-1)return ne.Pass;for(var i=z(l,"closeBefore"),D=z(l,"triples"),A=u.charAt(s+1)==p,S=a.listSelections(),R=s%2==0,O,m=0;m<S.length;m++){var v=S[m],h=v.head,d,C=a.getRange(h,M(h.line,h.ch+1));if(R&&!v.empty())d="surround";else if((A||!R)&&C==p)A&&c(a,h)?d="both":D.indexOf(p)>=0&&a.getRange(h,M(h.line,h.ch+3))==p+p+p?d="skipThree":d="skip";else if(A&&h.ch>1&&D.indexOf(p)>=0&&a.getRange(M(h.line,h.ch-2),h)==p+p){if(h.ch>2&&/\bstring/.test(a.getTokenTypeAt(M(h.line,h.ch-2))))return ne.Pass;d="addFour"}else if(A){var E=h.ch==0?" ":a.getRange(M(h.line,h.ch-1),h);if(!ne.isWordChar(C)&&E!=p&&!ne.isWordChar(E))d="both";else return ne.Pass}else if(R&&(C.length===0||/\s/.test(C)||i.indexOf(C)>-1))d="both";else return ne.Pass;if(!O)O=d;else if(O!=d)return ne.Pass}var w=s%2?u.charAt(s-1):p,j=s%2?p:u.charAt(s+1);a.operation(function(){if(O=="skip")a.execCommand("goCharRight");else if(O=="skipThree")for(var W=0;W<3;W++)a.execCommand("goCharRight");else if(O=="surround"){for(var T=a.getSelections(),W=0;W<T.length;W++)T[W]=w+T[W]+j;a.replaceSelections(T,"around"),T=a.listSelections().slice();for(var W=0;W<T.length;W++)T[W]=b(T[W]);a.setSelections(T)}else O=="both"?(a.replaceSelection(w+j,null),a.triggerElectric(w+j),a.execCommand("goCharLeft")):O=="addFour"&&(a.replaceSelection(w+w+w+w,"before"),a.execCommand("goCharRight"))})}function y(a,p){var l=a.getRange(M(p.line,p.ch-1),M(p.line,p.ch+1));return l.length==2?l:null}function c(a,p){var l=a.getTokenAt(M(p.line,p.ch+1));return/\bstring/.test(l.type)&&l.start==p.ch&&(p.ch==0||!/\bstring/.test(a.getTokenTypeAt(p)))}})},FOrL:function(ut,ve,U){ut.exports=U.p+"static/nodata.a6b3f948.png"},FWmy:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return ne});function ne(Y,M){if(!Y)throw new Error(M?`Assertion failed (${M})`:"Assertion Failed")}},HmJG:function(ut,ve,U){},IPdS:function(ut,ve,U){ut.exports={drawerWrap:"drawerWrap___nRvfD",title:"title___e_1lX",problemset:"problemset___1u9oP",content:"content___1WwQ5",delete:"delete___3Q7nc",deleteIcon:"deleteIcon___ObOyh",previewWrap:"previewWrap___25lTY",preview:"preview___3uiyE"}},Is5a:function(ut,ve){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACMgAAAA6CAYAAABPwffJAAAAAXNSR0IArs4c6QAAH35JREFUeF7t3Q2MZWV9x/H/c849d17uzL6y7K4M76xLNIAKoiBQak0oRgsiYKyxUEq0LwZLYmqa0hqtpi8xodam1daKRFtbRITYBmlspRBBAXmRaHddsCyO7Bsssztzd2buveec5jl37jC7bN155l7OL7P3ewmZfTnn+Z37+f9nsjn3n+c4W8JrfHx8bGam9ZfNZutif3q1Wrl3YKDyB2NjY+NLWC74FHV+8AVzQlcC6nqr87vC4+RgAXW91fnBYJyAAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACpr6/r86nBcoVUNdbnV+uNmnqevcy34WW84knto0513giz22NWef03P9qb27Vs846a9MrOiSjzg/14vjuBNT1Vud3p8fZoQLqeqvzQ704HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBMzU9/fV+fRAuQLqeqvzy9UmTV3vXucHD8g88shj/2zm3ttoNOa7wZmzJEnMnPvqOeec9euvZJuo81/J98baLxdQ11udT0+UK6Cutzq/XG3SEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBA4OgTU9/fV+UdHFZfPu1DXW52/fCp1dFyput69zg8ekLnvvu8+l+e28XDldM52XHTRW171SpZanf9KvjfWfrmAut7qfHqiXAF1vdX55WqThgACCCCAAAIIIIAAAggggAACCCCAAAIIIIDA0SGgvr+vzj86qrh83oW63ur85VOpo+NK1fXudX7wgMy3v31vnue5NZtNc84sz9sPWkqq1aLCb3vbxcFrhrSGOj/kWjm2ewF1vdX53QuyQoiAut7q/BArjkUAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIG2gPr+vjqfPihXQF1vdX652qSp693r/OBhlrvu+ve8PRiTmx+N6QzJtFsjt8sue0fwmiFtpc4PuVaO7V5AXW91fveCrBAioK63Oj/EimMRQAABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgLaC+v6/Opw/KFVDXW51frjZp6nr3Oj94mOX22+/0kzHWbDaK3WP8yw/JJElSDMxceeXlwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWW2/9Smcsptgx5qVdZNq/vuaa9wWvGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWb7whVvyZrN5UCf4xy055yxJqnb99dcGrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1k+85m/yZ05y4vdY/zjldpLFEMy5uyGD/9e8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjl05+++ZAdZNqPVvKvJEnsIx+5MXjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8olPfCrvPFKp/dXvHtNuDL/Yn3zspuA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy003fSxvNhsLOuGlJfwOMp/85MeD1wxpK3V+yLVybPcC6nqr87sXZIUQAXW91fkhVhyLAAIIIIAAAggggAACCCCAAAIIIIAAAggggAACbQH1/X11Pn1QroC63ur8crVJU9e71/nBwyw33viR3O8a03nN7x4zt5PMzTd/OnjNkLZS54dcK8d2L6Cutzq/e0FWCBFQ11udH2LFsQgggAACCCCAAAIIIIAAAggggAACCCCAAAIIINAWUN/fV+fTB+UKqOutzi9XmzR1vXudHzzM8qEP3ZC3mi3Lbe65SvM94axaTeyzn/1M8JohbaXOD7lWju1eQF1vdX73gqwQIqCutzo/xIpjEUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAoC2gvr+vzqcPyhVQ11udX642aep69zo/eJjluuuuf2kyxv/KrzD3Nc9zu+WWfwxeM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7z//dfkzUbjoP1j/COX/KOWqtWqffnLtwavGdJW6vyQa+XY7gXU9Vbndy/ICiEC6nqr80OsOBYBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQTaAur7++p8+qBcAXW91fnlapOmrnev84OHWa644sp8fsuY+X7obCrj7I47bg9eM6St1Pkh18qx3Quo663O716QFUIE1PVW54dYcSwCCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgi0BdT399X59EG5Aup6q/PL1SZNXe9e5wcPs7zjHb+Wt1rNYseY9is359z8DjLf/OZdwWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWSy65NG82m0UnNJuN4muSJMVX/4ilb33r7uA1Q9pKnR9yrRzbvYC63ur87gVZIURAXW91fogVxyKAAAIIIIAAAggggAACCCCAAAIIIIAAAggggEBbQH1/X51PH5QroK63Or9cbdLU9e51fvAwy4UXXpT73WP8kIxzZv43fgeZJKkWu8ncf/99wWuGtJU6P+RaObZ7AXW91fndC7JCiIC63ur8ECuORQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgbaA+v6+Op8+KFdAXW91frnapKnr3ev84GGWN73pzXmr1SoGYzo7yfgdZPyQTKVSse9//3vBa4a0lTo/5Fo5tnsBdb3V+d0LskKIgLre6vwQK45FAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBtoD6/r46nz4oV0Bdb3V+udqkqevd6/zgYZazzz4nbzQaxXBMsXuM74liB5mk2EXm0UcfCV4zpK3U+SHXyrHdC6jrrc7vXpAVQgTU9Vbnh1hxLAIIIIAAAggggAACCCCAAAIIIIAAAggggAACCLQF1Pf31fn0QbkC6nqr88vVJk1d717nBw+zbN58et7ZOabZbPjpGKtWE/OPXapWq7Zly/8ErxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/ODh1lOOeXUYkCmMyRjls8Px/gBmaeffip4zZC2UueHXCvHdi+grrc6v3tBVggRUNdbnR9ixbEIIIAAAggggAACCCCAAAIIIIAAAggggAACCCDQFlDf31fn0wflCqjrrc4vV5s0db17nR88zOIv4MCBujUafkimYa7zeKVKYsO1mv30p08HrxnSVur8kGvl2O4F1PVW53cvyAohAup6q/NDrDgWAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEE2gLq+/vqfPqgXAF1vdX55WqTpq53r/MXNcyS57m75557Vq9atfbCq656951+95h6fWp+F5kkqVqtVrMkSexrX/v65RMTL9x/ySWXvOicy3vRMur8XrwH1li8gLre6vzFS3FkLwTU9Vbn98KQNRBAAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6DcB9f19dX6/1Vv9ftX1Vuer/fstX13vVzL//x2Q8aG+0HfffXd1zbp1v3rssSe8rzay4opzXrc5rtfr1mo1bWpqqthBZnh42DpDMo88vjWtT+2/Y/fuZ/9p754937r00ksbfp3QYRl1fr81ufr9quutzlf791u+ut7q/H6rN+8XAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIFeCKjv76vze2HIGosXUNdbnb94KY7shYC63mXlH3ZAphN+7733Dqw5ZsONGzae9Ie55aMe9o2vP714tJIfkvE7yZi5YueYzg4yDz+2pfB35iZ37njmz/ZPPP+5Cy64YKL4s0XuKKPO70UDscbiBdT1VucvXoojeyGgrrc6vxeGrIEAAggggAACCCCAAAIIIIAAAggggAACCCCAQL8JqO/vq/P7rd7q96uutzpf7d9v+ep6l5n/sgGZuXD34IMPrhpZsfrP12886beyLI98Ezhndv65ZxSDMX5Ixn/NcysGZKrVavH1gYeeLP7Mv6LIZbuf2/7Fycm9N5x33nmzZpYfaUhGnd9vza5+v+p6q/PV/v2Wr663Or/f6s37RQABBBBAAAEEEEAAAQQQQAABBBBAAAEEEECgFwLq+/vq/F4YssbiBdT1VucvXoojeyGgrnfZ+QcNyCwIHxhdufbGdRtO+NPcD8f4o+amXi6+4Ozi8UqNRntAxr/845Wq1aT4+p37H2nXwU/T5GYuctmenc/+8eS+F24+0pCMOr8XDcQaixdQ11udv3gpjuyFgLre6vxeGLIGAggggAACCCCAAAIIIIAAAggggAACCCCAAAL9JqC+v6/O77d6q9+vut7qfLV/v+Wr663Inx+Q6YT70ZaHH330shNPfM2X8jwfzf2Ui5k1m6nd9i+32q23/MNBu8c45yzP8/kBmWuv+4Bd9Z7fsCSJi/Oc/8+5ye3bf3ztG9/whrv8qM3hdpJR5/dbs6vfr7re6ny1f7/lq+utzu+3evN+EUAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBDohYD6/r46vxeGrLF4AXW91fmLl+LIXgio663KP3RAJnrggQfWbjjutL+t1Ubf7Ydj/MYxrVbLPv93N9vT27batm3bit1j/JxLs9kqvvqdY/zLP2Zp06ZNduqmzfbB37nRKpVKsZGMH5Kp1ye/vvPnT/3u+eef/4KZZYc+amkOQJbfiyZijcULqOutzl+8FEf2QkBdb3V+LwxZAwEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBfhNQ399X5/dbvdXvV11vdb7av9/y1fVW5RcDMgumc6IfPP7ku44/YdNXsyyL/XCMP+CuO2+zhx96wOIoth/+8Ilixxj/eCW/e8zc+ZYkSfH7M888y9IstTeee75ddvnVxXYx/rAoitKfPbvtvWe/7oxv+AGZhbvIqPP7rdnV71ddb3W+2r/f8tX1Vuf3W715vwgggAACCCCAAAIIIIAAAggggAACCCCAAAII9EJAfX9fnd8LQ9ZYvIC63ur8xUtxZC8E1PVW5i8ckInMLN761M/+YuWqtb/fGY7ZvXunfeHzf21xHFujMWNbtmwthmOKV95+XtLcnIxVk6q9evMmGxgYsjRN7foP3mDHHrth/ph9Ey/81ebTjv+omaULd5HpTAep8nvRRKyxeAF1vdX5i5fiyF4IqOutzu+FIWsggAACCCCAAAIIIIAAAggggAACCCCAAAIIINBvAur7++r8fqu3+v2q663OV/v3W7663sp8t2A6J37ooR+OverEE2+pxMkv5Zkffsnt3v+6x3705GOWZZkdODBlW7duKwZiGg0/JFOMx8w/Zsn/+aZNp1mtNup3jLHXnvF6u/itlxSPWHKRWStt/vdz27f/5rnnnjk+NyTjF/Avv4gk/9BHPfVb85f9fuk31+n5sun7Mo9+o9/6svF50wgggAACCCCAAAIIIIAAAggggAACCCCAAAJdCfD5Ap8vdNVAgSfTb/RbYMt0dXjf99vC6Zz77ntw8+mvOesbae5OzX0fZpnd/q9ftqmpSZua2metZtOeeeZZm56ents1xhWPW2rvIONscHDQTjrpBKskiY2MrLSRkVG78j3v989XMpc7i13+9JYfP/Guiy46b2tnF5m56hW71yjyGZDp6vsn+GT6jR/wwU3TxQn0G/3WRftwKgIIIIAAAggggAACCCCAAAIIIIAAAggggECfCvD5Ap8vlNn69Bv9Rr+VN5/S2UEmesYs2fPw4284/uTN/2FZXsssszxzdvttXzLnnL3w/K5iGGbHjp02NVW3RmN2buMXX67cqtWqjYyM2MaNG4rdY9asPbb483dfda25KLfIIrPI1Z956keXbHjzOT84ycxvQZN1BmRU+QzIlPntZr6H/DgV/VYue9+m0W/8g6Jvm583jgACCCCAAAIIIIAAAggggAACCCCAAAIIILBkAT5f4POFJTfPEk6k3+i3JbTNkk/p+36bA4jHxy3Z/txD55x2ypl3Z3lWy/PMbyBjd//bbRZFse3e9VzxmKVWq1XsIpOmaTEw419+gMYPxZx88olWqVSK36/fcFxxzNvfebXfQMaciyxyUX3rTx59+yknnP/w2FgxIJPOVU6Wz4DMkr93lnQi/cYP+CU1zhJPot/otyW2DqchgAACCCCAAAIIIIAAAggggAACCCCAAAII9LEAny/w+UKZ7U+/0W/0W3nzKZ0dZCo7dlgyPv74a4874dW35VF+kmX+8Umpfe+737FGs1HsINOYnSlq44dkdu7cbfV6vRiGGR4etg0bjrU4jou/HxgcsrXHrLdqUrU3v+WXzbnYLMrNZe6Znz/7k6vHxl73o40biwGZ1lyxZfkMyJT57Ta/g4ys3vRbufVWp839g4J+UxeCfAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEElpEAny8wsFBmu9Jv9Bv9Vt58ih+Qicws3rXLqnv2bD111THHfi6Kquf53WP8DjH/+/SWYjhmdna6+LqY19q16606MGjHrNtgJ596+twOM2ZZ1nhw4vndv71u3ean16+3xsIdZFT5zrnOY54W89Y4pksB+o1+67KFgk6n3+i3oIbhYAQQQAABBBBAAAEEEEAAAQQQQAABBBBAAAEErPiMlM9P6YTSBOg3Ps8qrdn4+ZYeNCATxwdW7Hlx7ydXrlx1XZ47y7LcpqcP2LatT1ilUrXndz9n09P1X1ifoaGarVt/nDWbs7Zp81k2NDRsUeTMudz27Zv44rrVa25K0+H9hxuQUeQzIFPmt9vB/6BQ1Hvu3RYDYYp8+o1+K/PnK/1Wbr+RhgACCCCAAAIIIIAAAggggAACCCCAAAIIIHB0CCwcWFB8nsTnWUdHHy32XdBvDMgstld6cVzf99uhAOPj41esHxv7TJbmsR+Q8bvI7Nr5M5ua3GfORfbC8zts+sDUYe2Hhkds7TEb/dyR1UZW2PoNx8/tHuMsil26a3z8w2NjY3f8ogGZsvP5ALkX30aLX4N+4wf84rul+yPpN/qt+y5iBQQQQAABBBBAAAEEEEAAAQQQQAABBBBAAIF+E+DzBT5fKLPn6Tf6jX4rbz7loB1koqg+umfixROHhoY+lVQGf8UPx3T+f37XuDVbTYvjxOr1/Ta5f681ZmeKWvnHKY2uWGO12grLspbFccXWrR8rhmM6/zdbM/85PT39R+tWrd6eZbXJw+0go8hnQKbMb7eDd5BR1Hvu3RY7yCjy6Tf6rcyfr/Rbuf1GGgIIIIAAAggggAACCCCAAAIIIIAAAggggMDRIbBwYEHxeRKfZx0dfbTYd0G/MSCz2F7pxXF932+5f5aSWWXHDkucm6q14mTV3r3PXX7MqvUfz/J0KM/NMj8ok5pNTu61VnPGXBSbs8hc5E8tNoyxLE8tz1JLqoM2MrLGXGwWFQMy/ms8/fzEro+tWfOqOytpcyLPR+obN1rTzFpzRZTlO//sJ16lCdBv9FtpzdZ+hh4/38oEJwsBBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgaNAgM8X+DyrzDam3+g3+q28+RS/g4z/ADkeH7fErZwcbh1IVuStxvqZ6ckPrBhddU2aZ1GemWV+CiY1a6Uta7WmLW2llvupGTNzLra4ElulMmSVuGLmh2PMmYvMYhdl+ycnbh0cGv17V6nuqgw39+f7Rg+MjRUDMu0FhPkMyJT57TY/sEC/lcvet2n8fOMfFH3b/LxxBBBAAAEEEEAAAQQQQAABBBBAAAEEEEAAgSUL8PkCny8suXmWcCL9Rr8toW2WfErf99scQPSMWbJqwgbr2fRIVk9X5XG64cDU1EdXrFz11jTLoixr7xRTPHLJ/6LYnaHt7neJKb76//xv/K4xfjgmirJ9ExPfGRiMb06ike1RLZ6oRUNTE6ts5iQrBmT8qv4ly2dAZsnfO0s6kX7jB/ySGmeJJ9Fv9NsSW4fTEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBPpYgM8X+HyhzPan3+g3+q28+ZTODjKR38Vlzx6r5nm95lxtdDI9sDprzJyYNqavHhlZ/c4sSwczPyDj+7MzLDPXq85vQuOHZCIz/2v/5KUoimempl78Zjww8JUoGd4xGg+/mOf1Sedq9XXrrDG3e8z8gIwqnwGZMr/d5neQod/KZe/btM4/KFQ/X+bgZf3Oz7e+bX3eOAIIIIAAAggggAACCCCAAAIIIIAAAggggEAXAny+wMBCF+0TfCr9Rr8FN00XJ/R9v80BFI9Z2rHDkrRmg1FrutaaSkctydfMTmfr09bkxQNDtQuTJDkjy/Ko2EEmd/M7yfidY8zlxQ4yUeSyZrP55Ox0/f64MnrvwFC0y5pub2UknswqQ/W4bjMbN84/XmluD5pivEaSzwfIXXz3LOFU+o0f8EtomyWfQr/Rb0tuHk5EAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQ6FsBPl/g84Uym59+o9/ot/LmU4qHIx06JZSmU0OzrjJSaaUrGlm+Mk3z1ZY1jsvy1utdxZ1eTQbGnEUrnYtq7fOzem7ZvkZzdjxv5VsiV3nMourP49i9WI3cvlYl3j+Qt6bieGR64e4xneEUdX6ZDUcW/UYPlCug/vmizi9XmzQEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBI4OAfX9fXX+0VHF5fMu1PVW5y+fSh0dV6qutzJ/4YBM8ZCkcbOk9qJVm8364OxsZSSKWiNplI3mLh7Nm80VeWYjqbXWZ62sluX5kG+ByLnpqBLVY6vscpFNuSTZ7/J0Ms6iySyrTA0MtKaSpDZTX22NMSt2jyke0nTIgIws/+ho4+XzLhZMQdJvy6dsy/ZK6bdlWzouHAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABmQCfL8jo+zKYfuvLssvedD/3WzEg418LpnQi/6ilwUFL/JDMdB4Pu9nWUKsa1aJWo+Yq1SFrpYNZ5hLnsrh9bpRGUd60SjyTtxrTWaVarzSyej5QmR5y6QE/HDMzY825Ryv54Zjs0EcbqfNl3denwep6q/P7tOyyt62utzpfBk8wAggggAACCCCAAAIIIIAAAggggAACCCCAAALLWEB9f1+dv4xLtywvXV1vdf6yLNoyvmh1vVX5hw7I+N/7/+MdO6zih2RmZ6eqWTUeTNKhgZmZqcHKUDRQn02r1SiJs3SmGJCJ4sG0kTXT2kDcaE1ns4ODIzPNeHo2aqQzAwMjjbnhmJaZpX6eZuHuMZ2eWTClJMlfxr27LC9dXW91/rIs2jK+aHW91fnLuHRcOgIIIIAAAggggAACCCCAAAIIIIAAAggggAACMgH1/X11vgy+T4PV9Vbn92nZZW9bXW9V/vyAjJc/5CL8428qA3ssnh2wanWmnjQrUdJqumQ4GozrrcmKa7j2I5qqeV6rjLYOZDNpJcmbSStrNgZrzYFZa8yus3TMzA/HFI9VOtxwTKfq6nxZ9/VpsLre6vw+Lbvsbavrrc6XwROMAAIIIIAAAggggAACCCCAAAIIIIAAAggggMAyFlDf31fnL+PSLctLV9dbnb8si7aML1pdb0X+QQMyvnaHXIT/e//IpUqlYlGSWKUeT8Zx3UVx7IrdYzqvNM3TtJZntXQ0bTat1WpZtnHjwYMxv2g4prOOOn8Z9++yvHR1vdX5y7Joy/ii1fVW5y/j0nHpCCCAAAIIIIAAAggggAACCCCAAAIIIIAAAgjIBNT399X5Mvg+DVbXW53fp2WXvW11vcvOf9mAjJefuwj/y84jl6LOr8fHLYpjc1FU/N38K8ssT1PLx8Ze2ilm4a4xxWLO+R1kjvhS5x/xAjmgpwLqeqvze4rJYkcUUNdbnX9EIA5AAAEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQACBlwmo7++r82mJcgXU9Vbnl6tNmrreZeYfdkDGt8CCi/C/7QzKHPrrQ7uleITS3B8u/PWih2M6C6rz+TYoV0Bdb3V+udqkqeutzqcDEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBBBAIFxAfX9fnR8uxhndCKjrrc7vxo5zwwXU9S4r//8dkFlIdsjFdP7q0HNftjvMYneMOVJ51PlHuj7+vrcC6nqr83uryWpHElDXW51/JB/+HgEEEEAAAQQQQAABBBBAAAEEEEAAAQQQQAABBF4uoL6/r86nJ8oVUNdbnV+uNmnqer+S+f8HabRiLm3R4IUAAAAASUVORK5CYII="},"Ix/O":function(ut,ve){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAhNJREFUWEftlztLA0EQx/97Z2LAF1ooKhZaCClsVARFLAQbbQTBVFY2NjZiI4KFINjo51DBD2BhI4IQfKAIikJAg48oKD4Kk3usbDabXHSTu1yCucJp5pL5z+zvZm4XllBKVZTZSBriaLIV9HMdBIOoJE22XHEaA8U+zMc19B2HbfV5BByCAeAzDMPB4rJiCt0uBoZDHI5uIv4xUczbFJQbqOFdJNVz6Nm64xB7wVtQf0tBhUohJol7VHX1c4jddr0UNV3VIMoGh9hpKB+EakazIer7gc5FwN/o6qUcJyWegKsV4PUgmZINEVwGfHXyWoQAlALMy0zEmHdi2htwsWSBeFnNjIPVYOuIWuJZrG0XtwOQ5PNOPC+U75tIjyM27wGIu1kdFZXyRupxJGPMMxPPQp8vbo3l0fNxMAhmpgYovt8+15yF3u47EPEceg4RnfHAOG6mPQARmSoeQvUDRsLpYLJ0fBylgBAAAoZ5mTGdFVj1p07M65CzThhxQM2xi6QLOtPzTlyOO4Nw1Wz7pN8QugZU+ACZT54Tlhj7bdXJ4j81LN9qupYax/lY6pxIAIpklmaO/+1fUq4Q9VKed+JsxAPjOB32AMTJkAcgjgY8ABHu/YfI3DtU4+/vHWwDG+o9hwh39+HrYR8Uitut7yqPwESgeTBzIWYg75FNEK3NVcFCk6gvitqOELtMZyAKLVJC/TfVWC6c92hknAAAAABJRU5ErkJggg=="},JUtD:function(ut,ve,U){"use strict";U.r(ve);var ne=U("14J3"),Y=U("BMrR"),M=U("DjyN"),z=U("NUBc"),P=U("qVdP"),F=U("jsC+"),G=U("T2oS"),K=U("W9HT"),n=U("+L6B"),I=U("2/Rp"),b=U("sPJy"),f=U("bE4q"),y=U("5Dmo"),c=U("3S7+"),a=U("lUTK"),p=U("BvKs"),l=U("sRBo"),u=U("kaz8"),s=U("miYZ"),i=U("tsqr"),D=U("7Kak"),A=U("9yH6"),S=U("2qtc"),R=U("kLXV"),O=U("oBTY"),m=U("k1fw"),v=U("9og8"),h=U("tJVT"),d=U("PpiC"),C=U("5NDa"),E=U("5rEg"),w=U("Znn+"),j=U("ZTPi"),W=U("WmNS"),T=U.n(W),N=U("q1tI"),_=U.n(N),x=U("9kvl"),H=U("55Ip"),X=U("iris"),ee=U("jcZT"),J=U("BdwD"),ce=U("iNYN"),me=U.n(ce),ue=function(mt){var Pt=mt.problemset,Rt=mt.globalSetting,Gt=mt.loading,cn=mt.dispatch,Tn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch"]);return _.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Pt.actionTabs.key==="Problemset-PublicReview",title:"\u63D0\u793A",okText:"\u77E5\u9053\u5566",cancelText:"",width:"442px",onOk:function(){cn({type:"problemset/setActionTabs",payload:{}})},onCancel:function(){cn({type:"problemset/setActionTabs",payload:{}})}},_.a.createElement("div",{className:me.a.modalContent},"\u516C\u5F00\u7533\u8BF7\u5DF2\u63D0\u4EA4\uFF0C\u8BF7\u7B49\u5F85\u7BA1\u7406\u5458\u7684\u5BA1\u6838"),_.a.createElement("div",{className:me.a.modalContent},"\u6211\u4EEC\u5C06\u57281-2\u4E2A\u5DE5\u4F5C\u65E5\u5185\u5B8C\u6210\u5BA1\u6838"))},pe=Object(x.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(ue),xe=U("xlxt"),se=U.n(xe),ae=U("P/tu"),Ce=U("wd/R"),ze=U.n(Ce),Ye=function(mt){var Pt=mt.problemset,Rt=mt.dispatch,Gt=Object(N.useState)([]),cn=Object(h.a)(Gt,2),Tn=cn[0],Sn=cn[1],mn=function(){Rt({type:"problemset/setActionTabs",payload:{}})};Object(N.useEffect)(function(){if(Pt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898"){var hn,An;Sn([(hn=Pt.actionTabs)===null||hn===void 0||((An=hn.params)===null||An===void 0)?void 0:An.group_id])}},[Pt.actionTabs.key]);var In=function(){if(Tn.length===0){i.b.warn("\u8BF7\u9009\u62E9\u6587\u4EF6\u5939");return}console.log(Tn[0],22),Kn({},"/api/item_banks/export.xlsx?group_id=".concat(Tn[0]),function(An,dr){var Nn;if(((Nn=An.target.response)===null||Nn===void 0?void 0:Nn.type)==="application/json"){var zt=new FileReader;zt.readAsText(An.target.response,"utf-8"),zt.addEventListener("loadend",function(){var Bt=JSON.parse(zt.result);i.b.warn((Bt==null?void 0:Bt.message)||"\u4E0B\u8F7D\u51FA\u9519, \u8BF7\u8054\u7CFB\u7BA1\u7406\u5458")});return}var On=new Blob([An.target.response],{type:"application/vnd.ms-excel;charset=utf-8"}),sr="item_bank_template_".concat(ze()().format("YYYY-MM-DD HH:mm:ss"),".xlsx");if(window.navigator&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(On,sr);else{var Un=URL.createObjectURL(On),Xt=document.createElement("a");Xt.href=Un,Xt.setAttribute("download",sr),document.body.appendChild(Xt),Xt.click(),window.URL.revokeObjectURL(Xt.href)}mn()})},Kn=function(An,dr,Nn,zt){var On=dr,sr=new window.XMLHttpRequest;return sr.withCredentials=!0,sr.addEventListener("load",function(Un){Nn(Un,sr)},!1),sr.addEventListener("error",function(Un){zt&&zt(Un)},!1),sr.responseType="blob",sr.open("GET",On),sr.send(null),sr};return _.a.createElement(R.a,{centered:!0,title:"\u5BFC\u51FA\u8BD5\u9898",visible:Pt.actionTabs.key==="\u5BFC\u51FA\u8BD5\u9898",width:718,destroyOnClose:!0,wrapClassName:se.a.customModal,onCancel:mn,onOk:In},_.a.createElement("aside",{className:se.a.exportModal},_.a.createElement(ae.a,{value:Tn,onChange:function(An){return Sn(An)}})))},He=Object(x.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(Ye),Ve=U("i8i3"),Fe=U.n(Ve),Ke=U("WCUW"),nt=U("Ty5D"),he=function(mt){var Pt,Rt,Gt=mt.problemset,cn=mt.dispatch,Tn=mt.onOk,Sn=Object(nt.i)(),mn=Object(N.useState)([]),In=Object(h.a)(mn,2),Kn=In[0],hn=In[1],An=Object(N.useState)(1),dr=Object(h.a)(An,2),Nn=dr[0],zt=dr[1],On=Object(N.useState)([]),sr=Object(h.a)(On,2),Un=sr[0],Xt=sr[1],Bt=Object(N.useState)([]),yn=Object(h.a)(Bt,2),Ct=yn[0],Mt=yn[1],Dt=Object(N.useState)(!0),Me=Object(h.a)(Dt,2),Yt=Me[0],wn=Me[1],mr=Object(N.useState)(!1),Rn=Object(h.a)(mr,2),ii=Rn[0],ai=Rn[1],Hr=Object(N.useState)(!1),jn=Object(h.a)(Hr,2),Ft=jn[0],br=jn[1];Object(N.useEffect)(function(){if(Gt.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898"){var Jt,Qt;lr(),Xt([(Jt=Gt.actionTabs)===null||Jt===void 0||((Qt=Jt.params)===null||Qt===void 0)?void 0:Qt.group_id])}},[Gt.actionTabs.key]);var lr=function(){var Jt=Object(v.a)(T.a.mark(function Qt(){var pn,Gn,Mn;return T.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return wn(!0),gr.next=3,Object(Ke.y)({type:0,page:1,per_page:10,order_by:"new"});case 3:pn=gr.sent,pn!=null&&pn.item_banks_group&&(Gn={id:-1,item_banks_count:(pn==null?void 0:pn.no_group_count)||0,name:{name:"\u672A\u52A0\u5165\u5206\u7EC4"}},Mn=[Gn].concat((pn==null?void 0:pn.item_banks_group)||[]),hn(Mn)),wn(!1);case 6:case"end":return gr.stop()}},Qt)}));return function(){return Jt.apply(this,arguments)}}(),Yn=function(){cn({type:"problemset/setActionTabs",payload:{}})},oi=function(){var Jt=Object(v.a)(T.a.mark(function Qt(){var pn;return T.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:if(!(Un.length===0)){Mn.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u7684\u6587\u4EF6\u5939"),Mn.abrupt("return");case 3:if(!(Nn===1)){Mn.next=6;break}return zt(2),Mn.abrupt("return");case 6:return ai(!0),Mn.next=9,Object(Ke.l)({item_banks_group_ids:Un,clazz:"ItemBank",group_ids:Ct});case 9:pn=Mn.sent,(pn==null?void 0:pn.status)===0&&(Tn(),Yn()),ai(!1);case 12:case"end":return Mn.stop()}},Qt)}));return function(){return Jt.apply(this,arguments)}}(),$t=function(Qt){Xt(Qt),br(Qt.length===Kn.length)};return _.a.createElement(R.a,{centered:!0,afterClose:function(){Mt([]),zt(1),br(!1),hn([])},title:"\u5171\u4EAB\u8BD5\u9898".concat(Nn,"/2"),visible:Gt.actionTabs.key==="\u5171\u4EAB\u8BD5\u9898",footer:null,width:718,destroyOnClose:!0,wrapClassName:Fe.a.customModal,onCancel:Yn},_.a.createElement("aside",{className:Fe.a.shareModal},_.a.createElement(K.a,{spinning:Yt},_.a.createElement("div",{className:Fe.a.content},Nn===1&&_.a.createElement("div",{className:Fe.a.group},_.a.createElement(ae.a,{value:Un,onChange:function(Qt){return Xt(Qt)}})),Nn===2&&_.a.createElement("div",{className:Fe.a.teachGroup},_.a.createElement("p",null,"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),_.a.createElement(u.a.Group,{value:Ct,onChange:function(Qt){return Mt(Qt)}},Gt==null||((Pt=Gt.teachGroupData)===null||Pt===void 0||((Rt=Pt.groups)===null||Rt===void 0))?void 0:Rt.map(function(Jt){return _.a.createElement(u.a,{key:Jt.group_id,value:Jt.group_id},Jt==null?void 0:Jt.name)})))),_.a.createElement("div",{className:Fe.a.footer},_.a.createElement(I.a,{onClick:Yn},"\u53D6\u6D88"),_.a.createElement(I.a,{loading:ii,onClick:oi,type:"primary"},Nn===1?"\u4E0B\u4E00\u6B65":"\u786E\u8BA4\u5171\u4EAB")))))},Re=Object(x.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(he),Ne=function(mt){var Pt=mt.problemset,Rt=mt.globalSetting,Gt=mt.loading,cn=mt.dispatch,Tn=mt.onReloadData,Sn=Tn===void 0?function(){}:Tn,mn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch","onReloadData"]),In=Object(N.useRef)(!1),Kn=Object(N.useState)(!1),hn=Object(h.a)(Kn,2),An=hn[0],dr=hn[1];Object(N.useEffect)(function(){Pt.actionTabs.key==="Problemset-SetPrivate"?window.localStorage.getItem("problemset-set-private-hint-flag")==="1"?Nn():dr(!0):dr(!1)},[Pt.actionTabs.key]);var Nn=function(){var zt=Object(v.a)(T.a.mark(function On(){var sr;return T.a.wrap(function(Xt){for(;;)switch(Xt.prev=Xt.next){case 0:return In.current&&window.localStorage.setItem("problemset-set-private-hint-flag","1"),Xt.next=3,cn({type:"problemset/setPrivate",payload:Pt.actionTabs.params});case 3:sr=Xt.sent,cn({type:"problemset/setActionTabs",payload:{}}),In.current=!1,sr.status===0&&Sn();case 7:case"end":return Xt.stop()}},On)}));return function(){return zt.apply(this,arguments)}}();return _.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:An,title:"\u64A4\u9500\u516C\u5F00\u544A\u77E5",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Gt["problemset/setPrivate"],width:"442px",onOk:Nn,onCancel:function(){cn({type:"problemset/setActionTabs",payload:{}}),In.current=!1}},_.a.createElement("div",{className:me.a.modalContentLeft},"\u672C\u9898\u5DF2\u516C\u5F00\uFF0C\u64A4\u9500\u516C\u5F00\u53EF\u80FD\u5BFC\u81F4\u90E8\u5206\u7528\u6237\u5BF9\u672C\u9898\u7684\u4F7F\u7528\u53D7\u635F\u3002"),_.a.createElement("div",{className:me.a.modalContentLeft},"\u786E\u8BA4\u64A4\u9500\u516C\u5F00\u56DE\u5230\u81EA\u6709\u72B6\u6001\u5417\uFF1F"),_.a.createElement("div",null,_.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(On){return In.current=On.target.checked}},"\u4E0D\u518D\u63D0\u793A")))},Ue=Object(x.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(Ne),rt=function(mt){var Pt=mt.problemset,Rt=mt.globalSetting,Gt=mt.loading,cn=mt.dispatch,Tn=mt.onReloadData,Sn=Tn===void 0?function(){}:Tn,mn=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch","onReloadData"]),In=function(){var Kn=Object(v.a)(T.a.mark(function hn(){var An;return T.a.wrap(function(Nn){for(;;)switch(Nn.prev=Nn.next){case 0:return Nn.next=2,cn({type:"problemset/handleDelete",payload:Pt.actionTabs.params});case 2:An=Nn.sent,cn({type:"problemset/setActionTabs",payload:{}}),An.status===0&&Sn();case 5:case"end":return Nn.stop()}},hn)}));return function(){return Kn.apply(this,arguments)}}();return _.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Pt.actionTabs.key==="Problemset-Delete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Gt["problemset/handleDelete"],width:"442px",onOk:In,onCancel:function(){cn({type:"problemset/setActionTabs",payload:{}})}},_.a.createElement("div",{className:me.a.modalContent},"\u786E\u8BA4\u5220\u9664\u540E\uFF0C\u65E0\u6CD5\u64A4\u9500"),_.a.createElement("div",{className:me.a.modalContent},"\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F"))},st=Object(x.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(rt),dt=U("LvDl"),at=U("9Bee"),bt=function(mt){var Pt,Rt=mt.problemset,Gt=mt.dispatch,cn=Object(N.useState)({}),Tn=Object(h.a)(cn,2),Sn=Tn[0],mn=Tn[1],In=Object(N.useState)([]),Kn=Object(h.a)(In,2),hn=Kn[0],An=Kn[1],dr=Object(N.useState)(!1),Nn=Object(h.a)(dr,2),zt=Nn[0],On=Nn[1],sr=["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"];Object(N.useEffect)(function(){var yn;if((Rt==null||((yn=Rt.actionTabs)===null||yn===void 0)?void 0:yn.key)==="SINGLE"){var Ct,Mt=Object(dt.cloneDeep)(Rt==null||((Ct=Rt.actionTabs)===null||Ct===void 0)?void 0:Ct.params);mn(Mt),An(Mt.choices)}},[Rt==null||((Pt=Rt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Un=function(){var yn=Object(v.a)(T.a.mark(function Ct(){var Mt,Dt;return T.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(hn.some(function(wn){return wn==null?void 0:wn.checked})){Yt.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),Yt.abrupt("return");case 3:zt&&(Dt=Object(dt.cloneDeep)(Rt==null||((Mt=Rt.actionTabs)===null||Mt===void 0)?void 0:Mt.params),An(Dt.choices)),On(!zt);case 5:case"end":return Yt.stop()}},Ct)}));return function(){return yn.apply(this,arguments)}}(),Xt=function(Ct,Mt){console.log(Ct.target.checked);var Dt=hn.map(function(Me,Yt){return Object(m.a)(Object(m.a)({},Me),{},{checked:Yt===Mt?Ct.target.checked:!1})});An(Dt)},Bt=function(){mn({}),An([]),On(!1),Gt({type:"problemset/setActionTabs",payload:{}})};return _.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Rt.actionTabs.key==="SINGLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:zt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Un,onCancel:Bt},_.a.createElement("div",null,_.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),_.a.createElement(at.a,{value:Sn==null?void 0:Sn.name}),hn==null?void 0:hn.map(function(yn,Ct){var Mt=yn.is_answer,Dt=yn.checked,Me=yn.choice_text,Yt="";return zt&&Mt&&(Yt=me.a.green),zt&&!Mt&&Dt&&(Yt=me.a.red),_.a.createElement("div",{key:Ct,style:{pointerEvents:zt?"none":"auto"},className:"".concat(me.a.row," ").concat(Yt)},_.a.createElement(A.a,{onChange:function(mr){return Xt(mr,Ct)},checked:Dt}),_.a.createElement("span",null,sr[Ct],".\xA0"),_.a.createElement(at.a,{className:me.a.html,value:Me}),zt&&Mt&&_.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),zt&&!Mt&&Dt&&_.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),zt&&_.a.createElement(N.Fragment,null,_.a.createElement("div",{className:me.a.line}),_.a.createElement("div",{className:"c-grey-333 mb5"},_.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),sr[hn.findIndex(function(yn){return yn.is_answer})]),_.a.createElement("div",{className:"c-grey-333 mb10"},_.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Sn==null?void 0:Sn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},gt=Object(x.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(bt),xt=function(mt){var Pt,Rt=mt.problemset,Gt=mt.dispatch,cn=Object(N.useState)({}),Tn=Object(h.a)(cn,2),Sn=Tn[0],mn=Tn[1],In=Object(N.useState)([]),Kn=Object(h.a)(In,2),hn=Kn[0],An=Kn[1],dr=Object(N.useState)(!1),Nn=Object(h.a)(dr,2),zt=Nn[0],On=Nn[1],sr=["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"];Object(N.useEffect)(function(){var Ct;if((Rt==null||((Ct=Rt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="MULTIPLE"){var Mt,Dt=Object(dt.cloneDeep)(Rt==null||((Mt=Rt.actionTabs)===null||Mt===void 0)?void 0:Mt.params);mn(Dt),An(Dt.choices)}},[Rt==null||((Pt=Rt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Un=function(){var Ct=Object(v.a)(T.a.mark(function Mt(){var Dt,Me;return T.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(hn.some(function(mr){return mr==null?void 0:mr.checked})){wn.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),wn.abrupt("return");case 3:zt&&(Me=Object(dt.cloneDeep)(Rt==null||((Dt=Rt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),An(Me.choices)),On(!zt);case 5:case"end":return wn.stop()}},Mt)}));return function(){return Ct.apply(this,arguments)}}(),Xt=function(Mt,Dt){console.log(Mt.target.checked);var Me=hn.map(function(Yt,wn){return Object(m.a)(Object(m.a)({},Yt),{},{checked:wn===Dt?Mt.target.checked:Yt.checked})});An(Me)},Bt=function(){mn({}),An([]),On(!1),Gt({type:"problemset/setActionTabs",payload:{}})},yn=function(){var Mt="";return hn.forEach(function(Dt,Me){Dt.is_answer&&(Mt=Mt+sr[Me])}),Mt};return _.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Rt.actionTabs.key==="MULTIPLE",title:"\u8BD5\u9898\u4F53\u9A8C",okText:zt?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Un,onCancel:Bt},_.a.createElement("div",null,_.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),_.a.createElement(at.a,{value:Sn==null?void 0:Sn.name}),hn==null?void 0:hn.map(function(Ct,Mt){var Dt=Ct.is_answer,Me=Ct.checked,Yt=Ct.choice_text,wn="";return zt&&Dt&&(wn=me.a.green),zt&&!Dt&&Me&&(wn=me.a.red),_.a.createElement("div",{key:Mt,style:{pointerEvents:zt?"none":"auto"},className:"".concat(me.a.row," ").concat(wn)},_.a.createElement(u.a,{style:{padding:3},onChange:function(Rn){return Xt(Rn,Mt)},checked:Me}),_.a.createElement("span",null,sr[Mt],".\xA0"),_.a.createElement(at.a,{className:me.a.html,value:Yt}),zt&&Dt&&_.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),zt&&!Dt&&Me&&_.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),zt&&_.a.createElement(N.Fragment,null,_.a.createElement("div",{className:me.a.line}),_.a.createElement("div",{className:"c-grey-333 mb5"},_.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),yn()),_.a.createElement("div",{className:"c-grey-333 mb10"},_.a.createElement("b",null,"\u89E3\u6790:\xA0"),(Sn==null?void 0:Sn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Je=Object(x.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(xt),kt=function(mt){var Pt,Rt,Gt=mt.problemset,cn=mt.dispatch,Tn=Object(N.useState)({}),Sn=Object(h.a)(Tn,2),mn=Sn[0],In=Sn[1],Kn=Object(N.useState)([]),hn=Object(h.a)(Kn,2),An=hn[0],dr=hn[1],Nn=Object(N.useState)(!1),zt=Object(h.a)(Nn,2),On=zt[0],sr=zt[1],Un=["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"];Object(N.useEffect)(function(){var Ct;if((Gt==null||((Ct=Gt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="JUDGMENT"){var Mt,Dt=Object(dt.cloneDeep)(Gt==null||((Mt=Gt.actionTabs)===null||Mt===void 0)?void 0:Mt.params);In(Dt),dr(Dt.choices)}},[Gt==null||((Pt=Gt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Xt=function(){var Ct=Object(v.a)(T.a.mark(function Mt(){var Dt,Me;return T.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(An.some(function(mr){return mr==null?void 0:mr.checked})){wn.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),wn.abrupt("return");case 3:On&&(Me=Object(dt.cloneDeep)(Gt==null||((Dt=Gt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),dr(Me.choices)),sr(!On);case 5:case"end":return wn.stop()}},Mt)}));return function(){return Ct.apply(this,arguments)}}(),Bt=function(Mt,Dt){console.log(Mt.target.checked);var Me=An.map(function(Yt,wn){return Object(m.a)(Object(m.a)({},Yt),{},{checked:wn===Dt?Mt.target.checked:!1})});dr(Me)},yn=function(){In({}),dr([]),sr(!1),cn({type:"problemset/setActionTabs",payload:{}})};return _.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Gt.actionTabs.key==="JUDGMENT",title:"\u8BD5\u9898\u4F53\u9A8C",okText:On?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Xt,onCancel:yn},_.a.createElement("div",null,_.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),_.a.createElement(at.a,{value:mn==null?void 0:mn.name}),An==null?void 0:An.map(function(Ct,Mt){var Dt=Ct.is_answer,Me=Ct.checked,Yt=Ct.choice_text,wn="";return On&&Dt&&(wn=me.a.green),On&&!Dt&&Me&&(wn=me.a.red),_.a.createElement("div",{key:Mt,style:{pointerEvents:On?"none":"auto"},className:"".concat(me.a.row," ").concat(wn)},_.a.createElement(A.a,{onChange:function(Rn){return Bt(Rn,Mt)},checked:Me}),_.a.createElement(at.a,{className:me.a.html,value:Yt}),On&&Dt&&_.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),On&&!Dt&&Me&&_.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),On&&_.a.createElement(N.Fragment,null,_.a.createElement("div",{className:me.a.line}),_.a.createElement("div",{className:"c-grey-333 mb5"},_.a.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(Rt=An.find(function(Ct){return Ct.is_answer}))===null||Rt===void 0?void 0:Rt.choice_text),_.a.createElement("div",{className:"c-grey-333 mb10"},_.a.createElement("b",null,"\u89E3\u6790:\xA0"),(mn==null?void 0:mn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},Ot=Object(x.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(kt),tt=function(mt){var Pt,Rt,Gt=mt.problemset,cn=mt.dispatch,Tn=Object(N.useState)({}),Sn=Object(h.a)(Tn,2),mn=Sn[0],In=Sn[1],Kn=Object(N.useState)([]),hn=Object(h.a)(Kn,2),An=hn[0],dr=hn[1],Nn=Object(N.useState)(!1),zt=Object(h.a)(Nn,2),On=zt[0],sr=zt[1],Un=["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"];Object(N.useEffect)(function(){var Ct;if((Gt==null||((Ct=Gt.actionTabs)===null||Ct===void 0)?void 0:Ct.key)==="COMPLETION"){var Mt,Dt,Me=Object(dt.cloneDeep)(Gt==null||((Mt=Gt.actionTabs)===null||Mt===void 0)?void 0:Mt.params);In(Me),dr(Me==null||((Dt=Me.standard_answer)===null||Dt===void 0)?void 0:Dt.map(function(Yt){return{value:"",answer:(Yt==null?void 0:Yt.answer_text)||[]}}))}},[Gt==null||((Pt=Gt.actionTabs)===null||Pt===void 0)?void 0:Pt.key]);var Xt=function(){var Ct=Object(v.a)(T.a.mark(function Mt(){var Dt,Me,Yt;return T.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if(!An.some(function(Rn){return(Rn==null?void 0:Rn.value)===""})){mr.next=3;break}return i.b.warn("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4"),mr.abrupt("return");case 3:On&&(Yt=Object(dt.cloneDeep)(Gt==null||((Dt=Gt.actionTabs)===null||Dt===void 0)?void 0:Dt.params),dr(Yt==null||((Me=Yt.standard_answer)===null||Me===void 0)?void 0:Me.map(function(Rn){return{value:"",answer:(Rn==null?void 0:Rn.answer_text)||[]}}))),sr(!On);case 5:case"end":return mr.stop()}},Mt)}));return function(){return Ct.apply(this,arguments)}}(),Bt=function(Mt,Dt){var Me=An.map(function(Yt,wn){return Object(m.a)(Object(m.a)({},Yt),{},{value:wn===Dt?Mt.target.value:Yt.value})});dr(Me)},yn=function(){In({}),dr([]),sr(!1),cn({type:"problemset/setActionTabs",payload:{}})};return _.a.createElement(R.a,{centered:!0,destroyOnClose:!0,visible:Gt.actionTabs.key==="COMPLETION",title:"\u8BD5\u9898\u4F53\u9A8C",okText:On?"\u91CD\u65B0\u7B54\u9898":"\u63D0\u4EA4\u7B54\u6848",cancelText:"\u53D6\u6D88",width:708,onOk:Xt,onCancel:yn},_.a.createElement("div",null,_.a.createElement("div",{className:"c-light-primary mb5 font16"},"\u586B\u7A7A\u9898"),_.a.createElement(at.a,{value:mn==null?void 0:mn.name}),An==null?void 0:An.map(function(Ct,Mt){var Dt=Ct.value,Me=Ct.answer,Yt="";return On&&Me!==null&&Me!==void 0&&Me.includes(Dt)&&(Yt=me.a.green),On&&!(Me!=null&&Me.includes(Dt))&&(Yt=me.a.red),_.a.createElement("div",{key:Mt,style:{pointerEvents:On?"none":"auto",marginTop:10},className:"".concat(me.a.row," ").concat(Yt)},_.a.createElement("div",{style:{minWidth:80}},"\u586B\u7A7A",Mt+1,"\u7B54\u6848:"),_.a.createElement(E.a.TextArea,{className:me.a.textArea,style:{width:610,marginRight:10},onChange:function(mr){return Bt(mr,Mt)},value:Dt}),On&&(Me==null?void 0:Me.includes(Dt))&&_.a.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),On&&!(Me!=null&&Me.includes(Dt))&&_.a.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),On&&_.a.createElement(N.Fragment,null,_.a.createElement("div",{className:me.a.line}),mn==null||((Rt=mn.standard_answer)===null||Rt===void 0)?void 0:Rt.map(function(Ct,Mt){var Dt;return _.a.createElement("div",{className:"c-grey-333 mb5"},_.a.createElement("b",null,"\u586B\u7A7A",Mt+1,"\u7B54\u6848:\xA0"),(Ct==null||((Dt=Ct.answer_text)===null||Dt===void 0)?void 0:Dt.join("\u3001"))||"")}),_.a.createElement("div",{className:"c-grey-333 mb10"},_.a.createElement("b",null,"\u89E3\u6790:\xA0"),(mn==null?void 0:mn.analysis)||"\u6682\u65E0\u89E3\u6790"))))},ft=Object(x.a)(function(Zt){var mt=Zt.problemset;return{problemset:mt}})(tt),be=U("SAoR"),Ee=U("tK3L"),ge=U.n(Ee),de=U("bbsP"),fe=U("/wGt"),we=U("IPdS"),De=U.n(we),ke=[],Ze=function(mt){ke.forEach(function(Pt){if(mt.target===Pt.element||ht.isParent(mt.target,Pt.element))return;Pt.callbacks.forEach(function(Rt){return Rt()})})};window.document.body?window.document.body.addEventListener("click",Ze):window.addEventListener("DOMContentLoaded",function(){window.document.body.addEventListener("click",Ze)});var ht={isParent:function(mt,Pt){for(var Rt=mt;Rt&&Rt.tagName&&Rt.tagName.toLowerCase()!=="body";){if(Rt===Pt)return!0;Rt=Rt.parentNode}return!1},init:function(mt,Pt){var Rt=ke.filter(function(Gt){return Gt.element===mt});return Rt.length>0?Rt[0].callbacks.push(Pt):ke.push({element:mt,callbacks:[Pt]}),{clear:function(){ke=ke.filter(function(cn){return cn.element!==mt})}}}},Ut=ht,nn=[{stateName:"single_questions_count",type:"SINGLE",typeName:"\u5355\u9009\u9898"},{stateName:"multiple_questions_count",type:"MULTIPLE",typeName:"\u591A\u9009\u9898"},{stateName:"judgement_questions_count",type:"JUDGMENT",typeName:"\u5224\u65AD\u9898"},{stateName:"completion_questions_count",type:"COMPLETION",typeName:"\u586B\u7A7A\u9898"},{stateName:"subjective_questions_count",type:"SUBJECTIVE",typeName:"\u7B80\u7B54\u9898"},{stateName:"program_questions_count",type:"PROGRAM",typeName:"\u7F16\u7A0B\u9898"},{stateName:"practical_questions_count",type:"PRACTICAL",typeName:"\u5B9E\u8BAD\u9898"},{stateName:"combination_questions_count",type:"COMBINATION",typeName:"\u7EC4\u5408\u9898"}],tn=function(mt){var Pt=mt.visible,Rt=mt.basketData,Gt=mt.basketTotal,cn=mt.onClose,Tn=cn===void 0?function(){}:cn,Sn=mt.onDelete,mn=Sn===void 0?function(){}:Sn,In=Object(N.useRef)(),Kn=Object(N.useRef)();return Object(N.useEffect)(function(){return Kn.current?(Gt>=0&&!In.current&&(In.current=Ut.init(Kn.current,function(){Tn()})),function(){In.current&&In.current.clear()}):void 0},[Kn.current]),_.a.createElement(fe.a,{className:De.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:Pt,forceRender:!0,onClose:Tn},Gt>0?_.a.createElement("div",{style:{height:"100%"},ref:Kn},_.a.createElement("div",{className:De.a.title},"\u8BD5\u9898\u7BEE"),nn.map(function(hn){return Rt[hn.stateName]>0&&_.a.createElement("div",{className:De.a.problemset,key:hn.type},_.a.createElement("div",{className:De.a.content},hn.typeName,"(",Rt[hn.stateName],")"),_.a.createElement("div",{className:De.a.delete,onClick:function(){return mn(hn.type)}},_.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(De.a.deleteIcon)})))}),_.a.createElement("div",{className:De.a.previewWrap},_.a.createElement("div",{className:De.a.preview,onClick:function(){return x.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):_.a.createElement("div",{ref:Kn},_.a.createElement(J.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},_n={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",COMBINATION:"\u7EC4\u5408\u9898"},bn=function(mt){var Pt,Rt,Gt=mt.problemset,cn=mt.globalSetting,Tn=mt.loading,Sn=mt.dispatch,mn=mt.onReloadData,In=mn===void 0?function(){}:mn,Kn=mt.onReloadBasketData,hn=Kn===void 0?function(){}:Kn,An=Object(d.a)(mt,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),dr=function(){var Nn=Object(v.a)(T.a.mark(function zt(){var On;return T.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,Sn({type:"problemset/basketDelete",payload:Gt.actionTabs.params});case 2:On=Un.sent,Sn({type:"problemset/setActionTabs",payload:{}}),On.status===0&&(In(),hn());case 5:case"end":return Un.stop()}},zt)}));return function(){return Nn.apply(this,arguments)}}();return _.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Gt.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:Tn["problemset/handleDelete"],width:"442px",onOk:dr,onCancel:function(){Sn({type:"problemset/setActionTabs",payload:{}})}},_.a.createElement("div",{className:me.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",_n[(Pt=Gt.actionTabs)===null||Pt===void 0||((Rt=Pt.params)===null||Rt===void 0)?void 0:Rt.type]))},Kt=Object(x.a)(function(Zt){var mt=Zt.problemset,Pt=Zt.loading,Rt=Zt.globalSetting;return{problemset:mt,globalSetting:Rt,loading:Pt.effects}})(bn),rr=U("A60/"),Ln=U.n(rr),Cr=function(mt){var Pt=mt.count,Rt=mt.visibleBasket,Gt=mt.onToggleVisible,cn=Gt===void 0?function(){}:Gt;return _.a.createElement("div",{className:"".concat(Rt?Ln.a.right180:Ln.a.right20," ").concat(Ln.a.wrap)},_.a.createElement(c.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},_.a.createElement("div",{className:Ln.a.basket,onClick:cn},Pt>0&&_.a.createElement("div",{className:Ln.a.count},Pt),_.a.createElement("span",{className:Ln.a.iconWrap},_.a.createElement("i",{className:"".concat(Ln.a.icon," iconfont icon-shitilan")})),_.a.createElement("p",{className:Ln.a.name},"\u8BD5\u9898\u7BEE"))))},pr=U("EJTS"),kn=U("LE3n"),Mr=U("1vsH"),Or=U("xKgJ"),ln=U("/zsF"),Xr=U("PArb"),hr=U("jCWc"),Sr=U("kPKH"),vn=U("y8nQ"),fn=U("Vl3Y"),Jn=U("nSDg"),en=U.n(Jn),jt=U("HBuW"),Fr=U("NLgs"),ri=U("vkP9"),qr=E.a.Search,un={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},Rr={id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]},yi=function(mt){var Pt,Rt,Gt,cn,Tn=mt.classroomList,Sn=mt.loading,mn=mt.dispatch,In=mt.cb,Kn=mt.shixunIds,hn=Kn===void 0?[]:Kn,An=Object(nt.i)(),dr=Object(nt.h)(),Nn=Tn.actionTabs,zt=fn.a.useForm(),On=Object(h.a)(zt,1),sr=On[0],Un=Tn.shixunLists,Xt=Object(N.useState)([]),Bt=Object(h.a)(Xt,2),yn=Bt[0],Ct=Bt[1],Mt=Object(N.useState)([]),Dt=Object(h.a)(Mt,2),Me=Dt[0],Yt=Dt[1],wn=Object(N.useState)({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null}),mr=Object(h.a)(wn,2),Rn=mr[0],ii=mr[1];Object(N.useEffect)(function(){Tn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&mn({type:"classroomList/getShixunLists",payload:Object(m.a)({},Rn)})},[Tn.actionTabs.key]),Object(N.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(N.useEffect)(function(){ai()},[An]);var ai=function(){var Ft=Object(v.a)(T.a.mark(function br(){var lr;return T.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:return oi.next=2,Object(jt.pb)({});case 2:lr=oi.sent,Yt((lr==null?void 0:lr.disciplines)||[]);case 4:case"end":return oi.stop()}},br)}));return function(){return Ft.apply(this,arguments)}}(),Hr=function(br,lr,Yn){Rn.tag_level=br,Rn.sub_discipline_id=lr,Rn.discipline_id=Yn,ii(Object(m.a)({},Rn)),mn({type:"classroomList/getShixunLists",payload:Object(m.a)({},Rn)})},jn=function(){mn({type:"classroomList/setActionTabs",payload:{}}),ii({page:1,type:"all",diff:0,status:"published",order:"desc",limit:10,sort:"myshixuns_count",tag_level:null,sub_discipline_id:null,discipline_id:null})};return Tn.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:_.a.createElement(fe.a,{placement:"bottom",height:"100%",closable:!0,onClose:jn,visible:Tn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:en.a.drawer,footer:_.a.createElement("div",{className:"tc"},_.a.createElement(I.a,{size:"large",onClick:function(){jn(),Ct([])},style:{marginRight:8}},"\u53D6\u6D88"),_.a.createElement(I.a,{size:"large",onClick:Object(v.a)(T.a.mark(function Ft(){var br,lr,Yn;return T.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:br=function(Qt){var pn=yn[Qt];if(hn.includes(pn)){var Gn,Mn;return i.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(Un==null||((Gn=Un.shixun_list)===null||Gn===void 0||((Mn=Gn.find(function(qn){return qn.id===pn}))===null||Mn===void 0))?void 0:Mn.title)),{v:void 0}}},lr=0;case 2:if(!(lr<(yn==null?void 0:yn.length))){$t.next=9;break}if(Yn=br(lr),!(typeof Yn=="object")){$t.next=6;break}return $t.abrupt("return",Yn.v);case 6:lr++,$t.next=2;break;case 9:jn(),In(yn),Ct([]);case 12:case"end":return $t.stop()}},Ft)})),type:"primary"},"\u786E\u5B9A"))},_.a.createElement("section",{className:"tc"},_.a.createElement(ri.a,{onChange:function(br){ii(Object(m.a)(Object(m.a)(Object(m.a)({},Rn),br),{},{page:1})),mn({type:"classroomList/getShixunLists",payload:Object(m.a)(Object(m.a)(Object(m.a)({},Rn),br),{},{page:1})})}})),_.a.createElement("section",{className:"edu-container"},_.a.createElement("ul",{className:en.a.menu},_.a.createElement("li",null,un.name),un==null||((Pt=un.children)===null||Pt===void 0)?void 0:Pt.map(function(Ft,br){return _.a.createElement("li",{className:Rn[un.id]==Ft.id?en.a.actived:"",key:Ft.id,onClick:function(){Rn[un.id]=Ft.id,ii(Object(m.a)({},Rn)),mn({type:"classroomList/getShixunLists",payload:Object(m.a)({},Rn)})}},_.a.createElement("strong",null,Ft.name))})),_.a.createElement("ul",{className:en.a.menuDirection},_.a.createElement("li",{className:en.a.directionName},"\u65B9\u5411"),_.a.createElement("li",{className:Rn.discipline_id?"":en.a.actived,onClick:function(){Hr(null,null,null)}},_.a.createElement("strong",null,"\u5168\u90E8")),Me==null?void 0:Me.map(function(Ft,br){return _.a.createElement("li",{key:br,className:Rn.discipline_id==Ft.id?en.a.actived:""},_.a.createElement("strong",{onClick:function(){Hr(1,null,Ft.id)}},Ft.name),_.a.createElement("div",null,Ft.sub_disciplines.map(function(lr,Yn){return _.a.createElement("div",{key:Yn,className:"mt5"},_.a.createElement("div",{className:Rn.sub_discipline_id==lr.id?"".concat(en.a.actived2," ").concat(en.a.subTag):en.a.subTag,onClick:function(){Hr(2,lr.id,Ft.id)}},lr.name),_.a.createElement("ul",{className:"mt5"},lr.tags&&lr.tags.map(function(oi,$t){return _.a.createElement("li",{key:$t,className:Rn.sub_discipline_id==oi.id&&Rn.tag_level===3?en.a.actived2:"",onClick:function(){Hr(3,oi.id,Ft.id)}},oi.name)})))})))})),_.a.createElement("ul",{className:en.a.menu},_.a.createElement("li",null,Rr.name),Rr==null||((Rt=Rr.children)===null||Rt===void 0)?void 0:Rt.map(function(Ft,br){return _.a.createElement("li",{className:Rn[Rr.id]==Ft.id?en.a.actived:"",key:Ft.name,onClick:function(){Rn[Rr.id]=Ft.id,ii(Object(m.a)({},Rn)),mn({type:"classroomList/getShixunLists",payload:Object(m.a)({},Rn)})}},_.a.createElement("strong",null,Ft.name))})),_.a.createElement(Y.a,null,_.a.createElement(Sr.a,{flex:"1"},_.a.createElement("div",{className:en.a.menuCourse,style:{margin:"0px 15px"}},_.a.createElement("ul",null,_.a.createElement("li",null,"\u5DF2\u9009",_.a.createElement("span",{className:"c-blue"},yn.length),"\u4E2A\u5B9E\u8BAD"),_.a.createElement("li",null,"\u5171",_.a.createElement("span",{className:"c-blue"},Un.shixuns_count),"\u4E2A\u8BFE\u7A0B"),_.a.createElement("li",{className:"current",onClick:function(){var br=Object(m.a)(Object(m.a)({},Rn),{},{order:Rn.order==="asc"?"desc":"asc"});ii(br),mn({type:"classroomList/getShixunLists",payload:br})}},"\u5B66\u4E60\u4EBA\u6570",_.a.createElement("p",{className:"edu-sorter current ".concat(Rn.order)},Rn.order==="asc"?_.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):_.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),_.a.createElement(Sr.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),Un==null||((Gt=Un.shixun_list)===null||Gt===void 0)?void 0:Gt.map(function(Ft,br){return _.a.createElement("div",{className:en.a.listItem,key:br},_.a.createElement(u.a,{checked:yn.includes(Ft.id),value:Ft.id,disabled:Ft==null?void 0:Ft.need_authorize,onChange:function(Yn){var oi=yn.indexOf(Ft.id);yn.indexOf(Ft.id)>-1?Ct(yn.filter(function($t){return $t!==Ft.id})):Ct(yn.concat(Ft.id))}}),_.a.createElement("div",{className:en.a.info},_.a.createElement("div",{className:en.a.title},_.a.createElement("div",{className:en.a.titleLeft},_.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(Ft==null?void 0:Ft.identifier,"/challenges"),target:"_blank"},_.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Ft.title}})),(Ft==null?void 0:Ft.need_authorize)&&_.a.createElement("span",{onClick:function(){Object(Fr.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(Or.v)()&&(Ft==null?void 0:Ft.mark_status)===1&&_.a.createElement(c.a,{title:Ft==null?void 0:Ft.mark_content},_.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(Or.v)()&&(Ft==null?void 0:Ft.mark_status)===2&&_.a.createElement(c.a,{title:Ft==null?void 0:Ft.mark_content},_.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(Or.v)()&&(Ft==null?void 0:Ft.mark_status)===3&&_.a.createElement(c.a,{title:Ft==null?void 0:Ft.mark_content},_.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),_.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},_.a.createElement("span",{className:en.a.description,dangerouslySetInnerHTML:{__html:Ft.description}})),_.a.createElement("div",{className:" mt15"},Ft.challenge_names.map(function(lr,Yn){return _.a.createElement("span",{key:Yn,className:"mr30 font12"},"\u7B2C",Yn+1,"\u5173 ",lr," ")})),_.a.createElement(Xr.a,{dashed:!0}),_.a.createElement("div",{className:"c-light-black mt20 font12"},_.a.createElement("span",null,Ft.author_name),_.a.createElement("span",{className:"ml15 mr15"},"|"),_.a.createElement("span",null,Ft.author_school_name),_.a.createElement("span",{className:"ml15 mr15"},"|"),_.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",Ft.level),_.a.createElement("span",{className:"ml15 mr15"},"|"),_.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),_.a.createElement("span",null,Ft.study_count))))}),(Un==null||((cn=Un.shixun_list)===null||cn===void 0)?void 0:cn.length)===0&&_.a.createElement(J.a,null),_.a.createElement("p",null)),_.a.createElement("div",{className:"tc mt20"},_.a.createElement(z.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:Rn.page||1,showQuickJumper:!0,total:Un==null?void 0:Un.shixuns_count,onChange:function(br){var lr=Object(m.a)(Object(m.a)({},Rn),{},{page:br});ii(lr),mn({type:"classroomList/getShixunLists",payload:lr})}})))},fi=Object(x.a)(function(Zt){var mt=Zt.classroomList,Pt=Zt.loading;return{classroomList:mt,loading:Pt}})(yi),_t=U("mgmH"),sn=U("ErOA"),Ii=U("ORt/"),zi=U.n(Ii),na=U("Ot1p"),Vi=function(mt,Pt){var Rt,Gt=mt.data,cn=fn.a.useForm(),Tn=Object(h.a)(cn,1),Sn=Tn[0],mn=Object(N.useState)({}),In=Object(h.a)(mn,2),Kn=In[0],hn=In[1];return Object(N.useEffect)(function(){Gt&&(hn(Gt),Sn.setFieldsValue(Object(m.a)({},Gt)))},[Gt]),Object(N.useImperativeHandle)(Pt,function(){return{form:Sn}}),_.a.createElement("div",{className:zi.a.operating},_.a.createElement(fn.a,{form:Sn,scrollToFirstError:!0,onValuesChange:function(){hn(Object(m.a)({},Sn.getFieldsValue()))}},_.a.createElement(fn.a.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"},{max:30,message:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},_.a.createElement(E.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((Rt=Kn.name)===null||Rt===void 0?void 0:Rt.length)||0,"/30")})),_.a.createElement(fn.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},_.a.createElement(u.a.Group,null,_.a.createElement(u.a,{value:"c"},"C"),_.a.createElement(u.a,{value:"c++"},"C++"),_.a.createElement(u.a,{value:"java"},"Java"),_.a.createElement(u.a,{value:"python"},"Python"))),_.a.createElement("div",{className:zi.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),_.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),_.a.createElement(fn.a.Item,{name:"description"},_.a.createElement(na.a,{defaultValue:Kn.description||"",watch:!0}))))},Z=Object(N.forwardRef)(Vi),L=U("SVaM"),k=U("sesT"),V=U.n(k),re=U("wNkr"),Q=U.n(re),Pe=U("xTzM"),pt=U.n(Pe),Lt=j.a.TabPane,rn=E.a.Search,vt=E.a.TextArea,Vt;(function(Zt){Zt.Mine="0",Zt.Public="1",Zt.Collection="2",Zt.TeachGroupShare="3"})(Vt||(Vt={}));var fr=function(mt){var Pt,Rt,Gt,cn,Tn,Sn,mn,In,Kn,hn,An,dr,Nn=mt.classroomList,zt=mt.problemset,On=mt.user,sr=mt.globalSetting,Un=mt.loading,Xt=mt.dispatch,Bt=mt.match,yn=mt.shixunHomeworks,Ct=Object(d.a)(mt,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Mt=Object(N.useState)({discipline_id:null,sub_discipline_id:null,tag_discipline_id:null,group_id:null,type:"0",item_type:null,difficulty:null,keyword:null,page:1,per_page:20,sort_by:"updated_at",sort_direction:"desc",id:((Pt=Ct.location)===null||Pt===void 0||((Rt=Pt.query)===null||Rt===void 0)?void 0:Rt.id)||null,exam_id:(Bt==null||((Gt=Bt.params)===null||Gt===void 0)?void 0:Gt.id)||null,exercise_id:(Bt==null||((cn=Bt.params)===null||cn===void 0)?void 0:cn.categoryId)||null}),Dt=Object(h.a)(Mt,2),Me=Dt[0],Yt=Dt[1],wn=Object(N.useState)(0),mr=Object(h.a)(wn,2),Rn=mr[0],ii=mr[1],ai=Object(N.useState)([]),Hr=Object(h.a)(ai,2),jn=Hr[0],Ft=Hr[1],br=Object(N.useState)(Vt.Mine),lr=Object(h.a)(br,2),Yn=lr[0],oi=lr[1],$t=Object(N.useState)(0),Jt=Object(h.a)($t,2),Qt=Jt[0],pn=Jt[1],Gn=Object(N.useState)(-1),Mn=Object(h.a)(Gn,2),qn=Mn[0],gr=Mn[1],Ci=Object(N.useState)([]),Qn=Object(h.a)(Ci,2),Qi=Qn[0],vr=Qn[1],pi=Object(N.useState)(!1),si=Object(h.a)(pi,2),Ui=si[0],ka=si[1],Lo=Object(N.useState)([]),ua=Object(h.a)(Lo,2),Kr=ua[0],lo=ua[1],uo=Object(N.useState)(0),va=Object(h.a)(uo,2),ya=va[0],$a=va[1],co=Object(N.useState)(!1),Ma=Object(h.a)(co,2),Ca=Ma[0],ho=Ma[1],fo=Object(N.useState)(!1),Na=Object(h.a)(fo,2),po=Na[0],Qa=Na[1],_a=Object(N.useRef)(!1),ra=Object(N.useRef)(""),ba=Object(N.useRef)(),Te=Object(N.useRef)(),Le=Object(N.useRef)(),We=Object(N.useState)(),Se=Object(h.a)(We,2),ie=Se[0],ye=Se[1],le=Object(N.useState)([]),Ae=Object(h.a)(le,2),_e=Ae[0],Be=Ae[1],je=Object(N.useRef)(!1),Ge=(Bt==null?void 0:Bt.url)==="/problemset",et=Bt==null||((Tn=Bt.url)===null||Tn===void 0)?void 0:Tn.includes("program_homework"),yt=et&&Bt!==null&&Bt!==void 0&&(Sn=Bt.params)!==null&&Sn!==void 0&&Sn.categoryId&&Bt!==null&&Bt!==void 0&&(mn=Bt.url)!==null&&mn!==void 0&&mn.includes("edit")?Bt==null||((In=Bt.params)===null||In===void 0)?void 0:In.categoryId:"",Tt=yt?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Nt=Object(N.useState)({}),Dn=Object(h.a)(Nt,2),$n=Dn[0],Bn=Dn[1],zn=Object(N.useState)(!1),Xn=Object(h.a)(zn,2),Vn=Xn[0],Fn=Xn[1],Zn=On.userInfo||{},er=Zn.admin,Nr=Zn.business,tr=Zn.is_shixun_marker,En=Zn.is_teacher,gn=Zn.user_identity,Wn=er||Nr||tr||En||gn!=="\u5B66\u751F",ur=Object(N.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),an=Object(h.a)(ur,2),cr=an[0],Ur=an[1],ir=yn.commonHomeWorkAddDefaultData,Ar=Object(N.useState)([]),Er=Object(h.a)(Ar,2),Gr=Er[0],Yr=Er[1],Br=Object(N.useRef)(null),_i=Object(N.useState)(!1),Pi=Object(h.a)(_i,2),Si=Pi[0],$r=Pi[1],Ir=Object(N.useState)([]),xr=Object(h.a)(Ir,2),Cn=xr[0],Tr=xr[1],ji=Object(N.useState)(""),Zi=Object(h.a)(ji,2),ia=Zi[0],wr=Zi[1],Xi=Object(N.useState)(!1),Ji=Object(h.a)(Xi,2),Dr=Ji[0],yr=Ji[1],Wr=Object(N.useRef)(null),Ua=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(N.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Za=function(){var it=Object(v.a)(T.a.mark(function qe(){var $e,ot,lt;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(Ke.q)({id:yt});case 2:$e=St.sent,$e!=null&&$e.name&&(lt={description:$e.description,languages:$e.languages,name:$e.name},Wr.current.form.setFieldsValue(lt),Bn(Object(m.a)({},lt)),Tr(Object(O.a)($e.data)),Be((ot=$e.data)===null||ot===void 0?void 0:ot.map(function(wt){return wt.id})));case 4:case"end":return St.stop()}},qe)}));return function(){return it.apply(this,arguments)}}();Object(N.useEffect)(function(){yt&&Za()},[yt]),Object(N.useEffect)(function(){var it,qe=((it=Ct.location.query)===null||it===void 0?void 0:it.group_id)||0;Me.group_id=Number(qe),Xt({type:"problemset/getDisciplines",payload:Object(m.a)(Object(m.a)({source:"question"},Me),{},{group_type:Yn})}),Yt(Me),ei(Me).then(function($e){$e!=null&&$e.status||Yr($e==null?void 0:$e.item_banks_group),$r(!1)}),Yi(),Ea()},[]),Object(N.useEffect)(function(){return Xt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Xt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){Xt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Xt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(N.useEffect)(function(){return Xt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Xt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(N.useEffect)(function(){return Xt({type:"globalSetting/headerFooterToggle",payload:Ge}),function(){Xt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(N.useEffect)(function(){Object(Mr.Z)(et?Tt:"\u8BD5\u9898\u5E93")},[et,Tt]);var ca=function(qe,$e){var ot=[];if(!qe){var lt,At;zt==null||((lt=zt.disciplinesData)===null||lt===void 0||((At=lt.disciplines)===null||At===void 0))||At.forEach(function(zr){var Bi;zr==null||((Bi=zr.sub_disciplines)===null||Bi===void 0)||Bi.forEach(function(ta){var La;ta==null||((La=ta.tag_disciplines)===null||La===void 0)||La.forEach(function(Fi){Fi.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&ot.push(Fi)})})})}if(qe&&!$e){var St,wt,dn,nr=zt==null||((St=zt.disciplinesData)===null||St===void 0||((wt=St.disciplines)===null||wt===void 0))?void 0:wt.find(function(zr){return zr.id===qe});nr==null||((dn=nr.sub_disciplines)===null||dn===void 0)||dn.forEach(function(zr){var Bi;zr==null||((Bi=zr.tag_disciplines)===null||Bi===void 0)||Bi.forEach(function(ta){ta.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&ot.push(ta)})})}if(qe&&$e){var Oi,Hn,Ei,xi,gi=zt==null||((Oi=zt.disciplinesData)===null||Oi===void 0||((Hn=Oi.disciplines)===null||Hn===void 0))?void 0:Hn.find(function(zr){return zr.id===qe}),Ri=gi==null||((Ei=gi.sub_disciplines)===null||Ei===void 0)?void 0:Ei.find(function(zr){return zr.id===$e});Ri==null||((xi=Ri.tag_disciplines)===null||xi===void 0)||xi.forEach(function(zr){zr.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&ot.push(zr)})}return ot},Ea=function(){var it=Object(v.a)(T.a.mark(function qe(){return T.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Xt({type:"problemset/getTeachGroupData"});case 1:case"end":return ot.stop()}},qe)}));return function(){return it.apply(this,arguments)}}();Object(N.useEffect)(function(){var it=zt.basketData||{},qe=it.completion_questions_count,$e=qe===void 0?0:qe,ot=it.judgement_questions_count,lt=ot===void 0?0:ot,At=it.multiple_questions_count,St=At===void 0?0:At,wt=it.practical_questions_count,dn=wt===void 0?0:wt,nr=it.program_questions_count,Oi=nr===void 0?0:nr,Hn=it.single_questions_count,Ei=Hn===void 0?0:Hn,xi=it.subjective_questions_count,gi=xi===void 0?0:xi,Ri=it.combination_questions_count,zr=Ri===void 0?0:Ri,Bi=$e+lt+St+dn+Oi+Ei+gi+zr;$a(Bi)},[zt.basketData]);var ei=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot,lt;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return ot=Object(m.a)({},$e),ot.item_type=et?"PROGRAM":$e.item_type,$r(!0),ot.keyword=encodeURIComponent($e.keyword||""),St.next=6,Xt({type:"problemset/getItemBanks",payload:ot});case 6:if(lt=St.sent,!(lt&&lt.status!==403&&lt.status!==401&&lt.status!==500)){St.next=18;break}return ii(lt.items_count||0),Ft(lt.items||[]),vr(lt.tag_disciplines||[]),ye(lt.used_shixun_ids||[]),ja(lt.items||[]),et||Be([]),lo((lt==null?void 0:lt.navigation)||[]),pn((lt==null?void 0:lt.added_num)||0),$r(!1),St.abrupt("return",lt);case 18:case"end":return St.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),Yi=function(){Xt({type:"problemset/getBasketList",payload:{}})},ja=function(qe){var $e=qe.every(function(ot){var lt;return((lt=ot.program_attr)===null||lt===void 0?void 0:lt.status)===0});_a.current=$e},Io=function(qe,$e){if(Me.discipline_id=qe||"",Me.sub_discipline_id=$e||"",Me.tag_discipline_id="",Me.page=1,Me.per_page=20,delete Me.id,gr(qe===null?-1:null),Yt(Me),ei(Me),qe===null)return},Po=function(qe){Me.item_type=qe||"",Me.page=1,Me.per_page=20,Yt(Me),ei(Me)},mo=function(qe){Me.difficulty=qe||"",Me.page=1,Me.per_page=20,delete Me.id,Yt(Me),ei(Me)},Ja=function(qe){Me.tag_discipline_id=qe,Me.page=1,Me.per_page=20,delete Me.id,qe===-1&&(Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id=""),gr(qe),Yt(Me),ei(Me)},qa=Object(N.useState)(!1),da=Object(h.a)(qa,2),xa=da[0],go=da[1],Ba=function(qe){Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:qe}}),Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.item_type=null,Me.difficulty=null,Me.type=qe,qe==="0"?Me.group_id=0:Me.group_id=null,qe==="3"&&et?Me.only_published=!0:Me.only_published=null,qe==="3"?go(!0):go(!1),Me.page=1,Me.per_page=20,delete Me.id,gr(-1),oi(qe),Yt(Me),ei(Me)},Ta=function(qe,$e){Me.page=qe,Me.per_page=$e,Yt(Me),ei(Me)},ha=function(qe){Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.item_type=null,Me.difficulty=null,Me.page=1,Me.keyword=qe,delete Me.id,qe?(Qa(!0),Object(L.a)({name:qe,copywriting:qe,position:et?"Practice":"ItemBank"})):Qa(!1),gr(-1),Yt(Me),ei(Me)},Pr=function(){Me.per_page=20,Yt(Me),ei(Me)},ki=function(qe){var $e=qe.length===jn.length&&Me.page>1?Me.page-1:Me.page;Me.page=$e,Me.per_page=20,Yi(),Yt(Me),ei(Me)},fa=function(){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},aa=function(){var it=Object(v.a)(T.a.mark(function qe($e,ot){var lt;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!ot){St.next=6;break}return St.next=3,Object(Ke.n)({id:$e});case 3:St.t0=St.sent,St.next=9;break;case 6:return St.next=8,Object(Ke.G)({id:$e});case 8:St.t0=St.sent;case 9:lt=St.t0,(lt==null?void 0:lt.status)===0&&Pr();case 11:case"end":return St.stop()}},qe)}));return function($e,ot){return it.apply(this,arguments)}}(),Sa=function(){var it=Object(v.a)(T.a.mark(function qe($e){return T.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:Ka($e);case 1:case"end":return lt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),pa=function(){var it=Object(v.a)(T.a.mark(function qe($e){return T.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:Ha([$e]);case 1:case"end":return lt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),Fa=function(qe){Te.current="",ba.current="",R.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:_.a.createElement("div",{className:"font14"},_.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),_.a.createElement(A.a.Group,{className:"mt10",onChange:function(ot){return ba.current=ot.target.value}},_.a.createElement(A.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),_.a.createElement(A.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),_.a.createElement(A.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),_.a.createElement(A.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),_.a.createElement(A.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),_.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),_.a.createElement(vt,{className:"mt10",rows:4,defaultValue:Te.current,onChange:function(ot){return Te.current=ot.target.value}})),onOk:function(){return new Promise(function(){var ot=Object(v.a)(T.a.mark(function lt(At,St){var wt;return T.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:if(ba.current&&Te.current){nr.next=3;break}return i.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),nr.abrupt("return",St());case 3:return nr.next=5,Object(Ke.o)({id:qe,clazz:ba.current,description:Te.current});case 5:wt=nr.sent,wt.status===0&&i.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),At();case 8:case"end":return nr.stop()}},lt)}));return function(lt,At){return ot.apply(this,arguments)}}())}})},eo=function(qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:qe}}})},Wa=function(qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:qe}}})},to=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot,lt,At,St;return T.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(ot=$e.item_type,!(ot==="PROGRAM")){dn.next=12;break}return lt=$e.program_attr.identifier,dn.next=5,Xt({type:"problemset/startExperience",payload:{id:lt}});case 5:if(At=dn.sent,!(At.status===0)){dn.next=10;break}return St=At.identifier,Object(Mr.U)("/myproblems/".concat(St)),dn.abrupt("return");case 10:return i.b.warn(At.message),dn.abrupt("return");case 12:Xt({type:"problemset/setActionTabs",payload:{key:ot,params:$e}});case 13:case"end":return dn.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),qi=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot,lt,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Me.exam_id){wt.next=6;break}return wt.next=3,Object(Ke.M)({item_id:$e,id:Me.exam_id});case 3:return ot=wt.sent,ot.status===0&&Pr(),wt.abrupt("return");case 6:if(!(Me!=null&&Me.exercise_id)){wt.next=12;break}return wt.next=9,Object(sn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Me==null?void 0:Me.exercise_id,item_bank_ids:[$e]}});case 9:return lt=wt.sent,lt.status===0&&Pr(),wt.abrupt("return");case 12:return wt.next=14,Xt({type:"problemset/cancel",payload:{id:$e,item_bank:1}});case 14:At=wt.sent,At.status===0&&(Pr(),Yi());case 16:case"end":return wt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),oa=function(){var it=Object(v.a)(T.a.mark(function qe($e){return T.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs($e),group_type:Vt.Mine}}),Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.page=1,Me.per_page=20,Me.group_id=Math.abs($e),gr(-1),Yt(Me),ei(Me).then(function(At){return Yr(At==null?void 0:At.item_banks_group)});case 10:case"end":return lt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),no=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot,lt,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!Me.exam_id){wt.next=6;break}return wt.next=3,Object(Ke.t)({exam_id:Me.exam_id,item_bank_ids:[$e]});case 3:return ot=wt.sent,ot.status===0&&Pr(),wt.abrupt("return");case 6:if(!(Me!=null&&Me.exercise_id)){wt.next=12;break}return wt.next=9,Object(sn.a)("/api/exercises/".concat(Me==null?void 0:Me.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[$e]}});case 9:return lt=wt.sent,lt.status===0&&Pr(),wt.abrupt("return");case 12:if(!(ya===200)){wt.next=15;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),wt.abrupt("return");case 15:return wt.next=17,Xt({type:"problemset/select",payload:{item_bank_ids:[$e]}});case 17:At=wt.sent,At.status===0&&(Pr(),Yi());case 19:case"end":return wt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),ro=function(){var it=Object(v.a)(T.a.mark(function qe($e){return T.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if($e){lt.next=3;break}if(_e!=null&&_e.length){lt.next=3;break}return lt.abrupt("return",i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Le.current=[0],R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u79FB\u52A8\u5230",maskClosable:!0,className:"custom-modal-divider",icon:null,content:_.a.createElement("div",{className:"font14 ".concat(ge.a.overflow),style:{maxHeight:500,overflow:"auto"}},_.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),_.a.createElement(ae.a,{defaultValue:!0,value:Le.current,onChange:function(St){return Le.current=St}})),onOk:function(){var At=Object(v.a)(T.a.mark(function wt(){var dn,nr;return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.next=2,Object(Ke.f)({ids:$e?[$e]:_e,groups_ids:(dn=Le.current)===null||dn===void 0?void 0:dn[0]});case 2:nr=Hn.sent,Le.current=[],(nr==null?void 0:nr.status)===0&&Pr();case 5:case"end":return Hn.stop()}},wt)}));function St(){return At.apply(this,arguments)}return St}()});case 5:case"end":return lt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),ko=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot,lt;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(Ke.D)({clazz:"ItemBank",id:$e});case 2:ot=St.sent,lt=(ot==null?void 0:ot.groups)||[],Le.current=[],R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A\u64A4\u9500",cancelText:"\u53D6\u6D88",title:"\u672C\u9898\u5DF2\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:_.a.createElement("div",{className:"font14 ".concat(ge.a.overflow)},_.a.createElement("p",{className:"c-grey-999"},"\u9009\u4E2D\u5E76\u786E\u5B9A\uFF0C\u5373\u64A4\u9500\u672C\u9898\u5BF9\u9009\u4E2D\u6559\u7814\u56E2\u961F\u7684\u5206\u4EAB"),_.a.createElement(u.a.Group,{className:ge.a.checkbox,defaultValue:Le.current,onChange:function(dn){return Le.current=dn}},lt==null?void 0:lt.map(function(wt){return _.a.createElement(u.a,{key:wt.group_id,value:wt.group_id},wt.name)}))),onOk:function(){var wt=Object(v.a)(T.a.mark(function nr(){return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:return Hn.abrupt("return",new Promise(function(){var Ei=Object(v.a)(T.a.mark(function xi(gi,Ri){var zr,Bi,ta;return T.a.wrap(function(Fi){for(;;)switch(Fi.prev=Fi.next){case 0:if(Le.current.length){Fi.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Fi.abrupt("return",Ri());case 3:return Bi=lt==null||((zr=lt.map(function(_o){return _o.group_id}))===null||zr===void 0)?void 0:zr.filter(function(_o){return!Le.current.includes(_o)}),Fi.next=6,Object(Ke.l)({ids:[$e],clazz:"ItemBank",group_ids:Bi});case 6:return ta=Fi.sent,Le.current=[],(ta==null?void 0:ta.status)===0&&(i.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),Pr()),Fi.abrupt("return",gi());case 10:case"end":return Fi.stop()}},xi)}));return function(xi,gi){return Ei.apply(this,arguments)}}()));case 1:case"end":return Hn.stop()}},nr)}));function dn(){return wt.apply(this,arguments)}return dn}()});case 6:case"end":return St.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),Mo=function(qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:qe}}})},io=function(){Xt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Me}});return},No=function(){var qe={discipline_id:"&discipline_id=".concat(Me.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(Me.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(Me.tag_discipline_id),difficulty:"&difficulty=".concat(Me.difficulty),item_type:"&item_type=".concat(Me.item_type),group_id:"&group_id=".concat(Me.group_id||0)},$e="/problemset/newitem?pages=".concat(Me.page);Object.keys(qe).forEach(function(ot){Me[ot]&&($e=$e+qe[ot])}),x.d===null||x.d===void 0||x.d.push($e)},ti=function(qe){var $e=_e;if(!($e!=null&&$e.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(ya+$e.length>200&&qe&&Ge){i.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-ya,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat($e.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}qe?Qr($e):mi($e)},Qr=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:ot=Object(O.a)($e),jn.forEach(function(St){if(ot.includes(St.id)){var wt;St.item_type==="PROGRAM"&&((wt=St.program_attr)===null||wt===void 0?void 0:wt.status)===0&&Object(dt.remove)(ot,function(dn){return dn===St.id})}}),R.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:_.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",$e.length,"\u9053\u8BD5\u9898\uFF0C\u5DF2\u52A0\u5165\u8FC7\u7684\u8BD5\u9898\u6216\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u5C06\u4E0D\u4F1A\u91CD\u590D\u52A0\u5165"," "),onOk:function(){var St=Object(v.a)(T.a.mark(function dn(){var nr;return T.a.wrap(function(Hn){for(;;)switch(Hn.prev=Hn.next){case 0:if(!Me.exam_id){Hn.next=6;break}return Hn.next=3,Object(Ke.t)({exam_id:Me.exam_id,item_bank_ids:ot});case 3:nr=Hn.sent,Hn.next=15;break;case 6:if(!(Me!=null&&Me.exercise_id)){Hn.next=12;break}return Hn.next=9,Object(sn.a)("/api/exercises/".concat(Me==null?void 0:Me.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:ot}});case 9:nr=Hn.sent,Hn.next=15;break;case 12:return Hn.next=14,Xt({type:"problemset/select",payload:{item_bank_ids:ot}});case 14:nr=Hn.sent;case 15:nr.status===0&&(Pr(),Yi());case 16:case"end":return Hn.stop()}},dn)}));function wt(){return St.apply(this,arguments)}return wt}()});case 3:case"end":return At.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),mi=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!Me.exam_id){At.next=6;break}return At.next=3,Object(sn.a)("/api/examination_banks/".concat(Me.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:$e}});case 3:ot=At.sent,At.next=15;break;case 6:if(!(Me!=null&&Me.exercise_id)){At.next=12;break}return At.next=9,Object(sn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Me==null?void 0:Me.exercise_id,item_bank_ids:$e}});case 9:ot=At.sent,At.next=15;break;case 12:return At.next=14,Xt({type:"problemset/unselectAll",payload:{item_ids:$e}});case 14:ot=At.sent;case 15:ot.status===0&&(Pr(),Yi());case 16:case"end":return At.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),Zr=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot;return T.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(Ge&&ya===200)){At.next=3;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),At.abrupt("return");case 3:if(!Me.exam_id){At.next=10;break}return At.next=6,Object(Ke.t)({exam_id:Me.exam_id,shixun_ids:$e});case 6:ot=At.sent,ot.status===0&&Pr(),At.next=14;break;case 10:return At.next=12,Xt({type:"problemset/select",payload:{shixun_ids:$e}});case 12:ot=At.sent,ot.status===0&&(Yi(),Pr());case 14:case"end":return At.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),Aa=function(){Xt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Ha=function(qe){var $e,ot,lt,At;if(!(($e=zt.teachGroupData)!==null&&$e!==void 0&&(ot=$e.groups)!==null&&ot!==void 0&&ot.length))return i.b.info("\u60A8\u6682\u672A\u521B\u5EFA\u6216\u52A0\u5165\u4EFB\u4F55\u6559\u7814\u56E2\u961F\uFF0C\u8BF7\u524D\u5F80\u201C\u6211\u7684\u4E2A\u4EBA\u4E2D\u5FC3-\u6559\u7814\u56E2\u961F\u201D\u67E5\u770B");R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5171\u4EAB\u81F3\u6559\u7814\u56E2\u961F",maskClosable:!0,icon:null,content:_.a.createElement("div",{className:"font14 ".concat(ge.a.overflow)},_.a.createElement(u.a.Group,{className:ge.a.checkbox,defaultValue:Le.current,onChange:function(wt){return Le.current=wt}},(lt=zt.teachGroupData)===null||lt===void 0||((At=lt.groups)===null||At===void 0)?void 0:At.map(function(St){return _.a.createElement(u.a,{key:St.group_id,value:St.group_id},St.name)}))),onOk:function(){return new Promise(function(){var wt=Object(v.a)(T.a.mark(function dn(nr,Oi){var Hn,Ei;return T.a.wrap(function(gi){for(;;)switch(gi.prev=gi.next){case 0:if((Hn=Le.current)!==null&&Hn!==void 0&&Hn.length){gi.next=3;break}return i.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),gi.abrupt("return",Oi());case 3:return gi.next=5,Object(Ke.l)({ids:qe||_e,clazz:"ItemBank",group_ids:Le.current});case 5:Ei=gi.sent,(Ei==null?void 0:Ei.status)===0&&(i.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Le.current=[],Be([]),Pr(),nr());case 7:case"end":return gi.stop()}},dn)}));return function(dn,nr){return wt.apply(this,arguments)}}())}})},Mi=function(){var qe=function(){var $e=Object(v.a)(T.a.mark(function ot(){var lt;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return ka(!0),St.next=3,Object(Ke.j)({ids:_e});case 3:lt=St.sent,ka(!1),(lt==null?void 0:lt.status)===0&&R.a.info({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u5220\u9664\u7ED3\u679C",maskClosable:!1,keyboard:!1,icon:null,content:"\u672C\u6B21\u6210\u529F\u5220\u9664".concat(lt.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(lt.fail,"\u6761\u8BD5\u9898\u56E0\u4E3A\u516C\u5F00\u65E0\u6CD5\u5220\u9664\uFF0C\u8BF7\u64A4\u9500\u540E\u518D\u8FDB\u884C\u5220\u9664\u3002"),onOk:function(){ki(new Array(lt.success))}});case 6:case"end":return St.stop()}},ot)}));return function(){return $e.apply(this,arguments)}}();if(_e!=null&&_e.length){R.a.confirm({centered:!0,width:530,className:"custom-modal-divider ",okText:"\u786E\u5B9A",title:"\u63D0\u793A",cancelText:"\u53D6\u6D88",icon:null,content:"\u672C\u6B21\u9009\u4E2D\u4E86".concat(_e==null?void 0:_e.length,"\u6761\u8BD5\u9898\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF0C\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"),onOk:qe});return}i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},ao=function(){var qe,$e;if(!(_e!=null&&_e.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(jn!=null&&(qe=jn.filter(function(ot){return _e.includes(ot.id)}))!==null&&qe!==void 0&&qe.every(function(ot){return ot.public}))return i.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(jn!=null&&($e=jn.filter(function(ot){return _e.includes(ot.id)}))!==null&&$e!==void 0&&$e.find(function(ot){var lt;return ot.item_type==="PROGRAM"&&((lt=ot.program_attr)===null||lt===void 0?void 0:lt.status)===0}))return i.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||On.userInfo.professional_certification?Ka():R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:_.a.createElement("div",{className:"font16 c-grey-333"},"\u516C\u5F00\u5E76\u7ECF\u5E73\u53F0\u5BA1\u6838\u540E\uFF0C\u8BE5\u9898\u5C06\u5728\u516C\u5171\u8BD5\u9898\u5E93\u53EF\u89C1\uFF0CEducoder\u6240\u6709\u7528\u6237\u5747\u53EF\u4F7F\u7528\u8BE5\u9898\u3002",_.a.createElement("br",null),"\u516C\u5F00\u540E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u4F46\u53EF\u4EE5\u64A4\u9500\uFF1B\u64A4\u9500\u516C\u5F00\u540E\u53EF\u4EE5\u4FEE\u6539\u3002",_.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",_.a.createElement("br",null),_.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(lt){return je.current=lt.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ka()}})},Ka=function(){var it=Object(v.a)(T.a.mark(function qe($e){var ot,lt;return T.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return ot=Yn===Vt.TeachGroupShare?1:2,St.next=3,Object(Ke.g)({ids:$e?[$e]:_e,source:ot});case 3:lt=St.sent,lt.status===0&&(je.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),je.current=!1,Be([]),Pr());case 5:case"end":return St.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),vo=function(qe){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:_.a.createElement(_.a.Fragment,null,_.a.createElement("div",{className:ge.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),_.a.createElement("div",{className:ge.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var $e=Object(v.a)(T.a.mark(function lt(){var At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Ke.L)({identifier:qe});case 2:At=wt.sent,(At==null?void 0:At.status)===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),Pr());case 4:case"end":return wt.stop()}},lt)}));function ot(){return $e.apply(this,arguments)}return ot}()})},ma=function(qe){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:_.a.createElement("p",{className:ge.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var $e=Object(v.a)(T.a.mark(function lt(){var At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Ke.K)({identifier:qe});case 2:At=wt.sent,(At==null?void 0:At.status)===0&&(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),Pr());case 4:case"end":return wt.stop()}},lt)}));function ot(){return $e.apply(this,arguments)}return ot}()})},Ga=function(){var it=Object(v.a)(T.a.mark(function qe($e){return T.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:$e,group_type:Vt.TeachGroupShare}}),Me.page=1,Me.group_id=$e||null,delete Me.id,Yt(Object(m.a)({},Me)),ei(Me);case 6:case"end":return lt.stop()}},qe)}));return function($e){return it.apply(this,arguments)}}(),Oa=function(qe){Me.sort_by=qe.type,Me.sort_direction=qe.direction,Me.page=1,Me.per_page=20,Ur(qe.name),Yt(Me),ei(Me)},yo=function(){Me.page=1,Yt(Me),ei(Me)},za=function(qe){Me.discipline_id="",Me.sub_discipline_id="",Me.tag_discipline_id="",Me.item_type=null,Me.difficulty=null,Me.page=1,Me.per_page=20,Me.group_id=qe,gr(-1),Yt(Me),ei(Me).then(function($e){return Yr($e==null?void 0:$e.item_banks_group)})},_r=function(){if(!(_e!=null&&_e.length)){Xt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:Me}});return}R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:_.a.createElement("div",{className:"font14 ".concat(ge.a.overflow)},"\u5DF2\u9009\u4E2D",_e==null?void 0:_e.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(_t.k)({ids:_e})}})},or=function(){var it=Object(v.a)(T.a.mark(function qe(){var $e,ot,lt,At;return T.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Ke.i)({ids:_e});case 2:$e=wt.sent,ot=$e.data||{},lt=ot.unpublish_program_question_count,At=ot.total_item_banks,lt===0?R.a.error({title:"\u9519\u8BEF",content:_.a.createElement("span",null,"\u53D1\u5E03\u9519\u8BEF\uFF01\u8BF7\u9009\u62E9\u5C1A\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\u8FDB\u884C\u53D1\u5E03"),centered:!0,okText:"\u786E\u8BA4"}):R.a.confirm({title:"\u63D0\u793A",content:_.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",At,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",lt,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var dn=Object(v.a)(T.a.mark(function Oi(){var Hn;return T.a.wrap(function(xi){for(;;)switch(xi.prev=xi.next){case 0:return xi.next=2,Object(Ke.h)({ids:_e});case 2:Hn=xi.sent,Hn.status===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),Pr());case 4:case"end":return xi.stop()}},Oi)}));function nr(){return dn.apply(this,arguments)}return nr}()});case 5:case"end":return wt.stop()}},qe)}));return function(){return it.apply(this,arguments)}}(),ci=_.a.createElement(p.a,null,Wn&&_.a.createElement(p.a.Item,{onClick:function(){return ti(!0)}},"\u6279\u91CF\u52A0\u5165"),Wn&&_.a.createElement(p.a.Item,{onClick:function(){return ti(!1)}},"\u6279\u91CF\u79FB\u51FA"),Yn===Vt.Mine&&Ge&&_.a.createElement(p.a.Item,{onClick:function(){return ro()}},"\u79FB\u52A8\u5230"),Yn===Vt.Mine&&Ge&&_.a.createElement(p.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),Yn===Vt.Mine&&Ge&&_.a.createElement(p.a.Item,{onClick:function(){return Ha()}},"\u6279\u91CF\u5171\u4EAB"),Yn===Vt.Mine&&Ge&&_.a.createElement(p.a.Item,{onClick:Mi},"\u6279\u91CF\u5220\u9664")),bi=function(qe){if(et)if((Cn==null?void 0:Cn.length)<=0){var $e=jn.filter(function(dn){return qe.includes(dn.id)});Tr(Object(O.a)($e)),Be($e==null?void 0:$e.map(function(dn){return dn.id}))}else if(qe.length>Cn.length){var ot,lt=jn.filter(function(dn){return qe.includes(dn.id)}),At=Cn.map(function(dn){return dn.id}),St=lt.filter(function(dn){return!At.includes(dn.id)});Tr([].concat(Object(O.a)(Cn),Object(O.a)(St))),Be((ot=[].concat(Object(O.a)(Cn),Object(O.a)(St)))===null||ot===void 0?void 0:ot.map(function(dn){return dn.id}))}else{var wt=Cn.filter(function(dn){return qe.includes(dn.id)});Tr(Object(O.a)(wt)),Be(wt==null?void 0:wt.map(function(dn){return dn.id}))}else Be(qe)},sa=function(qe){if(et)if(qe){var $e,ot=Cn==null?void 0:Cn.map(function(wt){return wt.id}),lt=jn.filter(function(wt){return!ot.includes(wt.id)});Tr([].concat(Object(O.a)(Cn),Object(O.a)(lt))),Be(($e=[].concat(Object(O.a)(Cn),Object(O.a)(lt)))===null||$e===void 0?void 0:$e.map(function(wt){return wt.id}))}else{var At=jn==null?void 0:jn.map(function(wt){return wt.id}),St=Cn.filter(function(wt){return!At.includes(wt.id)});Tr(Object(O.a)(St)),Be(St==null?void 0:St.map(function(wt){return wt.id}))}else Be(qe?jn==null?void 0:jn.map(function(wt){return wt.id}):[])},ea=function(){var qe="/problemset/preview";if(Me.exam_id&&(qe="/paperlibrary/edit/".concat(Me.exam_id)),Me!=null&&Me.exercise_id){var $e;qe="/classrooms/".concat(Bt==null||(($e=Bt.params)===null||$e===void 0)?void 0:$e.coursesId,"/exercise/").concat(Me==null?void 0:Me.exercise_id,"/edit")}x.d.push(qe)},Ra=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],la={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},li=function(qe,$e){var ot,lt=$e.id<0?"--":Wn?$e[Me.exercise_id?"added":"choosed"]?_.a.createElement("span",{key:1,className:ge.a.btnAdd,onClick:function(wt){wt.target.style.pointerEvents="none",qi($e.id)}},Ge?"\u79FB\u51FA\u8BD5\u9898\u7BEE":_.a.createElement("span",null,_.a.createElement("b",{className:"iconfont icon-yichu ".concat(ge.a.cancelC)}),"\u79FB\u51FA")):$e.item_type==="PROGRAM"&&((ot=$e.program_attr)===null||ot===void 0?void 0:ot.status)===0?_.a.createElement(c.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},_.a.createElement("span",{className:ge.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":_.a.createElement("span",{style:{padding:"0 3px"}},_.a.createElement("b",{className:"iconfont icon-jiaru ".concat(ge.a.addC)}),"\u52A0\u5165")," ")):_.a.createElement("span",{className:ge.a.btnAdd,onClick:function(){return no($e.id)}},Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":_.a.createElement("span",{style:{padding:"0 3px"}},_.a.createElement("b",{className:"iconfont icon-jiaru ".concat(ge.a.addC)}),"\u52A0\u5165")):_.a.createElement(_.a.Fragment,null),At=_.a.createElement("span",{className:ge.a.actonBtn},$e.id>0&&_.a.createElement(pr.a,{isProblemset:Ge,user:On,key:$e.id,data:$e,activeTabsKey:Yn,selectIds:_e,onCollect:aa,onSetPublic:Sa,onStartExperience:to,onCorrection:Fa,onPublicReview:fa,onSetPrivate:eo,onDelete:Wa,onCancel:qi,onSelect:no,onMoveTo:ro,onSetShare:pa,onCancelShare:ko,onPublish:vo,onCancelPublish:ma}),lt);return At};Object(N.useEffect)(function(){if(et){var it=Bt.params,qe=it.coursesId,$e=it.categoryId;Xt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:$e,coursesId:qe,type:5}})}},[et]);var Da=function(){var it=Object(v.a)(T.a.mark(function qe(){var $e,ot,lt,At,St;return T.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:return Wr.current.form.validateFields().catch(function(nr){document.body.scrollIntoView()}),dn.next=3,Wr.current.form.validateFields();case 3:if($e=Wr.current.form.getFieldsValue(),console.log($e,"value"),!((Cn==null?void 0:Cn.length)<=0)){dn.next=8;break}return i.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),dn.abrupt("return");case 8:return Fn(!0),ot=Bt.params,lt=ot.coursesId,At=ot.categoryId,dn.next=12,Object(sn.a)(yt?"/api/homework_commons/".concat(At,"/update_hack.json"):"/api/courses/".concat(lt,"/homework_commons.json"),{method:yt?"put":"post",body:Object(m.a)(Object(m.a)({},$e),{},{coursesId:lt,category:At,type:5,hack_ids:Cn==null?void 0:Cn.map(function(nr){return nr.id})})});case 12:St=dn.sent,(St==null?void 0:St.status)===0&&x.d.push("/classrooms/".concat(Bt.params.coursesId,"/program_homework/").concat(yt?At:St.homework_id,"/detail?tabs=1")),Fn(!1);case 15:case"end":return dn.stop()}},qe)}));return function(){return it.apply(this,arguments)}}();return _.a.createElement("div",{className:ge.a.page},_.a.createElement("section",null,_.a.createElement("div",{className:ge.a.wrap},ir.course_name&&et&&_.a.createElement("section",{className:"animated fadeIn"},_.a.createElement("aside",{className:"mt10"},ir.category&&_.a.createElement(f.a,{separator:">"},_.a.createElement(f.a.Item,null,_.a.createElement(H.a,{to:"/classrooms/".concat(ir.course_id,"/program_homework")},ir.course_name)),_.a.createElement(f.a.Item,null,_.a.createElement(H.a,{to:"/classrooms/".concat(ir.course_id,"/program_homework")},ir.category.category_name)),_.a.createElement(f.a.Item,null,Tt)))),_.a.createElement("div",{className:ge.a.title},et?Tt:"\u8BD5\u9898\u5E93"),et&&_.a.createElement(Z,{data:$n,ref:Wr}),_.a.createElement("div",{className:ge.a.headerWrapper},_.a.createElement("div",{className:ge.a.tabsWrap},_.a.createElement(j.a,{activeKey:Yn,onChange:Ba,tabBarExtraContent:_.a.createElement("div",{className:ge.a.searchWrap},Yn===Vt.Mine&&Ge&&_.a.createElement(I.a,{className:ge.a.addQuestionBtn,onClick:No},_.a.createElement("img",{src:V.a,className:ge.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),_.a.createElement(rn,{allowClear:!0,suffix:_.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(ge.a.searchIcon),onClick:function(){return ha(Me.keyword)}}),className:ge.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function(qe){Me.keyword=qe.target.value,Yt(Object(m.a)({},Me))},onSearch:ha}))},_.a.createElement(Lt,{tab:"\u516C\u5171",key:"1"}),((Kn=zt.teachGroupData)===null||Kn===void 0||((hn=Kn.groups)===null||hn===void 0)?void 0:hn.length)&&_.a.createElement(Lt,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(Or.o)()&&!Object(Or.m)()&&!et&&_.a.createElement(Lt,{tab:"\u6536\u85CF\u5939",key:"2"}),_.a.createElement(Lt,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),_.a.createElement(X.a,{showSelectAll:!1,className:ge.a.select,disciplinesData:(An=zt.disciplinesData)===null||An===void 0?void 0:An.disciplines,knowledgeData:Qi,directionValue:Me.discipline_id,subDisciplineValue:Me.sub_discipline_id,typeValue:Me.item_type,isprogram_homework:et,showKnowledge:!0,name:ia,setname:wr,difficultyValue:Me.difficulty,showShixun:!Object(Or.m)()&&!Me.exercise_id&&Yn!==Vt.TeachGroupShare&&Yn!==Vt.Public,onShixunChange:Aa,onDirectionChange:Io,onTypeChange:Po,onDifficultyChange:mo,knowledgeValue:qn,onKnowledgeChange:Ja,teachGroupData:(dr=zt.teachGroupData)===null||dr===void 0?void 0:dr.groups,onTeachGroupChange:Ga,teachGroupValue:Me.group_id,showTeachGroup:xa})),_.a.createElement("div",{className:ge.a.treeWrapper,style:{display:Yn===Vt.Mine?"block":"none"}},_.a.createElement("div",{className:ge.a.treeHeader},_.a.createElement(be.a,{data:Kr,onClick:oa}),_.a.createElement(I.a,{type:"link",onClick:io,className:ge.a.exportBtn},_.a.createElement("img",{src:pt.a,alt:"",className:ge.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),_.a.createElement(K.a,{spinning:Si},_.a.createElement("div",{ref:Br,className:ge.a.treeContent},_.a.createElement(kn.a,{isProblemset:Ge,reloadData:Pr,data:Gr,onShare:Ha,onOpen:oa})))),_.a.createElement("div",{className:ge.a.contentWrap},_.a.createElement("div",{className:ge.a.batchWrap},_.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!et&&_.a.createElement("div",{className:"font14"},_.a.createElement(F.a,{overlay:_.a.createElement(p.a,{selectedKeys:[cr]},Ua==null?void 0:Ua.map(function(it,qe){return _.a.createElement(p.a.Item,{key:it.name,onClick:function(){return Oa(it)}},it.name)}))},_.a.createElement("span",{style:{color:"#464F66"}},_.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),cr))),et&&_.a.createElement("div",null,_.a.createElement(u.a,{checked:(jn==null?void 0:jn.filter(function(it){return Cn==null?void 0:Cn.map(function(qe){return qe.id}).includes(it.id)}).length)===jn.length,onChange:function(qe){return sa(qe.target.checked)}},"\u672C\u9875\u5168\u9009",_.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",_e==null?void 0:_e.length,")"))),et&&_.a.createElement(R.a,{visible:Dr,centered:!0,width:700,okText:"\u786E\u8BA4".concat(yt?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return yr(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:Da,confirmLoading:Vn,title:"\u67E5\u770B\u5DF2\u9009"},_.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",Cn==null?void 0:Cn.length,"\u4E2A"),_.a.createElement("div",{style:{height:400,overflow:"auto"}},Cn==null?void 0:Cn.map(function(it,qe){var $e,ot,lt,At,St,wt;return _.a.createElement("div",{key:qe,className:ge.a.sendModal},_.a.createElement("div",{className:ge.a.li},_.a.createElement("p",null,it==null?void 0:it.name),_.a.createElement("div",{className:ge.a.bottom},_.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),_.a.createElement("i",{className:ge.a.line}),_.a.createElement("span",{className:"c-grey-333"},it.difficulty===1&&"\u7B80\u5355",it.difficulty===2&&"\u9002\u4E2D",it.difficulty===3&&"\u56F0\u96BE"),_.a.createElement("i",{className:ge.a.line}),_.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",_.a.createElement(c.a,{title:it==null||(($e=it.author)===null||$e===void 0)?void 0:$e.name},_.a.createElement("span",{className:"c-grey-333"},(it==null||((ot=it.author)===null||ot===void 0||((lt=ot.name)===null||lt===void 0))?void 0:lt.length)>6?(it==null||((At=it.author)===null||At===void 0||((St=At.name)===null||St===void 0))?void 0:St.substr(0,3))+"...":it==null||((wt=it.author)===null||wt===void 0)?void 0:wt.name))),_.a.createElement("i",{className:ge.a.line}),_.a.createElement("span",{className:ge.a.des},"\u66F4\u65B0\xA0",_.a.createElement("span",{className:"c-grey-333"},it==null?void 0:it.updated_at)))),_.a.createElement("div",{className:ge.a.del,onClick:function(){bi(Cn.filter(function(nr){return nr.id!==it.id}).map(function(nr){return nr.id}))}},"\u5220\u9664"))})))),_.a.createElement("div",null,Yn===Vt.Mine&&Ge&&_.a.createElement(I.a,{onClick:_r,type:"link",className:ge.a.exportBtn},_.a.createElement("img",{src:Q.a,className:ge.a.pngIcon}),_.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?_.a.createElement("div",null,_.a.createElement(I.a,{style:{paddingLeft:0},onClick:function(){Me.page=1,Me.keyword=null,delete Me.id,Yt(Me),Qa(!1),ei(Me)},type:"link"}," ",_.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),_.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",decodeURIComponent(Me.keyword),"\u201D")):null,_.a.createElement("div",{className:ge.a.contentListWrap},Rn!==0?_.a.createElement(K.a,{size:"large",spinning:Un["problemset/getItemBanks"]},jn.map(function(it,qe){var $e,ot;return _.a.createElement("div",{className:ge.a.li},_.a.createElement("div",{className:ge.a.top},_.a.createElement(pr.b,{key:it.id,data:it,selectIds:_e,onSelectCheckBox:bi})),_.a.createElement("div",{className:ge.a.bottom},_.a.createElement("p",{className:"".concat(ge.a.actionLeftItem," ").concat(ge.a.questionTypeName)},($e=Ra.find(function(lt){return lt.type===it.item_type}))===null||$e===void 0?void 0:$e.name),_.a.createElement("p",{className:ge.a.actionLeftItem},la[it.difficulty]),_.a.createElement("p",{className:ge.a.actionLeftItem},"\u521B\u5EFA\u8005",_.a.createElement("span",{className:"c-grey-333"},it==null||((ot=it.author)===null||ot===void 0)?void 0:ot.name)),_.a.createElement("p",{className:ge.a.actionLeftItem},"\u66F4\u65B0",_.a.createElement("span",{className:"c-grey-333"},it==null?void 0:it.updated_at)),_.a.createElement("p",{className:ge.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",_.a.createElement("span",{className:"c-grey-333"},it==null?void 0:it.quotes)),!et&&_.a.createElement("div",{className:ge.a.more},li({},it))))})):_.a.createElement(K.a,{size:"large",spinning:Un["problemset/getItemBanks"]},_.a.createElement(J.a,null))),Rn!==0&&!et&&_.a.createElement(z.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:Me==null?void 0:Me.per_page,current:Me.page||1,total:Rn,showTotal:function(qe){return _.a.createElement("span",{className:"mr10"},"\u5171",_.a.createElement("span",{className:"c-light-primary"},qe),"\u6761\u6570\u636E")}}),et&&_.a.createElement("div",{style:{height:20}})),Ge&&_.a.createElement(tn,{basketData:zt.basketData,visible:Ca,basketTotal:ya,onClose:function(){return ho(!1)},onDelete:Mo}),!Object(Or.m)()&&Ge&&_.a.createElement(Cr,{visibleBasket:Ca,onToggleVisible:function(){return ho(!Ca)},count:ya})),_.a.createElement(pe,null),_.a.createElement(Ue,{onReloadData:Pr}),_.a.createElement(st,{onReloadData:function(){return ki([null])}}),_.a.createElement(Kt,{onReloadData:Pr,onReloadBasketData:Yi}),Nn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?_.a.createElement(fi,{shixunIds:ie,cb:Zr}):null,_.a.createElement(gt,null),_.a.createElement(Je,null),_.a.createElement(Ot,null),_.a.createElement(ft,null),_.a.createElement(He,null),_.a.createElement(Re,{onOk:yo}),_.a.createElement(ee.a,{onOk:za})),Ge?_.a.createElement(N.Fragment,null,!!(_e!=null&&_e.length)&&_.a.createElement("div",{className:ge.a.batch},_.a.createElement("aside",null,_.a.createElement("div",{style:{flexShrink:0,marginRight:20}},_.a.createElement(u.a,{className:"font14",checked:jn!=null&&jn.length?_e.length===(jn==null?void 0:jn.length):!1,onChange:function(qe){return sa(qe.target.checked)}},"\u672C\u9875\u5168\u9009",_.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",_e==null?void 0:_e.length,")"))),_.a.createElement("div",{className:ge.a.btns},Wn&&_.a.createElement("div",{className:ge.a.btn,onClick:function(){return ti(!0)}},_.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Wn&&_.a.createElement("div",{className:ge.a.btn,onClick:function(){return ti(!1)}},_.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),Yn===Vt.Mine&&_.a.createElement("div",{className:ge.a.btn,onClick:function(){return ro()}},_.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),Yn===Vt.Mine&&_.a.createElement("div",{className:ge.a.btn,onClick:ao}," ",_.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Yn===Vt.Mine&&_.a.createElement("div",{className:ge.a.btn,onClick:function(){return Ha()}}," ",_.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),Yn===Vt.Mine&&_.a.createElement("div",{className:ge.a.btn,onClick:Mi}," ",_.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),Yn===Vt.Mine&&_.a.createElement("div",{className:ge.a.btn,onClick:or}," ",_.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),_.a.createElement("div",{onClick:function(){return Be([])},style:{marginLeft:"auto"},className:ge.a.btn}," ",_.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):et?"":_.a.createElement("div",{className:ge.a.batch},_.a.createElement("aside",null,_.a.createElement("div",{style:{flexShrink:0,marginRight:20}},_.a.createElement(u.a,{className:"font14",checked:jn!=null&&jn.length?_e.length===(jn==null?void 0:jn.length):!1,onChange:function(qe){return sa(qe.target.checked)}},"\u672C\u9875\u5168\u9009",_.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",_e==null?void 0:_e.length,")"))),_.a.createElement("div",{className:ge.a.btns},Wn&&!!(_e!=null&&_e.length)&&_.a.createElement("div",{className:ge.a.btn,onClick:function(){return ti(!0)}},_.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Wn&&!!(_e!=null&&_e.length)&&_.a.createElement("div",{className:ge.a.btn,onClick:function(){return ti(!1)}},_.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),_.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",Qt,"\u9898"),_.a.createElement("div",{onClick:ea,className:ge.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),et&&_.a.createElement("div",{className:ge.a.batch},_.a.createElement("aside",null,_.a.createElement("div",{style:{flexShrink:0,marginRight:20}},_.a.createElement(z.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:Me==null?void 0:Me.per_page,current:Me.page||1,hideOnSinglePage:!0,total:Rn,showTotal:function(qe){return _.a.createElement("span",{className:"mr10"},"\u5171",_.a.createElement("span",{className:"c-light-primary"},qe),"\u6761\u6570\u636E")}})),_.a.createElement("div",{className:ge.a.btns},_.a.createElement(Y.a,{align:"middle",style:{marginLeft:"auto"}},_.a.createElement(Y.a,{onClick:function(){if((Cn==null?void 0:Cn.length)<=0){i.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}yr(!0)},align:"middle",className:"current"},_.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),_.a.createElement("span",null,"\u5DF2\u9009",_.a.createElement("span",{className:"c-light-primary"},_e.length),"\u4E2A")),_.a.createElement(I.a,{className:"mr20 ml40",onClick:function(){if(yt){var qe;x.d.push("/classrooms/".concat(Bt.params.coursesId,"/program_homework/").concat(Bt==null||((qe=Bt.params)===null||qe===void 0)?void 0:qe.categoryId,"/detail?tabs=1"));return}x.d.push("/classrooms/".concat(Bt.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),_.a.createElement(I.a,{loading:Vn,onClick:Da,type:"primary"},"\u786E\u8BA4",yt?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Lr=ve.default=Object(x.a)(function(Zt){var mt=Zt.classroomList,Pt=Zt.problemset,Rt=Zt.user,Gt=Zt.loading,cn=Zt.globalSetting,Tn=Zt.shixunHomeworks;return{classroomList:mt,problemset:Pt,user:Rt,globalSetting:cn,loading:Gt.effects,shixunHomeworks:Tn}})(fr)},JYp7:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return ne});var ne;(function(Y){function M(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}Y.is=M;const z=Object.freeze([]);function P(){return z}Y.empty=P;function*F(i){yield i}Y.single=F;function G(i){return i||z}Y.from=G;function K(i){return!i||i[Symbol.iterator]().next().done===!0}Y.isEmpty=K;function n(i){return i[Symbol.iterator]().next().value}Y.first=n;function I(i,D){for(const A of i)if(D(A))return!0;return!1}Y.some=I;function b(i,D){for(const A of i)if(D(A))return A;return}Y.find=b;function*f(i,D){for(const A of i)D(A)&&(yield A)}Y.filter=f;function*y(i,D){let A=0;for(const S of i)yield D(S,A++)}Y.map=y;function*c(...i){for(const D of i)for(const A of D)yield A}Y.concat=c;function*a(i){for(const D of i)for(const A of D)yield A}Y.concatNested=a;function p(i,D,A){let S=A;for(const R of i)S=D(S,R);return S}Y.reduce=p;function*l(i,D,A=i.length){for(D<0&&(D+=i.length),A<0?A+=i.length:A>i.length&&(A=i.length);D<A;D++)yield i[D]}Y.slice=l;function u(i,D=Number.POSITIVE_INFINITY){const A=[];if(D===0)return[A,i];const S=i[Symbol.iterator]();for(let R=0;R<D;R++){const O=S.next();if(O.done)return[A,Y.empty()];A.push(O.value)}return[A,{[Symbol.iterator](){return S}}]}Y.consume=u;function s(i,D,A=(S,R)=>S===R){const S=i[Symbol.iterator](),R=D[Symbol.iterator]();for(;;){const O=S.next(),m=R.next();if(O.done!==m.done)return!1;if(O.done)return!0;if(!A(O.value,m.value))return!1}}Y.equals=s})(ne||(ne={}))},LE3n:function(ut,ve,U){"use strict";var ne=U("ozfa"),Y=U("MJZm"),M=U("k1fw"),z=U("+L6B"),P=U("2/Rp"),F=U("5NDa"),G=U("5rEg"),K=U("2qtc"),n=U("kLXV"),I=U("miYZ"),b=U("tsqr"),f=U("9og8"),y=U("tJVT"),c=U("WmNS"),a=U.n(c),p=U("q1tI"),l=U.n(p),u=U("1vnw"),s=U.n(u),i=U("ErOA"),D=U("Ix/O"),A=U.n(D),S=U("xTzM"),R=U.n(S),O=U("WCUW"),m=U("LvDl"),v=U.n(m),h=function(E){var w=E.isProblemset,j=E.name,W=E.id,T=E.itemBanksCount,N=E.onOpen,_=N===void 0?function(){}:N,x=E.onShare,H=x===void 0?function(){}:x,X=E.onMove,ee=X===void 0?function(){}:X,J=E.onDeleteOk,ce=J===void 0?function(){}:J,me=Object(p.useState)(!1),ue=Object(y.a)(me,2),pe=ue[0],xe=ue[1],se=Object(p.useState)(j),ae=Object(y.a)(se,2),Ce=ae[0],ze=ae[1],Ye=Object(p.useState)(j),He=Object(y.a)(Ye,2),Ve=He[0],Fe=He[1],Ke=function(){var he=Object(f.a)(a.a.mark(function Re(Ne){var Ue,rt,st;return a.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(Ue=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],Ve.trim()){at.next=4;break}return b.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),at.abrupt("return");case 4:if(!(Ve.charAt(0)===" ")){at.next=7;break}return b.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),at.abrupt("return");case 7:rt=0;case 8:if(!(rt<Ve.length)){at.next=15;break}if(!Ue.includes(Ve.charAt(rt))){at.next=12;break}return b.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),at.abrupt("return",!1);case 12:rt++,at.next=8;break;case 15:return at.next=17,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(Ne),".json"),{method:"put",body:{name:Ve}});case 17:st=at.sent,st.status===0&&(xe(!1),ze(Ve));case 19:case"end":return at.stop()}},Re)}));return function(Ne){return he.apply(this,arguments)}}(),nt=function(Re){n.a.confirm({title:"\u63D0\u793A",okText:"\u786E\u8BA4\u5220\u9664",className:"custom-modal-divider ",icon:null,content:l.a.createElement("div",null,l.a.createElement("p",null,"\u672C\u6B21\u5220\u9664\u64CD\u4F5C\u786E\u5B9A\u540E\u5185\u5BB9\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F"),l.a.createElement("p",null,"\u5220\u9664\u6587\u4EF6\u5939\uFF0C\u5C06\u540C\u6B65\u5220\u9664\u5176\u6240\u5305\u542B\u7684\u5168\u90E8\u5B50\u6587\u4EF6\u5939\u548C\u8BD5\u9898\uFF0C\u8BF7\u614E\u91CD\u64CD\u4F5C\uFF01")),cancelText:"\u53D6\u6D88",onOk:function(){var Ne=Object(f.a)(a.a.mark(function rt(){var st;return a.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:return at.next=2,Object(i.a)("/api/item_banks_groups/".concat(Math.abs(Re),".json"),{method:"delete",body:{}});case 2:st=at.sent,st.status===0&&ce(Re);case 4:case"end":return at.stop()}},rt)}));function Ue(){return Ne.apply(this,arguments)}return Ue}()})};return l.a.createElement("div",{className:s.a.list},pe?l.a.createElement(G.a,{style:{maxWidth:780},value:Ve,onChange:function(Re){return Fe(Re.target.value)}}):l.a.createElement("div",{title:Ce,onClick:function(){return _(W)},className:s.a.name},Ce),w&&l.a.createElement("div",{className:s.a.btns},pe?l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{style:{height:16},onClick:function(){return Ke(W)},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-chenggong1",style:{color:"#33BD8C"}})),l.a.createElement("div",{style:{height:16},onClick:function(){Fe(Ce),xe(!1)},className:"ml10"},l.a.createElement("i",{className:"iconfont icon-qingchu"}))):l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{onClick:function(){return ee(W,"up")},className:"ml0"},l.a.createElement("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})),l.a.createElement("div",{onClick:function(){return ee(W,"down")},className:"ml10",style:{transform:"rotate(180deg) translateY(1px)"}},l.a.createElement("i",{className:"iconfont icon-shangyi3"}))),l.a.createElement(P.a,{className:"ml10",onClick:function(){if(!T){b.b.warn("\u8BE5\u76EE\u5F55\u4E0B\u6CA1\u6709\u8BD5\u9898");return}H(Math.abs(W))},type:"link"},"\u5171\u4EAB\u5168\u90E8\u8BD5\u9898"),l.a.createElement(P.a,{className:"ml10",onClick:function(){return xe(!0)},type:"link"},"\u91CD\u547D\u540D"),l.a.createElement(P.a,{onClick:function(){return nt(W)},type:"link",danger:!0},"\u5220\u9664")))},d=function(E){var w=E.isProblemset,j=E.data,W=E.onOpen,T=W===void 0?function(){}:W,N=E.onShare,_=N===void 0?function(){}:N,x=E.reloadData,H=Object(p.useState)(),X=Object(y.a)(H,2),ee=X[0],J=X[1];Object(p.useEffect)(function(){J(j==null?void 0:j.map(function(Ce){return{title:l.a.createElement(h,{isProblemset:w,name:Ce.name,id:Ce.id,itemBanksCount:Ce.item_banks_count,onMove:me,onOpen:T,onShare:_,onDeleteOk:pe}),key:Ce.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}}))},[j]);var ce=function Ce(ze,Ye,He){for(var Ve=Object(m.cloneDeep)(ze),Fe=0;Fe<Ve.length;Fe++){if(Ve[Fe].key===Ye){if(He==="up"){var Ke=[Ve[Fe],Ve[Fe-1]];Ve[Fe-1]=Ke[0],Ve[Fe]=Ke[1]}else{var nt=[Ve[Fe+1],Ve[Fe]];Ve[Fe]=nt[0],Ve[Fe+1]=nt[1]}break}Ve[Fe].children&&(Ve[Fe].children=Ce(Ve[Fe].children,Ye,He))}return Ve},me=function(){var Ce=Object(f.a)(a.a.mark(function ze(Ye,He){var Ve;return a.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:if(!(He==="up")){Ke.next=6;break}return Ke.next=3,Object(O.I)({id:Math.abs(Ye)});case 3:Ke.t0=Ke.sent,Ke.next=9;break;case 6:return Ke.next=8,Object(O.H)({id:Math.abs(Ye)});case 8:Ke.t0=Ke.sent;case 9:Ve=Ke.t0,Ve.status===0&&J(function(nt){return ce(nt,Ye,He)});case 11:case"end":return Ke.stop()}},ze)}));return function(Ye,He){return Ce.apply(this,arguments)}}(),ue=function Ce(ze,Ye){return ze.filter(function(He){return He.key===Ye?!1:(He.children&&(He.children=Ce(He.children,Ye)),!0)})},pe=function(ze){J(function(Ye){return ue(Ye,ze)}),x()},xe=function Ce(ze,Ye,He){return ze.map(function(Ve){return Ve.key===Ye?Object(M.a)(Object(M.a)({},Ve),He):Ve.children?Object(M.a)(Object(M.a)({},Ve),{},{children:Ce(Ve.children,Ye,He)}):Ve})},se=function(){var Ce=Object(f.a)(a.a.mark(function ze(Ye){var He,Ve,Fe,Ke,nt;return a.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return He=Ye.key,Re.next=3,Object(O.B)({group_id:Math.abs(He)});case 3:Ve=Re.sent,Fe=Ve||{},Ke=Fe.item_banks_group,nt=Fe.item_banks_group_count,nt>0?J(function(Ne){return xe(Ne,He,{children:Ke.map(function(Ue){return{title:l.a.createElement(h,{isProblemset:w,name:Ue.name,id:Ue.id,itemBanksCount:Ue.item_banks_count,onMove:me,onOpen:T,onShare:_,onDeleteOk:pe}),key:Ue.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}})})}):J(function(Ne){return xe(Ne,He,{isLeaf:!0})});case 6:case"end":return Re.stop()}},ze)}));return function(Ye){return Ce.apply(this,arguments)}}(),ae=function(ze,Ye){var He=Ye.node,Ve=Ye.expanded;J(function(Fe){return xe(Fe,He.key,{icon:Ve?l.a.createElement("img",{src:R.a,className:s.a.folderIcon}):l.a.createElement("img",{src:A.a,className:s.a.folderIcon})})})};return(ee==null?void 0:ee.length)>0&&l.a.createElement(Y.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:ee,loadData:se,onExpand:ae,className:s.a.folderWrapper,selectable:!1})};ve.a=d},LdHM:function(ut,ve,U){"use strict";U.d(ve,"b",function(){return i}),U.d(ve,"a",function(){return A});var ne=U("1OyB"),Y=U("vuIU"),M=U("Ji7U"),z=U("LK+K"),P=U("q1tI"),F=U("rePB"),G=U("Ff2n"),K=U("ODXe"),n=U("4IlW"),I=U("bX4T"),b=U("YrtM"),f=U("TSYQ"),y=U.n(f),c=U("+nKL"),a=U("8OUc"),p=function(H,X){var ee=H.prefixCls,J=H.id,ce=H.flattenOptions,me=H.childrenAsData,ue=H.values,pe=H.searchValue,xe=H.multiple,se=H.defaultActiveFirstOption,ae=H.height,Ce=H.itemHeight,ze=H.notFoundContent,Ye=H.open,He=H.menuItemSelectedIcon,Ve=H.virtual,Fe=H.onSelect,Ke=H.onToggleOpen,nt=H.onActiveValue,he=H.onScroll,Re=H.onMouseEnter,Ne="".concat(ee,"-item"),Ue=Object(b.a)(function(){return ce},[Ye,ce],function(ft,be){return be[0]&&ft[1]!==be[1]}),rt=P.useRef(null),st=function(be){be.preventDefault()},dt=function(be){rt.current&&rt.current.scrollTo({index:be})},at=function(be){for(var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ge=Ue.length,de=0;de<ge;de+=1){var fe=(be+de*Ee+ge)%ge,we=Ue[fe],De=we.group,ke=we.data;if(!De&&!ke.disabled)return fe}return-1},bt=P.useState(function(){return at(0)}),gt=Object(K.a)(bt,2),xt=gt[0],Je=gt[1],kt=function(be){Je(be);var Ee=Ue[be];if(!Ee){nt(null,-1);return}nt(Ee.data.value,be)};P.useEffect(function(){kt(se!==!1?at(0):-1)},[Ue.length,pe]),P.useEffect(function(){var ft=setTimeout(function(){if(!xe&&Ye&&ue.size===1){var be=Array.from(ue)[0],Ee=Ue.findIndex(function(ge){var de=ge.data;return de.value===be});kt(Ee),dt(Ee)}});return function(){return clearTimeout(ft)}},[Ye]);var Ot=function(be){be!==void 0&&Fe(be,{selected:!ue.has(be)}),xe||Ke(!1)};if(P.useImperativeHandle(X,function(){return{onKeyDown:function(be){var Ee=be.which;switch(Ee){case n.a.UP:case n.a.DOWN:{var ge=0;if(Ee===n.a.UP?ge=-1:Ee===n.a.DOWN&&(ge=1),ge!==0){var de=at(xt+ge,ge);dt(de),kt(de)}break}case n.a.ENTER:{var fe=Ue[xt];fe&&!fe.data.disabled?Ot(fe.data.value):Ot(void 0),Ye&&be.preventDefault();break}case n.a.ESC:Ke(!1)}},onKeyUp:function(){},scrollTo:function(be){dt(be)}}}),Ue.length===0)return P.createElement("div",{role:"listbox",id:"".concat(J,"_list"),className:"".concat(Ne,"-empty"),onMouseDown:st},ze);function tt(ft){var be=Ue[ft];if(!be)return null;var Ee=be.data||{},ge=Ee.value,de=Ee.label,fe=Ee.children,we=Object(I.a)(Ee,!0),De=me?fe:de;return be?P.createElement("div",Object.assign({"aria-label":typeof De=="string"?De:null},we,{key:ft,role:"option",id:"".concat(J,"_list_").concat(ft),"aria-selected":ue.has(ge)}),ge):null}return P.createElement(P.Fragment,null,P.createElement("div",{role:"listbox",id:"".concat(J,"_list"),style:{height:0,width:0,overflow:"hidden"}},tt(xt-1),tt(xt),tt(xt+1)),P.createElement(c.a,{itemKey:"key",ref:rt,data:Ue,height:ae,itemHeight:Ce,fullHeight:!1,onMouseDown:st,onScroll:he,virtual:Ve,onMouseEnter:Re},function(ft,be){var Ee,ge=ft.group,de=ft.groupOption,fe=ft.data,we=fe.label,De=fe.key;if(ge)return P.createElement("div",{className:y()(Ne,"".concat(Ne,"-group"))},we!==void 0?we:De);var ke=fe.disabled,Ze=fe.value,ht=fe.title,Ut=fe.children,nn=fe.style,tn=fe.className,_n=Object(G.a)(fe,["disabled","value","title","children","style","className"]),bn=ue.has(Ze),Kt="".concat(Ne,"-option"),rr=y()(Ne,Kt,tn,(Ee={},Object(F.a)(Ee,"".concat(Kt,"-grouped"),de),Object(F.a)(Ee,"".concat(Kt,"-active"),xt===be&&!ke),Object(F.a)(Ee,"".concat(Kt,"-disabled"),ke),Object(F.a)(Ee,"".concat(Kt,"-selected"),bn),Ee)),Ln=me?Ut:we,Cr=!He||typeof He=="function"||bn;return P.createElement("div",Object.assign({},_n,{"aria-selected":bn,className:rr,title:ht,onMouseMove:function(){if(xt===be||ke)return;kt(be)},onClick:function(){ke||Ot(Ze)},style:nn}),P.createElement("div",{className:"".concat(Kt,"-content")},Ln||Ze),P.isValidElement(He)||bn,Cr&&P.createElement(a.a,{className:"".concat(Ne,"-option-state"),customizeIcon:He,customizeIconProps:{isSelected:bn}},bn?"\u2713":null))}))},l=P.forwardRef(p);l.displayName="OptionList";var u=l,s=function(){return null};s.isSelectOption=!0;var i=s,D=function(){return null};D.isSelectOptGroup=!0;var A=D,S=U("VTBJ"),R=U("Zm9Q");function O(x){var H=x.key,X=x.props,ee=X.children,J=X.value,ce=Object(G.a)(X,["children","value"]);return Object(S.a)({key:H,value:J!==void 0?J:H,children:ee},ce)}function m(x){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(x).map(function(X,ee){if(!P.isValidElement(X)||!X.type)return null;var J=X.type.isSelectOptGroup,ce=X.key,me=X.props,ue=me.children,pe=Object(G.a)(me,["children"]);return H||!J?O(X):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(ce===null?ee:ce,"__"),label:ce},pe),{},{options:m(ue)})}).filter(function(X){return X})}var v=U("2Qr1"),h=U("qNPg"),d=U("U8pU"),C=U("Kwbf"),E=U("WKfj");function w(x){var H=x.mode,X=x.options,ee=x.children,J=x.backfill,ce=x.allowClear,me=x.placeholder,ue=x.getInputElement,pe=x.showSearch,xe=x.onSearch,se=x.defaultOpen,ae=x.autoFocus,Ce=x.labelInValue,ze=x.value,Ye=x.inputValue,He=x.optionLabelProp,Ve=H==="multiple"||H==="tags",Fe=pe!==void 0?pe:Ve||H==="combobox",Ke=X||m(ee);if(Object(C.a)(H!=="tags"||Ke.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var nt=Ke.some(function(Ne){return Ne.options?Ne.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(C.a)(!nt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!J,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!ue||!ce||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xe&&!Fe&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!se||ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ze!=null){var he=Object(E.d)(ze);Object(C.a)(!Ce||he.every(function(Ne){return Object(d.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!Ve||Array.isArray(ze),"`value` should be array when `mode` is `multiple` or `tags`")}if(ee){var Re=null;Object(R.a)(ee).some(function(Ne){if(!P.isValidElement(Ne)||!Ne.type)return!1;var Ue=Ne.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var rt=Object(R.a)(Ne.props.children).every(function(st){return!P.isValidElement(st)||!Ne.type||st.type.isSelectOption?!0:(Re=st.type,!1)});return!rt}return Re=Ue,!0}),Re&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Re.displayName||Re.name||Re,"`.")),Object(C.a)(Ye===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=w,W=Object(h.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:m,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:j,fillOptionsWithMissingValue:v.a}),T=function(x){Object(M.a)(X,x);var H=Object(z.a)(X);function X(){var ee;return Object(ne.a)(this,X),ee=H.apply(this,arguments),ee.selectRef=P.createRef(),ee.focus=function(){ee.selectRef.current.focus()},ee.blur=function(){ee.selectRef.current.blur()},ee}return Object(Y.a)(X,[{key:"render",value:function(){return P.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),X}(P.Component);T.Option=i,T.OptGroup=A;var N=T,_=ve.c=N},M8RZ:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return n});var ne=U("fWQN"),Y=U("mtLc"),M=U("yKVA"),z=U("879j"),P=U("q1tI"),F=U.n(P),G=U("i8i4"),K=U.n(G),n=function(I){Object(M.a)(f,I);var b=Object(z.a)(f);function f(y){var c;Object(ne.a)(this,f),c=b.call(this,y);var a=window.document;return c.node=a.createElement("div"),a.body.appendChild(c.node),c}return Object(Y.a)(f,[{key:"render",value:function(){var c=this.props.children;return Object(G.createPortal)(c,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(F.a.Component)},MI8n:function(ut,ve,U){"use strict";U.d(ve,"c",function(){return P}),U.d(ve,"b",function(){return n}),U.d(ve,"e",function(){return I}),U.d(ve,"a",function(){return b}),U.d(ve,"d",function(){return f}),U.d(ve,"f",function(){return y});var ne=U("/cxE"),Y=U("pmY6"),M=U("24hK"),z=U("5Y4S"),P;(function(c){c.None=()=>Y.a.None;function a(w){return(j,W=null,T)=>{let N=!1,_;return _=w(x=>N?void 0:(_?_.dispose():N=!0,j.call(W,x)),null,T),N&&_.dispose(),_}}c.once=a;function p(w,j){return A((W,T=null,N)=>w(_=>W.call(T,j(_)),null,N))}c.map=p;function l(w,j){return A((W,T=null,N)=>w(_=>{j(_),W.call(T,_)},null,N))}c.forEach=l;function u(w,j){return A((W,T=null,N)=>w(_=>j(_)&&W.call(T,_),null,N))}c.filter=u;function s(w){return w}c.signal=s;function i(...w){return(j,W=null,T)=>Object(Y.e)(...w.map(N=>N(_=>j.call(W,_),null,T)))}c.any=i;function D(w,j,W){let T=W;return p(w,N=>(T=j(T,N),T))}c.reduce=D;function A(w){let j;const W=new n({onFirstListenerAdd(){j=w(W.fire,W)},onLastListenerRemove(){j.dispose()}});return W.event}function S(w,j,W=100,T=!1,N){let _,x,H,X=0;const ee=new n({leakWarningThreshold:N,onFirstListenerAdd(){_=w(J=>{X++,x=j(x,J),T&&!H&&(ee.fire(x),x=void 0),clearTimeout(H),H=setTimeout(()=>{const ce=x;x=void 0,H=void 0,(!T||X>1)&&ee.fire(ce),X=0},W)})},onLastListenerRemove(){_.dispose()}});return ee.event}c.debounce=S;function R(w,j=(W,T)=>W===T){let W=!0,T;return u(w,N=>{const _=W||!j(N,T);return W=!1,T=N,_})}c.latch=R;function O(w,j){return[c.filter(w,j),c.filter(w,W=>!j(W))]}c.split=O;function m(w,j=!1,W=[]){let T=W.slice(),N=w(H=>{T?T.push(H):x.fire(H)});const _=()=>{T&&T.forEach(H=>x.fire(H)),T=null},x=new n({onFirstListenerAdd(){N||(N=w(H=>x.fire(H)))},onFirstListenerDidAdd(){T&&(j?setTimeout(_):_())},onLastListenerRemove(){N&&N.dispose(),N=null}});return x.event}c.buffer=m;class v{constructor(w){this.event=w}map(w){return new v(p(this.event,w))}forEach(w){return new v(l(this.event,w))}filter(w){return new v(u(this.event,w))}reduce(w,j){return new v(D(this.event,w,j))}latch(){return new v(R(this.event))}debounce(w,j=100,W=!1,T){return new v(S(this.event,w,j,W,T))}on(w,j,W){return this.event(w,j,W)}once(w,j,W){return a(this.event)(w,j,W)}}function h(w){return new v(w)}c.chain=h;function d(w,j,W=T=>T){const T=(...H)=>x.fire(W(...H)),N=()=>w.on(j,T),_=()=>w.removeListener(j,T),x=new n({onFirstListenerAdd:N,onLastListenerRemove:_});return x.event}c.fromNodeEventEmitter=d;function C(w,j,W=T=>T){const T=(...H)=>x.fire(W(...H)),N=()=>w.addEventListener(j,T),_=()=>w.removeEventListener(j,T),x=new n({onFirstListenerAdd:N,onLastListenerRemove:_});return x.event}c.fromDOMEventEmitter=C;function E(w){return new Promise(j=>a(w)(j))}c.toPromise=E})(P||(P={}));class F{constructor(c){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${c}_${F._idPool++}`}start(c){this._stopWatch=new z.a(!0),this._listenerCount=c}stop(){if(this._stopWatch){const c=this._stopWatch.elapsed();this._elapsedOverall+=c,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${c.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}F._idPool=0;let G=-1;class K{constructor(c,a=Math.random().toString(18).slice(2,5)){this.customThreshold=c,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(c){let a=G;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||c<a)return;this._stacks||(this._stacks=new Map);const p=new Error().stack.split(`
`).slice(3).join(`
`),l=this._stacks.get(p)||0;if(this._stacks.set(p,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let u,s=0;for(const[i,D]of this._stacks)(!u||s<D)&&(u=i,s=D);console.warn(`[${this.name}] potential listener LEAK detected, having ${c} listeners already. MOST frequent listener (${s}):`),console.warn(u)}return()=>{const u=this._stacks.get(p)||0;this._stacks.set(p,u-1)}}}class n{constructor(c){var a;this._disposed=!1,this._options=c,this._leakageMon=G>0?new K(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new F(this._options._profName):void 0}get event(){return this._event||(this._event=(c,a,p)=>{var l;this._listeners||(this._listeners=new M.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(a?[c,a]:c);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,c,a);const i=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),D=Object(Y.i)(()=>{if(i&&i(),!this._disposed&&(s(),this._options&&this._options.onLastListenerRemove)){const A=this._listeners&&!this._listeners.isEmpty();A||this._options.onLastListenerRemove(this)}});return p instanceof Y.b?p.add(D):Array.isArray(p)&&p.push(D),D}),this._event}fire(c){var a,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new M.a);for(let l of this._listeners)this._deliveryQueue.push([l,c]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,u]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,u):l[0].call(l[1],u)}catch(s){Object(ne.f)(s)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var c,a,p,l,u;this._disposed||(this._disposed=!0,(c=this._listeners)===null||c===void 0||c.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(l=(p=this._options)===null||p===void 0?void 0:p.onLastListenerRemove)===null||l===void 0||l.call(p),(u=this._leakageMon)===null||u===void 0||u.dispose())}}class I extends n{constructor(c){super(c);this._isPaused=0,this._eventQueue=new M.a,this._mergeFn=c==null?void 0:c.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const c=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(c))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(c){this._listeners&&(this._isPaused!==0?this._eventQueue.push(c):super.fire(c))}}class b extends I{constructor(c){var a;super(c);this._delay=(a=c.delay)!==null&&a!==void 0?a:100}fire(c){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(c)}}class f{constructor(){this.buffers=[]}wrapEvent(c){return(a,p,l)=>c(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>a.call(p,u)):a.call(p,u)},void 0,l)}bufferEvents(c){const a=[];this.buffers.push(a);const p=c();return this.buffers.pop(),a.forEach(l=>l()),p}}class y{constructor(){this.listening=!1,this.inputEvent=P.None,this.inputEventListener=Y.a.None,this.emitter=new n({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(c){this.inputEvent=c,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=c(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ut,ve,U){"use strict";(function(ne,Y){U.d(ve,"b",function(){return p}),U.d(ve,"i",function(){return i}),U.d(ve,"f",function(){return D}),U.d(ve,"d",function(){return A}),U.d(ve,"g",function(){return S}),U.d(ve,"h",function(){return R}),U.d(ve,"c",function(){return O}),U.d(ve,"k",function(){return m}),U.d(ve,"j",function(){return v}),U.d(ve,"a",function(){return h}),U.d(ve,"e",function(){return E});var M;const z="en";let P=!1,F=!1,G=!1,K=!1,n=!1,I=!1,b=!1,f,y=z,c,a;const p=typeof self=="object"?self:typeof ne=="object"?ne:{};let l;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?l=p.vscode.process:typeof Y!="undefined"&&(l=Y);const u=typeof((M=l==null?void 0:l.versions)===null||M===void 0?void 0:M.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)a=navigator.userAgent,P=a.indexOf("Windows")>=0,F=a.indexOf("Macintosh")>=0,b=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=a.indexOf("Linux")>=0,I=!0,f=navigator.language,y=f;else if(typeof l=="object"){P=l.platform==="win32",F=l.platform==="darwin",G=l.platform==="linux",K=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,f=z,y=z;const w=l.env.VSCODE_NLS_CONFIG;if(w)try{const j=JSON.parse(w),W=j.availableLanguages["*"];f=j.locale,y=W||z,c=j._translationsConfigFile}catch(j){}n=!0}else console.error("Unable to resolve platform.");let s=0;F?s=1:P?s=3:G&&(s=2);const i=P,D=F,A=G,S=n,R=I,O=b,m=a,v=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let W=[];p.addEventListener("message",N=>{if(N.data&&N.data.vscodeSetImmediateId)for(let _=0,x=W.length;_<x;_++){const H=W[_];if(H.id===N.data.vscodeSetImmediateId){W.splice(_,1),H.callback();return}}});let T=0;return N=>{const _=++T;W.push({id:_,callback:N}),p.postMessage({vscodeSetImmediateId:_},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const j=Promise.resolve();return W=>j.then(W)}(),h=F||b?2:P?1:3;let d=!0,C=!1;function E(){if(!C){C=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const j=new Uint16Array(w.buffer);d=j[0]===(2<<8)+1}return d}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(ut,ve,U){"use strict";U.d(ve,"C",function(){return ne}),U.d(ve,"v",function(){return M}),U.d(ve,"s",function(){return z}),U.d(ve,"t",function(){return P}),U.d(ve,"U",function(){return F}),U.d(ve,"J",function(){return G}),U.d(ve,"O",function(){return K}),U.d(ve,"p",function(){return n}),U.d(ve,"T",function(){return I}),U.d(ve,"q",function(){return b}),U.d(ve,"N",function(){return f}),U.d(ve,"M",function(){return y}),U.d(ve,"Q",function(){return c}),U.d(ve,"u",function(){return a}),U.d(ve,"x",function(){return p}),U.d(ve,"I",function(){return l}),U.d(ve,"f",function(){return u}),U.d(ve,"h",function(){return s}),U.d(ve,"g",function(){return i}),U.d(ve,"i",function(){return D}),U.d(ve,"G",function(){return A}),U.d(ve,"H",function(){return S}),U.d(ve,"r",function(){return R}),U.d(ve,"R",function(){return O}),U.d(ve,"d",function(){return m}),U.d(ve,"e",function(){return v}),U.d(ve,"E",function(){return h}),U.d(ve,"F",function(){return d}),U.d(ve,"j",function(){return C}),U.d(ve,"z",function(){return E}),U.d(ve,"K",function(){return j}),U.d(ve,"L",function(){return W}),U.d(ve,"m",function(){return N}),U.d(ve,"k",function(){return x}),U.d(ve,"A",function(){return X}),U.d(ve,"a",function(){return ee}),U.d(ve,"n",function(){return J}),U.d(ve,"l",function(){return ce}),U.d(ve,"D",function(){return me}),U.d(ve,"B",function(){return ue}),U.d(ve,"b",function(){return pe}),U.d(ve,"S",function(){return xe}),U.d(ve,"o",function(){return se}),U.d(ve,"P",function(){return ae}),U.d(ve,"w",function(){return Ce}),U.d(ve,"c",function(){return ze}),U.d(ve,"y",function(){return Ve});function ne(he){return!he||typeof he!="string"?!0:he.trim().length===0}const Y=/{(\d+)}/g;function M(he,...Re){return Re.length===0?he:he.replace(Y,function(Ne,Ue){const rt=parseInt(Ue,10);return isNaN(rt)||rt<0||rt>=Re.length?Ne:Re[rt]})}function z(he){return he.replace(/[<>&]/g,function(Re){switch(Re){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Re}})}function P(he){return he.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function F(he,Re=" "){const Ne=G(he,Re);return K(Ne,Re)}function G(he,Re){if(!he||!Re)return he;const Ne=Re.length;if(Ne===0||he.length===0)return he;let Ue=0;for(;he.indexOf(Re,Ue)===Ue;)Ue=Ue+Ne;return he.substring(Ue)}function K(he,Re){if(!he||!Re)return he;const Ne=Re.length,Ue=he.length;if(Ne===0||Ue===0)return he;let rt=Ue,st=-1;for(;!(st=he.lastIndexOf(Re,rt-1),st===-1||st+Ne!==rt);){if(st===0)return"";rt=st}return he.substring(0,rt)}function n(he){return he.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I(he){return he.replace(/\*/g,"")}function b(he,Re,Ne={}){if(!he)throw new Error("Cannot create regex from empty string");Re||(he=P(he)),Ne.wholeWord&&(/\B/.test(he.charAt(0))||(he="\\b"+he),/\B/.test(he.charAt(he.length-1))||(he=he+"\\b"));let Ue="";return Ne.global&&(Ue+="g"),Ne.matchCase||(Ue+="i"),Ne.multiline&&(Ue+="m"),Ne.unicode&&(Ue+="u"),new RegExp(he,Ue)}function f(he){if(he.source==="^"||he.source==="^$"||he.source==="$"||he.source==="^\\s*$")return!1;const Re=he.exec("");return!!(Re&&he.lastIndex===0)}function y(he){return(he.global?"g":"")+(he.ignoreCase?"i":"")+(he.multiline?"m":"")+(he.unicode?"u":"")}function c(he){return he.split(/\r\n|\r|\n/)}function a(he){for(let Re=0,Ne=he.length;Re<Ne;Re++){const Ue=he.charCodeAt(Re);if(Ue!==32&&Ue!==9)return Re}return-1}function p(he,Re=0,Ne=he.length){for(let Ue=Re;Ue<Ne;Ue++){const rt=he.charCodeAt(Ue);if(rt!==32&&rt!==9)return he.substring(Re,Ue)}return he.substring(Re,Ne)}function l(he,Re=he.length-1){for(let Ne=Re;Ne>=0;Ne--){const Ue=he.charCodeAt(Ne);if(Ue!==32&&Ue!==9)return Ne}return-1}function u(he,Re){return he<Re?-1:he>Re?1:0}function s(he,Re,Ne=0,Ue=he.length,rt=0,st=Re.length){for(;Ne<Ue&&rt<st;Ne++,rt++){let bt=he.charCodeAt(Ne),gt=Re.charCodeAt(rt);if(bt<gt)return-1;if(bt>gt)return 1}const dt=Ue-Ne,at=st-rt;return dt<at?-1:dt>at?1:0}function i(he,Re){return D(he,Re,0,he.length,0,Re.length)}function D(he,Re,Ne=0,Ue=he.length,rt=0,st=Re.length){for(;Ne<Ue&&rt<st;Ne++,rt++){let bt=he.charCodeAt(Ne),gt=Re.charCodeAt(rt);if(bt===gt)continue;if(bt>=128||gt>=128)return s(he.toLowerCase(),Re.toLowerCase(),Ne,Ue,rt,st);A(bt)&&(bt-=32),A(gt)&&(gt-=32);const xt=bt-gt;if(xt===0)continue;return xt}const dt=Ue-Ne,at=st-rt;return dt<at?-1:dt>at?1:0}function A(he){return he>=97&&he<=122}function S(he){return he>=65&&he<=90}function R(he,Re){return he.length===Re.length&&D(he,Re)===0}function O(he,Re){const Ne=Re.length;return Re.length>he.length?!1:D(he,Re,0,Ne)===0}function m(he,Re){let Ne,Ue=Math.min(he.length,Re.length);for(Ne=0;Ne<Ue;Ne++)if(he.charCodeAt(Ne)!==Re.charCodeAt(Ne))return Ne;return Ue}function v(he,Re){let Ne,Ue=Math.min(he.length,Re.length);const rt=he.length-1,st=Re.length-1;for(Ne=0;Ne<Ue;Ne++)if(he.charCodeAt(rt-Ne)!==Re.charCodeAt(st-Ne))return Ne;return Ue}function h(he){return 55296<=he&&he<=56319}function d(he){return 56320<=he&&he<=57343}function C(he,Re){return(he-55296<<10)+(Re-56320)+65536}function E(he,Re,Ne){const Ue=he.charCodeAt(Ne);if(h(Ue)&&Ne+1<Re){const rt=he.charCodeAt(Ne+1);if(d(rt))return C(Ue,rt)}return Ue}function w(he,Re){const Ne=he.charCodeAt(Re-1);if(d(Ne)&&Re>1){const Ue=he.charCodeAt(Re-2);if(h(Ue))return C(Ue,Ne)}return Ne}function j(he,Re){const Ne=Ye.getInstance(),Ue=Re,rt=he.length,st=E(he,rt,Re);Re+=st>=65536?2:1;let dt=Ne.getGraphemeBreakType(st);for(;Re<rt;){const at=E(he,rt,Re),bt=Ne.getGraphemeBreakType(at);if(ze(dt,bt))break;Re+=at>=65536?2:1,dt=bt}return Re-Ue}function W(he,Re){const Ne=Ye.getInstance(),Ue=Re,rt=w(he,Re);Re-=rt>=65536?2:1;let st=Ne.getGraphemeBreakType(rt);for(;Re>0;){const dt=w(he,Re),at=Ne.getGraphemeBreakType(dt);if(ze(at,st))break;Re-=dt>=65536?2:1,st=at}return Ue-Re}const T=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function N(he){return T.test(he)}const _=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function x(he){return _.test(he)}const H=/^[\t\n\r\x20-\x7E]*$/;function X(he){return H.test(he)}const ee=/[\u2028\u2029]/;function J(he){return ee.test(he)}function ce(he){for(let Re=0,Ne=he.length;Re<Ne;Re++)if(me(he.charCodeAt(Re)))return!0;return!1}function me(he){return he=+he,he>=11904&&he<=55215||he>=63744&&he<=64255||he>=65281&&he<=65374}function ue(he){return he>=127462&&he<=127487||he===8986||he===8987||he===9200||he===9203||he>=9728&&he<=10175||he===11088||he===11093||he>=127744&&he<=128591||he>=128640&&he<=128764||he>=128992&&he<=129003||he>=129280&&he<=129535||he>=129648&&he<=129750}const pe=String.fromCharCode(65279);function xe(he){return!!(he&&he.length>0&&he.charCodeAt(0)===65279)}function se(he,Re=!1){return he?(Re&&(he=he.replace(/\\./g,"")),he.toLowerCase()!==he):!1}function ae(he){const Re=90-65+1;return he=he%(2*Re),he<Re?String.fromCharCode(97+he):String.fromCharCode(65+he-Re)}function Ce(he){const Re=Ye.getInstance();return Re.getGraphemeBreakType(he)}function ze(he,Re){return he===0?Re!==5&&Re!==7:he===2&&Re===3?!1:he===4||he===2||he===3||(Re===4||Re===2||Re===3)?!0:he===8&&(Re===8||Re===9||Re===11||Re===12)||((he===11||he===9)&&(Re===9||Re===10)||((he===12||he===10)&&Re===10||(Re===5||Re===13||(Re===7||(he===1||he===13&&Re===14)))))?!1:!(he===6&&Re===6)}class Ye{constructor(){this._data=He()}static getInstance(){return Ye._INSTANCE||(Ye._INSTANCE=new Ye),Ye._INSTANCE}getGraphemeBreakType(he){if(he<32)return he===10?3:he===13?2:4;if(he<127)return 0;const Re=this._data,Ne=Re.length/3;let Ue=1;for(;Ue<=Ne;)if(he<Re[3*Ue])Ue=2*Ue;else if(he>Re[3*Ue+1])Ue=2*Ue+1;else return Re[3*Ue+2];return 0}}Ye._INSTANCE=null;function He(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ve(he,Re){if(he===0)return 0;const Ne=Fe(he,Re);if(Ne!==void 0)return Ne;const Ue=w(Re,he);return he-=Ke(Ue),he}function Fe(he,Re){let Ne=w(Re,he);for(he-=Ke(Ne);nt(Ne)||Ne===65039||Ne===8419;){if(he===0)return;Ne=w(Re,he),he-=Ke(Ne)}if(!ue(Ne))return;if(he>=0){const Ue=w(Re,he);Ue===8205&&(he-=Ke(Ue))}return he}function Ke(he){return he>=65536?2:1}function nt(he){return 127995<=he&&he<=127999}},NLgs:function(ut,ve,U){"use strict";U.d(ve,"e",function(){return l}),U.d(ve,"f",function(){return u}),U.d(ve,"d",function(){return i}),U.d(ve,"c",function(){return D}),U.d(ve,"a",function(){return A}),U.d(ve,"b",function(){return S});var ne=U("miYZ"),Y=U("tsqr"),M=U("9og8"),z=U("2qtc"),P=U("kLXV"),F=U("WmNS"),G=U.n(F),K=U("q1tI"),n=U.n(K),I=U("9kvl"),b=U("xKgJ"),f=U("1vsH"),y=U("RCxd"),c=U("yTi+"),a=U.n(c),p=U("m3rI"),l=function(O){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(u(O)&&s(m))},u=function(O){return Object(b.p)()?!0:(O({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},s=function(){var O,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,v=Object(I.c)()._store.getState(),h=v.user;return(O=h.userInfo)!==null&&O!==void 0&&O.profile_completed?!0:(P.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:m?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){I.d.push("/account/profile/edit")}}),!1)},i=function(){var O,m=Object(I.c)()._store.getState(),v=m.user;return(O=v.userInfo)!==null&&O!==void 0&&O.professional_certification?!0:(P.a.confirm({title:"\u63D0\u793A",centered:!0,content:n.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(f.U)("/account/certification")}}),!1)},D=function(){var O;if(Object(b.a)())return!0;var m=Object(I.c)()._store.getState(),v=m.user,h=m.globalSetting;return P.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc",style:{marginLeft:-38}},n.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),n.a.createElement("img",{src:p.a.IMG_SERVER+(h==null||((O=h.setting)===null||O===void 0)?void 0:O.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},A=function(O,m){var v;if(O)return!0;var h=Object(I.c)()._store.getState(),d=h.user,C=h.globalSetting;return P.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("p",null,m||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),n.a.createElement("div",{style:{marginLeft:"110px"}},n.a.createElement("img",{src:p.a.IMG_SERVER+(C==null||((v=C.setting)===null||v===void 0)?void 0:v.authority_qrcode_url),width:200}),n.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(f.U)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(O){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",v=Object(I.c)()._store.getState(),h=v.shixunsDetail.detail;return(h==null?void 0:h.public)===2||(h==null?void 0:h.public)===1||(h==null?void 0:h.shixun_status)===3?(P.a.info({centered:!0,icon:n.a.createElement(y.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc",style:{marginLeft:-38}},n.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},n.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(h==null?void 0:h.public)===2?"\u5DF2\u516C\u5F00":(h==null?void 0:h.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",m,"\u3002"),n.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),n.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:a.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(h==null?void 0:h.shixun_status)===2?(P.a.confirm({centered:!0,icon:n.a.createElement(y.a,null),title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",m,"\u3002"),n.a.createElement("br",null),n.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){P.a.confirm({width:440,centered:!0,icon:n.a.createElement(y.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var C=Object(M.a)(G.a.mark(function w(){var j;return G.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,O({type:"shixunsDetail/cancelRelease",payload:{id:h==null?void 0:h.identifier}});case 2:j=T.sent,j.status!==401&&(Y.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),O({type:"shixunsDetail/getShixunsDetail",payload:{id:h==null?void 0:h.identifier}}),O({type:"practiceSetting/getCommonData",payload:{id:h==null?void 0:h.identifier}}));case 4:case"end":return T.stop()}},w)}));function E(){return C.apply(this,arguments)}return E}()})}}),!0):!1}},NvD2:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return F});var ne=U("Kwbf");function Y(G,K){var n=new Set;return G.forEach(function(I){K.has(I)||n.add(I)}),n}function M(G){var K=G||{},n=K.disabled,I=K.disableCheckbox,b=K.checkable;return!!(n||I)||b===!1}function z(G,K,n,I){for(var b=new Set(G),f=new Set,y=0;y<=n;y+=1){var c=K.get(y)||new Set;c.forEach(function(u){var s=u.key,i=u.node,D=u.children,A=D===void 0?[]:D;b.has(s)&&!I(i)&&A.filter(function(S){return!I(S.node)}).forEach(function(S){b.add(S.key)})})}for(var a=new Set,p=n;p>=0;p-=1){var l=K.get(p)||new Set;l.forEach(function(u){var s=u.parent,i=u.node;if(I(i)||!u.parent||a.has(u.parent.key))return;if(I(u.parent.node)){a.add(s.key);return}var D=!0,A=!1;(s.children||[]).filter(function(S){return!I(S.node)}).forEach(function(S){var R=S.key,O=b.has(R);D&&!O&&(D=!1),!A&&(O||f.has(R))&&(A=!0)}),D&&b.add(s.key),A&&f.add(s.key),a.add(s.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(Y(f,b))}}function P(G,K,n,I,b){for(var f=new Set(G),y=new Set(K),c=0;c<=I;c+=1){var a=n.get(c)||new Set;a.forEach(function(s){var i=s.key,D=s.node,A=s.children,S=A===void 0?[]:A;!f.has(i)&&!y.has(i)&&!b(D)&&S.filter(function(R){return!b(R.node)}).forEach(function(R){f.delete(R.key)})})}y=new Set;for(var p=new Set,l=I;l>=0;l-=1){var u=n.get(l)||new Set;u.forEach(function(s){var i=s.parent,D=s.node;if(b(D)||!s.parent||p.has(s.parent.key))return;if(b(s.parent.node)){p.add(i.key);return}var A=!0,S=!1;(i.children||[]).filter(function(R){return!b(R.node)}).forEach(function(R){var O=R.key,m=f.has(O);A&&!m&&(A=!1),!S&&(m||y.has(O))&&(S=!0)}),A||f.delete(i.key),S&&y.add(i.key),p.add(i.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(Y(y,f))}}function F(G,K,n,I){var b=[],f;I?f=I:f=M;var y=new Set(G.filter(function(l){var u=!!n[l];return u||b.push(l),u})),c=new Map,a=0;Object.keys(n).forEach(function(l){var u=n[l],s=u.level,i=c.get(s);i||(i=new Set,c.set(s,i)),i.add(u),a=Math.max(a,s)}),Object(ne.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var p;return K===!0?p=z(y,c,a,f):p=P(y,K.halfCheckedKeys,c,a,f),p}},"ORt/":function(ut,ve,U){ut.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(ut,ve,U){"use strict";U.d(ve,"b",function(){return I}),U.d(ve,"a",function(){return b}),U.d(ve,"k",function(){return f}),U.d(ve,"h",function(){return y}),U.d(ve,"i",function(){return c}),U.d(ve,"g",function(){return a}),U.d(ve,"c",function(){return p}),U.d(ve,"d",function(){return l}),U.d(ve,"j",function(){return i}),U.d(ve,"e",function(){return D}),U.d(ve,"f",function(){return A});var ne=U("KQm4"),Y=U("U8pU"),M=U("Ff2n"),z=U("q1tI"),P=U.n(z),F=U("Kwbf"),G=U("WaYH"),K=.25,n=2;function I(S,R){var O=S.slice(),m=O.indexOf(R);return m>=0&&O.splice(m,1),O}function b(S,R){var O=S.slice();return O.indexOf(R)===-1&&O.push(R),O}function f(S){return S.split("-")}function y(S,R){return"".concat(S,"-").concat(R)}function c(S){return S&&S.type&&S.type.isTreeNode}function a(S,R){var O=[S],m=R[S];function v(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(d){var C=d.key,E=d.children;O.push(C),v(E)})}return v(m.children),O}function p(S,R){var O=S.clientY,m=R.selectHandle.getBoundingClientRect(),v=m.top,h=m.bottom,d=m.height,C=Math.max(d*K,n);return O<=v+C?-1:O>=h-C?1:0}function l(S,R){if(!S)return;var O=R.multiple;return O?S.slice():S.length?[S[0]]:S}var u=function(R){return R};function s(S,R){if(!S)return[];var O=R||{},m=O.processProps,v=m===void 0?u:m,h=Array.isArray(S)?S:[S];return h.map(function(d){var C=d.children,E=Object(M.a)(d,["children"]),w=s(C,R);return P.a.createElement(G.a,Object.assign({},v(E)),w)})}function i(S){if(!S)return null;var R;if(Array.isArray(S))R={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Y.a)(S)==="object")R={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(F.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function D(S,R){var O=new Set;function m(v){if(O.has(v))return;var h=R[v];if(!h)return;O.add(v);var d=h.parent,C=h.node;if(C.disabled)return;d&&m(d.key)}return(S||[]).forEach(function(v){m(v)}),Object(ne.a)(O)}function A(S){var R={};return Object.keys(S).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(R[O]=S[O])}),R}},Ot1p:function(ut,ve,U){"use strict";var ne=U("2qtc"),Y=U("kLXV"),M=U("rAM+"),z=U("miYZ"),P=U("tsqr"),F=U("9og8"),G=U("tJVT"),K=U("jrin"),n=U("WmNS"),I=U.n(n),b=U("q1tI"),f=U.n(b),y=U("VrN/"),c=U.n(y),a=U("bdgK"),p=U("p77/"),l=U("Bd2K"),u=U("ELLl"),s=U("19Vz"),i=U("lZu9"),D=U("+NIl"),A=U("kSUc"),S=U("9Bee"),R=function(ke){var Ze=ke.value,ht=Ze===void 0?"":Ze,Ut=ke.className,nn=ke.showTextOnly,tn=ke.showLines,_n=ke.style,bn=_n===void 0?{}:_n,Kt=Object(b.useMemo)(function(){return""},[ht]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Kt}}))},O=U("0Owb"),m=U("dejd"),v=U("C+DQ"),h=U("1vsH"),d=U("m3rI"),C=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function E(ke){var Ze=ke.onActionCallback,ht=ke.title,Ut=ke.icon,nn=ke.actionName,tn=ke.className,_n=tn===void 0?"":tn,bn=ke.children;function Kt(){Ze(nn)}return f.a.createElement("a",{title:ht,className:_n,onClick:Kt},f.a.createElement("i",{className:"md-iconfont ".concat(Ut)}),bn)}var w=function(ke){var Ze=ke.watch,ht=ke.showNullButton,Ut=ke.onActionCallback,nn=ke.fullScreen,tn=ke.insertTemp,_n=ke.hidetoolBar,bn=ke.uuid,Kt=ke.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.H)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.H)("_educoder_session"),"&key=").concat(bn,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var rr=[].concat(C,[{title:"".concat(Ze?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ze?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!_n&&rr.map(function(Ln,Cr){return f.a.createElement("li",{key:Cr},Ln.actionName?f.a.createElement(E,Object(O.a)({},Ln,{onActionCallback:Ut})):f.a.createElement("span",{className:"v-line"}))}),ht?f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ut},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,tn&&f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(tn),onActionCallback:Ut},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(E,{icon:"".concat(nn?"icon-shrink":"icon-enlarge"),title:nn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ut})))},j=U("M8RZ"),W=U("+L6B"),T=U("2/Rp"),N=U("y8nQ"),_=U("Vl3Y"),x=U("5NDa"),H=U("5rEg"),X={labelCol:{span:4},wrapperCol:{span:20}},ee=function(ke){var Ze=ke.callback,ht=ke.onCancel;function Ut(nn){Ze(nn)}return f.a.createElement(_.a,Object(O.a)({},X,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ut}),f.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(H.a,null)),f.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(H.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},J=U("7ahc"),ce=U("HmJG"),me=U("BjJ7"),ue=_.a.useForm,pe={width:280,marginRight:10},xe={labelCol:{span:5},wrapperCol:{span:19}},se=function(ke){var Ze=ke.callback,ht=ke.onCancel,Ut=ue(),nn=Object(G.a)(Ut,1),tn=nn[0];function _n(rr){Ze(rr)}function bn(rr,Ln){if(rr.status===-1){P.b.error(rr.message);return}tn.setFieldsValue({src:"/api/attachments/".concat(rr.id),type:Ln.type})}function Kt(rr){var Ln=rr.target.files[0];Ce(Ln,bn)}return f.a.createElement(_.a,Object(O.a)({form:tn},xe,{className:"upload-image-panel",onFinish:_n}),f.a.createElement(_.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(_.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(H.a,{style:pe})),f.a.createElement(ae,{onFileChange:Kt}))),f.a.createElement(_.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(H.a,{style:{width:264}})),f.a.createElement(_.a.Item,{style:{textAlign:"right"}},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))};function ae(ke){var Ze=ke.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Ze}))}function Ce(ke,Ze){if(!ke)throw new String("\u6CA1\u6709\u6587\u4EF6");var ht=new FormData;ht.append("editormd-image-file",ke),ht.append("file_param_name","editormd-image-file"),ht.append("byxhr","true");var Ut=new window.XMLHttpRequest;Ut.withCredentials=!0,Ut.addEventListener("load",function(nn){Ze(JSON.parse(nn.target.responseText),ke)},!1),Ut.addEventListener("error",function(nn){console.error(nn)},!1),Ut.open("POST","".concat(me.a,"/api/attachments.json")),Ut.send(ht)}var ze=U("giR+"),Ye=U("fyUT"),He=U("7Kak"),Ve=U("9yH6"),Fe=Ve.a.Group,Ke={margin:"0 8px"},nt=function(ke){var Ze=ke.callback,ht=ke.onCancel;function Ut(nn){Ze(nn)}return f.a.createElement(_.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ut},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Ke},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Ke},"\u884C\u6570"),f.a.createElement(_.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(Ye.a,null)),f.a.createElement("span",{style:Ke},"\u5217\u6570"),f.a.createElement(_.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(Ye.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(_.a.Item,{name:"align"},f.a.createElement(Fe,null,f.a.createElement(Ve.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(Ve.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(Ve.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(Ve.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(T.a,{type:"ghost",onClick:ht},"\u53D6\u6D88")))},he=U("ErOA"),Re=U("7Cbv"),Ne="link",Ue="upload-image",rt="code-block",st="add-table",dt="------------",at={default:dt,left:":".concat(dt),center:":".concat(dt,":"),right:"".concat(dt,":")},bt=U("9VGf"),gt,xt;function Je(){}var kt=0,Ot=1e4,tt="\u2581",ft=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function be(ke){return/^\d+$/.test(ke)?"".concat(ke,"px"):ke}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,ge=Ee?"Cmd":"Ctrl",de=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],fe=(gt={},Object(K.a)(gt,ge+"-B","bold"),Object(K.a)(gt,ge+"-I","italic"),gt),we=(xt={},Object(K.a)(xt,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(K.a)(xt,rt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(K.a)(xt,Ue,"\u6DFB\u52A0\u6587\u4EF6"),Object(K.a)(xt,st,"\u6DFB\u52A0\u8868\u683C"),xt),De=ve.a=function(ke){var Ze=ke.defaultValue,ht=Ze===void 0?"":Ze,Ut=ke.onChange,nn=ke.width,tn=nn===void 0?"100%":nn,_n=ke.height,bn=_n===void 0?400:_n,Kt=ke.miniToolbar,rr=Kt===void 0?!1:Kt,Ln=ke.isFocus,Cr=Ln===void 0?!1:Ln,pr=ke.watch,kn=ke.insertTemp,Mr=ke.mode,Or=Mr===void 0?"markdown":Mr,ln=ke.id,Xr=ln===void 0?"markdown-editor-id":ln,hr=ke.showResizeBar,Sr=hr===void 0?!1:hr,vn=ke.noStorage,fn=vn===void 0?!1:vn,Jn=ke.showNullButton,en=Jn===void 0?!1:Jn,jt=ke.hidetoolBar,Fr=jt===void 0?!1:jt,ri=ke.fullScreen,qr=ri===void 0?!1:ri,un=ke.onBlur,Rr=ke.onCMBeforeChange,yi=ke.onFullScreen,fi=ke.className,_t=fi===void 0?"":fi,sn=ke.disablePaste,Ii=sn===void 0?!1:sn,zi=ke.placeholder,na=zi===void 0?"":zi,Vi=ke.values,Z=Vi===void 0?"":Vi,L=Object(b.useState)(null),k=Object(G.a)(L,2),V=k[0],re=k[1],Q=Object(b.useState)(ht),Pe=Object(G.a)(Q,2),pt=Pe[0],Lt=Pe[1],rn=Object(b.useState)(pr),vt=Object(G.a)(rn,2),Vt=vt[0],fr=vt[1],Lr=Object(b.useState)(qr),Zt=Object(G.a)(Lr,2),mt=Zt[0],Pt=Zt[1],Rt=Object(b.useState)(""),Gt=Object(G.a)(Rt,2),cn=Gt[0],Tn=Gt[1],Sn=Object(b.useState)(0),mn=Object(G.a)(Sn,2),In=mn[0],Kn=mn[1],hn=Object(b.useState)(bn),An=Object(G.a)(hn,2),dr=An[0],Nn=An[1],zt=Object(b.useState)(!1),On=Object(G.a)(zt,2),sr=On[0],Un=On[1],Xt=Object(b.useRef)(Object(Re.a)()),Bt=Object(b.useRef)(!1),yn=Object(b.useRef)(),Ct=Object(b.useRef)(),Mt=Object(b.useRef)(),Dt=Object(b.useRef)(),Me=Object(b.useRef)(),Yt=function(){var $t=Object(F.a)(I.a.mark(function Jt(){var Qt,pn;return I.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Mn.next=2,Object(he.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:pn=Mn.sent,pn!=null&&(Qt=pn.attachments)!==null&&Qt!==void 0&&Qt.length&&(console.log("cm:",V,Ct),pn.attachments.map(function(qn){qn.content_type.indexOf("image")>-1?V.replaceSelection("![,](/api/attachments/".concat(qn.id,"?type=").concat(qn.content_type,")")):qn.content_type.indexOf("video")>-1?V.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):qn.content_type.indexOf("pdf")>-1?V.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,'&disposition=inline" target="_blank">').concat(qn.name,"</a>")):V.replaceSelection("[".concat(qn.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,")"))}));case 4:case"end":return Mn.stop()}},Jt)}));return function(){return $t.apply(this,arguments)}}();Object(b.useEffect)(function(){Lt(Z),V==null||V.setValue(Z)},[Z]),Object(b.useEffect)(function(){yi==null||yi(mt)},[mt]),Object(b.useEffect)(function(){if(Ct.current){var $t=c.a.fromTextArea(Ct.current,{mode:Or,lineNumbers:!rr,lineWrapping:!0,value:ht,autoCloseTags:!0,autoCloseBrackets:!0});Cr&&$t.focus();function Jt(Qt,pn){if(Ii){pn.preventDefault();return}var Gn=pn.clipboardData;if(Gn){var Mn=Gn.types.toString(),qn=Gn.items;if(Mn==="Files"||Gn.types.indexOf("Files")>-1){if(pn.preventDefault(),Or=="stex")return;try{var gr,Ci=qn[1];((gr=qn[0])===null||gr===void 0?void 0:gr.kind)==="file"&&(Ci=qn[0]);var Qn=Ci.getAsFile(),Qi=Qn.name.split(".").pop();Ce(Qn,function(vr){if(vr.id){var pi,si,Ui;(Qn==null||((pi=Qn.type)===null||pi===void 0)?void 0:pi.indexOf("image"))>-1?$t.replaceSelection("![,](/api/attachments/".concat(vr.id,"?type=").concat(vr.content_type,")")):(Qn==null||((si=Qn.type)===null||si===void 0)?void 0:si.indexOf("video"))>-1?$t.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'"></video>')):(Qn==null||((Ui=Qn.type)===null||Ui===void 0)?void 0:Ui.indexOf("pdf"))>-1?$t.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(Qn.type,'&disposition=inline" target="_blank">').concat(Qn.name,"</a>")):de.includes(Qi)?$t.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'?type=office&disposition=inline" target="_blank">').concat(Qn.name,"</a>")):$t.replaceSelection("[".concat(Qn.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(vr.content_type,")"))}else(vr==null?void 0:vr.status)===401&&(document.location.href="/user/login")})}catch(vr){P.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return $t.on("paste",Jt),$t.on("dragleave",function(Qt,pn){Mt.current.classList.remove("mouse-hover-md")}),$t.on("dragover",function(Qt,pn){Mt.current.classList.add("mouse-hover-md")}),$t.on("drop",function(Qt,pn){Mt.current.classList.add("mouse-hover-md");var Gn;if(Gn=pn.dataTransfer.files,Gn.length>0){pn.preventDefault(),pn.stopPropagation();for(var Mn=function(Ci){var Qn=Gn[Ci],Qi=Qn.name.split(".").pop();Ce(Qn,function(vr){if(vr.id){var pi,si,Ui;(Qn==null||((pi=Qn.type)===null||pi===void 0)?void 0:pi.indexOf("image"))>-1?$t.replaceSelection("![,](/api/attachments/".concat(vr.id,"?type=").concat(vr.content_type,")")):(Qn==null||((si=Qn.type)===null||si===void 0)?void 0:si.indexOf("video"))>-1?$t.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'"></video>')):(Qn==null||((Ui=Qn.type)===null||Ui===void 0)?void 0:Ui.indexOf("pdf"))>-1?$t.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(Qn.type,'&disposition=inline" target="_blank">').concat(Qn.name,"</a>")):de.includes(Qi)?$t.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,'?type=office&disposition=inline" target="_blank">').concat(Qn.name,"</a>")):$t.replaceSelection("[".concat(Qn.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(vr.id,"?type=").concat(vr.content_type,")"))}else(vr==null?void 0:vr.status)===401&&(document.location.href="/user/login")})},qn=0;qn<Gn.length;qn++)Mn(qn)}}),re($t),function(){$t.off("paste",Jt)}}},[]);var wn=Object(b.useCallback)(function(){if(Mt.current)try{}catch($t){console.log($t,"---- to set md editor body height")}},[dr,Mt,mt]);Object(b.useEffect)(function(){function $t(){var Qt=new a.default(function(pn){var Gn=Object(M.a)(pn),Mn;try{for(Gn.s();!(Mn=Gn.n()).done;){var qn=Mn.value;(qn.target.offsetHeight>0||qn.target.offsetWidth>0)&&(wn(),V.setSize("100%","100%"),V.refresh())}}catch(gr){Gn.e(gr)}finally{Gn.f()}});return Qt.observe(Ct.current.parentElement),Qt}if(V){var Jt=$t();return function(){Jt.unobserve(Ct.current.parentElement)}}},[V,wn]),Object(b.useEffect)(function(){if(V){for(var $t=[],Jt=function(){var qn=pn[Qt];Gn=Object(G.a)(qn,2);var gr=Gn[0],Ci=Gn[1],Qn=Object(K.a)({},gr,function(){mr(Ci)});$t.push(Qn),V.addKeyMap(Qn)},Qt=0,pn=Object.entries(fe);Qt<pn.length;Qt++){var Gn;Jt()}return yn.current=setInterval(function(){Bt.current&&Yt()},4e3),function(){clearInterval(yn.current);var Mn=Object(M.a)($t),qn;try{for(Mn.s();!(qn=Mn.n()).done;){var gr=qn.value;V.removeKeyMap(gr)}}catch(Ci){Mn.e(Ci)}finally{Mn.f()}}}},[V]),Object(b.useEffect)(function(){qr!==mt&&Pt(qr)},[qr]),Object(bt.a)(function(){if(!fn&&In>0){var $t=new Date().getTime(),Jt=window.sessionStorage.getItem(Xr);$t>=In+Ot&&(!Jt||Jt!==pt)&&(window.sessionStorage.setItem(Xr,pt),Un(!0))}},Ot),Object(b.useEffect)(function(){fr(pr)},[V,pr]),Object(b.useEffect)(function(){V&&(Cr&&V.focus())},[V,Cr]),Object(b.useEffect)(function(){if(Vt&&V){var $t=V.getScrollerElement();function Jt(Qt){var pn=Qt.target;if(Me.current){var Gn=pn.scrollTop/pn.scrollHeight;Me.current.scrollTop=Me.current.scrollHeight*Gn}}return $t.addEventListener("scroll",Jt),function(){$t.removeEventListener("scroll",Jt)}}},[V,Vt]),Object(b.useEffect)(function(){if(V&&Rr){function $t(Jt,Qt){Rr(Jt,Qt)}return V.on("beforeChange",$t),function(){V.off("beforeChange",$t)}}},[V,Rr]),Object(b.useEffect)(function(){if(V&&un){function $t(){un(V.getValue())}return V.on("blur",$t),function(){V.off("blur",$t)}}},[V,un]),Object(b.useEffect)(function(){if(V){function $t(Jt){var Qt=Jt.getValue();Lt(Qt),Kn(new Date().getTime()),Jt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ut&&Ut(Qt)}return V.on("change",$t),function(){V.off("change",$t)}}},[V,Ut]),Object(b.useEffect)(function(){V&&(ht==null?(V.setValue(""),Lt("")):ht!==V.getValue()&&(V.setValue(ht),Lt(ht),V.setCursor(V.lineCount(),0)))},[V,ht]);var mr=Object(b.useCallback)(function($t){var Jt=V.getCursor(),Qt=V.getSelection(),pn=Qt.split(`
`);switch($t){case"bold":return V.replaceSelection("**"+Qt+"**"),Qt===""&&V.setCursor(Jt.line,Jt.ch+2),V.focus();case"italic":return V.replaceSelection("*"+Qt+"*"),Qt===""&&V.setCursor(Jt.line,Jt.ch+1),V.focus();case"code":return V.replaceSelection("`"+Qt+"`"),Qt===""&&V.setCursor(Jt.line,Jt.ch+1),V.focus();case"inline-latex":return V.replaceSelection("`$$"+Qt+"$$`"),Qt===""&&V.setCursor(Jt.line,Jt.ch+3),V.focus();case"latex":return V.replaceSelection("```latex\n"+Qt+"\n```"),V.setCursor(Jt.line+1,Qt.length+1),V.focus();case"line-break":return V.replaceSelection(`<br/>
`),V.focus();case"list-ul":return Qt===""?V.replaceSelection("- "+Qt):V.replaceSelection(pn.map(function(Gn){return Gn===""?"":"- ".concat(Gn)}).join(`
`)),V.focus();case"list-ol":return Qt===""?V.replaceSelection("1. "+Qt):V.replaceSelection(pn.map(function(Gn,Mn){return Gn===""?"":"".concat(Mn+1,". ").concat(Gn)}).join(`
`)),V.focus();case"add-null-ch":return Qt===""&&V.setCursor(Jt.line,Jt.ch+1),V.replaceSelection(tt),V.focus();case"inster-template-1":return Qt===""&&V.setCursor(Jt.line,Jt.ch),V.replaceSelection(ft),V.focus();case"eraser":return V.setValue(""),V.focus();case"trigger-watch":return fr(!Vt),V.focus();case"trigger-full-screen":return Pt(!mt),V.focus();case Ne:Tn(Ne);return;case rt:Tn(rt);return;case Ue:Tn(Ue);return;case st:Tn(st);return;default:throw new Error}},[V,Vt,mt]),Rn=Object(b.useCallback)(function($t){Tn("");switch(cn){case Ne:var Jt=$t.title,Qt=$t.link;return V.replaceSelection("[".concat(Jt,"](").concat(Qt,")")),V.focus();case rt:var pn=$t.language,Gn=$t.content;return V.replaceSelection(["```"+pn,Gn,"```"].join(`
`)),V.focus();case Ue:var Mn=$t.src,qn=$t.alt;return qn?V.replaceSelection("![ ".concat(qn," ]( ").concat(Mn,' "').concat(qn,'" )')):V.replaceSelection("![,](".concat(Mn,")")),V.focus();case st:for(var gr=$t.row,Ci=$t.col,Qn=$t.align,Qi=`
`,vr=0;vr<gr;vr++){for(var pi=[],si=[],Ui=0;Ui<Ci;Ui++)vr===1&&si.push(at[Qn]),pi.push(" ");vr===1&&(Qi+="| ".concat(si.join(" | "),` |
`)),Qi+="| ".concat(pi.join(Ci===1?"":" | "),` |
`)}return V.replaceSelection(Qi+`
`),V.focus();default:throw new Error}},[V,cn]),ii=Object(b.useMemo)(function(){switch(cn){case Ne:return f.a.createElement(ee,{callback:Rn,onCancel:ai});case rt:return f.a.createElement(J.b,{callback:Rn,onCancel:ai});case Ue:return f.a.createElement(se,{callback:Rn,onCancel:ai});case st:return f.a.createElement(nt,{callback:Rn,onCancel:ai});default:return null}},[cn]);function ai(){Tn("")}Object(b.useEffect)(function(){if(Dt.current){var $t=Dt.current,Jt=!1,Qt=0;function pn(qn){Jt=!0,Qt=qn.pageY}function Gn(){Jt=!1}function Mn(qn){if(Jt){var gr=qn.pageY-Qt;gr<0&&(gr=0),gr>300&&(gr=300);var Ci=bn+gr+"px";Nn(Ci)}}return $t.addEventListener("mousedown",pn),document.addEventListener("mousemove",Mn),document.addEventListener("mouseup",Gn),function(){$t.removeEventListener("mousedown",pn),document.removeEventListener("mousemove",Mn),document.removeEventListener("mouseup",Gn)}}},[V,Dt]),Object(b.useEffect)(function(){Nn(bn)},[bn]);var Hr=be(tn),jn=be(dr),Ft={width:Hr,height:jn},br=Object(b.useMemo)(function(){if(In){var $t=new Date(In),Jt=$t.getHours(),Qt=$t.getMinutes(),pn=$t.getSeconds();return Jt=Jt<10?"0"+Jt:Jt,Qt=Qt<10?"0"+Qt:Qt,pn=pn<10?"0"+pn:pn,"".concat(Jt,":").concat(Qt,":").concat(pn)}return 0},[In]);function lr(){window.sessionStorage.removeItem(Xr),Un(!1),Kn(0)}function Yn(){Un(!1),Kn(0),V.setValue(window.sessionStorage.getItem(Xr))}function oi($t,Jt){var Qt=V.getValue();Qt=Qt.replace($t,Jt),Lt(Qt),V==null||V.setValue(Qt)}return f.a.createElement(b.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Mt},f.a.createElement("div",{className:"markdown-editor-container ".concat(_t," ").concat(Vt?"on-preview":""," ").concat(rr?"mini":""," ").concat(mt?"full-screen":""),style:Ft},f.a.createElement(w,{insertTemp:kn,watch:Vt,fullScreen:mt,showNullButton:en,onActionCallback:mr,hidetoolBar:Fr,uuid:Xt.current,setOpenPhones:function(){Bt.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:Ct,placeholder:na})),Vt?f.a.createElement("div",{ref:Me,className:"preview-container"},Or==="stex"&&f.a.createElement(R,{value:pt}),Or!=="stex"&&f.a.createElement(S.a,{edit:!0,value:pt,replaces:oi})):null))),Sr?f.a.createElement("a",{ref:Dt,className:"editor-resize"}):null,f.a.createElement(j.a,null,we[cn]?f.a.createElement(Y.a,{centered:!0,title:we[cn],visible:!0,onCancel:ai,footer:null,className:"markdown-popup-form"},ii):null))}},"P/tu":function(ut,ve,U){"use strict";var ne=U("ozfa"),Y=U("MJZm"),M=U("0Owb"),z=U("9og8"),P=U("tJVT"),F=U("PpiC"),G=U("WmNS"),K=U.n(G),n=U("q1tI"),I=U.n(n),b=U("WCUW"),f=U("spXi"),y=U.n(f),c=function(p){var l=p.value,u=p.onChange,s=p.defaultValue,i=p.disabled,D=Object(F.a)(p,["value","onChange","defaultValue","disabled"]),A=Object(n.useState)([]),S=Object(P.a)(A,2),R=S[0],O=S[1],m=Object(n.useState)("1"),v=Object(P.a)(m,2),h=v[0],d=v[1];Object(n.useEffect)(function(){C()},[]);var C=function(){var j=Object(z.a)(K.a.mark(function W(){var T,N;return K.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,Object(b.A)({});case 2:T=x.sent,T!=null&&T.data&&(N=[{title:I.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:y.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:I.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:E(T.data||[])}],O(N),d("2"));case 4:case"end":return x.stop()}},W)}));return function(){return j.apply(this,arguments)}}(),E=function(W){function T(N){var _=N.children,x=Array.isArray(_)&&_.length>0,H=N==null?void 0:N.group_id;return{title:I.a.createElement("div",{title:N==null?void 0:N.name,className:y.a.name},N==null?void 0:N.name),value:H,key:H,icon:I.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:x?_==null?void 0:_.map(function(X){return T(X)}):[]}}return W==null?void 0:W.map(function(N){return T(N)})},w=s?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return I.a.createElement("div",{className:y.a.customTree},I.a.createElement(Y.a,Object(M.a)({key:h},w,{showIcon:!0,treeData:R,onSelect:u,disabled:i},D)))};ve.a=c},Q0Vu:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___3fHaw",flex_space_between:"flex_space_between___1tu3K",flex_box_vertical_center:"flex_box_vertical_center___3kmTT",flex_box_center_end:"flex_box_center_end___19OcD",flex_box_column:"flex_box_column___1aMoy",main:"main___JkLSb",wrap:"wrap___1k_Ib",content:"content___1by-P",programName:"programName___1mMSD",name:"name___2mlTd",directionContentWrap:"directionContentWrap___3qsxQ",directionItem:"directionItem___2aAvu",active:"active___ACZqb",subActive:"subActive___2RkoB",subItem:"subItem___3tJgX",subMenu:"subMenu___Y_7S_",action:"action___xqgFs"}},SAoR:function(ut,ve,U){"use strict";var ne=U("Q9mQ"),Y=U("diRs"),M=U("q1tI"),z=U.n(M),P=U("+z73"),F=U.n(P),G=function(n){var I=n.data,b=I===void 0?[]:I,f=n.onClick,y=function(){return b.map(function(p,l){return z.a.createElement("div",{key:l,className:F.a.few},z.a.createElement("b",{title:p.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return f(p.id)}},p.name),l<b.length-1&&z.a.createElement("span",null,"/"))})},c=function(){var p=!0,l=b.slice(2,-2),u=z.a.createElement("div",{className:F.a.pWrap},l.map(function(s){return z.a.createElement("span",{title:s.name,onClick:function(){return f(s.id)},key:s.id},s.name)}));return b.map(function(s,i){var D=null;return i>1&&i<b.length-2?p&&(D=z.a.createElement(Y.a,{key:i,placement:"bottom",content:u},z.a.createElement("span",{style:{color:"#999",cursor:"pointer"}},".../")),p=!1):D=z.a.createElement("div",{key:i,className:F.a.few},z.a.createElement("b",{title:s.name,style:{color:i===0?"#333333":"#999999"},onClick:function(){return f(s.id)}},s.name),i<b.length-1&&z.a.createElement("span",null,"/")),D})};return z.a.createElement("aside",{style:{overflowX:"auto"}},(b==null?void 0:b.length)>5?c():y())};ve.a=G},SJMd:function(ut,ve){/**
* @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 U,ne,Y,M=!1,z,P;window.PR_SHOULD_USE_CONTINUATION=!0;var F,G;(function(){var K=window,n=["break,continue,do,else,for,if,return,while"],I=[n,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],b=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[b,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],y=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],c=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],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",p=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",u=[n,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],s=[n,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],i=[n,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],D=[f,c,y,p,l,u,s,i],A=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",R="kwd",O="com",m="typ",v="lit",h="pun",d="pln",C="tag",E="dec",w="src",j="atn",W="atv",T="nocode",N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function _(Fe){for(var Ke=0,nt=!1,he=!1,Re=0,Ne=Fe.length;Re<Ne;++Re){var Ue=Fe[Re];if(Ue.ignoreCase)he=!0;else if(/[a-z]/i.test(Ue.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){nt=!0,he=!1;break}}var rt={b:8,t:9,n:10,v:11,f:12,r:13};function st(xt){var Je=xt.charCodeAt(0);if(Je!==92)return Je;var kt=xt.charAt(1);return Je=rt[kt],Je||("0"<=kt&&kt<="7"?parseInt(xt.substring(1),8):kt==="u"||kt==="x"?parseInt(xt.substring(2),16):xt.charCodeAt(1))}function dt(xt){if(xt<32)return(xt<16?"\\x0":"\\x")+xt.toString(16);var Je=String.fromCharCode(xt);return Je==="\\"||Je==="-"||Je==="]"||Je==="^"?"\\"+Je:Je}function at(xt){var Je=xt.substring(1,xt.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")),kt=[],Ot=Je[0]==="^",tt=["["];Ot&&tt.push("^");for(var ft=Ot?1:0,be=Je.length;ft<be;++ft){var Ee=Je[ft];if(/\\[bdsw]/i.test(Ee))tt.push(Ee);else{var ge=st(Ee),de;ft+2<be&&Je[ft+1]==="-"?(de=st(Je[ft+2]),ft+=2):de=ge,kt.push([ge,de]),de<65||ge>122||(de<65||ge>90||kt.push([Math.max(65,ge)|32,Math.min(de,90)|32]),de<97||ge>122||kt.push([Math.max(97,ge)&~32,Math.min(de,122)&~32]))}}kt.sort(function(ke,Ze){return ke[0]-Ze[0]||Ze[1]-ke[1]});for(var fe=[],we=[],ft=0;ft<kt.length;++ft){var De=kt[ft];De[0]<=we[1]+1?we[1]=Math.max(we[1],De[1]):fe.push(we=De)}for(var ft=0;ft<fe.length;++ft){var De=fe[ft];tt.push(dt(De[0])),De[1]>De[0]&&(De[1]+1>De[0]&&tt.push("-"),tt.push(dt(De[1])))}return tt.push("]"),tt.join("")}function bt(xt){for(var Je=xt.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")),kt=Je.length,Ot=[],tt=0,ft=0;tt<kt;++tt){var be=Je[tt];if(be==="(")++ft;else if(be.charAt(0)==="\\"){var Ee=+be.substring(1);Ee&&(Ee<=ft?Ot[Ee]=-1:Je[tt]=dt(Ee))}}for(var tt=1;tt<Ot.length;++tt)Ot[tt]===-1&&(Ot[tt]=++Ke);for(var tt=0,ft=0;tt<kt;++tt){var be=Je[tt];if(be==="(")++ft,Ot[ft]||(Je[tt]="(?:");else if(be.charAt(0)==="\\"){var Ee=+be.substring(1);Ee&&Ee<=ft&&(Je[tt]="\\"+Ot[Ee])}}for(var tt=0;tt<kt;++tt)Je[tt]==="^"&&Je[tt+1]!=="^"&&(Je[tt]="");if(xt.ignoreCase&&nt)for(var tt=0;tt<kt;++tt){var be=Je[tt],ge=be.charAt(0);be.length>=2&&ge==="["?Je[tt]=at(be):ge!=="\\"&&(Je[tt]=be.replace(/[a-zA-Z]/g,function(we){var De=we.charCodeAt(0);return"["+String.fromCharCode(De&~32,De|32)+"]"}))}return Je.join("")}for(var gt=[],Re=0,Ne=Fe.length;Re<Ne;++Re){var Ue=Fe[Re];if(Ue.global||Ue.multiline)throw new Error(""+Ue);gt.push("(?:"+bt(Ue)+")")}return new RegExp(gt.join("|"),he?"gi":"g")}function x(Fe,Ke){var nt=/(?:^|\s)nocode(?:\s|$)/,he=[],Re=0,Ne=[],Ue=0;function rt(st){var dt=st.nodeType;if(dt==1){if(nt.test(st.className))return;for(var at=st.firstChild;at;at=at.nextSibling)rt(at);var bt=st.nodeName.toLowerCase();(bt==="br"||bt==="li")&&(he[Ue]=`
`,Ne[Ue<<1]=Re++,Ne[Ue++<<1|1]=st)}else if(dt==3||dt==4){var gt=st.nodeValue;gt.length&&(Ke?gt=gt.replace(/\r\n?/g,`
`):gt=gt.replace(/[ \t\r\n]+/g," "),he[Ue]=gt,Ne[Ue<<1]=Re,Re+=gt.length,Ne[Ue++<<1|1]=st)}}return rt(Fe),{sourceCode:he.join("").replace(/\n$/,""),spans:Ne}}function H(Fe,Ke,nt,he,Re){if(!nt)return;var Ne={sourceNode:Fe,pre:1,langExtension:null,numberLines:null,sourceCode:nt,spans:null,basePos:Ke,decorations:null};he(Ne),Re.push.apply(Re,Ne.decorations)}var X=/\S/;function ee(Fe){for(var Ke=void 0,nt=Fe.firstChild;nt;nt=nt.nextSibling){var he=nt.nodeType;Ke=he===1?Ke?Fe:nt:he===3&&X.test(nt.nodeValue)?Fe:Ke}return Ke===Fe?void 0:Ke}function J(Fe,Ke){var nt={},he;(function(){for(var Ue=Fe.concat(Ke),rt=[],st={},dt=0,at=Ue.length;dt<at;++dt){var bt=Ue[dt],gt=bt[3];if(gt)for(var xt=gt.length;--xt>=0;)nt[gt.charAt(xt)]=bt;var Je=bt[1],kt=""+Je;st.hasOwnProperty(kt)||(rt.push(Je),st[kt]=null)}rt.push(/[\0-\uffff]/),he=_(rt)})();var Re=Ke.length,Ne=function(Ue){for(var rt=Ue.sourceCode,st=Ue.basePos,dt=Ue.sourceNode,at=[st,d],bt=0,gt=rt.match(he)||[],xt={},Je=0,kt=gt.length;Je<kt;++Je){var Ot=gt[Je],tt=xt[Ot],ft=void 0,be;if(typeof tt=="string")be=!1;else{var Ee=nt[Ot.charAt(0)];if(Ee)ft=Ot.match(Ee[1]),tt=Ee[0];else{for(var ge=0;ge<Re;++ge)if(Ee=Ke[ge],ft=Ot.match(Ee[1]),ft){tt=Ee[0];break}ft||(tt=d)}be=tt.length>=5&&tt.substring(0,5)==="lang-",be&&!(ft&&typeof ft[1]=="string")&&(be=!1,tt=w),be||(xt[Ot]=tt)}var de=bt;if(bt+=Ot.length,!be)at.push(st+de,tt);else{var fe=ft[1],we=Ot.indexOf(fe),De=we+fe.length;ft[2]&&(De=Ot.length-ft[2].length,we=De-fe.length);var ke=tt.substring(5);H(dt,st+de,Ot.substring(0,we),Ne,at),H(dt,st+de+we,fe,ae(ke,fe),at),H(dt,st+de+De,Ot.substring(De),Ne,at)}}Ue.decorations=at};return Ne}function ce(Fe){var Ke=[],nt=[];Fe.tripleQuotedStrings?Ke.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Fe.multiLineStrings?Ke.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ke.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Fe.verbatimStrings&&nt.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var he=Fe.hashComments;he&&(Fe.cStyleComments?(he>1?Ke.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ke.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),nt.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ke.push([O,/^#[^\r\n]*/,null,"#"])),Fe.cStyleComments&&(nt.push([O,/^\/\/[^\r\n]*/,null]),nt.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Re=Fe.regexLiterals;if(Re){var Ne=Re>1?"":`
\r`,Ue=Ne?".":"[\\S\\s]",rt="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";nt.push(["lang-regex",RegExp("^"+N+"("+rt+")")])}var st=Fe.types;st&&nt.push([m,st]);var dt=(""+Fe.keywords).replace(/^ | $/g,"");dt.length&&nt.push([R,new RegExp("^(?:"+dt.replace(/[\s,]+/g,"|")+")\\b"),null]),Ke.push([d,/^\s+/,null,` \r
\xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return Fe.regexLiterals&&(at+="(?!s*/)"),nt.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[h,new RegExp(at),null]),J(Ke,nt)}var me=ce({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(Fe,Ke,nt){for(var he=/(?:^|\s)nocode(?:\s|$)/,Re=/\r\n?|\n/,Ne=Fe.ownerDocument,Ue=Ne.createElement("li");Fe.firstChild;)Ue.appendChild(Fe.firstChild);var rt=[Ue];function st(Je){var kt=Je.nodeType;if(kt==1&&!he.test(Je.className))if(Je.nodeName==="br")dt(Je),Je.parentNode&&Je.parentNode.removeChild(Je);else for(var Ot=Je.firstChild;Ot;Ot=Ot.nextSibling)st(Ot);else if((kt==3||kt==4)&&nt){var tt=Je.nodeValue,ft=tt.match(Re);if(ft){var be=tt.substring(0,ft.index);Je.nodeValue=be;var Ee=tt.substring(ft.index+ft[0].length);if(Ee){var ge=Je.parentNode;ge.insertBefore(Ne.createTextNode(Ee),Je.nextSibling)}dt(Je),be||Je.parentNode.removeChild(Je)}}}function dt(Je){for(;!Je.nextSibling;)if(Je=Je.parentNode,!Je)return;function kt(ft,be){var Ee=be?ft.cloneNode(!1):ft,ge=ft.parentNode;if(ge){var de=kt(ge,1),fe=ft.nextSibling;de.appendChild(Ee);for(var we=fe;we;we=fe)fe=we.nextSibling,de.appendChild(we)}return Ee}for(var Ot=kt(Je.nextSibling,0),tt;(tt=Ot.parentNode)&&tt.nodeType===1;)Ot=tt;rt.push(Ot)}for(var at=0;at<rt.length;++at)st(rt[at]);Ke===(Ke|0)&&rt[0].setAttribute("value",Ke);var bt=Ne.createElement("ol");bt.className="linenums";for(var gt=Math.max(0,Ke-1|0)||0,at=0,xt=rt.length;at<xt;++at)Ue=rt[at],Ue.className="L"+(at+gt)%10,Ue.firstChild||Ue.appendChild(Ne.createTextNode("\xA0")),bt.appendChild(Ue);Fe.appendChild(bt)}function pe(Fe){var Ke=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ke=Ke&&+Ke[1]<=8;var nt=/\n/g,he=Fe.sourceCode,Re=he.length,Ne=0,Ue=Fe.spans,rt=Ue.length,st=0,dt=Fe.decorations,at=dt.length,bt=0;dt[at]=Re;var gt,xt;for(xt=gt=0;xt<at;)dt[xt]!==dt[xt+2]?(dt[gt++]=dt[xt++],dt[gt++]=dt[xt++]):xt+=2;for(at=gt,xt=gt=0;xt<at;){for(var Je=dt[xt],kt=dt[xt+1],Ot=xt+2;Ot+2<=at&&dt[Ot+1]===kt;)Ot+=2;dt[gt++]=Je,dt[gt++]=kt,xt=Ot}at=dt.length=gt;var tt=Fe.sourceNode,ft="";tt&&(ft=tt.style.display,tt.style.display="none");try{for(var be=null;st<rt;){var Ee=Ue[st],ge=Ue[st+2]||Re,de=dt[bt+2]||Re,Ot=Math.min(ge,de),fe=Ue[st+1],we;if(fe.nodeType!==1&&(we=he.substring(Ne,Ot))){Ke&&(we=we.replace(nt,"\r")),fe.nodeValue=we;var De=fe.ownerDocument,ke=De.createElement("span");ke.className=dt[bt+1];var Ze=fe.parentNode;Ze.replaceChild(ke,fe),ke.appendChild(fe),Ne<ge&&(Ue[st+1]=fe=De.createTextNode(he.substring(Ot,ge)),Ze.insertBefore(fe,ke.nextSibling))}Ne=Ot,Ne>=ge&&(st+=2),Ne>=de&&(bt+=2)}}finally{tt&&(tt.style.display=ft)}}var xe={};function se(Fe,Ke){for(var nt=Ke.length;--nt>=0;){var he=Ke[nt];xe.hasOwnProperty(he)?K.console&&console.warn("cannot override language handler %s",he):xe[he]=Fe}}function ae(Fe,Ke){return Fe&&xe.hasOwnProperty(Fe)||(Fe=/^\s*</.test(Ke)?"default-markup":"default-code"),xe[Fe]}se(me,["default-code"]),se(J([],[[d,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[O,/^<\!--[\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"]),se(J([[d,/^[\s]+/,null,` \r
`],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),se(J([],[[W,/^[\s\S]+/]]),["uq.val"]),se(ce({keywords:f,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),se(ce({keywords:"null,true,false"}),["json"]),se(ce({keywords:c,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),se(ce({keywords:y,cStyleComments:!0}),["java"]),se(ce({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),se(ce({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),se(ce({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),se(ce({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),se(ce({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),se(ce({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),se(J([],[[S,/^[\s\S]+/]]),["regex"]);function Ce(Fe){var Ke=Fe.langExtension;try{var nt=x(Fe.sourceNode,Fe.pre),he=nt.sourceCode;Fe.sourceCode=he,Fe.spans=nt.spans,Fe.basePos=0,ae(Ke,he)(Fe),pe(Fe)}catch(Re){K.console&&console.log(Re&&Re.stack||Re)}}function ze(Fe,Ke,nt){var he=nt||!1,Re=Ke||null,Ne=document.createElement("div");Ne.innerHTML="<pre>"+Fe+"</pre>",Ne=Ne.firstChild,he&&ue(Ne,he,!0);var Ue={langExtension:Re,numberLines:he,sourceNode:Ne,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ce(Ue),Ne.innerHTML}function Ye(Fe,Ke){var nt=Ke||document.body,he=nt.ownerDocument||document;function Re(Ee){return nt.getElementsByTagName(Ee)}for(var Ne=[Re("pre"),Re("code"),Re("xmp")],Ue=[],rt=0;rt<Ne.length;++rt)for(var st=0,dt=Ne[rt].length;st<dt;++st)Ue.push(Ne[rt][st]);Ne=null;var at=Date;at.now||(at={now:function(){return+new Date}});var bt=0,gt=/\blang(?:uage)?-([\w.]+)(?!\S)/,xt=/\bprettyprint\b/,Je=/\bprettyprinted\b/,kt=/pre|xmp/i,Ot=/^code$/i,tt=/^(?:pre|code|xmp)$/i,ft={};function be(){for(var Ee=K.PR_SHOULD_USE_CONTINUATION?at.now()+250:Infinity;bt<Ue.length&&at.now()<Ee;bt++){for(var ge=Ue[bt],de=ft,fe=ge;fe=fe.previousSibling;){var we=fe.nodeType,De=(we===7||we===8)&&fe.nodeValue;if(De?!/^\??prettify\b/.test(De):we!==3||/\S/.test(fe.nodeValue))break;if(De){de={},De.replace(/\b(\w+)=([\w:.%+-]+)/g,function(pr,kn,Mr){de[kn]=Mr});break}}var ke=ge.className;if((de!==ft||xt.test(ke))&&!Je.test(ke)){for(var Ze=!1,ht=ge.parentNode;ht;ht=ht.parentNode){var Ut=ht.tagName;if(tt.test(Ut)&&ht.className&&xt.test(ht.className)){Ze=!0;break}}if(!Ze){ge.className+=" prettyprinted";var nn=de.lang;if(!nn){nn=ke.match(gt);var tn;!nn&&(tn=ee(ge))&&Ot.test(tn.tagName)&&(nn=tn.className.match(gt)),nn&&(nn=nn[1])}var _n;if(kt.test(ge.tagName))_n=1;else{var bn=ge.currentStyle,Kt=he.defaultView,rr=bn?bn.whiteSpace:Kt&&Kt.getComputedStyle?Kt.getComputedStyle(ge,null).getPropertyValue("white-space"):0;_n=rr&&rr.substring(0,3)==="pre"}var Ln=de.linenums;(Ln=Ln==="true"||+Ln)||(Ln=ke.match(/\blinenums\b(?::(\d+))?/),Ln=Ln?Ln[1]&&Ln[1].length?+Ln[1]:!0:!1),Ln&&ue(ge,Ln,_n);var Cr={langExtension:nn,sourceNode:ge,numberLines:Ln,pre:_n,sourceCode:null,basePos:null,spans:null,decorations:null};Ce(Cr)}}}bt<Ue.length?K.setTimeout(be,250):typeof Fe=="function"&&Fe()}be()}var He=K.PR={createSimpleLexer:J,registerLangHandler:se,sourceDecorator:ce,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:W,PR_COMMENT:O,PR_DECLARATION:E,PR_KEYWORD:R,PR_LITERAL:v,PR_NOCODE:T,PR_PLAIN:d,PR_PUNCTUATION:h,PR_SOURCE:w,PR_STRING:S,PR_TAG:C,PR_TYPE:m,prettyPrintOne:M?K.prettyPrintOne=ze:F=ze,prettyPrint:G=M?K.prettyPrint=Ye:G=Ye},Ve=K.define;typeof Ve=="function"&&Ve.amd&&Ve("google-code-prettify",[],function(){return He})})()},T8No:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return G}),U.d(ve,"e",function(){return K}),U.d(ve,"c",function(){return h}),U.d(ve,"b",function(){return d}),U.d(ve,"d",function(){return C}),U.d(ve,"f",function(){return j});var ne=U("MNsG"),Y=U("N0LK"),M=U("Cg/j");let z=ne.k||"";const P=new Map;P.set("false",!1),P.set("true",!0),P.set("isMac",ne.f),P.set("isLinux",ne.d),P.set("isWindows",ne.i),P.set("isWeb",ne.h),P.set("isMacNative",ne.f&&!ne.h),P.set("isEdge",z.indexOf("Edg/")>=0),P.set("isFirefox",z.indexOf("Firefox")>=0),P.set("isChrome",z.indexOf("Chrome")>=0),P.set("isSafari",z.indexOf("Safari")>=0);const F=Object.prototype.hasOwnProperty;class G{static has(T){return f.create(T)}static equals(T,N){return y.create(T,N)}static regex(T,N){return S.create(T,N)}static not(T){return l.create(T)}static and(...T){return m.create(T,null)}static or(...T){return v.create(T,null,!0)}static deserialize(T,N=!1){return T?this._deserializeOrExpression(T,N):void 0}static _deserializeOrExpression(T,N){let _=T.split("||");return v.create(_.map(x=>this._deserializeAndExpression(x,N)),null,!0)}static _deserializeAndExpression(T,N){let _=T.split("&&");return m.create(_.map(x=>this._deserializeOne(x,N)),null)}static _deserializeOne(T,N){if(T=T.trim(),T.indexOf("!=")>=0){let _=T.split("!=");return p.create(_[0].trim(),this._deserializeValue(_[1],N))}if(T.indexOf("==")>=0){let _=T.split("==");return y.create(_[0].trim(),this._deserializeValue(_[1],N))}if(T.indexOf("=~")>=0){let _=T.split("=~");return S.create(_[0].trim(),this._deserializeRegexValue(_[1],N))}if(T.indexOf(" in ")>=0){let _=T.split(" in ");return c.create(_[0].trim(),_[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(T)){const _=T.split(">=");return i.create(_[0].trim(),_[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(T)){const _=T.split(">");return s.create(_[0].trim(),_[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(T)){const _=T.split("<=");return A.create(_[0].trim(),_[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(T)){const _=T.split("<");return D.create(_[0].trim(),_[1].trim())}return/^\!\s*/.test(T)?l.create(T.substr(1).trim()):f.create(T)}static _deserializeValue(T,N){if(T=T.trim(),T==="true")return!0;if(T==="false")return!1;let _=/^'([^']*)'$/.exec(T);return _?_[1].trim():T}static _deserializeRegexValue(T,N){if(Object(Y.C)(T)){if(N)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let _=T.indexOf("/"),x=T.lastIndexOf("/");if(_===x||_<0){if(N)throw new Error(`bad regexp-value '${T}', missing /-enclosure`);return console.warn(`bad regexp-value '${T}', missing /-enclosure`),null}let H=T.slice(_+1,x),X=T[x+1]==="i"?"i":"";try{return new RegExp(H,X)}catch(ee){if(N)throw new Error(`bad regexp-value '${T}', parse error: ${ee}`);return console.warn(`bad regexp-value '${T}', parse error: ${ee}`),null}}}function K(T,N){const _=T?T.substituteConstants():void 0,x=N?N.substituteConstants():void 0;return!_&&!x?!0:!_||!x?!1:_.equals(x)}function n(T,N){return T.cmp(N)}class I{constructor(){this.type=0}cmp(T){return this.type-T.type}equals(T){return T.type===this.type}substituteConstants(){return this}evaluate(T){return!1}serialize(){return"false"}keys(){return[]}negate(){return b.INSTANCE}}I.INSTANCE=new I;class b{constructor(){this.type=1}cmp(T){return this.type-T.type}equals(T){return T.type===this.type}substituteConstants(){return this}evaluate(T){return!0}serialize(){return"true"}keys(){return[]}negate(){return I.INSTANCE}}b.INSTANCE=new b;class f{constructor(T,N){this.key=T,this.negated=N,this.type=2}static create(T,N=null){const _=P.get(T);return typeof _=="boolean"?_?b.INSTANCE:I.INSTANCE:new f(T,N)}cmp(T){return T.type!==this.type?this.type-T.type:E(this.key,T.key)}equals(T){return T.type===this.type?this.key===T.key:!1}substituteConstants(){const T=P.get(this.key);return typeof T=="boolean"?T?b.INSTANCE:I.INSTANCE:this}evaluate(T){return!!T.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class y{constructor(T,N,_){this.key=T,this.value=N,this.negated=_,this.type=4}static create(T,N,_=null){if(typeof N=="boolean")return N?f.create(T,_):l.create(T,_);const x=P.get(T);if(typeof x=="boolean"){const H=x?"true":"false";return N===H?b.INSTANCE:I.INSTANCE}return new y(T,N,_)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){const T=P.get(this.key);if(typeof T=="boolean"){const N=T?"true":"false";return this.value===N?b.INSTANCE:I.INSTANCE}return this}evaluate(T){return T.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class c{constructor(T,N){this.key=T,this.valueKey=N,this.type=10,this.negated=null}static create(T,N){return new c(T,N)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.valueKey,T.key,T.valueKey)}equals(T){return T.type===this.type?this.key===T.key&&this.valueKey===T.valueKey:!1}substituteConstants(){return this}evaluate(T){const N=T.getValue(this.valueKey),_=T.getValue(this.key);return Array.isArray(N)?N.indexOf(_)>=0:typeof _=="string"&&typeof N=="object"&&N!==null?F.call(N,_):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(T){this._actual=T,this.type=11}static create(T){return new a(T)}cmp(T){return T.type!==this.type?this.type-T.type:this._actual.cmp(T._actual)}equals(T){return T.type===this.type?this._actual.equals(T._actual):!1}substituteConstants(){return this}evaluate(T){return!this._actual.evaluate(T)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class p{constructor(T,N,_){this.key=T,this.value=N,this.negated=_,this.type=5}static create(T,N,_=null){if(typeof N=="boolean")return N?l.create(T,_):f.create(T,_);const x=P.get(T);if(typeof x=="boolean"){const H=x?"true":"false";return N===H?I.INSTANCE:b.INSTANCE}return new p(T,N,_)}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){const T=P.get(this.key);if(typeof T=="boolean"){const N=T?"true":"false";return this.value===N?I.INSTANCE:b.INSTANCE}return this}evaluate(T){return T.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this.value,this)),this.negated}}class l{constructor(T,N){this.key=T,this.negated=N,this.type=3}static create(T,N=null){const _=P.get(T);return typeof _=="boolean"?_?I.INSTANCE:b.INSTANCE:new l(T,N)}cmp(T){return T.type!==this.type?this.type-T.type:E(this.key,T.key)}equals(T){return T.type===this.type?this.key===T.key:!1}substituteConstants(){const T=P.get(this.key);return typeof T=="boolean"?T?I.INSTANCE:b.INSTANCE:this}evaluate(T){return!T.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function u(T,N){if(typeof T=="string"){const _=parseFloat(T);isNaN(_)||(T=_)}return typeof T=="string"||typeof T=="number"?N(T):I.INSTANCE}class s{constructor(T,N,_){this.key=T,this.value=N,this.negated=_,this.type=12}static create(T,N,_=null){return u(N,x=>new s(T,x,_))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this.key,this.value,this)),this.negated}}class i{constructor(T,N,_){this.key=T,this.value=N,this.negated=_,this.type=13}static create(T,N,_=null){return u(N,x=>new i(T,x,_))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=D.create(this.key,this.value,this)),this.negated}}class D{constructor(T,N,_){this.key=T,this.value=N,this.negated=_,this.type=14}static create(T,N,_=null){return u(N,x=>new D(T,x,_))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class A{constructor(T,N,_){this.key=T,this.value=N,this.negated=_,this.type=15}static create(T,N,_=null){return u(N,x=>new A(T,x,_))}cmp(T){return T.type!==this.type?this.type-T.type:w(this.key,this.value,T.key,T.value)}equals(T){return T.type===this.type?this.key===T.key&&this.value===T.value:!1}substituteConstants(){return this}evaluate(T){return typeof this.value=="string"?!1:parseFloat(T.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class S{constructor(T,N){this.key=T,this.regexp=N,this.type=7,this.negated=null}static create(T,N){return new S(T,N)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.key<T.key)return-1;if(this.key>T.key)return 1;const N=this.regexp?this.regexp.source:"",_=T.regexp?T.regexp.source:"";return N<_?-1:N>_?1:0}equals(T){if(T.type===this.type){const N=this.regexp?this.regexp.source:"",_=T.regexp?T.regexp.source:"";return this.key===T.key&&N===_}return!1}substituteConstants(){return this}evaluate(T){let N=T.getValue(this.key);return this.regexp?this.regexp.test(N):!1}serialize(){const T=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${T}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this)),this.negated}}class R{constructor(T){this._actual=T,this.type=8}static create(T){return new R(T)}cmp(T){return T.type!==this.type?this.type-T.type:this._actual.cmp(T._actual)}equals(T){return T.type===this.type?this._actual.equals(T._actual):!1}substituteConstants(){return this}evaluate(T){return!this._actual.evaluate(T)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(T){let N=null;for(let _=0,x=T.length;_<x;_++){const H=T[_].substituteConstants();if(T[_]!==H&&N===null){N=[];for(let X=0;X<_;X++)N[X]=T[X]}N!==null&&(N[_]=H)}return N===null?T:N}class m{constructor(T,N){this.expr=T,this.negated=N,this.type=6}static create(T,N){return m._normalizeArr(T,N)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.length<T.expr.length)return-1;if(this.expr.length>T.expr.length)return 1;for(let N=0,_=this.expr.length;N<_;N++){const x=n(this.expr[N],T.expr[N]);if(x!==0)return x}return 0}equals(T){if(T.type===this.type){if(this.expr.length!==T.expr.length)return!1;for(let N=0,_=this.expr.length;N<_;N++)if(!this.expr[N].equals(T.expr[N]))return!1;return!0}return!1}substituteConstants(){const T=O(this.expr);return T===this.expr?this:m.create(T,this.negated)}evaluate(T){for(let N=0,_=this.expr.length;N<_;N++)if(!this.expr[N].evaluate(T))return!1;return!0}static _normalizeArr(T,N){const _=[];let x=!1;for(const H of T){if(!H)continue;if(H.type===1){x=!0;continue}if(H.type===0)return I.INSTANCE;if(H.type===6){_.push(...H.expr);continue}_.push(H)}if(_.length===0&&x)return b.INSTANCE;if(_.length===0)return;if(_.length===1)return _[0];_.sort(n);for(let H=1;H<_.length;H++)_[H-1].equals(_[H])&&(_.splice(H,1),H--);if(_.length===1)return _[0];for(;_.length>1;){const H=_[_.length-1];if(H.type!==9)break;_.pop();const X=_.pop(),ee=_.length===0,J=v.create(H.expr.map(ce=>m.create([ce,X],null)),null,ee);J&&(_.push(J),_.sort(n))}return _.length===1?_[0]:new m(_,N)}serialize(){return this.expr.map(T=>T.serialize()).join(" && ")}keys(){const T=[];for(let N of this.expr)T.push(...N.keys());return T}negate(){if(!this.negated){const T=[];for(let N of this.expr)T.push(N.negate());this.negated=v.create(T,this,!0)}return this.negated}}class v{constructor(T,N){this.expr=T,this.negated=N,this.type=9}static create(T,N,_){return v._normalizeArr(T,N,_)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.length<T.expr.length)return-1;if(this.expr.length>T.expr.length)return 1;for(let N=0,_=this.expr.length;N<_;N++){const x=n(this.expr[N],T.expr[N]);if(x!==0)return x}return 0}equals(T){if(T.type===this.type){if(this.expr.length!==T.expr.length)return!1;for(let N=0,_=this.expr.length;N<_;N++)if(!this.expr[N].equals(T.expr[N]))return!1;return!0}return!1}substituteConstants(){const T=O(this.expr);return T===this.expr?this:v.create(T,this.negated,!1)}evaluate(T){for(let N=0,_=this.expr.length;N<_;N++)if(this.expr[N].evaluate(T))return!0;return!1}static _normalizeArr(T,N,_){let x=[],H=!1;if(T){for(let X=0,ee=T.length;X<ee;X++){const J=T[X];if(!J)continue;if(J.type===0){H=!0;continue}if(J.type===1)return b.INSTANCE;if(J.type===9){x=x.concat(J.expr);continue}x.push(J)}if(x.length===0&&H)return I.INSTANCE;x.sort(n)}if(x.length===0)return;if(x.length===1)return x[0];for(let X=1;X<x.length;X++)x[X-1].equals(x[X])&&(x.splice(X,1),X--);if(x.length===1)return x[0];if(_){for(let X=0;X<x.length;X++)for(let ee=X+1;ee<x.length;ee++)j(x[X],x[ee])&&(x.splice(ee,1),ee--);if(x.length===1)return x[0]}return new v(x,N)}serialize(){return this.expr.map(T=>T.serialize()).join(" || ")}keys(){const T=[];for(let N of this.expr)T.push(...N.keys());return T}negate(){if(!this.negated){let T=[];for(let N of this.expr)T.push(N.negate());for(;T.length>1;){const N=T.shift(),_=T.shift(),x=[];for(const X of W(N))for(const ee of W(_))x.push(m.create([X,ee],null));const H=T.length===0;T.unshift(v.create(x,null,H))}this.negated=T[0]}return this.negated}}class h extends f{constructor(T,N,_){super(T,null);this._defaultValue=N,typeof _=="object"?h._info.push(Object.assign(Object.assign({},_),{key:T})):_!==!0&&h._info.push({key:T,description:_,type:N!=null?typeof N:void 0})}static all(){return h._info.values()}bindTo(T){return T.createKey(this.key,this._defaultValue)}getValue(T){return T.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(T){return y.create(this.key,T)}}h._info=[];const d=Object(M.c)("contextKeyService"),C="setContext";function E(T,N){return T<N?-1:T>N?1:0}function w(T,N,_,x){return T<_?-1:T>_?1:N<x?-1:N>x?1:0}function j(T,N){if(N.type===6&&T.type!==9&&T.type!==6){for(const H of N.expr)if(T.equals(H))return!0}const _=T.negate(),x=W(_).concat(W(N));x.sort(n);for(let H=0;H<x.length;H++){const X=x[H],ee=X.negate();for(let J=H+1;J<x.length;J++){const ce=x[J];if(ee.equals(ce))return!0}}return!1}function W(T){return T.type===9?T.expr:[T]}},TXwP:function(ut,ve,U){var ne,Y;(function(){var M;(function(){"use strict";var P=[,,function(n){function I(y){this.__parent=y,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 y=new I(this.__parent);return y.set_indent(this.__indent_count,this.__alignment_count),y},I.prototype.item=function(y){return y<0?this.__items[this.__items.length+y]:this.__items[y]},I.prototype.has_match=function(y){for(var c=this.__items.length-1;c>=0;c--)if(this.__items[c].match(y))return!0;return!1},I.prototype.set_indent=function(y,c){this.is_empty()&&(this.__indent_count=y||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 y=this.__parent.current_line;return y.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),y.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),y.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,y.__items[0]===" "&&(y.__items.splice(0,1),y.__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(y){this.__items.push(y);var c=y.lastIndexOf(`
`);c!==-1?this.__character_count=y.length-c:this.__character_count+=y.length},I.prototype.pop=function(){var y=null;return this.is_empty()||(y=this.__items.pop(),this.__character_count-=y.length),y},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 y="";return this.is_empty()?this.__parent.indent_empty_lines&&(y=this.__parent.get_indent_string(this.__indent_count)):(y=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),y+=this.__items.join("")),y};function b(y,c){this.__cache=[""],this.__indent_size=y.indent_size,this.__indent_string=y.indent_char,y.indent_with_tabs||(this.__indent_string=new Array(y.indent_size+1).join(y.indent_char)),c=c||"",y.indent_level>0&&(c=new Array(y.indent_level+1).join(this.__indent_string)),this.__base_string=c,this.__base_string_length=c.length}b.prototype.get_indent_size=function(y,c){var a=this.__base_string_length;return c=c||0,y<0&&(a=0),a+=y*this.__indent_size,a+=c,a},b.prototype.get_indent_string=function(y,c){var a=this.__base_string;return c=c||0,y<0&&(y=0,a=""),c+=y*this.__indent_size,this.__ensure_cache(c),a+=this.__cache[c],a},b.prototype.__ensure_cache=function(y){for(;y>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var y=this.__cache.length,c=0,a="";this.__indent_size&&y>=this.__indent_size&&(c=Math.floor(y/this.__indent_size),y-=c*this.__indent_size,a=new Array(c+1).join(this.__indent_string)),y&&(a+=new Array(y+1).join(" ")),this.__cache.push(a)};function f(y,c){this.__indent_cache=new b(y,c),this.raw=!1,this._end_with_newline=y.end_with_newline,this.indent_size=y.indent_size,this.wrap_line_length=y.wrap_line_length,this.indent_empty_lines=y.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()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(y,c){return this.__indent_cache.get_indent_string(y,c)},f.prototype.get_indent_size=function(y,c){return this.__indent_cache.get_indent_size(y,c)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(y){return this.is_empty()||!y&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(y){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 y!==`
`&&(a=a.replace(/[\n]/g,y)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(y,c){return y=y||0,c=c||0,this.next_line.set_indent(y,c),this.__lines.length>1?(this.current_line.set_indent(y,c),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(y){for(var c=0;c<y.newlines;c++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(y.whitespace_before),this.current_line.push(y.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(y){this.__add_space_before_token(),this.current_line.push(y),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(y){for(var c=this.__lines.length;y<c;)this.__lines[y]._remove_indent(),y++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(y){for(y=y===void 0?!1:y,this.current_line.trim();y&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(y,c){for(var a=this.__lines.length-2;a>=0;){var p=this.__lines[a];if(p.is_empty())break;if(p.item(0).indexOf(y)!==0&&p.item(-1)!==c){this.__lines.splice(a+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},n.exports.Output=f},,,,function(n){function I(y,c){this.raw_options=b(y,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(y,c){var a=this.raw_options[y],p=c||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(p=a.concat()):typeof a=="string"&&(p=a.split(/[^a-zA-Z0-9_\/\-]+/)),p},I.prototype._get_boolean=function(y,c){var a=this.raw_options[y],p=a===void 0?!!c:!!a;return p},I.prototype._get_characters=function(y,c){var a=this.raw_options[y],p=c||"";return typeof a=="string"&&(p=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},I.prototype._get_number=function(y,c){var a=this.raw_options[y];c=parseInt(c,10),isNaN(c)&&(c=0);var p=parseInt(a,10);return isNaN(p)&&(p=c),p},I.prototype._get_selection=function(y,c,a){var p=this._get_selection_list(y,c,a);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+y+`' can only be one of the following values:
`+c+`
You passed in: '`+this.raw_options[y]+"'");return p[0]},I.prototype._get_selection_list=function(y,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 p=this._get_array(y,a);if(!this._is_valid_selection(p,c))throw new Error("Invalid Option Value: The option '"+y+`' can contain only the following values:
`+c+`
You passed in: '`+this.raw_options[y]+"'");return p},I.prototype._is_valid_selection=function(y,c){return y.length&&c.length&&!y.some(function(a){return c.indexOf(a)===-1})};function b(y,c){var a={};y=f(y);var p;for(p in y)p!==c&&(a[p]=y[p]);if(c&&y[c])for(p in y[c])a[p]=y[c][p];return a}function f(y){var c={},a;for(a in y){var p=a.replace(/-/g,"_");c[p]=y[a]}return c}n.exports.Options=I,n.exports.normalizeOpts=f,n.exports.mergeOpts=b},,function(n){var I=RegExp.prototype.hasOwnProperty("sticky");function b(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}b.prototype.restart=function(){this.__position=0},b.prototype.back=function(){this.__position>0&&(this.__position-=1)},b.prototype.hasNext=function(){return this.__position<this.__input_length},b.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},b.prototype.peek=function(f){var y=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(y=this.__input.charAt(f)),y},b.prototype.__match=function(f,y){f.lastIndex=y;var c=f.exec(this.__input);return c&&!(I&&f.sticky)&&(c.index!==y&&(c=null)),c},b.prototype.test=function(f,y){return y=y||0,y+=this.__position,y>=0&&y<this.__input_length?!!this.__match(f,y):!1},b.prototype.testChar=function(f,y){var c=this.peek(y);return f.lastIndex=0,c!==null&&f.test(c)},b.prototype.match=function(f){var y=this.__match(f,this.__position);return y?this.__position+=y[0].length:y=null,y},b.prototype.read=function(f,y,c){var a="",p;return f&&(p=this.match(f),p&&(a+=p[0])),y&&(p||!f)&&(a+=this.readUntil(y,c)),a},b.prototype.readUntil=function(f,y){var c="",a=this.__position;f.lastIndex=this.__position;var p=f.exec(this.__input);return p?(a=p.index,y&&(a+=p[0].length)):a=this.__input_length,c=this.__input.substring(this.__position,a),this.__position=a,c},b.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},b.prototype.get_regexp=function(f,y){var c=null,a="g";return y&&I&&(a="y"),typeof f=="string"&&f!==""?c=new RegExp(f,a):f&&(c=new RegExp(f.source,a)),c},b.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},b.prototype.peekUntilAfter=function(f){var y=this.__position,c=this.readUntilAfter(f);return this.__position=y,c},b.prototype.lookBack=function(f){var y=this.__position-1;return y>=f.length&&this.__input.substring(y-f.length,y).toLowerCase()===f},n.exports.InputScanner=b},,,,,function(n){function I(b,f){b=typeof b=="string"?b:b.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+f,"g")}I.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var y=this.__directive_pattern.exec(b);y;)f[y[1]]=y[2],y=this.__directive_pattern.exec(b);return f},I.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=I},,function(n,I,b){var f=b(16).Beautifier,y=b(17).Options;function c(a,p){var l=new f(a,p);return l.beautify()}n.exports=c,n.exports.defaultOptions=function(){return new y}},function(n,I,b){var f=b(17).Options,y=b(2).Output,c=b(8).InputScanner,a=b(13).Directives,p=new a(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,s=/\s/,i=/(?:\s|\n)+/g,D=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,A=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(R,O){this._source_text=R||"",this._options=new f(O),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"]}S.prototype.eatString=function(R){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(R.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(R){for(var O=s.test(this._input.peek()),m=0;s.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===`
`&&((m===0||m<this._options.max_preserve_newlines)&&(m++,this._output.add_new_line(!0)));return O},S.prototype.foundNestedPseudoClass=function(){for(var R=0,O=1,m=this._input.peek(O);m;){if(m==="{")return!0;if(m==="(")R+=1;else if(m===")"){if(R===0)return!1;R-=1}else if(m===";"||m==="}")return!1;O++,m=this._input.peek(O)}return!1},S.prototype.print_string=function(R){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(R)},S.prototype.preserveSingleSpace=function(R){R&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R=this._source_text,O=this._options.eol;O==="auto"&&(O=`
`,R&&l.test(R||"")&&(O=R.match(l)[0])),R=R.replace(u,`
`);var m=R.match(/^[\t ]*/)[0];this._output=new y(this._options,m),this._input=new c(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,h=!1,d=!1,C=!1,E=!1,w=!1,j=!1,W=this._ch,T=!1,N,_,x;N=this._input.read(i),_=N!=="",x=W,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),W=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(D),X=p.get_directives(H);X&&X.ignore==="start"&&(H+=p.readIgnored(this._input)),this.print_string(H),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(_),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ee=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ee.match(/[ :]$/)&&(ee=this.eatString(": ").replace(/\s$/,""),this.print_string(ee),this._output.space_before_token=!0),ee=ee.replace(/\s$/,""),ee==="extend"?E=!0:ee==="import"&&(w=!0),ee in this.NESTED_AT_RULE?(this._nestedLevel+=1,ee in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!h&&v===0&&ee.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(_),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),C?(C=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),w=!1,E=!1,d&&(this.outdent(),d=!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 J=0;J<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;J++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[J])){T=!0;break}(h||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&v===0?(this.print_string(":"),d||(d=!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 ce=x==='"'||x==="'";this.preserveSingleSpace(ce||_),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")T=!1,v===0?(d&&(this.outdent(),d=!1),E=!1,w=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),v++,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(")")),v&&(v--,this.outdent()));else{var me=!1;this._input.lookBack("with")&&(me=!0),this.preserveSingleSpace(_||me),this.print_string(this._ch),d&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),j=!0):(this.eatWhitespace(),v++,this.indent())}else if(this._ch===")")v&&(v--,this.outdent()),j&&this._input.peek()===";"&&this._options.selector_separator_newline&&(j=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!d||j)&&v===0&&!w&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&v===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(_),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 ue=x==='"'||x==="'";this.preserveSingleSpace(ue||_),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&T&&this._output.add_new_line()}var pe=this._output.get_code(O);return pe},n.exports.Beautifier=S},function(n,I,b){var f=b(6).Options;function y(c){f.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 p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l<p.length;l++)p[l]!=="expand"?this.brace_style="collapse":this.brace_style=p[l]}y.prototype=new f,n.exports.Options=y}],F={};function G(n){var I=F[n];if(I!==void 0)return I.exports;var b=F[n]={exports:{}};return P[n](b,b.exports,G),b.exports}var K=G(15);M=K})();var z=M;!(ne=[],Y=function(){return{css_beautify:z}}.apply(ve,ne),Y!==void 0&&(ut.exports=Y))})()},Vhoy:function(ut,ve,U){"use strict";U.d(ve,"d",function(){return z}),U.d(ve,"e",function(){return P}),U.d(ve,"c",function(){return F}),U.d(ve,"b",function(){return G}),U.d(ve,"a",function(){return K});var ne=U("MI8n");class Y{constructor(){this._icons=new Map,this._onDidRegister=new ne.b}add(n){const I=this._icons.get(n.id);I?n.description?I.description=n.description:console.error(`Duplicate registration of codicon ${n.id}`):(this._icons.set(n.id,n),this._onDidRegister.fire(n))}get(n){return this._icons.get(n)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const M=new Y,z=M;function P(n,I){return new G(n,I)}function F(n){return n?n.replace(/\$\((.*?)\)/g,(I,b)=>` ${b} `).trim():""}class G{constructor(n,I,b){this.id=n,this.definition=I,this.description=b,M.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var K;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9\\-]+",n.iconModifierExpression="~[A-Za-z]+";const I=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function b(c){if(c instanceof G)return["codicon","codicon-"+c.id];const a=I.exec(c.id);if(!a)return b(G.error);let[,p,l]=a;const u=["codicon","codicon-"+p];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=b;function f(c){return b(c).join(" ")}n.asClassName=f;function y(c){return"."+b(c).join(".")}n.asCSSSelector=y})(K||(K={})),function(n){n.add=new n("add",{fontCharacter:"\\ea60"}),n.plus=new n("plus",n.add.definition),n.gistNew=new n("gist-new",n.add.definition),n.repoCreate=new n("repo-create",n.add.definition),n.lightbulb=new n("lightbulb",{fontCharacter:"\\ea61"}),n.lightBulb=new n("light-bulb",{fontCharacter:"\\ea61"}),n.repo=new n("repo",{fontCharacter:"\\ea62"}),n.repoDelete=new n("repo-delete",{fontCharacter:"\\ea62"}),n.gistFork=new n("gist-fork",{fontCharacter:"\\ea63"}),n.repoForked=new n("repo-forked",{fontCharacter:"\\ea63"}),n.gitPullRequest=new n("git-pull-request",{fontCharacter:"\\ea64"}),n.gitPullRequestAbandoned=new n("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),n.recordKeys=new n("record-keys",{fontCharacter:"\\ea65"}),n.keyboard=new n("keyboard",{fontCharacter:"\\ea65"}),n.tag=new n("tag",{fontCharacter:"\\ea66"}),n.tagAdd=new n("tag-add",{fontCharacter:"\\ea66"}),n.tagRemove=new n("tag-remove",{fontCharacter:"\\ea66"}),n.person=new n("person",{fontCharacter:"\\ea67"}),n.personFollow=new n("person-follow",{fontCharacter:"\\ea67"}),n.personOutline=new n("person-outline",{fontCharacter:"\\ea67"}),n.personFilled=new n("person-filled",{fontCharacter:"\\ea67"}),n.gitBranch=new n("git-branch",{fontCharacter:"\\ea68"}),n.gitBranchCreate=new n("git-branch-create",{fontCharacter:"\\ea68"}),n.gitBranchDelete=new n("git-branch-delete",{fontCharacter:"\\ea68"}),n.sourceControl=new n("source-control",{fontCharacter:"\\ea68"}),n.mirror=new n("mirror",{fontCharacter:"\\ea69"}),n.mirrorPublic=new n("mirror-public",{fontCharacter:"\\ea69"}),n.star=new n("star",{fontCharacter:"\\ea6a"}),n.starAdd=new n("star-add",{fontCharacter:"\\ea6a"}),n.starDelete=new n("star-delete",{fontCharacter:"\\ea6a"}),n.starEmpty=new n("star-empty",{fontCharacter:"\\ea6a"}),n.comment=new n("comment",{fontCharacter:"\\ea6b"}),n.commentAdd=new n("comment-add",{fontCharacter:"\\ea6b"}),n.alert=new n("alert",{fontCharacter:"\\ea6c"}),n.warning=new n("warning",{fontCharacter:"\\ea6c"}),n.search=new n("search",{fontCharacter:"\\ea6d"}),n.searchSave=new n("search-save",{fontCharacter:"\\ea6d"}),n.logOut=new n("log-out",{fontCharacter:"\\ea6e"}),n.signOut=new n("sign-out",{fontCharacter:"\\ea6e"}),n.logIn=new n("log-in",{fontCharacter:"\\ea6f"}),n.signIn=new n("sign-in",{fontCharacter:"\\ea6f"}),n.eye=new n("eye",{fontCharacter:"\\ea70"}),n.eyeUnwatch=new n("eye-unwatch",{fontCharacter:"\\ea70"}),n.eyeWatch=new n("eye-watch",{fontCharacter:"\\ea70"}),n.circleFilled=new n("circle-filled",{fontCharacter:"\\ea71"}),n.primitiveDot=new n("primitive-dot",{fontCharacter:"\\ea71"}),n.closeDirty=new n("close-dirty",{fontCharacter:"\\ea71"}),n.debugBreakpoint=new n("debug-breakpoint",{fontCharacter:"\\ea71"}),n.debugBreakpointDisabled=new n("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),n.debugHint=new n("debug-hint",{fontCharacter:"\\ea71"}),n.primitiveSquare=new n("primitive-square",{fontCharacter:"\\ea72"}),n.edit=new n("edit",{fontCharacter:"\\ea73"}),n.pencil=new n("pencil",{fontCharacter:"\\ea73"}),n.info=new n("info",{fontCharacter:"\\ea74"}),n.issueOpened=new n("issue-opened",{fontCharacter:"\\ea74"}),n.gistPrivate=new n("gist-private",{fontCharacter:"\\ea75"}),n.gitForkPrivate=new n("git-fork-private",{fontCharacter:"\\ea75"}),n.lock=new n("lock",{fontCharacter:"\\ea75"}),n.mirrorPrivate=new n("mirror-private",{fontCharacter:"\\ea75"}),n.close=new n("close",{fontCharacter:"\\ea76"}),n.removeClose=new n("remove-close",{fontCharacter:"\\ea76"}),n.x=new n("x",{fontCharacter:"\\ea76"}),n.repoSync=new n("repo-sync",{fontCharacter:"\\ea77"}),n.sync=new n("sync",{fontCharacter:"\\ea77"}),n.clone=new n("clone",{fontCharacter:"\\ea78"}),n.desktopDownload=new n("desktop-download",{fontCharacter:"\\ea78"}),n.beaker=new n("beaker",{fontCharacter:"\\ea79"}),n.microscope=new n("microscope",{fontCharacter:"\\ea79"}),n.vm=new n("vm",{fontCharacter:"\\ea7a"}),n.deviceDesktop=new n("device-desktop",{fontCharacter:"\\ea7a"}),n.file=new n("file",{fontCharacter:"\\ea7b"}),n.fileText=new n("file-text",{fontCharacter:"\\ea7b"}),n.more=new n("more",{fontCharacter:"\\ea7c"}),n.ellipsis=new n("ellipsis",{fontCharacter:"\\ea7c"}),n.kebabHorizontal=new n("kebab-horizontal",{fontCharacter:"\\ea7c"}),n.mailReply=new n("mail-reply",{fontCharacter:"\\ea7d"}),n.reply=new n("reply",{fontCharacter:"\\ea7d"}),n.organization=new n("organization",{fontCharacter:"\\ea7e"}),n.organizationFilled=new n("organization-filled",{fontCharacter:"\\ea7e"}),n.organizationOutline=new n("organization-outline",{fontCharacter:"\\ea7e"}),n.newFile=new n("new-file",{fontCharacter:"\\ea7f"}),n.fileAdd=new n("file-add",{fontCharacter:"\\ea7f"}),n.newFolder=new n("new-folder",{fontCharacter:"\\ea80"}),n.fileDirectoryCreate=new n("file-directory-create",{fontCharacter:"\\ea80"}),n.trash=new n("trash",{fontCharacter:"\\ea81"}),n.trashcan=new n("trashcan",{fontCharacter:"\\ea81"}),n.history=new n("history",{fontCharacter:"\\ea82"}),n.clock=new n("clock",{fontCharacter:"\\ea82"}),n.folder=new n("folder",{fontCharacter:"\\ea83"}),n.fileDirectory=new n("file-directory",{fontCharacter:"\\ea83"}),n.symbolFolder=new n("symbol-folder",{fontCharacter:"\\ea83"}),n.logoGithub=new n("logo-github",{fontCharacter:"\\ea84"}),n.markGithub=new n("mark-github",{fontCharacter:"\\ea84"}),n.github=new n("github",{fontCharacter:"\\ea84"}),n.terminal=new n("terminal",{fontCharacter:"\\ea85"}),n.console=new n("console",{fontCharacter:"\\ea85"}),n.repl=new n("repl",{fontCharacter:"\\ea85"}),n.zap=new n("zap",{fontCharacter:"\\ea86"}),n.symbolEvent=new n("symbol-event",{fontCharacter:"\\ea86"}),n.error=new n("error",{fontCharacter:"\\ea87"}),n.stop=new n("stop",{fontCharacter:"\\ea87"}),n.variable=new n("variable",{fontCharacter:"\\ea88"}),n.symbolVariable=new n("symbol-variable",{fontCharacter:"\\ea88"}),n.array=new n("array",{fontCharacter:"\\ea8a"}),n.symbolArray=new n("symbol-array",{fontCharacter:"\\ea8a"}),n.symbolModule=new n("symbol-module",{fontCharacter:"\\ea8b"}),n.symbolPackage=new n("symbol-package",{fontCharacter:"\\ea8b"}),n.symbolNamespace=new n("symbol-namespace",{fontCharacter:"\\ea8b"}),n.symbolObject=new n("symbol-object",{fontCharacter:"\\ea8b"}),n.symbolMethod=new n("symbol-method",{fontCharacter:"\\ea8c"}),n.symbolFunction=new n("symbol-function",{fontCharacter:"\\ea8c"}),n.symbolConstructor=new n("symbol-constructor",{fontCharacter:"\\ea8c"}),n.symbolBoolean=new n("symbol-boolean",{fontCharacter:"\\ea8f"}),n.symbolNull=new n("symbol-null",{fontCharacter:"\\ea8f"}),n.symbolNumeric=new n("symbol-numeric",{fontCharacter:"\\ea90"}),n.symbolNumber=new n("symbol-number",{fontCharacter:"\\ea90"}),n.symbolStructure=new n("symbol-structure",{fontCharacter:"\\ea91"}),n.symbolStruct=new n("symbol-struct",{fontCharacter:"\\ea91"}),n.symbolParameter=new n("symbol-parameter",{fontCharacter:"\\ea92"}),n.symbolTypeParameter=new n("symbol-type-parameter",{fontCharacter:"\\ea92"}),n.symbolKey=new n("symbol-key",{fontCharacter:"\\ea93"}),n.symbolText=new n("symbol-text",{fontCharacter:"\\ea93"}),n.symbolReference=new n("symbol-reference",{fontCharacter:"\\ea94"}),n.goToFile=new n("go-to-file",{fontCharacter:"\\ea94"}),n.symbolEnum=new n("symbol-enum",{fontCharacter:"\\ea95"}),n.symbolValue=new n("symbol-value",{fontCharacter:"\\ea95"}),n.symbolRuler=new n("symbol-ruler",{fontCharacter:"\\ea96"}),n.symbolUnit=new n("symbol-unit",{fontCharacter:"\\ea96"}),n.activateBreakpoints=new n("activate-breakpoints",{fontCharacter:"\\ea97"}),n.archive=new n("archive",{fontCharacter:"\\ea98"}),n.arrowBoth=new n("arrow-both",{fontCharacter:"\\ea99"}),n.arrowDown=new n("arrow-down",{fontCharacter:"\\ea9a"}),n.arrowLeft=new n("arrow-left",{fontCharacter:"\\ea9b"}),n.arrowRight=new n("arrow-right",{fontCharacter:"\\ea9c"}),n.arrowSmallDown=new n("arrow-small-down",{fontCharacter:"\\ea9d"}),n.arrowSmallLeft=new n("arrow-small-left",{fontCharacter:"\\ea9e"}),n.arrowSmallRight=new n("arrow-small-right",{fontCharacter:"\\ea9f"}),n.arrowSmallUp=new n("arrow-small-up",{fontCharacter:"\\eaa0"}),n.arrowUp=new n("arrow-up",{fontCharacter:"\\eaa1"}),n.bell=new n("bell",{fontCharacter:"\\eaa2"}),n.bold=new n("bold",{fontCharacter:"\\eaa3"}),n.book=new n("book",{fontCharacter:"\\eaa4"}),n.bookmark=new n("bookmark",{fontCharacter:"\\eaa5"}),n.debugBreakpointConditionalUnverified=new n("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),n.debugBreakpointConditional=new n("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),n.debugBreakpointConditionalDisabled=new n("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),n.debugBreakpointDataUnverified=new n("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),n.debugBreakpointData=new n("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),n.debugBreakpointDataDisabled=new n("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),n.debugBreakpointLogUnverified=new n("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),n.debugBreakpointLog=new n("debug-breakpoint-log",{fontCharacter:"\\eaab"}),n.debugBreakpointLogDisabled=new n("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),n.briefcase=new n("briefcase",{fontCharacter:"\\eaac"}),n.broadcast=new n("broadcast",{fontCharacter:"\\eaad"}),n.browser=new n("browser",{fontCharacter:"\\eaae"}),n.bug=new n("bug",{fontCharacter:"\\eaaf"}),n.calendar=new n("calendar",{fontCharacter:"\\eab0"}),n.caseSensitive=new n("case-sensitive",{fontCharacter:"\\eab1"}),n.check=new n("check",{fontCharacter:"\\eab2"}),n.checklist=new n("checklist",{fontCharacter:"\\eab3"}),n.chevronDown=new n("chevron-down",{fontCharacter:"\\eab4"}),n.dropDownButton=new n("drop-down-button",n.chevronDown.definition),n.chevronLeft=new n("chevron-left",{fontCharacter:"\\eab5"}),n.chevronRight=new n("chevron-right",{fontCharacter:"\\eab6"}),n.chevronUp=new n("chevron-up",{fontCharacter:"\\eab7"}),n.chromeClose=new n("chrome-close",{fontCharacter:"\\eab8"}),n.chromeMaximize=new n("chrome-maximize",{fontCharacter:"\\eab9"}),n.chromeMinimize=new n("chrome-minimize",{fontCharacter:"\\eaba"}),n.chromeRestore=new n("chrome-restore",{fontCharacter:"\\eabb"}),n.circleOutline=new n("circle-outline",{fontCharacter:"\\eabc"}),n.debugBreakpointUnverified=new n("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),n.circleSlash=new n("circle-slash",{fontCharacter:"\\eabd"}),n.circuitBoard=new n("circuit-board",{fontCharacter:"\\eabe"}),n.clearAll=new n("clear-all",{fontCharacter:"\\eabf"}),n.clippy=new n("clippy",{fontCharacter:"\\eac0"}),n.closeAll=new n("close-all",{fontCharacter:"\\eac1"}),n.cloudDownload=new n("cloud-download",{fontCharacter:"\\eac2"}),n.cloudUpload=new n("cloud-upload",{fontCharacter:"\\eac3"}),n.code=new n("code",{fontCharacter:"\\eac4"}),n.collapseAll=new n("collapse-all",{fontCharacter:"\\eac5"}),n.colorMode=new n("color-mode",{fontCharacter:"\\eac6"}),n.commentDiscussion=new n("comment-discussion",{fontCharacter:"\\eac7"}),n.compareChanges=new n("compare-changes",{fontCharacter:"\\eafd"}),n.creditCard=new n("credit-card",{fontCharacter:"\\eac9"}),n.dash=new n("dash",{fontCharacter:"\\eacc"}),n.dashboard=new n("dashboard",{fontCharacter:"\\eacd"}),n.database=new n("database",{fontCharacter:"\\eace"}),n.debugContinue=new n("debug-continue",{fontCharacter:"\\eacf"}),n.debugDisconnect=new n("debug-disconnect",{fontCharacter:"\\ead0"}),n.debugPause=new n("debug-pause",{fontCharacter:"\\ead1"}),n.debugRestart=new n("debug-restart",{fontCharacter:"\\ead2"}),n.debugStart=new n("debug-start",{fontCharacter:"\\ead3"}),n.debugStepInto=new n("debug-step-into",{fontCharacter:"\\ead4"}),n.debugStepOut=new n("debug-step-out",{fontCharacter:"\\ead5"}),n.debugStepOver=new n("debug-step-over",{fontCharacter:"\\ead6"}),n.debugStop=new n("debug-stop",{fontCharacter:"\\ead7"}),n.debug=new n("debug",{fontCharacter:"\\ead8"}),n.deviceCameraVideo=new n("device-camera-video",{fontCharacter:"\\ead9"}),n.deviceCamera=new n("device-camera",{fontCharacter:"\\eada"}),n.deviceMobile=new n("device-mobile",{fontCharacter:"\\eadb"}),n.diffAdded=new n("diff-added",{fontCharacter:"\\eadc"}),n.diffIgnored=new n("diff-ignored",{fontCharacter:"\\eadd"}),n.diffModified=new n("diff-modified",{fontCharacter:"\\eade"}),n.diffRemoved=new n("diff-removed",{fontCharacter:"\\eadf"}),n.diffRenamed=new n("diff-renamed",{fontCharacter:"\\eae0"}),n.diff=new n("diff",{fontCharacter:"\\eae1"}),n.discard=new n("discard",{fontCharacter:"\\eae2"}),n.editorLayout=new n("editor-layout",{fontCharacter:"\\eae3"}),n.emptyWindow=new n("empty-window",{fontCharacter:"\\eae4"}),n.exclude=new n("exclude",{fontCharacter:"\\eae5"}),n.extensions=new n("extensions",{fontCharacter:"\\eae6"}),n.eyeClosed=new n("eye-closed",{fontCharacter:"\\eae7"}),n.fileBinary=new n("file-binary",{fontCharacter:"\\eae8"}),n.fileCode=new n("file-code",{fontCharacter:"\\eae9"}),n.fileMedia=new n("file-media",{fontCharacter:"\\eaea"}),n.filePdf=new n("file-pdf",{fontCharacter:"\\eaeb"}),n.fileSubmodule=new n("file-submodule",{fontCharacter:"\\eaec"}),n.fileSymlinkDirectory=new n("file-symlink-directory",{fontCharacter:"\\eaed"}),n.fileSymlinkFile=new n("file-symlink-file",{fontCharacter:"\\eaee"}),n.fileZip=new n("file-zip",{fontCharacter:"\\eaef"}),n.files=new n("files",{fontCharacter:"\\eaf0"}),n.filter=new n("filter",{fontCharacter:"\\eaf1"}),n.flame=new n("flame",{fontCharacter:"\\eaf2"}),n.foldDown=new n("fold-down",{fontCharacter:"\\eaf3"}),n.foldUp=new n("fold-up",{fontCharacter:"\\eaf4"}),n.fold=new n("fold",{fontCharacter:"\\eaf5"}),n.folderActive=new n("folder-active",{fontCharacter:"\\eaf6"}),n.folderOpened=new n("folder-opened",{fontCharacter:"\\eaf7"}),n.gear=new n("gear",{fontCharacter:"\\eaf8"}),n.gift=new n("gift",{fontCharacter:"\\eaf9"}),n.gistSecret=new n("gist-secret",{fontCharacter:"\\eafa"}),n.gist=new n("gist",{fontCharacter:"\\eafb"}),n.gitCommit=new n("git-commit",{fontCharacter:"\\eafc"}),n.gitCompare=new n("git-compare",{fontCharacter:"\\eafd"}),n.gitMerge=new n("git-merge",{fontCharacter:"\\eafe"}),n.githubAction=new n("github-action",{fontCharacter:"\\eaff"}),n.githubAlt=new n("github-alt",{fontCharacter:"\\eb00"}),n.globe=new n("globe",{fontCharacter:"\\eb01"}),n.grabber=new n("grabber",{fontCharacter:"\\eb02"}),n.graph=new n("graph",{fontCharacter:"\\eb03"}),n.gripper=new n("gripper",{fontCharacter:"\\eb04"}),n.heart=new n("heart",{fontCharacter:"\\eb05"}),n.home=new n("home",{fontCharacter:"\\eb06"}),n.horizontalRule=new n("horizontal-rule",{fontCharacter:"\\eb07"}),n.hubot=new n("hubot",{fontCharacter:"\\eb08"}),n.inbox=new n("inbox",{fontCharacter:"\\eb09"}),n.issueClosed=new n("issue-closed",{fontCharacter:"\\eba4"}),n.issueReopened=new n("issue-reopened",{fontCharacter:"\\eb0b"}),n.issues=new n("issues",{fontCharacter:"\\eb0c"}),n.italic=new n("italic",{fontCharacter:"\\eb0d"}),n.jersey=new n("jersey",{fontCharacter:"\\eb0e"}),n.json=new n("json",{fontCharacter:"\\eb0f"}),n.kebabVertical=new n("kebab-vertical",{fontCharacter:"\\eb10"}),n.key=new n("key",{fontCharacter:"\\eb11"}),n.law=new n("law",{fontCharacter:"\\eb12"}),n.lightbulbAutofix=new n("lightbulb-autofix",{fontCharacter:"\\eb13"}),n.linkExternal=new n("link-external",{fontCharacter:"\\eb14"}),n.link=new n("link",{fontCharacter:"\\eb15"}),n.listOrdered=new n("list-ordered",{fontCharacter:"\\eb16"}),n.listUnordered=new n("list-unordered",{fontCharacter:"\\eb17"}),n.liveShare=new n("live-share",{fontCharacter:"\\eb18"}),n.loading=new n("loading",{fontCharacter:"\\eb19"}),n.location=new n("location",{fontCharacter:"\\eb1a"}),n.mailRead=new n("mail-read",{fontCharacter:"\\eb1b"}),n.mail=new n("mail",{fontCharacter:"\\eb1c"}),n.markdown=new n("markdown",{fontCharacter:"\\eb1d"}),n.megaphone=new n("megaphone",{fontCharacter:"\\eb1e"}),n.mention=new n("mention",{fontCharacter:"\\eb1f"}),n.milestone=new n("milestone",{fontCharacter:"\\eb20"}),n.mortarBoard=new n("mortar-board",{fontCharacter:"\\eb21"}),n.move=new n("move",{fontCharacter:"\\eb22"}),n.multipleWindows=new n("multiple-windows",{fontCharacter:"\\eb23"}),n.mute=new n("mute",{fontCharacter:"\\eb24"}),n.noNewline=new n("no-newline",{fontCharacter:"\\eb25"}),n.note=new n("note",{fontCharacter:"\\eb26"}),n.octoface=new n("octoface",{fontCharacter:"\\eb27"}),n.openPreview=new n("open-preview",{fontCharacter:"\\eb28"}),n.package_=new n("package",{fontCharacter:"\\eb29"}),n.paintcan=new n("paintcan",{fontCharacter:"\\eb2a"}),n.pin=new n("pin",{fontCharacter:"\\eb2b"}),n.play=new n("play",{fontCharacter:"\\eb2c"}),n.run=new n("run",{fontCharacter:"\\eb2c"}),n.plug=new n("plug",{fontCharacter:"\\eb2d"}),n.preserveCase=new n("preserve-case",{fontCharacter:"\\eb2e"}),n.preview=new n("preview",{fontCharacter:"\\eb2f"}),n.project=new n("project",{fontCharacter:"\\eb30"}),n.pulse=new n("pulse",{fontCharacter:"\\eb31"}),n.question=new n("question",{fontCharacter:"\\eb32"}),n.quote=new n("quote",{fontCharacter:"\\eb33"}),n.radioTower=new n("radio-tower",{fontCharacter:"\\eb34"}),n.reactions=new n("reactions",{fontCharacter:"\\eb35"}),n.references=new n("references",{fontCharacter:"\\eb36"}),n.refresh=new n("refresh",{fontCharacter:"\\eb37"}),n.regex=new n("regex",{fontCharacter:"\\eb38"}),n.remoteExplorer=new n("remote-explorer",{fontCharacter:"\\eb39"}),n.remote=new n("remote",{fontCharacter:"\\eb3a"}),n.remove=new n("remove",{fontCharacter:"\\eb3b"}),n.replaceAll=new n("replace-all",{fontCharacter:"\\eb3c"}),n.replace=new n("replace",{fontCharacter:"\\eb3d"}),n.repoClone=new n("repo-clone",{fontCharacter:"\\eb3e"}),n.repoForcePush=new n("repo-force-push",{fontCharacter:"\\eb3f"}),n.repoPull=new n("repo-pull",{fontCharacter:"\\eb40"}),n.repoPush=new n("repo-push",{fontCharacter:"\\eb41"}),n.report=new n("report",{fontCharacter:"\\eb42"}),n.requestChanges=new n("request-changes",{fontCharacter:"\\eb43"}),n.rocket=new n("rocket",{fontCharacter:"\\eb44"}),n.rootFolderOpened=new n("root-folder-opened",{fontCharacter:"\\eb45"}),n.rootFolder=new n("root-folder",{fontCharacter:"\\eb46"}),n.rss=new n("rss",{fontCharacter:"\\eb47"}),n.ruby=new n("ruby",{fontCharacter:"\\eb48"}),n.saveAll=new n("save-all",{fontCharacter:"\\eb49"}),n.saveAs=new n("save-as",{fontCharacter:"\\eb4a"}),n.save=new n("save",{fontCharacter:"\\eb4b"}),n.screenFull=new n("screen-full",{fontCharacter:"\\eb4c"}),n.screenNormal=new n("screen-normal",{fontCharacter:"\\eb4d"}),n.searchStop=new n("search-stop",{fontCharacter:"\\eb4e"}),n.server=new n("server",{fontCharacter:"\\eb50"}),n.settingsGear=new n("settings-gear",{fontCharacter:"\\eb51"}),n.settings=new n("settings",{fontCharacter:"\\eb52"}),n.shield=new n("shield",{fontCharacter:"\\eb53"}),n.smiley=new n("smiley",{fontCharacter:"\\eb54"}),n.sortPrecedence=new n("sort-precedence",{fontCharacter:"\\eb55"}),n.splitHorizontal=new n("split-horizontal",{fontCharacter:"\\eb56"}),n.splitVertical=new n("split-vertical",{fontCharacter:"\\eb57"}),n.squirrel=new n("squirrel",{fontCharacter:"\\eb58"}),n.starFull=new n("star-full",{fontCharacter:"\\eb59"}),n.starHalf=new n("star-half",{fontCharacter:"\\eb5a"}),n.symbolClass=new n("symbol-class",{fontCharacter:"\\eb5b"}),n.symbolColor=new n("symbol-color",{fontCharacter:"\\eb5c"}),n.symbolConstant=new n("symbol-constant",{fontCharacter:"\\eb5d"}),n.symbolEnumMember=new n("symbol-enum-member",{fontCharacter:"\\eb5e"}),n.symbolField=new n("symbol-field",{fontCharacter:"\\eb5f"}),n.symbolFile=new n("symbol-file",{fontCharacter:"\\eb60"}),n.symbolInterface=new n("symbol-interface",{fontCharacter:"\\eb61"}),n.symbolKeyword=new n("symbol-keyword",{fontCharacter:"\\eb62"}),n.symbolMisc=new n("symbol-misc",{fontCharacter:"\\eb63"}),n.symbolOperator=new n("symbol-operator",{fontCharacter:"\\eb64"}),n.symbolProperty=new n("symbol-property",{fontCharacter:"\\eb65"}),n.wrench=new n("wrench",{fontCharacter:"\\eb65"}),n.wrenchSubaction=new n("wrench-subaction",{fontCharacter:"\\eb65"}),n.symbolSnippet=new n("symbol-snippet",{fontCharacter:"\\eb66"}),n.tasklist=new n("tasklist",{fontCharacter:"\\eb67"}),n.telescope=new n("telescope",{fontCharacter:"\\eb68"}),n.textSize=new n("text-size",{fontCharacter:"\\eb69"}),n.threeBars=new n("three-bars",{fontCharacter:"\\eb6a"}),n.thumbsdown=new n("thumbsdown",{fontCharacter:"\\eb6b"}),n.thumbsup=new n("thumbsup",{fontCharacter:"\\eb6c"}),n.tools=new n("tools",{fontCharacter:"\\eb6d"}),n.triangleDown=new n("triangle-down",{fontCharacter:"\\eb6e"}),n.triangleLeft=new n("triangle-left",{fontCharacter:"\\eb6f"}),n.triangleRight=new n("triangle-right",{fontCharacter:"\\eb70"}),n.triangleUp=new n("triangle-up",{fontCharacter:"\\eb71"}),n.twitter=new n("twitter",{fontCharacter:"\\eb72"}),n.unfold=new n("unfold",{fontCharacter:"\\eb73"}),n.unlock=new n("unlock",{fontCharacter:"\\eb74"}),n.unmute=new n("unmute",{fontCharacter:"\\eb75"}),n.unverified=new n("unverified",{fontCharacter:"\\eb76"}),n.verified=new n("verified",{fontCharacter:"\\eb77"}),n.versions=new n("versions",{fontCharacter:"\\eb78"}),n.vmActive=new n("vm-active",{fontCharacter:"\\eb79"}),n.vmOutline=new n("vm-outline",{fontCharacter:"\\eb7a"}),n.vmRunning=new n("vm-running",{fontCharacter:"\\eb7b"}),n.watch=new n("watch",{fontCharacter:"\\eb7c"}),n.whitespace=new n("whitespace",{fontCharacter:"\\eb7d"}),n.wholeWord=new n("whole-word",{fontCharacter:"\\eb7e"}),n.window=new n("window",{fontCharacter:"\\eb7f"}),n.wordWrap=new n("word-wrap",{fontCharacter:"\\eb80"}),n.zoomIn=new n("zoom-in",{fontCharacter:"\\eb81"}),n.zoomOut=new n("zoom-out",{fontCharacter:"\\eb82"}),n.listFilter=new n("list-filter",{fontCharacter:"\\eb83"}),n.listFlat=new n("list-flat",{fontCharacter:"\\eb84"}),n.listSelection=new n("list-selection",{fontCharacter:"\\eb85"}),n.selection=new n("selection",{fontCharacter:"\\eb85"}),n.listTree=new n("list-tree",{fontCharacter:"\\eb86"}),n.debugBreakpointFunctionUnverified=new n("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),n.debugBreakpointFunction=new n("debug-breakpoint-function",{fontCharacter:"\\eb88"}),n.debugBreakpointFunctionDisabled=new n("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),n.debugStackframeActive=new n("debug-stackframe-active",{fontCharacter:"\\eb89"}),n.debugStackframeDot=new n("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),n.debugStackframe=new n("debug-stackframe",{fontCharacter:"\\eb8b"}),n.debugStackframeFocused=new n("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),n.debugBreakpointUnsupported=new n("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),n.symbolString=new n("symbol-string",{fontCharacter:"\\eb8d"}),n.debugReverseContinue=new n("debug-reverse-continue",{fontCharacter:"\\eb8e"}),n.debugStepBack=new n("debug-step-back",{fontCharacter:"\\eb8f"}),n.debugRestartFrame=new n("debug-restart-frame",{fontCharacter:"\\eb90"}),n.callIncoming=new n("call-incoming",{fontCharacter:"\\eb92"}),n.callOutgoing=new n("call-outgoing",{fontCharacter:"\\eb93"}),n.menu=new n("menu",{fontCharacter:"\\eb94"}),n.expandAll=new n("expand-all",{fontCharacter:"\\eb95"}),n.feedback=new n("feedback",{fontCharacter:"\\eb96"}),n.groupByRefType=new n("group-by-ref-type",{fontCharacter:"\\eb97"}),n.ungroupByRefType=new n("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),n.account=new n("account",{fontCharacter:"\\eb99"}),n.bellDot=new n("bell-dot",{fontCharacter:"\\eb9a"}),n.debugConsole=new n("debug-console",{fontCharacter:"\\eb9b"}),n.library=new n("library",{fontCharacter:"\\eb9c"}),n.output=new n("output",{fontCharacter:"\\eb9d"}),n.runAll=new n("run-all",{fontCharacter:"\\eb9e"}),n.syncIgnored=new n("sync-ignored",{fontCharacter:"\\eb9f"}),n.pinned=new n("pinned",{fontCharacter:"\\eba0"}),n.githubInverted=new n("github-inverted",{fontCharacter:"\\eba1"}),n.debugAlt=new n("debug-alt",{fontCharacter:"\\eb91"}),n.serverProcess=new n("server-process",{fontCharacter:"\\eba2"}),n.serverEnvironment=new n("server-environment",{fontCharacter:"\\eba3"}),n.pass=new n("pass",{fontCharacter:"\\eba4"}),n.stopCircle=new n("stop-circle",{fontCharacter:"\\eba5"}),n.playCircle=new n("play-circle",{fontCharacter:"\\eba6"}),n.record=new n("record",{fontCharacter:"\\eba7"}),n.debugAltSmall=new n("debug-alt-small",{fontCharacter:"\\eba8"}),n.vmConnect=new n("vm-connect",{fontCharacter:"\\eba9"}),n.cloud=new n("cloud",{fontCharacter:"\\ebaa"}),n.merge=new n("merge",{fontCharacter:"\\ebab"}),n.exportIcon=new n("export",{fontCharacter:"\\ebac"}),n.graphLeft=new n("graph-left",{fontCharacter:"\\ebad"}),n.magnet=new n("magnet",{fontCharacter:"\\ebae"}),n.notebook=new n("notebook",{fontCharacter:"\\ebaf"}),n.redo=new n("redo",{fontCharacter:"\\ebb0"}),n.checkAll=new n("check-all",{fontCharacter:"\\ebb1"}),n.pinnedDirty=new n("pinned-dirty",{fontCharacter:"\\ebb2"}),n.passFilled=new n("pass-filled",{fontCharacter:"\\ebb3"}),n.circleLargeFilled=new n("circle-large-filled",{fontCharacter:"\\ebb4"}),n.circleLargeOutline=new n("circle-large-outline",{fontCharacter:"\\ebb5"}),n.combine=new n("combine",{fontCharacter:"\\ebb6"}),n.gather=new n("gather",{fontCharacter:"\\ebb6"}),n.table=new n("table",{fontCharacter:"\\ebb7"}),n.variableGroup=new n("variable-group",{fontCharacter:"\\ebb8"}),n.typeHierarchy=new n("type-hierarchy",{fontCharacter:"\\ebb9"}),n.typeHierarchySub=new n("type-hierarchy-sub",{fontCharacter:"\\ebba"}),n.typeHierarchySuper=new n("type-hierarchy-super",{fontCharacter:"\\ebbb"}),n.gitPullRequestCreate=new n("git-pull-request-create",{fontCharacter:"\\ebbc"}),n.runAbove=new n("run-above",{fontCharacter:"\\ebbd"}),n.runBelow=new n("run-below",{fontCharacter:"\\ebbe"}),n.notebookTemplate=new n("notebook-template",{fontCharacter:"\\ebbf"}),n.debugRerun=new n("debug-rerun",{fontCharacter:"\\ebc0"}),n.workspaceTrusted=new n("workspace-trusted",{fontCharacter:"\\ebc1"}),n.workspaceUntrusted=new n("workspace-untrusted",{fontCharacter:"\\ebc2"}),n.workspaceUnspecified=new n("workspace-unspecified",{fontCharacter:"\\ebc3"}),n.terminalCmd=new n("terminal-cmd",{fontCharacter:"\\ebc4"}),n.terminalDebian=new n("terminal-debian",{fontCharacter:"\\ebc5"}),n.terminalLinux=new n("terminal-linux",{fontCharacter:"\\ebc6"}),n.terminalPowershell=new n("terminal-powershell",{fontCharacter:"\\ebc7"}),n.terminalTmux=new n("terminal-tmux",{fontCharacter:"\\ebc8"}),n.terminalUbuntu=new n("terminal-ubuntu",{fontCharacter:"\\ebc9"}),n.terminalBash=new n("terminal-bash",{fontCharacter:"\\ebca"}),n.arrowSwap=new n("arrow-swap",{fontCharacter:"\\ebcb"}),n.copy=new n("copy",{fontCharacter:"\\ebcc"}),n.personAdd=new n("person-add",{fontCharacter:"\\ebcd"}),n.filterFilled=new n("filter-filled",{fontCharacter:"\\ebce"}),n.wand=new n("wand",{fontCharacter:"\\ebcf"}),n.debugLineByLine=new n("debug-line-by-line",{fontCharacter:"\\ebd0"}),n.inspect=new n("inspect",{fontCharacter:"\\ebd1"}),n.layers=new n("layers",{fontCharacter:"\\ebd2"}),n.layersDot=new n("layers-dot",{fontCharacter:"\\ebd3"}),n.layersActive=new n("layers-active",{fontCharacter:"\\ebd4"}),n.compass=new n("compass",{fontCharacter:"\\ebd5"}),n.compassDot=new n("compass-dot",{fontCharacter:"\\ebd6"}),n.compassActive=new n("compass-active",{fontCharacter:"\\ebd7"}),n.azure=new n("azure",{fontCharacter:"\\ebd8"}),n.issueDraft=new n("issue-draft",{fontCharacter:"\\ebd9"}),n.gitPullRequestClosed=new n("git-pull-request-closed",{fontCharacter:"\\ebda"}),n.gitPullRequestDraft=new n("git-pull-request-draft",{fontCharacter:"\\ebdb"}),n.debugAll=new n("debug-all",{fontCharacter:"\\ebdc"}),n.debugCoverage=new n("debug-coverage",{fontCharacter:"\\ebdd"}),n.runErrors=new n("run-errors",{fontCharacter:"\\ebde"}),n.folderLibrary=new n("folder-library",{fontCharacter:"\\ebdf"}),n.debugContinueSmall=new n("debug-continue-small",{fontCharacter:"\\ebe0"}),n.beakerStop=new n("beaker-stop",{fontCharacter:"\\ebe1"}),n.graphLine=new n("graph-line",{fontCharacter:"\\ebe2"}),n.graphScatter=new n("graph-scatter",{fontCharacter:"\\ebe3"}),n.pieChart=new n("pie-chart",{fontCharacter:"\\ebe4"}),n.bracket=new n("bracket",n.json.definition),n.bracketDot=new n("bracket-dot",{fontCharacter:"\\ebe5"}),n.bracketError=new n("bracket-error",{fontCharacter:"\\ebe6"}),n.lockSmall=new n("lock-small",{fontCharacter:"\\ebe7"}),n.azureDevops=new n("azure-devops",{fontCharacter:"\\ebe8"}),n.verifiedFilled=new n("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(ut,ve,U){(function(ne,Y){ut.exports=Y()})(this,function(){"use strict";var ne=navigator.userAgent,Y=navigator.platform,M=/gecko\/\d/i.test(ne),z=/MSIE \d/.test(ne),P=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ne),F=/Edge\/(\d+)/.exec(ne),G=z||P||F,K=G&&(z?document.documentMode||6:+(F||P)[1]),n=!F&&/WebKit\//.test(ne),I=n&&/Qt\/\d+\.\d+/.test(ne),b=!F&&/Chrome\//.test(ne),f=/Opera\//.test(ne),y=/Apple Computer/.test(navigator.vendor),c=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ne),a=/PhantomJS/.test(ne),p=!F&&/AppleWebKit/.test(ne)&&/Mobile\/\w+/.test(ne),l=/Android/.test(ne),u=p||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ne),s=p||/Mac/.test(Y),i=/\bCrOS\b/.test(ne),D=/win/i.test(Y),A=f&&ne.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(f=!1,n=!0);var S=s&&(I||f&&(A==null||A<12.11)),R=M||G&&K>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var o=e.className,r=O(t).exec(o);if(r){var g=o.slice(r.index+r[0].length);e.className=o.slice(0,r.index)+(g?r[1]+g:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function h(e,t){return v(e).appendChild(t)}function d(e,t,o,r){var g=document.createElement(e);if(o&&(g.className=o),r&&(g.style.cssText=r),typeof t=="string")g.appendChild(document.createTextNode(t));else if(t)for(var B=0;B<t.length;++B)g.appendChild(t[B]);return g}function C(e,t,o,r){var g=d(e,t,o,r);return g.setAttribute("role","presentation"),g}var E;document.createRange?E=function(e,t,o,r){var g=document.createRange();return g.setEnd(r||e,o),g.setStart(e,t),g}:E=function(e,t,o){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(g){return r}return r.collapse(!0),r.moveEnd("character",o),r.moveStart("character",t),r};function w(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function W(e,t){var o=e.className;O(t).test(o)||(e.className+=(o?" ":"")+t)}function T(e,t){for(var o=e.split(" "),r=0;r<o.length;r++)o[r]&&!O(o[r]).test(t)&&(t+=" "+o[r]);return t}var N=function(e){e.select()};p?N=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:G&&(N=function(e){try{e.select()}catch(t){}});function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function x(e,t,o){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(o!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function H(e,t,o,r,g){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var B=r||0,$=g||0;;){var q=e.indexOf(" ",B);if(q<0||q>=t)return $+(t-B);$+=q-B,$+=o-$%o,B=q+1}}var X=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};X.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},X.prototype.set=function(e,t){this.f=t;var o=+new Date+e;(!this.id||o<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=o)};function ee(e,t){for(var o=0;o<e.length;++o)if(e[o]==t)return o;return-1}var J=50,ce={toString:function(){return"CodeMirror.Pass"}},me={scroll:!1},ue={origin:"*mouse"},pe={origin:"+move"};function xe(e,t,o){for(var r=0,g=0;;){var B=e.indexOf(" ",r);B==-1&&(B=e.length);var $=B-r;if(B==e.length||g+$>=t)return r+Math.min($,t-g);if(g+=B-r,g+=o-g%o,r=B+1,g>=t)return r}}var se=[""];function ae(e){for(;se.length<=e;)se.push(Ce(se)+" ");return se[e]}function Ce(e){return e[e.length-1]}function ze(e,t){for(var o=[],r=0;r<e.length;r++)o[r]=t(e[r],r);return o}function Ye(e,t,o){for(var r=0,g=o(t);r<e.length&&o(e[r])<=g;)r++;e.splice(r,0,t)}function He(){}function Ve(e,t){var o;return Object.create?o=Object.create(e):(He.prototype=e,o=new He),t&&x(t,o),o}var Fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ke(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Fe.test(e))}function nt(e,t){return t?t.source.indexOf("\\w")>-1&&Ke(e)?!0:t.test(e):Ke(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Re=/[\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 Ne(e){return e.charCodeAt(0)>=768&&Re.test(e)}function Ue(e,t,o){for(;(o<0?t>0:t<e.length)&&Ne(e.charAt(t));)t+=o;return t}function rt(e,t,o){for(var r=t>o?-1:1;;){if(t==o)return t;var g=(t+o)/2,B=r<0?Math.ceil(g):Math.floor(g);if(B==t)return e(B)?t:o;e(B)?o=B:t=B+r}}function st(e,t,o,r){if(!e)return r(t,o,"ltr",0);for(var g=!1,B=0;B<e.length;++B){var $=e[B];($.from<o&&$.to>t||t==o&&$.to==t)&&(r(Math.max($.from,t),Math.min($.to,o),$.level==1?"rtl":"ltr",B),g=!0)}g||r(t,o,"ltr")}var dt=null;function at(e,t,o){var r;dt=null;for(var g=0;g<e.length;++g){var B=e[g];if(B.from<t&&B.to>t)return g;B.to==t&&(B.from!=B.to&&o=="before"?r=g:dt=g),B.from==t&&(B.from!=B.to&&o!="before"?r=g:dt=g)}return r!=null?r:dt}var bt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function o(oe){return oe<=247?e.charAt(oe):1424<=oe&&oe<=1524?"R":1536<=oe&&oe<=1785?t.charAt(oe-1536):1774<=oe&&oe<=2220?"r":8192<=oe&&oe<=8203?"w":oe==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,B=/[LRr]/,$=/[Lb1n]/,q=/[1n]/;function te(oe,Oe,Ie){this.level=oe,this.from=Oe,this.to=Ie}return function(oe,Oe){var Ie=Oe=="ltr"?"L":"R";if(oe.length==0||Oe=="ltr"&&!r.test(oe))return!1;for(var Qe=oe.length,Xe=[],ct=0;ct<Qe;++ct)Xe.push(o(oe.charCodeAt(ct)));for(var Et=0,It=Ie;Et<Qe;++Et){var Wt=Xe[Et];Wt=="m"?Xe[Et]=It:It=Wt}for(var qt=0,Ht=Ie;qt<Qe;++qt){var on=Xe[qt];on=="1"&&Ht=="r"?Xe[qt]="n":B.test(on)&&(Ht=on,on=="r"&&(Xe[qt]="R"))}for(var Pn=1,xn=Xe[0];Pn<Qe-1;++Pn){var ar=Xe[Pn];ar=="+"&&xn=="1"&&Xe[Pn+1]=="1"?Xe[Pn]="1":ar==","&&xn==Xe[Pn+1]&&(xn=="1"||xn=="n")&&(Xe[Pn]=xn),xn=ar}for(var jr=0;jr<Qe;++jr){var Ti=Xe[jr];if(Ti==",")Xe[jr]="N";else if(Ti=="%"){var Jr=void 0;for(Jr=jr+1;Jr<Qe&&Xe[Jr]=="%";++Jr);for(var $i=jr&&Xe[jr-1]=="!"||Jr<Qe&&Xe[Jr]=="1"?"1":"N",Hi=jr;Hi<Jr;++Hi)Xe[Hi]=$i;jr=Jr-1}}for(var di=0,Ki=Ie;di<Qe;++di){var Ai=Xe[di];Ki=="L"&&Ai=="1"?Xe[di]="L":B.test(Ai)&&(Ki=Ai)}for(var vi=0;vi<Qe;++vi)if(g.test(Xe[vi])){var hi=void 0;for(hi=vi+1;hi<Qe&&g.test(Xe[hi]);++hi);for(var ni=(vi?Xe[vi-1]:Ie)=="L",Gi=(hi<Qe?Xe[hi]:Ie)=="L",Ro=ni==Gi?ni?"L":"R":Ie,Ya=vi;Ya<hi;++Ya)Xe[Ya]=Ro;vi=hi-1}for(var Li=[],wa,wi=0;wi<Qe;)if($.test(Xe[wi])){var _s=wi;for(++wi;wi<Qe&&$.test(Xe[wi]);++wi);Li.push(new te(0,_s,wi))}else{var Pa=wi,oo=Li.length,so=Oe=="rtl"?1:0;for(++wi;wi<Qe&&Xe[wi]!="L";++wi);for(var Ni=Pa;Ni<wi;)if(q.test(Xe[Ni])){Pa<Ni&&(Li.splice(oo,0,new te(1,Pa,Ni)),oo+=so);var Do=Ni;for(++Ni;Ni<wi&&q.test(Xe[Ni]);++Ni);Li.splice(oo,0,new te(2,Do,Ni)),oo+=so,Pa=Ni}else++Ni;Pa<wi&&Li.splice(oo,0,new te(1,Pa,wi))}return Oe=="ltr"&&(Li[0].level==1&&(wa=oe.match(/^\s+/))&&(Li[0].from=wa[0].length,Li.unshift(new te(0,0,wa[0].length))),Ce(Li).level==1&&(wa=oe.match(/\s+$/))&&(Ce(Li).to-=wa[0].length,Li.push(new te(0,Qe-wa[0].length,Qe)))),Oe=="rtl"?Li.reverse():Li}}();function gt(e,t){var o=e.order;return o==null&&(o=e.order=bt(e.text,t)),o}var xt=[],Je=function(e,t,o){if(e.addEventListener)e.addEventListener(t,o,!1);else if(e.attachEvent)e.attachEvent("on"+t,o);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||xt).concat(o)}};function kt(e,t){return e._handlers&&e._handlers[t]||xt}function Ot(e,t,o){if(e.removeEventListener)e.removeEventListener(t,o,!1);else if(e.detachEvent)e.detachEvent("on"+t,o);else{var r=e._handlers,g=r&&r[t];if(g){var B=ee(g,o);B>-1&&(r[t]=g.slice(0,B).concat(g.slice(B+1)))}}}function tt(e,t){var o=kt(e,t);if(!o.length)return;for(var r=Array.prototype.slice.call(arguments,2),g=0;g<o.length;++g)o[g].apply(null,r)}function ft(e,t,o){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),tt(e,o||t.type,e,t),we(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var o=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ee(o,t[r])==-1&&o.push(t[r])}function Ee(e,t){return kt(e,t).length>0}function ge(e){e.prototype.on=function(t,o){Je(this,t,o)},e.prototype.off=function(t,o){Ot(this,t,o)}}function de(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function fe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function we(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function De(e){de(e),fe(e)}function ke(e){return e.target||e.srcElement}function Ze(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),s&&e.ctrlKey&&t==1&&(t=3),t}var ht=function(){if(G&&K<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Ut;function nn(e){if(Ut==null){var t=d("span","\u200B");h(e,d("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ut=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&K<8))}var o=Ut?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return o.setAttribute("cm-text",""),o}var tn;function _n(e){if(tn!=null)return tn;var t=h(e,document.createTextNode("A\u062EA")),o=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return v(e),!o||o.left==o.right?!1:tn=r.right-o.right<3}var bn=`
b`.split(/\n/).length!=3?function(e){for(var t=0,o=[],r=e.length;t<=r;){var g=e.indexOf(`
`,t);g==-1&&(g=e.length);var B=e.slice(t,e.charAt(g-1)=="\r"?g-1:g),$=B.indexOf("\r");$!=-1?(o.push(B.slice(0,$)),t+=$+1):(o.push(B),t=g+1)}return o}:function(e){return e.split(/\r\n?|\n/)},Kt=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(o){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},rr=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ln=null;function Cr(e){if(Ln!=null)return Ln;var t=h(e,d("span","x")),o=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return Ln=Math.abs(o.left-r.left)>1}var pr={},kn={};function Mr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),pr[e]=t}function Or(e,t){kn[e]=t}function ln(e){if(typeof e=="string"&&kn.hasOwnProperty(e))e=kn[e];else if(e&&typeof e.name=="string"&&kn.hasOwnProperty(e.name)){var t=kn[e.name];typeof t=="string"&&(t={name:t}),e=Ve(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ln("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ln("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Xr(e,t){t=ln(t);var o=pr[t.name];if(!o)return Xr(e,"text/plain");var r=o(e,t);if(hr.hasOwnProperty(t.name)){var g=hr[t.name];for(var B in g){if(!g.hasOwnProperty(B))continue;r.hasOwnProperty(B)&&(r["_"+B]=r[B]),r[B]=g[B]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var $ in t.modeProps)r[$]=t.modeProps[$];return r}var hr={};function Sr(e,t){var o=hr.hasOwnProperty(e)?hr[e]:hr[e]={};x(t,o)}function vn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var o={};for(var r in t){var g=t[r];g instanceof Array&&(g=g.concat([])),o[r]=g}return o}function fn(e,t){for(var o;e.innerMode&&!(o=e.innerMode(t),!o||o.mode==e);)t=o.state,e=o.mode;return o||{mode:e,state:t}}function Jn(e,t,o){return e.startState?e.startState(t,o):!0}var en=function(e,t,o){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=o};en.prototype.eol=function(){return this.pos>=this.string.length},en.prototype.sol=function(){return this.pos==this.lineStart},en.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},en.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},en.prototype.eat=function(e){var t=this.string.charAt(this.pos),o;if(typeof e=="string"?o=t==e:o=t&&(e.test?e.test(t):e(t)),o)return++this.pos,t},en.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},en.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},en.prototype.skipToEnd=function(){this.pos=this.string.length},en.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},en.prototype.backUp=function(e){this.pos-=e},en.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},en.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},en.prototype.match=function(e,t,o){if(typeof e=="string"){var r=function($){return o?$.toLowerCase():$},g=this.string.substr(this.pos,e.length);if(r(g)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var B=this.string.slice(this.pos).match(e);return B&&B.index>0?null:(B&&t!==!1&&(this.pos+=B[0].length),B)}},en.prototype.current=function(){return this.string.slice(this.start,this.pos)},en.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},en.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},en.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function jt(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 o=e;!o.lines;)for(var r=0;;++r){var g=o.children[r],B=g.chunkSize();if(t<B){o=g;break}t-=B}return o.lines[t]}function Fr(e,t,o){var r=[],g=t.line;return e.iter(t.line,o.line+1,function(B){var $=B.text;g==o.line&&($=$.slice(0,o.ch)),g==t.line&&($=$.slice(t.ch)),r.push($),++g}),r}function ri(e,t,o){var r=[];return e.iter(t,o,function(g){r.push(g.text)}),r}function qr(e,t){var o=t-e.height;if(o)for(var r=e;r;r=r.parent)r.height+=o}function un(e){if(e.parent==null)return null;for(var t=e.parent,o=ee(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var g=0;!(r.children[g]==t);++g)o+=r.children[g].chunkSize();return o+t.first}function Rr(e,t){var o=e.first;e:do{for(var r=0;r<e.children.length;++r){var g=e.children[r],B=g.height;if(t<B){e=g;continue e}t-=B,o+=g.chunkSize()}return o}while(!e.lines);for(var $=0;$<e.lines.length;++$){var q=e.lines[$],te=q.height;if(t<te)break;t-=te}return o+$}function yi(e,t){return t>=e.first&&t<e.first+e.size}function fi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function _t(e,t,o){if(o===void 0&&(o=null),!(this instanceof _t))return new _t(e,t,o);this.line=e,this.ch=t,this.sticky=o}function sn(e,t){return e.line-t.line||e.ch-t.ch}function Ii(e,t){return e.sticky==t.sticky&&sn(e,t)==0}function zi(e){return _t(e.line,e.ch)}function na(e,t){return sn(e,t)<0?t:e}function Vi(e,t){return sn(e,t)<0?e:t}function Z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function L(e,t){if(t.line<e.first)return _t(e.first,0);var o=e.first+e.size-1;return t.line>o?_t(o,jt(e,o).text.length):k(t,jt(e,t.line).text.length)}function k(e,t){var o=e.ch;return o==null||o>t?_t(e.line,t):o<0?_t(e.line,0):e}function V(e,t){for(var o=[],r=0;r<t.length;r++)o[r]=L(e,t[r]);return o}var re=function(e,t){this.state=e,this.lookAhead=t},Q=function(e,t,o,r){this.state=t,this.doc=e,this.line=o,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Q.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Q.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Q.fromSaved=function(e,t,o){return t instanceof re?new Q(e,vn(e.mode,t.state),o,t.lookAhead):new Q(e,vn(e.mode,t),o)},Q.prototype.save=function(e){var t=e!==!1?vn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new re(t,this.maxLookAhead):t};function Pe(e,t,o,r){var g=[e.state.modeGen],B={};mt(e,t.text,e.doc.mode,o,function(oe,Oe){return g.push(oe,Oe)},B,r);for(var $=o.state,q=function(oe){o.baseTokens=g;var Oe=e.state.overlays[oe],Ie=1,Qe=0;o.state=!0,mt(e,t.text,Oe.mode,o,function(Xe,ct){for(var Et=Ie;Qe<Xe;){var It=g[Ie];It>Xe&&g.splice(Ie,1,Xe,g[Ie+1],It),Ie+=2,Qe=Math.min(Xe,It)}if(!ct)return;if(Oe.opaque)g.splice(Et,Ie-Et,Xe,"overlay "+ct),Ie=Et+2;else for(;Et<Ie;Et+=2){var Wt=g[Et+1];g[Et+1]=(Wt?Wt+" ":"")+"overlay "+ct}},B),o.state=$,o.baseTokens=null,o.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)q(te);return{styles:g,classes:B.bgClass||B.textClass?B:null}}function pt(e,t,o){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Lt(e,un(t)),g=t.text.length>e.options.maxHighlightLength&&vn(e.doc.mode,r.state),B=Pe(e,t,r);g&&(r.state=g),t.stateAfter=r.save(!g),t.styles=B.styles,B.classes?t.styleClasses=B.classes:t.styleClasses&&(t.styleClasses=null),o===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Lt(e,t,o){var r=e.doc,g=e.display;if(!r.mode.startState)return new Q(r,!0,t);var B=Pt(e,t,o),$=B>r.first&&jt(r,B-1).stateAfter,q=$?Q.fromSaved(r,$,B):new Q(r,Jn(r.mode),B);return r.iter(B,t,function(te){rn(e,te.text,q);var oe=q.line;te.stateAfter=oe==t-1||oe%5==0||oe>=g.viewFrom&&oe<g.viewTo?q.save():null,q.nextLine()}),o&&(r.modeFrontier=q.line),q}function rn(e,t,o,r){var g=e.doc.mode,B=new en(t,e.options.tabSize,o);for(B.start=B.pos=r||0,t==""&&vt(g,o.state);!B.eol();)Vt(g,B,o.state),B.start=B.pos}function vt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var o=fn(e,t);if(o.mode.blankLine)return o.mode.blankLine(o.state)}function Vt(e,t,o,r){for(var g=0;g<10;g++){r&&(r[0]=fn(e,o).mode);var B=e.token(t,o);if(t.pos>t.start)return B}throw new Error("Mode "+e.name+" failed to advance stream.")}var fr=function(e,t,o){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=o};function Lr(e,t,o,r){var g=e.doc,B=g.mode,$;t=L(g,t);var q=jt(g,t.line),te=Lt(e,t.line,o),oe=new en(q.text,e.options.tabSize,te),Oe;for(r&&(Oe=[]);(r||oe.pos<t.ch)&&!oe.eol();)oe.start=oe.pos,$=Vt(B,oe,te.state),r&&Oe.push(new fr(oe,$,vn(g.mode,te.state)));return r?Oe:new fr(oe,$,te.state)}function Zt(e,t){if(e)for(;;){var o=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!o)break;e=e.slice(0,o.index)+e.slice(o.index+o[0].length);var r=o[1]?"bgClass":"textClass";t[r]==null?t[r]=o[2]:new RegExp("(?:^|\\s)"+o[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+o[2])}return e}function mt(e,t,o,r,g,B,$){var q=o.flattenSpans;q==null&&(q=e.options.flattenSpans);var te=0,oe=null,Oe=new en(t,e.options.tabSize,r),Ie,Qe=e.options.addModeClass&&[null];for(t==""&&Zt(vt(o,r.state),B);!Oe.eol();){if(Oe.pos>e.options.maxHighlightLength?(q=!1,$&&rn(e,t,r,Oe.pos),Oe.pos=t.length,Ie=null):Ie=Zt(Vt(o,Oe,r.state,Qe),B),Qe){var Xe=Qe[0].name;Xe&&(Ie="m-"+(Ie?Xe+" "+Ie:Xe))}if(!q||oe!=Ie){for(;te<Oe.start;)te=Math.min(Oe.start,te+5e3),g(te,oe);oe=Ie}Oe.start=Oe.pos}for(;te<Oe.pos;){var ct=Math.min(Oe.pos,te+5e3);g(ct,oe),te=ct}}function Pt(e,t,o){for(var r,g,B=e.doc,$=o?-1:t-(e.doc.mode.innerMode?1e3:100),q=t;q>$;--q){if(q<=B.first)return B.first;var te=jt(B,q-1),oe=te.stateAfter;if(oe&&(!o||q+(oe instanceof re?oe.lookAhead:0)<=B.modeFrontier))return q;var Oe=H(te.text,null,e.options.tabSize);(g==null||r>Oe)&&(g=q-1,r=Oe)}return g}function Rt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var o=e.first,r=t-1;r>o;r--){var g=jt(e,r).stateAfter;if(g&&(!(g instanceof re)||r+g.lookAhead<t)){o=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,o)}var Gt=!1,cn=!1;function Tn(){Gt=!0}function Sn(){cn=!0}function mn(e,t,o){this.marker=e,this.from=t,this.to=o}function In(e,t){if(e)for(var o=0;o<e.length;++o){var r=e[o];if(r.marker==t)return r}}function Kn(e,t){for(var o,r=0;r<e.length;++r)e[r]!=t&&(o||(o=[])).push(e[r]);return o}function hn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function An(e,t,o){var r;if(e)for(var g=0;g<e.length;++g){var B=e[g],$=B.marker,q=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);if(q||B.from==t&&$.type=="bookmark"&&(!o||!B.marker.insertLeft)){var te=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);(r||(r=[])).push(new mn($,B.from,te?null:B.to))}}return r}function dr(e,t,o){var r;if(e)for(var g=0;g<e.length;++g){var B=e[g],$=B.marker,q=B.to==null||($.inclusiveRight?B.to>=t:B.to>t);if(q||B.from==t&&$.type=="bookmark"&&(!o||B.marker.insertLeft)){var te=B.from==null||($.inclusiveLeft?B.from<=t:B.from<t);(r||(r=[])).push(new mn($,te?null:B.from-t,B.to==null?null:B.to-t))}}return r}function Nn(e,t){if(t.full)return null;var o=yi(e,t.from.line)&&jt(e,t.from.line).markedSpans,r=yi(e,t.to.line)&&jt(e,t.to.line).markedSpans;if(!o&&!r)return null;var g=t.from.ch,B=t.to.ch,$=sn(t.from,t.to)==0,q=An(o,g,$),te=dr(r,B,$),oe=t.text.length==1,Oe=Ce(t.text).length+(oe?g:0);if(q)for(var Ie=0;Ie<q.length;++Ie){var Qe=q[Ie];if(Qe.to==null){var Xe=In(te,Qe.marker);Xe?oe&&(Qe.to=Xe.to==null?null:Xe.to+Oe):Qe.to=g}}if(te)for(var ct=0;ct<te.length;++ct){var Et=te[ct];if(Et.to!=null&&(Et.to+=Oe),Et.from==null){var It=In(q,Et.marker);It||(Et.from=Oe,oe&&(q||(q=[])).push(Et))}else Et.from+=Oe,oe&&(q||(q=[])).push(Et)}q&&(q=zt(q)),te&&te!=q&&(te=zt(te));var Wt=[q];if(!oe){var qt=t.text.length-2,Ht;if(qt>0&&q)for(var on=0;on<q.length;++on)q[on].to==null&&(Ht||(Ht=[])).push(new mn(q[on].marker,null,null));for(var Pn=0;Pn<qt;++Pn)Wt.push(Ht);Wt.push(te)}return Wt}function zt(e){for(var t=0;t<e.length;++t){var o=e[t];o.from!=null&&o.from==o.to&&o.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function On(e,t,o){var r=null;if(e.iter(t.line,o.line+1,function(Xe){if(Xe.markedSpans)for(var ct=0;ct<Xe.markedSpans.length;++ct){var Et=Xe.markedSpans[ct].marker;Et.readOnly&&(!r||ee(r,Et)==-1)&&(r||(r=[])).push(Et)}}),!r)return null;for(var g=[{from:t,to:o}],B=0;B<r.length;++B)for(var $=r[B],q=$.find(0),te=0;te<g.length;++te){var oe=g[te];if(sn(oe.to,q.from)<0||sn(oe.from,q.to)>0)continue;var Oe=[te,1],Ie=sn(oe.from,q.from),Qe=sn(oe.to,q.to);(Ie<0||!$.inclusiveLeft&&!Ie)&&Oe.push({from:oe.from,to:q.from}),(Qe>0||!$.inclusiveRight&&!Qe)&&Oe.push({from:q.to,to:oe.to}),g.splice.apply(g,Oe),te+=Oe.length-3}return g}function sr(e){var t=e.markedSpans;if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.detachLine(e);e.markedSpans=null}function Un(e,t){if(!t)return;for(var o=0;o<t.length;++o)t[o].marker.attachLine(e);e.markedSpans=t}function Xt(e){return e.inclusiveLeft?-1:0}function Bt(e){return e.inclusiveRight?1:0}function yn(e,t){var o=e.lines.length-t.lines.length;if(o!=0)return o;var r=e.find(),g=t.find(),B=sn(r.from,g.from)||Xt(e)-Xt(t);if(B)return-B;var $=sn(r.to,g.to)||Bt(e)-Bt(t);return $||t.id-e.id}function Ct(e,t){var o=cn&&e.markedSpans,r;if(o)for(var g=void 0,B=0;B<o.length;++B)g=o[B],g.marker.collapsed&&(t?g.from:g.to)==null&&(!r||yn(r,g.marker)<0)&&(r=g.marker);return r}function Mt(e){return Ct(e,!0)}function Dt(e){return Ct(e,!1)}function Me(e,t){var o=cn&&e.markedSpans,r;if(o)for(var g=0;g<o.length;++g){var B=o[g];B.marker.collapsed&&(B.from==null||B.from<t)&&(B.to==null||B.to>t)&&(!r||yn(r,B.marker)<0)&&(r=B.marker)}return r}function Yt(e,t,o,r,g){var B=jt(e,t),$=cn&&B.markedSpans;if($)for(var q=0;q<$.length;++q){var te=$[q];if(!te.marker.collapsed)continue;var oe=te.marker.find(0),Oe=sn(oe.from,o)||Xt(te.marker)-Xt(g),Ie=sn(oe.to,r)||Bt(te.marker)-Bt(g);if(Oe>=0&&Ie<=0||Oe<=0&&Ie>=0)continue;if(Oe<=0&&(te.marker.inclusiveRight&&g.inclusiveLeft?sn(oe.to,o)>=0:sn(oe.to,o)>0)||Oe>=0&&(te.marker.inclusiveRight&&g.inclusiveLeft?sn(oe.from,r)<=0:sn(oe.from,r)<0))return!0}}function wn(e){for(var t;t=Mt(e);)e=t.find(-1,!0).line;return e}function mr(e){for(var t;t=Dt(e);)e=t.find(1,!0).line;return e}function Rn(e){for(var t,o;t=Dt(e);)e=t.find(1,!0).line,(o||(o=[])).push(e);return o}function ii(e,t){var o=jt(e,t),r=wn(o);return o==r?t:un(r)}function ai(e,t){if(t>e.lastLine())return t;var o=jt(e,t),r;if(!Hr(e,o))return t;for(;r=Dt(o);)o=r.find(1,!0).line;return un(o)+1}function Hr(e,t){var o=cn&&t.markedSpans;if(o)for(var r=void 0,g=0;g<o.length;++g){if(r=o[g],!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&jn(e,t,r))return!0}}function jn(e,t,o){if(o.to==null){var r=o.marker.find(1,!0);return jn(e,r.line,In(r.line.markedSpans,o.marker))}if(o.marker.inclusiveRight&&o.to==t.text.length)return!0;for(var g=void 0,B=0;B<t.markedSpans.length;++B)if(g=t.markedSpans[B],g.marker.collapsed&&!g.marker.widgetNode&&g.from==o.to&&(g.to==null||g.to!=o.from)&&(g.marker.inclusiveLeft||o.marker.inclusiveRight)&&jn(e,t,g))return!0}function Ft(e){e=wn(e);for(var t=0,o=e.parent,r=0;r<o.lines.length;++r){var g=o.lines[r];if(g==e)break;t+=g.height}for(var B=o.parent;B;o=B,B=o.parent)for(var $=0;$<B.children.length;++$){var q=B.children[$];if(q==o)break;t+=q.height}return t}function br(e){if(e.height==0)return 0;for(var t=e.text.length,o,r=e;o=Mt(r);){var g=o.find(0,!0);r=g.from.line,t+=g.from.ch-g.to.ch}for(r=e;o=Dt(r);){var B=o.find(0,!0);t-=r.text.length-B.from.ch,r=B.to.line,t+=r.text.length-B.to.ch}return t}function lr(e){var t=e.display,o=e.doc;t.maxLine=jt(o,o.first),t.maxLineLength=br(t.maxLine),t.maxLineChanged=!0,o.iter(function(r){var g=br(r);g>t.maxLineLength&&(t.maxLineLength=g,t.maxLine=r)})}var Yn=function(e,t,o){this.text=e,Un(this,t),this.height=o?o(this):1};Yn.prototype.lineNo=function(){return un(this)},ge(Yn);function oi(e,t,o,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),sr(e),Un(e,o);var g=r?r(e):1;g!=e.height&&qr(e,g)}function $t(e){e.parent=null,sr(e)}var Jt={},Qt={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var o=t.addModeClass?Qt:Jt;return o[e]||(o[e]=e.replace(/\S+/g,"cm-$&"))}function Gn(e,t){var o=C("span",null,null,n?"padding-right: .1px":null),r={pre:C("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var g=0;g<=(t.rest?t.rest.length:0);g++){var B=g?t.rest[g-1]:t.line,$=void 0;r.pos=0,r.addToken=qn,_n(e.display.measure)&&($=gt(B,e.doc.direction))&&(r.addToken=Ci(r.addToken,$)),r.map=[];var q=t!=e.display.externalMeasured&&un(B);Qi(B,r,pt(e,B,q)),B.styleClasses&&(B.styleClasses.bgClass&&(r.bgClass=T(B.styleClasses.bgClass,r.bgClass||"")),B.styleClasses.textClass&&(r.textClass=T(B.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(nn(e.display.measure))),g==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(n){var te=r.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return tt(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=T(r.pre.className,r.textClass||"")),r}function Mn(e){var t=d("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function qn(e,t,o,r,g,B,$){if(!t)return;var q=e.splitSpaces?gr(t,e.trailingSpace):t,te=e.cm.state.specialChars,oe=!1,Oe;if(!te.test(t))e.col+=t.length,Oe=document.createTextNode(q),e.map.push(e.pos,e.pos+t.length,Oe),G&&K<9&&(oe=!0),e.pos+=t.length;else{Oe=document.createDocumentFragment();for(var Ie=0;;){te.lastIndex=Ie;var Qe=te.exec(t),Xe=Qe?Qe.index-Ie:t.length-Ie;if(Xe){var ct=document.createTextNode(q.slice(Ie,Ie+Xe));G&&K<9?Oe.appendChild(d("span",[ct])):Oe.appendChild(ct),e.map.push(e.pos,e.pos+Xe,ct),e.col+=Xe,e.pos+=Xe}if(!Qe)break;Ie+=Xe+1;var Et=void 0;if(Qe[0]==" "){var It=e.cm.options.tabSize,Wt=It-e.col%It;Et=Oe.appendChild(d("span",ae(Wt),"cm-tab")),Et.setAttribute("role","presentation"),Et.setAttribute("cm-text"," "),e.col+=Wt}else Qe[0]=="\r"||Qe[0]==`
`?(Et=Oe.appendChild(d("span",Qe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Et.setAttribute("cm-text",Qe[0]),e.col+=1):(Et=e.cm.options.specialCharPlaceholder(Qe[0]),Et.setAttribute("cm-text",Qe[0]),G&&K<9?Oe.appendChild(d("span",[Et])):Oe.appendChild(Et),e.col+=1);e.map.push(e.pos,e.pos+1,Et),e.pos++}}if(e.trailingSpace=q.charCodeAt(t.length-1)==32,o||r||g||oe||B||$){var qt=o||"";r&&(qt+=r),g&&(qt+=g);var Ht=d("span",[Oe],qt,B);if($)for(var on in $)$.hasOwnProperty(on)&&on!="style"&&on!="class"&&Ht.setAttribute(on,$[on]);return e.content.appendChild(Ht)}e.content.appendChild(Oe)}function gr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var o=t,r="",g=0;g<e.length;g++){var B=e.charAt(g);B==" "&&o&&(g==e.length-1||e.charCodeAt(g+1)==32)&&(B="\xA0"),r+=B,o=B==" "}return r}function Ci(e,t){return function(o,r,g,B,$,q,te){g=g?g+" cm-force-border":"cm-force-border";for(var oe=o.pos,Oe=oe+r.length;;){for(var Ie=void 0,Qe=0;Qe<t.length&&!(Ie=t[Qe],Ie.to>oe&&Ie.from<=oe);Qe++);if(Ie.to>=Oe)return e(o,r,g,B,$,q,te);e(o,r.slice(0,Ie.to-oe),g,B,null,q,te),B=null,r=r.slice(Ie.to-oe),oe=Ie.to}}}function Qn(e,t,o,r){var g=!r&&o.widgetNode;g&&e.map.push(e.pos,e.pos+t,g),!r&&e.cm.display.input.needsContentAttribute&&(g||(g=e.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",o.id)),g&&(e.cm.display.input.setUneditable(g),e.content.appendChild(g)),e.pos+=t,e.trailingSpace=!1}function Qi(e,t,o){var r=e.markedSpans,g=e.text,B=0;if(!r){for(var $=1;$<o.length;$+=2)t.addToken(t,g.slice(B,B=o[$]),pn(o[$+1],t.cm.options));return}for(var q=g.length,te=0,oe=1,Oe="",Ie,Qe,Xe=0,ct,Et,It,Wt,qt;;){if(Xe==te){ct=Et=It=Qe="",qt=null,Wt=null,Xe=Infinity;for(var Ht=[],on=void 0,Pn=0;Pn<r.length;++Pn){var xn=r[Pn],ar=xn.marker;if(ar.type=="bookmark"&&xn.from==te&&ar.widgetNode)Ht.push(ar);else if(xn.from<=te&&(xn.to==null||xn.to>te||ar.collapsed&&xn.to==te&&xn.from==te)){if(xn.to!=null&&xn.to!=te&&Xe>xn.to&&(Xe=xn.to,Et=""),ar.className&&(ct+=" "+ar.className),ar.css&&(Qe=(Qe?Qe+";":"")+ar.css),ar.startStyle&&xn.from==te&&(It+=" "+ar.startStyle),ar.endStyle&&xn.to==Xe&&(on||(on=[])).push(ar.endStyle,xn.to),ar.title&&((qt||(qt={})).title=ar.title),ar.attributes)for(var jr in ar.attributes)(qt||(qt={}))[jr]=ar.attributes[jr];ar.collapsed&&(!Wt||yn(Wt.marker,ar)<0)&&(Wt=xn)}else xn.from>te&&Xe>xn.from&&(Xe=xn.from)}if(on)for(var Ti=0;Ti<on.length;Ti+=2)on[Ti+1]==Xe&&(Et+=" "+on[Ti]);if(!Wt||Wt.from==te)for(var Jr=0;Jr<Ht.length;++Jr)Qn(t,0,Ht[Jr]);if(Wt&&(Wt.from||0)==te){if(Qn(t,(Wt.to==null?q+1:Wt.to)-te,Wt.marker,Wt.from==null),Wt.to==null)return;Wt.to==te&&(Wt=!1)}}if(te>=q)break;for(var $i=Math.min(q,Xe);;){if(Oe){var Hi=te+Oe.length;if(!Wt){var di=Hi>$i?Oe.slice(0,$i-te):Oe;t.addToken(t,di,Ie?Ie+ct:ct,It,te+di.length==Xe?Et:"",Qe,qt)}if(Hi>=$i){Oe=Oe.slice($i-te),te=$i;break}te=Hi,It=""}Oe=g.slice(B,B=o[oe++]),Ie=pn(o[oe++],t.cm.options)}}}function vr(e,t,o){this.line=t,this.rest=Rn(t),this.size=this.rest?un(Ce(this.rest))-o+1:1,this.node=this.text=null,this.hidden=Hr(e,t)}function pi(e,t,o){for(var r=[],g,B=t;B<o;B=g){var $=new vr(e.doc,jt(e.doc,B),B);g=B+$.size,r.push($)}return r}var si=null;function Ui(e){si?si.ops.push(e):e.ownsGroup=si={ops:[e],delayedCallbacks:[]}}function ka(e){var t=e.delayedCallbacks,o=0;do{for(;o<t.length;o++)t[o].call(null);for(var r=0;r<e.ops.length;r++){var g=e.ops[r];if(g.cursorActivityHandlers)for(;g.cursorActivityCalled<g.cursorActivityHandlers.length;)g.cursorActivityHandlers[g.cursorActivityCalled++].call(null,g.cm)}}while(o<t.length)}function Lo(e,t){var o=e.ownsGroup;if(!o)return;try{ka(o)}finally{si=null,t(o)}}var ua=null;function Kr(e,t){var o=kt(e,t);if(!o.length)return;var r=Array.prototype.slice.call(arguments,2),g;si?g=si.delayedCallbacks:ua?g=ua:(g=ua=[],setTimeout(lo,0));for(var B=function(q){g.push(function(){return o[q].apply(null,r)})},$=0;$<o.length;++$)B($)}function lo(){var e=ua;ua=null;for(var t=0;t<e.length;++t)e[t]()}function uo(e,t,o,r){for(var g=0;g<t.changes.length;g++){var B=t.changes[g];B=="text"?co(e,t):B=="gutter"?Ca(e,t,o,r):B=="class"?Ma(e,t):B=="widget"&&ho(e,t,r)}t.changes=null}function va(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),G&&K<8&&(e.node.style.zIndex=2)),e.node}function ya(e,t){var o=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(o&&(o+=" CodeMirror-linebackground"),t.background)o?t.background.className=o:(t.background.parentNode.removeChild(t.background),t.background=null);else if(o){var r=va(t);t.background=r.insertBefore(d("div",null,o),r.firstChild),e.display.input.setUneditable(t.background)}}function $a(e,t){var o=e.display.externalMeasured;return o&&o.line==t.line?(e.display.externalMeasured=null,t.measure=o.measure,o.built):Gn(e,t)}function co(e,t){var o=t.text.className,r=$a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ma(e,t)):o&&(t.text.className=o)}function Ma(e,t){ya(e,t),t.line.wrapClass?va(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var o=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=o||""}function Ca(e,t,o,r){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 g=va(t);t.gutterBackground=d("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),g.insertBefore(t.gutterBackground,t.text)}var B=t.line.gutterMarkers;if(e.options.lineNumbers||B){var $=va(t),q=t.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(q),$.insertBefore(q,t.text),t.line.gutterClass&&(q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!B||!B["CodeMirror-linenumbers"])&&(t.lineNumber=q.appendChild(d("div",fi(e.options,o),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),B)for(var te=0;te<e.display.gutterSpecs.length;++te){var oe=e.display.gutterSpecs[te].className,Oe=B.hasOwnProperty(oe)&&B[oe];Oe&&q.appendChild(d("div",[Oe],"CodeMirror-gutter-elt","left: "+r.gutterLeft[oe]+"px; width: "+r.gutterWidth[oe]+"px"))}}}function ho(e,t,o){t.alignable&&(t.alignable=null);for(var r=O("CodeMirror-linewidget"),g=t.node.firstChild,B=void 0;g;g=B)B=g.nextSibling,r.test(g.className)&&t.node.removeChild(g);Na(e,t,o)}function fo(e,t,o,r){var g=$a(e,t);return t.text=t.node=g.pre,g.bgClass&&(t.bgClass=g.bgClass),g.textClass&&(t.textClass=g.textClass),Ma(e,t),Ca(e,t,o,r),Na(e,t,r),t.node}function Na(e,t,o){if(po(e,t.line,t,o,!0),t.rest)for(var r=0;r<t.rest.length;r++)po(e,t.rest[r],t,o,!1)}function po(e,t,o,r,g){if(!t.widgets)return;for(var B=va(o),$=0,q=t.widgets;$<q.length;++$){var te=q[$],oe=d("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||oe.setAttribute("cm-ignore-events","true"),Qa(te,oe,o,r),e.display.input.setUneditable(oe),g&&te.above?B.insertBefore(oe,o.gutter||o.text):B.appendChild(oe),Kr(te,"redraw")}}function Qa(e,t,o,r){if(e.noHScroll){(o.alignable||(o.alignable=[])).push(t);var g=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(g-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=g+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function _a(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(document.body,e.node)){var o="position: relative;";e.coverGutter&&(o+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(o+="width: "+t.display.wrapper.clientWidth+"px;"),h(t.display.measure,d("div",[e.node],null,o))}return e.height=e.node.parentNode.offsetHeight}function ra(e,t){for(var o=ke(t);o!=e.wrapper;o=o.parentNode)if(!o||o.nodeType==1&&o.getAttribute("cm-ignore-events")=="true"||o.parentNode==e.sizer&&o!=e.mover)return!0}function ba(e){return e.lineSpace.offsetTop}function Te(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Le(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=h(e.measure,d("pre","x","CodeMirror-line-like")),o=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(o.paddingLeft),right:parseInt(o.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function We(e){return J-e.display.nativeBarWidth}function Se(e){return e.display.scroller.clientWidth-We(e)-e.display.barWidth}function ie(e){return e.display.scroller.clientHeight-We(e)-e.display.barHeight}function ye(e,t,o){var r=e.options.lineWrapping,g=r&&Se(e);if(!t.measure.heights||r&&t.measure.width!=g){var B=t.measure.heights=[];if(r){t.measure.width=g;for(var $=t.text.firstChild.getClientRects(),q=0;q<$.length-1;q++){var te=$[q],oe=$[q+1];Math.abs(te.bottom-oe.bottom)>2&&B.push((te.bottom+oe.top)/2-o.top)}}B.push(o.bottom-o.top)}}function le(e,t,o){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var g=0;g<e.rest.length;g++)if(un(e.rest[g])>o)return{map:e.measure.maps[g],cache:e.measure.caches[g],before:!0}}function Ae(e,t){t=wn(t);var o=un(t),r=e.display.externalMeasured=new vr(e.doc,t,o);r.lineN=o;var g=r.built=Gn(e,r);return r.text=g.pre,h(e.display.lineMeasure,g.pre),r}function _e(e,t,o,r){return Ge(e,je(e,t),o,r)}function Be(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ir(e,t)];var o=e.display.externalMeasured;if(o&&t>=o.lineN&&t<o.lineN+o.size)return o}function je(e,t){var o=un(t),r=Be(e,o);r&&!r.text?r=null:r&&r.changes&&(uo(e,r,o,Br(e)),e.curOp.forceUpdate=!0),r||(r=Ae(e,t));var g=le(r,t,o);return{line:t,view:r,rect:null,map:g.map,cache:g.cache,before:g.before,hasHeights:!1}}function Ge(e,t,o,r,g){t.before&&(o=-1);var B=o+(r||""),$;return t.cache.hasOwnProperty(B)?$=t.cache[B]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(ye(e,t.view,t.rect),t.hasHeights=!0),$=Nt(e,t,o,r),$.bogus||(t.cache[B]=$)),{left:$.left,right:$.right,top:g?$.rtop:$.top,bottom:g?$.rbottom:$.bottom}}var et={left:0,right:0,top:0,bottom:0};function yt(e,t,o){for(var r,g,B,$,q,te,oe=0;oe<e.length;oe+=3)if(q=e[oe],te=e[oe+1],t<q?(g=0,B=1,$="left"):t<te?(g=t-q,B=g+1):(oe==e.length-3||t==te&&e[oe+3]>t)&&(B=te-q,g=B-1,t>=te&&($="right")),g!=null){if(r=e[oe+2],q==te&&o==(r.insertLeft?"left":"right")&&($=o),o=="left"&&g==0)for(;oe&&e[oe-2]==e[oe-3]&&e[oe-1].insertLeft;)r=e[(oe-=3)+2],$="left";if(o=="right"&&g==te-q)for(;oe<e.length-3&&e[oe+3]==e[oe+4]&&!e[oe+5].insertLeft;)r=e[(oe+=3)+2],$="right";break}return{node:r,start:g,end:B,collapse:$,coverStart:q,coverEnd:te}}function Tt(e,t){var o=et;if(t=="left")for(var r=0;r<e.length&&!((o=e[r]).left!=o.right);r++);else for(var g=e.length-1;g>=0&&!((o=e[g]).left!=o.right);g--);return o}function Nt(e,t,o,r){var g=yt(t.map,o,r),B=g.node,$=g.start,q=g.end,te=g.collapse,oe;if(B.nodeType==3){for(var Oe=0;Oe<4;Oe++){for(;$&&Ne(t.line.text.charAt(g.coverStart+$));)--$;for(;g.coverStart+q<g.coverEnd&&Ne(t.line.text.charAt(g.coverStart+q));)++q;if(G&&K<9&&$==0&&q==g.coverEnd-g.coverStart?oe=B.parentNode.getBoundingClientRect():oe=Tt(E(B,$,q).getClientRects(),r),oe.left||oe.right||$==0)break;q=$,$=$-1,te="right"}G&&K<11&&(oe=Dn(e.display.measure,oe))}else{$>0&&(te=r="right");var Ie;e.options.lineWrapping&&(Ie=B.getClientRects()).length>1?oe=Ie[r=="right"?Ie.length-1:0]:oe=B.getBoundingClientRect()}if(G&&K<9&&!$&&(!oe||!oe.left&&!oe.right)){var Qe=B.parentNode.getClientRects()[0];Qe?oe={left:Qe.left,right:Qe.left+Yr(e.display),top:Qe.top,bottom:Qe.bottom}:oe=et}for(var Xe=oe.top-t.rect.top,ct=oe.bottom-t.rect.top,Et=(Xe+ct)/2,It=t.view.measure.heights,Wt=0;Wt<It.length-1&&!(Et<It[Wt]);Wt++);var qt=Wt?It[Wt-1]:0,Ht=It[Wt],on={left:(te=="right"?oe.right:oe.left)-t.rect.left,right:(te=="left"?oe.left:oe.right)-t.rect.left,top:qt,bottom:Ht};return!oe.left&&!oe.right&&(on.bogus=!0),e.options.singleCursorHeightPerLine||(on.rtop=Xe,on.rbottom=ct),on}function Dn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Cr(e))return t;var o=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*o,right:t.right*o,top:t.top*r,bottom:t.bottom*r}}function $n(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 Bn(e){e.display.externalMeasure=null,v(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$n(e.display.view[t])}function zn(e){Bn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Xn(){return b&&l?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vn(){return b&&l?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Fn(e){var t=0;if(e.widgets)for(var o=0;o<e.widgets.length;++o)e.widgets[o].above&&(t+=_a(e.widgets[o]));return t}function Zn(e,t,o,r,g){if(!g){var B=Fn(t);o.top+=B,o.bottom+=B}if(r=="line")return o;r||(r="local");var $=Ft(t);if(r=="local"?$+=ba(e.display):$-=e.display.viewOffset,r=="page"||r=="window"){var q=e.display.lineSpace.getBoundingClientRect();$+=q.top+(r=="window"?0:Vn());var te=q.left+(r=="window"?0:Xn());o.left+=te,o.right+=te}return o.top+=$,o.bottom+=$,o}function er(e,t,o){if(o=="div")return t;var r=t.left,g=t.top;if(o=="page")r-=Xn(),g-=Vn();else if(o=="local"||!o){var B=e.display.sizer.getBoundingClientRect();r+=B.left,g+=B.top}var $=e.display.lineSpace.getBoundingClientRect();return{left:r-$.left,top:g-$.top}}function Nr(e,t,o,r,g){return r||(r=jt(e.doc,t.line)),Zn(e,r,_e(e,r,t.ch,g),o)}function tr(e,t,o,r,g,B){r=r||jt(e.doc,t.line),g||(g=je(e,r));function $(ct,Et){var It=Ge(e,g,ct,Et?"right":"left",B);return Et?It.left=It.right:It.right=It.left,Zn(e,r,It,o)}var q=gt(r,e.doc.direction),te=t.ch,oe=t.sticky;if(te>=r.text.length?(te=r.text.length,oe="before"):te<=0&&(te=0,oe="after"),!q)return $(oe=="before"?te-1:te,oe=="before");function Oe(ct,Et,It){var Wt=q[Et],qt=Wt.level==1;return $(It?ct-1:ct,qt!=It)}var Ie=at(q,te,oe),Qe=dt,Xe=Oe(te,Ie,oe=="before");return Qe!=null&&(Xe.other=Oe(te,Qe,oe!="before")),Xe}function En(e,t){var o=0;t=L(e.doc,t),e.options.lineWrapping||(o=Yr(e.display)*t.ch);var r=jt(e.doc,t.line),g=Ft(r)+ba(e.display);return{left:o,right:o,top:g,bottom:g+r.height}}function gn(e,t,o,r,g){var B=_t(e,t,o);return B.xRel=g,r&&(B.outside=r),B}function Wn(e,t,o){var r=e.doc;if(o+=e.display.viewOffset,o<0)return gn(r.first,0,null,-1,-1);var g=Rr(r,o),B=r.first+r.size-1;if(g>B)return gn(r.first+r.size-1,jt(r,B).text.length,null,1,1);t<0&&(t=0);for(var $=jt(r,g);;){var q=Ur(e,$,g,t,o),te=Me($,q.ch+(q.xRel>0||q.outside>0?1:0));if(!te)return q;var oe=te.find(1);if(oe.line==g)return oe;$=jt(r,g=oe.line)}}function ur(e,t,o,r){r-=Fn(t);var g=t.text.length,B=rt(function($){return Ge(e,o,$-1).bottom<=r},g,0);return g=rt(function($){return Ge(e,o,$).top>r},B,g),{begin:B,end:g}}function an(e,t,o,r){o||(o=je(e,t));var g=Zn(e,t,Ge(e,o,r),"line").top;return ur(e,t,o,g)}function cr(e,t,o,r){return e.bottom<=o?!1:e.top>o?!0:(r?e.left:e.right)>t}function Ur(e,t,o,r,g){g-=Ft(t);var B=je(e,t),$=Fn(t),q=0,te=t.text.length,oe=!0,Oe=gt(t,e.doc.direction);if(Oe){var Ie=(e.options.lineWrapping?Ar:ir)(e,t,o,B,Oe,r,g);oe=Ie.level!=1,q=oe?Ie.from:Ie.to-1,te=oe?Ie.to:Ie.from-1}var Qe=null,Xe=null,ct=rt(function(Pn){var xn=Ge(e,B,Pn);return xn.top+=$,xn.bottom+=$,cr(xn,r,g,!1)?(xn.top<=g&&xn.left<=r&&(Qe=Pn,Xe=xn),!0):!1},q,te),Et,It,Wt=!1;if(Xe){var qt=r-Xe.left<Xe.right-r,Ht=qt==oe;ct=Qe+(Ht?0:1),It=Ht?"after":"before",Et=qt?Xe.left:Xe.right}else{!oe&&(ct==te||ct==q)&&ct++,It=ct==0?"after":ct==t.text.length?"before":Ge(e,B,ct-(oe?1:0)).bottom+$<=g==oe?"after":"before";var on=tr(e,_t(o,ct,It),"line",t,B);Et=on.left,Wt=g<on.top?-1:g>=on.bottom?1:0}return ct=Ue(t.text,ct,1),gn(o,ct,It,Wt,r-Et)}function ir(e,t,o,r,g,B,$){var q=rt(function(Ie){var Qe=g[Ie],Xe=Qe.level!=1;return cr(tr(e,_t(o,Xe?Qe.to:Qe.from,Xe?"before":"after"),"line",t,r),B,$,!0)},0,g.length-1),te=g[q];if(q>0){var oe=te.level!=1,Oe=tr(e,_t(o,oe?te.from:te.to,oe?"after":"before"),"line",t,r);cr(Oe,B,$,!0)&&Oe.top>$&&(te=g[q-1])}return te}function Ar(e,t,o,r,g,B,$){var q=ur(e,t,r,$),te=q.begin,oe=q.end;/\s/.test(t.text.charAt(oe-1))&&oe--;for(var Oe=null,Ie=null,Qe=0;Qe<g.length;Qe++){var Xe=g[Qe];if(Xe.from>=oe||Xe.to<=te)continue;var ct=Xe.level!=1,Et=Ge(e,r,ct?Math.min(oe,Xe.to)-1:Math.max(te,Xe.from)).right,It=Et<B?B-Et+1e9:Et-B;(!Oe||Ie>It)&&(Oe=Xe,Ie=It)}return Oe||(Oe=g[g.length-1]),Oe.from<te&&(Oe={from:te,to:Oe.to,level:Oe.level}),Oe.to>oe&&(Oe={from:Oe.from,to:oe,level:Oe.level}),Oe}var Er;function Gr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Er==null){Er=d("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Er.appendChild(document.createTextNode("x")),Er.appendChild(d("br"));Er.appendChild(document.createTextNode("x"))}h(e.measure,Er);var o=Er.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),v(e.measure),o||1}function Yr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=d("span","xxxxxxxxxx"),o=d("pre",[t],"CodeMirror-line-like");h(e.measure,o);var r=t.getBoundingClientRect(),g=(r.right-r.left)/10;return g>2&&(e.cachedCharWidth=g),g||10}function Br(e){for(var t=e.display,o={},r={},g=t.gutters.clientLeft,B=t.gutters.firstChild,$=0;B;B=B.nextSibling,++$){var q=e.display.gutterSpecs[$].className;o[q]=B.offsetLeft+B.clientLeft+g,r[q]=B.clientWidth}return{fixedPos:_i(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:o,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function _i(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Pi(e){var t=Gr(e.display),o=e.options.lineWrapping,r=o&&Math.max(5,e.display.scroller.clientWidth/Yr(e.display)-3);return function(g){if(Hr(e.doc,g))return 0;var B=0;if(g.widgets)for(var $=0;$<g.widgets.length;$++)g.widgets[$].height&&(B+=g.widgets[$].height);return o?B+(Math.ceil(g.text.length/r)||1)*t:B+t}}function Si(e){var t=e.doc,o=Pi(e);t.iter(function(r){var g=o(r);g!=r.height&&qr(r,g)})}function $r(e,t,o,r){var g=e.display;if(!o&&ke(t).getAttribute("cm-not-content")=="true")return null;var B,$,q=g.lineSpace.getBoundingClientRect();try{B=t.clientX-q.left,$=t.clientY-q.top}catch(Ie){return null}var te=Wn(e,B,$),oe;if(r&&te.xRel>0&&(oe=jt(e.doc,te.line).text).length==te.ch){var Oe=H(oe,oe.length,e.options.tabSize)-oe.length;te=_t(te.line,Math.max(0,Math.round((B-Le(e.display).left)/Yr(e.display))-Oe))}return te}function Ir(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var o=e.display.view,r=0;r<o.length;r++)if(t-=o[r].size,t<0)return r}function xr(e,t,o,r){t==null&&(t=e.doc.first),o==null&&(o=e.doc.first+e.doc.size),r||(r=0);var g=e.display;if(r&&o<g.viewTo&&(g.updateLineNumbers==null||g.updateLineNumbers>t)&&(g.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=g.viewTo)cn&&ii(e.doc,t)<g.viewTo&&Tr(e);else if(o<=g.viewFrom)cn&&ai(e.doc,o+r)>g.viewFrom?Tr(e):(g.viewFrom+=r,g.viewTo+=r);else if(t<=g.viewFrom&&o>=g.viewTo)Tr(e);else if(t<=g.viewFrom){var B=ji(e,o,o+r,1);B?(g.view=g.view.slice(B.index),g.viewFrom=B.lineN,g.viewTo+=r):Tr(e)}else if(o>=g.viewTo){var $=ji(e,t,t,-1);$?(g.view=g.view.slice(0,$.index),g.viewTo=$.lineN):Tr(e)}else{var q=ji(e,t,t,-1),te=ji(e,o,o+r,1);q&&te?(g.view=g.view.slice(0,q.index).concat(pi(e,q.lineN,te.lineN)).concat(g.view.slice(te.index)),g.viewTo+=r):Tr(e)}var oe=g.externalMeasured;oe&&(o<oe.lineN?oe.lineN+=r:t<oe.lineN+oe.size&&(g.externalMeasured=null))}function Cn(e,t,o){e.curOp.viewChanged=!0;var r=e.display,g=e.display.externalMeasured;if(g&&t>=g.lineN&&t<g.lineN+g.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)return;var B=r.view[Ir(e,t)];if(B.node==null)return;var $=B.changes||(B.changes=[]);ee($,o)==-1&&$.push(o)}function Tr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ji(e,t,o,r){var g=Ir(e,t),B,$=e.display.view;if(!cn||o==e.doc.first+e.doc.size)return{index:g,lineN:o};for(var q=e.display.viewFrom,te=0;te<g;te++)q+=$[te].size;if(q!=t){if(r>0){if(g==$.length-1)return null;B=q+$[g].size-t,g++}else B=q-t;t+=B,o+=B}for(;ii(e.doc,o)!=o;){if(g==(r<0?0:$.length-1))return null;o+=r*$[g-(r<0?1:0)].size,g+=r}return{index:g,lineN:o}}function Zi(e,t,o){var r=e.display,g=r.view;g.length==0||t>=r.viewTo||o<=r.viewFrom?(r.view=pi(e,t,o),r.viewFrom=t):(r.viewFrom>t?r.view=pi(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ir(e,t))),r.viewFrom=t,r.viewTo<o?r.view=r.view.concat(pi(e,r.viewTo,o)):r.viewTo>o&&(r.view=r.view.slice(0,Ir(e,o)))),r.viewTo=o}function ia(e){for(var t=e.display.view,o=0,r=0;r<t.length;r++){var g=t[r];!g.hidden&&(!g.node||g.changes)&&++o}return o}function wr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Xi(e,t){t===void 0&&(t=!0);for(var o=e.doc,r={},g=r.cursors=document.createDocumentFragment(),B=r.selection=document.createDocumentFragment(),$=0;$<o.sel.ranges.length;$++){if(!t&&$==o.sel.primIndex)continue;var q=o.sel.ranges[$];if(q.from().line>=e.display.viewTo||q.to().line<e.display.viewFrom)continue;var te=q.empty();(te||e.options.showCursorWhenSelecting)&&Ji(e,q.head,g),te||yr(e,q,B)}return r}function Ji(e,t,o){var r=tr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),g=o.appendChild(d("div","\xA0","CodeMirror-cursor"));if(g.style.left=r.left+"px",g.style.top=r.top+"px",g.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var B=o.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));B.style.display="",B.style.left=r.other.left+"px",B.style.top=r.other.top+"px",B.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Dr(e,t){return e.top-t.top||e.left-t.left}function yr(e,t,o){var r=e.display,g=e.doc,B=document.createDocumentFragment(),$=Le(e.display),q=$.left,te=Math.max(r.sizerWidth,Se(e)-r.sizer.offsetLeft)-$.right,oe=g.direction=="ltr";function Oe(Ht,on,Pn,xn){on<0&&(on=0),on=Math.round(on),xn=Math.round(xn),B.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Ht+`px;
top: `+on+"px; width: "+(Pn==null?te-Ht:Pn)+`px;
height: `+(xn-on)+"px"))}function Ie(Ht,on,Pn){var xn=jt(g,Ht),ar=xn.text.length,jr,Ti;function Jr(di,Ki){return Nr(e,_t(Ht,di),"div",xn,Ki)}function $i(di,Ki,Ai){var vi=an(e,xn,null,di),hi=Ki=="ltr"==(Ai=="after")?"left":"right",ni=Ai=="after"?vi.begin:vi.end-(/\s/.test(xn.text.charAt(vi.end-1))?2:1);return Jr(ni,hi)[hi]}var Hi=gt(xn,g.direction);return st(Hi,on||0,Pn==null?ar:Pn,function(di,Ki,Ai,vi){var hi=Ai=="ltr",ni=Jr(di,hi?"left":"right"),Gi=Jr(Ki-1,hi?"right":"left"),Ro=on==null&&di==0,Ya=Pn==null&&Ki==ar,Li=vi==0,wa=!Hi||vi==Hi.length-1;if(Gi.top-ni.top<=3){var wi=(oe?Ro:Ya)&&Li,_s=(oe?Ya:Ro)&&wa,Pa=wi?q:(hi?ni:Gi).left,oo=_s?te:(hi?Gi:ni).right;Oe(Pa,ni.top,oo-Pa,ni.bottom)}else{var so,Ni,Do,bs;hi?(so=oe&&Ro&&Li?q:ni.left,Ni=oe?te:$i(di,Ai,"before"),Do=oe?q:$i(Ki,Ai,"after"),bs=oe&&Ya&&wa?te:Gi.right):(so=oe?$i(di,Ai,"before"):q,Ni=!oe&&Ro&&Li?te:ni.right,Do=!oe&&Ya&&wa?q:Gi.left,bs=oe?$i(Ki,Ai,"after"):te),Oe(so,ni.top,Ni-so,ni.bottom),ni.bottom<Gi.top&&Oe(q,ni.bottom,null,Gi.top),Oe(Do,Gi.top,bs-Do,Gi.bottom)}(!jr||Dr(ni,jr)<0)&&(jr=ni),Dr(Gi,jr)<0&&(jr=Gi),(!Ti||Dr(ni,Ti)<0)&&(Ti=ni),Dr(Gi,Ti)<0&&(Ti=Gi)}),{start:jr,end:Ti}}var Qe=t.from(),Xe=t.to();if(Qe.line==Xe.line)Ie(Qe.line,Qe.ch,Xe.ch);else{var ct=jt(g,Qe.line),Et=jt(g,Xe.line),It=wn(ct)==wn(Et),Wt=Ie(Qe.line,Qe.ch,It?ct.text.length+1:null).end,qt=Ie(Xe.line,It?0:null,Xe.ch).start;It&&(Wt.top<qt.top-2?(Oe(Wt.right,Wt.top,null,Wt.bottom),Oe(q,qt.top,qt.left,qt.bottom)):Oe(Wt.right,Wt.top,qt.left-Wt.right,Wt.bottom)),Wt.bottom<qt.top&&Oe(q,Wt.bottom,null,qt.top)}o.appendChild(B)}function Wr(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var o=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Ea(e),t.cursorDiv.style.visibility=(o=!o)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ua(e){e.state.focused||(e.display.input.focus(),ca(e))}function Za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ea(e))},100)}function ca(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(tt(e,"focus",e,t),e.state.focused=!0,W(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),n&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wr(e)}function Ea(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(tt(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function ei(e){for(var t=e.display,o=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var g=t.view[r],B=e.options.lineWrapping,$=void 0,q=0;if(g.hidden)continue;if(G&&K<8){var te=g.node.offsetTop+g.node.offsetHeight;$=te-o,o=te}else{var oe=g.node.getBoundingClientRect();$=oe.bottom-oe.top,!B&&g.text.firstChild&&(q=g.text.firstChild.getBoundingClientRect().right-oe.left-1)}var Oe=g.line.height-$;if((Oe>.005||Oe<-.005)&&(qr(g.line,$),Yi(g.line),g.rest))for(var Ie=0;Ie<g.rest.length;Ie++)Yi(g.rest[Ie]);if(q>e.display.sizerWidth){var Qe=Math.ceil(q/Yr(e.display));Qe>e.display.maxLineLength&&(e.display.maxLineLength=Qe,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}function Yi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var o=e.widgets[t],r=o.node.parentNode;r&&(o.height=r.offsetHeight)}}function ja(e,t,o){var r=o&&o.top!=null?Math.max(0,o.top):e.scroller.scrollTop;r=Math.floor(r-ba(e));var g=o&&o.bottom!=null?o.bottom:r+e.wrapper.clientHeight,B=Rr(t,r),$=Rr(t,g);if(o&&o.ensure){var q=o.ensure.from.line,te=o.ensure.to.line;q<B?(B=q,$=Rr(t,Ft(jt(t,q))+e.wrapper.clientHeight)):Math.min(te,t.lastLine())>=$&&(B=Rr(t,Ft(jt(t,te))-e.wrapper.clientHeight),$=te)}return{from:B,to:Math.max($,B+1)}}function Io(e,t){if(ft(e,"scrollCursorIntoView"))return;var o=e.display,r=o.sizer.getBoundingClientRect(),g=null;if(t.top+r.top<0?g=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(g=!1),g!=null&&!a){var B=d("div","\u200B",null,`position: absolute;
top: `+(t.top-o.viewOffset-ba(e.display))+`px;
height: `+(t.bottom-t.top+We(e)+o.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(B),B.scrollIntoView(g),e.display.lineSpace.removeChild(B)}}function Po(e,t,o,r){r==null&&(r=0);var g;!e.options.lineWrapping&&t==o&&(t=t.ch?_t(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,o=t.sticky=="before"?_t(t.line,t.ch+1,"before"):t);for(var B=0;B<5;B++){var $=!1,q=tr(e,t),te=!o||o==t?q:tr(e,o);g={left:Math.min(q.left,te.left),top:Math.min(q.top,te.top)-r,right:Math.max(q.left,te.left),bottom:Math.max(q.bottom,te.bottom)+r};var oe=Ja(e,g),Oe=e.doc.scrollTop,Ie=e.doc.scrollLeft;if(oe.scrollTop!=null&&(ha(e,oe.scrollTop),Math.abs(e.doc.scrollTop-Oe)>1&&($=!0)),oe.scrollLeft!=null&&(ki(e,oe.scrollLeft),Math.abs(e.doc.scrollLeft-Ie)>1&&($=!0)),!$)break}return g}function mo(e,t){var o=Ja(e,t);o.scrollTop!=null&&ha(e,o.scrollTop),o.scrollLeft!=null&&ki(e,o.scrollLeft)}function Ja(e,t){var o=e.display,r=Gr(e.display);t.top<0&&(t.top=0);var g=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:o.scroller.scrollTop,B=ie(e),$={};t.bottom-t.top>B&&(t.bottom=t.top+B);var q=e.doc.height+Te(o),te=t.top<r,oe=t.bottom>q-r;if(t.top<g)$.scrollTop=te?0:t.top;else if(t.bottom>g+B){var Oe=Math.min(t.top,(oe?q:t.bottom)-B);Oe!=g&&($.scrollTop=Oe)}var Ie=e.options.fixedGutter?0:o.gutters.offsetWidth,Qe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:o.scroller.scrollLeft-Ie,Xe=Se(e)-o.gutters.offsetWidth,ct=t.right-t.left>Xe;return ct&&(t.right=t.left+Xe),t.left<10?$.scrollLeft=0:t.left<Qe?$.scrollLeft=Math.max(0,t.left+Ie-(ct?0:10)):t.right>Xe+Qe-3&&($.scrollLeft=t.right+(ct?0:10)-Xe),$}function qa(e,t){if(t==null)return;Ba(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function da(e){Ba(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xa(e,t,o){(t!=null||o!=null)&&Ba(e),t!=null&&(e.curOp.scrollLeft=t),o!=null&&(e.curOp.scrollTop=o)}function go(e,t){Ba(e),e.curOp.scrollToPos=t}function Ba(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var o=En(e,t.from),r=En(e,t.to);Ta(e,o,r,t.margin)}}function Ta(e,t,o,r){var g=Ja(e,{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top)-r,right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)+r});xa(e,g.scrollLeft,g.scrollTop)}function ha(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||Oa(e,{top:t}),Pr(e,t,!0),M&&Oa(e),Aa(e,100)}function Pr(e,t,o){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!o)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ki(e,t,o,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(o?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,or(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,o=t.gutters.offsetWidth,r=Math.round(e.doc.height+Te(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?o:0,docHeight:r,scrollHeight:r+We(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:o}}var aa=function(e,t,o){this.cm=o;var r=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=g.tabIndex=-1,e(r),e(g),Je(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Je(g,"scroll",function(){g.clientWidth&&t(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&K<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};aa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,o=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(o){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var g=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+g)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=o?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var B=e.viewWidth-e.barLeft-(o?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+B)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:o?r:0,bottom:t?r:0}},aa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},aa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},aa.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 X,this.disableVert=new X},aa.prototype.enableZeroWidthBar=function(e,t,o){e.style.pointerEvents="auto";function r(){var g=e.getBoundingClientRect(),B=o=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);B!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},aa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function pa(e,t){t||(t=fa(e));var o=e.display.barWidth,r=e.display.barHeight;Fa(e,t);for(var g=0;g<4&&o!=e.display.barWidth||r!=e.display.barHeight;g++)o!=e.display.barWidth&&e.options.lineWrapping&&ei(e),Fa(e,fa(e)),o=e.display.barWidth,r=e.display.barHeight}function Fa(e,t){var o=e.display,r=o.scrollbars.update(t);o.sizer.style.paddingRight=(o.barWidth=r.right)+"px",o.sizer.style.paddingBottom=(o.barHeight=r.bottom)+"px",o.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(o.scrollbarFiller.style.display="block",o.scrollbarFiller.style.height=r.bottom+"px",o.scrollbarFiller.style.width=r.right+"px"):o.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(o.gutterFiller.style.display="block",o.gutterFiller.style.height=r.bottom+"px",o.gutterFiller.style.width=t.gutterWidth+"px"):o.gutterFiller.style.display=""}var eo={native:aa,null:Sa};function Wa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Je(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,o){o=="horizontal"?ki(e,t):ha(e,t)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function qi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++to},Ui(e.curOp)}function oa(e){var t=e.curOp;t&&Lo(t,function(o){for(var r=0;r<o.ops.length;r++)o.ops[r].cm.curOp=null;no(o)})}function no(e){for(var t=e.ops,o=0;o<t.length;o++)ro(t[o]);for(var r=0;r<t.length;r++)ko(t[r]);for(var g=0;g<t.length;g++)Mo(t[g]);for(var B=0;B<t.length;B++)io(t[B]);for(var $=0;$<t.length;$++)No(t[$])}function ro(e){var t=e.cm,o=t.display;ao(t),e.updateMaxLine&&lr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<o.viewFrom||e.scrollToPos.to.line>=o.viewTo)||o.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Mi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ko(e){e.updatedDisplay=e.mustUpdate&&ma(e.cm,e.update)}function Mo(e){var t=e.cm,o=t.display;e.updatedDisplay&&ei(t),e.barMeasure=fa(t),o.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_e(t,o.maxLine,o.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(o.scroller.clientWidth,o.sizer.offsetLeft+e.adjustWidthTo+We(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,o.sizer.offsetLeft+e.adjustWidthTo-Se(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=o.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ki(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var o=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,o),(e.updatedDisplay||e.startHeight!=t.doc.height)&&pa(t,e.barMeasure),e.updatedDisplay&&_r(t,e.barMeasure),e.selectionChanged&&Wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),o&&Ua(e.cm)}function No(e){var t=e.cm,o=t.display,r=t.doc;if(e.updatedDisplay&&Ga(t,e.update),o.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(o.wheelStartX=o.wheelStartY=null),e.scrollTop!=null&&Pr(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ki(t,e.scrollLeft,!0,!0),e.scrollToPos){var g=Po(t,L(r,e.scrollToPos.from),L(r,e.scrollToPos.to),e.scrollToPos.margin);Io(t,g)}var B=e.maybeHiddenMarkers,$=e.maybeUnhiddenMarkers;if(B)for(var q=0;q<B.length;++q)B[q].lines.length||tt(B[q],"hide");if($)for(var te=0;te<$.length;++te)$[te].lines.length&&tt($[te],"unhide");o.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&tt(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ti(e,t){if(e.curOp)return t();qi(e);try{return t()}finally{oa(e)}}function Qr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qi(e);try{return t.apply(e,arguments)}finally{oa(e)}}}function mi(e){return function(){if(this.curOp)return e.apply(this,arguments);qi(this);try{return e.apply(this,arguments)}finally{oa(this)}}}function Zr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qi(t);try{return e.apply(this,arguments)}finally{oa(t)}}}function Aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(Ha,e))}function Ha(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var o=+new Date+e.options.workTime,r=Lt(e,t.highlightFrontier),g=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(B){if(r.line>=e.display.viewFrom){var $=B.styles,q=B.text.length>e.options.maxHighlightLength?vn(t.mode,r.state):null,te=Pe(e,B,r,!0);q&&(r.state=q),B.styles=te.styles;var oe=B.styleClasses,Oe=te.classes;Oe?B.styleClasses=Oe:oe&&(B.styleClasses=null);for(var Ie=!$||$.length!=B.styles.length||oe!=Oe&&(!oe||!Oe||oe.bgClass!=Oe.bgClass||oe.textClass!=Oe.textClass),Qe=0;!Ie&&Qe<$.length;++Qe)Ie=$[Qe]!=B.styles[Qe];Ie&&g.push(r.line),B.stateAfter=r.save(),r.nextLine()}else B.text.length<=e.options.maxHighlightLength&&rn(e,B.text,r),B.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>o)return Aa(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),g.length&&ti(e,function(){for(var B=0;B<g.length;B++)Cn(e,g[B],"text")})}var Mi=function(e,t,o){var r=e.display;this.viewport=t,this.visible=ja(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Se(e),this.force=o,this.dims=Br(e),this.events=[]};Mi.prototype.signal=function(e,t){Ee(e,t)&&this.events.push(arguments)},Mi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)tt.apply(null,this.events[e])};function ao(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=We(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=We(e)+"px",t.scrollbarsClipped=!0)}function Ka(e){if(e.hasFocus())return null;var t=j();if(!t||!w(e.display.lineDiv,t))return null;var o={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&w(e.display.lineDiv,r.anchorNode)&&(o.anchorNode=r.anchorNode,o.anchorOffset=r.anchorOffset,o.focusNode=r.focusNode,o.focusOffset=r.focusOffset)}return o}function vo(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),o=document.createRange();o.setEnd(e.anchorNode,e.anchorOffset),o.collapse(!1),t.removeAllRanges(),t.addRange(o),t.extend(e.focusNode,e.focusOffset)}}function ma(e,t){var o=e.display,r=e.doc;if(t.editorIsHidden)return Tr(e),!1;if(!t.force&&t.visible.from>=o.viewFrom&&t.visible.to<=o.viewTo&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo)&&o.renderedView==o.view&&ia(e)==0)return!1;ci(e)&&(Tr(e),t.dims=Br(e));var g=r.first+r.size,B=Math.max(t.visible.from-e.options.viewportMargin,r.first),$=Math.min(g,t.visible.to+e.options.viewportMargin);o.viewFrom<B&&B-o.viewFrom<20&&(B=Math.max(r.first,o.viewFrom)),o.viewTo>$&&o.viewTo-$<20&&($=Math.min(g,o.viewTo)),cn&&(B=ii(e.doc,B),$=ai(e.doc,$));var q=B!=o.viewFrom||$!=o.viewTo||o.lastWrapHeight!=t.wrapperHeight||o.lastWrapWidth!=t.wrapperWidth;Zi(e,B,$),o.viewOffset=Ft(jt(e.doc,o.viewFrom)),e.display.mover.style.top=o.viewOffset+"px";var te=ia(e);if(!q&&te==0&&!t.force&&o.renderedView==o.view&&(o.updateLineNumbers==null||o.updateLineNumbers>=o.viewTo))return!1;var oe=Ka(e);return te>4&&(o.lineDiv.style.display="none"),yo(e,o.updateLineNumbers,t.dims),te>4&&(o.lineDiv.style.display=""),o.renderedView=o.view,vo(oe),v(o.cursorDiv),v(o.selectionDiv),o.gutters.style.height=o.sizer.style.minHeight=0,q&&(o.lastWrapHeight=t.wrapperHeight,o.lastWrapWidth=t.wrapperWidth,Aa(e,400)),o.updateLineNumbers=null,!0}function Ga(e,t){for(var o=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Se(e)){if(o&&o.top!=null&&(o={top:Math.min(e.doc.height+Te(e.display)-ie(e),o.top)}),t.visible=ja(e.display,e.doc,o),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ja(e.display,e.doc,o));if(!ma(e,t))break;ei(e);var g=fa(e);wr(e),pa(e,g),_r(e,g),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 Oa(e,t){var o=new Mi(e,t);if(ma(e,o)){ei(e),Ga(e,o);var r=fa(e);wr(e),pa(e,r),_r(e,r),o.finish()}}function yo(e,t,o){var r=e.display,g=e.options.lineNumbers,B=r.lineDiv,$=B.firstChild;function q(ct){var Et=ct.nextSibling;return n&&s&&e.display.currentWheelTarget==ct?ct.style.display="none":ct.parentNode.removeChild(ct),Et}for(var te=r.view,oe=r.viewFrom,Oe=0;Oe<te.length;Oe++){var Ie=te[Oe];if(!Ie.hidden)if(!Ie.node||Ie.node.parentNode!=B){var Qe=fo(e,Ie,oe,o);B.insertBefore(Qe,$)}else{for(;$!=Ie.node;)$=q($);var Xe=g&&t!=null&&t<=oe&&Ie.lineNumber;Ie.changes&&(ee(Ie.changes,"gutter")>-1&&(Xe=!1),uo(e,Ie,oe,o)),Xe&&(v(Ie.lineNumber),Ie.lineNumber.appendChild(document.createTextNode(fi(e.options,oe)))),$=Ie.node.nextSibling}oe+=Ie.size}for(;$;)$=q($)}function za(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _r(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+We(e)+"px"}function or(e){var t=e.display,o=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=_i(t)-t.scroller.scrollLeft+e.doc.scrollLeft,g=t.gutters.offsetWidth,B=r+"px",$=0;$<o.length;$++)if(!o[$].hidden){e.options.fixedGutter&&(o[$].gutter&&(o[$].gutter.style.left=B),o[$].gutterBackground&&(o[$].gutterBackground.style.left=B));var q=o[$].alignable;if(q)for(var te=0;te<q.length;te++)q[te].style.left=B}e.options.fixedGutter&&(t.gutters.style.left=r+g+"px")}function ci(e){if(!e.options.lineNumbers)return!1;var t=e.doc,o=fi(e.options,t.first+t.size-1),r=e.display;if(o.length!=r.lineNumChars){var g=r.measure.appendChild(d("div",[d("div",o)],"CodeMirror-linenumber CodeMirror-gutter-elt")),B=g.firstChild.offsetWidth,$=g.offsetWidth-B;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(B,r.lineGutter.offsetWidth-$)+1,r.lineNumWidth=r.lineNumInnerWidth+$,r.lineNumChars=r.lineNumInnerWidth?o.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",za(e.display),!0}return!1}function bi(e,t){for(var o=[],r=!1,g=0;g<e.length;g++){var B=e[g],$=null;if(typeof B!="string"&&($=B.style,B=B.className),B=="CodeMirror-linenumbers")if(t)r=!0;else continue;o.push({className:B,style:$})}return t&&!r&&o.push({className:"CodeMirror-linenumbers",style:null}),o}function sa(e){var t=e.gutters,o=e.gutterSpecs;v(t),e.lineGutter=null;for(var r=0;r<o.length;++r){var g=o[r],B=g.className,$=g.style,q=t.appendChild(d("div",null,"CodeMirror-gutter "+B));$&&(q.style.cssText=$),B=="CodeMirror-linenumbers"&&(e.lineGutter=q,q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=o.length?"":"none",za(e)}function ea(e){sa(e.display),xr(e),or(e)}function Ra(e,t,o,r){var g=this;this.input=o,g.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),g.scrollbarFiller.setAttribute("cm-not-content","true"),g.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),g.gutterFiller.setAttribute("cm-not-content","true"),g.lineDiv=C("div",null,"CodeMirror-code"),g.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),g.cursorDiv=d("div",null,"CodeMirror-cursors"),g.measure=d("div",null,"CodeMirror-measure"),g.lineMeasure=d("div",null,"CodeMirror-measure"),g.lineSpace=C("div",[g.measure,g.lineMeasure,g.selectionDiv,g.cursorDiv,g.lineDiv],null,"position: relative; outline: none");var B=C("div",[g.lineSpace],"CodeMirror-lines");g.mover=d("div",[B],null,"position: relative"),g.sizer=d("div",[g.mover],"CodeMirror-sizer"),g.sizerWidth=null,g.heightForcer=d("div",null,null,"position: absolute; height: "+J+"px; width: 1px;"),g.gutters=d("div",null,"CodeMirror-gutters"),g.lineGutter=null,g.scroller=d("div",[g.sizer,g.heightForcer,g.gutters],"CodeMirror-scroll"),g.scroller.setAttribute("tabIndex","-1"),g.wrapper=d("div",[g.scrollbarFiller,g.gutterFiller,g.scroller],"CodeMirror"),G&&K<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!n&&!(M&&u)&&(g.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(g.wrapper):e(g.wrapper)),g.viewFrom=g.viewTo=t.first,g.reportedViewFrom=g.reportedViewTo=t.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=bi(r.gutters,r.lineNumbers),sa(g),o.init(g)}var la=0,li=null;G?li=-.53:M?li=15:b?li=-.7:y&&(li=-1/3);function Da(e){var t=e.wheelDeltaX,o=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),o==null&&e.detail&&e.axis==e.VERTICAL_AXIS?o=e.detail:o==null&&(o=e.wheelDelta),{x:t,y:o}}function it(e){var t=Da(e);return t.x*=li,t.y*=li,t}function qe(e,t){var o=Da(t),r=o.x,g=o.y,B=e.display,$=B.scroller,q=$.scrollWidth>$.clientWidth,te=$.scrollHeight>$.clientHeight;if(!(r&&q||g&&te))return;if(g&&s&&n){e:for(var oe=t.target,Oe=B.view;oe!=$;oe=oe.parentNode)for(var Ie=0;Ie<Oe.length;Ie++)if(Oe[Ie].node==oe){e.display.currentWheelTarget=oe;break e}}if(r&&!M&&!f&&li!=null){g&&te&&ha(e,Math.max(0,$.scrollTop+g*li)),ki(e,Math.max(0,$.scrollLeft+r*li)),(!g||g&&te)&&de(t),B.wheelStartX=null;return}if(g&&li!=null){var Qe=g*li,Xe=e.doc.scrollTop,ct=Xe+B.wrapper.clientHeight;Qe<0?Xe=Math.max(0,Xe+Qe-50):ct=Math.min(e.doc.height,ct+Qe+50),Oa(e,{top:Xe,bottom:ct})}la<20&&(B.wheelStartX==null?(B.wheelStartX=$.scrollLeft,B.wheelStartY=$.scrollTop,B.wheelDX=r,B.wheelDY=g,setTimeout(function(){if(B.wheelStartX==null)return;var Et=$.scrollLeft-B.wheelStartX,It=$.scrollTop-B.wheelStartY,Wt=It&&B.wheelDY&&It/B.wheelDY||Et&&B.wheelDX&&Et/B.wheelDX;if(B.wheelStartX=B.wheelStartY=null,!Wt)return;li=(li*la+Wt)/(la+1),++la},200)):(B.wheelDX+=r,B.wheelDY+=g))}var $e=function(e,t){this.ranges=e,this.primIndex=t};$e.prototype.primary=function(){return this.ranges[this.primIndex]},$e.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 o=this.ranges[t],r=e.ranges[t];if(!Ii(o.anchor,r.anchor)||!Ii(o.head,r.head))return!1}return!0},$e.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ot(zi(this.ranges[t].anchor),zi(this.ranges[t].head));return new $e(e,this.primIndex)},$e.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},$e.prototype.contains=function(e,t){t||(t=e);for(var o=0;o<this.ranges.length;o++){var r=this.ranges[o];if(sn(t,r.from())>=0&&sn(e,r.to())<=0)return o}return-1};var ot=function(e,t){this.anchor=e,this.head=t};ot.prototype.from=function(){return Vi(this.anchor,this.head)},ot.prototype.to=function(){return na(this.anchor,this.head)},ot.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function lt(e,t,o){var r=e&&e.options.selectionsMayTouch,g=t[o];t.sort(function(Qe,Xe){return sn(Qe.from(),Xe.from())}),o=ee(t,g);for(var B=1;B<t.length;B++){var $=t[B],q=t[B-1],te=sn(q.to(),$.from());if(r&&!$.empty()?te>0:te>=0){var oe=Vi(q.from(),$.from()),Oe=na(q.to(),$.to()),Ie=q.empty()?$.from()==$.head:q.from()==q.head;B<=o&&--o,t.splice(--B,2,new ot(Ie?Oe:oe,Ie?oe:Oe))}}return new $e(t,o)}function At(e,t){return new $e([new ot(e,t||e)],0)}function St(e){return e.text?_t(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function wt(e,t){if(sn(e,t.from)<0)return e;if(sn(e,t.to)<=0)return St(t);var o=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=St(t).ch-t.to.ch),_t(o,r)}function dn(e,t){for(var o=[],r=0;r<e.sel.ranges.length;r++){var g=e.sel.ranges[r];o.push(new ot(wt(g.anchor,t),wt(g.head,t)))}return lt(e.cm,o,e.sel.primIndex)}function nr(e,t,o){return e.line==t.line?_t(o.line,e.ch-t.ch+o.ch):_t(o.line+(e.line-t.line),e.ch)}function Oi(e,t,o){for(var r=[],g=_t(e.first,0),B=g,$=0;$<t.length;$++){var q=t[$],te=nr(q.from,g,B),oe=nr(St(q),g,B);if(g=q.to,B=oe,o=="around"){var Oe=e.sel.ranges[$],Ie=sn(Oe.head,Oe.anchor)<0;r[$]=new ot(Ie?oe:te,Ie?te:oe)}else r[$]=new ot(te,te)}return new $e(r,e.sel.primIndex)}function Hn(e){e.doc.mode=Xr(e.options,e.doc.modeOption),Ei(e)}function Ei(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&&xr(e)}function xi(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function gi(e,t,o,r){function g(qt){return o?o[qt]:null}function B(qt,Ht,on){oi(qt,Ht,on,r),Kr(qt,"change",qt,t)}function $(qt,Ht){for(var on=[],Pn=qt;Pn<Ht;++Pn)on.push(new Yn(oe[Pn],g(Pn),r));return on}var q=t.from,te=t.to,oe=t.text,Oe=jt(e,q.line),Ie=jt(e,te.line),Qe=Ce(oe),Xe=g(oe.length-1),ct=te.line-q.line;if(t.full)e.insert(0,$(0,oe.length)),e.remove(oe.length,e.size-oe.length);else if(xi(e,t)){var Et=$(0,oe.length-1);B(Ie,Ie.text,Xe),ct&&e.remove(q.line,ct),Et.length&&e.insert(q.line,Et)}else if(Oe==Ie)if(oe.length==1)B(Oe,Oe.text.slice(0,q.ch)+Qe+Oe.text.slice(te.ch),Xe);else{var It=$(1,oe.length-1);It.push(new Yn(Qe+Oe.text.slice(te.ch),Xe,r)),B(Oe,Oe.text.slice(0,q.ch)+oe[0],g(0)),e.insert(q.line+1,It)}else if(oe.length==1)B(Oe,Oe.text.slice(0,q.ch)+oe[0]+Ie.text.slice(te.ch),g(0)),e.remove(q.line+1,ct);else{B(Oe,Oe.text.slice(0,q.ch)+oe[0],g(0)),B(Ie,Qe+Ie.text.slice(te.ch),Xe);var Wt=$(1,oe.length-1);ct>1&&e.remove(q.line+1,ct-1),e.insert(q.line+1,Wt)}Kr(e,"change",e,t)}function Ri(e,t,o){function r(g,B,$){if(g.linked)for(var q=0;q<g.linked.length;++q){var te=g.linked[q];if(te.doc==B)continue;var oe=$&&te.sharedHist;if(o&&!oe)continue;t(te.doc,oe),r(te.doc,g,oe)}}r(e,null,!0)}function zr(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Si(e),Hn(e),Bi(e),e.options.lineWrapping||lr(e),e.options.mode=t.modeOption,xr(e)}function Bi(e){(e.doc.direction=="rtl"?W:m)(e.display.lineDiv,"CodeMirror-rtl")}function ta(e){ti(e,function(){Bi(e),xr(e)})}function La(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 Fi(e,t){var o={from:zi(t.from),to:St(t),text:Fr(e,t.from,t.to)};return xs(e,o,t.from.line,t.to.line+1),Ri(e,function(r){return xs(r,o,t.from.line,t.to.line+1)},!0),o}function _o(e){for(;e.length;){var t=Ce(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return _o(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function Es(e,t,o,r){var g=e.history;g.undone.length=0;var B=+new Date,$,q;if((g.lastOp==r||g.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&g.lastModTime>B-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&($=pl(g,g.lastOp==r)))q=Ce($.changes),sn(t.from,t.to)==0&&sn(t.from,q.to)==0?q.to=St(t):$.changes.push(Fi(e,t));else{var te=Ce(g.done);for((!te||!te.ranges)&&Qo(e.sel,g.done),$={changes:[Fi(e,t)],generation:g.generation},g.done.push($);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(o),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=B,g.lastOp=g.lastSelOp=r,g.lastOrigin=g.lastSelOrigin=t.origin,q||tt(e,"historyAdded")}function ml(e,t,o,r){var g=t.charAt(0);return g=="*"||g=="+"&&o.ranges.length==r.ranges.length&&o.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,o,r){var g=e.history,B=r&&r.origin;o==g.lastSelOp||B&&g.lastSelOrigin==B&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==B||ml(e,B,Ce(g.done),t))?g.done[g.done.length-1]=t:Qo(t,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=B,g.lastSelOp=o,r&&r.clearRedo!==!1&&_o(g.undone)}function Qo(e,t){var o=Ce(t);o&&o.ranges&&o.equals(e)||t.push(e)}function xs(e,t,o,r){var g=t["spans_"+e.id],B=0;e.iter(Math.max(e.first,o),Math.min(e.first+e.size,r),function($){$.markedSpans&&((g||(g=t["spans_"+e.id]={}))[B]=$.markedSpans),++B})}function vl(e){if(!e)return null;for(var t,o=0;o<e.length;++o)e[o].marker.explicitlyCleared?t||(t=e.slice(0,o)):t&&t.push(e[o]);return t?t.length?t:null:e}function yl(e,t){var o=t["spans_"+e.id];if(!o)return null;for(var r=[],g=0;g<t.text.length;++g)r.push(vl(o[g]));return r}function Ts(e,t){var o=yl(e,t),r=Nn(e,t);if(!o)return r;if(!r)return o;for(var g=0;g<o.length;++g){var B=o[g],$=r[g];if(B&&$){e:for(var q=0;q<$.length;++q){for(var te=$[q],oe=0;oe<B.length;++oe)if(B[oe].marker==te.marker)continue e;B.push(te)}}else $&&(o[g]=$)}return o}function bo(e,t,o){for(var r=[],g=0;g<e.length;++g){var B=e[g];if(B.ranges){r.push(o?$e.prototype.deepCopy.call(B):B);continue}var $=B.changes,q=[];r.push({changes:q});for(var te=0;te<$.length;++te){var oe=$[te],Oe=void 0;if(q.push({from:oe.from,to:oe.to,text:oe.text}),t)for(var Ie in oe)(Oe=Ie.match(/^spans_(\d+)$/))&&(ee(t,Number(Oe[1]))>-1&&(Ce(q)[Ie]=oe[Ie],delete oe[Ie]))}}return r}function ls(e,t,o,r){if(r){var g=e.anchor;if(o){var B=sn(t,g)<0;B!=sn(o,g)<0?(g=t,t=o):B!=sn(t,o)<0&&(t=o)}return new ot(g,t)}else return new ot(o||t,t)}function Zo(e,t,o,r,g){g==null&&(g=e.cm&&(e.cm.display.shift||e.extend)),Di(e,new $e([ls(e.sel.primary(),t,o,g)],0),r)}function ws(e,t,o){for(var r=[],g=e.cm&&(e.cm.display.shift||e.extend),B=0;B<e.sel.ranges.length;B++)r[B]=ls(e.sel.ranges[B],t[B],null,g);var $=lt(e.cm,r,e.sel.primIndex);Di(e,$,o)}function us(e,t,o,r){var g=e.sel.ranges.slice(0);g[t]=o,Di(e,lt(e.cm,g,e.sel.primIndex),r)}function Cs(e,t,o,r){Di(e,At(t,o),r)}function _l(e,t,o){var r={ranges:t.ranges,update:function(g){this.ranges=[];for(var B=0;B<g.length;B++)this.ranges[B]=new ot(L(e,g[B].anchor),L(e,g[B].head))},origin:o&&o.origin};return tt(e,"beforeSelectionChange",e,r),e.cm&&tt(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?lt(e.cm,r.ranges,r.ranges.length-1):t}function Ss(e,t,o){var r=e.history.done,g=Ce(r);g&&g.ranges?(r[r.length-1]=t,Jo(e,t,o)):Di(e,t,o)}function Di(e,t,o){Jo(e,t,o),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,o)}function Jo(e,t,o){(Ee(e,"beforeSelectionChange")||e.cm&&Ee(e.cm,"beforeSelectionChange"))&&(t=_l(e,t,o));var r=o&&o.bias||(sn(t.primary().head,e.sel.primary().head)<0?-1:1);As(e,Rs(e,t,r,!0)),!(o&&o.scroll===!1)&&e.cm&&da(e.cm)}function As(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),Kr(e,"cursorActivity",e)}function Os(e){As(e,Rs(e,e.sel,null,!1))}function Rs(e,t,o,r){for(var g,B=0;B<t.ranges.length;B++){var $=t.ranges[B],q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[B],te=qo(e,$.anchor,q&&q.anchor,o,r),oe=qo(e,$.head,q&&q.head,o,r);(g||te!=$.anchor||oe!=$.head)&&(g||(g=t.ranges.slice(0,B)),g[B]=new ot(te,oe))}return g?lt(e.cm,g,t.primIndex):t}function Eo(e,t,o,r,g){var B=jt(e,t.line);if(B.markedSpans)for(var $=0;$<B.markedSpans.length;++$){var q=B.markedSpans[$],te=q.marker,oe="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,Oe="selectRight"in te?!te.selectRight:te.inclusiveRight;if((q.from==null||(oe?q.from<=t.ch:q.from<t.ch))&&(q.to==null||(Oe?q.to>=t.ch:q.to>t.ch))){if(g&&(tt(te,"beforeCursorEnter"),te.explicitlyCleared))if(B.markedSpans){--$;continue}else break;if(!te.atomic)continue;if(o){var Ie=te.find(r<0?1:-1),Qe=void 0;if((r<0?Oe:oe)&&(Ie=Ds(e,Ie,-r,Ie&&Ie.line==t.line?B:null)),Ie&&Ie.line==t.line&&(Qe=sn(Ie,o))&&(r<0?Qe<0:Qe>0))return Eo(e,Ie,t,r,g)}var Xe=te.find(r<0?-1:1);return(r<0?oe:Oe)&&(Xe=Ds(e,Xe,r,Xe.line==t.line?B:null)),Xe?Eo(e,Xe,t,r,g):null}}return t}function qo(e,t,o,r,g){var B=r||1,$=Eo(e,t,o,B,g)||!g&&Eo(e,t,o,B,!0)||Eo(e,t,o,-B,g)||!g&&Eo(e,t,o,-B,!0);return $||(e.cantEdit=!0,_t(e.first,0))}function Ds(e,t,o,r){return o<0&&t.ch==0?t.line>e.first?L(e,_t(t.line-1)):null:o>0&&t.ch==(r||jt(e,t.line)).text.length?t.line<e.first+e.size-1?_t(t.line+1,0):null:new _t(t.line,t.ch+o)}function Ls(e){e.setSelection(_t(e.firstLine(),0),_t(e.lastLine()),me)}function Is(e,t,o){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return o&&(r.update=function(g,B,$,q){g&&(r.from=L(e,g)),B&&(r.to=L(e,B)),$&&(r.text=$),q!==void 0&&(r.origin=q)}),tt(e,"beforeChange",e,r),e.cm&&tt(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function xo(e,t,o){if(e.cm){if(!e.cm.curOp)return Qr(e.cm,xo)(e,t,o);if(e.cm.state.suppressEdits)return}if((Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"))&&(t=Is(e,t,!0),!t))return;var r=Gt&&!o&&On(e,t.from,t.to);if(r)for(var g=r.length-1;g>=0;--g)Ps(e,{from:r[g].from,to:r[g].to,text:g?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&sn(t.from,t.to)==0)return;var o=dn(e,t);Es(e,t,o,e.cm?e.cm.curOp.id:NaN),Uo(e,t,o,Nn(e,t));var r=[];Ri(e,function(g,B){!B&&ee(r,g.history)==-1&&(Us(g.history,t),r.push(g.history)),Uo(g,t,null,Nn(g,t))})}function es(e,t,o){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!o)return;for(var g=e.history,B,$=e.sel,q=t=="undo"?g.done:g.undone,te=t=="undo"?g.undone:g.done,oe=0;oe<q.length&&!(B=q[oe],o?B.ranges&&!B.equals(e.sel):!B.ranges);oe++);if(oe==q.length)return;for(g.lastOrigin=g.lastSelOrigin=null;;)if(B=q.pop(),B.ranges){if(Qo(B,te),o&&!B.equals(e.sel)){Di(e,B,{clearRedo:!1});return}$=B}else if(r){q.push(B);return}else break;var Oe=[];Qo($,te),te.push({changes:Oe,generation:g.generation}),g.generation=B.generation||++g.maxGeneration;for(var Ie=Ee(e,"beforeChange")||e.cm&&Ee(e.cm,"beforeChange"),Qe=function(Et){var It=B.changes[Et];if(It.origin=t,Ie&&!Is(e,It,!1))return q.length=0,{};Oe.push(Fi(e,It));var Wt=Et?dn(e,It):Ce(q);Uo(e,It,Wt,Ts(e,It)),!Et&&e.cm&&e.cm.scrollIntoView({from:It.from,to:St(It)});var qt=[];Ri(e,function(Ht,on){!on&&ee(qt,Ht.history)==-1&&(Us(Ht.history,It),qt.push(Ht.history)),Uo(Ht,It,null,Ts(Ht,It))})},Xe=B.changes.length-1;Xe>=0;--Xe){var ct=Qe(Xe);if(ct)return ct.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new $e(ze(e.sel.ranges,function(g){return new ot(_t(g.anchor.line+t,g.anchor.ch),_t(g.head.line+t,g.head.ch))}),e.sel.primIndex),e.cm){xr(e.cm,e.first,e.first-t,t);for(var o=e.cm.display,r=o.viewFrom;r<o.viewTo;r++)Cn(e.cm,r,"gutter")}}function Uo(e,t,o,r){if(e.cm&&!e.cm.curOp)return Qr(e.cm,Uo)(e,t,o,r);if(t.to.line<e.first){ks(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 g=t.text.length-1-(e.first-t.from.line);ks(e,g),t={from:_t(e.first,0),to:_t(t.to.line+g,t.to.ch),text:[Ce(t.text)],origin:t.origin}}var B=e.lastLine();t.to.line>B&&(t={from:t.from,to:_t(B,jt(e,B).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Fr(e,t.from,t.to),o||(o=dn(e,t)),e.cm?bl(e.cm,t,r):gi(e,t,r),Jo(e,o,me),e.cantEdit&&qo(e,_t(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,o){var r=e.doc,g=e.display,B=t.from,$=t.to,q=!1,te=B.line;e.options.lineWrapping||(te=un(wn(jt(r,B.line))),r.iter(te,$.line+1,function(Xe){if(Xe==g.maxLine)return q=!0,!0})),r.sel.contains(t.from,t.to)>-1&&be(e),gi(r,t,o,Pi(e)),e.options.lineWrapping||(r.iter(te,B.line+t.text.length,function(Xe){var ct=br(Xe);ct>g.maxLineLength&&(g.maxLine=Xe,g.maxLineLength=ct,g.maxLineChanged=!0,q=!1)}),q&&(e.curOp.updateMaxLine=!0)),Rt(r,B.line),Aa(e,400);var oe=t.text.length-($.line-B.line)-1;t.full?xr(e):B.line==$.line&&t.text.length==1&&!xi(e.doc,t)?Cn(e,B.line,"text"):xr(e,B.line,$.line+1,oe);var Oe=Ee(e,"changes"),Ie=Ee(e,"change");if(Ie||Oe){var Qe={from:B,to:$,text:t.text,removed:t.removed,origin:t.origin};Ie&&Kr(e,"change",e,Qe),Oe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Qe)}e.display.selForContextMenu=null}function To(e,t,o,r,g){var B;r||(r=o),sn(r,o)<0&&(B=[r,o],o=B[0],r=B[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:o,to:r,text:t,origin:g})}function Ms(e,t,o,r){o<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ns(e,t,o,r){for(var g=0;g<e.length;++g){var B=e[g],$=!0;if(B.ranges){B.copied||(B=e[g]=B.deepCopy(),B.copied=!0);for(var q=0;q<B.ranges.length;q++)Ms(B.ranges[q].anchor,t,o,r),Ms(B.ranges[q].head,t,o,r);continue}for(var te=0;te<B.changes.length;++te){var oe=B.changes[te];if(o<oe.from.line)oe.from=_t(oe.from.line+r,oe.from.ch),oe.to=_t(oe.to.line+r,oe.to.ch);else if(t<=oe.to.line){$=!1;break}}$||(e.splice(0,g+1),g=0)}}function Us(e,t){var o=t.from.line,r=t.to.line,g=t.text.length-(r-o)-1;Ns(e.done,o,r,g),Ns(e.undone,o,r,g)}function jo(e,t,o,r){var g=t,B=t;return typeof t=="number"?B=jt(e,Z(e,t)):g=un(t),g==null?null:(r(B,g)&&e.cm&&Cn(e.cm,g,o),B)}function Bo(e){this.lines=e,this.parent=null;for(var t=0,o=0;o<e.length;++o)e[o].parent=this,t+=e[o].height;this.height=t}Bo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var o=e,r=e+t;o<r;++o){var g=this.lines[o];this.height-=g.height,$t(g),Kr(g,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,o){this.height+=o,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,o){for(var r=e+t;e<r;++e)if(o(this.lines[e]))return!0}};function Fo(e){this.children=e;for(var t=0,o=0,r=0;r<e.length;++r){var g=e[r];t+=g.chunkSize(),o+=g.height,g.parent=this}this.size=t,this.height=o,this.parent=null}Fo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var o=0;o<this.children.length;++o){var r=this.children[o],g=r.chunkSize();if(e<g){var B=Math.min(t,g-e),$=r.height;if(r.removeInner(e,B),this.height-=$-r.height,g==B&&(this.children.splice(o--,1),r.parent=null),(t-=B)==0)break;e=0}else e-=g}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bo))){var q=[];this.collapse(q),this.children=[new Bo(q)],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,o){this.size+=t.length,this.height+=o;for(var r=0;r<this.children.length;++r){var g=this.children[r],B=g.chunkSize();if(e<=B){if(g.insertInner(e,t,o),g.lines&&g.lines.length>50){for(var $=g.lines.length%25+25,q=$;q<g.lines.length;){var te=new Bo(g.lines.slice(q,q+=25));g.height-=te.height,this.children.splice(++r,0,te),te.parent=this}g.lines=g.lines.slice(0,$),this.maybeSpill()}break}e-=B}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),o=new Fo(t);if(e.parent){e.size-=o.size,e.height-=o.height;var g=ee(e.parent.children,e);e.parent.children.splice(g+1,0,o)}else{var r=new Fo(e.children);r.parent=e,e.children=[r,o],e=r}o.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,o){for(var r=0;r<this.children.length;++r){var g=this.children[r],B=g.chunkSize();if(e<B){var $=Math.min(t,B-e);if(g.iterN(e,$,o))return!0;if((t-=$)==0)break;e=0}else e-=B}}};var Wo=function(e,t,o){if(o)for(var r in o)o.hasOwnProperty(r)&&(this[r]=o[r]);this.doc=e,this.node=t};Wo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,o=this.line,r=un(o);if(r==null||!t)return;for(var g=0;g<t.length;++g)t[g]==this&&t.splice(g--,1);t.length||(o.widgets=null);var B=_a(this);qr(o,Math.max(0,o.height-B)),e&&(ti(e,function(){js(e,o,-B),Cn(e,r,"widget")}),Kr(e,"lineWidgetCleared",e,this,r))},Wo.prototype.changed=function(){var e=this,t=this.height,o=this.doc.cm,r=this.line;this.height=null;var g=_a(this)-t;if(!g)return;Hr(this.doc,r)||qr(r,r.height+g),o&&ti(o,function(){o.curOp.forceUpdate=!0,js(o,r,g),Kr(o,"lineWidgetChanged",o,e,un(r))})},ge(Wo);function js(e,t,o){Ft(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&qa(e,o)}function El(e,t,o,r){var g=new Wo(e,o,r),B=e.cm;return B&&g.noHScroll&&(B.display.alignWidgets=!0),jo(e,t,"widget",function($){var q=$.widgets||($.widgets=[]);if(g.insertAt==null?q.push(g):q.splice(Math.min(q.length-1,Math.max(0,g.insertAt)),0,g),g.line=$,B&&!Hr(e,$)){var te=Ft($)<e.scrollTop;qr($,$.height+_a(g)),te&&qa(B,g.height),B.curOp.forceUpdate=!0}return!0}),B&&Kr(B,"lineWidgetAdded",B,g,typeof t=="number"?t:un(t)),g}var Bs=0,Va=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Bs};Va.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&qi(e),Ee(this,"clear")){var o=this.find();o&&Kr(this,"clear",o.from,o.to)}for(var r=null,g=null,B=0;B<this.lines.length;++B){var $=this.lines[B],q=In($.markedSpans,this);e&&!this.collapsed?Cn(e,un($),"text"):e&&(q.to!=null&&(g=un($)),q.from!=null&&(r=un($))),$.markedSpans=Kn($.markedSpans,q),q.from==null&&this.collapsed&&!Hr(this.doc,$)&&e&&qr($,Gr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var oe=wn(this.lines[te]),Oe=br(oe);Oe>e.display.maxLineLength&&(e.display.maxLine=oe,e.display.maxLineLength=Oe,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&xr(e,r,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Kr(e,"markerCleared",e,this,r,g),t&&oa(e),this.parent&&this.parent.clear()},Va.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var o,r,g=0;g<this.lines.length;++g){var B=this.lines[g],$=In(B.markedSpans,this);if($.from!=null&&(o=_t(t?B:un(B),$.from),e==-1))return o;if($.to!=null&&(r=_t(t?B:un(B),$.to),e==1))return r}return o&&{from:o,to:r}},Va.prototype.changed=function(){var e=this,t=this.find(-1,!0),o=this,r=this.doc.cm;if(!t||!r)return;ti(r,function(){var g=t.line,B=un(t.line),$=Be(r,B);if($&&($n($),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Hr(o.doc,g)&&o.height!=null){var q=o.height;o.height=null;var te=_a(o)-q;te&&qr(g,g.height+te)}Kr(r,"markerChanged",r,e)})},Va.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ee(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Va.prototype.detachLine=function(e){if(this.lines.splice(ee(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ge(Va);function wo(e,t,o,r,g){if(r&&r.shared)return xl(e,t,o,r,g);if(e.cm&&!e.cm.curOp)return Qr(e.cm,wo)(e,t,o,r,g);var B=new Va(e,g),$=sn(t,o);if(r&&x(r,B,!1),$>0||$==0&&B.clearWhenEmpty!==!1)return B;if(B.replacedWith&&(B.collapsed=!0,B.widgetNode=C("span",[B.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||B.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(B.widgetNode.insertLeft=!0)),B.collapsed){if(Yt(e,t.line,t,o,B)||t.line!=o.line&&Yt(e,o.line,t,o,B))throw new Error("Inserting collapsed marker partially overlapping an existing one");Sn()}B.addToHistory&&Es(e,{from:t,to:o,origin:"markText"},e.sel,NaN);var q=t.line,te=e.cm,oe;if(e.iter(q,o.line+1,function(Ie){te&&B.collapsed&&!te.options.lineWrapping&&wn(Ie)==te.display.maxLine&&(oe=!0),B.collapsed&&q!=t.line&&qr(Ie,0),hn(Ie,new mn(B,q==t.line?t.ch:null,q==o.line?o.ch:null)),++q}),B.collapsed&&e.iter(t.line,o.line+1,function(Ie){Hr(e,Ie)&&qr(Ie,0)}),B.clearOnEnter&&Je(B,"beforeCursorEnter",function(){return B.clear()}),B.readOnly&&(Tn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),B.collapsed&&(B.id=++Bs,B.atomic=!0),te){if(oe&&(te.curOp.updateMaxLine=!0),B.collapsed)xr(te,t.line,o.line+1);else if(B.className||B.startStyle||B.endStyle||B.css||B.attributes||B.title)for(var Oe=t.line;Oe<=o.line;Oe++)Cn(te,Oe,"text");B.atomic&&Os(te.doc),Kr(te,"markerAdded",te,B)}return B}var Ho=function(e,t){this.markers=e,this.primary=t;for(var o=0;o<e.length;++o)e[o].parent=this};Ho.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Kr(this,"clear")},Ho.prototype.find=function(e,t){return this.primary.find(e,t)},ge(Ho);function xl(e,t,o,r,g){r=x(r),r.shared=!1;var B=[wo(e,t,o,r,g)],$=B[0],q=r.widgetNode;return Ri(e,function(te){q&&(r.widgetNode=q.cloneNode(!0)),B.push(wo(te,L(te,t),L(te,o),r,g));for(var oe=0;oe<te.linked.length;++oe)if(te.linked[oe].isParent)return;$=Ce(B)}),new Ho(B,$)}function Fs(e){return e.findMarks(_t(e.first,0),e.clipPos(_t(e.lastLine())),function(t){return t.parent})}function Tl(e,t){for(var o=0;o<t.length;o++){var r=t[o],g=r.find(),B=e.clipPos(g.from),$=e.clipPos(g.to);if(sn(B,$)){var q=wo(e,B,$,r.primary,r.primary.type);r.markers.push(q),q.parent=r}}}function wl(e){for(var t=function(r){var g=e[r],B=[g.primary.doc];Ri(g.primary.doc,function(te){return B.push(te)});for(var $=0;$<g.markers.length;$++){var q=g.markers[$];ee(B,q.doc)==-1&&(q.parent=null,g.markers.splice($--,1))}},o=0;o<e.length;o++)t(o)}var Cl=0,Wi=function(e,t,o,r,g){if(!(this instanceof Wi))return new Wi(e,t,o,r,g);o==null&&(o=0),Fo.call(this,[new Bo([new Yn("",null)])]),this.first=o,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=o;var B=_t(o,0);this.sel=At(B),this.history=new La(null),this.id=++Cl,this.modeOption=t,this.lineSep=r,this.direction=g=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),gi(this,{from:B,to:B,text:e}),Di(this,At(B),me)};Wi.prototype=Ve(Fo.prototype,{constructor:Wi,iter:function(e,t,o){o?this.iterN(e-this.first,t-e,o):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var o=0,r=0;r<t.length;++r)o+=t[r].height;this.insertInner(e-this.first,t,o)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ri(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Zr(function(e){var t=_t(this.first,0),o=this.first+this.size-1;xo(this,{from:t,to:_t(o,jt(this,o).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&xa(this.cm,0,0),Di(this,At(t),me)}),replaceRange:function(e,t,o,r){t=L(this,t),o=o?L(this,o):t,To(this,e,t,o,r)},getRange:function(e,t,o){var r=Fr(this,L(this,e),L(this,t));return o===!1?r:r.join(o||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(yi(this,e))return jt(this,e)},getLineNumber:function(e){return un(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=jt(this,e)),wn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return L(this,e)},getCursor:function(e){var t=this.sel.primary(),o;return e==null||e=="head"?o=t.head:e=="anchor"?o=t.anchor:e=="end"||e=="to"||e===!1?o=t.to():o=t.from(),o},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Zr(function(e,t,o){Cs(this,L(this,typeof e=="number"?_t(e,t||0):e),null,o)}),setSelection:Zr(function(e,t,o){Cs(this,L(this,e),L(this,t||e),o)}),extendSelection:Zr(function(e,t,o){Zo(this,L(this,e),t&&L(this,t),o)}),extendSelections:Zr(function(e,t){ws(this,V(this,e),t)}),extendSelectionsBy:Zr(function(e,t){var o=ze(this.sel.ranges,e);ws(this,V(this,o),t)}),setSelections:Zr(function(e,t,o){if(!e.length)return;for(var r=[],g=0;g<e.length;g++)r[g]=new ot(L(this,e[g].anchor),L(this,e[g].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Di(this,lt(this.cm,r,t),o)}),addSelection:Zr(function(e,t,o){var r=this.sel.ranges.slice(0);r.push(new ot(L(this,e),L(this,t||e))),Di(this,lt(this.cm,r,r.length-1),o)}),getSelection:function(e){for(var t=this.sel.ranges,o,r=0;r<t.length;r++){var g=Fr(this,t[r].from(),t[r].to());o=o?o.concat(g):g}return e===!1?o:o.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],o=this.sel.ranges,r=0;r<o.length;r++){var g=Fr(this,o[r].from(),o[r].to());e!==!1&&(g=g.join(e||this.lineSeparator())),t[r]=g}return t},replaceSelection:function(e,t,o){for(var r=[],g=0;g<this.sel.ranges.length;g++)r[g]=e;this.replaceSelections(r,t,o||"+input")},replaceSelections:Zr(function(e,t,o){for(var r=[],g=this.sel,B=0;B<g.ranges.length;B++){var $=g.ranges[B];r[B]={from:$.from(),to:$.to(),text:this.splitLines(e[B]),origin:o}}for(var q=t&&t!="end"&&Oi(this,r,t),te=r.length-1;te>=0;te--)xo(this,r[te]);q?Ss(this,q):this.cm&&da(this.cm)}),undo:Zr(function(){es(this,"undo")}),redo:Zr(function(){es(this,"redo")}),undoSelection:Zr(function(){es(this,"undo",!0)}),redoSelection:Zr(function(){es(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,o=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var g=0;g<e.undone.length;g++)e.undone[g].ranges||++o;return{undo:t,redo:o}},clearHistory:function(){var e=this;this.history=new La(this.history.maxGeneration),Ri(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:bo(this.history.done),undone:bo(this.history.undone)}},setHistory:function(e){var t=this.history=new La(this.history.maxGeneration);t.done=bo(e.done.slice(0),null,!0),t.undone=bo(e.undone.slice(0),null,!0)},setGutterMarker:Zr(function(e,t,o){return jo(this,e,"gutter",function(r){var g=r.gutterMarkers||(r.gutterMarkers={});return g[t]=o,!o&&he(g)&&(r.gutterMarkers=null),!0})}),clearGutter:Zr(function(e){var t=this;this.iter(function(o){o.gutterMarkers&&o.gutterMarkers[e]&&jo(t,o,"gutter",function(){return o.gutterMarkers[e]=null,he(o.gutterMarkers)&&(o.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!yi(this,e))return null;if(t=e,e=jt(this,e),!e)return null}else if(t=un(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:Zr(function(e,t,o){return jo(this,e,t=="gutter"?"gutter":"class",function(r){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[g])r[g]=o;else{if(O(o).test(r[g]))return!1;r[g]+=" "+o}return!0})}),removeLineClass:Zr(function(e,t,o){return jo(this,e,t=="gutter"?"gutter":"class",function(r){var g=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",B=r[g];if(B)if(o==null)r[g]=null;else{var $=B.match(O(o));if(!$)return!1;var q=$.index+$[0].length;r[g]=B.slice(0,$.index)+(!$.index||q==B.length?"":" ")+B.slice(q)||null}else return!1;return!0})}),addLineWidget:Zr(function(e,t,o){return El(this,e,t,o)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,o){return wo(this,L(this,e),L(this,t),o,o&&o.type||"range")},setBookmark:function(e,t){var o={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=L(this,e),wo(this,e,e,o,"bookmark")},findMarksAt:function(e){e=L(this,e);var t=[],o=jt(this,e.line).markedSpans;if(o)for(var r=0;r<o.length;++r){var g=o[r];(g.from==null||g.from<=e.ch)&&(g.to==null||g.to>=e.ch)&&t.push(g.marker.parent||g.marker)}return t},findMarks:function(e,t,o){e=L(this,e),t=L(this,t);var r=[],g=e.line;return this.iter(e.line,t.line+1,function(B){var $=B.markedSpans;if($)for(var q=0;q<$.length;q++){var te=$[q];!(te.to!=null&&g==e.line&&e.ch>=te.to||te.from==null&&g!=e.line||te.from!=null&&g==t.line&&te.from>=t.ch)&&(!o||o(te.marker))&&r.push(te.marker.parent||te.marker)}++g}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var o=t.markedSpans;if(o)for(var r=0;r<o.length;++r)o[r].from!=null&&e.push(o[r].marker)}),e},posFromIndex:function(e){var t,o=this.first,r=this.lineSeparator().length;return this.iter(function(g){var B=g.text.length+r;if(B>e)return t=e,!0;e-=B,++o}),L(this,_t(o,t))},indexFromPos:function(e){e=L(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var o=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+o}),t},copy:function(e){var t=new Wi(ri(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,o=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<o&&(o=e.to);var r=new Wi(ri(this,t,o),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Tl(r,Fs(this)),r},unlinkDoc:function(e){if(e instanceof Vr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var o=this.linked[t];if(o.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Fs(this));break}if(e.history==this.history){var r=[e.id];Ri(e,function(g){return r.push(g.id)},!0),e.history=new La(null),e.history.done=bo(this.history.done,r),e.history.undone=bo(this.history.undone,r)}},iterLinkedDocs:function(e){Ri(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):bn(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Zr(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&ta(this.cm)})}),Wi.prototype.eachLine=Wi.prototype.iter;var Ws=0;function Sl(e){var t=this;if(Hs(t),ft(t,e)||ra(t.display,e))return;de(e),G&&(Ws=+new Date);var o=$r(t,e,!0),r=e.dataTransfer.files;if(!o||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File)for(var g=r.length,B=Array(g),$=0,q=function(){++$==g&&Qr(t,function(){o=L(t.doc,o);var Xe={from:o,to:o,text:t.doc.splitLines(B.filter(function(ct){return ct!=null}).join(t.doc.lineSeparator())),origin:"paste"};xo(t.doc,Xe),Ss(t.doc,At(L(t.doc,o),L(t.doc,St(Xe))))})()},te=function(Xe,ct){if(t.options.allowDropFileTypes&&ee(t.options.allowDropFileTypes,Xe.type)==-1){q();return}var Et=new FileReader;Et.onerror=function(){return q()},Et.onload=function(){var It=Et.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(It)){q();return}B[ct]=It,q()},Et.readAsText(Xe)},oe=0;oe<r.length;oe++)te(r[oe],oe);else{if(t.state.draggingText&&t.doc.sel.contains(o)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Oe=e.dataTransfer.getData("Text");if(Oe){var Ie;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ie=t.listSelections()),Jo(t.doc,At(o,o)),Ie)for(var Qe=0;Qe<Ie.length;++Qe)To(t.doc,"",Ie[Qe].anchor,Ie[Qe].head,"drag");t.replaceSelection(Oe,"around","paste"),t.display.input.focus()}}catch(Xe){}}}function Al(e,t){if(G&&(!e.state.draggingText||+new Date-Ws<100)){De(t);return}if(ft(e,t)||ra(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!y){var o=d("img",null,null,"position: fixed; left: 0; top: 0;");o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(o.width=o.height=1,e.display.wrapper.appendChild(o),o._top=o.offsetTop),t.dataTransfer.setDragImage(o,0,0),f&&o.parentNode.removeChild(o)}}function Ol(e,t){var o=$r(e,t);if(!o)return;var r=document.createDocumentFragment();Ji(e,o,r),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,r)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ks(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),o=[],r=0;r<t.length;r++){var g=t[r].CodeMirror;g&&o.push(g)}o.length&&o[0].operation(function(){for(var B=0;B<o.length;B++)e(o[B])})}var Gs=!1;function Rl(){if(Gs)return;Dl(),Gs=!0}function Dl(){var e;Je(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ks(Ll)},100))}),Je(window,"blur",function(){return Ks(Ea)})}function Ll(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Xa={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"},Ko=0;Ko<10;Ko++)Xa[Ko+48]=Xa[Ko+96]=String(Ko);for(var ts=65;ts<=90;ts++)Xa[ts]=String.fromCharCode(ts);for(var Go=1;Go<=12;Go++)Xa[Go+111]=Xa[Go+63235]="F"+Go;var Ia={};Ia.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"},Ia.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"},Ia.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"},Ia.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"]},Ia.default=s?Ia.macDefault:Ia.pcDefault;function Il(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var o,r,g,B,$=0;$<t.length-1;$++){var q=t[$];if(/^(cmd|meta|m)$/i.test(q))B=!0;else if(/^a(lt)?$/i.test(q))o=!0;else if(/^(c|ctrl|control)$/i.test(q))r=!0;else if(/^s(hift)?$/i.test(q))g=!0;else throw new Error("Unrecognized modifier name: "+q)}return o&&(e="Alt-"+e),r&&(e="Ctrl-"+e),B&&(e="Cmd-"+e),g&&(e="Shift-"+e),e}function Pl(e){var t={};for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];if(/^(name|fallthrough|(de|at)tach)$/.test(o))continue;if(r=="..."){delete e[o];continue}for(var g=ze(o.split(" "),Il),B=0;B<g.length;B++){var $=void 0,q=void 0;B==g.length-1?(q=g.join(" "),$=r):(q=g.slice(0,B+1).join(" "),$="...");var te=t[q];if(!te)t[q]=$;else if(te!=$)throw new Error("Inconsistent bindings for "+q)}delete e[o]}for(var oe in t)e[oe]=t[oe];return e}function Co(e,t,o,r){t=ns(t);var g=t.call?t.call(e,r):t[e];if(g===!1)return"nothing";if(g==="...")return"multi";if(g!=null&&o(g))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Co(e,t.fallthrough,o,r);for(var B=0;B<t.fallthrough.length;B++){var $=Co(e,t.fallthrough[B],o,r);if($)return $}}}function zs(e){var t=typeof e=="string"?e:Xa[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,o){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!o&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(f&&e.keyCode==34&&e.char)return!1;var o=Xa[e.keyCode];return o==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(o=e.code),Vs(o,e,t))}function ns(e){return typeof e=="string"?Ia[e]:e}function So(e,t){for(var o=e.doc.sel.ranges,r=[],g=0;g<o.length;g++){for(var B=t(o[g]);r.length&&sn(B.from,Ce(r).to)<=0;){var $=r.pop();if(sn($.from,B.from)<0){B.from=$.from;break}}r.push(B)}ti(e,function(){for(var q=r.length-1;q>=0;q--)To(e.doc,"",r[q].from,r[q].to,"+delete");da(e)})}function cs(e,t,o){var r=Ue(e.text,t+o,o);return r<0||r>e.text.length?null:r}function ds(e,t,o){var r=cs(e,t.ch,o);return r==null?null:new _t(t.line,r,o<0?"after":"before")}function hs(e,t,o,r,g){if(e){t.doc.direction=="rtl"&&(g=-g);var B=gt(o,t.doc.direction);if(B){var $=g<0?Ce(B):B[0],q=g<0==($.level==1),te=q?"after":"before",oe;if($.level>0||t.doc.direction=="rtl"){var Oe=je(t,o);oe=g<0?o.text.length-1:0;var Ie=Ge(t,Oe,oe).top;oe=rt(function(Qe){return Ge(t,Oe,Qe).top==Ie},g<0==($.level==1)?$.from:$.to-1,oe),te=="before"&&(oe=cs(o,oe,1))}else oe=g<0?$.to:$.from;return new _t(r,oe,te)}}return new _t(r,g<0?o.text.length:0,g<0?"before":"after")}function kl(e,t,o,r){var g=gt(t,e.doc.direction);if(!g)return ds(t,o,r);o.ch>=t.text.length?(o.ch=t.text.length,o.sticky="before"):o.ch<=0&&(o.ch=0,o.sticky="after");var B=at(g,o.ch,o.sticky),$=g[B];if(e.doc.direction=="ltr"&&$.level%2==0&&(r>0?$.to>o.ch:$.from<o.ch))return ds(t,o,r);var q=function(Wt,qt){return cs(t,Wt instanceof _t?Wt.ch:Wt,qt)},te,oe=function(Wt){return e.options.lineWrapping?(te=te||je(e,t),an(e,t,te,Wt)):{begin:0,end:t.text.length}},Oe=oe(o.sticky=="before"?q(o,-1):o.ch);if(e.doc.direction=="rtl"||$.level==1){var Ie=$.level==1==r<0,Qe=q(o,Ie?1:-1);if(Qe!=null&&(Ie?Qe<=$.to&&Qe<=Oe.end:Qe>=$.from&&Qe>=Oe.begin)){var Xe=Ie?"before":"after";return new _t(o.line,Qe,Xe)}}var ct=function(Wt,qt,Ht){for(var on=function(jr,Ti){return Ti?new _t(o.line,q(jr,1),"before"):new _t(o.line,jr,"after")};Wt>=0&&Wt<g.length;Wt+=qt){var Pn=g[Wt],xn=qt>0==(Pn.level!=1),ar=xn?Ht.begin:q(Ht.end,-1);if(Pn.from<=ar&&ar<Pn.to)return on(ar,xn);if(ar=xn?Pn.from:q(Pn.to,-1),Ht.begin<=ar&&ar<Ht.end)return on(ar,xn)}},Et=ct(B+r,r,Oe);if(Et)return Et;var It=r>0?Oe.end:q(Oe.begin,-1);return It!=null&&!(r>0&&It==t.text.length)&&(Et=ct(r>0?0:g.length-1,r,oe(It)),Et)?Et:null}var zo={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),me)},killLine:function(e){return So(e,function(t){if(t.empty()){var o=jt(e.doc,t.head.line).text.length;return t.head.ch==o&&t.head.line<e.lastLine()?{from:t.head,to:_t(t.head.line+1,0)}:{from:t.head,to:_t(t.head.line,o)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return So(e,function(t){return{from:_t(t.from().line,0),to:L(e.doc,_t(t.to().line+1,0))}})},delLineLeft:function(e){return So(e,function(t){return{from:_t(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return So(e,function(t){var o=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:o},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return So(e,function(t){var o=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div");return{from:t.from(),to:r}})},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(_t(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(_t(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ys(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $s(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:o},"div")},pe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:o},"div")},pe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var o=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:o},"div");return r.ch<e.getLine(r.line).search(/\S/)?$s(e,t.head):r},pe)},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=[],o=e.listSelections(),r=e.options.tabSize,g=0;g<o.length;g++){var B=o[g].from(),$=H(e.getLine(B.line),B.ch,r);t.push(ae(r-$%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ti(e,function(){for(var t=e.listSelections(),o=[],r=0;r<t.length;r++){if(!t[r].empty())continue;var g=t[r].head,B=jt(e.doc,g.line).text;if(B){if(g.ch==B.length&&(g=new _t(g.line,g.ch-1)),g.ch>0)g=new _t(g.line,g.ch+1),e.replaceRange(B.charAt(g.ch-1)+B.charAt(g.ch-2),_t(g.line,g.ch-2),g,"+transpose");else if(g.line>e.doc.first){var $=jt(e.doc,g.line-1).text;$&&(g=new _t(g.line,1),e.replaceRange(B.charAt(0)+e.doc.lineSeparator()+$.charAt($.length-1),_t(g.line-1,$.length-1),g,"+transpose"))}}o.push(new ot(g,g))}e.setSelections(o)})},newlineAndIndent:function(e){return ti(e,function(){for(var t=e.listSelections(),o=t.length-1;o>=0;o--)e.replaceRange(e.doc.lineSeparator(),t[o].anchor,t[o].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);da(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ys(e,t){var o=jt(e.doc,t),r=wn(o);return r!=o&&(t=un(r)),hs(!0,e,r,t,1)}function Ml(e,t){var o=jt(e.doc,t),r=mr(o);return r!=o&&(t=un(r)),hs(!0,e,o,t,-1)}function $s(e,t){var o=Ys(e,t.line),r=jt(e.doc,o.line),g=gt(r,e.doc.direction);if(!g||g[0].level==0){var B=Math.max(o.ch,r.text.search(/\S/)),$=t.line==o.line&&t.ch<=B&&t.ch;return _t(o.line,$?0:B,o.sticky)}return o}function rs(e,t,o){if(typeof t=="string"&&(t=zo[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),o&&(e.display.shift=!1),g=t(e)!=ce}finally{e.display.shift=r,e.state.suppressEdits=!1}return g}function Nl(e,t,o){for(var r=0;r<e.state.keyMaps.length;r++){var g=Co(t,e.state.keyMaps[r],o,e);if(g)return g}return e.options.extraKeys&&Co(t,e.options.extraKeys,o,e)||Co(t,e.options.keyMap,o,e)}var Ul=new X;function Vo(e,t,o,r){var g=e.state.keySeq;if(g){if(zs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==g&&(e.state.keySeq=null,e.display.input.reset())}),Qs(e,g+" "+t,o,r))return!0}return Qs(e,t,o,r)}function Qs(e,t,o,r){var g=Nl(e,t,r);return g=="multi"&&(e.state.keySeq=t),g=="handled"&&Kr(e,"keyHandled",e,t,o),(g=="handled"||g=="multi")&&(de(o),Wr(e)),!!g}function Zs(e,t){var o=Xs(t,!0);return o?t.shiftKey&&!e.state.keySeq?Vo(e,"Shift-"+o,t,function(r){return rs(e,r,!0)})||Vo(e,o,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return rs(e,r)}):Vo(e,o,t,function(r){return rs(e,r)}):!1}function jl(e,t,o){return Vo(e,"'"+o+"'",t,function(r){return rs(e,r,!0)})}var fs=null;function Js(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),ft(t,e))return;G&&K<11&&e.keyCode==27&&(e.returnValue=!1);var o=e.keyCode;t.display.shift=o==16||e.shiftKey;var r=Zs(t,e);f&&(fs=r?o:null,!r&&o==88&&!rr&&(s?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),M&&!s&&!r&&o==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),o==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;W(t,"CodeMirror-crosshair");function o(r){(r.keyCode==18||!r.altKey)&&(m(t,"CodeMirror-crosshair"),Ot(document,"keyup",o),Ot(document,"mouseover",o))}Je(document,"keyup",o),Je(document,"mouseover",o)}function qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),ft(this,e)}function el(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(ra(t.display,e)||ft(t,e)||e.ctrlKey&&!e.altKey||s&&e.metaKey)return;var o=e.keyCode,r=e.charCode;if(f&&o==fs){fs=null,de(e);return}if(f&&(!e.which||e.which<10)&&Zs(t,e))return;var g=String.fromCharCode(r==null?o:r);if(g=="\b")return;if(jl(t,e,g))return;t.display.input.onKeyPress(e)}var Fl=400,ps=function(e,t,o){this.time=e,this.pos=t,this.button=o};ps.prototype.compare=function(e,t,o){return this.time+Fl>e&&sn(t,this.pos)==0&&o==this.button};var Xo,Yo;function Wl(e,t){var o=+new Date;return Yo&&Yo.compare(o,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(o,e,t)?(Yo=new ps(o,e,t),Xo=null,"double"):(Xo=new ps(o,e,t),Yo=null,"single")}function tl(e){var t=this,o=t.display;if(ft(t,e)||o.activeTouch&&o.input.supportsTouch())return;if(o.input.ensurePolled(),o.shift=e.shiftKey,ra(o,e)){n||(o.scroller.draggable=!1,setTimeout(function(){return o.scroller.draggable=!0},100));return}if(ms(t,e))return;var r=$r(t,e),g=Ze(e),B=r?Wl(r,g):"single";if(window.focus(),g==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,g,r,B,e))return;g==1?r?Gl(t,r,B,e):ke(e)==o.scroller&&de(e):g==2?(r&&Zo(t.doc,r),setTimeout(function(){return o.input.focus()},20)):g==3&&(R?t.display.input.onContextMenu(e):Za(t))}function Hl(e,t,o,r,g){var B="Click";return r=="double"?B="Double"+B:r=="triple"&&(B="Triple"+B),B=(t==1?"Left":t==2?"Middle":"Right")+B,Vo(e,Vs(B,g),g,function($){if(typeof $=="string"&&($=zo[$]),!$)return!1;var q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),q=$(e,o)!=ce}finally{e.state.suppressEdits=!1}return q})}function Kl(e,t,o){var r=e.getOption("configureMouse"),g=r?r(e,t,o):{};if(g.unit==null){var B=i?o.shiftKey&&o.metaKey:o.altKey;g.unit=B?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(g.extend==null||e.doc.extend)&&(g.extend=e.doc.extend||o.shiftKey),g.addNew==null&&(g.addNew=s?o.metaKey:o.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(s?o.altKey:o.ctrlKey)),g}function Gl(e,t,o,r){G?setTimeout(_(Ua,e),0):e.curOp.focus=j();var g=Kl(e,o,r),B=e.doc.sel,$;e.options.dragDrop&&ht&&!e.isReadOnly()&&o=="single"&&($=B.contains(t))>-1&&(sn(($=B.ranges[$]).from(),t)<0||t.xRel>0)&&(sn($.to(),t)>0||t.xRel<0)?zl(e,r,t,g):Vl(e,r,t,g)}function zl(e,t,o,r){var g=e.display,B=!1,$=Qr(e,function(oe){n&&(g.scroller.draggable=!1),e.state.draggingText=!1,Ot(g.wrapper.ownerDocument,"mouseup",$),Ot(g.wrapper.ownerDocument,"mousemove",q),Ot(g.scroller,"dragstart",te),Ot(g.scroller,"drop",$),B||(de(oe),r.addNew||Zo(e.doc,o,null,null,r.extend),n&&!y||G&&K==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),q=function(oe){B=B||Math.abs(t.clientX-oe.clientX)+Math.abs(t.clientY-oe.clientY)>=10},te=function(){return B=!0};n&&(g.scroller.draggable=!0),e.state.draggingText=$,$.copy=!r.moveOnDrag,g.scroller.dragDrop&&g.scroller.dragDrop(),Je(g.wrapper.ownerDocument,"mouseup",$),Je(g.wrapper.ownerDocument,"mousemove",q),Je(g.scroller,"dragstart",te),Je(g.scroller,"drop",$),Za(e),setTimeout(function(){return g.input.focus()},20)}function nl(e,t,o){if(o=="char")return new ot(t,t);if(o=="word")return e.findWordAt(t);if(o=="line")return new ot(_t(t.line,0),L(e.doc,_t(t.line+1,0)));var r=o(e,t);return new ot(r.from,r.to)}function Vl(e,t,o,r){var g=e.display,B=e.doc;de(t);var $,q,te=B.sel,oe=te.ranges;if(r.addNew&&!r.extend?(q=B.sel.contains(o),q>-1?$=oe[q]:$=new ot(o,o)):($=B.sel.primary(),q=B.sel.primIndex),r.unit=="rectangle")r.addNew||($=new ot(o,o)),o=$r(e,t,!0,!0),q=-1;else{var Oe=nl(e,o,r.unit);r.extend?$=ls($,Oe.anchor,Oe.head,r.extend):$=Oe}r.addNew?q==-1?(q=oe.length,Di(B,lt(e,oe.concat([$]),q),{scroll:!1,origin:"*mouse"})):oe.length>1&&oe[q].empty()&&r.unit=="char"&&!r.extend?(Di(B,lt(e,oe.slice(0,q).concat(oe.slice(q+1)),0),{scroll:!1,origin:"*mouse"}),te=B.sel):us(B,q,$,ue):(q=0,Di(B,new $e([$],0),ue),te=B.sel);var Ie=o;function Qe(Ht){if(sn(Ie,Ht)==0)return;if(Ie=Ht,r.unit=="rectangle"){for(var on=[],Pn=e.options.tabSize,xn=H(jt(B,o.line).text,o.ch,Pn),ar=H(jt(B,Ht.line).text,Ht.ch,Pn),jr=Math.min(xn,ar),Ti=Math.max(xn,ar),Jr=Math.min(o.line,Ht.line),$i=Math.min(e.lastLine(),Math.max(o.line,Ht.line));Jr<=$i;Jr++){var Hi=jt(B,Jr).text,di=xe(Hi,jr,Pn);jr==Ti?on.push(new ot(_t(Jr,di),_t(Jr,di))):Hi.length>di&&on.push(new ot(_t(Jr,di),_t(Jr,xe(Hi,Ti,Pn))))}on.length||on.push(new ot(o,o)),Di(B,lt(e,te.ranges.slice(0,q).concat(on),q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ht)}else{var Ki=$,Ai=nl(e,Ht,r.unit),vi=Ki.anchor,hi;sn(Ai.anchor,vi)>0?(hi=Ai.head,vi=Vi(Ki.from(),Ai.anchor)):(hi=Ai.anchor,vi=na(Ki.to(),Ai.head));var ni=te.ranges.slice(0);ni[q]=Xl(e,new ot(L(B,vi),hi)),Di(B,lt(e,ni,q),ue)}}var Xe=g.wrapper.getBoundingClientRect(),ct=0;function Et(Ht){var on=++ct,Pn=$r(e,Ht,!0,r.unit=="rectangle");if(!Pn)return;if(sn(Pn,Ie)!=0){e.curOp.focus=j(),Qe(Pn);var xn=ja(g,B);(Pn.line>=xn.to||Pn.line<xn.from)&&setTimeout(Qr(e,function(){ct==on&&Et(Ht)}),150)}else{var ar=Ht.clientY<Xe.top?-20:Ht.clientY>Xe.bottom?20:0;ar&&setTimeout(Qr(e,function(){if(ct!=on)return;g.scroller.scrollTop+=ar,Et(Ht)}),50)}}function It(Ht){e.state.selectingText=!1,ct=Infinity,Ht&&(de(Ht),g.input.focus()),Ot(g.wrapper.ownerDocument,"mousemove",Wt),Ot(g.wrapper.ownerDocument,"mouseup",qt),B.history.lastSelOrigin=null}var Wt=Qr(e,function(Ht){Ht.buttons===0||!Ze(Ht)?It(Ht):Et(Ht)}),qt=Qr(e,It);e.state.selectingText=qt,Je(g.wrapper.ownerDocument,"mousemove",Wt),Je(g.wrapper.ownerDocument,"mouseup",qt)}function Xl(e,t){var o=t.anchor,r=t.head,g=jt(e.doc,o.line);if(sn(o,r)==0&&o.sticky==r.sticky)return t;var B=gt(g);if(!B)return t;var $=at(B,o.ch,o.sticky),q=B[$];if(q.from!=o.ch&&q.to!=o.ch)return t;var te=$+(q.from==o.ch==(q.level!=1)?0:1);if(te==0||te==B.length)return t;var oe;if(r.line!=o.line)oe=(r.line-o.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Oe=at(B,r.ch,r.sticky),Ie=Oe-$||(r.ch-o.ch)*(q.level==1?-1:1);Oe==te-1||Oe==te?oe=Ie<0:oe=Ie>0}var Qe=B[te+(oe?-1:0)],Xe=oe==(Qe.level==1),ct=Xe?Qe.from:Qe.to,Et=Xe?"after":"before";return o.ch==ct&&o.sticky==Et?t:new ot(new _t(o.line,ct,Et),r)}function rl(e,t,o,r){var g,B;if(t.touches)g=t.touches[0].clientX,B=t.touches[0].clientY;else try{g=t.clientX,B=t.clientY}catch(Qe){return!1}if(g>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&de(t);var $=e.display,q=$.lineDiv.getBoundingClientRect();if(B>q.bottom||!Ee(e,o))return we(t);B-=q.top-$.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var oe=$.gutters.childNodes[te];if(oe&&oe.getBoundingClientRect().right>=g){var Oe=Rr(e.doc,B),Ie=e.display.gutterSpecs[te];return tt(e,o,e,Oe,Ie.className,t),we(t)}}}function ms(e,t){return rl(e,t,"gutterClick",!0)}function il(e,t){if(ra(e.display,t)||Yl(e,t))return;if(ft(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return Ee(e,"gutterContextMenu")?rl(e,t,"gutterContextMenu",!1):!1}function al(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),zn(e)}var Ao={toString:function(){return"CodeMirror.Init"}},ol={},is={};function $l(e){var t=e.optionHandlers;function o(r,g,B,$){e.defaults[r]=g,B&&(t[r]=$?function(q,te,oe){oe!=Ao&&B(q,te,oe)}:B)}e.defineOption=o,e.Init=Ao,o("value","",function(r,g){return r.setValue(g)},!0),o("mode",null,function(r,g){r.doc.modeOption=g,Hn(r)},!0),o("indentUnit",2,Hn,!0),o("indentWithTabs",!1),o("smartIndent",!0),o("tabSize",4,function(r){Ei(r),zn(r),xr(r)},!0),o("lineSeparator",null,function(r,g){if(r.doc.lineSep=g,!g)return;var B=[],$=r.doc.first;r.doc.iter(function(te){for(var oe=0;;){var Oe=te.text.indexOf(g,oe);if(Oe==-1)break;oe=Oe+g.length,B.push(_t($,Oe))}$++});for(var q=B.length-1;q>=0;q--)To(r.doc,g,B[q],_t(B[q].line,B[q].ch+g.length))}),o("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,g,B){r.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),B!=Ao&&r.refresh()}),o("specialCharPlaceholder",Mn,function(r){return r.refresh()},!0),o("electricChars",!0),o("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),o("spellcheck",!1,function(r,g){return r.getInputField().spellcheck=g},!0),o("autocorrect",!1,function(r,g){return r.getInputField().autocorrect=g},!0),o("autocapitalize",!1,function(r,g){return r.getInputField().autocapitalize=g},!0),o("rtlMoveVisually",!D),o("wholeLineUpdateBefore",!0),o("theme","default",function(r){al(r),ea(r)},!0),o("keyMap","default",function(r,g,B){var $=ns(g),q=B!=Ao&&ns(B);q&&q.detach&&q.detach(r,$),$.attach&&$.attach(r,q||null)}),o("extraKeys",null),o("configureMouse",null),o("lineWrapping",!1,Zl,!0),o("gutters",[],function(r,g){r.display.gutterSpecs=bi(g,r.options.lineNumbers),ea(r)},!0),o("fixedGutter",!0,function(r,g){r.display.gutters.style.left=g?_i(r.display)+"px":"0",r.refresh()},!0),o("coverGutterNextToScrollbar",!1,function(r){return pa(r)},!0),o("scrollbarStyle","native",function(r){Wa(r),pa(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),o("lineNumbers",!1,function(r,g){r.display.gutterSpecs=bi(r.options.gutters,g),ea(r)},!0),o("firstLineNumber",1,ea,!0),o("lineNumberFormatter",function(r){return r},ea,!0),o("showCursorWhenSelecting",!1,wr,!0),o("resetSelectionOnContextMenu",!0),o("lineWiseCopyCut",!0),o("pasteLinesPerSelection",!0),o("selectionsMayTouch",!1),o("readOnly",!1,function(r,g){g=="nocursor"&&(Ea(r),r.display.input.blur()),r.display.input.readOnlyChanged(g)}),o("screenReaderLabel",null,function(r,g){g=g===""?null:g,r.display.input.screenReaderLabelChanged(g)}),o("disableInput",!1,function(r,g){g||r.display.input.reset()},!0),o("dragDrop",!0,Ql),o("allowDropFileTypes",null),o("cursorBlinkRate",530),o("cursorScrollMargin",0),o("cursorHeight",1,wr,!0),o("singleCursorHeightPerLine",!0,wr,!0),o("workTime",100),o("workDelay",100),o("flattenSpans",!0,Ei,!0),o("addModeClass",!1,Ei,!0),o("pollInterval",100),o("undoDepth",200,function(r,g){return r.doc.history.undoDepth=g}),o("historyEventDelay",1250),o("viewportMargin",10,function(r){return r.refresh()},!0),o("maxHighlightLength",1e4,Ei,!0),o("moveInputWithCursor",!0,function(r,g){g||r.display.input.resetPosition()}),o("tabindex",null,function(r,g){return r.display.input.getField().tabIndex=g||""}),o("autofocus",null),o("direction","ltr",function(r,g){return r.doc.setDirection(g)},!0),o("phrases",null)}function Ql(e,t,o){var r=o&&o!=Ao;if(!t!=!r){var g=e.display.dragFunctions,B=t?Je:Ot;B(e.display.scroller,"dragstart",g.start),B(e.display.scroller,"dragenter",g.enter),B(e.display.scroller,"dragover",g.over),B(e.display.scroller,"dragleave",g.leave),B(e.display.scroller,"drop",g.drop)}}function Zl(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),lr(e)),Si(e),xr(e),zn(e),setTimeout(function(){return pa(e)},100)}function Vr(e,t){var o=this;if(!(this instanceof Vr))return new Vr(e,t);this.options=t=t?x(t):{},x(ol,t,!1);var r=t.value;typeof r=="string"?r=new Wi(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var g=new Vr.inputStyles[t.inputStyle](this),B=this.display=new Ra(e,r,g,t);B.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wa(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 X,keySeq:null,specialChars:null},t.autofocus&&!u&&B.input.focus(),G&&K<11&&setTimeout(function(){return o.display.input.reset(!0)},20),Jl(this),Rl(),qi(this),this.curOp.forceUpdate=!0,zr(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){o.hasFocus()&&!o.state.focused&&ca(o)},20):Ea(this);for(var $ in is)is.hasOwnProperty($)&&is[$](this,t[$],Ao);ci(this),t.finishInit&&t.finishInit(this);for(var q=0;q<gs.length;++q)gs[q](this);oa(this),n&&t.lineWrapping&&getComputedStyle(B.lineDiv).textRendering=="optimizelegibility"&&(B.lineDiv.style.textRendering="auto")}Vr.defaults=ol,Vr.optionHandlers=is;function Jl(e){var t=e.display;Je(t.scroller,"mousedown",Qr(e,tl)),G&&K<11?Je(t.scroller,"dblclick",Qr(e,function(te){if(ft(e,te))return;var oe=$r(e,te);if(!oe||ms(e,te)||ra(e.display,te))return;de(te);var Oe=e.findWordAt(oe);Zo(e.doc,Oe.anchor,Oe.head)})):Je(t.scroller,"dblclick",function(te){return ft(e,te)||de(te)}),Je(t.scroller,"contextmenu",function(te){return il(e,te)}),Je(t.input.getField(),"contextmenu",function(te){t.scroller.contains(te.target)||il(e,te)});var o,r={end:0};function g(){t.activeTouch&&(o=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function B(te){if(te.touches.length!=1)return!1;var oe=te.touches[0];return oe.radiusX<=1&&oe.radiusY<=1}function $(te,oe){if(oe.left==null)return!0;var Oe=oe.left-te.left,Ie=oe.top-te.top;return Oe*Oe+Ie*Ie>20*20}Je(t.scroller,"touchstart",function(te){if(!ft(e,te)&&!B(te)&&!ms(e,te)){t.input.ensurePolled(),clearTimeout(o);var oe=+new Date;t.activeTouch={start:oe,moved:!1,prev:oe-r.end<=300?r:null},te.touches.length==1&&(t.activeTouch.left=te.touches[0].pageX,t.activeTouch.top=te.touches[0].pageY)}}),Je(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Je(t.scroller,"touchend",function(te){var oe=t.activeTouch;if(oe&&!ra(t,te)&&oe.left!=null&&!oe.moved&&new Date-oe.start<300){var Oe=e.coordsChar(t.activeTouch,"page"),Ie;!oe.prev||$(oe,oe.prev)?Ie=new ot(Oe,Oe):!oe.prev.prev||$(oe,oe.prev.prev)?Ie=e.findWordAt(Oe):Ie=new ot(_t(Oe.line,0),L(e.doc,_t(Oe.line+1,0))),e.setSelection(Ie.anchor,Ie.head),e.focus(),de(te)}g()}),Je(t.scroller,"touchcancel",g),Je(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ha(e,t.scroller.scrollTop),ki(e,t.scroller.scrollLeft,!0),tt(e,"scroll",e))}),Je(t.scroller,"mousewheel",function(te){return qe(e,te)}),Je(t.scroller,"DOMMouseScroll",function(te){return qe(e,te)}),Je(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(te){ft(e,te)||De(te)},over:function(te){ft(e,te)||(Ol(e,te),De(te))},start:function(te){return Al(e,te)},drop:Qr(e,Sl),leave:function(te){ft(e,te)||Hs(e)}};var q=t.input.getField();Je(q,"keyup",function(te){return qs.call(e,te)}),Je(q,"keydown",Qr(e,Js)),Je(q,"keypress",Qr(e,el)),Je(q,"focus",function(te){return ca(e,te)}),Je(q,"blur",function(te){return Ea(e,te)})}var gs=[];Vr.defineInitHook=function(e){return gs.push(e)};function $o(e,t,o,r){var g=e.doc,B;o==null&&(o="add"),o=="smart"&&(g.mode.indent?B=Lt(e,t).state:o="prev");var $=e.options.tabSize,q=jt(g,t),te=H(q.text,null,$);q.stateAfter&&(q.stateAfter=null);var oe=q.text.match(/^\s*/)[0],Oe;if(!r&&!/\S/.test(q.text))Oe=0,o="not";else if(o=="smart"&&(Oe=g.mode.indent(B,q.text.slice(oe.length),q.text),Oe==ce||Oe>150)){if(!r)return;o="prev"}o=="prev"?t>g.first?Oe=H(jt(g,t-1).text,null,$):Oe=0:o=="add"?Oe=te+e.options.indentUnit:o=="subtract"?Oe=te-e.options.indentUnit:typeof o=="number"&&(Oe=te+o),Oe=Math.max(0,Oe);var Ie="",Qe=0;if(e.options.indentWithTabs)for(var Xe=Math.floor(Oe/$);Xe;--Xe)Qe+=$,Ie+=" ";if(Qe<Oe&&(Ie+=ae(Oe-Qe)),Ie!=oe)return To(g,Ie,_t(t,0),_t(t,oe.length),"+input"),q.stateAfter=null,!0;for(var ct=0;ct<g.sel.ranges.length;ct++){var Et=g.sel.ranges[ct];if(Et.head.line==t&&Et.head.ch<oe.length){var It=_t(t,oe.length);us(g,ct,new ot(It,It));break}}}var ga=null;function as(e){ga=e}function vs(e,t,o,r,g){var B=e.doc;e.display.shift=!1,r||(r=B.sel);var $=+new Date-200,q=g=="paste"||e.state.pasteIncoming>$,te=bn(t),oe=null;if(q&&r.ranges.length>1)if(ga&&ga.text.join(`
`)==t){if(r.ranges.length%ga.text.length==0){oe=[];for(var Oe=0;Oe<ga.text.length;Oe++)oe.push(B.splitLines(ga.text[Oe]))}}else te.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(oe=ze(te,function(Wt){return[Wt]}));for(var Ie=e.curOp.updateInput,Qe=r.ranges.length-1;Qe>=0;Qe--){var Xe=r.ranges[Qe],ct=Xe.from(),Et=Xe.to();Xe.empty()&&(o&&o>0?ct=_t(ct.line,ct.ch-o):e.state.overwrite&&!q?Et=_t(Et.line,Math.min(jt(B,Et.line).text.length,Et.ch+Ce(te).length)):q&&ga&&ga.lineWise&&ga.text.join(`
`)==te.join(`
`)&&(ct=Et=_t(ct.line,0)));var It={from:ct,to:Et,text:oe?oe[Qe%oe.length]:te,origin:g||(q?"paste":e.state.cutIncoming>$?"cut":"+input")};xo(e.doc,It),Kr(e,"inputRead",e,It)}t&&!q&&ll(e,t),da(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ie),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var o=e.clipboardData&&e.clipboardData.getData("Text");if(o)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ti(t,function(){return vs(t,o,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var o=e.doc.sel,r=o.ranges.length-1;r>=0;r--){var g=o.ranges[r];if(g.head.ch>100||r&&o.ranges[r-1].head.line==g.head.line)continue;var B=e.getModeAt(g.head),$=!1;if(B.electricChars){for(var q=0;q<B.electricChars.length;q++)if(t.indexOf(B.electricChars.charAt(q))>-1){$=$o(e,g.head.line,"smart");break}}else B.electricInput&&(B.electricInput.test(jt(e.doc,g.head.line).text.slice(0,g.head.ch))&&($=$o(e,g.head.line,"smart")));$&&Kr(e,"electricInput",e,g.head.line)}}function ul(e){for(var t=[],o=[],r=0;r<e.doc.sel.ranges.length;r++){var g=e.doc.sel.ranges[r].head.line,B={anchor:_t(g,0),head:_t(g+1,0)};o.push(B),t.push(e.getRange(B.anchor,B.head))}return{text:t,ranges:o}}function cl(e,t,o,r){e.setAttribute("autocorrect",o?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function dl(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return n?e.style.width="1000px":e.setAttribute("wrap","off"),p&&(e.style.border="1px solid black"),cl(e),t}function ql(e){var t=e.optionHandlers,o=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,g){var B=this.options,$=B[r];if(B[r]==g&&r!="mode")return;B[r]=g,t.hasOwnProperty(r)&&Qr(this,t[r])(this,g,$),tt(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,g){this.state.keyMaps[g?"push":"unshift"](ns(r))},removeKeyMap:function(r){for(var g=this.state.keyMaps,B=0;B<g.length;++B)if(g[B]==r||g[B].name==r)return g.splice(B,1),!0},addOverlay:mi(function(r,g){var B=r.token?r:e.getMode(this.options,r);if(B.startState)throw new Error("Overlays may not be stateful.");Ye(this.state.overlays,{mode:B,modeSpec:r,opaque:g&&g.opaque,priority:g&&g.priority||0},function($){return $.priority}),this.state.modeGen++,xr(this)}),removeOverlay:mi(function(r){for(var g=this.state.overlays,B=0;B<g.length;++B){var $=g[B].modeSpec;if($==r||typeof r=="string"&&$.name==r){g.splice(B,1),this.state.modeGen++,xr(this);return}}}),indentLine:mi(function(r,g,B){typeof g!="string"&&typeof g!="number"&&(g==null?g=this.options.smartIndent?"smart":"prev":g=g?"add":"subtract"),yi(this.doc,r)&&$o(this,r,g,B)}),indentSelection:mi(function(r){for(var g=this.doc.sel.ranges,B=-1,$=0;$<g.length;$++){var q=g[$];if(q.empty())q.head.line>B&&($o(this,q.head.line,r,!0),B=q.head.line,$==this.doc.sel.primIndex&&da(this));else{var te=q.from(),oe=q.to(),Oe=Math.max(B,te.line);B=Math.min(this.lastLine(),oe.line-(oe.ch?0:1))+1;for(var Ie=Oe;Ie<B;++Ie)$o(this,Ie,r);var Qe=this.doc.sel.ranges;te.ch==0&&g.length==Qe.length&&Qe[$].from().ch>0&&us(this.doc,$,new ot(te,Qe[$].to()),me)}}}),getTokenAt:function(r,g){return Lr(this,r,g)},getLineTokens:function(r,g){return Lr(this,_t(r),g,!0)},getTokenTypeAt:function(r){r=L(this.doc,r);var g=pt(this,jt(this.doc,r.line)),B=0,$=(g.length-1)/2,q=r.ch,te;if(q==0)te=g[2];else for(;;){var oe=B+$>>1;if((oe?g[oe*2-1]:0)>=q)$=oe;else if(g[oe*2+1]<q)B=oe+1;else{te=g[oe*2+2];break}}var Oe=te?te.indexOf("overlay "):-1;return Oe<0?te:Oe==0?null:te.slice(0,Oe-1)},getModeAt:function(r){var g=this.doc.mode;return g.innerMode?e.innerMode(g,this.getTokenAt(r).state).mode:g},getHelper:function(r,g){return this.getHelpers(r,g)[0]},getHelpers:function(r,g){var B=[];if(!o.hasOwnProperty(g))return B;var $=o[g],q=this.getModeAt(r);if(typeof q[g]=="string")$[q[g]]&&B.push($[q[g]]);else if(q[g])for(var te=0;te<q[g].length;te++){var oe=$[q[g][te]];oe&&B.push(oe)}else q.helperType&&$[q.helperType]?B.push($[q.helperType]):$[q.name]&&B.push($[q.name]);for(var Oe=0;Oe<$._global.length;Oe++){var Ie=$._global[Oe];Ie.pred(q,this)&&ee(B,Ie.val)==-1&&B.push(Ie.val)}return B},getStateAfter:function(r,g){var B=this.doc;return r=Z(B,r==null?B.first+B.size-1:r),Lt(this,r+1,g).state},cursorCoords:function(r,g){var B,$=this.doc.sel.primary();return r==null?B=$.head:typeof r=="object"?B=L(this.doc,r):B=r?$.from():$.to(),tr(this,B,g||"page")},charCoords:function(r,g){return Nr(this,L(this.doc,r),g||"page")},coordsChar:function(r,g){return r=er(this,r,g||"page"),Wn(this,r.left,r.top)},lineAtHeight:function(r,g){return r=er(this,{top:r,left:0},g||"page").top,Rr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,g,B){var $=!1,q;if(typeof r=="number"){var te=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>te&&(r=te,$=!0),q=jt(this.doc,r)}else q=r;return Zn(this,q,{top:0,left:0},g||"page",B||$).top+($?this.doc.height-Ft(q):0)},defaultTextHeight:function(){return Gr(this.display)},defaultCharWidth:function(){return Yr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,g,B,$,q){var te=this.display;r=tr(this,L(this.doc,r));var oe=r.bottom,Oe=r.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),te.sizer.appendChild(g),$=="over")oe=r.top;else if($=="above"||$=="near"){var Ie=Math.max(te.wrapper.clientHeight,this.doc.height),Qe=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);($=="above"||r.bottom+g.offsetHeight>Ie)&&r.top>g.offsetHeight?oe=r.top-g.offsetHeight:r.bottom+g.offsetHeight<=Ie&&(oe=r.bottom),Oe+g.offsetWidth>Qe&&(Oe=Qe-g.offsetWidth)}g.style.top=oe+"px",g.style.left=g.style.right="",q=="right"?(Oe=te.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(q=="left"?Oe=0:q=="middle"&&(Oe=(te.sizer.clientWidth-g.offsetWidth)/2),g.style.left=Oe+"px"),B&&mo(this,{left:Oe,top:oe,right:Oe+g.offsetWidth,bottom:oe+g.offsetHeight})},triggerOnKeyDown:mi(Js),triggerOnKeyPress:mi(el),triggerOnKeyUp:qs,triggerOnMouseDown:mi(tl),execCommand:function(r){if(zo.hasOwnProperty(r))return zo[r].call(null,this)},triggerElectric:mi(function(r){ll(this,r)}),findPosH:function(r,g,B,$){var q=1;g<0&&(q=-1,g=-g);for(var te=L(this.doc,r),oe=0;oe<g&&!(te=ys(this.doc,te,q,B,$),te.hitSide);++oe);return te},moveH:mi(function(r,g){var B=this;this.extendSelectionsBy(function($){return B.display.shift||B.doc.extend||$.empty()?ys(B.doc,$.head,r,g,B.options.rtlMoveVisually):r<0?$.from():$.to()},pe)}),deleteH:mi(function(r,g){var B=this.doc.sel,$=this.doc;B.somethingSelected()?$.replaceSelection("",null,"+delete"):So(this,function(q){var te=ys($,q.head,r,g,!1);return r<0?{from:te,to:q.head}:{from:q.head,to:te}})}),findPosV:function(r,g,B,$){var q=1,te=$;g<0&&(q=-1,g=-g);for(var oe=L(this.doc,r),Oe=0;Oe<g;++Oe){var Ie=tr(this,oe,"div");if(te==null?te=Ie.left:Ie.left=te,oe=hl(this,Ie,q,B),oe.hitSide)break}return oe},moveV:mi(function(r,g){var B=this,$=this.doc,q=[],te=!this.display.shift&&!$.extend&&$.sel.somethingSelected();if($.extendSelectionsBy(function(Oe){if(te)return r<0?Oe.from():Oe.to();var Ie=tr(B,Oe.head,"div");Oe.goalColumn!=null&&(Ie.left=Oe.goalColumn),q.push(Ie.left);var Qe=hl(B,Ie,r,g);return g=="page"&&Oe==$.sel.primary()&&qa(B,Nr(B,Qe,"div").top-Ie.top),Qe},pe),q.length)for(var oe=0;oe<$.sel.ranges.length;oe++)$.sel.ranges[oe].goalColumn=q[oe]}),findWordAt:function(r){var g=this.doc,B=jt(g,r.line).text,$=r.ch,q=r.ch;if(B){var te=this.getHelper(r,"wordChars");(r.sticky=="before"||q==B.length)&&$?--$:++q;for(var oe=B.charAt($),Oe=nt(oe,te)?function(Ie){return nt(Ie,te)}:/\s/.test(oe)?function(Ie){return/\s/.test(Ie)}:function(Ie){return!/\s/.test(Ie)&&!nt(Ie)};$>0&&Oe(B.charAt($-1));)--$;for(;q<B.length&&Oe(B.charAt(q));)++q}return new ot(_t(r.line,$),_t(r.line,q))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?W(this.display.cursorDiv,"CodeMirror-overwrite"):m(this.display.cursorDiv,"CodeMirror-overwrite"),tt(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:mi(function(r,g){xa(this,r,g)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-We(this)-this.display.barHeight,width:r.scrollWidth-We(this)-this.display.barWidth,clientHeight:ie(this),clientWidth:Se(this)}},scrollIntoView:mi(function(r,g){r==null?(r={from:this.doc.sel.primary().head,to:null},g==null&&(g=this.options.cursorScrollMargin)):typeof r=="number"?r={from:_t(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=g||0,r.from.line!=null?go(this,r):Ta(this,r.from,r.to,r.margin)}),setSize:mi(function(r,g){var B=this,$=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};r!=null&&(this.display.wrapper.style.width=$(r)),g!=null&&(this.display.wrapper.style.height=$(g)),this.options.lineWrapping&&Bn(this);var q=this.display.viewFrom;this.doc.iter(q,this.display.viewTo,function(te){if(te.widgets){for(var oe=0;oe<te.widgets.length;oe++)if(te.widgets[oe].noHScroll){Cn(B,q,"widget");break}}++q}),this.curOp.forceUpdate=!0,tt(this,"refresh",this)}),operation:function(r){return ti(this,r)},startOperation:function(){return qi(this)},endOperation:function(){return oa(this)},refresh:mi(function(){var r=this.display.cachedTextHeight;xr(this),this.curOp.forceUpdate=!0,zn(this),xa(this,this.doc.scrollLeft,this.doc.scrollTop),za(this.display),(r==null||Math.abs(r-Gr(this.display))>.5||this.options.lineWrapping)&&Si(this),tt(this,"refresh",this)}),swapDoc:mi(function(r){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),zr(this,r),zn(this),this.display.input.reset(),xa(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Kr(this,"swapDoc",this,g),g}),phrase:function(r){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,r)?g[r]:r},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(r,g,B){o.hasOwnProperty(r)||(o[r]=e[r]={_global:[]}),o[r][g]=B},e.registerGlobalHelper=function(r,g,B,$){e.registerHelper(r,g,$),o[r]._global.push({pred:B,val:$})}}function ys(e,t,o,r,g){var B=t,$=o,q=jt(e,t.line),te=g&&e.direction=="rtl"?-o:o;function oe(){var qt=t.line+te;return qt<e.first||qt>=e.first+e.size?!1:(t=new _t(qt,t.ch,t.sticky),q=jt(e,qt))}function Oe(qt){var Ht;if(r=="codepoint"){var on=q.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(on)?Ht=null:Ht=new _t(t.line,Math.max(0,Math.min(q.text.length,t.ch+o*(on>=55296&&on<56320?2:1))),-o)}else g?Ht=kl(e.cm,q,t,o):Ht=ds(q,t,o);if(Ht==null)if(!qt&&oe())t=hs(g,e.cm,q,t.line,te);else return!1;else t=Ht;return!0}if(r=="char"||r=="codepoint")Oe();else if(r=="column")Oe(!0);else if(r=="word"||r=="group")for(var Ie=null,Qe=r=="group",Xe=e.cm&&e.cm.getHelper(t,"wordChars"),ct=!0;!(o<0&&!Oe(!ct));ct=!1){var Et=q.text.charAt(t.ch)||`
`,It=nt(Et,Xe)?"w":Qe&&Et==`
`?"n":!Qe||/\s/.test(Et)?null:"p";if(Qe&&!ct&&!It&&(It="s"),Ie&&Ie!=It){o<0&&(o=1,Oe(),t.sticky="after");break}if(It&&(Ie=It),o>0&&!Oe(!ct))break}var Wt=qo(e,t,B,$,!0);return Ii(B,Wt)&&(Wt.hitSide=!0),Wt}function hl(e,t,o,r){var g=e.doc,B=t.left,$;if(r=="page"){var q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(q-.5*Gr(e.display),3);$=(o>0?t.bottom:t.top)+o*te}else r=="line"&&($=o>0?t.bottom+3:t.top-3);for(var oe;!(oe=Wn(e,B,$),!oe.outside);){if(o<0?$<=0:$>=g.height){oe.hitSide=!0;break}$+=o*5}return oe}var kr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new X,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};kr.prototype.init=function(e){var t=this,o=this,r=o.cm,g=o.div=e.lineDiv;cl(g,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function B(q){for(var te=q.target;te;te=te.parentNode){if(te==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}Je(g,"paste",function(q){if(!B(q)||ft(r,q)||sl(q,r))return;K<=11&&setTimeout(Qr(r,function(){return t.updateFromDOM()}),20)}),Je(g,"compositionstart",function(q){t.composing={data:q.data,done:!1}}),Je(g,"compositionupdate",function(q){t.composing||(t.composing={data:q.data,done:!1})}),Je(g,"compositionend",function(q){t.composing&&(q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Je(g,"touchstart",function(){return o.forceCompositionEnd()}),Je(g,"input",function(){t.composing||t.readFromDOMSoon()});function $(q){if(!B(q)||ft(r,q))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()}),q.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var te=ul(r);as({lineWise:!0,text:te.text}),q.type=="cut"&&r.operation(function(){r.setSelections(te.ranges,0,me),r.replaceSelection("",null,"cut")})}else return;if(q.clipboardData){q.clipboardData.clearData();var oe=ga.text.join(`
`);if(q.clipboardData.setData("Text",oe),q.clipboardData.getData("Text")==oe){q.preventDefault();return}}var Oe=dl(),Ie=Oe.firstChild;r.display.lineSpace.insertBefore(Oe,r.display.lineSpace.firstChild),Ie.value=ga.text.join(`
`);var Qe=document.activeElement;N(Ie),setTimeout(function(){r.display.lineSpace.removeChild(Oe),Qe.focus(),Qe==g&&o.showPrimarySelection()},50)}Je(g,"copy",$),Je(g,"cut",$)},kr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},kr.prototype.prepareSelection=function(){var e=Xi(this.cm,!1);return e.focus=document.activeElement==this.div,e},kr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},kr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},kr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,o=t.doc.sel.primary(),r=o.from(),g=o.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||g.line<t.display.viewFrom){e.removeAllRanges();return}var B=os(t,e.anchorNode,e.anchorOffset),$=os(t,e.focusNode,e.focusOffset);if(B&&!B.bad&&$&&!$.bad&&sn(Vi(B,$),r)==0&&sn(na(B,$),g)==0)return;var q=t.display.view,te=r.line>=t.display.viewFrom&&fl(t,r)||{node:q[0].measure.map[2],offset:0},oe=g.line<t.display.viewTo&&fl(t,g);if(!oe){var Oe=q[q.length-1].measure,Ie=Oe.maps?Oe.maps[Oe.maps.length-1]:Oe.map;oe={node:Ie[Ie.length-1],offset:Ie[Ie.length-2]-Ie[Ie.length-3]}}if(!te||!oe){e.removeAllRanges();return}var Qe=e.rangeCount&&e.getRangeAt(0),Xe;try{Xe=E(te.node,te.offset,oe.offset,oe.node)}catch(ct){}Xe&&(!M&&t.state.focused?(e.collapse(te.node,te.offset),Xe.collapsed||(e.removeAllRanges(),e.addRange(Xe))):(e.removeAllRanges(),e.addRange(Xe)),Qe&&e.anchorNode==null?e.addRange(Qe):M&&this.startGracePeriod()),this.rememberSelection()},kr.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)},kr.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},kr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},kr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},kr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},kr.prototype.blur=function(){this.div.blur()},kr.prototype.getField=function(){return this.div},kr.prototype.supportsTouch=function(){return!0},kr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ti(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)},kr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},kr.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(l&&b&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var o=os(t,e.anchorNode,e.anchorOffset),r=os(t,e.focusNode,e.focusOffset);o&&r&&ti(t,function(){Di(t.doc,At(o,r),me),(o.bad||r.bad)&&(t.curOp.selectionChanged=!0)})},kr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,o=e.doc.sel.primary(),r=o.from(),g=o.to();if(r.ch==0&&r.line>e.firstLine()&&(r=_t(r.line-1,jt(e.doc,r.line-1).length)),g.ch==jt(e.doc,g.line).text.length&&g.line<e.lastLine()&&(g=_t(g.line+1,0)),r.line<t.viewFrom||g.line>t.viewTo-1)return!1;var B,$,q;r.line==t.viewFrom||(B=Ir(e,r.line))==0?($=un(t.view[0].line),q=t.view[0].node):($=un(t.view[B].line),q=t.view[B-1].node.nextSibling);var te=Ir(e,g.line),oe,Oe;if(te==t.view.length-1?(oe=t.viewTo-1,Oe=t.lineDiv.lastChild):(oe=un(t.view[te+1].line)-1,Oe=t.view[te+1].node.previousSibling),!q)return!1;for(var Ie=e.doc.splitLines(tu(e,q,Oe,$,oe)),Qe=Fr(e.doc,_t($,0),_t(oe,jt(e.doc,oe).text.length));Ie.length>1&&Qe.length>1;)if(Ce(Ie)==Ce(Qe))Ie.pop(),Qe.pop(),oe--;else if(Ie[0]==Qe[0])Ie.shift(),Qe.shift(),$++;else break;for(var Xe=0,ct=0,Et=Ie[0],It=Qe[0],Wt=Math.min(Et.length,It.length);Xe<Wt&&Et.charCodeAt(Xe)==It.charCodeAt(Xe);)++Xe;for(var qt=Ce(Ie),Ht=Ce(Qe),on=Math.min(qt.length-(Ie.length==1?Xe:0),Ht.length-(Qe.length==1?Xe:0));ct<on&&qt.charCodeAt(qt.length-ct-1)==Ht.charCodeAt(Ht.length-ct-1);)++ct;if(Ie.length==1&&Qe.length==1&&$==r.line)for(;Xe&&Xe>r.ch&&qt.charCodeAt(qt.length-ct-1)==Ht.charCodeAt(Ht.length-ct-1);)Xe--,ct++;Ie[Ie.length-1]=qt.slice(0,qt.length-ct).replace(/^\u200b+/,""),Ie[0]=Ie[0].slice(Xe).replace(/\u200b+$/,"");var Pn=_t($,Xe),xn=_t(oe,Qe.length?Ce(Qe).length-ct:0);if(Ie.length>1||Ie[0]||sn(Pn,xn))return To(e.doc,Ie,Pn,xn,"+input"),!0},kr.prototype.ensurePolled=function(){this.forceCompositionEnd()},kr.prototype.reset=function(){this.forceCompositionEnd()},kr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},kr.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)},kr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ti(this.cm,function(){return xr(e.cm)})},kr.prototype.setUneditable=function(e){e.contentEditable="false"},kr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Qr(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},kr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},kr.prototype.onContextMenu=function(){},kr.prototype.resetPosition=function(){},kr.prototype.needsContentAttribute=!0;function fl(e,t){var o=Be(e,t.line);if(!o||o.hidden)return null;var r=jt(e.doc,t.line),g=le(o,r,t.line),B=gt(r,e.doc.direction),$="left";if(B){var q=at(B,t.ch);$=q%2?"right":"left"}var te=yt(g.map,t.ch,$);return te.offset=te.collapse=="right"?te.end:te.start,te}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Oo(e,t){return t&&(e.bad=!0),e}function tu(e,t,o,r,g){var B="",$=!1,q=e.doc.lineSeparator(),te=!1;function oe(Xe){return function(ct){return ct.id==Xe}}function Oe(){$&&(B+=q,te&&(B+=q),$=te=!1)}function Ie(Xe){Xe&&(Oe(),B+=Xe)}function Qe(Xe){if(Xe.nodeType==1){var ct=Xe.getAttribute("cm-text");if(ct){Ie(ct);return}var Et=Xe.getAttribute("cm-marker"),It;if(Et){var Wt=e.findMarks(_t(r,0),_t(g+1,0),oe(+Et));Wt.length&&(It=Wt[0].find(0))&&Ie(Fr(e.doc,It.from,It.to).join(q));return}if(Xe.getAttribute("contenteditable")=="false")return;var qt=/^(pre|div|p|li|table|br)$/i.test(Xe.nodeName);if(!/^br$/i.test(Xe.nodeName)&&Xe.textContent.length==0)return;qt&&Oe();for(var Ht=0;Ht<Xe.childNodes.length;Ht++)Qe(Xe.childNodes[Ht]);/^(pre|p)$/i.test(Xe.nodeName)&&(te=!0),qt&&($=!0)}else Xe.nodeType==3&&Ie(Xe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Qe(t),t==o);)t=t.nextSibling,te=!1;return B}function os(e,t,o){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[o],!r)return Oo(e.clipPos(_t(e.display.viewTo-1)),!0);t=null,o=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var g=0;g<e.display.view.length;g++){var B=e.display.view[g];if(B.node==r)return nu(B,t,o)}}function nu(e,t,o){var r=e.text.firstChild,g=!1;if(!t||!w(r,t))return Oo(_t(un(e.line),0),!0);if(t==r&&(g=!0,t=r.childNodes[o],o=0,!t)){var B=e.rest?Ce(e.rest):e.line;return Oo(_t(un(B),B.text.length),g)}var $=t.nodeType==3?t:null,q=t;for(!$&&t.childNodes.length==1&&t.firstChild.nodeType==3&&($=t.firstChild,o&&(o=$.nodeValue.length));q.parentNode!=r;)q=q.parentNode;var te=e.measure,oe=te.maps;function Oe(It,Wt,qt){for(var Ht=-1;Ht<(oe?oe.length:0);Ht++)for(var on=Ht<0?te.map:oe[Ht],Pn=0;Pn<on.length;Pn+=3){var xn=on[Pn+2];if(xn==It||xn==Wt){var ar=un(Ht<0?e.line:e.rest[Ht]),jr=on[Pn]+qt;return(qt<0||xn!=It)&&(jr=on[Pn+(qt?1:0)]),_t(ar,jr)}}}var Ie=Oe($,q,o);if(Ie)return Oo(Ie,g);for(var Qe=q.nextSibling,Xe=$?$.nodeValue.length-o:0;Qe;Qe=Qe.nextSibling){if(Ie=Oe(Qe,Qe.firstChild,0),Ie)return Oo(_t(Ie.line,Ie.ch-Xe),g);Xe+=Qe.textContent.length}for(var ct=q.previousSibling,Et=o;ct;ct=ct.previousSibling){if(Ie=Oe(ct,ct.firstChild,-1),Ie)return Oo(_t(Ie.line,Ie.ch+Et),g);Et+=ct.textContent.length}}var ui=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new X,this.hasSelection=!1,this.composing=null};ui.prototype.init=function(e){var t=this,o=this,r=this.cm;this.createField(e);var g=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),p&&(g.style.width="0px"),Je(g,"input",function(){G&&K>=9&&t.hasSelection&&(t.hasSelection=null),o.poll()}),Je(g,"paste",function($){if(ft(r,$)||sl($,r))return;r.state.pasteIncoming=+new Date,o.fastPoll()});function B($){if(ft(r,$))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var q=ul(r);as({lineWise:!0,text:q.text}),$.type=="cut"?r.setSelections(q.ranges,null,me):(o.prevInput="",g.value=q.text.join(`
`),N(g))}else return;$.type=="cut"&&(r.state.cutIncoming=+new Date)}Je(g,"cut",B),Je(g,"copy",B),Je(e.scroller,"paste",function($){if(ra(e,$)||ft(r,$))return;if(!g.dispatchEvent){r.state.pasteIncoming=+new Date,o.focus();return}var q=new Event("paste");q.clipboardData=$.clipboardData,g.dispatchEvent(q)}),Je(e.lineSpace,"selectstart",function($){ra(e,$)||de($)}),Je(g,"compositionstart",function(){var $=r.getCursor("from");o.composing&&o.composing.range.clear(),o.composing={start:$,range:r.markText($,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Je(g,"compositionend",function(){o.composing&&(o.poll(),o.composing.range.clear(),o.composing=null)})},ui.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},ui.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ui.prototype.prepareSelection=function(){var e=this.cm,t=e.display,o=e.doc,r=Xi(e);if(e.options.moveInputWithCursor){var g=tr(e,o.sel.primary().head,"div"),B=t.wrapper.getBoundingClientRect(),$=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,g.top+$.top-B.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,g.left+$.left-B.left))}return r},ui.prototype.showSelection=function(e){var t=this.cm,o=t.display;h(o.cursorDiv,e.cursors),h(o.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ui.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var o=t.getSelection();this.textarea.value=o,t.state.focused&&N(this.textarea),G&&K>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",G&&K>=9&&(this.hasSelection=null))},ui.prototype.getField=function(){return this.textarea},ui.prototype.supportsTouch=function(){return!1},ui.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},ui.prototype.blur=function(){this.textarea.blur()},ui.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ui.prototype.receivedFocus=function(){this.slowPoll()},ui.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()})},ui.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function o(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,o)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,o)},ui.prototype.poll=function(){var e=this,t=this.cm,o=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Kt(o)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var g=o.value;if(g==r&&!t.somethingSelected())return!1;if(G&&K>=9&&this.hasSelection===g||s&&/[\uf700-\uf7ff]/.test(g))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var B=g.charCodeAt(0);if(B==8203&&!r&&(r="\u200B"),B==8666)return this.reset(),this.cm.execCommand("undo")}for(var $=0,q=Math.min(r.length,g.length);$<q&&r.charCodeAt($)==g.charCodeAt($);)++$;return ti(t,function(){vs(t,g.slice($),r.length-$,null,e.composing?"*compose":null),g.length>1e3||g.indexOf(`
`)>-1?o.value=e.prevInput="":e.prevInput=g,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ui.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ui.prototype.onKeyPress=function(){G&&K>=9&&(this.hasSelection=null),this.fastPoll()},ui.prototype.onContextMenu=function(e){var t=this,o=t.cm,r=o.display,g=t.textarea;t.contextMenuPending&&t.contextMenuPending();var B=$r(o,e),$=r.scroller.scrollTop;if(!B||f)return;var q=o.options.resetSelectionOnContextMenu;q&&o.doc.sel.contains(B)==-1&&Qr(o,Di)(o.doc,At(B),me);var te=g.style.cssText,oe=t.wrapper.style.cssText,Oe=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Oe.top-5)+"px; left: "+(e.clientX-Oe.left-5)+`px;
z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ie;n&&(Ie=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Ie),r.input.reset(),o.somethingSelected()||(g.value=t.prevInput=" "),t.contextMenuPending=Xe,r.selForContextMenu=o.doc.sel,clearTimeout(r.detectingSelectAll);function Qe(){if(g.selectionStart!=null){var Et=o.somethingSelected(),It="\u200B"+(Et?g.value:"");g.value="\u21DA",g.value=It,t.prevInput=Et?"":"\u200B",g.selectionStart=1,g.selectionEnd=It.length,r.selForContextMenu=o.doc.sel}}function Xe(){if(t.contextMenuPending!=Xe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=oe,g.style.cssText=te,G&&K<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=$),g.selectionStart!=null){(!G||G&&K<9)&&Qe();var Et=0,It=function(){r.selForContextMenu==o.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&t.prevInput=="\u200B"?Qr(o,Ls)(o):Et++<10?r.detectingSelectAll=setTimeout(It,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(It,200)}}if(G&&K>=9&&Qe(),R){De(e);var ct=function(){Ot(window,"mouseup",ct),setTimeout(Xe,20)};Je(window,"mouseup",ct)}else setTimeout(Xe,50)},ui.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ui.prototype.setUneditable=function(){},ui.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?x(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var o=j();t.autofocus=o==e||e.getAttribute("autofocus")!=null&&o==document.body}function r(){e.value=q.getValue()}var g;if(e.form&&(Je(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var B=e.form;g=B.submit;try{var $=B.submit=function(){r(),B.submit=g,B.submit(),B.submit=$}}catch(te){}}t.finishInit=function(te){te.save=r,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,r(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(Ot(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=g))}},e.style.display="none";var q=Vr(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},t);return q}function iu(e){e.off=Ot,e.on=Je,e.wheelEventPixels=it,e.Doc=Wi,e.splitLines=bn,e.countColumn=H,e.findColumn=xe,e.isWordChar=Ke,e.Pass=ce,e.signal=tt,e.Line=Yn,e.changeEnd=St,e.scrollbarModel=eo,e.Pos=_t,e.cmpPos=sn,e.modes=pr,e.mimeModes=kn,e.resolveMode=ln,e.getMode=Xr,e.modeExtensions=hr,e.extendMode=Sr,e.copyState=vn,e.startState=Jn,e.innerMode=fn,e.commands=zo,e.keyMap=Ia,e.keyName=Xs,e.isModifierKey=zs,e.lookupKey=Co,e.normalizeKeyMap=Pl,e.StringStream=en,e.SharedTextMarker=Ho,e.TextMarker=Va,e.LineWidget=Wo,e.e_preventDefault=de,e.e_stopPropagation=fe,e.e_stop=De,e.addClass=W,e.contains=w,e.rmClass=m,e.keyNames=Xa}$l(Vr),ql(Vr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ss in Wi.prototype)Wi.prototype.hasOwnProperty(ss)&&ee(au,ss)<0&&(Vr.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Wi.prototype[ss]));return ge(Wi),Vr.inputStyles={textarea:ui,contenteditable:kr},Vr.defineMode=function(e){!Vr.defaults.mode&&e!="null"&&(Vr.defaults.mode=e),Mr.apply(this,arguments)},Vr.defineMIME=Or,Vr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Vr.defineMIME("text/plain","null"),Vr.defineExtension=function(e,t){Vr.prototype[e]=t},Vr.defineDocExtension=function(e,t){Wi.prototype[e]=t},Vr.fromTextArea=ru,iu(Vr),Vr.version="5.58.2",Vr})},WaYH:function(ut,ve,U){"use strict";var ne=U("rePB"),Y=U("Ff2n"),M=U("VTBJ"),z=U("1OyB"),P=U("vuIU"),F=U("JX7q"),G=U("Ji7U"),K=U("LK+K"),n=U("q1tI"),I=U("TSYQ"),b=U.n(I),f=U("sboe"),y=U("OZM5"),c=function(R){var O=R.prefixCls,m=R.level,v=R.isStart,h=R.isEnd;if(!m)return null;for(var d="".concat(O,"-indent-unit"),C=[],E=0;E<m;E+=1){var w;C.push(n.createElement("span",{key:E,className:b()(d,(w={},Object(ne.a)(w,"".concat(d,"-start"),v[E+1]),Object(ne.a)(w,"".concat(d,"-end"),h[E+1]),Object(ne.a)(w,"".concat(d,"-end-first-level"),!E&&h[0]),w))}))}return n.createElement("span",{"aria-hidden":"true",className:"".concat(O,"-indent")},C)},a=c,p=U("815F"),l="open",u="close",s="---",i=function(S){Object(G.a)(O,S);var R=Object(K.a)(O);function O(){var m;return Object(z.a)(this,O),m=R.apply(this,arguments),m.state={dragNodeHighlight:!1},m.onSelectorClick=function(v){var h=m.props.context.onNodeClick;h(v,Object(p.b)(m.props)),m.isSelectable()?m.onSelect(v):m.onCheck(v)},m.onSelectorDoubleClick=function(v){var h=m.props.context.onNodeDoubleClick;h(v,Object(p.b)(m.props))},m.onSelect=function(v){if(m.isDisabled())return;var h=m.props.context.onNodeSelect;v.preventDefault(),h(v,Object(p.b)(m.props))},m.onCheck=function(v){if(m.isDisabled())return;var h=m.props,d=h.disableCheckbox,C=h.checked,E=m.props.context.onNodeCheck;if(!m.isCheckable()||d)return;v.preventDefault();var w=!C;E(v,Object(p.b)(m.props),w)},m.onMouseEnter=function(v){var h=m.props.context.onNodeMouseEnter;h(v,Object(p.b)(m.props))},m.onMouseLeave=function(v){var h=m.props.context.onNodeMouseLeave;h(v,Object(p.b)(m.props))},m.onContextMenu=function(v){var h=m.props.context.onNodeContextMenu;h(v,Object(p.b)(m.props))},m.onDragStart=function(v){var h=m.props.context.onNodeDragStart;v.stopPropagation(),m.setState({dragNodeHighlight:!0}),h(v,Object(F.a)(m));try{v.dataTransfer.setData("text/plain","")}catch(d){}},m.onDragEnter=function(v){var h=m.props.context.onNodeDragEnter;v.preventDefault(),v.stopPropagation(),h(v,Object(F.a)(m))},m.onDragOver=function(v){var h=m.props.context.onNodeDragOver;v.preventDefault(),v.stopPropagation(),h(v,Object(F.a)(m))},m.onDragLeave=function(v){var h=m.props.context.onNodeDragLeave;v.stopPropagation(),h(v,Object(F.a)(m))},m.onDragEnd=function(v){var h=m.props.context.onNodeDragEnd;v.stopPropagation(),m.setState({dragNodeHighlight:!1}),h(v,Object(F.a)(m))},m.onDrop=function(v){var h=m.props.context.onNodeDrop;v.preventDefault(),v.stopPropagation(),m.setState({dragNodeHighlight:!1}),h(v,Object(F.a)(m))},m.onExpand=function(v){var h=m.props.context.onNodeExpand;h(v,Object(p.b)(m.props))},m.setSelectHandle=function(v){m.selectHandle=v},m.getNodeState=function(){var v=m.props.expanded;return m.isLeaf()?null:v?l:u},m.hasChildren=function(){var v=m.props.eventKey,h=m.props.context.keyEntities,d=h[v]||{},C=d.children;return!!(C||[]).length},m.isLeaf=function(){var v=m.props,h=v.isLeaf,d=v.loaded,C=m.props.context.loadData,E=m.hasChildren();return h===!1?!1:h||!C&&!E||C&&d&&!E},m.isDisabled=function(){var v=m.props.disabled,h=m.props.context.disabled;return!!(h||v)},m.isCheckable=function(){var v=m.props.checkable,h=m.props.context.checkable;return!h||v===!1?!1:h},m.syncLoadData=function(v){var h=v.expanded,d=v.loading,C=v.loaded,E=m.props.context,w=E.loadData,j=E.onNodeLoad;if(d)return;w&&h&&!m.isLeaf()&&(!m.hasChildren()&&!C&&j(Object(p.b)(m.props)))},m.renderSwitcher=function(){var v=m.props,h=v.expanded,d=v.switcherIcon,C=m.props.context,E=C.prefixCls,w=C.switcherIcon,j=d||w;if(m.isLeaf())return n.createElement("span",{className:b()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof j=="function"?j(Object(M.a)(Object(M.a)({},m.props),{},{isLeaf:!0})):j);var W=b()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(h?l:u));return n.createElement("span",{onClick:m.onExpand,className:W},typeof j=="function"?j(Object(M.a)(Object(M.a)({},m.props),{},{isLeaf:!1})):j)},m.renderCheckbox=function(){var v=m.props,h=v.checked,d=v.halfChecked,C=v.disableCheckbox,E=m.props.context.prefixCls,w=m.isDisabled(),j=m.isCheckable();if(!j)return null;var W=typeof j!="boolean"?j:null;return n.createElement("span",{className:b()("".concat(E,"-checkbox"),h&&"".concat(E,"-checkbox-checked"),!h&&d&&"".concat(E,"-checkbox-indeterminate"),(w||C)&&"".concat(E,"-checkbox-disabled")),onClick:m.onCheck},W)},m.renderIcon=function(){var v=m.props.loading,h=m.props.context.prefixCls;return n.createElement("span",{className:b()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(m.getNodeState()||"docu"),v&&"".concat(h,"-icon_loading"))})},m.renderSelector=function(){var v=m.state.dragNodeHighlight,h=m.props,d=h.title,C=h.selected,E=h.icon,w=h.loading,j=h.data,W=m.props.context,T=W.prefixCls,N=W.showIcon,_=W.icon,x=W.draggable,H=W.loadData,X=W.titleRender,ee=m.isDisabled(),J="".concat(T,"-node-content-wrapper"),ce;if(N){var me=E||_;ce=me?n.createElement("span",{className:b()("".concat(T,"-iconEle"),"".concat(T,"-icon__customize"))},typeof me=="function"?me(m.props):me):m.renderIcon()}else H&&w&&(ce=m.renderIcon());var ue;typeof d=="function"?ue=d(j):X?ue=X(j):ue=d;var pe=n.createElement("span",{className:"".concat(T,"-title")},ue);return n.createElement("span",{ref:m.setSelectHandle,title:typeof d=="string"?d:"",className:b()("".concat(J),"".concat(J,"-").concat(m.getNodeState()||"normal"),!ee&&(C||v)&&"".concat(T,"-node-selected"),!ee&&x&&"draggable"),draggable:!ee&&x||void 0,"aria-grabbed":!ee&&x||void 0,onMouseEnter:m.onMouseEnter,onMouseLeave:m.onMouseLeave,onContextMenu:m.onContextMenu,onClick:m.onSelectorClick,onDoubleClick:m.onSelectorDoubleClick,onDragStart:x?m.onDragStart:void 0},ce,pe)},m}return Object(P.a)(O,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var v=this.props.selectable,h=this.props.context.selectable;return typeof v=="boolean"?v:h}},{key:"render",value:function(){var v,h=this.props,d=h.eventKey,C=h.className,E=h.style,w=h.dragOver,j=h.dragOverGapTop,W=h.dragOverGapBottom,T=h.isLeaf,N=h.isStart,_=h.isEnd,x=h.expanded,H=h.selected,X=h.checked,ee=h.halfChecked,J=h.loading,ce=h.domRef,me=h.active,ue=h.onMouseMove,pe=Object(Y.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),xe=this.props.context,se=xe.prefixCls,ae=xe.filterTreeNode,Ce=xe.draggable,ze=xe.keyEntities,Ye=this.isDisabled(),He=Object(y.f)(pe),Ve=ze[d]||{},Fe=Ve.level,Ke=_[_.length-1];return n.createElement("div",Object.assign({ref:ce,className:b()(C,"".concat(se,"-treenode"),(v={},Object(ne.a)(v,"".concat(se,"-treenode-disabled"),Ye),Object(ne.a)(v,"".concat(se,"-treenode-switcher-").concat(x?"open":"close"),!T),Object(ne.a)(v,"".concat(se,"-treenode-checkbox-checked"),X),Object(ne.a)(v,"".concat(se,"-treenode-checkbox-indeterminate"),ee),Object(ne.a)(v,"".concat(se,"-treenode-selected"),H),Object(ne.a)(v,"".concat(se,"-treenode-loading"),J),Object(ne.a)(v,"".concat(se,"-treenode-active"),me),Object(ne.a)(v,"".concat(se,"-treenode-leaf-last"),Ke),Object(ne.a)(v,"drag-over",!Ye&&w),Object(ne.a)(v,"drag-over-gap-top",!Ye&&j),Object(ne.a)(v,"drag-over-gap-bottom",!Ye&&W),Object(ne.a)(v,"filter-node",ae&&ae(Object(p.b)(this.props))),v)),style:E,onDragEnter:Ce?this.onDragEnter:void 0,onDragOver:Ce?this.onDragOver:void 0,onDragLeave:Ce?this.onDragLeave:void 0,onDrop:Ce?this.onDrop:void 0,onDragEnd:Ce?this.onDragEnd:void 0,onMouseMove:ue},He),n.createElement(a,{prefixCls:se,level:Fe,isStart:N,isEnd:_}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),O}(n.Component),D=function(R){return n.createElement(f.a.Consumer,null,function(O){return n.createElement(i,Object.assign({},R,{context:O}))})};D.displayName="TreeNode",D.defaultProps={title:s},D.isTreeNode=1;var A=ve.a=D},Y1PL:function(ut,ve,U){"use strict";U.r(ve),U.d(ve,"ResizableTextArea",function(){return ee});var ne=U("wx14"),Y=U("1OyB"),M=U("vuIU"),z=U("Ji7U"),P=U("LK+K"),F=U("q1tI"),G=U("VTBJ"),K=U("rePB"),n=U("Zm9Q"),I=U("Kwbf"),b=U("c+Xe"),f=U("m+aA"),y=U("bdgK"),c=new Map;function a(me){me.forEach(function(ue){var pe,xe=ue.target;(pe=c.get(xe))===null||pe===void 0||pe.forEach(function(se){return se(xe)})})}var p=new y.default(a),l=null,u=null;function s(me,ue){c.has(me)||(c.set(me,new Set),p.observe(me)),c.get(me).add(ue)}function i(me,ue){c.has(me)&&(c.get(me).delete(ue),c.get(me).size||(p.unobserve(me),c.delete(me)))}var D=function(me){Object(z.a)(pe,me);var ue=Object(P.a)(pe);function pe(){return Object(Y.a)(this,pe),ue.apply(this,arguments)}return Object(M.a)(pe,[{key:"render",value:function(){return this.props.children}}]),pe}(F.Component),A=F.createContext(null);function S(me){var ue=me.children,pe=me.onBatchResize,xe=F.useRef(0),se=F.useRef([]),ae=F.useContext(A),Ce=F.useCallback(function(ze,Ye,He){xe.current+=1;var Ve=xe.current;se.current.push({size:ze,element:Ye,data:He}),Promise.resolve().then(function(){Ve===xe.current&&(pe==null||pe(se.current),se.current=[])}),ae==null||ae(ze,Ye,He)},[pe,ae]);return F.createElement(A.Provider,{value:Ce},ue)}function R(me){var ue=me.children,pe=me.disabled,xe=F.useRef(null),se=F.useRef(null),ae=F.useContext(A),Ce=F.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ze=F.isValidElement(ue)&&Object(b.c)(ue),Ye=ze?ue.ref:null,He=F.useMemo(function(){return Object(b.a)(Ye,xe)},[Ye,xe]),Ve=F.useRef(me);Ve.current=me;var Fe=F.useCallback(function(Ke){var nt=Ve.current,he=nt.onResize,Re=nt.data,Ne=Ke.getBoundingClientRect(),Ue=Ne.width,rt=Ne.height,st=Ke.offsetWidth,dt=Ke.offsetHeight,at=Math.floor(Ue),bt=Math.floor(rt);if(Ce.current.width!==at||Ce.current.height!==bt||Ce.current.offsetWidth!==st||Ce.current.offsetHeight!==dt){var gt={width:at,height:bt,offsetWidth:st,offsetHeight:dt};Ce.current=gt;var xt=st===Math.round(Ue)?Ue:st,Je=dt===Math.round(rt)?rt:dt,kt=Object(G.a)(Object(G.a)({},gt),{},{offsetWidth:xt,offsetHeight:Je});ae==null||ae(kt,Ke,Re),he&&Promise.resolve().then(function(){he(kt,Ke)})}},[]);return F.useEffect(function(){var Ke=Object(f.a)(xe.current)||Object(f.a)(se.current);return Ke&&!pe&&s(Ke,Fe),function(){return i(Ke,Fe)}},[xe.current,pe]),F.createElement(D,{ref:se},ze?F.cloneElement(ue,{ref:He}):ue)}var O="rc-observer-key";function m(me){var ue=me.children,pe=Object(n.a)(ue);return pe.map(function(xe,se){var ae=(xe==null?void 0:xe.key)||"".concat(O,"-").concat(se);return F.createElement(R,Object(ne.a)({},me,{key:ae}),xe)})}m.Collection=S;var v=m,h=U("bT9E"),d=U("TSYQ"),C=U.n(d),E=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],j={},W;function T(me){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=me.getAttribute("id")||me.getAttribute("data-reactid")||me.getAttribute("name");if(ue&&j[pe])return j[pe];var xe=window.getComputedStyle(me),se=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),ae=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),Ce=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),ze=w.map(function(He){return"".concat(He,":").concat(xe.getPropertyValue(He))}).join(";"),Ye={sizingStyle:ze,paddingSize:ae,borderSize:Ce,boxSizing:se};return ue&&pe&&(j[pe]=Ye),Ye}function N(me){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;W||(W=document.createElement("textarea"),W.setAttribute("tab-index","-1"),W.setAttribute("aria-hidden","true"),document.body.appendChild(W)),me.getAttribute("wrap")?W.setAttribute("wrap",me.getAttribute("wrap")):W.removeAttribute("wrap");var se=T(me,ue),ae=se.paddingSize,Ce=se.borderSize,ze=se.boxSizing,Ye=se.sizingStyle;W.setAttribute("style","".concat(Ye,";").concat(E)),W.value=me.value||me.placeholder||"";var He=Number.MIN_SAFE_INTEGER,Ve=Number.MAX_SAFE_INTEGER,Fe=W.scrollHeight,Ke;if(ze==="border-box"?Fe+=Ce:ze==="content-box"&&(Fe-=ae),pe!==null||xe!==null){W.value=" ";var nt=W.scrollHeight-ae;pe!==null&&(He=nt*pe,ze==="border-box"&&(He=He+ae+Ce),Fe=Math.max(He,Fe)),xe!==null&&(Ve=nt*xe,ze==="border-box"&&(Ve=Ve+ae+Ce),Ke=Fe>Ve?"":"hidden",Fe=Math.min(Ve,Fe))}return{height:Fe,minHeight:He,maxHeight:Ve,overflowY:Ke,resize:"none"}}var _=U("Gytx"),x=U.n(_),H;(function(me){me[me.NONE=0]="NONE",me[me.RESIZING=1]="RESIZING",me[me.RESIZED=2]="RESIZED"})(H||(H={}));var X=function(me){Object(z.a)(pe,me);var ue=Object(P.a)(pe);function pe(xe){var se;return Object(Y.a)(this,pe),se=ue.call(this,xe),se.nextFrameActionId=void 0,se.resizeFrameId=void 0,se.textArea=void 0,se.saveTextArea=function(ae){se.textArea=ae},se.handleResize=function(ae){var Ce=se.state.resizeStatus,ze=se.props,Ye=ze.autoSize,He=ze.onResize;if(Ce!==H.NONE)return;typeof He=="function"&&He(ae),Ye&&se.resizeOnNextFrame()},se.resizeOnNextFrame=function(){cancelAnimationFrame(se.nextFrameActionId),se.nextFrameActionId=requestAnimationFrame(se.resizeTextarea)},se.resizeTextarea=function(){var ae=se.props.autoSize;if(!ae||!se.textArea)return;var Ce=ae.minRows,ze=ae.maxRows,Ye=N(se.textArea,!1,Ce,ze);se.setState({textareaStyles:Ye,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(se.resizeFrameId),se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:H.RESIZED},function(){se.resizeFrameId=requestAnimationFrame(function(){se.setState({resizeStatus:H.NONE}),se.fixFirefoxAutoScroll()})})})})},se.renderTextArea=function(){var ae=se.props,Ce=ae.prefixCls,ze=Ce===void 0?"rc-textarea":Ce,Ye=ae.autoSize,He=ae.onResize,Ve=ae.className,Fe=ae.disabled,Ke=se.state,nt=Ke.textareaStyles,he=Ke.resizeStatus,Re=Object(h.a)(se.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ne=C()(ze,Ve,Object(K.a)({},"".concat(ze,"-disabled"),Fe));"value"in Re&&(Re.value=Re.value||"");var Ue=Object(G.a)(Object(G.a)(Object(G.a)({},se.props.style),nt),he===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return F.createElement(v,{onResize:se.handleResize,disabled:!(Ye||He)},F.createElement("textarea",Object(ne.a)({},Re,{className:Ne,style:Ue,ref:se.saveTextArea})))},se.state={textareaStyles:{},resizeStatus:H.NONE},se}return Object(M.a)(pe,[{key:"componentDidUpdate",value:function(se){(se.value!==this.props.value||!x()(se.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 se=this.textArea.selectionStart,ae=this.textArea.selectionEnd;this.textArea.setSelectionRange(se,ae)}}catch(Ce){}}},{key:"render",value:function(){return this.renderTextArea()}}]),pe}(F.Component),ee=X,J=function(me){Object(z.a)(pe,me);var ue=Object(P.a)(pe);function pe(xe){var se;Object(Y.a)(this,pe),se=ue.call(this,xe),se.resizableTextArea=void 0,se.focus=function(){se.resizableTextArea.textArea.focus()},se.saveTextArea=function(Ce){se.resizableTextArea=Ce},se.handleChange=function(Ce){var ze=se.props.onChange;se.setValue(Ce.target.value,function(){se.resizableTextArea.resizeTextarea()}),ze&&ze(Ce)},se.handleKeyDown=function(Ce){var ze=se.props,Ye=ze.onPressEnter,He=ze.onKeyDown;Ce.keyCode===13&&Ye&&Ye(Ce),He&&He(Ce)};var ae=typeof xe.value=="undefined"||xe.value===null?xe.defaultValue:xe.value;return se.state={value:ae},se}return Object(M.a)(pe,[{key:"setValue",value:function(se,ae){"value"in this.props||this.setState({value:se},ae)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return F.createElement(ee,Object(ne.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(se){return"value"in se?{value:se.value}:null}}]),pe}(F.Component),ce=ve.default=J},ZW9T:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return _});var ne=U("k1fw"),Y=U("oBTY"),M=U("miYZ"),z=U("tsqr"),P=U("rAM+"),F=U("tJVT"),G=U("PpiC"),K=U("q1tI"),n=U.n(K),I=U("bdgK"),b=U("9og8"),f=U("WmNS"),y=U.n(f),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"]},p={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},l={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(`
`)}]},u=U("5VLF"),s=U.n(u),i={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"]}},D=function(H,X){return X.map(function(ee){return{label:ee,kind:H.languages.CompletionItemKind.Keyword,insertText:ee}})},A=function(H){return Object.keys(i.tables).map(function(X){return{label:X,kind:H.languages.CompletionItemKind.Variable,insertText:X}})},S=function(H,X){var ee=i.tables[H];return ee?ee.map(function(J){return{label:J,kind:X.languages.CompletionItemKind.Field,insertText:J}}):[]};function R(x,H,X,ee,J){var ce=H.getWordUntilPosition(X),me={startLineNumber:X.lineNumber,endLineNumber:X.lineNumber,startColumn:ce.startColumn,endColumn:ce.endColumn},ue=ee.map(function(pe){return{label:pe,kind:x.languages.CompletionItemKind.Keyword,insertText:pe,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:me}});return J.map(function(pe){ue.push(Object(ne.a)(Object(ne.a)({},pe),{},{range:me}))}),ue}var O=function(x){i.languages.map(function(J){return x.languages.registerDocumentFormattingEditProvider(J,{provideDocumentFormattingEdits:function(me,ue,pe){return Object(b.a)(y.a.mark(function xe(){var se;return y.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return se=s()(me.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}),Ce.abrupt("return",[{range:me.getFullModelRange(),text:se}]);case 2:case"end":return Ce.stop()}},xe)}))()}}),J});var H=p.quickKey.map(function(J){return{label:J.label,kind:x.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),X=l.quickKey.map(function(J){return{label:J.label,kind:x.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=a.quickKey.map(function(J){return{label:J.label,kind:x.languages.CompletionItemKind.Method,insertText:J.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet}});x.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ce,me){var ue=ce.getWordUntilPosition(me),pe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn},xe=ce.getLineContent(me.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(p.keywords.map(function(se){return{label:se,kind:x.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})),Object(Y.a)(p.quickKey.map(function(se){return{label:se.label,kind:x.languages.CompletionItemKind.Function,documentation:se.content,insertText:xe.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})))}}}),x.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ce,me){var ue=ce.getWordUntilPosition(me),pe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn};return{suggestions:Object(Y.a)(c.keywords.map(function(xe){return{label:xe,kind:x.languages.CompletionItemKind.Function,documentation:xe,insertText:xe,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}}))}}}),x.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ce,me){var ue=ce.getWordUntilPosition(me),pe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn},xe=ce.getLineContent(me.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(a.keywords.map(function(se){return{label:se,kind:x.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})),Object(Y.a)(a.quickKey.map(function(se){return{label:se.label,kind:x.languages.CompletionItemKind.Function,documentation:se.content,insertText:xe.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})))}}}),x.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ce,me){var ue=ce.getWordUntilPosition(me),pe={startLineNumber:me.lineNumber,endLineNumber:me.lineNumber,startColumn:ue.startColumn,endColumn:ue.endColumn},xe=ce.getLineContent(me.lineNumber).substring(ue.startColumn-2,ue.endColumn);return{suggestions:[].concat(Object(Y.a)(l.keywords.map(function(se){return{label:se,kind:x.languages.CompletionItemKind.Function,documentation:se,insertText:se,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})),Object(Y.a)(l.quickKey.map(function(se){return{label:se.label,kind:x.languages.CompletionItemKind.Function,documentation:se.content,insertText:xe.startsWith("#")?se.content.replace(/#/,""):se.content,insertTextRules:x.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}})))}}})},m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=U("fjLI"),h=U("LvDl"),d=U("+ua5");function C(x){return/^\d+$/.test(x)?"".concat(x,"px"):x}function E(){}var w=!1,j={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function W(){var x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=x;if(Array.isArray(x)){for(var X=0;X<x.length;X++){var ee=j[x[X]];if(ee)return ee}return H[0]}return j[H]||H}var T=null,N=ve.b=function(x){var H=x.width,X=H===void 0?"100%":H,ee=x.height,J=ee===void 0?"100%":ee,ce=x.value,me=x.language,ue=me===void 0?"javascript":me,pe=x.style,xe=pe===void 0?{}:pe,se=x.options,ae=se===void 0?{}:se,Ce=x.overrideServices,ze=Ce===void 0?{}:Ce,Ye=x.theme,He=Ye===void 0?"vs-dark":Ye,Ve=x.onEditBlur,Fe=x.onSave,Ke=x.autoHeight,nt=Ke===void 0?!1:Ke,he=x.forbidCopy,Re=he===void 0?!1:he,Ne=x.onChange,Ue=Ne===void 0?E:Ne,rt=x.editorDidMount,st=rt===void 0?E:rt,dt=x.onFocus,at=dt===void 0?E:dt,bt=x.filename,gt=bt===void 0?"educoder.txt":bt,xt=x.errorLine,Je=x.errorContent,kt=Je===void 0?"":Je,Ot=x.customTheme,tt=Ot===void 0?null:Ot,ft=Object(G.a)(x,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent","customTheme"]),be=Object(K.useRef)(),Ee=Object(K.useRef)({}),ge=Object(K.useRef)(),de=Object(K.useRef)(),fe=Object(K.useRef)(!1),we=Object(K.useRef)(),De=Object(K.useState)(!1),ke=Object(F.a)(De,2),Ze=ke[0],ht=ke[1];function Ut(){var vn;return be.current&&(vn=new I.default(function(fn){var Jn=Object(P.a)(fn),en;try{for(Jn.s();!(en=Jn.n()).done;){var jt=en.value;(jt.target.offsetHeight>0||jt.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(Fr){Jn.e(Fr)}finally{Jn.f()}}),vn.observe(be.current)),vn}function nn(){z.b.warn(decodeURIComponent(m))}var tn=function(){var fn=Ee.current.instance;if(ce!=null&&fn&&Ze){var Jn=fn.getModel();Jn&&ce!==Jn.getValue()&&(w=!0,Jn.setValue(ce),fn.layout(),w=!1)}};Object(K.useEffect)(function(){de.current&&clearTimeout(de.current),de.current=setTimeout(function(){tn()},500)},[ce,Ze,Ee.current]),Object(K.useEffect)(function(){if(xt&&Ee.current&&Ee.current.instance){var vn=Ee.current.instance;vn.changeViewZones(function(Jn){var en=document.createElement("div");en.style.padding="10px 20px",en.style.width="calc(100% - 20px)",en.className="my-error-line-wrp",en.innerHTML=kt,Jn.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:en})});var fn={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}};vn.addOverlayWidget(fn),vn.revealPositionInCenter({lineNumber:20,column:1})}},[xt,Ee.current,Ze]);function _n(){var vn=Ee.current.instance;if(vn){var fn=vn.getSelection(),Jn=Ee.current.pastePos||{},en=new T.Range(Jn.startLineNumber||fn.endLineNumber,Jn.startColumn||fn.endColumn,Jn.endLineNumber||fn.endLineNumber,Jn.endColumn||fn.endColumn);setTimeout(function(){vn.executeEdits("",[{range:en,text:""}])},300)}}function bn(vn){(window.navigator.platform.match("Mac")?vn.metaKey:vn.ctrlKey)&&vn.keyCode==83&&(vn.preventDefault(),Fe())}var Kt=function(){if(nt&&Ee.current.instance){var fn=Ee.current.instance.getContentHeight();hr(fn<J?J:fn)}else hr(J)};function rr(vn){var fn=document.createEvent("MouseEvents");fn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),vn.dispatchEvent(fn)}function Ln(vn,fn){var Jn=window.URL||window.webkitURL||window,en=new Blob([fn]),jt=document.createElementNS("http://www.w3.org/1999/xhtml","a");jt.href=Jn.createObjectURL(en),jt.download=vn,rr(jt)}Object(K.useEffect)(function(){Kt()},[Kt]),Object(K.useEffect)(function(){be.current&&!Ze&&Promise.all([U.e(16),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(vn){try{T=vn,Ee.current.instance=T.editor.create(be.current,{value:ce,language:W(ue),theme:He,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},ze);var fn=Ee.current.instance,Jn=v.d._menuItems,en=Object(Y.a)(Jn).find(function(un){return un[0]._debugName=="EditorContext"}),jt=en[1],Fr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],ri=function(Rr,yi){var fi=Rr._first;do{var _t,sn,Ii=yi.includes((_t=fi.element)===null||_t===void 0||((sn=_t.command)===null||sn===void 0)?void 0:sn.id);Ii&&Rr._remove(fi)}while(fi=fi.next)};if(st(fn,T),setTimeout(function(){Kt(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ln(gt||"educoder.txt",fn.getValue())}}),fn.getDomNode().addEventListener("input",function(){ge.current.autoFormat&&fn.getAction("editor.action.formatDocument").run()})},500),Ee.current.subscription=fn.onDidChangeModelContent(function(un){fe.current?clearTimeout(we.current):(Kt(),Ue(fn.getValue(),un)),we.current=setTimeout(function(){fe.current=!1},500)}),window.Monaco||O(T,W(ue)),Re&&(ri(jt,Fr),be.current.classList.add("noCopyPaste"),fn.onKeyDown(function(un){var Rr=un.keyCode,yi=un.ctrlKey,fi=un.metaKey;(Rr===33||Rr===52)&&(fi||yi)&&(nn(),un.preventDefault())})),window.Monaco=T,Ve&&fn.onDidBlurEditorWidget(function(){Ve(fn.getValue())}),at&&fn.onDidFocusEditorText(function(){at(fn.getValue())}),Re){fn.addCommand(T.KeyMod.CtrlCmd|T.KeyCode.KEY_V,function(){return nn(),null}),fn.onDidPaste(function(un){Ee.current.pastePos=un});try{window.addEventListener("paste",_n)}catch(un){}}var qr=Ut();return ht(!0),function(){var un=Ee.current.instance;un.dispose();var Rr=un.getModel();Rr&&Rr.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),Re&&window.removeEventListener("paste",_n),qr.unobserve(be.current)}}catch(un){}})},[]),Object(K.useEffect)(function(){var vn=Ee.current.instance;if(vn&&Ze)return document.addEventListener("keydown",bn,!1),function(){document.removeEventListener("keydown",bn)}},[Fe,Ze]),Object(K.useEffect)(function(){var vn=Ee.current.instance;if(vn&&Ze){var fn=W(ue);T.editor.setModelLanguage(vn.getModel(),fn),console.log("language:",ue,vn.getModel(),fn)}},[ue,Ze]),Object(K.useEffect)(function(){var vn=Ee.current.instance;vn&&Ze&&(tt?(T.editor.defineTheme("customTheme",tt),T.editor.setTheme("customTheme")):T.editor.setTheme(He))},[He,Ze,tt]),Object(K.useEffect)(function(){var vn=Ee.current.instance;ge.current=ae,vn&&Ze&&(vn.updateOptions(Object(ne.a)({},ae)),setTimeout(function(){vn.getModel().updateOptions(Object(ne.a)({},ae))},200))},[JSON.stringify(ae),Ze]),Object(K.useEffect)(function(){var vn=Ee.current.instance;vn&&Ze&&vn.layout()},[X,J,Ze]);var Cr=Object(K.useState)(C(X)),pr=Object(F.a)(Cr,2),kn=pr[0],Mr=pr[1],Or=Object(K.useState)(C(J)),ln=Object(F.a)(Or,2),Xr=ln[0],hr=ln[1],Sr=Object(ne.a)(Object(ne.a)({},xe),{},{width:kn,height:Xr});return n.a.createElement("div",{className:"my-monaco-editor",ref:be,style:Sr})};function _(x){var H=x.width,X=H===void 0?"100%":H,ee=x.height,J=ee===void 0?"100%":ee,ce=x.original,me=x.modified,ue=x.language,pe=x.options,xe=pe===void 0?{}:pe,se=Object(K.useRef)(),ae=Object(K.useState)(null),Ce=Object(F.a)(ae,2),ze=Ce[0],Ye=Ce[1];function He(nt){var he;return se.current&&(he=new I.default(function(Re){var Ne=Object(P.a)(Re),Ue;try{for(Ne.s();!(Ue=Ne.n()).done;){var rt=Ue.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&nt.layout()}}catch(st){Ne.e(st)}finally{Ne.f()}}),he.observe(se.current)),he}Object(K.useEffect)(function(){se.current&&Promise.all([U.e(16),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(nt){T=nt;var he=T.editor.createDiffEditor(se.current,Object(ne.a)(Object(ne.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},xe),{},{wordWrap:!0}));Ye(he);var Re=He(he);return function(){he.dispose();var Ne=he.getModel();Ne&&Ne.dispose(),Re.unobserve(se.current)}})},[]),Object(K.useEffect)(function(){ze&&ze.setModel({original:T.editor.createModel(ce,ue),modified:T.editor.createModel(me,ue)})},[ce,me,ue,ze]);var Ve=C(X),Fe=C(J),Ke={width:Ve,height:Fe};return n.a.createElement("div",{className:"my-diff-editor",ref:se,style:Ke})}},ZpRC:function(ut,ve,U){"use strict";function ne(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function Y(b,f){return(!f||b!=="hidden")&&b!=="visible"&&b!=="clip"}function M(b,f){if(b.clientHeight<b.scrollHeight||b.clientWidth<b.scrollWidth){var y=getComputedStyle(b,null);return Y(y.overflowY,f)||Y(y.overflowX,f)||function(c){var a=function(p){if(!p.ownerDocument||!p.ownerDocument.defaultView)return null;try{return p.ownerDocument.defaultView.frameElement}catch(l){return null}}(c);return!!a&&(a.clientHeight<c.scrollHeight||a.clientWidth<c.scrollWidth)}(b)}return!1}function z(b,f,y,c,a,p,l,u){return p<b&&l>f||p>b&&l<f?0:p<=b&&u<=y||l>=f&&u>=y?p-b-c:l>f&&u<y||p<b&&u>y?l-f+a:0}var P=function(b,f){var y=window,c=f.scrollMode,a=f.block,p=f.inline,l=f.boundary,u=f.skipOverflowHiddenElements,s=typeof l=="function"?l:function(nt){return nt!==l};if(!ne(b))throw new TypeError("Invalid target");for(var i=document.scrollingElement||document.documentElement,D=[],A=b;ne(A)&&s(A);){if((A=A.parentElement)===i){D.push(A);break}A!=null&&A===document.body&&M(A)&&!M(document.documentElement)||A!=null&&M(A,u)&&D.push(A)}for(var S=y.visualViewport?y.visualViewport.width:innerWidth,R=y.visualViewport?y.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,v=b.getBoundingClientRect(),h=v.height,d=v.width,C=v.top,E=v.right,w=v.bottom,j=v.left,W=a==="start"||a==="nearest"?C:a==="end"?w:C+h/2,T=p==="center"?j+d/2:p==="end"?E:j,N=[],_=0;_<D.length;_++){var x=D[_],H=x.getBoundingClientRect(),X=H.height,ee=H.width,J=H.top,ce=H.right,me=H.bottom,ue=H.left;if(c==="if-needed"&&C>=0&&j>=0&&w<=R&&E<=S&&C>=J&&w<=me&&j>=ue&&E<=ce)return N;var pe=getComputedStyle(x),xe=parseInt(pe.borderLeftWidth,10),se=parseInt(pe.borderTopWidth,10),ae=parseInt(pe.borderRightWidth,10),Ce=parseInt(pe.borderBottomWidth,10),ze=0,Ye=0,He="offsetWidth"in x?x.offsetWidth-x.clientWidth-xe-ae:0,Ve="offsetHeight"in x?x.offsetHeight-x.clientHeight-se-Ce:0;if(i===x)ze=a==="start"?W:a==="end"?W-R:a==="nearest"?z(m,m+R,R,se,Ce,m+W,m+W+h,h):W-R/2,Ye=p==="start"?T:p==="center"?T-S/2:p==="end"?T-S:z(O,O+S,S,xe,ae,O+T,O+T+d,d),ze=Math.max(0,ze+m),Ye=Math.max(0,Ye+O);else{ze=a==="start"?W-J-se:a==="end"?W-me+Ce+Ve:a==="nearest"?z(J,me,X,se,Ce+Ve,W,W+h,h):W-(J+X/2)+Ve/2,Ye=p==="start"?T-ue-xe:p==="center"?T-(ue+ee/2)+He/2:p==="end"?T-ce+ae+He:z(ue,ce,ee,xe,ae+He,T,T+d,d);var Fe=x.scrollLeft,Ke=x.scrollTop;W+=Ke-(ze=Math.max(0,Math.min(Ke+ze,x.scrollHeight-X+Ve))),T+=Fe-(Ye=Math.max(0,Math.min(Fe+Ye,x.scrollWidth-ee+He)))}N.push({el:x,top:ze,left:Ye})}return N};function F(b){return b===Object(b)&&Object.keys(b).length!==0}function G(b,f){f===void 0&&(f="auto");var y="scrollBehavior"in document.body.style;b.forEach(function(c){var a=c.el,p=c.top,l=c.left;a.scroll&&y?a.scroll({top:p,left:l,behavior:f}):(a.scrollTop=p,a.scrollLeft=l)})}function K(b){return b===!1?{block:"end",inline:"nearest"}:F(b)?b:{block:"start",inline:"nearest"}}function n(b,f){var y=!b.ownerDocument.documentElement.contains(b);if(F(f)&&typeof f.behavior=="function")return f.behavior(y?[]:P(b,f));if(y)return;var c=K(f);return G(P(b,c),c.behavior)}var I=ve.a=n},"a+yL":function(ut,ve,U){ut.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return Y});var ne=U("VTBJ");function Y(M,z){var P=Object(ne.a)({},M);return Array.isArray(z)&&z.forEach(function(F){delete P[F]}),P}},c5Ni:function(ut,ve,U){},d5o6:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___2-Tej",flex_space_between:"flex_space_between___1Q3vH",flex_box_vertical_center:"flex_box_vertical_center___2x9ha",flex_box_center_end:"flex_box_center_end___1fvRI",flex_box_column:"flex_box_column___2RmOE",addModal:"addModal___2Pv06",row:"row___2XmSi",label:"label___1L8pt"}},dejd:function(ut,ve,U){},dmUQ:function(ut,ve,U){"use strict";var ne=U("Ff2n"),Y=U("rePB"),M=U("1OyB"),z=U("vuIU"),P=U("Ji7U"),F=U("md7G"),G=U("foSv"),K=U("q1tI"),n=U.n(K),I=U("TSYQ"),b=U.n(I),f=U("4IlW");function y(h,d){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);d&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(h,w).enumerable})),C.push.apply(C,E)}return C}function c(h){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?y(Object(C),!0).forEach(function(E){Object(Y.a)(h,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):y(Object(C)).forEach(function(E){Object.defineProperty(h,E,Object.getOwnPropertyDescriptor(C,E))})}return h}function a(h){var d=p();return function(){var E=Object(G.a)(h),w;if(d){var j=Object(G.a)(this).constructor;w=Reflect.construct(E,arguments,j)}else w=E.apply(this,arguments);return Object(F.a)(this,w)}}function p(){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 l(){}function u(h){h.preventDefault()}var s=function(d){return d.replace(/[^\w.-]+/g,"")},i=200,D=600,A=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(d){return d!=null},R=function(d,C){return C===d||typeof C=="number"&&typeof d=="number"&&isNaN(C)&&isNaN(d)},O=function(h){Object(P.a)(C,h);var d=a(C);function C(E){var w;Object(M.a)(this,C),w=d.call(this,E),w.onKeyDown=function(T){var N=w.props,_=N.onKeyDown,x=N.onPressEnter;if(T.keyCode===f.a.UP){var H=w.getRatio(T);w.up(T,H,null),w.stop()}else if(T.keyCode===f.a.DOWN){var X=w.getRatio(T);w.down(T,X,null),w.stop()}else T.keyCode===f.a.ENTER&&x&&x(T);if(w.recordCursorPosition(),w.lastKeyCode=T.keyCode,_){for(var ee=arguments.length,J=new Array(ee>1?ee-1:0),ce=1;ce<ee;ce++)J[ce-1]=arguments[ce];_.apply(void 0,[T].concat(J))}},w.onKeyUp=function(T){var N=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),N){for(var _=arguments.length,x=new Array(_>1?_-1:0),H=1;H<_;H++)x[H-1]=arguments[H];N.apply(void 0,[T].concat(x))}},w.onChange=function(T){var N=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(T)),w.setState({inputValue:w.rawInput}),N(w.toNumber(w.rawInput))},w.onMouseUp=function(){var T=w.props.onMouseUp;w.recordCursorPosition(),T&&T.apply(void 0,arguments)},w.onFocus=function(){var T;w.setState({focused:!0}),(T=w.props).onFocus.apply(T,arguments)},w.onBlur=function(){var T=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var N=w.getCurrentValidValue(w.state.inputValue),_=w.setValue(N,l);if(T){var x=w.input.value,H=w.getInputDisplayValue({focus:!1,value:_});w.input.value=H&&Number(H),T.apply(void 0,arguments),w.input.value=x}},w.getRatio=function(T){var N=1;return T.metaKey||T.ctrlKey?N=.1:T.shiftKey&&(N=10),N},w.getFullNum=function(T){return isNaN(T)?T:/e/i.test(String(T))?Number(T).toFixed(18).replace(/\.?0+$/,""):T},w.getPrecision=function(T){if(S(w.props.precision))return w.props.precision;var N=String(T);if(N.indexOf("e-")>=0)return parseInt(N.slice(N.indexOf("e-")+2),10);var _=0;return N.indexOf(".")>=0&&(_=N.length-N.indexOf(".")-1),_},w.getInputDisplayValue=function(T){var N=T||w.state,_=N.focused,x=N.inputValue,H=N.value,X;_?X=x:X=w.toPrecisionAsStep(H),X==null&&(X="");var ee=w.formatWrapper(X);return S(w.props.decimalSeparator)&&(ee=ee.toString().replace(".",w.props.decimalSeparator)),ee},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(T){}},w.restoreByAfter=function(T){if(T===void 0)return!1;var N=w.input.value,_=N.lastIndexOf(T);if(_===-1)return!1;var x=w.cursorBefore.length;return w.lastKeyCode===f.a.DELETE&&w.cursorBefore.charAt(x-1)===T[0]?(w.fixCaret(x,x),!0):_+T.length===N.length?(w.fixCaret(_,_),!0):!1},w.partRestoreByAfter=function(T){return T===void 0?!1:Array.prototype.some.call(T,function(N,_){var x=T.substring(_);return w.restoreByAfter(x)})},w.isNotCompleteNumber=function(T){return isNaN(T)||T===""||T===null||T&&T.toString().indexOf(".")===T.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(T,N,_){w.pressingUpOrDown=!0,w.step("down",T,N,_)},w.up=function(T,N,_){w.pressingUpOrDown=!0,w.step("up",T,N,_)},w.saveInput=function(T){w.input=T};var j=E.value;j===void 0&&(j=E.defaultValue),w.state={focused:E.autoFocus};var W=w.getValidValue(w.toNumber(j));return w.state=c(c({},w.state),{},{inputValue:w.toPrecisionAsStep(W),value:W}),w}return Object(z.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var j=this.props,W=j.value,T=j.onChange,N=j.max,_=j.min,x=this.state.focused;if(w){if(!R(w.value,W)||!R(w.max,N)||!R(w.min,_)){var H=x?W:this.getValidValue(W),X;this.pressingUpOrDown?X=H:this.inputting?X=this.rawInput:X=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:X})}var ee="value"in this.props?W:this.state.value;"max"in this.props&&w.max!==N&&typeof ee=="number"&&ee>N&&T&&T(N),"min"in this.props&&w.min!==_&&typeof ee=="number"&&ee<_&&T&&T(_)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var J=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===f.a.BACKSPACE?J=this.cursorStart-1:this.lastKeyCode===f.a.DELETE&&(J=this.cursorStart):J=this.input.value.length,this.fixCaret(J,J)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case f.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case f.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ce){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(w){var j=w;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(w){var j=w.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,T=parseFloat(w);return isNaN(T)?w:(T<j&&(T=j),T>W&&(T=W),T)}},{key:"setValue",value:function(w,j){var W=this.props.precision,T=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),N=this.state.value,_=N===void 0?null:N,x=this.state.inputValue,H=x===void 0?null:x,X=typeof T=="number"?T.toFixed(W):"".concat(T),ee=T!==_||X!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},j)):this.setState({value:T,inputValue:this.toPrecisionAsStep(w)},j),ee&&this.props.onChange(T),T}},{key:"getMaxPrecision",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,T=W.precision,N=W.step;if(S(T))return T;var _=this.getPrecision(j),x=this.getPrecision(N),H=this.getPrecision(w);return w?Math.max(H,_+x):_+x}},{key:"getPrecisionFactor",value:function(w){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(w,j);return Math.pow(10,W)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var j=Math.abs(this.getMaxPrecision(w));return isNaN(j)?w.toString():Number(w).toFixed(j)}},{key:"toNumber",value:function(w){var j=this.props.precision,W=this.state.focused,T=w&&w.length>16&&W;return this.isNotCompleteNumber(w)||T?w:S(j)?Math.round(w*Math.pow(10,j))/Math.pow(10,j):Number(w)}},{key:"upStep",value:function(w,j){var W=this.props.step,T=this.getPrecisionFactor(w,j),N=Math.abs(this.getMaxPrecision(w,j)),_=((T*w+T*W*j)/T).toFixed(N);return this.toNumber(_)}},{key:"downStep",value:function(w,j){var W=this.props.step,T=this.getPrecisionFactor(w,j),N=Math.abs(this.getMaxPrecision(w,j)),_=((T*w-T*W*j)/T).toFixed(N);return this.toNumber(_)}},{key:"step",value:function(w,j){var W=this,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,N=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var _=this.props;if(_.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var H=this["".concat(w,"Step")](x,T),X=H>_.max||H<_.min;if(H>_.max?H=_.max:H<_.min&&(H=_.min),this.setValue(H,null),this.setState({focused:!0},function(){W.pressingUpOrDown=!1}),X)return;this.autoStepTimer=setTimeout(function(){W[w](j,T,!0)},N?i:D)}},{key:"fixCaret",value:function(w,j){if(w===void 0||j===void 0||!this.input||!this.input.value)return;try{var W=this.input.selectionStart,T=this.input.selectionEnd;(w!==W||j!==T)&&this.input.setSelectionRange(w,j)}catch(N){}}},{key:"render",value:function(){var w,j=this.props,W=j.prefixCls,T=j.disabled,N=j.readOnly,_=j.useTouch,x=j.autoComplete,H=j.upHandler,X=j.downHandler,ee=j.className,J=j.max,ce=j.min,me=j.style,ue=j.title,pe=j.onMouseEnter,xe=j.onMouseLeave,se=j.onMouseOver,ae=j.onMouseOut,Ce=j.required,ze=j.onClick,Ye=j.tabIndex,He=j.type,Ve=j.placeholder,Fe=j.id,Ke=j.inputMode,nt=j.pattern,he=j.step,Re=j.maxLength,Ne=j.autoFocus,Ue=j.name,rt=j.onPaste,st=j.onInput,dt=Object(ne.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),at=this.state,bt=at.value,gt=at.focused,xt=b()(W,(w={},Object(Y.a)(w,ee,!!ee),Object(Y.a)(w,"".concat(W,"-disabled"),T),Object(Y.a)(w,"".concat(W,"-focused"),gt),w)),Je={};Object.keys(dt).forEach(function(De){(De.substr(0,5)==="data-"||De.substr(0,5)==="aria-"||De==="role")&&(Je[De]=dt[De])});var kt=!N&&!T,Ot=this.getInputDisplayValue(null),tt=(bt||bt===0)&&(isNaN(bt)||Number(bt)>=J),ft=(bt||bt===0)&&(isNaN(bt)||Number(bt)<=ce),be=tt||T||N,Ee=ft||T||N,ge=b()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Y.a)({},"".concat(W,"-handler-up-disabled"),be)),de=b()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Y.a)({},"".concat(W,"-handler-down-disabled"),Ee)),fe=_?{onTouchStart:be?l:this.up,onTouchEnd:this.stop}:{onMouseDown:be?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},we=_?{onTouchStart:Ee?l:this.down,onTouchEnd:this.stop}:{onMouseDown:Ee?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:xt,style:me,title:ue,onMouseEnter:pe,onMouseLeave:xe,onMouseOver:se,onMouseOut:ae,onFocus:function(){return null},onBlur:function(){return null}},n.a.createElement("div",{className:"".concat(W,"-handler-wrap")},n.a.createElement("span",Object.assign({unselectable:"on"},fe,{role:"button","aria-label":"Increase Value","aria-disabled":be,className:ge}),H||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},we,{role:"button","aria-label":"Decrease Value","aria-disabled":Ee,className:de}),X||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-down-inner"),onClick:u}))),n.a.createElement("div",{className:"".concat(W,"-input-wrap")},n.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ce,"aria-valuemax":J,"aria-valuenow":bt,required:Ce,type:He,placeholder:Ve,onPaste:rt,onClick:ze,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:Ye,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:kt?this.onKeyDown:l,onKeyUp:kt?this.onKeyUp:l,autoFocus:Ne,maxLength:Re,readOnly:N,disabled:T,max:J,min:ce,step:he,name:Ue,title:ue,id:Fe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Ot),pattern:nt,inputMode:Ke,onInput:st},Je))))}}]),C}(n.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:A,min:-A,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:s,required:!1,autoComplete:"off"};var m=O,v=ve.a=m},fAei:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return i.a});var ne=U("rePB"),Y=U("VTBJ"),M=U("KQm4"),z=U("1OyB"),P=U("vuIU"),F=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U("4IlW"),I=U("Kwbf"),b=U("TSYQ"),f=U.n(b),y=U("sboe"),c=U("OZM5"),a=U("815F"),p=U("ODXe"),l=U("Ff2n"),u=U("+nKL"),s=U("8XRh"),i=U("WaYH"),D=function(ce,me){var ue=ce.className,pe=ce.style,xe=ce.motion,se=ce.motionNodes,ae=ce.motionType,Ce=ce.onMotionStart,ze=ce.onMotionEnd,Ye=ce.active,He=ce.treeNodeRequiredProps,Ve=Object(l.a)(ce,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Fe=K.useState(!0),Ke=Object(p.a)(Fe,2),nt=Ke[0],he=Ke[1],Re=K.useContext(y.a),Ne=Re.prefixCls,Ue=K.useRef(!1),rt=function(){Ue.current||ze(),Ue.current=!0};return Object(K.useEffect)(function(){se&&ae==="hide"&&nt&&he(!1)},[se]),Object(K.useEffect)(function(){return se&&Ce(),function(){se&&rt()}},[]),se?K.createElement(s.default,Object.assign({ref:me,visible:nt},xe,{motionAppear:ae==="show",onAppearEnd:rt,onLeaveEnd:rt}),function(st,dt){var at=st.className,bt=st.style;return K.createElement("div",{ref:dt,className:f()("".concat(Ne,"-treenode-motion"),at),style:bt},se.map(function(gt){var xt=gt.data,Je=xt.key,kt=Object(l.a)(xt,["key"]),Ot=gt.isStart,tt=gt.isEnd;delete kt.children;var ft=Object(a.f)(Je,He);return K.createElement(i.a,Object.assign({},kt,ft,{active:Ye,data:gt.data,key:Je,isStart:Ot,isEnd:tt}))}))}):K.createElement(i.a,Object.assign({domRef:me,className:ue,style:pe},Ve,{active:Ye}))};D.displayName="MotionTreeNode";var A=K.forwardRef(D),S=A;function R(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],me=J.length,ue=ce.length;if(Math.abs(me-ue)!==1)return{add:!1,key:null};function pe(xe,se){var ae=new Map;xe.forEach(function(ze){ae.set(ze,!0)});var Ce=se.filter(function(ze){return!ae.has(ze)});return Ce.length===1?Ce[0]:null}return me<ue?{add:!0,key:pe(J,ce)}:{add:!1,key:pe(ce,J)}}function O(J,ce,me){var ue=J.findIndex(function(ae){var Ce=ae.data;return Ce.key===me}),pe=J[ue+1],xe=ce.findIndex(function(ae){var Ce=ae.data;return Ce.key===me});if(pe){var se=ce.findIndex(function(ae){var Ce=ae.data;return Ce.key===pe.data.key});return ce.slice(xe+1,se)}return ce.slice(xe+1)}var m={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},v=function(){},h="RC_TREE_MOTION_".concat(Math.random()),d={key:h},C={key:h,level:0,index:0,pos:"0",node:d},E={parent:null,children:[],pos:C.pos,data:d,isStart:[],isEnd:[]};function w(J,ce,me,ue){return ce===!1||!me?J:J.slice(0,Math.ceil(me/ue)+1)}function j(J){var ce=J.data.key,me=J.pos;return Object(a.e)(ce,me)}function W(J){for(var ce=String(J.data.key),me=J;me.parent;)me=me.parent,ce="".concat(me.data.key," > ").concat(ce);return ce}var T=function(ce,me){var ue=ce.prefixCls,pe=ce.data,xe=ce.selectable,se=ce.checkable,ae=ce.expandedKeys,Ce=ce.selectedKeys,ze=ce.checkedKeys,Ye=ce.loadedKeys,He=ce.loadingKeys,Ve=ce.halfCheckedKeys,Fe=ce.keyEntities,Ke=ce.disabled,nt=ce.dragging,he=ce.dragOverNodeKey,Re=ce.dropPosition,Ne=ce.motion,Ue=ce.height,rt=ce.itemHeight,st=ce.virtual,dt=ce.focusable,at=ce.activeItem,bt=ce.focused,gt=ce.tabIndex,xt=ce.onKeyDown,Je=ce.onFocus,kt=ce.onBlur,Ot=ce.onActiveChange,tt=ce.onListChangeStart,ft=ce.onListChangeEnd,be=Object(l.a)(ce,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),Ee=K.useRef(null);K.useImperativeHandle(me,function(){return{scrollTo:function(Sr){Ee.current.scrollTo(Sr)}}});var ge=K.useState(ae),de=Object(p.a)(ge,2),fe=de[0],we=de[1],De=K.useState(pe),ke=Object(p.a)(De,2),Ze=ke[0],ht=ke[1],Ut=K.useState(pe),nn=Object(p.a)(Ut,2),tn=nn[0],_n=nn[1],bn=K.useState([]),Kt=Object(p.a)(bn,2),rr=Kt[0],Ln=Kt[1],Cr=K.useState(null),pr=Object(p.a)(Cr,2),kn=pr[0],Mr=pr[1];function Or(){ht(pe),_n(pe),Ln([]),Mr(null),ft()}K.useEffect(function(){we(ae);var hr=R(fe,ae);if(hr.key!==null)if(hr.add){var Sr=Ze.findIndex(function(Fr){var ri=Fr.data.key;return ri===hr.key}),vn=w(O(Ze,pe,hr.key),st,Ue,rt),fn=Ze.slice();fn.splice(Sr+1,0,E),_n(fn),Ln(vn),Mr("show")}else{var Jn=pe.findIndex(function(Fr){var ri=Fr.data.key;return ri===hr.key}),en=w(O(pe,Ze,hr.key),st,Ue,rt),jt=pe.slice();jt.splice(Jn+1,0,E),_n(jt),Ln(en),Mr("hide")}else Ze!==pe&&(ht(pe),_n(pe))},[ae,pe]),K.useEffect(function(){nt||Or()},[nt]);var ln=Ne?tn:pe,Xr={expandedKeys:ae,selectedKeys:Ce,loadedKeys:Ye,loadingKeys:He,checkedKeys:ze,halfCheckedKeys:Ve,dragOverNodeKey:he,dropPosition:Re,keyEntities:Fe};return K.createElement(K.Fragment,null,bt&&at&&K.createElement("span",{style:m,"aria-live":"assertive"},W(at)),K.createElement("div",{role:"tree"},K.createElement("input",{style:m,disabled:dt===!1||Ke,tabIndex:dt!==!1?gt:null,onKeyDown:xt,onFocus:Je,onBlur:kt,value:"",onChange:v})),K.createElement(u.a,Object.assign({},be,{data:ln,itemKey:j,height:Ue,fullHeight:!1,virtual:st,itemHeight:rt,prefixCls:"".concat(ue,"-list"),ref:Ee}),function(hr){var Sr=hr.pos,vn=hr.data,fn=vn.key,Jn=Object(l.a)(vn,["key"]),en=hr.isStart,jt=hr.isEnd,Fr=Object(a.e)(fn,Sr);delete Jn.children;var ri=Object(a.f)(Fr,Xr);return K.createElement(S,Object.assign({},Jn,ri,{active:at&&fn===at.data.key,pos:Sr,data:hr.data,isStart:en,isEnd:jt,motion:Ne,motionNodes:fn===h?rr:null,motionType:kn,onMotionStart:tt,onMotionEnd:Or,treeNodeRequiredProps:Xr,onMouseMove:function(){Ot(null)}}))}))},N=K.forwardRef(T);N.displayName="NodeList";var _=N,x=U("NvD2"),H=function(J){Object(F.a)(me,J);var ce=Object(G.a)(me);function me(){var ue;return Object(z.a)(this,me),ue=ce.apply(this,arguments),ue.destroyed=!1,ue.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ue.listRef=K.createRef(),ue.onNodeDragStart=function(pe,xe){var se=ue.state,ae=se.expandedKeys,Ce=se.keyEntities,ze=ue.props.onDragStart,Ye=xe.props.eventKey;ue.dragNode=xe;var He=Object(c.b)(ae,Ye);ue.setState({dragging:!0,dragNodesKeys:Object(c.g)(Ye,Ce)}),ue.setExpandedKeys(He),ze&&ze({event:pe,node:Object(a.b)(xe.props)})},ue.onNodeDragEnter=function(pe,xe){var se=ue.state,ae=se.expandedKeys,Ce=se.keyEntities,ze=se.dragNodesKeys,Ye=ue.props.onDragEnter,He=xe.props,Ve=He.pos,Fe=He.eventKey;if(!ue.dragNode||ze.indexOf(Fe)!==-1)return;var Ke=Object(c.c)(pe,xe);if(ue.dragNode.props.eventKey===Fe&&Ke===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:Fe,dropPosition:Ke}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(nt){clearTimeout(ue.delayedDragEnterLogic[nt])}),ue.delayedDragEnterLogic[Ve]=window.setTimeout(function(){if(!ue.state.dragging)return;var nt=Object(M.a)(ae),he=Ce[Fe];he&&(he.children||[]).length&&(nt=Object(c.a)(ae,Fe)),"expandedKeys"in ue.props||ue.setExpandedKeys(nt),Ye&&Ye({event:pe,node:Object(a.b)(xe.props),expandedKeys:nt})},400)},0)},ue.onNodeDragOver=function(pe,xe){var se=ue.state.dragNodesKeys,ae=ue.props.onDragOver,Ce=xe.props.eventKey;if(se.indexOf(Ce)!==-1)return;if(ue.dragNode&&Ce===ue.state.dragOverNodeKey){var ze=Object(c.c)(pe,xe);if(ze===ue.state.dropPosition)return;ue.setState({dropPosition:ze})}ae&&ae({event:pe,node:Object(a.b)(xe.props)})},ue.onNodeDragLeave=function(pe,xe){var se=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),se&&se({event:pe,node:Object(a.b)(xe.props)})},ue.onNodeDragEnd=function(pe,xe){var se=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),se&&se({event:pe,node:Object(a.b)(xe.props)}),ue.dragNode=null},ue.onNodeDrop=function(pe,xe){var se=ue.state,ae=se.dragNodesKeys,Ce=ae===void 0?[]:ae,ze=se.dropPosition,Ye=ue.props.onDrop,He=xe.props,Ve=He.eventKey,Fe=He.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),Ce.indexOf(Ve)!==-1){Object(I.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ke=Object(c.k)(Fe),nt={event:pe,node:Object(a.b)(xe.props),dragNode:ue.dragNode?Object(a.b)(ue.dragNode.props):null,dragNodesKeys:Ce.slice(),dropPosition:ze+Number(Ke[Ke.length-1]),dropToGap:!1};ze!==0&&(nt.dropToGap=!0),Ye&&Ye(nt),ue.dragNode=null},ue.cleanDragState=function(){var pe=ue.state.dragging;pe&&ue.setState({dragging:!1})},ue.onNodeClick=function(pe,xe){var se=ue.props.onClick;se&&se(pe,xe)},ue.onNodeDoubleClick=function(pe,xe){var se=ue.props.onDoubleClick;se&&se(pe,xe)},ue.onNodeSelect=function(pe,xe){var se=ue.state.selectedKeys,ae=ue.state.keyEntities,Ce=ue.props,ze=Ce.onSelect,Ye=Ce.multiple,He=xe.selected,Ve=xe.key,Fe=!He;Fe?Ye?se=Object(c.a)(se,Ve):se=[Ve]:se=Object(c.b)(se,Ve);var Ke=se.map(function(nt){var he=ae[nt];return he?he.node:null}).filter(function(nt){return nt});ue.setUncontrolledState({selectedKeys:se}),ze&&ze(se,{event:"select",selected:Fe,node:xe,selectedNodes:Ke,nativeEvent:pe.nativeEvent})},ue.onNodeCheck=function(pe,xe,se){var ae=ue.state,Ce=ae.keyEntities,ze=ae.checkedKeys,Ye=ae.halfCheckedKeys,He=ue.props,Ve=He.checkStrictly,Fe=He.onCheck,Ke=xe.key,nt,he={event:"check",node:xe,checked:se,nativeEvent:pe.nativeEvent};if(Ve){var Re=se?Object(c.a)(ze,Ke):Object(c.b)(ze,Ke),Ne=Object(c.b)(Ye,Ke);nt={checked:Re,halfChecked:Ne},he.checkedNodes=Re.map(function(bt){return Ce[bt]}).filter(function(bt){return bt}).map(function(bt){return bt.node}),ue.setUncontrolledState({checkedKeys:Re})}else{var Ue=Object(x.a)([].concat(Object(M.a)(ze),[Ke]),!0,Ce),rt=Ue.checkedKeys,st=Ue.halfCheckedKeys;if(!se){var dt=new Set(rt);dt.delete(Ke);var at=Object(x.a)(Array.from(dt),{checked:!1,halfCheckedKeys:st},Ce);rt=at.checkedKeys,st=at.halfCheckedKeys}nt=rt,he.checkedNodes=[],he.checkedNodesPositions=[],he.halfCheckedKeys=st,rt.forEach(function(bt){var gt=Ce[bt];if(!gt)return;var xt=gt.node,Je=gt.pos;he.checkedNodes.push(xt),he.checkedNodesPositions.push({node:xt,pos:Je})}),ue.setUncontrolledState({checkedKeys:rt},!1,{halfCheckedKeys:st})}Fe&&Fe(nt,he)},ue.onNodeLoad=function(pe){return new Promise(function(xe){ue.setState(function(se){var ae=se.loadedKeys,Ce=ae===void 0?[]:ae,ze=se.loadingKeys,Ye=ze===void 0?[]:ze,He=ue.props,Ve=He.loadData,Fe=He.onLoad,Ke=pe.key;if(!Ve||Ce.indexOf(Ke)!==-1||Ye.indexOf(Ke)!==-1)return{};var nt=Ve(pe);return nt.then(function(){var he=ue.state,Re=he.loadedKeys,Ne=he.loadingKeys,Ue=Object(c.a)(Re,Ke),rt=Object(c.b)(Ne,Ke);Fe&&Fe(Ue,{event:"load",node:pe}),ue.setUncontrolledState({loadedKeys:Ue}),ue.setState({loadingKeys:rt}),xe()}),{loadingKeys:Object(c.a)(Ye,Ke)}})})},ue.onNodeMouseEnter=function(pe,xe){var se=ue.props.onMouseEnter;se&&se({event:pe,node:xe})},ue.onNodeMouseLeave=function(pe,xe){var se=ue.props.onMouseLeave;se&&se({event:pe,node:xe})},ue.onNodeContextMenu=function(pe,xe){var se=ue.props.onRightClick;se&&(pe.preventDefault(),se({event:pe,node:xe}))},ue.onFocus=function(){var pe=ue.props.onFocus;ue.setState({focused:!0}),pe&&pe.apply(void 0,arguments)},ue.onBlur=function(){var pe=ue.props.onBlur;ue.setState({focused:!1}),ue.onActiveChange(null),pe&&pe.apply(void 0,arguments)},ue.getTreeNodeRequiredProps=function(){var pe=ue.state,xe=pe.expandedKeys,se=pe.selectedKeys,ae=pe.loadedKeys,Ce=pe.loadingKeys,ze=pe.checkedKeys,Ye=pe.halfCheckedKeys,He=pe.dragOverNodeKey,Ve=pe.dropPosition,Fe=pe.keyEntities;return{expandedKeys:xe||[],selectedKeys:se||[],loadedKeys:ae||[],loadingKeys:Ce||[],checkedKeys:ze||[],halfCheckedKeys:Ye||[],dragOverNodeKey:He,dropPosition:Ve,keyEntities:Fe}},ue.setExpandedKeys=function(pe){var xe=ue.state.treeData,se=Object(a.d)(xe,pe);ue.setUncontrolledState({expandedKeys:pe,flattenNodes:se},!0)},ue.onNodeExpand=function(pe,xe){var se=ue.state.expandedKeys,ae=ue.state.listChanging,Ce=ue.props,ze=Ce.onExpand,Ye=Ce.loadData,He=xe.key,Ve=xe.expanded;if(ae)return;var Fe=se.indexOf(He),Ke=!Ve;if(Object(I.a)(Ve&&Fe!==-1||!Ve&&Fe===-1,"Expand state not sync with index check"),Ke?se=Object(c.a)(se,He):se=Object(c.b)(se,He),ue.setExpandedKeys(se),ze&&ze(se,{node:xe,expanded:Ke,nativeEvent:pe.nativeEvent}),Ke&&Ye){var nt=ue.onNodeLoad(xe);nt&&nt.then(function(){var he=Object(a.d)(ue.state.treeData,se);ue.setUncontrolledState({flattenNodes:he})})}},ue.onListChangeStart=function(){ue.setUncontrolledState({listChanging:!0})},ue.onListChangeEnd=function(){setTimeout(function(){ue.setUncontrolledState({listChanging:!1})})},ue.onActiveChange=function(pe){var xe=ue.state.activeKey,se=ue.props.onActiveChange;if(xe===pe)return;ue.setState({activeKey:pe}),pe!==null&&ue.scrollTo({key:pe}),se&&se(pe)},ue.getActiveItem=function(){var pe=ue.state,xe=pe.activeKey,se=pe.flattenNodes;return xe===null?null:se.find(function(ae){var Ce=ae.data.key;return Ce===xe})||null},ue.offsetActiveKey=function(pe){var xe=ue.state,se=xe.flattenNodes,ae=xe.activeKey,Ce=se.findIndex(function(He){var Ve=He.data.key;return Ve===ae});Ce===-1&&pe<0&&(Ce=se.length),Ce=(Ce+pe+se.length)%se.length;var ze=se[Ce];if(ze){var Ye=ze.data.key;ue.onActiveChange(Ye)}else ue.onActiveChange(null)},ue.onKeyDown=function(pe){var xe=ue.state,se=xe.activeKey,ae=xe.expandedKeys,Ce=xe.checkedKeys,ze=ue.props,Ye=ze.onKeyDown,He=ze.checkable,Ve=ze.selectable;switch(pe.which){case n.a.UP:{ue.offsetActiveKey(-1),pe.preventDefault();break}case n.a.DOWN:{ue.offsetActiveKey(1),pe.preventDefault();break}}var Fe=ue.getActiveItem();if(Fe&&Fe.data){var Ke=ue.getTreeNodeRequiredProps(),nt=Fe.data.isLeaf===!1||!!(Fe.data.children||[]).length,he=Object(a.b)(Object(Y.a)(Object(Y.a)({},Object(a.f)(se,Ke)),{},{data:Fe.data,active:!0}));switch(pe.which){case n.a.LEFT:{nt&&ae.includes(se)?ue.onNodeExpand({},he):Fe.parent&&ue.onActiveChange(Fe.parent.data.key),pe.preventDefault();break}case n.a.RIGHT:{nt&&!ae.includes(se)?ue.onNodeExpand({},he):Fe.children&&Fe.children.length&&ue.onActiveChange(Fe.children[0].data.key),pe.preventDefault();break}case n.a.ENTER:case n.a.SPACE:{He&&!he.disabled&&he.checkable!==!1&&!he.disableCheckbox?ue.onNodeCheck({},he,!Ce.includes(se)):!He&&Ve&&!he.disabled&&he.selectable!==!1&&ue.onNodeSelect({},he);break}}}Ye&&Ye(pe)},ue.setUncontrolledState=function(pe){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ue.destroyed)return;var ae=!1,Ce=!0,ze={};Object.keys(pe).forEach(function(Ye){if(Ye in ue.props){Ce=!1;return}ae=!0,ze[Ye]=pe[Ye]}),ae&&(!xe||Ce)&&ue.setState(Object(Y.a)(Object(Y.a)({},ze),se))},ue.scrollTo=function(pe){ue.listRef.current.scrollTo(pe)},ue}return Object(P.a)(me,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var pe,xe=this.state,se=xe.focused,ae=xe.flattenNodes,Ce=xe.keyEntities,ze=xe.dragging,Ye=xe.activeKey,He=this.props,Ve=He.prefixCls,Fe=He.className,Ke=He.style,nt=He.showLine,he=He.focusable,Re=He.tabIndex,Ne=Re===void 0?0:Re,Ue=He.selectable,rt=He.showIcon,st=He.icon,dt=He.switcherIcon,at=He.draggable,bt=He.checkable,gt=He.checkStrictly,xt=He.disabled,Je=He.motion,kt=He.loadData,Ot=He.filterTreeNode,tt=He.height,ft=He.itemHeight,be=He.virtual,Ee=He.titleRender,ge=He.onContextMenu,de=Object(c.f)(this.props);return K.createElement(y.a.Provider,{value:{prefixCls:Ve,selectable:Ue,showIcon:rt,icon:st,switcherIcon:dt,draggable:at,checkable:bt,checkStrictly:gt,disabled:xt,keyEntities:Ce,loadData:kt,filterTreeNode:Ot,titleRender:Ee,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},K.createElement("div",{className:f()(Ve,Fe,(pe={},Object(ne.a)(pe,"".concat(Ve,"-show-line"),nt),Object(ne.a)(pe,"".concat(Ve,"-focused"),se),Object(ne.a)(pe,"".concat(Ve,"-active-focused"),Ye!==null),pe))},K.createElement(_,Object.assign({ref:this.listRef,prefixCls:Ve,style:Ke,data:ae,disabled:xt,selectable:Ue,checkable:!!bt,motion:Je,dragging:ze,height:tt,itemHeight:ft,virtual:be,focusable:he,focused:se,tabIndex:Ne,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ge},this.getTreeNodeRequiredProps(),de))))}}],[{key:"getDerivedStateFromProps",value:function(pe,xe){var se=xe.prevProps,ae={prevProps:pe};function Ce(st){return!se&&st in pe||se&&se[st]!==pe[st]}var ze;if(Ce("treeData")?ze=pe.treeData:Ce("children")&&(Object(I.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),ze=Object(a.c)(pe.children)),ze){ae.treeData=ze;var Ye=Object(a.a)(ze);ae.keyEntities=Object(Y.a)(Object(ne.a)({},h,C),Ye.keyEntities)}var He=ae.keyEntities||xe.keyEntities;if(Ce("expandedKeys")||se&&Ce("autoExpandParent"))ae.expandedKeys=pe.autoExpandParent||!se&&pe.defaultExpandParent?Object(c.e)(pe.expandedKeys,He):pe.expandedKeys;else if(!se&&pe.defaultExpandAll){var Ve=Object(Y.a)({},He);delete Ve[h],ae.expandedKeys=Object.keys(Ve).map(function(st){return Ve[st].key})}else!se&&pe.defaultExpandedKeys&&(ae.expandedKeys=pe.autoExpandParent||pe.defaultExpandParent?Object(c.e)(pe.defaultExpandedKeys,He):pe.defaultExpandedKeys);if(ae.expandedKeys||delete ae.expandedKeys,ze||ae.expandedKeys){var Fe=Object(a.d)(ze||xe.treeData,ae.expandedKeys||xe.expandedKeys);ae.flattenNodes=Fe}if(pe.selectable&&(Ce("selectedKeys")?ae.selectedKeys=Object(c.d)(pe.selectedKeys,pe):!se&&pe.defaultSelectedKeys&&(ae.selectedKeys=Object(c.d)(pe.defaultSelectedKeys,pe))),pe.checkable){var Ke;if(Ce("checkedKeys")?Ke=Object(c.j)(pe.checkedKeys)||{}:!se&&pe.defaultCheckedKeys?Ke=Object(c.j)(pe.defaultCheckedKeys)||{}:ze&&(Ke=Object(c.j)(pe.checkedKeys)||{checkedKeys:xe.checkedKeys,halfCheckedKeys:xe.halfCheckedKeys}),Ke){var nt=Ke,he=nt.checkedKeys,Re=he===void 0?[]:he,Ne=nt.halfCheckedKeys,Ue=Ne===void 0?[]:Ne;if(!pe.checkStrictly){var rt=Object(x.a)(Re,!0,He);Re=rt.checkedKeys,Ue=rt.halfCheckedKeys}ae.checkedKeys=Re,ae.halfCheckedKeys=Ue}}return Ce("loadedKeys")&&(ae.loadedKeys=pe.loadedKeys),ae}}]),me}(K.Component);H.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},H.TreeNode=i.a;var X=H,ee=ve.b=X},fcSX:function(ut,ve,U){"use strict";var ne=U("Ff2n"),Y=U("1OyB"),M=U("vuIU"),z=U("Ji7U"),P=U("md7G"),F=U("foSv"),G=U("1W/9"),K=U("q1tI"),n=U("rePB"),I=U("JX7q"),b=U("TSYQ"),f=U.n(b),y=U("qx4F"),c=U("4IlW");function a(T){return Array.isArray(T)?T:[T]}var p={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(p).filter(function(T){if(typeof document=="undefined")return!1;var N=document.getElementsByTagName("html")[0];return T in(N?N.style:{})})[0],u=p[l];function s(T,N,_,x){T.addEventListener?T.addEventListener(N,_,x):T.attachEvent&&T.attachEvent("on".concat(N),_)}function i(T,N,_,x){T.removeEventListener?T.removeEventListener(N,_,x):T.attachEvent&&T.detachEvent("on".concat(N),_)}function D(T,N){var _=typeof T=="function"?T(N):T;return Array.isArray(_)?_.length===2?_:[_[0],_[1]]:[_]}var A=function(N){return!isNaN(parseFloat(N))&&isFinite(N)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function T(N,_,x,H){if(!_||_===document||_ instanceof Document)return!1;if(_===N.parentNode)return!0;var X=Math.max(Math.abs(x),Math.abs(H))===Math.abs(H),ee=Math.max(Math.abs(x),Math.abs(H))===Math.abs(x),J=_.scrollHeight-_.clientHeight,ce=_.scrollWidth-_.clientWidth,me=document.defaultView.getComputedStyle(_),ue=me.overflowY==="auto"||me.overflowY==="scroll",pe=me.overflowX==="auto"||me.overflowX==="scroll",xe=J&&ue,se=ce&&pe;return X&&(!xe||xe&&(_.scrollTop>=J&&H<0||_.scrollTop<=0&&H>0))||ee&&(!se||se&&(_.scrollLeft>=ce&&x<0||_.scrollLeft<=0&&x>0))?T(N,_.parentNode,x,H):!1};function O(T){var N=m();return function(){var x=Object(F.a)(T),H;if(N){var X=Object(F.a)(this).constructor;H=Reflect.construct(x,arguments,X)}else H=x.apply(this,arguments);return Object(P.a)(this,H)}}function m(){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(T){return!1}}var v={},h=function(T){Object(z.a)(_,T);var N=O(_);function _(x){var H;return Object(Y.a)(this,_),H=N.call(this,x),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(X){if(X.touches.length>1)return;H.startPos={x:X.touches[0].clientX,y:X.touches[0].clientY}},H.removeMoveHandler=function(X){if(X.changedTouches.length>1)return;var ee=X.currentTarget,J=X.changedTouches[0].clientX-H.startPos.x,ce=X.changedTouches[0].clientY-H.startPos.y;(ee===H.maskDom||ee===H.handlerDom||ee===H.contentDom&&R(ee,X.target,J,ce))&&X.cancelable&&X.preventDefault()},H.transitionEnd=function(X){var ee=X.target;i(ee,u,H.transitionEnd),ee.style.transition=""},H.onKeyDown=function(X){if(X.keyCode===c.a.ESC){var ee=H.props.onClose;X.stopPropagation(),ee&&ee(X)}},H.onWrapperTransitionEnd=function(X){var ee=H.props,J=ee.open,ce=ee.afterVisibleChange;X.target===H.contentWrapper&&X.propertyName.match(/transform$/)&&(H.dom.style.transition="",!J&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),ce&&ce(!!J))},H.openLevelTransition=function(){var X=H.props,ee=X.open,J=X.width,ce=X.height,me=H.getHorizontalBoolAndPlacementName(),ue=me.isHorizontal,pe=me.placementName,xe=H.contentDom?H.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,se=(ue?J:ce)||xe;H.setLevelAndScrolling(ee,pe,se)},H.setLevelTransform=function(X,ee,J,ce){var me=H.props,ue=me.placement,pe=me.levelMove,xe=me.duration,se=me.ease,ae=me.showMask;H.levelDom.forEach(function(Ce){Ce.style.transition="transform ".concat(xe," ").concat(se),s(Ce,u,H.transitionEnd);var ze=X?J:0;if(pe){var Ye=D(pe,{target:Ce,open:X});ze=X?Ye[0]:Ye[1]||0}var He=typeof ze=="number"?"".concat(ze,"px"):ze,Ve=ue==="left"||ue==="top"?He:"-".concat(He);Ve=ae&&ue==="right"&&ce?"calc(".concat(Ve," + ").concat(ce,"px)"):Ve,Ce.style.transform=ze?"".concat(ee,"(").concat(Ve,")"):""})},H.setLevelAndScrolling=function(X,ee,J){var ce=H.props.onChange;if(!S){var me=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(y.a)(!0):0;H.setLevelTransform(X,ee,J,me),H.toggleScrollingToDrawerAndBody(me)}ce&&ce(X)},H.toggleScrollingToDrawerAndBody=function(X){var ee=H.props,J=ee.getOpenCount,ce=ee.getContainer,me=ee.showMask,ue=ee.open,pe=ce&&ce(),xe=J&&J();if(pe&&pe.parentNode===document.body&&me){var se=["touchstart"],ae=[document.body,H.maskDom,H.handlerDom,H.contentDom];ue&&document.body.style.overflow!=="hidden"?(X&&H.addScrollingEffect(X),xe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ae.forEach(function(Ce,ze){if(!Ce)return;s(Ce,se[ze]||"touchmove",ze?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(xe||(document.body.style.overflow=""),document.body.style.touchAction="",X&&H.remScrollingEffect(X),ae.forEach(function(Ce,ze){if(!Ce)return;i(Ce,se[ze]||"touchmove",ze?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(X){var ee=H.props,J=ee.placement,ce=ee.duration,me=ee.ease,ue=ee.getOpenCount,pe=ee.switchScrollingEffect,xe=ue&&ue();xe===1&&pe();var se="width ".concat(ce," ").concat(me),ae="transform ".concat(ce," ").concat(me);H.dom.style.transition="none";switch(J){case"right":H.dom.style.transform="translateX(-".concat(X,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(X,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ae,",").concat(se),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(X){var ee=H.props,J=ee.placement,ce=ee.duration,me=ee.ease,ue=ee.getOpenCount,pe=ee.switchScrollingEffect,xe=ue&&ue();xe||pe(!0),l&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var se,ae="width ".concat(ce," ").concat(me),Ce="transform ".concat(ce," ").concat(me);switch(J){case"left":{H.dom.style.width="100%",ae="width 0s ".concat(me," ").concat(ce);break}case"right":{H.dom.style.transform="translateX(".concat(X,"px)"),H.dom.style.width="100%",ae="width 0s ".concat(me," ").concat(ce),H.maskDom&&(H.maskDom.style.left="-".concat(X,"px"),H.maskDom.style.width="calc(100% + ".concat(X,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(X,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",se="height 0s ".concat(me," ").concat(ce);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(Ce,",").concat(se?"".concat(se,","):"").concat(ae),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(v).some(function(X){return v[X]})},H.getLevelDom=function(X){var ee=X.level,J=X.getContainer;if(S)return;var ce=J&&J(),me=ce?ce.parentNode:null;if(H.levelDom=[],ee==="all"){var ue=me?Array.prototype.slice.call(me.children):[];ue.forEach(function(pe){pe.nodeName!=="SCRIPT"&&pe.nodeName!=="STYLE"&&pe.nodeName!=="LINK"&&pe!==ce&&H.levelDom.push(pe)})}else ee&&a(ee).forEach(function(pe){document.querySelectorAll(pe).forEach(function(xe){H.levelDom.push(xe)})})},H.getHorizontalBoolAndPlacementName=function(){var X=H.props.placement,ee=X==="left"||X==="right",J="translate".concat(ee?"X":"Y");return{isHorizontal:ee,placementName:J}},H.state={_self:Object(I.a)(H)},H}return Object(M.a)(_,[{key:"componentDidMount",value:function(){var H=this;if(!S){var X=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return X=!0,null}}))}catch(ue){}this.passive=X?{passive:!1}:!1}var ee=this.props,J=ee.open,ce=ee.getContainer,me=ce&&ce();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),J&&(me&&me.parentNode===document.body&&(v[this.drawerId]=J),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var X=this.props,ee=X.open,J=X.getContainer,ce=J&&J();ee!==H.open&&(ee&&this.domFocus(),ce&&ce.parentNode===document.body&&(v[this.drawerId]=!!ee),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,X=H.getOpenCount,ee=H.open,J=H.switchScrollingEffect,ce=typeof X=="function"&&X();delete v[this.drawerId],ee&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ce||(document.body.style.overflow="",J(!0))}},{key:"render",value:function(){var H,X=this,ee=this.props,J=ee.className,ce=ee.children,me=ee.style,ue=ee.width,pe=ee.height,xe=ee.defaultOpen,se=ee.open,ae=ee.prefixCls,Ce=ee.placement,ze=ee.level,Ye=ee.levelMove,He=ee.ease,Ve=ee.duration,Fe=ee.getContainer,Ke=ee.handler,nt=ee.onChange,he=ee.afterVisibleChange,Re=ee.showMask,Ne=ee.maskClosable,Ue=ee.maskStyle,rt=ee.onClose,st=ee.onHandleClick,dt=ee.keyboard,at=ee.getOpenCount,bt=ee.switchScrollingEffect,gt=Object(ne.a)(ee,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),xt=this.dom?se:!1,Je=f()(ae,(H={},Object(n.a)(H,"".concat(ae,"-").concat(Ce),!0),Object(n.a)(H,"".concat(ae,"-open"),xt),Object(n.a)(H,J||"",!!J),Object(n.a)(H,"no-mask",!Re),H)),kt=this.getHorizontalBoolAndPlacementName(),Ot=kt.placementName,tt=Ce==="left"||Ce==="top"?"-100%":"100%",ft=xt?"":"".concat(Ot,"(").concat(tt,")"),be=Ke&&K.cloneElement(Ke,{onClick:function(ge){Ke.props.onClick&&Ke.props.onClick(),st&&st(ge)},ref:function(ge){X.handlerDom=ge}});return K.createElement("div",Object.assign({},gt,{tabIndex:-1,className:Je,style:me,ref:function(ge){X.dom=ge},onKeyDown:xt&&dt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Re&&K.createElement("div",{className:"".concat(ae,"-mask"),onClick:Ne?rt:void 0,style:Ue,ref:function(ge){X.maskDom=ge}}),K.createElement("div",{className:"".concat(ae,"-content-wrapper"),style:{transform:ft,msTransform:ft,width:A(ue)?"".concat(ue,"px"):ue,height:A(pe)?"".concat(pe,"px"):pe},ref:function(ge){X.contentWrapper=ge}},K.createElement("div",{className:"".concat(ae,"-content"),ref:function(ge){X.contentDom=ge},onTouchStart:xt&&Re?this.removeStartHandler:void 0,onTouchMove:xt&&Re?this.removeMoveHandler:void 0},ce),be))}}],[{key:"getDerivedStateFromProps",value:function(H,X){var ee=X.prevProps,J=X._self,ce={prevProps:H};if(ee!==void 0){var me=H.placement,ue=H.level;me!==ee.placement&&(J.contentDom=null),ue!==ee.level&&J.getLevelDom(H)}return ce}}]),_}(K.Component);h.defaultProps={switchScrollingEffect:function(){}};var d=h;function C(T){var N=E();return function(){var x=Object(F.a)(T),H;if(N){var X=Object(F.a)(this).constructor;H=Reflect.construct(x,arguments,X)}else H=x.apply(this,arguments);return Object(P.a)(this,H)}}function E(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(T){return!1}}var w=function(T){Object(z.a)(_,T);var N=C(_);function _(x){var H;Object(Y.a)(this,_),H=N.call(this,x),H.onHandleClick=function(ee){var J=H.props,ce=J.onHandleClick,me=J.open;if(ce&&ce(ee),typeof me=="undefined"){var ue=H.state.open;H.setState({open:!ue})}},H.onClose=function(ee){var J=H.props,ce=J.onClose,me=J.open;ce&&ce(ee),typeof me=="undefined"&&H.setState({open:!1})};var X=typeof x.open!="undefined"?x.open:!!x.defaultOpen;return H.state={open:X},"onMaskClick"in x&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(M.a)(_,[{key:"render",value:function(){var H=this,X=this.props,ee=X.defaultOpen,J=X.getContainer,ce=X.wrapperClassName,me=X.forceRender,ue=X.handler,pe=Object(ne.a)(X,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),xe=this.state.open;if(!J)return K.createElement("div",{className:ce,ref:function(Ce){H.dom=Ce}},K.createElement(d,Object.assign({},pe,{open:xe,handler:ue,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var se=!!ue||me;return K.createElement(G.a,{visible:xe,forceRender:se,getContainer:J,wrapperClassName:ce},function(ae){var Ce=ae.visible,ze=ae.afterClose,Ye=Object(ne.a)(ae,["visible","afterClose"]);return K.createElement(d,Object.assign({},pe,Ye,{open:Ce!==void 0?Ce:xe,afterVisibleChange:ze!==void 0?ze:pe.afterVisibleChange,handler:ue,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,X){var ee=X.prevProps,J={prevProps:H};return typeof ee!="undefined"&&H.open!==ee.open&&(J.open=H.open),J}}]),_}(K.Component);w.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:K.createElement("div",{className:"drawer-handle"},K.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var j=w,W=ve.a=j},fjLI:function(ut,ve,U){"use strict";U.d(ve,"f",function(){return y}),U.d(ve,"b",function(){return c}),U.d(ve,"a",function(){return a}),U.d(ve,"d",function(){return p}),U.d(ve,"e",function(){return l}),U.d(ve,"c",function(){return u});var ne=U("8HAY"),Y=U("Vhoy"),M=U("MI8n"),z=U("JYp7"),P=U("pmY6"),F=U("24hK"),G=U("nnTU"),K=U("T8No"),n=U("Cg/j"),I=U("t9D7"),b=function(s,i,D,A){var S=arguments.length,R=S<3?i:A===null?A=Object.getOwnPropertyDescriptor(i,D):A,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(s,i,D,A);else for(var m=s.length-1;m>=0;m--)(O=s[m])&&(R=(S<3?O(R):S>3?O(i,D,R):O(i,D))||R);return S>3&&R&&Object.defineProperty(i,D,R),R},f=function(s,i){return function(D,A){i(D,A,s)}};function y(s){return s.command!==void 0}class c{constructor(s){this.id=c._idPool++,this._debugName=s}}c._idPool=0,c.CommandPalette=new c("CommandPalette"),c.EditorContext=new c("EditorContext"),c.SimpleEditorContext=new c("SimpleEditorContext"),c.EditorContextCopy=new c("EditorContextCopy"),c.EditorContextPeek=new c("EditorContextPeek"),c.MenubarEditMenu=new c("MenubarEditMenu"),c.MenubarCopy=new c("MenubarCopy"),c.MenubarGoMenu=new c("MenubarGoMenu"),c.MenubarSelectionMenu=new c("MenubarSelectionMenu"),c.InlineCompletionsActions=new c("InlineCompletionsActions");const a=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new M.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===c.CommandPalette}}addCommand(s){return this.addCommands(z.a.single(s))}addCommands(s){for(const i of s)this._commands.set(i.id,i);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(P.i)(()=>{let i=!1;for(const D of s)i=this._commands.delete(D.id)||i;i&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(s){return this._commands.get(s)}getCommands(){const s=new Map;return this._commands.forEach((i,D)=>s.set(D,i)),s}appendMenuItem(s,i){return this.appendMenuItems(z.a.single({id:s,item:i}))}appendMenuItems(s){const i=new Set,D=new F.a;for(const{id:A,item:S}of s){let R=this._menuItems.get(A);R||(R=new F.a,this._menuItems.set(A,R)),D.push(R.push(S)),i.add(A)}return this._onDidChangeMenu.fire(i),Object(P.i)(()=>{if(D.size>0){for(let A of D)A();this._onDidChangeMenu.fire(i),D.clear()}})}getMenuItems(s){let i;return this._menuItems.has(s)?i=[...this._menuItems.get(s)]:i=[],s===c.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(s){const i=new Set;for(const D of s)y(D)&&(i.add(D.command.id),D.alt&&i.add(D.alt.id));this._commands.forEach((D,A)=>{i.has(A)||s.push({command:D})})}};class l extends ne.e{constructor(s,i,D,A){super(`submenuitem.${s.submenu.id}`,typeof s.title=="string"?s.title:s.title.value,[],"submenu");this.item=s,this._menuService=i,this._contextKeyService=D,this._options=A}get actions(){const s=[],i=this._menuService.createMenu(this.item.submenu,this._contextKeyService),D=i.getActions(this._options);i.dispose();for(const[,A]of D)A.length>0&&(s.push(...A),s.push(new ne.d));return s.length&&s.pop(),s}}let u=class s{constructor(i,D,A,S,R){var O,m;if(this._commandService=R,this.id=i.id,this.label=(A==null?void 0:A.renderShortTitle)&&i.shortTitle?typeof i.shortTitle=="string"?i.shortTitle:i.shortTitle.value:typeof i.title=="string"?i.title:i.title.value,this.tooltip=(m=typeof i.tooltip=="string"?i.tooltip:(O=i.tooltip)===null||O===void 0?void 0:O.value)!==null&&m!==void 0?m:"",this.enabled=!i.precondition||S.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const v=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=S.contextMatchesRules(v.condition),this.checked&&v.tooltip&&(this.tooltip=typeof v.tooltip=="string"?v.tooltip:v.tooltip.value),v.title&&(this.label=typeof v.title=="string"?v.title:v.title.value)}this.item=i,this.alt=D?new s(D,void 0,A,S,R):void 0,this._options=A,I.d.isThemeIcon(i.icon)&&(this.class=Y.a.asClassName(i.icon))}dispose(){}run(...i){var D,A;let S=[];return((D=this._options)===null||D===void 0?void 0:D.arg)&&(S=[...S,this._options.arg]),((A=this._options)===null||A===void 0?void 0:A.shouldForwardArgs)&&(S=[...S,...i]),this._commandService.executeCommand(this.id,...S)}};u=b([f(3,K.b),f(4,G.b)],u)},i8i3:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___3Vf6o",flex_space_between:"flex_space_between___3kR1x",flex_box_vertical_center:"flex_box_vertical_center___25a0b",flex_box_center_end:"flex_box_center_end___3k_KQ",flex_box_column:"flex_box_column___38BD-",customModal:"customModal___2JXW3",shareModal:"shareModal___1xuLw",content:"content___1yjOV",group:"group___2tJcj",teachGroup:"teachGroup___VMxNc",footer:"footer___1OQG5"}},iNYN:function(ut,ve,U){ut.exports={modalContent:"modalContent___3NP2x",modalContentLeft:"modalContentLeft___ycFEY",green:"green___2njFR",textArea:"textArea___28pXQ",red:"red___2bPlD",row:"row___tW7CE",html:"html___30ord",line:"line___1f3U7"}},ic2d:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return z});var ne=U("FWmy"),Y=U("746U");class M{constructor(){this.data=new Map}add(P,F){ne.a(Y.l(P)),ne.a(Y.k(F)),ne.a(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,F)}as(P){return this.data.get(P)||null}}const z=new M},iris:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return y});var ne=U("qVdP"),Y=U("jsC+"),M=U("lUTK"),z=U("BvKs"),P=U("tJVT"),F=U("q1tI"),G=U.n(F),K=U("Q0Vu"),n=U.n(K),I=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],b=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],f=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],y=function(a){var p=a.showSelectAll,l=p===void 0?!1:p,u=a.disciplinesData,s=u===void 0?[]:u,i=a.knowledgeData,D=i===void 0?[]:i,A=a.directionValue,S=a.subDisciplineValue,R=a.typeValue,O=a.knowledgeValue,m=a.showKnowledge,v=m===void 0?!1:m,h=a.showRandomType,d=h===void 0?!1:h,C=a.difficultyValue,E=a.randomValue,w=a.selectAll,j=a.languagesvalue,W=a.className,T=a.languages,N=T===void 0?[]:T,_=a.isprogram_homework,x=a.showShixun,H=x===void 0?!1:x,X=a.showItemType,ee=X===void 0?!0:X,J=a.onShixunChange,ce=J===void 0?function(){}:J,me=a.onDirectionChange,ue=me===void 0?function(){}:me,pe=a.onTypeChange,xe=pe===void 0?function(){}:pe,se=a.onDifficultyChange,ae=se===void 0?function(){}:se,Ce=a.handlelanguagesChange,ze=Ce===void 0?function(){}:Ce,Ye=a.onKnowledgeChange,He=Ye===void 0?function(){}:Ye,Ve=a.onRandomChange,Fe=Ve===void 0?function(){}:Ve,Ke=a.showTeachGroup,nt=Ke===void 0?!1:Ke,he=a.teachGroupData,Re=he===void 0?[]:he,Ne=a.onTeachGroupChange,Ue=Ne===void 0?function(){}:Ne,rt=a.teachGroupValue,st=Object(F.useState)(0),dt=Object(P.a)(st,2),at=dt[0],bt=dt[1],gt=Object(F.useRef)(null),xt=Object(F.useState)(0),Je=Object(P.a)(xt,2),kt=Je[0],Ot=Je[1],tt=Object(F.useRef)(null);Object(F.useEffect)(function(){if(s.length!==0){var be;(gt==null||((be=gt.current)===null||be===void 0)?void 0:be.clientHeight)>108?bt(1):bt(0)}s.length===0&&bt(0)},[s]),Object(F.useEffect)(function(){if(console.log(D.length===0,"\u6570\u91CF"),D.length!==0){var be,Ee;console.log(tt==null||((be=tt.current)===null||be===void 0)?void 0:be.clientHeight,"\u9AD8\u5EA6"),(tt==null||((Ee=tt.current)===null||Ee===void 0)?void 0:Ee.clientHeight)>108?Ot(1):Ot(0)}D.length===0&&Ot(0)},[D]);var ft=function(){var Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ge=arguments.length>1?arguments[1]:void 0;return G.a.createElement(z.a,{className:n.a.subMenu},Ee.map(function(de){return G.a.createElement(z.a.Item,{key:de.id},G.a.createElement("a",{className:"".concat(n.a.subItem," ").concat(S===de.id?n.a.subActive:""),onClick:function(){return ue(ge,de.id)}},de.name))}))};return G.a.createElement("aside",{className:W?"".concat(n.a.main," ").concat(W):n.a.main},G.a.createElement("div",{className:n.a.wrap},_&&G.a.createElement("div",{className:n.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),nt&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u56E2\u961F"),G.a.createElement("div",{className:n.a.directionContentWrap},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(rt?"":n.a.active," "),onClick:function(){return Ue(null)}},"\u5168\u90E8"),Re==null?void 0:Re.map(function(be){return G.a.createElement("li",{key:be.group_id,className:"".concat(n.a.directionItem," ").concat(rt===be.group_id?n.a.active:""," "),onClick:function(){return Ue(be.group_id)}},be.name)}))),G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u65B9\u5411"),G.a.createElement("span",null),G.a.createElement("div",{className:n.a.directionContentWrap,style:{overflow:"hidden",height:at===1?88:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A?"":n.a.active," "),onClick:function(){return ue(null)}},"\u5168\u90E8"),s.map(function(be){var Ee;return G.a.createElement(G.a.Fragment,{key:be.id},((Ee=be.sub_disciplines)===null||Ee===void 0?void 0:Ee.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(de){return de.parentNode},overlay:function(){return ft(be.sub_disciplines,be.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===be.id?n.a.active:""," "),onClick:function(){return ue(be.id)}},be.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===be.id?n.a.active:""," "),onClick:function(){return ue(be.id)}},be.name))})),G.a.createElement("div",{className:n.a.directionContentWrap,ref:gt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},s.map(function(be){var Ee;return G.a.createElement(G.a.Fragment,{key:be.id},((Ee=be.sub_disciplines)===null||Ee===void 0?void 0:Ee.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(de){return de.parentNode},overlay:function(){return ft(be.sub_disciplines,be.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===be.id?n.a.active:""," "),onClick:function(){return ue(be.id)}},be.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===be.id?n.a.active:""," "),onClick:function(){return ue(be.id)}},be.name))})),!!at&&G.a.createElement("div",{className:n.a.action},at===1&&G.a.createElement("span",{onClick:function(){return bt(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),at===2&&G.a.createElement("span",{onClick:function(){return bt(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),v&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u77E5\u8BC6\u70B9"),G.a.createElement("div",{className:n.a.directionContentWrap,style:{overflow:"hidden",height:kt===1?106:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(O===-1?n.a.active:""," "),onClick:function(){return He(-1)}},"\u5168\u90E8"),D.map(function(be){return G.a.createElement("li",{key:be.id,className:"".concat(n.a.directionItem," ").concat(O===be.id?n.a.active:""," "),onClick:function(){return He(be.id)}},be.name)})),G.a.createElement("div",{ref:tt,className:n.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},D.map(function(be){return G.a.createElement("li",{key:be.id,className:"".concat(n.a.directionItem," ").concat(O===be.id?n.a.active:""," "),onClick:function(){return He(be.id)}},be.name)})),!!kt&&G.a.createElement("div",{className:n.a.action},kt===1&&G.a.createElement("span",{onClick:function(){return Ot(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),kt===2&&G.a.createElement("span",{onClick:function(){return Ot(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),ee&&!_&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u9898\u578B"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(R?"":n.a.active," "),onClick:function(){return xe(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},I.map(function(be){return G.a.createElement("li",{key:be.name,className:"".concat(n.a.directionItem," ").concat(R===be.value?n.a.active:""," "),onClick:function(){return xe(be.value)}},be.name)}),H&&G.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:n.a.directionItem,onClick:function(){return ce()}},"\u5B9E\u8BAD\u9898"))),G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u96BE\u5EA6"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(C?"":n.a.active," "),onClick:function(){return ae(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},b.map(function(be){return G.a.createElement("li",{key:be.name,className:"".concat(n.a.directionItem," ").concat(C===be.value?n.a.active:""," "),onClick:function(){return ae(be.value)}},be.name)}))),d&&G.a.createElement("div",{className:n.a.content},G.a.createElement("span",{className:n.a.name},"\u7C7B\u578B"),G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(E?"":n.a.active," "),onClick:function(){return Fe(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},f.map(function(be){return G.a.createElement("li",{key:be.name,className:"".concat(n.a.directionItem," ").concat(E===be.value?n.a.active:""," "),onClick:function(){return Fe(be.value)}},be.name)})))))}},jcZT:function(ut,ve,U){"use strict";var ne=U("2qtc"),Y=U("kLXV"),M=U("5NDa"),z=U("5rEg"),P=U("miYZ"),F=U("tsqr"),G=U("9og8"),K=U("tJVT"),n=U("WmNS"),I=U.n(n),b=U("q1tI"),f=U.n(b),y=U("d5o6"),c=U.n(y),a=U("P/tu"),p=U("WCUW"),l=U("9kvl"),u=function(i){var D=i.problemset,A=i.dispatch,S=i.onOk,R=Object(b.useState)(""),O=Object(K.a)(R,2),m=O[0],v=O[1],h=Object(b.useState)([0]),d=Object(K.a)(h,2),C=d[0],E=d[1],w=function(){A({type:"problemset/setActionTabs",payload:{}})};Object(b.useEffect)(function(){if(D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var W,T;E([(W=D.actionTabs)===null||W===void 0||((T=W.params)===null||T===void 0)?void 0:T.group_id]),v("")}},[D.actionTabs.key]);var j=function(){var W=Object(G.a)(I.a.mark(function T(){var N,_,x;return I.a.wrap(function(X){for(;;)switch(X.prev=X.next){case 0:if(N=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],m.trim()){X.next=4;break}return F.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),X.abrupt("return");case 4:if(!(m.charAt(0)===" ")){X.next=7;break}return F.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),X.abrupt("return");case 7:_=0;case 8:if(!(_<m.length)){X.next=15;break}if(!N.includes(m.charAt(_))){X.next=12;break}return F.b.warn("\u6587\u4EF6\u5939\u540D\u79F0\u5305\u542B\u7279\u6B8A\u5B57\u7B26"),X.abrupt("return",!1);case 12:_++,X.next=8;break;case 15:return X.next=17,Object(p.p)({parent_id:C.length>0?C[0]:0,name:m});case 17:x=X.sent,x.status===0&&(w(),S(x==null?void 0:x.id));case 19:case"end":return X.stop()}},T)}));return function(){return W.apply(this,arguments)}}();return f.a.createElement(Y.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:D.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:w,onOk:j,destroyOnClose:!0},f.a.createElement("div",{className:c.a.addModal},f.a.createElement("div",{className:c.a.row},f.a.createElement("span",{className:c.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),f.a.createElement(z.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:m,onChange:function(T){return v(T.target.value)}})),f.a.createElement("div",{className:c.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},f.a.createElement("span",{className:c.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),f.a.createElement(a.a,{value:C,onChange:function(T){return E(T)}}))))};ve.a=Object(l.a)(function(s){var i=s.problemset;return{problemset:i}})(u)},k3GJ:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return fo});var ne=U("rePB"),Y=U("ODXe"),M=U("Ff2n"),z=U("VTBJ"),P=U("q1tI"),F=U("TSYQ"),G=U.n(F),K=U("Zm9Q"),n=U("6cGi"),I=U("KQm4"),b=U("xEkU"),f=U.n(b),y=U("t23M");function c(Te){var Le=Object(P.useRef)(),We=Object(P.useRef)(!1);function Se(){for(var ie=arguments.length,ye=new Array(ie),le=0;le<ie;le++)ye[le]=arguments[le];We.current||(f.a.cancel(Le.current),Le.current=f()(function(){Te.apply(void 0,ye)}))}return Object(P.useEffect)(function(){return function(){We.current=!0,f.a.cancel(Le.current)}},[]),Se}function a(Te){var Le=Object(P.useRef)([]),We=Object(P.useState)({}),Se=Object(Y.a)(We,2),ie=Se[1],ye=Object(P.useRef)(typeof Te=="function"?Te():Te),le=c(function(){var _e=ye.current;Le.current.forEach(function(Be){_e=Be(_e)}),Le.current=[],ye.current=_e,ie({})});function Ae(_e){Le.current.push(_e),le()}return[ye.current,Ae]}var p=U("4IlW");function l(Te,Le){var We,Se=Te.prefixCls,ie=Te.id,ye=Te.active,le=Te.rtl,Ae=Te.tab,_e=Ae.key,Be=Ae.tab,je=Ae.disabled,Ge=Ae.closeIcon,et=Te.tabBarGutter,yt=Te.tabPosition,Tt=Te.closable,Nt=Te.renderWrapper,Dn=Te.removeAriaLabel,$n=Te.editable,Bn=Te.onClick,zn=Te.onRemove,Xn=Te.onFocus,Vn="".concat(Se,"-tab");P.useEffect(function(){return zn},[]);var Fn={};yt==="top"||yt==="bottom"?Fn[le?"marginLeft":"marginRight"]=et:Fn.marginBottom=et;var Zn=$n&&Tt!==!1&&!je;function er(En){if(je)return;Bn(En)}function Nr(En){En.preventDefault(),En.stopPropagation(),$n.onEdit("remove",{key:_e,event:En})}var tr=P.createElement("div",{key:_e,ref:Le,className:G()(Vn,(We={},Object(ne.a)(We,"".concat(Vn,"-with-remove"),Zn),Object(ne.a)(We,"".concat(Vn,"-active"),ye),Object(ne.a)(We,"".concat(Vn,"-disabled"),je),We)),style:Fn,onClick:er},P.createElement("div",{role:"tab","aria-selected":ye,id:ie&&"".concat(ie,"-tab-").concat(_e),className:"".concat(Vn,"-btn"),"aria-controls":ie&&"".concat(ie,"-panel-").concat(_e),"aria-disabled":je,tabIndex:je?null:0,onClick:function(gn){gn.stopPropagation(),er(gn)},onKeyDown:function(gn){[p.a.SPACE,p.a.ENTER].includes(gn.which)&&(gn.preventDefault(),er(gn))},onFocus:Xn},Be),Zn&&P.createElement("button",{type:"button","aria-label":Dn||"remove",tabIndex:0,className:"".concat(Vn,"-remove"),onClick:function(gn){gn.stopPropagation(),Nr(gn)}},Ge||$n.removeIcon||"\xD7"));return Nt&&(tr=Nt(tr)),tr}var u=P.forwardRef(l),s={width:0,height:0,left:0,top:0};function i(Te,Le,We){return Object(P.useMemo)(function(){for(var Se,ie=new Map,ye=Le.get((Se=Te[0])===null||Se===void 0?void 0:Se.key)||s,le=ye.left+ye.width,Ae=0;Ae<Te.length;Ae+=1){var _e=Te[Ae].key,Be=Le.get(_e);if(!Be){var je;Be=Le.get((je=Te[Ae-1])===null||je===void 0?void 0:je.key)||s}var Ge=ie.get(_e)||Object(z.a)({},Be);Ge.right=le-Ge.left-Ge.width,ie.set(_e,Ge)}return ie},[Te.map(function(Se){return Se.key}).join("_"),Le,We])}var D={width:0,height:0,left:0,top:0,right:0};function A(Te,Le,We,Se,ie){var ye=ie.tabs,le=ie.tabPosition,Ae=ie.rtl,_e,Be,je;["top","bottom"].includes(le)?(_e="width",Be=Ae?"right":"left",je=Math.abs(Le.left)):(_e="height",Be="top",je=-Le.top);var Ge=Le[_e],et=We[_e],yt=Se[_e],Tt=Ge;return et+yt>Ge&&(Tt=Ge-yt),Object(P.useMemo)(function(){if(!ye.length)return[0,0];for(var Nt=ye.length,Dn=Nt,$n=0;$n<Nt;$n+=1){var Bn=Te.get(ye[$n].key)||D;if(Bn[Be]+Bn[_e]>je+Tt){Dn=$n-1;break}}for(var zn=0,Xn=Nt-1;Xn>=0;Xn-=1){var Vn=Te.get(ye[Xn].key)||D;if(Vn[Be]<je){zn=Xn+1;break}}return[zn,Dn]},[Te,je,Tt,le,ye.map(function(Nt){return Nt.key}).join("_"),Ae])}var S=U("wx14"),R=U("1OyB"),O=U("vuIU"),m=U("JX7q"),v=U("Ji7U"),h=U("LK+K"),d=U("I8Z2"),C=U("bT9E"),E=U("2GS6"),w=U("Gytx"),j=U.n(w),W=U("U8pU"),T=/iPhone/i,N=/iPod/i,_=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,X=/\bAndroid(?:.+)SD4930UR\b/i,ee=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,J=/Windows Phone/i,ce=/\bWindows(?:.+)ARM\b/i,me=/BlackBerry/i,ue=/BB10/i,pe=/Opera Mini/i,xe=/\b(CriOS|Chrome)(?:.+)Mobile/i,se=/Mobile(?:.+)Firefox\b/i;function ae(Te,Le){return Te.test(Le)}function Ce(Te){var Le=Te||(typeof navigator!="undefined"?navigator.userAgent:""),We=(Le||"").split("[FBAN");if(typeof We[1]!="undefined"){var Se=We,ie=Object(Y.a)(Se,1);Le=ie[0]}if(We=Le.split("Twitter"),typeof We[1]!="undefined"){var ye=We,le=Object(Y.a)(ye,1);Le=le[0]}var Ae={apple:{phone:ae(T,Le)&&!ae(J,Le),ipod:ae(N,Le),tablet:!ae(T,Le)&&ae(_,Le)&&!ae(J,Le),device:(ae(T,Le)||ae(N,Le)||ae(_,Le))&&!ae(J,Le)},amazon:{phone:ae(X,Le),tablet:!ae(X,Le)&&ae(ee,Le),device:ae(X,Le)||ae(ee,Le)},android:{phone:!ae(J,Le)&&ae(X,Le)||!ae(J,Le)&&ae(x,Le),tablet:!ae(J,Le)&&!ae(X,Le)&&!ae(x,Le)&&(ae(ee,Le)||ae(H,Le)),device:!ae(J,Le)&&(ae(X,Le)||ae(ee,Le)||ae(x,Le)||ae(H,Le))||ae(/\bokhttp\b/i,Le)},windows:{phone:ae(J,Le),tablet:ae(ce,Le),device:ae(J,Le)||ae(ce,Le)},other:{blackberry:ae(me,Le),blackberry10:ae(ue,Le),opera:ae(pe,Le),firefox:ae(se,Le),chrome:ae(xe,Le),device:ae(me,Le)||ae(ue,Le)||ae(pe,Le)||ae(se,Le)||ae(xe,Le)},any:null,phone:null,tablet:null};return Ae.any=Ae.apple.device||Ae.android.device||Ae.windows.device||Ae.other.device,Ae.phone=Ae.apple.phone||Ae.android.phone||Ae.windows.phone,Ae.tablet=Ae.apple.tablet||Ae.android.tablet||Ae.windows.tablet,Ae}var ze=Object(z.a)(Object(z.a)({},Ce()),{},{isMobile:Ce}),Ye=ze;function He(){}function Ve(Te,Le,We){var Se=Le||"";return Te.key||"".concat(Se,"item_").concat(We)}function Fe(Te){return"".concat(Te,"-menu-")}function Ke(Te,Le){var We=-1;P.Children.forEach(Te,function(Se){We+=1,Se&&Se.type&&Se.type.isMenuItemGroup?P.Children.forEach(Se.props.children,function(ie){We+=1,Le(ie,We)}):Le(Se,We)})}function nt(Te,Le,We){if(!Te||We.find)return;P.Children.forEach(Te,function(Se){if(Se){var ie=Se.type;if(!ie||!(ie.isSubMenu||ie.isMenuItem||ie.isMenuItemGroup))return;Le.indexOf(Se.key)!==-1?We.find=!0:Se.props.children&&nt(Se.props.children,Le,We)}})}var he=["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"],Re=function(Le){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=Le&&typeof Le.getBoundingClientRect=="function"&&Le.getBoundingClientRect().width;if(Se){if(We){var ie=getComputedStyle(Le),ye=ie.marginLeft,le=ie.marginRight;Se+=+ye.replace("px","")+ +le.replace("px","")}Se=+Se.toFixed(6)}return Se||0},Ne=function(Le,We,Se){Le&&Object(W.a)(Le.style)==="object"&&(Le.style[We]=Se)},Ue=function(){return Ye.any},rt=U("bdgK"),st=U("i8i4"),dt=U.n(st),at=U("wgJM"),bt=U("l4aY"),gt=U("m+aA"),xt=U("c+Xe"),Je=U("zT1h"),kt=U("QC+M");function Ot(Te,Le,We){return We?Te[0]===Le[0]:Te[0]===Le[0]&&Te[1]===Le[1]}function tt(Te,Le,We){var Se=Te[Le]||{};return Object(z.a)(Object(z.a)({},Se),We)}function ft(Te,Le,We,Se){for(var ie=We.points,ye=Object.keys(Te),le=0;le<ye.length;le+=1){var Ae=ye[le];if(Ot(Te[Ae].points,ie,Se))return"".concat(Le,"-placement-").concat(Ae)}return""}var be=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Te=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Te)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Te==null?void 0:Te.substr(0,4)))},Ee=U("MNnm");function ge(Te,Le){var We={};return We[Te.toLowerCase()]=Le.toLowerCase(),We["Webkit".concat(Te)]="webkit".concat(Le),We["Moz".concat(Te)]="moz".concat(Le),We["ms".concat(Te)]="MS".concat(Le),We["O".concat(Te)]="o".concat(Le.toLowerCase()),We}function de(Te,Le){var We={animationend:ge("Animation","AnimationEnd"),transitionend:ge("Transition","TransitionEnd")};return Te&&("AnimationEvent"in Le||delete We.animationend.animation,"TransitionEvent"in Le||delete We.transitionend.transition),We}var fe=de(Object(Ee.a)(),typeof window!="undefined"?window:{}),we={};if(Object(Ee.a)()){var De=document.createElement("div");we=De.style}var ke={};function Ze(Te){if(ke[Te])return ke[Te];var Le=fe[Te];if(Le)for(var We=Object.keys(Le),Se=We.length,ie=0;ie<Se;ie+=1){var ye=We[ie];if(Object.prototype.hasOwnProperty.call(Le,ye)&&ye in we)return ke[Te]=Le[ye],ke[Te]}return""}var ht=Ze("animationend"),Ut=Ze("transitionend"),nn=!!(ht&&Ut),tn=ht||"animationend",_n=Ut||"transitionend";function bn(Te,Le){if(!Te)return null;if(Object(W.a)(Te)==="object"){var We=Le.replace(/-\w/g,function(Se){return Se[1].toUpperCase()});return Te[We]}return"".concat(Te,"-").concat(Le)}var Kt="none",rr="appear",Ln="enter",Cr="leave",pr="none",kn="prepare",Mr="start",Or="active",ln="end";function Xr(Te){var Le=Object(P.useRef)(!1),We=Object(P.useState)(Te),Se=Object(Y.a)(We,2),ie=Se[0],ye=Se[1];function le(Ae){Le.current||ye(Ae)}return Object(P.useEffect)(function(){return function(){Le.current=!0}},[]),[ie,le]}var hr=Object(Ee.a)()?P.useLayoutEffect:P.useEffect,Sr=hr,vn=function(){var Te=P.useRef(null);function Le(){at.a.cancel(Te.current)}function We(Se){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;Le();var ye=Object(at.a)(function(){ie<=1?Se({isCanceled:function(){return ye!==Te.current}}):We(Se,ie-1)});Te.current=ye}return P.useEffect(function(){return function(){Le()}},[]),[We,Le]},fn=[kn,Mr,Or,ln],Jn=!1,en=!0;function jt(Te){return Te===Or||Te===ln}var Fr=function(Te,Le){var We=P.useState(pr),Se=Object(Y.a)(We,2),ie=Se[0],ye=Se[1],le=vn(),Ae=Object(Y.a)(le,2),_e=Ae[0],Be=Ae[1];function je(){ye(kn)}return Sr(function(){if(ie!==pr&&ie!==ln){var Ge=fn.indexOf(ie),et=fn[Ge+1],yt=Le(ie);yt===Jn?ye(et):_e(function(Tt){function Nt(){if(Tt.isCanceled())return;ye(et)}yt===!0?Nt():Promise.resolve(yt).then(Nt)})}},[Te,ie]),P.useEffect(function(){return function(){Be()}},[]),[je,ie]},ri=function(Te){var Le=Object(P.useRef)(),We=Object(P.useRef)(Te);We.current=Te;var Se=P.useCallback(function(le){We.current(le)},[]);function ie(le){le&&(le.removeEventListener(_n,Se),le.removeEventListener(tn,Se))}function ye(le){Le.current&&Le.current!==le&&ie(Le.current),le&&le!==Le.current&&(le.addEventListener(_n,Se),le.addEventListener(tn,Se),Le.current=le)}return P.useEffect(function(){return function(){ie(Le.current)}},[]),[ye,ie]};function qr(Te,Le,We,Se){var ie=Se.motionEnter,ye=ie===void 0?!0:ie,le=Se.motionAppear,Ae=le===void 0?!0:le,_e=Se.motionLeave,Be=_e===void 0?!0:_e,je=Se.motionDeadline,Ge=Se.motionLeaveImmediately,et=Se.onAppearPrepare,yt=Se.onEnterPrepare,Tt=Se.onLeavePrepare,Nt=Se.onAppearStart,Dn=Se.onEnterStart,$n=Se.onLeaveStart,Bn=Se.onAppearActive,zn=Se.onEnterActive,Xn=Se.onLeaveActive,Vn=Se.onAppearEnd,Fn=Se.onEnterEnd,Zn=Se.onLeaveEnd,er=Se.onVisibleChanged,Nr=Xr(),tr=Object(Y.a)(Nr,2),En=tr[0],gn=tr[1],Wn=Xr(Kt),ur=Object(Y.a)(Wn,2),an=ur[0],cr=ur[1],Ur=Xr(null),ir=Object(Y.a)(Ur,2),Ar=ir[0],Er=ir[1],Gr=Object(P.useRef)(!1),Yr=Object(P.useRef)(null),Br=Object(P.useRef)(!1),_i=Object(P.useRef)(null);function Pi(){var Dr=We();return Dr||_i.current}var Si=Object(P.useRef)(!1);function $r(Dr){var yr=Pi();if(Dr&&!Dr.deadline&&Dr.target!==yr)return;var Wr;an===rr&&Si.current?Wr=Vn==null?void 0:Vn(yr,Dr):an===Ln&&Si.current?Wr=Fn==null?void 0:Fn(yr,Dr):an===Cr&&Si.current&&(Wr=Zn==null?void 0:Zn(yr,Dr)),Wr!==!1&&!Br.current&&(cr(Kt),Er(null))}var Ir=ri($r),xr=Object(Y.a)(Ir,1),Cn=xr[0],Tr=P.useMemo(function(){var Dr,yr,Wr;switch(an){case"appear":return Dr={},Object(ne.a)(Dr,kn,et),Object(ne.a)(Dr,Mr,Nt),Object(ne.a)(Dr,Or,Bn),Dr;case"enter":return yr={},Object(ne.a)(yr,kn,yt),Object(ne.a)(yr,Mr,Dn),Object(ne.a)(yr,Or,zn),yr;case"leave":return Wr={},Object(ne.a)(Wr,kn,Tt),Object(ne.a)(Wr,Mr,$n),Object(ne.a)(Wr,Or,Xn),Wr;default:return{}}},[an]),ji=Fr(an,function(Dr){if(Dr===kn){var yr=Tr[kn];return yr?yr(Pi()):Jn}if(wr in Tr){var Wr;Er(((Wr=Tr[wr])===null||Wr===void 0?void 0:Wr.call(Tr,Pi(),null))||null)}return wr===Or&&(Cn(Pi()),je>0&&(clearTimeout(Yr.current),Yr.current=setTimeout(function(){$r({deadline:!0})},je))),en}),Zi=Object(Y.a)(ji,2),ia=Zi[0],wr=Zi[1],Xi=jt(wr);Si.current=Xi,Sr(function(){gn(Le);var Dr=Gr.current;if(Gr.current=!0,!Te)return;var yr;!Dr&&Le&&Ae&&(yr=rr),Dr&&Le&&ye&&(yr=Ln),(Dr&&!Le&&Be||!Dr&&Ge&&!Le&&Be)&&(yr=Cr),yr&&(cr(yr),ia())},[Le]),Object(P.useEffect)(function(){(an===rr&&!Ae||an===Ln&&!ye||an===Cr&&!Be)&&cr(Kt)},[Ae,ye,Be]),Object(P.useEffect)(function(){return function(){clearTimeout(Yr.current),Br.current=!0}},[]),Object(P.useEffect)(function(){En!==void 0&&an===Kt&&(er==null||er(En))},[En,an]);var Ji=Ar;return Tr[kn]&&wr===Mr&&(Ji=Object(z.a)({transition:"none"},Ji)),[an,wr,Ji,En!=null?En:Le]}var un=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(){return Object(R.a)(this,We),Le.apply(this,arguments)}return Object(O.a)(We,[{key:"render",value:function(){return this.props.children}}]),We}(P.Component),Rr=un;function yi(Te){var Le=Te;Object(W.a)(Te)==="object"&&(Le=Te.transitionSupport);function We(ie){return!!(ie.motionName&&Le)}var Se=P.forwardRef(function(ie,ye){var le=ie.visible,Ae=le===void 0?!0:le,_e=ie.removeOnLeave,Be=_e===void 0?!0:_e,je=ie.forceRender,Ge=ie.children,et=ie.motionName,yt=ie.leavedClassName,Tt=ie.eventProps,Nt=We(ie),Dn=Object(P.useRef)(),$n=Object(P.useRef)();function Bn(){try{return Object(gt.a)(Dn.current||$n.current)}catch(cr){return null}}var zn=qr(Nt,Ae,Bn,ie),Xn=Object(Y.a)(zn,4),Vn=Xn[0],Fn=Xn[1],Zn=Xn[2],er=Xn[3],Nr=P.useRef(er);er&&(Nr.current=!0);var tr=Object(P.useRef)(ye);tr.current=ye;var En=P.useCallback(function(cr){Dn.current=cr,Object(xt.b)(tr.current,cr)},[]),gn,Wn=Object(z.a)(Object(z.a)({},Tt),{},{visible:Ae});if(!Ge)gn=null;else if(Vn===Kt||!We(ie))er?gn=Ge(Object(z.a)({},Wn),En):!Be&&Nr.current?gn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{className:yt}),En):je?gn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{style:{display:"none"}}),En):gn=null;else{var ur,an;Fn===kn?an="prepare":jt(Fn)?an="active":Fn===Mr&&(an="start"),gn=Ge(Object(z.a)(Object(z.a)({},Wn),{},{className:G()(bn(et,Vn),(ur={},Object(ne.a)(ur,bn(et,"".concat(Vn,"-").concat(an)),an),Object(ne.a)(ur,et,typeof et=="string"),ur)),style:Zn}),En)}return P.createElement(Rr,{ref:$n},gn)});return Se.displayName="CSSMotion",Se}var fi=yi(nn),_t="add",sn="keep",Ii="remove",zi="removed";function na(Te){var Le;return Te&&Object(W.a)(Te)==="object"&&"key"in Te?Le=Te:Le={key:Te},Object(z.a)(Object(z.a)({},Le),{},{key:String(Le.key)})}function Vi(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Te.map(na)}function Z(){var Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],We=[],Se=0,ie=Le.length,ye=Vi(Te),le=Vi(Le);ye.forEach(function(Be){for(var je=!1,Ge=Se;Ge<ie;Ge+=1){var et=le[Ge];if(et.key===Be.key){Se<Ge&&(We=We.concat(le.slice(Se,Ge).map(function(yt){return Object(z.a)(Object(z.a)({},yt),{},{status:_t})})),Se=Ge),We.push(Object(z.a)(Object(z.a)({},et),{},{status:sn})),Se+=1,je=!0;break}}je||We.push(Object(z.a)(Object(z.a)({},Be),{},{status:Ii}))}),Se<ie&&(We=We.concat(le.slice(Se).map(function(Be){return Object(z.a)(Object(z.a)({},Be),{},{status:_t})})));var Ae={};We.forEach(function(Be){var je=Be.key;Ae[je]=(Ae[je]||0)+1});var _e=Object.keys(Ae).filter(function(Be){return Ae[Be]>1});return _e.forEach(function(Be){We=We.filter(function(je){var Ge=je.key,et=je.status;return Ge!==Be||et!==Ii}),We.forEach(function(je){je.key===Be&&(je.status=sn)})}),We}var L=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function k(Te){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fi,We=function(Se){Object(v.a)(ye,Se);var ie=Object(h.a)(ye);function ye(){var le;return Object(R.a)(this,ye),le=ie.apply(this,arguments),le.state={keyEntities:[]},le.removeKey=function(Ae){le.setState(function(_e){var Be=_e.keyEntities;return{keyEntities:Be.map(function(je){return je.key!==Ae?je:Object(z.a)(Object(z.a)({},je),{},{status:zi})})}})},le}return Object(O.a)(ye,[{key:"render",value:function(){var Ae=this,_e=this.state.keyEntities,Be=this.props,je=Be.component,Ge=Be.children,et=Be.onVisibleChanged,yt=Object(M.a)(Be,["component","children","onVisibleChanged"]),Tt=je||P.Fragment,Nt={};return L.forEach(function(Dn){Nt[Dn]=yt[Dn],delete yt[Dn]}),delete yt.keys,P.createElement(Tt,yt,_e.map(function(Dn){var $n=Dn.status,Bn=Object(M.a)(Dn,["status"]),zn=$n===_t||$n===sn;return P.createElement(Le,Object(S.a)({},Nt,{key:Bn.key,visible:zn,eventProps:Bn,onVisibleChanged:function(Vn){et==null||et(Vn,{key:Bn.key}),Vn||Ae.removeKey(Bn.key)}}),Ge)}))}}],[{key:"getDerivedStateFromProps",value:function(Ae,_e){var Be=Ae.keys,je=_e.keyEntities,Ge=Vi(Be),et=Z(je,Ge);return{keyEntities:et.filter(function(yt){var Tt=je.find(function(Nt){var Dn=Nt.key;return yt.key===Dn});return!(Tt&&Tt.status===zi&&yt.status===Ii)})}}}]),ye}(P.Component);return We.defaultProps={component:"div"},We}var V=k(nn),re=fi;function Q(Te){var Le=Te.prefixCls,We=Te.motion,Se=Te.animation,ie=Te.transitionName;return We||(Se?{motionName:"".concat(Le,"-").concat(Se)}:ie?{motionName:ie}:null)}function Pe(Te){var Le=Te.prefixCls,We=Te.visible,Se=Te.zIndex,ie=Te.mask,ye=Te.maskMotion,le=Te.maskAnimation,Ae=Te.maskTransitionName;if(!ie)return null;var _e={};return(ye||Ae||le)&&(_e=Object(z.a)({motionAppear:!0},Q({motion:ye,prefixCls:Le,transitionName:Ae,animation:le}))),P.createElement(re,Object(S.a)({},_e,{visible:We,removeOnLeave:!0}),function(Be){var je=Be.className;return P.createElement("div",{style:{zIndex:Se},className:G()("".concat(Le,"-mask"),je)})})}var pt=U("9mu1"),Lt=U("o0o1"),rn=U.n(Lt),vt=U("HaE+"),Vt=["measure","align",null,"motion"],fr=function(Te,Le){var We=Object(P.useState)(null),Se=Object(Y.a)(We,2),ie=Se[0],ye=Se[1],le=Object(P.useRef)(),Ae=Object(P.useRef)(!1);function _e(Ge){Ae.current||ye(Ge)}function Be(){at.a.cancel(le.current)}function je(Ge){Be(),le.current=Object(at.a)(function(){_e(function(et){switch(ie){case"align":return"motion";case"motion":return"stable";default:}return et}),Ge==null||Ge()})}return Object(P.useEffect)(function(){_e("measure")},[Te]),Object(P.useEffect)(function(){switch(ie){case"measure":Le();break;default:}ie&&(le.current=Object(at.a)(Object(vt.a)(rn.a.mark(function Ge(){var et,yt;return rn.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:et=Vt.indexOf(ie),yt=Vt[et+1],yt&&et!==-1&&_e(yt);case 3:case"end":return Nt.stop()}},Ge)}))))},[ie]),Object(P.useEffect)(function(){return function(){Ae.current=!0,Be()}},[]),[ie,je]},Lr=function(Te){var Le=P.useState({width:0,height:0}),We=Object(Y.a)(Le,2),Se=We[0],ie=We[1];function ye(Ae){ie({width:Ae.offsetWidth,height:Ae.offsetHeight})}var le=P.useMemo(function(){var Ae={};if(Te){var _e=Se.width,Be=Se.height;Te.indexOf("height")!==-1&&Be?Ae.height=Be:Te.indexOf("minHeight")!==-1&&Be&&(Ae.minHeight=Be),Te.indexOf("width")!==-1&&_e?Ae.width=_e:Te.indexOf("minWidth")!==-1&&_e&&(Ae.minWidth=_e)}return Ae},[Te,Se]);return[le,ye]},Zt=P.forwardRef(function(Te,Le){var We=Te.visible,Se=Te.prefixCls,ie=Te.className,ye=Te.style,le=Te.children,Ae=Te.zIndex,_e=Te.stretch,Be=Te.destroyPopupOnHide,je=Te.forceRender,Ge=Te.align,et=Te.point,yt=Te.getRootDomNode,Tt=Te.getClassNameFromAlign,Nt=Te.onAlign,Dn=Te.onMouseEnter,$n=Te.onMouseLeave,Bn=Te.onMouseDown,zn=Te.onTouchStart,Xn=Object(P.useRef)(),Vn=Object(P.useRef)(),Fn=Object(P.useState)(),Zn=Object(Y.a)(Fn,2),er=Zn[0],Nr=Zn[1],tr=Lr(_e),En=Object(Y.a)(tr,2),gn=En[0],Wn=En[1];function ur(){_e&&Wn(yt())}var an=fr(We,ur),cr=Object(Y.a)(an,2),Ur=cr[0],ir=cr[1],Ar=Object(P.useRef)();function Er(){return et||yt}function Gr(){var Ir;(Ir=Xn.current)===null||Ir===void 0||Ir.forceAlign()}function Yr(Ir,xr){var Cn=Tt(xr);er!==Cn&&Nr(Cn),Ur==="align"&&(er!==Cn?Promise.resolve().then(function(){Gr()}):ir(function(){var Tr;(Tr=Ar.current)===null||Tr===void 0||Tr.call(Ar)}),Nt==null||Nt(Ir,xr))}var Br=Object(z.a)({},Q(Te));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Ir){var xr=Br[Ir];Br[Ir]=function(Cn,Tr){return ir(),xr==null?void 0:xr(Cn,Tr)}});function _i(){return new Promise(function(Ir){Ar.current=Ir})}P.useEffect(function(){!Br.motionName&&Ur==="motion"&&ir()},[Br.motionName,Ur]),P.useImperativeHandle(Le,function(){return{forceAlign:Gr,getElement:function(){return Vn.current}}});var Pi=Object(z.a)(Object(z.a)({},gn),{},{zIndex:Ae,opacity:Ur==="motion"||Ur==="stable"||!We?void 0:0,pointerEvents:Ur==="stable"?void 0:"none"},ye),Si=!0;(Ge==null?void 0:Ge.points)&&(Ur==="align"||Ur==="stable")&&(Si=!1);var $r=le;return P.Children.count(le)>1&&($r=P.createElement("div",{className:"".concat(Se,"-content")},le)),P.createElement(re,Object(S.a)({visible:We,ref:Vn,leavedClassName:"".concat(Se,"-hidden")},Br,{onAppearPrepare:_i,onEnterPrepare:_i,removeOnLeave:Be,forceRender:je}),function(Ir,xr){var Cn=Ir.className,Tr=Ir.style,ji=G()(Se,ie,er,Cn);return P.createElement(pt.a,{target:Er(),key:"popup",ref:Xn,monitorWindowResize:!0,disabled:Si,align:Ge,onAlign:Yr},P.createElement("div",{ref:xr,className:ji,onMouseEnter:Dn,onMouseLeave:$n,onMouseDownCapture:Bn,onTouchStartCapture:zn,style:Object(z.a)(Object(z.a)({},Tr),Pi)},$r))})});Zt.displayName="PopupInner";var mt=Zt,Pt=P.forwardRef(function(Te,Le){var We=Te.prefixCls,Se=Te.visible,ie=Te.zIndex,ye=Te.children,le=Te.mobile;le=le===void 0?{}:le;var Ae=le.popupClassName,_e=le.popupStyle,Be=le.popupMotion,je=Be===void 0?{}:Be,Ge=le.popupRender,et=P.useRef();P.useImperativeHandle(Le,function(){return{forceAlign:function(){},getElement:function(){return et.current}}});var yt=Object(z.a)({zIndex:ie},_e),Tt=ye;return P.Children.count(ye)>1&&(Tt=P.createElement("div",{className:"".concat(We,"-content")},ye)),Ge&&(Tt=Ge(Tt)),P.createElement(re,Object(S.a)({visible:Se,ref:et,removeOnLeave:!0},je),function(Nt,Dn){var $n=Nt.className,Bn=Nt.style,zn=G()(We,Ae,$n);return P.createElement("div",{ref:Dn,className:zn,style:Object(z.a)(Object(z.a)({},Bn),yt)},Tt)})});Pt.displayName="MobilePopupInner";var Rt=Pt,Gt=["visible","mobile"],cn=P.forwardRef(function(Te,Le){var We=Te.visible,Se=Te.mobile,ie=Object(M.a)(Te,Gt),ye=Object(P.useState)(We),le=Object(Y.a)(ye,2),Ae=le[0],_e=le[1],Be=Object(P.useState)(!1),je=Object(Y.a)(Be,2),Ge=je[0],et=je[1],yt=Object(z.a)(Object(z.a)({},ie),{},{visible:Ae});Object(P.useEffect)(function(){_e(We),We&&Se&&et(be())},[We,Se]);var Tt=Ge?P.createElement(Rt,Object(S.a)({},yt,{mobile:Se,ref:Le})):P.createElement(mt,Object(S.a)({},yt,{ref:Le}));return P.createElement("div",null,P.createElement(Pe,yt),Tt)});cn.displayName="Popup";var Tn=cn,Sn=P.createContext(null),mn=Sn;function In(){}function Kn(){return""}function hn(Te){return Te?Te.ownerDocument:window.document}var An=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function dr(Te){var Le=function(We){Object(v.a)(ie,We);var Se=Object(h.a)(ie);function ie(ye){var le;Object(R.a)(this,ie),le=Se.call(this,ye),le.popupRef=P.createRef(),le.triggerRef=P.createRef(),le.attachId=void 0,le.clickOutsideHandler=void 0,le.touchOutsideHandler=void 0,le.contextMenuOutsideHandler1=void 0,le.contextMenuOutsideHandler2=void 0,le.mouseDownTimeout=void 0,le.focusTime=void 0,le.preClickTime=void 0,le.preTouchTime=void 0,le.delayTimer=void 0,le.hasPopupMouseDown=void 0,le.onMouseEnter=function(_e){var Be=le.props.mouseEnterDelay;le.fireEvents("onMouseEnter",_e),le.delaySetPopupVisible(!0,Be,Be?null:_e)},le.onMouseMove=function(_e){le.fireEvents("onMouseMove",_e),le.setPoint(_e)},le.onMouseLeave=function(_e){le.fireEvents("onMouseLeave",_e),le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onPopupMouseEnter=function(){le.clearDelayTimer()},le.onPopupMouseLeave=function(_e){var Be;if(_e.relatedTarget&&!_e.relatedTarget.setTimeout&&Object(bt.a)((Be=le.popupRef.current)===null||Be===void 0?void 0:Be.getElement(),_e.relatedTarget))return;le.delaySetPopupVisible(!1,le.props.mouseLeaveDelay)},le.onFocus=function(_e){le.fireEvents("onFocus",_e),le.clearDelayTimer(),le.isFocusToShow()&&(le.focusTime=Date.now(),le.delaySetPopupVisible(!0,le.props.focusDelay))},le.onMouseDown=function(_e){le.fireEvents("onMouseDown",_e),le.preClickTime=Date.now()},le.onTouchStart=function(_e){le.fireEvents("onTouchStart",_e),le.preTouchTime=Date.now()},le.onBlur=function(_e){le.fireEvents("onBlur",_e),le.clearDelayTimer(),le.isBlurToHide()&&le.delaySetPopupVisible(!1,le.props.blurDelay)},le.onContextMenu=function(_e){_e.preventDefault(),le.fireEvents("onContextMenu",_e),le.setPopupVisible(!0,_e)},le.onContextMenuClose=function(){le.isContextMenuToShow()&&le.close()},le.onClick=function(_e){if(le.fireEvents("onClick",_e),le.focusTime){var Be;if(le.preClickTime&&le.preTouchTime?Be=Math.min(le.preClickTime,le.preTouchTime):le.preClickTime?Be=le.preClickTime:le.preTouchTime&&(Be=le.preTouchTime),Math.abs(Be-le.focusTime)<20)return;le.focusTime=0}le.preClickTime=0,le.preTouchTime=0,le.isClickToShow()&&(le.isClickToHide()||le.isBlurToHide())&&_e&&_e.preventDefault&&_e.preventDefault();var je=!le.state.popupVisible;(le.isClickToHide()&&!je||je&&le.isClickToShow())&&le.setPopupVisible(!le.state.popupVisible,_e)},le.onPopupMouseDown=function(){if(le.hasPopupMouseDown=!0,clearTimeout(le.mouseDownTimeout),le.mouseDownTimeout=window.setTimeout(function(){le.hasPopupMouseDown=!1},0),le.context){var _e;(_e=le.context).onPopupMouseDown.apply(_e,arguments)}},le.onDocumentClick=function(_e){if(le.props.mask&&!le.props.maskClosable)return;var Be=_e.target,je=le.getRootDomNode(),Ge=le.getPopupDomNode();(!Object(bt.a)(je,Be)||le.isContextMenuOnly())&&!Object(bt.a)(Ge,Be)&&!le.hasPopupMouseDown&&le.close()},le.getRootDomNode=function(){var _e=le.props.getTriggerDOMNode;if(_e)return _e(le.triggerRef.current);try{var Be=Object(gt.a)(le.triggerRef.current);if(Be)return Be}catch(je){}return dt.a.findDOMNode(Object(m.a)(le))},le.getPopupClassNameFromAlign=function(_e){var Be=[],je=le.props,Ge=je.popupPlacement,et=je.builtinPlacements,yt=je.prefixCls,Tt=je.alignPoint,Nt=je.getPopupClassNameFromAlign;return Ge&&et&&Be.push(ft(et,yt,_e,Tt)),Nt&&Be.push(Nt(_e)),Be.join(" ")},le.getComponent=function(){var _e=le.props,Be=_e.prefixCls,je=_e.destroyPopupOnHide,Ge=_e.popupClassName,et=_e.onPopupAlign,yt=_e.popupMotion,Tt=_e.popupAnimation,Nt=_e.popupTransitionName,Dn=_e.popupStyle,$n=_e.mask,Bn=_e.maskAnimation,zn=_e.maskTransitionName,Xn=_e.maskMotion,Vn=_e.zIndex,Fn=_e.popup,Zn=_e.stretch,er=_e.alignPoint,Nr=_e.mobile,tr=_e.forceRender,En=le.state,gn=En.popupVisible,Wn=En.point,ur=le.getPopupAlign(),an={};return le.isMouseEnterToShow()&&(an.onMouseEnter=le.onPopupMouseEnter),le.isMouseLeaveToHide()&&(an.onMouseLeave=le.onPopupMouseLeave),an.onMouseDown=le.onPopupMouseDown,an.onTouchStart=le.onPopupMouseDown,P.createElement(Tn,Object(S.a)({prefixCls:Be,destroyPopupOnHide:je,visible:gn,point:er&&Wn,className:Ge,align:ur,onAlign:et,animation:Tt,getClassNameFromAlign:le.getPopupClassNameFromAlign},an,{stretch:Zn,getRootDomNode:le.getRootDomNode,style:Dn,mask:$n,zIndex:Vn,transitionName:Nt,maskAnimation:Bn,maskTransitionName:zn,maskMotion:Xn,ref:le.popupRef,motion:yt,mobile:Nr,forceRender:tr}),typeof Fn=="function"?Fn():Fn)},le.attachParent=function(_e){at.a.cancel(le.attachId);var Be=le.props,je=Be.getPopupContainer,Ge=Be.getDocument,et=le.getRootDomNode(),yt;je?(et||je.length===0)&&(yt=je(et)):yt=Ge(le.getRootDomNode()).body,yt?yt.appendChild(_e):le.attachId=Object(at.a)(function(){le.attachParent(_e)})},le.getContainer=function(){var _e=le.props.getDocument,Be=_e(le.getRootDomNode()).createElement("div");return Be.style.position="absolute",Be.style.top="0",Be.style.left="0",Be.style.width="100%",le.attachParent(Be),Be},le.setPoint=function(_e){var Be=le.props.alignPoint;if(!Be||!_e)return;le.setState({point:{pageX:_e.pageX,pageY:_e.pageY}})},le.handlePortalUpdate=function(){le.state.prevPopupVisible!==le.state.popupVisible&&le.props.afterPopupVisibleChange(le.state.popupVisible)},le.triggerContextValue={onPopupMouseDown:le.onPopupMouseDown};var Ae;return"popupVisible"in ye?Ae=!!ye.popupVisible:Ae=!!ye.defaultPopupVisible,le.state={prevPopupVisible:Ae,popupVisible:Ae},An.forEach(function(_e){le["fire".concat(_e)]=function(Be){le.fireEvents(_e,Be)}}),le}return Object(O.a)(ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this.props,Ae=this.state;if(Ae.popupVisible){var _e;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(_e=le.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Je.a)(_e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(_e=_e||le.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Je.a)(_e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(_e=_e||le.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Je.a)(_e,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Je.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),at.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var le;return((le=this.popupRef.current)===null||le===void 0?void 0:le.getElement())||null}},{key:"getPopupAlign",value:function(){var le=this.props,Ae=le.popupPlacement,_e=le.popupAlign,Be=le.builtinPlacements;return Ae&&Be?tt(Be,Ae,_e):_e}},{key:"setPopupVisible",value:function(le,Ae){var _e=this.props.alignPoint,Be=this.state.popupVisible;this.clearDelayTimer(),Be!==le&&("popupVisible"in this.props||this.setState({popupVisible:le,prevPopupVisible:Be}),this.props.onPopupVisibleChange(le)),_e&&Ae&&le&&this.setPoint(Ae)}},{key:"delaySetPopupVisible",value:function(le,Ae,_e){var Be=this,je=Ae*1e3;if(this.clearDelayTimer(),je){var Ge=_e?{pageX:_e.pageX,pageY:_e.pageY}:null;this.delayTimer=window.setTimeout(function(){Be.setPopupVisible(le,Ge),Be.clearDelayTimer()},je)}else this.setPopupVisible(le,_e)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(le){var Ae=this.props.children.props,_e=this.props;return Ae[le]&&_e[le]?this["fire".concat(le)]:Ae[le]||_e[le]}},{key:"isClickToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("click")!==-1||_e.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var le=this.props.action;return le==="contextMenu"||le.length===1&&le[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("contextMenu")!==-1||_e.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var le=this.props,Ae=le.action,_e=le.hideAction;return Ae.indexOf("click")!==-1||_e.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("hover")!==-1||_e.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var le=this.props,Ae=le.action,_e=le.hideAction;return Ae.indexOf("hover")!==-1||_e.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var le=this.props,Ae=le.action,_e=le.showAction;return Ae.indexOf("focus")!==-1||_e.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var le=this.props,Ae=le.action,_e=le.hideAction;return Ae.indexOf("focus")!==-1||_e.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var le;(le=this.popupRef.current)===null||le===void 0||le.forceAlign()}}},{key:"fireEvents",value:function(le,Ae){var _e=this.props.children.props[le];_e&&_e(Ae);var Be=this.props[le];Be&&Be(Ae)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var le=this.state.popupVisible,Ae=this.props,_e=Ae.children,Be=Ae.forceRender,je=Ae.alignPoint,Ge=Ae.className,et=Ae.autoDestroy,yt=P.Children.only(_e),Tt={key:"trigger"};this.isContextMenuToShow()?Tt.onContextMenu=this.onContextMenu:Tt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Tt.onClick=this.onClick,Tt.onMouseDown=this.onMouseDown,Tt.onTouchStart=this.onTouchStart):(Tt.onClick=this.createTwoChains("onClick"),Tt.onMouseDown=this.createTwoChains("onMouseDown"),Tt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Tt.onMouseEnter=this.onMouseEnter,je&&(Tt.onMouseMove=this.onMouseMove)):Tt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Tt.onMouseLeave=this.onMouseLeave:Tt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Tt.onFocus=this.onFocus,Tt.onBlur=this.onBlur):(Tt.onFocus=this.createTwoChains("onFocus"),Tt.onBlur=this.createTwoChains("onBlur"));var Nt=G()(yt&&yt.props&&yt.props.className,Ge);Nt&&(Tt.className=Nt);var Dn=Object(z.a)({},Tt);Object(xt.c)(yt)&&(Dn.ref=Object(xt.a)(this.triggerRef,yt.ref));var $n=P.cloneElement(yt,Dn),Bn;return(le||this.popupRef.current||Be)&&(Bn=P.createElement(Te,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!le&&et&&(Bn=null),P.createElement(mn.Provider,{value:this.triggerContextValue},$n,Bn)}}],[{key:"getDerivedStateFromProps",value:function(le,Ae){var _e=le.popupVisible,Be={};return _e!==void 0&&Ae.popupVisible!==_e&&(Be.popupVisible=_e,Be.prevPopupVisible=Ae.popupVisible),Be}}]),ie}(P.Component);return Le.contextType=mn,Le.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Kn,getDocument:hn,onPopupVisibleChange:In,afterPopupVisibleChange:In,onPopupAlign:In,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Le}var Nn=dr(kt.a),zt={adjustX:1,adjustY:1},On={topLeft:{points:["bl","tl"],overflow:zt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:zt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:zt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:zt,offset:[4,0]}},sr={topLeft:{points:["bl","tl"],overflow:zt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:zt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:zt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:zt,offset:[4,0]}},Un=On,Xt=0,Bt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},yn=function(Le,We,Se){var ie=Fe(We),ye=Le.getState();Le.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},ye.defaultActiveFirst),{},Object(ne.a)({},ie,Se))})},Ct=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(Se){var ie;Object(R.a)(this,We),ie=Le.call(this,Se),ie.onDestroy=function(je){ie.props.onDestroy(je)},ie.onKeyDown=function(je){var Ge=je.keyCode,et=ie.menuInstance,yt=ie.props.store,Tt=ie.getVisible();if(Ge===p.a.ENTER)return ie.onTitleClick(je),yn(yt,ie.props.eventKey,!0),!0;if(Ge===p.a.RIGHT)return Tt?et.onKeyDown(je):(ie.triggerOpenChange(!0),yn(yt,ie.props.eventKey,!0)),!0;if(Ge===p.a.LEFT){var Nt;if(Tt)Nt=et.onKeyDown(je);else return;return Nt||(ie.triggerOpenChange(!1),Nt=!0),Nt}return Tt&&(Ge===p.a.UP||Ge===p.a.DOWN)?et.onKeyDown(je):void 0},ie.onOpenChange=function(je){ie.props.onOpenChange(je)},ie.onPopupVisibleChange=function(je){ie.triggerOpenChange(je,je?"mouseenter":"mouseleave")},ie.onMouseEnter=function(je){var Ge=ie.props,et=Ge.eventKey,yt=Ge.onMouseEnter,Tt=Ge.store;yn(Tt,ie.props.eventKey,!1),yt({key:et,domEvent:je})},ie.onMouseLeave=function(je){var Ge=ie.props,et=Ge.parentMenu,yt=Ge.eventKey,Tt=Ge.onMouseLeave;et.subMenuInstance=Object(m.a)(ie),Tt({key:yt,domEvent:je})},ie.onTitleMouseEnter=function(je){var Ge=ie.props,et=Ge.eventKey,yt=Ge.onItemHover,Tt=Ge.onTitleMouseEnter;yt({key:et,hover:!0}),Tt({key:et,domEvent:je})},ie.onTitleMouseLeave=function(je){var Ge=ie.props,et=Ge.parentMenu,yt=Ge.eventKey,Tt=Ge.onItemHover,Nt=Ge.onTitleMouseLeave;et.subMenuInstance=Object(m.a)(ie),Tt({key:yt,hover:!1}),Nt({key:yt,domEvent:je})},ie.onTitleClick=function(je){var Ge=Object(m.a)(ie),et=Ge.props;if(et.onTitleClick({key:et.eventKey,domEvent:je}),et.triggerSubMenuAction==="hover")return;ie.triggerOpenChange(!ie.getVisible(),"click"),yn(et.store,ie.props.eventKey,!1)},ie.onSubMenuClick=function(je){typeof ie.props.onClick=="function"&&ie.props.onClick(ie.addKeyPath(je))},ie.onSelect=function(je){ie.props.onSelect(je)},ie.onDeselect=function(je){ie.props.onDeselect(je)},ie.getPrefixCls=function(){return"".concat(ie.props.rootPrefixCls,"-submenu")},ie.getActiveClassName=function(){return"".concat(ie.getPrefixCls(),"-active")},ie.getDisabledClassName=function(){return"".concat(ie.getPrefixCls(),"-disabled")},ie.getSelectedClassName=function(){return"".concat(ie.getPrefixCls(),"-selected")},ie.getOpenClassName=function(){return"".concat(ie.props.rootPrefixCls,"-submenu-open")},ie.getVisible=function(){return ie.state.isOpen},ie.getMode=function(){return ie.state.mode},ie.saveMenuInstance=function(je){ie.menuInstance=je},ie.addKeyPath=function(je){return Object(z.a)(Object(z.a)({},je),{},{keyPath:(je.keyPath||[]).concat(ie.props.eventKey)})},ie.triggerOpenChange=function(je,Ge){var et=ie.props.eventKey,yt=function(){ie.onOpenChange({key:et,item:Object(m.a)(ie),trigger:Ge,open:je})};Ge==="mouseenter"?ie.mouseenterTimeout=setTimeout(function(){yt()},0):yt()},ie.isChildrenSelected=function(){var je={find:!1};return nt(ie.props.children,ie.props.selectedKeys,je),je.find},ie.isInlineMode=function(){return ie.getMode()==="inline"},ie.adjustWidth=function(){if(!ie.subMenuTitle||!ie.menuInstance)return;var je=st.findDOMNode(ie.menuInstance);if(je.offsetWidth>=ie.subMenuTitle.offsetWidth)return;je.style.minWidth="".concat(ie.subMenuTitle.offsetWidth,"px")},ie.saveSubMenuTitle=function(je){ie.subMenuTitle=je},ie.getBaseProps=function(){var je=Object(m.a)(ie),Ge=je.props,et=ie.getMode();return{mode:et==="horizontal"?"vertical":et,visible:ie.getVisible(),level:Ge.level+1,inlineIndent:Ge.inlineIndent,focusable:!1,onClick:ie.onSubMenuClick,onSelect:ie.onSelect,onDeselect:ie.onDeselect,onDestroy:ie.onDestroy,selectedKeys:Ge.selectedKeys,eventKey:"".concat(Ge.eventKey,"-menu-"),openKeys:Ge.openKeys,motion:Ge.motion,onOpenChange:ie.onOpenChange,subMenuOpenDelay:Ge.subMenuOpenDelay,parentMenu:Object(m.a)(ie),subMenuCloseDelay:Ge.subMenuCloseDelay,forceSubMenuRender:Ge.forceSubMenuRender,triggerSubMenuAction:Ge.triggerSubMenuAction,builtinPlacements:Ge.builtinPlacements,defaultActiveFirst:Ge.store.getState().defaultActiveFirst[Fe(Ge.eventKey)],multiple:Ge.multiple,prefixCls:Ge.rootPrefixCls,id:ie.internalMenuId,manualRef:ie.saveMenuInstance,itemIcon:Ge.itemIcon,expandIcon:Ge.expandIcon,direction:Ge.direction}},ie.getMotion=function(je,Ge){var et=Object(m.a)(ie),yt=et.haveRendered,Tt=ie.props,Nt=Tt.motion,Dn=Tt.rootPrefixCls,$n=Object(z.a)(Object(z.a)({},Nt),{},{leavedClassName:"".concat(Dn,"-hidden"),removeOnLeave:!1,motionAppear:yt||!Ge||je!=="inline"});return $n};var ye=Se.store,le=Se.eventKey,Ae=ye.getState(),_e=Ae.defaultActiveFirst;ie.isRootMenu=!1;var Be=!1;return _e&&(Be=_e[le]),yn(ye,le,Be),ie.state={mode:Se.mode,isOpen:Se.isOpen},ie}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var ie=this,ye=this.props,le=ye.mode,Ae=ye.parentMenu,_e=ye.manualRef,Be=ye.isOpen,je=function(){ie.setState({mode:le,isOpen:Be})},Ge=Be!==this.state.isOpen,et=le!==this.state.mode;if((et||Ge)&&(at.a.cancel(this.updateStateRaf),et?this.updateStateRaf=Object(at.a)(je):je()),_e&&_e(this),le!=="horizontal"||!(Ae==null?void 0:Ae.isRootMenu)||!Be)return;this.minWidthTimeout=setTimeout(function(){return ie.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var ie=this.props,ye=ie.onDestroy,le=ie.eventKey;ye&&ye(le),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),at.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(ie,ye){var le=this.getBaseProps();return P.createElement(lr,Object(S.a)({},le,{id:this.internalMenuId,className:ie,style:ye}),this.props.children)}},{key:"renderChildren",value:function(){var ie=this,ye=this.getBaseProps(),le=ye.mode,Ae=ye.visible,_e=ye.forceSubMenuRender,Be=ye.direction,je=this.getMotion(le,Ae);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ae||_e,!this.haveOpened)return P.createElement("div",null);var Ge=G()("".concat(ye.prefixCls,"-sub"),Object(ne.a)({},"".concat(ye.prefixCls,"-rtl"),Be==="rtl"));return this.isInlineMode()?P.createElement(re,Object(S.a)({visible:ye.visible,forceRender:_e},je),function(et){var yt=et.className,Tt=et.style,Nt=G()(Ge,yt);return ie.renderPopupMenu(Nt,Tt)}):this.renderPopupMenu(Ge)}},{key:"render",value:function(){var ie,ye,le,Ae=Object(z.a)({},this.props),_e=this.getVisible(),Be=this.getPrefixCls(),je=this.isInlineMode(),Ge=this.getMode(),et=G()(Be,"".concat(Be,"-").concat(Ge),(ie={},Object(ne.a)(ie,Ae.className,!!Ae.className),Object(ne.a)(ie,this.getOpenClassName(),_e),Object(ne.a)(ie,this.getActiveClassName(),Ae.active||_e&&!je),Object(ne.a)(ie,this.getDisabledClassName(),Ae.disabled),Object(ne.a)(ie,this.getSelectedClassName(),this.isChildrenSelected()),ie));this.internalMenuId||(Ae.eventKey?this.internalMenuId="".concat(Ae.eventKey,"$Menu"):(Xt+=1,this.internalMenuId="$__$".concat(Xt,"$Menu")));var yt={},Tt={},Nt={};Ae.disabled||(yt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Tt={onClick:this.onTitleClick},Nt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Dn={},$n=Ae.direction,Bn=$n==="rtl";je&&(Bn?Dn.paddingRight=Ae.inlineIndent*Ae.level:Dn.paddingLeft=Ae.inlineIndent*Ae.level);var zn={};this.getVisible()&&(zn={"aria-owns":this.internalMenuId});var Xn=null;Ge!=="horizontal"&&(Xn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Xn=P.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var Vn=P.createElement("div",Object(S.a)({ref:this.saveSubMenuTitle,style:Dn,className:"".concat(Be,"-title"),role:"button"},Nt,Tt,{"aria-expanded":_e},zn,{"aria-haspopup":"true",title:typeof Ae.title=="string"?Ae.title:void 0}),Ae.title,Xn||P.createElement("i",{className:"".concat(Be,"-arrow")})),Fn=this.renderChildren(),Zn=((ye=Ae.parentMenu)===null||ye===void 0?void 0:ye.isRootMenu)?Ae.parentMenu.props.getPopupContainer:function(Er){return Er.parentNode},er=Bt[Ge],Nr=Ae.popupOffset?{offset:Ae.popupOffset}:{},tr=G()((le={},Object(ne.a)(le,Ae.popupClassName,Ae.popupClassName&&!je),Object(ne.a)(le,"".concat(Be,"-rtl"),Bn),le)),En=Ae.disabled,gn=Ae.triggerSubMenuAction,Wn=Ae.subMenuOpenDelay,ur=Ae.forceSubMenuRender,an=Ae.subMenuCloseDelay,cr=Ae.builtinPlacements;he.forEach(function(Er){return delete Ae[Er]}),delete Ae.onClick;var Ur=Bn?Object(z.a)(Object(z.a)({},sr),cr):Object(z.a)(Object(z.a)({},On),cr);delete Ae.direction;var ir=this.getBaseProps(),Ar=je?null:this.getMotion(ir.mode,ir.visible);return P.createElement("li",Object(S.a)({},Ae,yt,{className:et,role:"menuitem"}),P.createElement(Nn,{prefixCls:Be,popupClassName:G()("".concat(Be,"-popup"),tr),getPopupContainer:Zn,builtinPlacements:Ur,popupPlacement:er,popupVisible:je?!1:_e,popupAlign:Nr,popup:je?null:Fn,action:En||je?[]:[gn],mouseEnterDelay:Wn,mouseLeaveDelay:an,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ur,popupMotion:Ar},Vn),je?Fn:null)}}]),We}(P.Component);Ct.defaultProps={onMouseEnter:He,onMouseLeave:He,onTitleMouseEnter:He,onTitleMouseLeave:He,onTitleClick:He,manualRef:He,mode:"vertical",title:""};var Mt=Object(d.b)(function(Te,Le){var We=Te.openKeys,Se=Te.activeKey,ie=Te.selectedKeys,ye=Le.eventKey,le=Le.subMenuKey;return{isOpen:We.indexOf(ye)>-1,active:Se[le]===ye,selectedKeys:ie}})(Ct);Mt.isSubMenu=!0;var Dt=Mt,Me="menuitem-overflowed",Yt=.5,wn=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(){var Se;return Object(R.a)(this,We),Se=Le.apply(this,arguments),Se.resizeObserver=null,Se.mutationObserver=null,Se.originalTotalWidth=0,Se.overflowedItems=[],Se.menuItemSizes=[],Se.cancelFrameId=null,Se.state={lastVisibleIndex:void 0},Se.childRef=P.createRef(),Se.getMenuItemNodes=function(){var ie=Se.props.prefixCls,ye=Se.childRef.current;return ye?[].slice.call(ye.children).filter(function(le){return le.className.split(" ").indexOf("".concat(ie,"-overflowed-submenu"))<0}):[]},Se.getOverflowedSubMenuItem=function(ie,ye,le){var Ae=Se.props,_e=Ae.overflowedIndicator,Be=Ae.level,je=Ae.mode,Ge=Ae.prefixCls,et=Ae.theme;if(Be!==1||je!=="horizontal")return null;var yt=Se.props.children[0],Tt=yt.props,Nt=Tt.children,Dn=Tt.title,$n=Tt.style,Bn=Object(M.a)(Tt,["children","title","style"]),zn=Object(z.a)({},$n),Xn="".concat(ie,"-overflowed-indicator"),Vn="".concat(ie,"-overflowed-indicator");ye.length===0&&le!==!0?zn=Object(z.a)(Object(z.a)({},zn),{},{display:"none"}):le&&(zn=Object(z.a)(Object(z.a)({},zn),{},{visibility:"hidden",position:"absolute"}),Xn="".concat(Xn,"-placeholder"),Vn="".concat(Vn,"-placeholder"));var Fn=et?"".concat(Ge,"-").concat(et):"",Zn={};return he.forEach(function(er){Bn[er]!==void 0&&(Zn[er]=Bn[er])}),P.createElement(Dt,Object(S.a)({title:_e,className:"".concat(Ge,"-overflowed-submenu"),popupClassName:Fn},Zn,{key:Xn,eventKey:Vn,disabled:!1,style:zn}),ye)},Se.setChildrenWidthAndResize=function(){if(Se.props.mode!=="horizontal")return;var ie=Se.childRef.current;if(!ie)return;var ye=ie.children;if(!ye||ye.length===0)return;var le=ie.children[ye.length-1];Ne(le,"display","inline-block");var Ae=Se.getMenuItemNodes(),_e=Ae.filter(function(Be){return Be.className.split(" ").indexOf(Me)>=0});_e.forEach(function(Be){Ne(Be,"display","inline-block")}),Se.menuItemSizes=Ae.map(function(Be){return Re(Be,!0)}),_e.forEach(function(Be){Ne(Be,"display","none")}),Se.overflowedIndicatorWidth=Re(ie.children[ie.children.length-1],!0),Se.originalTotalWidth=Se.menuItemSizes.reduce(function(Be,je){return Be+je},0),Se.handleResize(),Ne(le,"display","none")},Se.handleResize=function(){if(Se.props.mode!=="horizontal")return;var ie=Se.childRef.current;if(!ie)return;var ye=Re(ie);Se.overflowedItems=[];var le=0,Ae;Se.originalTotalWidth>ye+Yt&&(Ae=-1,Se.menuItemSizes.forEach(function(_e){le+=_e,le+Se.overflowedIndicatorWidth<=ye&&(Ae+=1)})),Se.setState({lastVisibleIndex:Ae})},Se}return Object(O.a)(We,[{key:"componentDidMount",value:function(){var ie=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ye=this.childRef.current;if(!ye)return;this.resizeObserver=new rt.default(function(le){le.forEach(function(){var Ae=ie.cancelFrameId;cancelAnimationFrame(Ae),ie.cancelFrameId=requestAnimationFrame(ie.setChildrenWidthAndResize)})}),[].slice.call(ye.children).concat(ye).forEach(function(le){ie.resizeObserver.observe(le)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){ie.resizeObserver.disconnect(),[].slice.call(ye.children).concat(ye).forEach(function(le){ie.resizeObserver.observe(le)}),ie.setChildrenWidthAndResize()}),this.mutationObserver.observe(ye,{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(ie){var ye=this,le=this.state.lastVisibleIndex;return(ie||[]).reduce(function(Ae,_e,Be){var je=_e;if(ye.props.mode==="horizontal"){var Ge=ye.getOverflowedSubMenuItem(_e.props.eventKey,[]);le!==void 0&&ye.props.className.indexOf("".concat(ye.props.prefixCls,"-root"))!==-1&&(Be>le&&(je=P.cloneElement(_e,{style:{display:"none"},eventKey:"".concat(_e.props.eventKey,"-hidden"),className:"".concat(Me)})),Be===le+1&&(ye.overflowedItems=ie.slice(le+1).map(function(yt){return P.cloneElement(yt,{key:yt.props.eventKey,mode:"vertical-left"})}),Ge=ye.getOverflowedSubMenuItem(_e.props.eventKey,ye.overflowedItems)));var et=[].concat(Object(I.a)(Ae),[Ge,je]);return Be===ie.length-1&&et.push(ye.getOverflowedSubMenuItem(_e.props.eventKey,[],!0)),et}return[].concat(Object(I.a)(Ae),[je])},[])}},{key:"render",value:function(){var ie=this.props,ye=ie.visible,le=ie.prefixCls,Ae=ie.overflowedIndicator,_e=ie.mode,Be=ie.level,je=ie.tag,Ge=ie.children,et=ie.theme,yt=Object(M.a)(ie,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Tt=je;return P.createElement(Tt,Object(S.a)({ref:this.childRef},yt),this.renderChildren(Ge))}}]),We}(P.Component);wn.defaultProps={tag:"div",className:""};var mr=wn;function Rn(Te){return Te.length?Te.every(function(Le){return!!Le.props.disabled}):!0}function ii(Te,Le,We){var Se=Te.getState();Te.setState({activeKey:Object(z.a)(Object(z.a)({},Se.activeKey),{},Object(ne.a)({},Le,We))})}function ai(Te){return Te.eventKey||"0-menu-"}function Hr(Te,Le){var We=Le,Se=Te.children,ie=Te.eventKey;if(We){var ye;if(Ke(Se,function(le,Ae){le&&le.props&&!le.props.disabled&&We===Ve(le,ie,Ae)&&(ye=!0)}),ye)return We}return We=null,Te.defaultActiveFirst&&Ke(Se,function(le,Ae){!We&&le&&!le.props.disabled&&(We=Ve(le,ie,Ae))}),We}function jn(Te){if(!Te)return;var Le=this.instanceArray.indexOf(Te);Le!==-1?this.instanceArray[Le]=Te:this.instanceArray.push(Te)}var Ft=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(Se){var ie;return Object(R.a)(this,We),ie=Le.call(this,Se),ie.onKeyDown=function(ye,le){var Ae=ye.keyCode,_e;if(ie.getFlatInstanceArray().forEach(function(je){je&&je.props.active&&je.onKeyDown&&(_e=je.onKeyDown(ye))}),_e)return 1;var Be=null;return(Ae===p.a.UP||Ae===p.a.DOWN)&&(Be=ie.step(Ae===p.a.UP?-1:1)),Be?(ye.preventDefault(),ii(ie.props.store,ai(ie.props),Be.props.eventKey),typeof le=="function"&&le(Be),1):void 0},ie.onItemHover=function(ye){var le=ye.key,Ae=ye.hover;ii(ie.props.store,ai(ie.props),Ae?le:null)},ie.onDeselect=function(ye){ie.props.onDeselect(ye)},ie.onSelect=function(ye){ie.props.onSelect(ye)},ie.onClick=function(ye){ie.props.onClick(ye)},ie.onOpenChange=function(ye){ie.props.onOpenChange(ye)},ie.onDestroy=function(ye){ie.props.onDestroy(ye)},ie.getFlatInstanceArray=function(){return ie.instanceArray},ie.step=function(ye){var le=ie.getFlatInstanceArray(),Ae=ie.props.store.getState().activeKey[ai(ie.props)],_e=le.length;if(!_e)return null;ye<0&&(le=le.concat().reverse());var Be=-1;if(le.every(function(yt,Tt){return yt&&yt.props.eventKey===Ae?(Be=Tt,!1):!0}),!ie.props.defaultActiveFirst&&Be!==-1&&Rn(le.slice(Be,_e-1)))return;var je=(Be+1)%_e,Ge=je;do{var et=le[Ge];if(!et||et.props.disabled)Ge=(Ge+1)%_e;else return et}while(Ge!==je);return null},ie.renderCommonMenuItem=function(ye,le,Ae){var _e=ie.props.store.getState(),Be=Object(m.a)(ie),je=Be.props,Ge=Ve(ye,je.eventKey,le),et=ye.props;if(!et||typeof ye.type=="string")return ye;var yt=Ge===_e.activeKey,Tt=Object(z.a)(Object(z.a)({mode:et.mode||je.mode,level:je.level,inlineIndent:je.inlineIndent,renderMenuItem:ie.renderMenuItem,rootPrefixCls:je.prefixCls,index:le,parentMenu:je.parentMenu,manualRef:et.disabled?void 0:Object(E.a)(ye.ref,jn.bind(Object(m.a)(ie))),eventKey:Ge,active:!et.disabled&&yt,multiple:je.multiple,onClick:function(Dn){(et.onClick||He)(Dn),ie.onClick(Dn)},onItemHover:ie.onItemHover,motion:je.motion,subMenuOpenDelay:je.subMenuOpenDelay,subMenuCloseDelay:je.subMenuCloseDelay,forceSubMenuRender:je.forceSubMenuRender,onOpenChange:ie.onOpenChange,onDeselect:ie.onDeselect,onSelect:ie.onSelect,builtinPlacements:je.builtinPlacements,itemIcon:et.itemIcon||ie.props.itemIcon,expandIcon:et.expandIcon||ie.props.expandIcon},Ae),{},{direction:je.direction});return(je.mode==="inline"||Ue())&&(Tt.triggerSubMenuAction="click"),P.cloneElement(ye,Object(z.a)(Object(z.a)({},Tt),{},{key:Ge||le}))},ie.renderMenuItem=function(ye,le,Ae){if(!ye)return null;var _e=ie.props.store.getState(),Be={openKeys:_e.openKeys,selectedKeys:_e.selectedKeys,triggerSubMenuAction:ie.props.triggerSubMenuAction,subMenuKey:Ae};return ie.renderCommonMenuItem(ye,le,Be)},Se.store.setState({activeKey:Object(z.a)(Object(z.a)({},Se.store.getState().activeKey),{},Object(ne.a)({},Se.eventKey,Hr(Se,Se.activeKey)))}),ie.instanceArray=[],ie}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(ie){return this.props.visible||ie.visible||this.props.className!==ie.className||!j()(this.props.style,ie.style)}},{key:"componentDidUpdate",value:function(ie){var ye=this.props,le="activeKey"in ye?ye.activeKey:ye.store.getState().activeKey[ai(ye)],Ae=Hr(ye,le);if(Ae!==le)ii(ye.store,ai(ye),Ae);else if("activeKey"in ie){var _e=Hr(ie,ie.activeKey);Ae!==_e&&ii(ye.store,ai(ye),Ae)}}},{key:"render",value:function(){var ie=this,ye=Object(S.a)({},this.props);this.instanceArray=[];var le=G()(ye.prefixCls,ye.className,"".concat(ye.prefixCls,"-").concat(ye.mode)),Ae={className:le,role:ye.role||"menu"};ye.id&&(Ae.id=ye.id),ye.focusable&&(Ae.tabIndex=0,Ae.onKeyDown=this.onKeyDown);var _e=ye.prefixCls,Be=ye.eventKey,je=ye.visible,Ge=ye.level,et=ye.mode,yt=ye.overflowedIndicator,Tt=ye.theme;return he.forEach(function(Nt){return delete ye[Nt]}),delete ye.onClick,P.createElement(mr,Object(S.a)({},ye,{prefixCls:_e,mode:et,tag:"ul",level:Ge,theme:Tt,visible:je,overflowedIndicator:yt},Ae),Object(K.a)(ye.children).map(function(Nt,Dn){return ie.renderMenuItem(Nt,Dn,Be||"0-menu-")}))}}]),We}(P.Component);Ft.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:He};var br=Object(d.b)()(Ft),lr=br,Yn=U("Kwbf");function oi(Te,Le,We){var Se=Te.prefixCls,ie=Te.motion,ye=Te.defaultMotions,le=ye===void 0?{}:ye,Ae=Te.openAnimation,_e=Te.openTransitionName,Be=Le.switchingModeFromInline;if(ie)return ie;if(Object(W.a)(Ae)==="object"&&Ae)Object(Yn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Ae=="string")return{motionName:"".concat(Se,"-open-").concat(Ae)};if(_e)return{motionName:_e};var je=le[We];return je||(Be?null:le.other)}var $t=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(Se){var ie;Object(R.a)(this,We),ie=Le.call(this,Se),ie.onSelect=function(Ae){var _e=Object(m.a)(ie),Be=_e.props;if(Be.selectable){var je=ie.store.getState(),Ge=je.selectedKeys,et=Ae.key;Be.multiple?Ge=Ge.concat([et]):Ge=[et],"selectedKeys"in Be||ie.store.setState({selectedKeys:Ge}),Be.onSelect(Object(z.a)(Object(z.a)({},Ae),{},{selectedKeys:Ge}))}},ie.onClick=function(Ae){var _e=ie.getRealMenuMode(),Be=Object(m.a)(ie),je=Be.store,Ge=Be.props.onOpenChange;_e!=="inline"&&!("openKeys"in ie.props)&&(je.setState({openKeys:[]}),Ge([])),ie.props.onClick(Ae)},ie.onKeyDown=function(Ae,_e){ie.innerMenu.getWrappedInstance().onKeyDown(Ae,_e)},ie.onOpenChange=function(Ae){var _e=Object(m.a)(ie),Be=_e.props,je=ie.store.getState().openKeys.concat(),Ge=!1,et=function(Tt){var Nt=!1;if(Tt.open)Nt=je.indexOf(Tt.key)===-1,Nt&&je.push(Tt.key);else{var Dn=je.indexOf(Tt.key);Nt=Dn!==-1,Nt&&je.splice(Dn,1)}Ge=Ge||Nt};Array.isArray(Ae)?Ae.forEach(et):et(Ae),Ge&&("openKeys"in ie.props||ie.store.setState({openKeys:je}),Be.onOpenChange(je))},ie.onDeselect=function(Ae){var _e=Object(m.a)(ie),Be=_e.props;if(Be.selectable){var je=ie.store.getState().selectedKeys.concat(),Ge=Ae.key,et=je.indexOf(Ge);et!==-1&&je.splice(et,1),"selectedKeys"in Be||ie.store.setState({selectedKeys:je}),Be.onDeselect(Object(z.a)(Object(z.a)({},Ae),{},{selectedKeys:je}))}},ie.onMouseEnter=function(Ae){ie.restoreModeVerticalFromInline();var _e=ie.props.onMouseEnter;_e&&_e(Ae)},ie.onTransitionEnd=function(Ae){var _e=Ae.propertyName==="width"&&Ae.target===Ae.currentTarget,Be=Ae.target.className,je=Object.prototype.toString.call(Be)==="[object SVGAnimatedString]"?Be.animVal:Be,Ge=Ae.propertyName==="font-size"&&je.indexOf("anticon")>=0;(_e||Ge)&&ie.restoreModeVerticalFromInline()},ie.setInnerMenu=function(Ae){ie.innerMenu=Ae},ie.isRootMenu=!0;var ye=Se.defaultSelectedKeys,le=Se.defaultOpenKeys;return"selectedKeys"in Se&&(ye=Se.selectedKeys||[]),"openKeys"in Se&&(le=Se.openKeys||[]),ie.store=Object(d.c)({selectedKeys:ye,openKeys:le,activeKey:{"0-menu-":Hr(Se,Se.activeKey)}}),ie.state={switchingModeFromInline:!1,prevProps:Se,inlineOpenKeys:[],store:ie.store},ie}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(ie){var ye=this.props,le=ye.siderCollapsed,Ae=ye.inlineCollapsed,_e=ye.onOpenChange;(!ie.inlineCollapsed&&Ae||!ie.siderCollapsed&&le)&&_e([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var ie=this.props.collapsedWidth,ye=this.store,le=this.prevOpenKeys,Ae=this.getInlineCollapsed()&&(ie===0||ie==="0"||ie==="0px");Ae?(this.prevOpenKeys=ye.getState().openKeys.concat(),this.store.setState({openKeys:[]})):le&&(this.store.setState({openKeys:le}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var ie=this.props.mode,ye=this.state.switchingModeFromInline,le=this.getInlineCollapsed();return ye&&le?"inline":le?"vertical":ie}},{key:"getInlineCollapsed",value:function(){var ie=this.props,ye=ie.inlineCollapsed,le=ie.siderCollapsed;return le!==void 0?le:ye}},{key:"restoreModeVerticalFromInline",value:function(){var ie=this.state.switchingModeFromInline;ie&&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 ie=Object(z.a)({},Object(C.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ye=this.getRealMenuMode();return ie.className+=" ".concat(ie.prefixCls,"-root"),ie.direction==="rtl"&&(ie.className+=" ".concat(ie.prefixCls,"-rtl")),ie=Object(z.a)(Object(z.a)({},ie),{},{mode:ye,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:oi(this.props,this.state,ye)}),delete ie.openAnimation,delete ie.openTransitionName,P.createElement(d.a,{store:this.store},P.createElement(lr,Object(S.a)({},ie,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(ie,ye){var le=ye.prevProps,Ae=ye.store,_e=Ae.getState(),Be={},je={prevProps:ie};return le.mode==="inline"&&ie.mode!=="inline"&&(je.switchingModeFromInline=!0),"openKeys"in ie?Be.openKeys=ie.openKeys||[]:((ie.inlineCollapsed&&!le.inlineCollapsed||ie.siderCollapsed&&!le.siderCollapsed)&&(je.switchingModeFromInline=!0,je.inlineOpenKeys=_e.openKeys,Be.openKeys=[]),(!ie.inlineCollapsed&&le.inlineCollapsed||!ie.siderCollapsed&&le.siderCollapsed)&&(Be.openKeys=ye.inlineOpenKeys,je.inlineOpenKeys=[])),Object.keys(Be).length&&Ae.setState(Be),je}}]),We}(P.Component);$t.defaultProps={selectable:!0,onClick:He,onSelect:He,onOpenChange:He,onDeselect:He,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:P.createElement("span",null,"\xB7\xB7\xB7")};var Jt=$t,Qt=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(){var Se;return Object(R.a)(this,We),Se=Le.apply(this,arguments),Se.onKeyDown=function(ie){var ye=ie.keyCode;return ye===p.a.ENTER?(Se.onClick(ie),!0):void 0},Se.onMouseLeave=function(ie){var ye=Se.props,le=ye.eventKey,Ae=ye.onItemHover,_e=ye.onMouseLeave;Ae({key:le,hover:!1}),_e({key:le,domEvent:ie})},Se.onMouseEnter=function(ie){var ye=Se.props,le=ye.eventKey,Ae=ye.onItemHover,_e=ye.onMouseEnter;Ae({key:le,hover:!0}),_e({key:le,domEvent:ie})},Se.onClick=function(ie){var ye=Se.props,le=ye.eventKey,Ae=ye.multiple,_e=ye.onClick,Be=ye.onSelect,je=ye.onDeselect,Ge=ye.isSelected,et={key:le,keyPath:[le],item:Object(m.a)(Se),domEvent:ie};_e(et),Ae?Ge?je(et):Be(et):Ge||Be(et)},Se.saveNode=function(ie){Se.node=ie},Se}return Object(O.a)(We,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var ie=this.props;ie.onDestroy&&ie.onDestroy(ie.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 ie,ye=Object(z.a)({},this.props),le=G()(this.getPrefixCls(),ye.className,(ie={},Object(ne.a)(ie,this.getActiveClassName(),!ye.disabled&&ye.active),Object(ne.a)(ie,this.getSelectedClassName(),ye.isSelected),Object(ne.a)(ie,this.getDisabledClassName(),ye.disabled),ie)),Ae=Object(z.a)(Object(z.a)({},ye.attribute),{},{title:typeof ye.title=="string"?ye.title:void 0,className:le,role:ye.role||"menuitem","aria-disabled":ye.disabled});ye.role==="option"?Ae=Object(z.a)(Object(z.a)({},Ae),{},{role:"option","aria-selected":ye.isSelected}):(ye.role===null||ye.role==="none")&&(Ae.role="none");var _e={onClick:ye.disabled?null:this.onClick,onMouseLeave:ye.disabled?null:this.onMouseLeave,onMouseEnter:ye.disabled?null:this.onMouseEnter},Be=Object(z.a)({},ye.style);ye.mode==="inline"&&(ye.direction==="rtl"?Be.paddingRight=ye.inlineIndent*ye.level:Be.paddingLeft=ye.inlineIndent*ye.level),he.forEach(function(Ge){return delete ye[Ge]}),delete ye.direction;var je=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(je=P.createElement(this.props.itemIcon,this.props)),P.createElement("li",Object(S.a)({},Object(C.a)(ye,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Ae,_e,{style:Be,ref:this.saveNode}),ye.children,je)}}]),We}(P.Component);Qt.isMenuItem=!0,Qt.defaultProps={onSelect:He,onMouseEnter:He,onMouseLeave:He,manualRef:He};var pn=Object(d.b)(function(Te,Le){var We=Te.activeKey,Se=Te.selectedKeys,ie=Le.eventKey,ye=Le.subMenuKey;return{active:We[ye]===ie,isSelected:Array.isArray(Se)?Se.indexOf(ie)!==-1:Se===ie}})(Qt),Gn=pn,Mn=function(Te){Object(v.a)(We,Te);var Le=Object(h.a)(We);function We(){var Se;return Object(R.a)(this,We),Se=Le.apply(this,arguments),Se.renderInnerMenuItem=function(ie){var ye=Se.props,le=ye.renderMenuItem,Ae=ye.index;return le(ie,Ae,Se.props.subMenuKey)},Se}return Object(O.a)(We,[{key:"render",value:function(){var ie=Object(S.a)({},this.props),ye=ie.className,le=ye===void 0?"":ye,Ae=ie.rootPrefixCls,_e="".concat(Ae,"-item-group-title"),Be="".concat(Ae,"-item-group-list"),je=ie.title,Ge=ie.children;return he.forEach(function(et){return delete ie[et]}),delete ie.direction,P.createElement("li",Object(S.a)({},ie,{onClick:function(yt){return yt.stopPropagation()},className:"".concat(le," ").concat(Ae,"-item-group")}),P.createElement("div",{className:_e,title:typeof je=="string"?je:void 0},je),P.createElement("ul",{className:Be},P.Children.map(Ge,this.renderInnerMenuItem)))}}]),We}(P.Component);Mn.isMenuItemGroup=!0,Mn.defaultProps={disabled:!0};var qn=Mn,gr=function(Le){var We=Le.className,Se=Le.rootPrefixCls,ie=Le.style;return P.createElement("li",{className:"".concat(We," ").concat(Se,"-item-divider"),style:ie})};gr.defaultProps={disabled:!0,className:"",style:{}};var Ci=gr,Qn=Jt,Qi=U("eDIo");function vr(Te,Le){var We=Te.prefixCls,Se=Te.editable,ie=Te.locale,ye=Te.style;return!Se||Se.showAdd===!1?null:P.createElement("button",{ref:Le,type:"button",className:"".concat(We,"-nav-add"),style:ye,"aria-label":(ie==null?void 0:ie.addAriaLabel)||"Add tab",onClick:function(Ae){Se.onEdit("add",{event:Ae})}},Se.addIcon||"+")}var pi=P.forwardRef(vr);function si(Te,Le){var We=Te.prefixCls,Se=Te.id,ie=Te.tabs,ye=Te.locale,le=Te.mobile,Ae=Te.moreIcon,_e=Ae===void 0?"More":Ae,Be=Te.moreTransitionName,je=Te.style,Ge=Te.className,et=Te.editable,yt=Te.tabBarGutter,Tt=Te.rtl,Nt=Te.onTabClick,Dn=Object(P.useState)(!1),$n=Object(Y.a)(Dn,2),Bn=$n[0],zn=$n[1],Xn=Object(P.useState)(null),Vn=Object(Y.a)(Xn,2),Fn=Vn[0],Zn=Vn[1],er="".concat(Se,"-more-popup"),Nr="".concat(We,"-dropdown"),tr=Fn!==null?"".concat(er,"-").concat(Fn):null,En=ye==null?void 0:ye.dropdownAriaLabel,gn=P.createElement(Qn,{onClick:function(Ar){var Er=Ar.key,Gr=Ar.domEvent;Nt(Er,Gr),zn(!1)},id:er,tabIndex:-1,role:"listbox","aria-activedescendant":tr,selectedKeys:[Fn],"aria-label":En!==void 0?En:"expanded dropdown"},ie.map(function(ir){return P.createElement(Gn,{key:ir.key,id:"".concat(er,"-").concat(ir.key),role:"option","aria-controls":Se&&"".concat(Se,"-panel-").concat(ir.key),disabled:ir.disabled},ir.tab)}));function Wn(ir){for(var Ar=ie.filter(function(_i){return!_i.disabled}),Er=Ar.findIndex(function(_i){return _i.key===Fn})||0,Gr=Ar.length,Yr=0;Yr<Gr;Yr+=1){Er=(Er+ir+Gr)%Gr;var Br=Ar[Er];if(!Br.disabled){Zn(Br.key);return}}}function ur(ir){var Ar=ir.which;if(!Bn){[p.a.DOWN,p.a.SPACE,p.a.ENTER].includes(Ar)&&(zn(!0),ir.preventDefault());return}switch(Ar){case p.a.UP:Wn(-1),ir.preventDefault();break;case p.a.DOWN:Wn(1),ir.preventDefault();break;case p.a.ESC:zn(!1);break;case p.a.SPACE:case p.a.ENTER:Fn!==null&&Nt(Fn,ir);break}}Object(P.useEffect)(function(){var ir=document.getElementById(tr);ir&&ir.scrollIntoView&&ir.scrollIntoView(!1)},[Fn]),Object(P.useEffect)(function(){Bn||Zn(null)},[Bn]);var an=Object(ne.a)({},Tt?"marginLeft":"marginRight",yt);ie.length||(an.visibility="hidden",an.order=1);var cr=G()(Object(ne.a)({},"".concat(Nr,"-rtl"),Tt)),Ur=le?null:P.createElement(Qi.a,{prefixCls:Nr,overlay:gn,trigger:["hover"],visible:Bn,transitionName:Be,onVisibleChange:zn,overlayClassName:cr,mouseEnterDelay:.1,mouseLeaveDelay:.1},P.createElement("button",{type:"button",className:"".concat(We,"-nav-more"),style:an,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":er,id:"".concat(Se,"-more"),"aria-expanded":Bn,onKeyDown:ur},_e));return P.createElement("div",{className:G()("".concat(We,"-nav-operations"),Ge),style:je,ref:Le},Ur,P.createElement(pi,{prefixCls:We,locale:ye,editable:et}))}var Ui=P.forwardRef(si),ka=Object(P.createContext)(null),Lo=.1,ua=.01,Kr=20,lo=Math.pow(.995,Kr);function uo(){var Te=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Te)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Te.substr(0,4)))}function va(Te,Le){var We=Object(P.useState)(),Se=Object(Y.a)(We,2),ie=Se[0],ye=Se[1],le=Object(P.useState)(0),Ae=Object(Y.a)(le,2),_e=Ae[0],Be=Ae[1],je=Object(P.useState)(0),Ge=Object(Y.a)(je,2),et=Ge[0],yt=Ge[1],Tt=Object(P.useState)(),Nt=Object(Y.a)(Tt,2),Dn=Nt[0],$n=Nt[1],Bn=Object(P.useRef)();function zn(En){var gn=En.touches[0],Wn=gn.screenX,ur=gn.screenY;ye({x:Wn,y:ur}),window.clearInterval(Bn.current)}function Xn(En){if(!ie)return;En.preventDefault();var gn=En.touches[0],Wn=gn.screenX,ur=gn.screenY;ye({x:Wn,y:ur});var an=Wn-ie.x,cr=ur-ie.y;Le(an,cr);var Ur=Date.now();Be(Ur),yt(Ur-_e),$n({x:an,y:cr})}function Vn(){if(!ie)return;if(ye(null),$n(null),Dn){var En=Dn.x/et,gn=Dn.y/et,Wn=Math.abs(En),ur=Math.abs(gn);if(Math.max(Wn,ur)<Lo)return;var an=En,cr=gn;Bn.current=window.setInterval(function(){if(Math.abs(an)<ua&&Math.abs(cr)<ua){window.clearInterval(Bn.current);return}an*=lo,cr*=lo,Le(an*Kr,cr*Kr)},Kr)}}var Fn=Object(P.useRef)(0),Zn=Object(P.useRef)(!1),er=Object(P.useRef)();function Nr(En){var gn=En.deltaX,Wn=En.deltaY,ur=0,an=Math.abs(gn),cr=Math.abs(Wn);an===cr?ur=er.current==="x"?gn:Wn:an>cr?(ur=gn,er.current="x"):(ur=Wn,er.current="y");var Ur=Date.now();Ur-Fn.current>100&&(Zn.current=!1),(Le(-ur,-ur)||Zn.current)&&(En.preventDefault(),Zn.current=!0),Fn.current=Ur}var tr=Object(P.useRef)(null);tr.current={onTouchStart:zn,onTouchMove:Xn,onTouchEnd:Vn,onWheel:Nr},P.useEffect(function(){function En(an){tr.current.onTouchStart(an)}function gn(an){tr.current.onTouchMove(an)}function Wn(an){tr.current.onTouchEnd(an)}function ur(an){tr.current.onWheel(an)}return document.addEventListener("touchmove",gn,{passive:!1}),document.addEventListener("touchend",Wn,{passive:!1}),Te.current.addEventListener("touchstart",En,{passive:!1}),Te.current.addEventListener("wheel",ur),function(){document.removeEventListener("touchmove",gn),document.removeEventListener("touchend",Wn)}},[])}function ya(){var Te=Object(P.useRef)(new Map);function Le(Se){return Te.current.has(Se)||Te.current.set(Se,P.createRef()),Te.current.get(Se)}function We(Se){Te.current.delete(Se)}return[Le,We]}function $a(Te,Le){var We=P.useRef(Te),Se=P.useState({}),ie=Object(Y.a)(Se,2),ye=ie[1];function le(Ae){var _e=typeof Ae=="function"?Ae(We.current):Ae;_e!==We.current&&Le(_e,We.current),We.current=_e,ye({})}return[We.current,le]}var co=function(Le){var We=Le.position,Se=Le.prefixCls,ie=Le.extra;if(!ie)return null;var ye,le=ie;return We==="right"&&(ye=le.right||!le.left&&le||null),We==="left"&&(ye=le.left||null),ye?P.createElement("div",{className:"".concat(Se,"-extra-content")},ye):null};function Ma(Te,Le){var We,Se=P.useContext(ka),ie=Se.prefixCls,ye=Se.tabs,le=Te.className,Ae=Te.style,_e=Te.id,Be=Te.animated,je=Te.activeKey,Ge=Te.rtl,et=Te.extra,yt=Te.editable,Tt=Te.locale,Nt=Te.tabPosition,Dn=Te.tabBarGutter,$n=Te.children,Bn=Te.onTabClick,zn=Te.onTabScroll,Xn=Object(P.useRef)(),Vn=Object(P.useRef)(),Fn=Object(P.useRef)(),Zn=Object(P.useRef)(),er=ya(),Nr=Object(Y.a)(er,2),tr=Nr[0],En=Nr[1],gn=Nt==="top"||Nt==="bottom",Wn=$a(0,function(_r,or){gn&&zn&&zn({direction:_r>or?"left":"right"})}),ur=Object(Y.a)(Wn,2),an=ur[0],cr=ur[1],Ur=$a(0,function(_r,or){!gn&&zn&&zn({direction:_r>or?"top":"bottom"})}),ir=Object(Y.a)(Ur,2),Ar=ir[0],Er=ir[1],Gr=Object(P.useState)(0),Yr=Object(Y.a)(Gr,2),Br=Yr[0],_i=Yr[1],Pi=Object(P.useState)(0),Si=Object(Y.a)(Pi,2),$r=Si[0],Ir=Si[1],xr=Object(P.useState)(0),Cn=Object(Y.a)(xr,2),Tr=Cn[0],ji=Cn[1],Zi=Object(P.useState)(0),ia=Object(Y.a)(Zi,2),wr=ia[0],Xi=ia[1],Ji=Object(P.useState)(null),Dr=Object(Y.a)(Ji,2),yr=Dr[0],Wr=Dr[1],Ua=Object(P.useState)(null),Za=Object(Y.a)(Ua,2),ca=Za[0],Ea=Za[1],ei=Object(P.useState)(0),Yi=Object(Y.a)(ei,2),ja=Yi[0],Io=Yi[1],Po=Object(P.useState)(0),mo=Object(Y.a)(Po,2),Ja=mo[0],qa=mo[1],da=a(new Map),xa=Object(Y.a)(da,2),go=xa[0],Ba=xa[1],Ta=i(ye,go,Br),ha="".concat(ie,"-nav-operations-hidden"),Pr=0,ki=0;gn?Ge?(Pr=0,ki=Math.max(0,Br-yr)):(Pr=Math.min(0,yr-Br),ki=0):(Pr=Math.min(0,ca-$r),ki=0);function fa(_r){return _r<Pr?[Pr,!1]:_r>ki?[ki,!1]:[_r,!0]}var aa=Object(P.useRef)(),Sa=Object(P.useState)(),pa=Object(Y.a)(Sa,2),Fa=pa[0],eo=pa[1];function Wa(){eo(Date.now())}function to(){window.clearTimeout(aa.current)}va(Xn,function(_r,or){var ci=!1;function bi(sa,ea){sa(function(Ra){var la=fa(Ra+ea),li=Object(Y.a)(la,2),Da=li[0],it=li[1];return ci=it,Da})}if(gn){if(yr>=Br)return ci;bi(cr,_r)}else{if(ca>=$r)return ci;bi(Er,or)}return to(),Wa(),ci}),Object(P.useEffect)(function(){return to(),Fa&&(aa.current=window.setTimeout(function(){eo(0)},100)),to},[Fa]);function qi(){var _r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:je,or=Ta.get(_r);if(!or)return;if(gn){var ci=an;Ge?or.right<an?ci=or.right:or.right+or.width>an+yr&&(ci=or.right+or.width-yr):or.left<-an?ci=-or.left:or.left+or.width>-an+yr&&(ci=-(or.left+or.width-yr)),Er(0),cr(fa(ci)[0])}else{var bi=Ar;or.top<-Ar?bi=-or.top:or.top+or.height>-Ar+ca&&(bi=-(or.top+or.height-ca)),cr(0),Er(fa(bi)[0])}}var oa=A(Ta,{width:yr,height:ca,left:an,top:Ar},{width:Tr,height:wr},{width:ja,height:Ja},Object(z.a)(Object(z.a)({},Te),{},{tabs:ye})),no=Object(Y.a)(oa,2),ro=no[0],ko=no[1],Mo=ye.map(function(_r){var or=_r.key;return P.createElement(u,{id:_e,prefixCls:ie,key:or,rtl:Ge,tab:_r,closable:_r.closable,editable:yt,active:or===je,tabPosition:Nt,tabBarGutter:Dn,renderWrapper:$n,removeAriaLabel:Tt==null?void 0:Tt.removeAriaLabel,ref:tr(or),onClick:function(bi){Bn(or,bi)},onRemove:function(){En(or)},onFocus:function(){qi(or),Wa(),Ge||(Xn.current.scrollLeft=0),Xn.current.scrollTop=0}})}),io=c(function(){var _r,or,ci,bi,sa,ea,Ra,la,li,Da=((_r=Xn.current)===null||_r===void 0?void 0:_r.offsetWidth)||0,it=((or=Xn.current)===null||or===void 0?void 0:or.offsetHeight)||0,qe=((ci=Zn.current)===null||ci===void 0?void 0:ci.offsetWidth)||0,$e=((bi=Zn.current)===null||bi===void 0?void 0:bi.offsetHeight)||0,ot=((sa=Fn.current)===null||sa===void 0?void 0:sa.offsetWidth)||0,lt=((ea=Fn.current)===null||ea===void 0?void 0:ea.offsetHeight)||0;Wr(Da),Ea(it),Io(qe),qa($e);var At=(((Ra=Vn.current)===null||Ra===void 0?void 0:Ra.offsetWidth)||0)-qe,St=(((la=Vn.current)===null||la===void 0?void 0:la.offsetHeight)||0)-$e;_i(At),Ir(St);var wt=(li=Fn.current)===null||li===void 0?void 0:li.className.includes(ha);ji(At-(wt?0:ot)),Xi(St-(wt?0:lt)),Ba(function(){var dn=new Map;return ye.forEach(function(nr){var Oi=nr.key,Hn=tr(Oi).current;Hn&&dn.set(Oi,{width:Hn.offsetWidth,height:Hn.offsetHeight,left:Hn.offsetLeft,top:Hn.offsetTop})}),dn})}),No=ye.slice(0,ro),ti=ye.slice(ko+1),Qr=[].concat(Object(I.a)(No),Object(I.a)(ti)),mi=Object(P.useState)(),Zr=Object(Y.a)(mi,2),Aa=Zr[0],Ha=Zr[1],Mi=Ta.get(je),ao=Object(P.useRef)();function Ka(){f.a.cancel(ao.current)}Object(P.useEffect)(function(){var _r={};return Mi&&(gn?(Ge?_r.right=Mi.right:_r.left=Mi.left,_r.width=Mi.width):(_r.top=Mi.top,_r.height=Mi.height)),Ka(),ao.current=f()(function(){Ha(_r)}),Ka},[Mi,gn,Ge]),Object(P.useEffect)(function(){qi()},[je,Mi,Ta,gn]),Object(P.useEffect)(function(){io()},[Ge,Dn,je,ye.map(function(_r){return _r.key}).join("_")]);var vo=!!Qr.length,ma="".concat(ie,"-nav-wrap"),Ga,Oa,yo,za;return gn?Ge?(Oa=an>0,Ga=an+yr<Br):(Ga=an<0,Oa=-an+yr<Br):(yo=Ar<0,za=-Ar+ca<$r),P.createElement("div",{ref:Le,role:"tablist",className:G()("".concat(ie,"-nav"),le),style:Ae,onKeyDown:function(){Wa()}},P.createElement(co,{position:"left",extra:et,prefixCls:ie}),P.createElement(y.a,{onResize:io},P.createElement("div",{className:G()(ma,(We={},Object(ne.a)(We,"".concat(ma,"-ping-left"),Ga),Object(ne.a)(We,"".concat(ma,"-ping-right"),Oa),Object(ne.a)(We,"".concat(ma,"-ping-top"),yo),Object(ne.a)(We,"".concat(ma,"-ping-bottom"),za),We)),ref:Xn},P.createElement(y.a,{onResize:io},P.createElement("div",{ref:Vn,className:"".concat(ie,"-nav-list"),style:{transform:"translate(".concat(an,"px, ").concat(Ar,"px)"),transition:Fa?"none":void 0}},Mo,P.createElement(pi,{ref:Zn,prefixCls:ie,locale:Tt,editable:yt,style:{visibility:vo?"hidden":null}}),P.createElement("div",{className:G()("".concat(ie,"-ink-bar"),Object(ne.a)({},"".concat(ie,"-ink-bar-animated"),Be.inkBar)),style:Aa}))))),P.createElement(Ui,Object.assign({},Te,{ref:Fn,prefixCls:ie,tabs:Qr,className:!vo&&ha})),P.createElement(co,{position:"right",extra:et,prefixCls:ie}))}var Ca=P.forwardRef(Ma);function ho(Te){var Le=Te.id,We=Te.activeKey,Se=Te.animated,ie=Te.tabPosition,ye=Te.rtl,le=Te.destroyInactiveTabPane,Ae=P.useContext(ka),_e=Ae.prefixCls,Be=Ae.tabs,je=Se.tabPane,Ge=Be.findIndex(function(et){return et.key===We});return P.createElement("div",{className:G()("".concat(_e,"-content-holder"))},P.createElement("div",{className:G()("".concat(_e,"-content"),"".concat(_e,"-content-").concat(ie),Object(ne.a)({},"".concat(_e,"-content-animated"),je)),style:Ge&&je?Object(ne.a)({},ye?"marginRight":"marginLeft","-".concat(Ge,"00%")):null},Be.map(function(et){return P.cloneElement(et.node,{key:et.key,prefixCls:_e,tabKey:et.key,id:Le,animated:je,active:et.key===We,destroyInactiveTabPane:le})})))}function fo(Te){var Le=Te.prefixCls,We=Te.forceRender,Se=Te.className,ie=Te.style,ye=Te.id,le=Te.active,Ae=Te.animated,_e=Te.destroyInactiveTabPane,Be=Te.tabKey,je=Te.children,Ge=P.useState(We),et=Object(Y.a)(Ge,2),yt=et[0],Tt=et[1];P.useEffect(function(){le?Tt(!0):_e&&Tt(!1)},[le,_e]);var Nt={};return le||(Ae?(Nt.visibility="hidden",Nt.height=0,Nt.overflowY="hidden"):Nt.display="none"),P.createElement("div",{id:ye&&"".concat(ye,"-panel-").concat(Be),role:"tabpanel",tabIndex:le?0:-1,"aria-labelledby":ye&&"".concat(ye,"-tab-").concat(Be),"aria-hidden":!le,style:Object(z.a)(Object(z.a)({},Nt),ie),className:G()("".concat(Le,"-tabpane"),le&&"".concat(Le,"-tabpane-active"),Se)},(le||yt||We)&&je)}var Na=0;function po(Te){return Object(K.a)(Te).map(function(Le){if(P.isValidElement(Le)){var We=Le.key!==void 0?String(Le.key):void 0;return Object(z.a)(Object(z.a)({key:We},Le.props),{},{node:Le})}return null}).filter(function(Le){return Le})}function Qa(Te,Le){var We,Se=Te.id,ie=Te.prefixCls,ye=ie===void 0?"rc-tabs":ie,le=Te.className,Ae=Te.children,_e=Te.direction,Be=Te.activeKey,je=Te.defaultActiveKey,Ge=Te.editable,et=Te.animated,yt=Te.tabPosition,Tt=yt===void 0?"top":yt,Nt=Te.tabBarGutter,Dn=Te.tabBarStyle,$n=Te.tabBarExtraContent,Bn=Te.locale,zn=Te.moreIcon,Xn=Te.moreTransitionName,Vn=Te.destroyInactiveTabPane,Fn=Te.renderTabBar,Zn=Te.onChange,er=Te.onTabClick,Nr=Te.onTabScroll,tr=Object(M.a)(Te,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),En=po(Ae),gn=_e==="rtl",Wn;et===!1?Wn={inkBar:!1,tabPane:!1}:Wn=Object(z.a)({inkBar:!0,tabPane:!1},et!==!0?et:null);var ur=Object(P.useState)(!1),an=Object(Y.a)(ur,2),cr=an[0],Ur=an[1];Object(P.useEffect)(function(){Ur(uo())},[]);var ir=Object(n.a)(function(){var wr;return(wr=En[0])===null||wr===void 0?void 0:wr.key},{value:Be,defaultValue:je}),Ar=Object(Y.a)(ir,2),Er=Ar[0],Gr=Ar[1],Yr=Object(P.useState)(function(){return En.findIndex(function(wr){return wr.key===Er})}),Br=Object(Y.a)(Yr,2),_i=Br[0],Pi=Br[1];Object(P.useEffect)(function(){var wr=En.findIndex(function(Ji){return Ji.key===Er});if(wr===-1){var Xi;wr=Math.max(0,Math.min(_i,En.length-1)),Gr((Xi=En[wr])===null||Xi===void 0?void 0:Xi.key)}Pi(wr)},[En.map(function(wr){return wr.key}).join("_"),Er,_i]);var Si=Object(n.a)(null,{value:Se}),$r=Object(Y.a)(Si,2),Ir=$r[0],xr=$r[1],Cn=Tt;cr&&!["left","right"].includes(Tt)&&(Cn="top"),Object(P.useEffect)(function(){Se||(xr("rc-tabs-".concat(Na)),Na+=1)},[]);function Tr(wr,Xi){er==null||er(wr,Xi),Gr(wr),Zn==null||Zn(wr)}var ji={id:Ir,activeKey:Er,animated:Wn,tabPosition:Cn,rtl:gn,mobile:cr},Zi,ia=Object(z.a)(Object(z.a)({},ji),{},{editable:Ge,locale:Bn,moreIcon:zn,moreTransitionName:Xn,tabBarGutter:Nt,onTabClick:Tr,onTabScroll:Nr,extra:$n,style:Dn,panes:Ae});return Fn?Zi=Fn(ia,Ca):Zi=P.createElement(Ca,Object.assign({},ia)),P.createElement(ka.Provider,{value:{tabs:En,prefixCls:ye}},P.createElement("div",Object.assign({ref:Le,id:Se,className:G()(ye,"".concat(ye,"-").concat(Cn),(We={},Object(ne.a)(We,"".concat(ye,"-mobile"),cr),Object(ne.a)(We,"".concat(ye,"-editable"),Ge),Object(ne.a)(We,"".concat(ye,"-rtl"),gn),We),le)},tr),Zi,P.createElement(ho,Object.assign({destroyInactiveTabPane:Vn},ji,{animated:Wn}))))}var _a=P.forwardRef(Qa);_a.TabPane=fo;var ra=_a,ba=ve.b=ra},kSUc:function(ut,ve,U){},lZu9:function(ut,ve,U){(function(ne){ne(U("VrN/"),U("1eCo"),U("8EBN"))})(function(ne){"use strict";ne.defineMode("markdown",function(Y,M){var z=ne.getMode(Y,"text/html"),P=z.name=="null";function F(_){if(ne.findModeByName){var x=ne.findModeByName(_);x&&(_=x.mime||x.mimes[0])}var H=ne.getMode(Y,_);return H.name=="null"?null:H}M.highlightFormatting===void 0&&(M.highlightFormatting=!1),M.maxBlockquoteDepth===void 0&&(M.maxBlockquoteDepth=0),M.taskLists===void 0&&(M.taskLists=!1),M.strikethrough===void 0&&(M.strikethrough=!1),M.emoji===void 0&&(M.emoji=!1),M.fencedCodeBlockHighlighting===void 0&&(M.fencedCodeBlockHighlighting=!0),M.fencedCodeBlockDefaultMode===void 0&&(M.fencedCodeBlockDefaultMode="text/plain"),M.xml===void 0&&(M.xml=!0),M.tokenTypeOverrides===void 0&&(M.tokenTypeOverrides={});var G={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var K in G)G.hasOwnProperty(K)&&M.tokenTypeOverrides[K]&&(G[K]=M.tokenTypeOverrides[K]);var n=/^([*\-_])(?:\s*\1){2,}\s*$/,I=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,b=/^\[(x| )\](?=\s)/i,f=M.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,y=/^ {0,3}(?:\={1,}|-{2,})\s*$/,c=/^[^#!\[\]*_\\<>` "'(~:]+/,a=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,u=" ";function s(_,x,H){return x.f=x.inline=H,H(_,x)}function i(_,x,H){return x.f=x.block=H,H(_,x)}function D(_){return!_||!/\S/.test(_.string)}function A(_){if(_.linkTitle=!1,_.linkHref=!1,_.linkText=!1,_.em=!1,_.strong=!1,_.strikethrough=!1,_.quote=0,_.indentedCode=!1,_.f==R){var x=P;if(!x){var H=ne.innerMode(z,_.htmlState);x=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}x&&(_.f=h,_.block=S,_.htmlState=null)}return _.trailingSpace=0,_.trailingSpaceNewLine=!1,_.prevLine=_.thisLine,_.thisLine={stream:null},null}function S(_,x){var H=_.column()===x.indentation,X=D(x.prevLine.stream),ee=x.indentedCode,J=x.prevLine.hr,ce=x.list!==!1,me=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var ue=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,ce)){for(x.list=null;ue<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=ue-x.listStack[x.listStack.length-1])}var pe=!X&&!J&&!x.prevLine.header&&(!ce||!ee)&&!x.prevLine.fencedCodeEnd,xe=(x.list===!1||J||X)&&x.indentation<=me&&_.match(n),se=null;if(x.indentationDiff>=4&&(ee||x.prevLine.fencedCodeEnd||x.prevLine.header||X))return _.skipToEnd(),x.indentedCode=!0,G.code;if(_.eatSpace())return null;if(H&&x.indentation<=me&&(se=_.match(f))&&se[1].length<=6)return x.quote=0,x.header=se[1].length,x.thisLine.header=!0,M.highlightFormatting&&(x.formatting="header"),x.f=x.inline,m(x);if(x.indentation<=me&&_.eat(">"))return x.quote=H?1:x.quote+1,M.highlightFormatting&&(x.formatting="quote"),_.eatSpace(),m(x);if(!xe&&!x.setext&&H&&x.indentation<=me&&(se=_.match(I))){var ae=se[1]?"ol":"ul";return x.indentation=ue+_.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,M.taskLists&&_.match(b,!1)&&(x.taskList=!0),x.f=x.inline,M.highlightFormatting&&(x.formatting=["list","list-"+ae]),m(x)}else{if(H&&x.indentation<=me&&(se=_.match(a,!0)))return x.quote=0,x.fencedEndRE=new RegExp(se[1]+"+ *$"),x.localMode=M.fencedCodeBlockHighlighting&&F(se[2]||M.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=ne.startState(x.localMode)),x.f=x.block=O,M.highlightFormatting&&(x.formatting="code-block"),x.code=-1,m(x);if(x.setext||(!pe||!ce)&&!x.quote&&x.list===!1&&!x.code&&!xe&&!p.test(_.string)&&(se=_.lookAhead(1))&&(se=se.match(y)))return x.setext?(x.header=x.setext,x.setext=0,_.skipToEnd(),M.highlightFormatting&&(x.formatting="header")):(x.header=se[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,m(x);if(xe)return _.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,G.hr;if(_.peek()==="[")return s(_,x,j)}return s(_,x,x.inline)}function R(_,x){var H=z.token(_,x.htmlState);if(!P){var X=ne.innerMode(z,x.htmlState);(X.mode.name=="xml"&&X.state.tagStart===null&&!X.state.context&&X.state.tokenize.isInText||x.md_inside&&_.current().indexOf(">")>-1)&&(x.f=h,x.block=S,x.htmlState=null)}return H}function O(_,x){var H=x.listStack[x.listStack.length-1]||0,X=x.indentation<H,ee=H+3;if(x.fencedEndRE&&x.indentation<=ee&&(X||_.match(x.fencedEndRE))){M.highlightFormatting&&(x.formatting="code-block");var J;return X||(J=m(x)),x.localMode=x.localState=null,x.block=S,x.f=h,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,X?i(_,x,x.block):J}else return x.localMode?x.localMode.token(_,x.localState):(_.skipToEnd(),G.code)}function m(_){var x=[];if(_.formatting){x.push(G.formatting),typeof _.formatting=="string"&&(_.formatting=[_.formatting]);for(var H=0;H<_.formatting.length;H++)x.push(G.formatting+"-"+_.formatting[H]),_.formatting[H]==="header"&&x.push(G.formatting+"-"+_.formatting[H]+"-"+_.header),_.formatting[H]==="quote"&&(!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=_.quote?x.push(G.formatting+"-"+_.formatting[H]+"-"+_.quote):x.push("error"))}if(_.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(_.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(_.linkHref?x.push(G.linkHref,"url"):(_.strong&&x.push(G.strong),_.em&&x.push(G.em),_.strikethrough&&x.push(G.strikethrough),_.emoji&&x.push(G.emoji),_.linkText&&x.push(G.linkText),_.code&&x.push(G.code),_.image&&x.push(G.image),_.imageAltText&&x.push(G.imageAltText,"link"),_.imageMarker&&x.push(G.imageMarker)),_.header&&x.push(G.header,G.header+"-"+_.header),_.quote&&(x.push(G.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=_.quote?x.push(G.quote+"-"+_.quote):x.push(G.quote+"-"+M.maxBlockquoteDepth)),_.list!==!1){var X=(_.listStack.length-1)%3;X?X===1?x.push(G.list2):x.push(G.list3):x.push(G.list1)}return _.trailingSpaceNewLine?x.push("trailing-space-new-line"):_.trailingSpace&&x.push("trailing-space-"+(_.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function v(_,x){return _.match(c,!0)?m(x):void 0}function h(_,x){var H=x.text(_,x);if(typeof H!="undefined")return H;if(x.list)return x.list=null,m(x);if(x.taskList){var X=_.match(b,!0)[1]===" ";return X?x.taskOpen=!0:x.taskClosed=!0,M.highlightFormatting&&(x.formatting="task"),x.taskList=!1,m(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&_.match(/^#+$/,!0))return M.highlightFormatting&&(x.formatting="header"),m(x);var ee=_.next();if(x.linkTitle){x.linkTitle=!1;var J=ee;ee==="("&&(J=")"),J=(J+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ce="^\\s*(?:[^"+J+"\\\\]+|\\\\\\\\|\\\\.)"+J;if(_.match(new RegExp(ce),!0))return G.linkHref}if(ee==="`"){var me=x.formatting;M.highlightFormatting&&(x.formatting="code"),_.eatWhile("`");var ue=_.current().length;if(x.code==0&&(!x.quote||ue==1))return x.code=ue,m(x);if(ue==x.code){var pe=m(x);return x.code=0,pe}else return x.formatting=me,m(x)}else if(x.code)return m(x);if(ee==="\\"&&(_.next(),M.highlightFormatting)){var xe=m(x),se=G.formatting+"-escape";return xe?xe+" "+se:se}if(ee==="!"&&_.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,M.highlightFormatting&&(x.formatting="image"),m(x);if(ee==="["&&x.imageMarker&&_.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,M.highlightFormatting&&(x.formatting="image"),m(x);if(ee==="]"&&x.imageAltText){M.highlightFormatting&&(x.formatting="image");var xe=m(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=C,xe}if(ee==="["&&!x.image)return x.linkText&&_.match(/^.*?\]/)||(x.linkText=!0,M.highlightFormatting&&(x.formatting="link")),m(x);if(ee==="]"&&x.linkText){M.highlightFormatting&&(x.formatting="link");var xe=m(x);return x.linkText=!1,x.inline=x.f=_.match(/\(.*?\)| ?\[.*?\]/,!1)?C:h,xe}if(ee==="<"&&_.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=d,M.highlightFormatting&&(x.formatting="link");var xe=m(x);return xe?xe+=" ":xe="",xe+G.linkInline}if(ee==="<"&&_.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=d,M.highlightFormatting&&(x.formatting="link");var xe=m(x);return xe?xe+=" ":xe="",xe+G.linkEmail}if(M.xml&&ee==="<"&&_.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ae=_.string.indexOf(">",_.pos);if(ae!=-1){var Ce=_.string.substring(_.start,ae);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ce)&&(x.md_inside=!0)}return _.backUp(1),x.htmlState=ne.startState(z),i(_,x,R)}if(M.xml&&ee==="<"&&_.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(ee==="*"||ee==="_"){for(var ze=1,Ye=_.pos==1?" ":_.string.charAt(_.pos-2);ze<3&&_.eat(ee);)ze++;var He=_.peek()||" ",Ve=!/\s/.test(He)&&(!l.test(He)||/\s/.test(Ye)||l.test(Ye)),Fe=!/\s/.test(Ye)&&(!l.test(Ye)||/\s/.test(He)||l.test(He)),Ke=null,nt=null;if(ze%2&&(!x.em&&Ve&&(ee==="*"||!Fe||l.test(Ye))?Ke=!0:x.em==ee&&Fe&&(ee==="*"||!Ve||l.test(He))&&(Ke=!1)),ze>1&&(!x.strong&&Ve&&(ee==="*"||!Fe||l.test(Ye))?nt=!0:x.strong==ee&&Fe&&(ee==="*"||!Ve||l.test(He))&&(nt=!1)),nt!=null||Ke!=null){M.highlightFormatting&&(x.formatting=Ke==null?"strong":nt==null?"em":"strong em"),Ke===!0&&(x.em=ee),nt===!0&&(x.strong=ee);var pe=m(x);return Ke===!1&&(x.em=!1),nt===!1&&(x.strong=!1),pe}}else if(ee===" "&&(_.eat("*")||_.eat("_"))){if(_.peek()===" ")return m(x);_.backUp(1)}if(M.strikethrough){if(ee==="~"&&_.eatWhile(ee)){if(x.strikethrough){M.highlightFormatting&&(x.formatting="strikethrough");var pe=m(x);return x.strikethrough=!1,pe}else if(_.match(/^[^\s]/,!1))return x.strikethrough=!0,M.highlightFormatting&&(x.formatting="strikethrough"),m(x)}else if(ee===" "&&_.match(/^~~/,!0)){if(_.peek()===" ")return m(x);_.backUp(2)}}if(M.emoji&&ee===":"&&_.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,M.highlightFormatting&&(x.formatting="emoji");var he=m(x);return x.emoji=!1,he}return ee===" "&&(_.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),m(x)}function d(_,x){var H=_.next();if(H===">"){x.f=x.inline=h,M.highlightFormatting&&(x.formatting="link");var X=m(x);return X?X+=" ":X="",X+G.linkInline}return _.match(/^[^>]+/,!0),G.linkInline}function C(_,x){if(_.eatSpace())return null;var H=_.next();return H==="("||H==="["?(x.f=x.inline=w(H==="("?")":"]"),M.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,m(x)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(_){return function(x,H){var X=x.next();if(X===_){H.f=H.inline=h,M.highlightFormatting&&(H.formatting="link-string");var ee=m(H);return H.linkHref=!1,ee}return x.match(E[_]),H.linkHref=!0,m(H)}}function j(_,x){return _.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=W,_.next(),M.highlightFormatting&&(x.formatting="link"),x.linkText=!0,m(x)):s(_,x,h)}function W(_,x){if(_.match(/^\]:/,!0)){x.f=x.inline=T,M.highlightFormatting&&(x.formatting="link");var H=m(x);return x.linkText=!1,H}return _.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function T(_,x){return _.eatSpace()?null:(_.match(/^[^\s]+/,!0),_.peek()===void 0?x.linkTitle=!0:_.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),x.f=x.inline=h,G.linkHref+" url")}var N={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:h,text:v,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(_){return{f:_.f,prevLine:_.prevLine,thisLine:_.thisLine,block:_.block,htmlState:_.htmlState&&ne.copyState(z,_.htmlState),indentation:_.indentation,localMode:_.localMode,localState:_.localMode?ne.copyState(_.localMode,_.localState):null,inline:_.inline,text:_.text,formatting:!1,linkText:_.linkText,linkTitle:_.linkTitle,linkHref:_.linkHref,code:_.code,em:_.em,strong:_.strong,strikethrough:_.strikethrough,emoji:_.emoji,header:_.header,setext:_.setext,hr:_.hr,taskList:_.taskList,list:_.list,listStack:_.listStack.slice(0),quote:_.quote,indentedCode:_.indentedCode,trailingSpace:_.trailingSpace,trailingSpaceNewLine:_.trailingSpaceNewLine,md_inside:_.md_inside,fencedEndRE:_.fencedEndRE}},token:function(_,x){if(x.formatting=!1,_!=x.thisLine.stream){if(x.header=0,x.hr=!1,_.match(/^\s*$/,!0))return A(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:_},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=R)){var H=_.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(x.indentation=H,x.indentationDiff=null,H>0)return null}}return x.f(_,x)},innerMode:function(_){return _.block==R?{state:_.htmlState,mode:z}:_.localState?{state:_.localState,mode:_.localMode}:{state:_,mode:N}},indent:function(_,x,H){return _.block==R&&z.indent?z.indent(_.htmlState,x,H):_.localState&&_.localMode.indent?_.localMode.indent(_.localState,x,H):ne.Pass},blankLine:A,getType:m,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return N},"xml"),ne.defineMIME("text/markdown","markdown"),ne.defineMIME("text/x-markdown","markdown")})},mgmH:function(ut,ve,U){"use strict";U.d(ve,"d",function(){return y}),U.d(ve,"b",function(){return c}),U.d(ve,"e",function(){return a}),U.d(ve,"c",function(){return p}),U.d(ve,"n",function(){return l}),U.d(ve,"g",function(){return u}),U.d(ve,"h",function(){return s}),U.d(ve,"j",function(){return D}),U.d(ve,"a",function(){return A}),U.d(ve,"l",function(){return S}),U.d(ve,"f",function(){return R}),U.d(ve,"k",function(){return O}),U.d(ve,"m",function(){return m}),U.d(ve,"i",function(){return v}),U.d(ve,"p",function(){return h}),U.d(ve,"v",function(){return d}),U.d(ve,"u",function(){return C}),U.d(ve,"r",function(){return E}),U.d(ve,"s",function(){return w}),U.d(ve,"t",function(){return j}),U.d(ve,"x",function(){return W}),U.d(ve,"w",function(){return T}),U.d(ve,"o",function(){return N}),U.d(ve,"q",function(){return _});var ne=U("miYZ"),Y=U("tsqr"),M=U("k1fw"),z=U("9og8"),P=U("WmNS"),F=U.n(P),G=U("oUNq"),K=U("9kvl"),n=U("1vsH"),I=U("m3rI"),b=function(){Object(K.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},f=function(){Object(K.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},y=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return b(),ce.next=3,Object(G.t)(Object(M.a)({},X));case 3:if(ee=ce.sent,!(ee.status===0)){ce.next=7;break}return ce.next=7,Object(n.y)("",Object(n.ab)({url:I.a.API_SERVER+"/api/courses/".concat(X.coursesId,"/export_couser_info.json"),query:X}));case 7:f();case 8:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),c=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(G.r)(Object(M.a)({},X));case 2:if(ee=ce.sent,!(ee.status===0)){ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_member_act_score")),ce.next=13;break;case 8:if(!(ee.status===-2)){ce.next=12;break}return ce.abrupt("return",ee);case 12:ee.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),a=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(G.u)(Object(M.a)({},X));case 2:if(ee=ce.sent,!(ee.status===0)){ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_score")),ce.next=13;break;case 8:if(!(ee.status===-2)){ce.next=12;break}return ce.abrupt("return",ee);case 12:ee.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_score")));case 13:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),p=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(G.s)(Object(M.a)({},X));case 2:if(ee=ce.sent,!(ee.status===0)){ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_exercise_and_other")),ce.next=13;break;case 8:if(!(ee.status===-2)){ce.next=12;break}return ce.abrupt("return",ee);case 12:ee.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),l=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(G.z)(Object(M.a)({},X));case 2:if(ee=ce.sent,!(ee.status===0)){ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_exercise_and_other")),ce.next=13;break;case 8:if(!(ee.status===-2)){ce.next=12;break}return ce.abrupt("return",ee);case 12:ee.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),u=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(G.v)(Object(M.a)({},X));case 2:if(ee=ce.sent,!(ee.status===0)){ce.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_homework")),ce.next=13;break;case 8:if(!(ee.status===-2)){ce.next=12;break}return ce.abrupt("return",ee);case 12:ee.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),s=function(){var x=Object(z.a)(F.a.mark(function H(X,ee){var J;return F.a.wrap(function(me){for(;;)switch(me.prev=me.next){case 0:return me.next=2,Object(G.x)(Object(M.a)({},X));case 2:J=me.sent,J.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/").concat(ee))):J.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/").concat(ee)));case 4:case"end":return me.stop()}},H)}));return function(X,ee){return x.apply(this,arguments)}}(),i=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return b(),ce.next=3,Object(G.w)(Object(M.a)({},X));case 3:if(ee=ce.sent,!(ee.status===0)){ce.next=7;break}return ce.next=7,Object(n.y)("",Object(n.ab)({url:I.a.API_SERVER+"/api/homework_commons/".concat(X.categoryId,"/works_list.zip"),query:X}));case 7:f();case 8:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),D=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return b(),ce.next=3,Object(G.A)(Object(M.a)({},X));case 3:if(ee=ce.sent,!(ee.status===0)){ce.next=7;break}return ce.next=7,Object(n.y)("",Object(n.ab)({url:I.a.API_SERVER+"/api/polls/".concat(X.categoryId,"/commit_result.xlsx"),query:X}));case 7:f();case 8:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),A=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/courses/".concat(X.coursesId,"/attendances/export_xlsx_data.xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),S=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/courses/".concat(X.coursesId,"/video_study_statics.xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),R=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/courses/".concat(X.coursesId,"/export_course_students_info.xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),O=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/item_banks/export.xlsx",query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),m=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),v=function(){var x=Object(z.a)(F.a.mark(function H(X){var ee;return F.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return ce.next=2,Object(G.y)(Object(M.a)({},X));case 2:ee=ce.sent,ee.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/exercise_score"))):ee.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(X.coursesId,"/exportlist/exercise_score")));case 4:case"end":return ce.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),h=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),J.next=3,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/export_records/".concat(X.id,".xlsx"),query:X}));case 3:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),d=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),C=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/ec_years/".concat(X==null?void 0:X.ec_year_id,"/ec_training_objectives.xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),E=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)(X==null?void 0:X.name,Object(n.ab)({url:I.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),w=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/ec_years/".concat(X==null?void 0:X.ec_year_id,"/ec_courses.xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),j=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/ec_years/".concat(X==null?void 0:X.ec_year_id,"/ec_graduation_requirements.xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),W=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/courses/rank_list.xlsx",query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),T=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.x)("",Object(n.ab)({url:I.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),N=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.y)("",Object(n.ab)({url:I.a.API_SERVER+"/api/shixun_collects/".concat(X.id,"/details.").concat(X.is_json?"json":"xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}(),_=function(){var x=Object(z.a)(F.a.mark(function H(X){return F.a.wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.next=2,Object(n.y)("",Object(n.ab)({url:I.a.API_SERVER+"/api/shixun_collects/test_two_list.".concat(X.is_json?"json":"xlsx"),query:X}));case 2:case"end":return J.stop()}},H)}));return function(X){return x.apply(this,arguments)}}()},nEHx:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return ne});var ne;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(ne||(ne={}))},nSDg:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___2lqeg",flex_space_between:"flex_space_between___RuZ2s",flex_box_vertical_center:"flex_box_vertical_center___2AGHP",flex_box_center_end:"flex_box_center_end___FDazu",flex_box_column:"flex_box_column___1Yqjx",wrp:"wrp____lZAZ",drawer:"drawer___2XpEN",menu:"menu___fZQrG",actived:"actived___1Yg9q",actived2:"actived2___2KHN5",subTag:"subTag___3AbgU",directionName:"directionName___2Xp-L",menuDirection:"menuDirection___1ZMmo",listItem:"listItem___g9W0X",info:"info___1FHWU",title:"title___1VzwI",titleLeft:"titleLeft___yvqaz",titleRight:"titleRight___2Dqm5",search:"search___3pcQt",description:"description___3yQGh",menuCourse:"menuCourse___3iBFc",paginationWrap:"paginationWrap___KxpDN"}},nnTU:function(ut,ve,U){"use strict";U.d(ve,"b",function(){return G}),U.d(ve,"a",function(){return K});var ne=U("MI8n"),Y=U("JYp7"),M=U("pmY6"),z=U("24hK"),P=U("746U"),F=U("Cg/j");const G=Object(F.c)("commandService"),K=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ne.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,I){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!I)throw new Error("invalid command");return this.registerCommand({id:n,handler:I})}if(n.description){const a=[];for(let l of n.description.args)a.push(l.constraint);const p=n.handler;n.handler=function(l,...u){return Object(P.o)(u,a),p(l,...u)}}const{id:b}=n;let f=this._commands.get(b);f||(f=new z.a,this._commands.set(b,f));let y=f.unshift(n),c=Object(M.i)(()=>{y();const a=this._commands.get(b);(a==null?void 0:a.isEmpty())&&this._commands.delete(b)});return this._onDidRegisterCommand.fire(b),c}registerCommandAlias(n,I){return K.registerCommand(n,(b,...f)=>b.get(G).executeCommand(I,...f))}getCommand(n){const I=this._commands.get(n);return!I||I.isEmpty()?void 0:Y.a.first(I)}getCommands(){const n=new Map;for(const I of this._commands.keys()){const b=this.getCommand(I);b&&n.set(I,b)}return n}};K.registerCommand("noop",()=>{})},osHv:function(ut,ve,U){(function(ne){ne(U("VrN/"))})(function(ne){"use strict";var Y=ne.Pos;function M(l,u){return l.line-u.line||l.ch-u.ch}var z="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",P=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",F=new RegExp("<(/?)(["+z+"]["+P+"]*)","g");function G(l,u,s,i){this.line=u,this.ch=s,this.cm=l,this.text=l.getLine(u),this.min=i?Math.max(i.from,l.firstLine()):l.firstLine(),this.max=i?Math.min(i.to-1,l.lastLine()):l.lastLine()}function K(l,u){var s=l.cm.getTokenTypeAt(Y(l.line,u));return s&&/\btag\b/.test(s)}function n(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function I(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function b(l){for(;;){var u=l.text.indexOf(">",l.ch);if(u==-1){if(n(l))continue;return}if(!K(l,u+1)){l.ch=u+1;continue}var s=l.text.lastIndexOf("/",u),i=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,i?"selfClose":"regular"}}function f(l){for(;;){var u=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}F.lastIndex=u,l.ch=u;var s=F.exec(l.text);if(s&&s.index==u)return s}}function y(l){for(;;){F.lastIndex=l.ch;var u=F.exec(l.text);if(!u){if(n(l))continue;return}if(!K(l,u.index+1)){l.ch=u.index+1;continue}return l.ch=u.index+u[0].length,u}}function c(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(I(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}var s=l.text.lastIndexOf("/",u),i=s>-1&&!/\S/.test(l.text.slice(s+1,u));return l.ch=u+1,i?"selfClose":"regular"}}function a(l,u){for(var s=[];;){var i=y(l),D,A=l.line,S=l.ch-(i?i[0].length:0);if(!i||!(D=b(l)))return;if(D=="selfClose")continue;if(i[1]){for(var R=s.length-1;R>=0;--R)if(s[R]==i[2]){s.length=R;break}if(R<0&&(!u||u==i[2]))return{tag:i[2],from:Y(A,S),to:Y(l.line,l.ch)}}else s.push(i[2])}}function p(l,u){for(var s=[];;){var i=c(l);if(!i)return;if(i=="selfClose"){f(l);continue}var D=l.line,A=l.ch,S=f(l);if(!S)return;if(S[1])s.push(S[2]);else{for(var R=s.length-1;R>=0;--R)if(s[R]==S[2]){s.length=R;break}if(R<0&&(!u||u==S[2]))return{tag:S[2],from:Y(l.line,l.ch),to:Y(D,A)}}}}ne.registerHelper("fold","xml",function(l,u){for(var s=new G(l,u.line,0);;){var i=y(s);if(!i||s.line!=u.line)return;var D=b(s);if(!D)return;if(!i[1]&&D!="selfClose"){var A=Y(s.line,s.ch),S=a(s,i[2]);return S&&M(S.from,A)>0?{from:A,to:S.from}:null}}}),ne.findMatchingTag=function(l,u,s){var i=new G(l,u.line,u.ch,s);if(i.text.indexOf(">")==-1&&i.text.indexOf("<")==-1)return;var D=b(i),A=D&&Y(i.line,i.ch),S=D&&f(i);if(!D||!S||M(i,u)>0)return;var R={from:Y(i.line,i.ch),to:A,tag:S[2]};return D=="selfClose"?{open:R,close:null,at:"open"}:S[1]?{open:p(i,S[2]),close:R,at:"close"}:(i=new G(l,A.line,A.ch,s),{open:R,close:a(i,S[2]),at:"open"})},ne.findEnclosingTag=function(l,u,s,i){for(var D=new G(l,u.line,u.ch,s);;){var A=p(D,i);if(!A)break;var S=new G(l,u.line,u.ch,s),R=a(S,A.tag);if(R)return{open:A,close:R}}},ne.scanForClosingTag=function(l,u,s,i){var D=new G(l,u.line,u.ch,i?{from:0,to:i}:null);return a(D,s)}})},p5ED:function(ut,ve,U){"use strict";var ne=U("+L6B"),Y=U("2/Rp"),M=U("5Dmo"),z=U("3S7+"),P=U("k1fw"),F=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),I=U("q1tI"),b=U.n(I),f=U("vHTk"),y=U.n(f),c=U("yEEn"),a=U("ZW9T"),p=U("1vsH"),l=U("V0Rq"),u=U("m3rI");ve.a=function(s){var i,D,A,S,R,O,m,v=s.editOffice,h=v===void 0?"view":v,d=s.data,C=s.theme,E=s.type,w=s.filename,j=s.monacoEditor,W=s.className,T=s.style,N=s.close,_=s.onClose,x=s.hasMask,H=s.disabledDownload,X=Object(I.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ee=Object(G.a)(X,2),J=ee[0],ce=ee[1],me=Object(I.useState)(""),ue=Object(G.a)(me,2),pe=ue[0],xe=ue[1],se=Object(I.useState)(),ae=Object(G.a)(se,2),Ce=ae[0],ze=ae[1],Ye=window.ENV==="build"?"/react/build":"",He=u.a.PROXY_SERVER||location.origin,Ve,Fe=1024*1024,Ke=10*Fe,nt=Object(I.useRef)();(i=d)!==null&&i!==void 0&&i.startsWith("/api")&&E!=="txt"&&(d=u.a.API_SERVER+d),E==="office"&&(Ve=Object(p.V)(d).filesize,Ve>Ke&&(E="other")),w&&j&&(j.filename=w),Object(I.useEffect)(function(){var Ue,rt,st=(Ue=document.cookie)===null||Ue===void 0||((rt=Ue.replace(/\s/g,""))===null||rt===void 0)?void 0:rt.split(";");st==null||st.map(function(dt){var at=dt.split("=");at[0]==="_educoder_session"&&xe(at[1])})},[]),Object(I.useEffect)(function(){E==="office"&&he()},[E,d]);var he=function(){var Ue=Object(F.a)(n.a.mark(function rt(){var st,dt,at;return n.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return console.log("data:",d),st=d,d.startsWith("http")||(st=location.origin+st),dt=new URL(st).pathname.split("/").pop(),gt.next=6,Object(l.V)({attachment_id:dt});case 6:at=gt.sent,ze(at);case 8:case"end":return gt.stop()}},rt)}));return function(){return Ue.apply(this,arguments)}}(),Re=function(){if(d.startsWith("http")||d.startsWith("blob:")){Ne();return}Object(p.B)(w||"educoder",d,w)},Ne=function(){Object(p.z)(w||"educoder",decodeURIComponent(d))};return b.a.createElement("div",{style:Object(P.a)({},T||{}),className:"".concat(x&&y.a.bgBlack," ").concat(E?y.a.wrp:"hide")},N&&b.a.createElement("div",{className:y.a.close,ref:nt},!H&&b.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return nt.current}},b.a.createElement("span",{onClick:Ne},b.a.createElement("i",{className:"icon-quxiaozhiding"}))),b.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return nt.current}},b.a.createElement("span",{className:"",onClick:_},b.a.createElement("i",{className:"icon-guanbi1"})))),b.a.createElement("div",{className:"".concat(y.a[W]," ").concat(W," ").concat(y.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&b.a.createElement(a.b,j)),E==="audio"&&b.a.createElement("audio",{src:"".concat(((D=d)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((A=d)===null||A===void 0?void 0:A.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),E==="video"&&b.a.createElement(b.a.Fragment,null,((S=d)===null||S===void 0?void 0:S.indexOf("http"))>-1?b.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):b.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),E==="office"&&Ce&&b.a.createElement("iframe",{src:"".concat(Ye,"/office.html?key=").concat(Ce.key,"&url=").concat(He+Ce.url,"&callbackUrl=").concat(He+Ce.callbackUrl,"&fileType=").concat(Ce.fileType,"&title=").concat(Ce.title,"&model=").concat(h,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),E==="html"&&b.a.createElement("iframe",{src:d+"&disposition=inline"}),E==="pdf"&&b.a.createElement("iframe",{src:"".concat(Ye,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!H)}),E==="image"&&b.a.createElement("img",{src:"".concat(((R=d)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((O=d)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(m=d)!==null&&m!==void 0&&m.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),E==="other"&&b.a.createElement("div",null,b.a.createElement(Y.a,{type:"primary",size:"large",onClick:Re},b.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&b.a.createElement(Y.a,{type:"primary",size:"large",onClick:Re},b.a.createElement(c.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ut,ve,U){},pmY6:function(ut,ve,U){"use strict";U.d(ve,"h",function(){return I}),U.d(ve,"g",function(){return f}),U.d(ve,"f",function(){return y}),U.d(ve,"e",function(){return c}),U.d(ve,"i",function(){return a}),U.d(ve,"b",function(){return p}),U.d(ve,"a",function(){return l}),U.d(ve,"d",function(){return u}),U.d(ve,"c",function(){return s});var ne=U("C/vA"),Y=U("JYp7");const M=!1;let z=null;function P(i){z=i}if(M){const i="__is_disposable_tracked__";P(new class{trackDisposable(D){const A=new Error("Potentially leaked disposable").stack;setTimeout(()=>{D[i]||console.log(A)},3e3)}setParent(D,A){if(D&&D!==l.None)try{D[i]=!0}catch(S){}}markAsDisposed(D){if(D&&D!==l.None)try{D[i]=!0}catch(A){}}markAsSingleton(D){}})}function F(i){return z==null||z.trackDisposable(i),i}function G(i){z==null||z.markAsDisposed(i)}function K(i,D){z==null||z.setParent(i,D)}function n(i,D){if(!z)return;for(const A of i)z.setParent(A,D)}function I(i){return z==null||z.markAsSingleton(i),i}class b extends Error{constructor(i){super(`Encountered errors while disposing of store. Errors: [${i.join(", ")}]`);this.errors=i}}function f(i){return typeof i.dispose=="function"&&i.dispose.length===0}function y(i){if(Y.a.is(i)){let D=[];for(const A of i)if(A)try{A.dispose()}catch(S){D.push(S)}if(D.length===1)throw D[0];if(D.length>1)throw new b(D);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function c(...i){const D=a(()=>y(i));return n(i,D),D}function a(i){const D=F({dispose:Object(ne.a)(()=>{G(D),i()})});return D}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,F(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{y(this._toDispose.values())}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return K(i,this),this._isDisposed?p.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}}p.DISABLE_DISPOSED_WARNING=!1;class l{constructor(){this._store=new p,F(this),K(this._store,this)}dispose(){G(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}}l.None=Object.freeze({dispose(){}});class u{constructor(){this._isDisposed=!1,F(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){var D;if(this._isDisposed||i===this._value)return;(D=this._value)===null||D===void 0||D.dispose(),i&&K(i,this),this._value=i}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,G(this),(i=this._value)===null||i===void 0||i.dispose(),this._value=void 0}clearAndLeak(){const i=this._value;return this._value=void 0,i&&K(i,null),i}}class s{constructor(i){this.object=i}dispose(){}}},psGv:function(ut,ve,U){var ne,Y;(function(){var M;(function(){"use strict";var G=[,,function(b){function f(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=[]}f.prototype.clone_empty=function(){var a=new f(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},f.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},f.prototype.has_match=function(a){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(a))return!0;return!1},f.prototype.set_indent=function(a,p){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=p||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},f.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var 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},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(a){this.__items.push(a);var p=a.lastIndexOf(`
`);p!==-1?this.__character_count=a.length-p:this.__character_count+=a.length},f.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var 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 y(a,p){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)),p=p||"",a.indent_level>0&&(p=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}y.prototype.get_indent_size=function(a,p){var l=this.__base_string_length;return p=p||0,a<0&&(l=0),l+=a*this.__indent_size,l+=p,l},y.prototype.get_indent_string=function(a,p){var l=this.__base_string;return p=p||0,a<0&&(a=0,l=""),p+=a*this.__indent_size,this.__ensure_cache(p),l+=this.__cache[p],l},y.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},y.prototype.__add_column=function(){var a=this.__cache.length,p=0,l="";this.__indent_size&&a>=this.__indent_size&&(p=Math.floor(a/this.__indent_size),a-=p*this.__indent_size,l=new Array(p+1).join(this.__indent_string)),a&&(l+=new Array(a+1).join(" ")),this.__cache.push(l)};function c(a,p){this.__indent_cache=new y(a,p),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 f(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,p){return this.__indent_cache.get_indent_string(a,p)},c.prototype.get_indent_size=function(a,p){return this.__indent_cache.get_indent_size(a,p)},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 p=this.current_line.pop();p&&(p[p.length-1]===`
`&&(p=p.replace(/\n+$/g,"")),this.current_line.push(p)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(`
`);return a!==`
`&&(l=l.replace(/[\n]/g,a)),l},c.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},c.prototype.set_indent=function(a,p){return a=a||0,p=p||0,this.next_line.set_indent(a,p),this.__lines.length>1?(this.current_line.set_indent(a,p),!0):(this.current_line.set_indent(),!1)},c.prototype.add_raw_token=function(a){for(var p=0;p<a.newlines;p++)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 p=this.__lines.length;a<p;)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,p){for(var l=this.__lines.length-2;l>=0;){var u=this.__lines[l];if(u.is_empty())break;if(u.item(0).indexOf(a)!==0&&u.item(-1)!==p){this.__lines.splice(l+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},b.exports.Output=c},function(b){function f(y,c,a,p){this.type=y,this.text=c,this.comments_before=null,this.newlines=a||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=f},,,function(b){function f(a,p){this.raw_options=y(a,p),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}f.prototype._get_array=function(a,p){var l=this.raw_options[a],u=p||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(u=l.concat()):typeof l=="string"&&(u=l.split(/[^a-zA-Z0-9_\/\-]+/)),u},f.prototype._get_boolean=function(a,p){var l=this.raw_options[a],u=l===void 0?!!p:!!l;return u},f.prototype._get_characters=function(a,p){var l=this.raw_options[a],u=p||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),u},f.prototype._get_number=function(a,p){var l=this.raw_options[a];p=parseInt(p,10),isNaN(p)&&(p=0);var u=parseInt(l,10);return isNaN(u)&&(u=p),u},f.prototype._get_selection=function(a,p,l){var u=this._get_selection_list(a,p,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+p+`
You passed in: '`+this.raw_options[a]+"'");return u[0]},f.prototype._get_selection_list=function(a,p,l){if(!p||p.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[p[0]],!this._is_valid_selection(l,p))throw new Error("Invalid Default Value!");var u=this._get_array(a,l);if(!this._is_valid_selection(u,p))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+p+`
You passed in: '`+this.raw_options[a]+"'");return u},f.prototype._is_valid_selection=function(a,p){return a.length&&p.length&&!a.some(function(l){return p.indexOf(l)===-1})};function y(a,p){var l={};a=c(a);var u;for(u in a)u!==p&&(l[u]=a[u]);if(p&&a[p])for(u in a[p])l[u]=a[p][u];return l}function c(a){var p={},l;for(l in a){var u=l.replace(/-/g,"_");p[u]=a[l]}return p}b.exports.Options=f,b.exports.normalizeOpts=c,b.exports.mergeOpts=y},,function(b){var f=RegExp.prototype.hasOwnProperty("sticky");function y(c){this.__input=c||"",this.__input_length=this.__input.length,this.__position=0}y.prototype.restart=function(){this.__position=0},y.prototype.back=function(){this.__position>0&&(this.__position-=1)},y.prototype.hasNext=function(){return this.__position<this.__input_length},y.prototype.next=function(){var c=null;return this.hasNext()&&(c=this.__input.charAt(this.__position),this.__position+=1),c},y.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},y.prototype.__match=function(c,a){c.lastIndex=a;var p=c.exec(this.__input);return p&&!(f&&c.sticky)&&(p.index!==a&&(p=null)),p},y.prototype.test=function(c,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(c,a):!1},y.prototype.testChar=function(c,a){var p=this.peek(a);return c.lastIndex=0,p!==null&&c.test(p)},y.prototype.match=function(c){var a=this.__match(c,this.__position);return a?this.__position+=a[0].length:a=null,a},y.prototype.read=function(c,a,p){var l="",u;return c&&(u=this.match(c),u&&(l+=u[0])),a&&(u||!c)&&(l+=this.readUntil(a,p)),l},y.prototype.readUntil=function(c,a){var p="",l=this.__position;c.lastIndex=this.__position;var u=c.exec(this.__input);return u?(l=u.index,a&&(l+=u[0].length)):l=this.__input_length,p=this.__input.substring(this.__position,l),this.__position=l,p},y.prototype.readUntilAfter=function(c){return this.readUntil(c,!0)},y.prototype.get_regexp=function(c,a){var p=null,l="g";return a&&f&&(l="y"),typeof c=="string"&&c!==""?p=new RegExp(c,l):c&&(p=new RegExp(c.source,l)),p},y.prototype.get_literal_regexp=function(c){return RegExp(c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},y.prototype.peekUntilAfter=function(c){var a=this.__position,p=this.readUntilAfter(c);return this.__position=a,p},y.prototype.lookBack=function(c){var a=this.__position-1;return a>=c.length&&this.__input.substring(a-c.length,a).toLowerCase()===c},b.exports.InputScanner=y},function(b,f,y){var c=y(8).InputScanner,a=y(3).Token,p=y(10).TokenStream,l=y(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(i,D){this._input=new c(i),this._options=D||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new p,this._reset();for(var i,D=new a(u.START,""),A=null,S=[],R=new p;D.type!==u.EOF;){for(i=this._get_next_token(D,A);this._is_comment(i);)R.add(i),i=this._get_next_token(D,A);R.isEmpty()||(i.comments_before=R,R=new p),i.parent=A,this._is_opening(i)?(S.push(A),A=i):A&&this._is_closing(i,A)&&(i.opened=A,A.closed=i,A=S.pop(),i.parent=A),i.previous=D,D.next=i,this.__tokens.add(i),D=i}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(i,D){this._readWhitespace();var A=this._input.read(/.+/g);return A?this._create_token(u.RAW,A):this._create_token(u.EOF,"")},s.prototype._is_comment=function(i){return!1},s.prototype._is_opening=function(i){return!1},s.prototype._is_closing=function(i,D){return!1},s.prototype._create_token=function(i,D){var A=new a(i,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return A},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=s,b.exports.TOKEN=u},function(b){function f(y){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=y}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var y=null;return this.hasNext()&&(y=this.__tokens[this.__position],this.__position+=1),y},f.prototype.peek=function(y){var c=null;return y=y||0,y+=this.__position,y>=0&&y<this.__tokens_length&&(c=this.__tokens[y]),c},f.prototype.add=function(y){this.__parent_token&&(y.parent=this.__parent_token),this.__tokens.push(y),this.__tokens_length+=1},b.exports.TokenStream=f},function(b,f,y){var c=y(12).Pattern;function a(p,l){c.call(this,p,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new c,a.prototype.__set_whitespace_patterns=function(p,l){p+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+p+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var p=this._input.read(this._match_pattern);if(p===" ")this.whitespace_before_token=" ";else if(p){var l=this.__split(this._newline_regexp,p);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return p},a.prototype.matching=function(p,l){var u=this._create();return u.__set_whitespace_patterns(p,l),u._update(),u},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(p,l){p.lastIndex=0;for(var u=0,s=[],i=p.exec(l);i;)s.push(l.substring(u,i.index)),u=i.index+i[0].length,i=p.exec(l);return u<l.length?s.push(l.substring(u,l.length)):s.push(""),s},b.exports.WhitespacePattern=a},function(b){function f(y,c){this._input=y,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)}f.prototype.read=function(){var y=this._input.read(this._starting_pattern);return(!this._starting_pattern||y)&&(y+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),y},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(y){var c=this._create();return c._until_after=!0,c._until_pattern=this._input.get_regexp(y),c._update(),c},f.prototype.until=function(y){var c=this._create();return c._until_after=!1,c._until_pattern=this._input.get_regexp(y),c._update(),c},f.prototype.starting_with=function(y){var c=this._create();return c._starting_pattern=this._input.get_regexp(y,!0),c._update(),c},f.prototype.matching=function(y){var c=this._create();return c._match_pattern=this._input.get_regexp(y,!0),c._update(),c},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},b.exports.Pattern=f},function(b){function f(y,c){y=typeof y=="string"?y:y.source,c=typeof c=="string"?c:c.source,this.__directives_block_pattern=new RegExp(y+/ beautify( \w+[:]\w+)+ /.source+c,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(y+/\sbeautify\signore:end\s/.source+c,"g")}f.prototype.get_directives=function(y){if(!y.match(this.__directives_block_pattern))return null;var c={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(y);a;)c[a[1]]=a[2],a=this.__directive_pattern.exec(y);return c},f.prototype.readIgnored=function(y){return y.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=f},function(b,f,y){var c=y(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function p(l,u){c.call(this,l,u),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),u&&(this.__template_pattern=this._input.get_regexp(u.__template_pattern),this._excluded=Object.assign(this._excluded,u._excluded),this._disabled=Object.assign(this._disabled,u._disabled));var s=new c(l);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}/)}}p.prototype=new c,p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){this.__set_templated_pattern()},p.prototype.disable=function(l){var u=this._create();return u._disabled[l]=!0,u._update(),u},p.prototype.read_options=function(l){var u=this._create();for(var s in a)u._disabled[s]=l.templating.indexOf(s)===-1;return u._update(),u},p.prototype.exclude=function(l){var u=this._create();return u._excluded[l]=!0,u._update(),u},p.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var u=this._read_template();u;)this._match_pattern?u+=this._input.read(this._match_pattern):u+=this._input.readUntil(this.__template_pattern),l+=u,u=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},p.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},p.prototype._read_template=function(){var l="",u=this._input.peek();if(u==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(l=l||this.__patterns.erb.read())}else u==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},b.exports.TemplatablePattern=p},,,,function(b,f,y){var c=y(19).Beautifier,a=y(20).Options;function p(l,u,s,i){var D=new c(l,u,s,i);return D.beautify()}b.exports=p,b.exports.defaultOptions=function(){return new a}},function(b,f,y){var c=y(20).Options,a=y(2).Output,p=y(21).Tokenizer,l=y(21).TOKEN,u=/\r\n|[\r\n]/,s=/\r\n|[\r\n]/g,i=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new a(C,E)};i.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},i.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},i.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},i.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},i.prototype.print_preserved_newlines=function(C){var E=0;C.type!==l.TEXT&&C.previous.type!==l.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var w=0;w<E;w++)this.print_newline(w>0);return E!==0},i.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},i.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},i.prototype.print_newline=function(C){this._output.add_new_line(C)},i.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},i.prototype.indent=function(){this.indent_level++},i.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var D=function(C){for(var E=null,w=C.next;w.type!==l.EOF&&C.closed!==w;){if(w.type===l.ATTRIBUTE&&w.text==="type"){w.next&&w.next.type===l.EQUALS&&w.next.next&&w.next.next.type===l.VALUE&&(E=w.next.next.text);break}w=w.next}return E},A=function(C,E){var w=null,j=null;return E.closed?(C==="script"?w="text/javascript":C==="style"&&(w="text/css"),w=D(E)||w,w.search("text/css")>-1?j="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?j="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?j="html":w.search(/test\/null/)>-1&&(j="null"),j):null};function S(C,E){return E.indexOf(C)!==-1}function R(C,E,w){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=w||0,this.parser_token=E||null}function O(C){this._printer=C,this._current_frame=null}O.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},O.prototype.record_tag=function(C){var E=new R(this._current_frame,C,this._printer.indent_level);this._current_frame=E},O.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},O.prototype._get_frame=function(C,E){for(var w=this._current_frame;w&&!(C.indexOf(w.tag)!==-1);){if(E&&E.indexOf(w.tag)!==-1){w=null;break}w=w.parent}return w},O.prototype.try_pop=function(C,E){var w=this._get_frame([C],E);return this._try_pop_frame(w)},O.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function m(C,E,w,j){this._source_text=C||"",E=E||{},this._js_beautify=w,this._css_beautify=j,this._tag_stack=null;var W=new c(E,"html");this._options=W,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"}m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
`,C&&u.test(C)&&(E=C.match(u)[0])),C=C.replace(s,`
`);var w=C.match(/^[\t ]*/)[0],j={text:"",type:""},W=new v,T=new i(this._options,w),N=new p(C,this._options).tokenize();this._tag_stack=new O(T);for(var _=null,x=N.next();x.type!==l.EOF;)x.type===l.TAG_OPEN||x.type===l.COMMENT?(_=this._handle_tag_open(T,x,W,j),W=_):x.type===l.ATTRIBUTE||x.type===l.EQUALS||x.type===l.VALUE||x.type===l.TEXT&&!W.tag_complete?_=this._handle_inside_tag(T,x,W,N):x.type===l.TAG_CLOSE?_=this._handle_tag_close(T,x,W):x.type===l.TEXT?_=this._handle_text(T,x,W):T.add_raw_token(x),j=_,x=N.next();var H=T._output.get_code(E);return H},m.prototype._handle_tag_close=function(C,E,w){var j={text:E.text,type:E.type};return C.alignment_size=0,w.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),w.is_unformatted?C.add_raw_token(E):(w.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&w.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),w.indent_content&&!(w.is_unformatted||w.is_content_unformatted)&&(C.indent(),w.indent_content=!1),!w.is_inline_element&&!(w.is_unformatted||w.is_content_unformatted)&&C.set_wrap_point(),j},m.prototype._handle_inside_tag=function(C,E,w,j){var W=w.has_wrapped_attrs,T={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),w.is_unformatted)C.add_raw_token(E);else if(w.tag_start_char==="{"&&E.type===l.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===l.ATTRIBUTE?(C.set_space_before_token(!0),w.attr_count+=1):(E.type===l.EQUALS||E.type===l.VALUE&&E.previous.type===l.EQUALS)&&C.set_space_before_token(!1),E.type===l.ATTRIBUTE&&w.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),W=W||E.newlines!==0),this._is_wrap_attributes_force)){var N=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var _=!0,x=0,H;do{if(H=j.peek(x),H.type===l.ATTRIBUTE){_=!1;break}x+=1}while(x<4&&H.type!==l.EOF&&H.type!==l.TAG_CLOSE);N=!_}N&&(C.print_newline(!1),W=!0)}C.print_token(E),W=W||C.previous_token_wrapped(),w.has_wrapped_attrs=W}return T},m.prototype._handle_text=function(C,E,w){var j={text:E.text,type:"TK_CONTENT"};return w.custom_beautifier_name?this._print_custom_beatifier_text(C,E,w):w.is_unformatted||w.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),j},m.prototype._print_custom_beatifier_text=function(C,E,w){var j=this;if(E.text!==""){var W=E.text,T,N=1,_="",x="";w.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?T=this._js_beautify:w.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?T=this._css_beautify:w.custom_beautifier_name==="html"&&(T=function(me,ue){var pe=new m(me,ue,j._js_beautify,j._css_beautify);return pe.beautify()}),this._options.indent_scripts==="keep"?N=0:this._options.indent_scripts==="separate"&&(N=-C.indent_level);var H=C.get_full_indent(N);if(W=W.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(<!--|<!\[CDATA\[)/)){var X=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(W);if(!X){C.add_raw_token(E);return}_=H+X[1]+`
`,W=X[4],X[5]&&(x=H+X[5]),W=W.replace(/\n[ \t]*$/,""),(X[2]||X[3].indexOf(`
`)!==-1)&&(X=X[3].match(/[ \t]+$/),X&&(E.whitespace_before=X[0]))}if(W)if(T){var ee=function(){this.eol=`
`};ee.prototype=this._options.raw_options;var J=new ee;W=T(H+W,J)}else{var ce=E.whitespace_before;ce&&(W=W.replace(new RegExp(`
(`+ce+")?","g"),`
`)),W=H+W.replace(/\n/g,`
`+H)}_&&(W?W=_+W+`
`+x:W=_+x),C.print_newline(!1),W&&(E.text=W,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},m.prototype._handle_tag_open=function(C,E,w,j){var W=this._get_tag_open_token(E);return(w.is_unformatted||w.is_content_unformatted)&&!w.is_empty_element&&E.type===l.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),W.start_tag_token=this._tag_stack.try_pop(W.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,W,w,j),W.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(W.alignment_size=E.text.length+1),!W.tag_complete&&!W.is_unformatted&&(C.alignment_size=W.alignment_size),W};var v=function(C,E){if(this.parent=C||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="",!E)this.tag_complete=!0;else{var w;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(w=E.text.match(/^<([^\s>]*)/),this.tag_check=w?w[1]:""):(w=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=w?w[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===l.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||E.closed&&E.closed.text==="/>";var j=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(j=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(j)))}};m.prototype._get_tag_open_token=function(C){var E=new v(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||S(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&S(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&S(E.tag_check,this._options.content_unformatted),E.is_inline_element=S(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},m.prototype._set_tag_position=function(C,E,w,j,W){if(w.is_empty_element||(w.is_end_tag?w.start_tag_token=this._tag_stack.try_pop(w.tag_name):(this._do_optional_end_element(w)&&(w.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(w),(w.tag_name==="script"||w.tag_name==="style")&&!(w.is_unformatted||w.is_content_unformatted)&&(w.custom_beautifier_name=A(w.tag_check,E)))),S(w.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),w.is_empty_element){if(w.tag_start_char==="{"&&w.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),w.indent_content=!0;var T=C.current_line_has_match(/{{#if/);T||C.print_newline(!1)}w.tag_name==="!--"&&W.type===l.TAG_CLOSE&&j.is_end_tag&&w.text.indexOf(`
`)===-1||(w.is_inline_element||w.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,w))}else if(w.is_end_tag){var N=!1;N=w.start_tag_token&&w.start_tag_token.multiline_content,N=N||!w.is_inline_element&&!(j.is_inline_element||j.is_unformatted)&&!(W.type===l.TAG_CLOSE&&w.start_tag_token===j)&&W.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(N=!1),N&&C.print_newline(!1)}else w.indent_content=!w.custom_beautifier_name,w.tag_start_char==="<"&&(w.tag_name==="html"?w.indent_content=this._options.indent_inner_html:w.tag_name==="head"?w.indent_content=this._options.indent_head_inner_html:w.tag_name==="body"&&(w.indent_content=this._options.indent_body_inner_html)),!(w.is_inline_element||w.is_unformatted)&&(W.type!=="TK_CONTENT"||w.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,w)},m.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var 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"],d=["a","audio","del","ins","map","noscript","video"];m.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&h.indexOf(C.tag_name)!==-1){var w=C.parent.parent;(!w||d.indexOf(w.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},b.exports.Beautifier=m},function(b,f,y){var c=y(6).Options;function a(p){c.call(this,p,"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,b.exports.Options=a},function(b,f,y){var c=y(9).Tokenizer,a=y(9).TOKEN,p=y(13).Directives,l=y(14).TemplatablePattern,u=y(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},i=new p(/<\!--/,/-->/),D=function(A,S){c.call(this,A,S),this._current_tag_name="";var R=new l(this._input).read_options(this._options),O=new u(this._input);if(this.__patterns={word:R.until(/[\n\r\t <]/),single_quote:R.until_after(/'/),double_quote:R.until_after(/"/),attribute:R.until(/[\n\r\t =>]|\/>/),element_name:R.until(/[\n\r\t >\/]/),handlebars_comment:O.starting_with(/{{!--/).until_after(/--}}/),handlebars:O.starting_with(/{{/).until_after(/}}/),handlebars_open:O.until(/[\n\r\t }]/),handlebars_raw_close:O.until(/}}/),comment:O.starting_with(/<!--/).until_after(/-->/),cdata:O.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:O.starting_with(/<!\[/).until_after(/]>/),processing:O.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 m=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(m).until_after(m)}};D.prototype=new c,D.prototype._is_comment=function(A){return!1},D.prototype._is_opening=function(A){return A.type===s.TAG_OPEN},D.prototype._is_closing=function(A,S){return A.type===s.TAG_CLOSE&&S&&((A.text===">"||A.text==="/>")&&S.text[0]==="<"||A.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},D.prototype._reset=function(){this._current_tag_name=""},D.prototype._get_next_token=function(A,S){var R=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(s.EOF,""):(R=R||this._read_open_handlebars(O,S),R=R||this._read_attribute(O,A,S),R=R||this._read_close(O,S),R=R||this._read_raw_content(O,A,S),R=R||this._read_content_word(O),R=R||this._read_comment_or_cdata(O),R=R||this._read_processing(O),R=R||this._read_open(O,S),R=R||this._create_token(s.UNKNOWN,this._input.next()),R)},D.prototype._read_comment_or_cdata=function(A){var S=null,R=null,O=null;if(A==="<"){var m=this._input.peek(1);m==="!"&&(R=this.__patterns.comment.read(),R?(O=i.get_directives(R),O&&O.ignore==="start"&&(R+=i.readIgnored(this._input))):R=this.__patterns.cdata.read()),R&&(S=this._create_token(s.COMMENT,R),S.directives=O)}return S},D.prototype._read_processing=function(A){var S=null,R=null,O=null;if(A==="<"){var m=this._input.peek(1);(m==="!"||m==="?")&&(R=this.__patterns.conditional_comment.read(),R=R||this.__patterns.processing.read()),R&&(S=this._create_token(s.COMMENT,R),S.directives=O)}return S},D.prototype._read_open=function(A,S){var R=null,O=null;return S||A==="<"&&(R=this._input.next(),this._input.peek()==="/"&&(R+=this._input.next()),R+=this.__patterns.element_name.read(),O=this._create_token(s.TAG_OPEN,R)),O},D.prototype._read_open_handlebars=function(A,S){var R=null,O=null;return S||this._options.indent_handlebars&&A==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(R=this.__patterns.handlebars_comment.read(),R=R||this.__patterns.handlebars.read(),O=this._create_token(s.COMMENT,R)):(R=this.__patterns.handlebars_open.read(),O=this._create_token(s.TAG_OPEN,R))),O},D.prototype._read_close=function(A,S){var R=null,O=null;return S&&(S.text[0]==="<"&&(A===">"||A==="/"&&this._input.peek(1)===">")?(R=this._input.next(),A==="/"&&(R+=this._input.next()),O=this._create_token(s.TAG_CLOSE,R)):S.text[0]==="{"&&A==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(s.TAG_CLOSE,"}}"))),O},D.prototype._read_attribute=function(A,S,R){var O=null,m="";if(R&&R.text[0]==="<")if(A==="=")O=this._create_token(s.EQUALS,this._input.next());else if(A==='"'||A==="'"){var v=this._input.next();A==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,v)}else m=this.__patterns.attribute.read(),m&&(S.type===s.EQUALS?O=this._create_token(s.VALUE,m):O=this._create_token(s.ATTRIBUTE,m));return O},D.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)},D.prototype._read_raw_content=function(A,S,R){var O="";if(R&&R.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===s.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var m=S.opened.text.substr(1).toLowerCase();if(m==="script"||m==="style"){var v=this._read_comment_or_cdata(A);if(v)return v.type=s.TEXT,v;O=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(m)&&(O=this._input.readUntil(new RegExp("</"+m+"[\\n\\r\\t ]*?>","ig")))}return O?this._create_token(s.TEXT,O):null},D.prototype._read_content_word=function(A){var S="";if(this._options.unformatted_content_delimiter&&(A===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(s.TEXT,S)},b.exports.Tokenizer=D,b.exports.TOKEN=s}],K={};function n(b){var f=K[b];if(f!==void 0)return f.exports;var y=K[b]={exports:{}};return G[b](y,y.exports,n),y.exports}var I=n(18);M=I})();var z=M;if(!0)!(ne=[U,U("6UM0"),U("TXwP")],Y=function(G){var K=U("6UM0"),n=U("TXwP");return{html_beautify:function(I,b){return z(I,b,K.js_beautify,n.css_beautify)}}}.apply(ve,ne),Y!==void 0&&(ut.exports=Y));else var P,F})()},rUJ1:function(ut,ve){const U=/[&<>"']/,ne=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P=O=>z[O];function F(O,m){if(m){if(U.test(O))return O.replace(ne,P)}else if(Y.test(O))return O.replace(M,P);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function K(O){return O.replace(G,(m,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const n=/(^|[^\[])\^/g;function I(O,m){O=O.source||O,m=m||"";const v={replace:(h,d)=>(d=d.source||d,d=d.replace(n,"$1"),O=O.replace(h,d),v),getRegex:()=>new RegExp(O,m)};return v}const b=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function y(O,m,v){if(O){let h;try{h=decodeURIComponent(K(v)).replace(b,"").toLowerCase()}catch(d){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}m&&!f.test(v)&&(v=u(m,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(h){return null}return v}const c={},a=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,m){c[" "+O]||(a.test(O)?c[" "+O]=O+"/":c[" "+O]=A(O,"/",!0)),O=c[" "+O];const v=O.indexOf(":")===-1;return m.substring(0,2)==="//"?v?m:O.replace(p,"$1")+m:m.charAt(0)==="/"?v?m:O.replace(l,"$1")+m:O+m}const s={exec:function(){}};function i(O){let m=1,v,h;for(;m<arguments.length;m++){v=arguments[m];for(h in v)Object.prototype.hasOwnProperty.call(v,h)&&(O[h]=v[h])}return O}function D(O,m){const v=O.replace(/\|/g,(C,E,w)=>{let j=!1,W=E;for(;--W>=0&&w[W]==="\\";)j=!j;return j?"|":" |"}),h=v.split(/ \|/);let d=0;if(h.length>m)h.splice(m);else for(;h.length<m;)h.push("");for(;d<h.length;d++)h[d]=h[d].trim().replace(/\\\|/g,"|");return h}function A(O,m,v){const h=O.length;if(h===0)return"";let d=0;for(;d<h;){const C=O.charAt(h-d-1);if(C===m&&!v)d++;else if(C!==m&&v)d++;else break}return O.substr(0,h-d)}function S(O,m){if(O.indexOf(m[1])===-1)return-1;const v=O.length;let h=0,d=0;for(;d<v;d++)if(O[d]==="\\")d++;else if(O[d]===m[0])h++;else if(O[d]===m[1]&&(h--,h<0))return d;return-1}function R(O){O&&O.sanitize&&!O.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")}ut.exports={escape:F,unescape:K,edit:I,cleanUrl:y,resolveUrl:u,noopTest:s,merge:i,splitCells:D,rtrim:A,findClosingBracket:S,checkSanitizeDeprecation:R}},sboe:function(ut,ve,U){"use strict";U.d(ve,"a",function(){return M});var ne=U("q1tI"),Y=U.n(ne),M=ne.createContext(null)},sesT:function(ut,ve){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAoCAYAAACb3CikAAAAAXNSR0IArs4c6QAABJFJREFUWEftWF1oHFUU/u7MZmazm4Q0tS/RmARSba0tDVazqyB9sVYlDzWRllopErWlER9EFFGRIuqDT0UoQaO0adKkQqui+FKhQmqSQn8o1cbYQH9Iia3QNN387Pwemdmdyd472Z0kRMhD7ssddu4997vnfOc7Z5YRkYwlMNgyECEKyx4RabmEPfL39mdham0EqgIYAEJmDg7xrbfSmZ3BGECUmZ3hPWfnFCB/gbXHP3PXillDf754lQhVsxrKQvIO8jHm/SEUKiQluhYPHb0SAGJdajYzXuBvMKtHGAMRgXlXnqceOXsjUrQJj3b9KAD5jZkXDxqePQKBgcGZXQ9ln53ZBSq8DxAwZL1rT2JvFq0/1iYA+TKiXzidnjEY5lr+aMczuR7ynp0572DS58rG7o94IKP7VW10aNLbKJItQN5c9mVcxnE78FoMpRNWST6s1He28ECG3oulUyP3/NAQoNS+Drl0zTyj76UND8y6NwjjWrubPV4yADgZ3dT1HA/kwlsVU8bYbf9UIqhVjZDj1XmAzC901uR1aCM/+7ZcpjF2tvjxjgQHZPqP1kp7YuKGLxuiMATgBJSDd0EAZ1ZUfM4wR0CG4g0d6zgg2vnWWkObuJIvDiIZxXVzImfOpqxHbsYTh6o5IPr5fesMffKiH0SBfcF0FnWXd0FY+ru7mTQeTxxayQFJn9uTNPWp3nw6EaYjhQtCMK0coBKYGUt2RDkgU2dbtpCh/+Ipq5OPal0LImWLkzXm+CC04W+zPMpmDpgWSx6J82Qd2N1sk9XjhdG5ofJgIyIli5M15sQ1aNd/8qtgthZOxJKd5bxHBl55A2Qf9JVQULSwZA0PDU/vTM6xu7Fk5308R87s+sC27P1e+gaVMX9Zn0VYg8VZSDP3nmC348muSt4j/S8fAOzWXOXL7ScClkNdEKb5LvzLseTRDTxH+nYcI6DJ54hYxAL9iChQC6gEDL/Gkj1bRSADYNiUWy3V1Xsglz2ygBOCRdAavwx9+KucCkKQZOlItKH7VR5I//ZREFbNSDxBqd4GuaR2cWpN6ir0Gz/w/Y3EPo0lej6eAXJpX9l06t87fIcappSCshZqUvNcRZbVl5SGzu99IOaZnUnD1Ho9W16Z5sgqGJt3VonNNIDi4hU1qG8f8YFo/U2vEdlt3FniSWLnM19hEe1J0j/R5IkH3Et7Xbzev+0bsq3duUBCinzh74W50JtF2tUnT+zlgfQ1/gWiukL7w9qTMFkRHSJH1GciieOnZoCca16tp6cGuS+g2RAFm1hBswVdKfyFdVN56t0aYLPbOLqhMfteeJ/I+iQARDAkNj4BD+RZb7BSjKeLUEK3XJbpKEdRRf3h0voPW3zxJPpOMU5/PQxQVRj35hL2QNcG4K6pYnLsFmyDYKQJKzfstVZtfHoF8PCUD8T8fcsOss3uhRwStseCjRQB2nQaZtoCiqpRvv5tirKxd9T7nz+Qu58ZvZv7GZBwfgxr7ebSk1pQYbAYdNuEIREiJXWAUoNI+RNQKh6DfOdUj1K5dZd4iSX8t0SYv/+n98seER37H8mkzkc00C7pAAAAAElFTkSuQmCC"},spXi:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___2B_Y7",flex_space_between:"flex_space_between___2olzC",flex_box_vertical_center:"flex_box_vertical_center___2Z4dV",flex_box_center_end:"flex_box_center_end___3FiwX",flex_box_column:"flex_box_column___8kyK-",customTree:"customTree___1KOYx",name:"name___3pqs4"}},t23M:function(ut,ve,U){"use strict";var ne=U("VTBJ"),Y=U("1OyB"),M=U("vuIU"),z=U("Ji7U"),P=U("LK+K"),F=U("q1tI"),G=U.n(F),K=U("m+aA"),n=U("Zm9Q"),I=U("Kwbf"),b=U("c+Xe"),f=U("bdgK"),y="rc-observer-key",c=function(a){Object(z.a)(l,a);var p=Object(P.a)(l);function l(){var u;return Object(Y.a)(this,l),u=p.apply(this,arguments),u.resizeObserver=null,u.childNode=null,u.currentElement=null,u.state={width:0,height:0,offsetHeight:0,offsetWidth:0},u.onResize=function(s){var i=u.props.onResize,D=s[0].target,A=D.getBoundingClientRect(),S=A.width,R=A.height,O=D.offsetWidth,m=D.offsetHeight,v=Math.floor(S),h=Math.floor(R);if(u.state.width!==v||u.state.height!==h||u.state.offsetWidth!==O||u.state.offsetHeight!==m){var d={width:v,height:h,offsetWidth:O,offsetHeight:m};u.setState(d),i&&Promise.resolve().then(function(){i(Object(ne.a)(Object(ne.a)({},d),{},{offsetWidth:O,offsetHeight:m}))})}},u.setChildNode=function(s){u.childNode=s},u}return Object(M.a)(l,[{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 i=Object(K.a)(this.childNode||this),D=i!==this.currentElement;D&&(this.destroyObserver(),this.currentElement=i),!this.resizeObserver&&i&&(this.resizeObserver=new f.default(this.onResize),this.resizeObserver.observe(i))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var s=this.props.children,i=Object(n.a)(s);if(i.length>1)Object(I.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(I.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var D=i[0];if(F.isValidElement(D)&&Object(b.c)(D)){var A=D.ref;i[0]=F.cloneElement(D,{ref:Object(b.a)(A,this.setChildNode)})}return i.length===1?i[0]:i.map(function(S,R){return!F.isValidElement(S)||"key"in S&&S.key!==null?S:F.cloneElement(S,{key:"".concat(y,"-").concat(R)})})}}]),l}(F.Component);c.displayName="ResizeObserver",ve.a=c},t9D7:function(ut,ve,U){"use strict";U.d(ve,"b",function(){return G}),U.d(ve,"g",function(){return n}),U.d(ve,"d",function(){return I}),U.d(ve,"e",function(){return b}),U.d(ve,"a",function(){return f}),U.d(ve,"f",function(){return a}),U.d(ve,"c",function(){return p});var ne=U("Vhoy"),Y=U("MI8n"),M=U("pmY6"),z=U("Cg/j"),P=U("ic2d"),F=U("nEHx");const G=Object(z.c)("themeService");var K;(function(l){function u(s){return s&&typeof s=="object"&&typeof s.id=="string"}l.isThemeColor=u})(K||(K={}));function n(l){return{id:l}}var I;(function(l){function u(R){return R&&typeof R=="object"&&typeof R.id=="string"&&(typeof R.color=="undefined"||K.isThemeColor(R.color))}l.isThemeIcon=u;const s=new RegExp(`^\\$\\((${ne.a.iconNameExpression}(?:${ne.a.iconModifierExpression})?)\\)$`);function i(R){const O=s.exec(R);if(!O)return;let[,m]=O;return{id:m}}l.fromString=i;function D(R,O){let m=R.id;const v=m.lastIndexOf("~");return v!==-1&&(m=m.substring(0,v)),O&&(m=`${m}~${O}`),{id:m}}l.modify=D;function A(R,O){var m,v;return R.id===O.id&&((m=R.color)===null||m===void 0?void 0:m.id)===((v=O.color)===null||v===void 0?void 0:v.id)}l.isEqual=A;function S(R,O){return{id:R.id,color:O?n(O):void 0}}l.asThemeIcon=S,l.asClassNameArray=ne.a.asClassNameArray,l.asClassName=ne.a.asClassName,l.asCSSSelector=ne.a.asCSSSelector})(I||(I={}));function b(l){switch(l){case F.a.DARK:return"vs-dark";case F.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class y{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Y.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(M.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let c=new y;P.a.add(f.ThemingContribution,c);function a(l){return c.onColorThemeChange(l)}class p extends M.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(u=>this.onThemeChange(u)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},tK3L:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___3uV00",flex_space_between:"flex_space_between___253zc",flex_box_vertical_center:"flex_box_vertical_center___3Nn4F",flex_box_center_end:"flex_box_center_end___3N00E",flex_box_column:"flex_box_column___wngbD",page:"page___1qj_b",wrap:"wrap___1vIxE",title:"title___3EB7K",select:"select___3yoep",contentWrap:"contentWrap___2vBaG",pngIcon:"pngIcon___3tbYk",tabsWrap:"tabsWrap___35WZr",searchWrap:"searchWrap___3zxJK",addQuestionBtn:"addQuestionBtn___3pN4A",search:"search___Qt6zp",searchIcon:"searchIcon___1fYTO",batchWrap:"batchWrap___1QFBy",customTable:"customTable___4pmq7",row:"row___mgwpl",contentListWrap:"contentListWrap___sfO91",li:"li___2kFZ7",bottom:"bottom___1-hPm",actionLeftItem:"actionLeftItem___3mz5t",questionTypeName:"questionTypeName___2Vr34",more:"more___Oo-pR",btnAdd:"btnAdd___3ROdW",cancelC:"cancelC___3SmK1",addC:"addC___3VFkF",actonBtn:"actonBtn___3j8EO",batch:"batch___1YJ8c",btns:"btns___33g-Q",btn:"btn___3yAUt",treeWrapper:"treeWrapper___3Sn4Z",treeHeader:"treeHeader___1fITD",treeContent:"treeContent___3wYv9",action:"action___2Ys8R",sendModal:"sendModal___3kKOa",line:"line___2PBOX",del:"del___1X0CN",divider:"divider___3XDiC",headerWrapper:"headerWrapper___3F2Wp",exportBtn:"exportBtn___3nux1"}},ulZh:function(ut,ve,U){typeof window!="undefined"&&function(Y,M){ut.exports=M()}(this,function(){return function(ne){var Y={};function M(z){if(Y[z])return Y[z].exports;var P=Y[z]={i:z,l:!1,exports:{}};return ne[z].call(P.exports,P,P.exports,M),P.l=!0,P.exports}return M.m=ne,M.c=Y,M.d=function(z,P,F){M.o(z,P)||Object.defineProperty(z,P,{enumerable:!0,get:F})},M.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},M.t=function(z,P){if(P&1&&(z=M(z)),P&8)return z;if(P&4&&typeof z=="object"&&z&&z.__esModule)return z;var F=Object.create(null);if(M.r(F),Object.defineProperty(F,"default",{enumerable:!0,value:z}),P&2&&typeof z!="string")for(var G in z)M.d(F,G,function(K){return z[K]}.bind(null,G));return F},M.n=function(z){var P=z&&z.__esModule?function(){return z.default}:function(){return z};return M.d(P,"a",P),P},M.o=function(z,P){return Object.prototype.hasOwnProperty.call(z,P)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ne,Y,M){"use strict";var z=Object.prototype.hasOwnProperty,P="~";function F(){}Object.create&&(F.prototype=Object.create(null),new F().__proto__||(P=!1));function G(b,f,y){this.fn=b,this.context=f,this.once=y||!1}function K(b,f,y,c,a){if(typeof y!="function")throw new TypeError("The listener must be a function");var p=new G(y,c||b,a),l=P?P+f:f;return b._events[l]?b._events[l].fn?b._events[l]=[b._events[l],p]:b._events[l].push(p):(b._events[l]=p,b._eventsCount++),b}function n(b,f){--b._eventsCount===0?b._events=new F:delete b._events[f]}function I(){this._events=new F,this._eventsCount=0}I.prototype.eventNames=function(){var f=[],y,c;if(this._eventsCount===0)return f;for(c in y=this._events)z.call(y,c)&&f.push(P?c.slice(1):c);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(y)):f},I.prototype.listeners=function(f){var y=P?P+f:f,c=this._events[y];if(!c)return[];if(c.fn)return[c.fn];for(var a=0,p=c.length,l=new Array(p);a<p;a++)l[a]=c[a].fn;return l},I.prototype.listenerCount=function(f){var y=P?P+f:f,c=this._events[y];return c?c.fn?1:c.length:0},I.prototype.emit=function(f,y,c,a,p,l){var u=P?P+f:f;if(!this._events[u])return!1;var s=this._events[u],i=arguments.length,D,A;if(s.fn){s.once&&this.removeListener(f,s.fn,void 0,!0);switch(i){case 1:return s.fn.call(s.context),!0;case 2:return s.fn.call(s.context,y),!0;case 3:return s.fn.call(s.context,y,c),!0;case 4:return s.fn.call(s.context,y,c,a),!0;case 5:return s.fn.call(s.context,y,c,a,p),!0;case 6:return s.fn.call(s.context,y,c,a,p,l),!0}for(A=1,D=new Array(i-1);A<i;A++)D[A-1]=arguments[A];s.fn.apply(s.context,D)}else{var S=s.length,R;for(A=0;A<S;A++){s[A].once&&this.removeListener(f,s[A].fn,void 0,!0);switch(i){case 1:s[A].fn.call(s[A].context);break;case 2:s[A].fn.call(s[A].context,y);break;case 3:s[A].fn.call(s[A].context,y,c);break;case 4:s[A].fn.call(s[A].context,y,c,a);break;default:if(!D)for(R=1,D=new Array(i-1);R<i;R++)D[R-1]=arguments[R];s[A].fn.apply(s[A].context,D)}}}return!0},I.prototype.on=function(f,y,c){return K(this,f,y,c,!1)},I.prototype.once=function(f,y,c){return K(this,f,y,c,!0)},I.prototype.removeListener=function(f,y,c,a){var p=P?P+f:f;if(!this._events[p])return this;if(!y)return n(this,p),this;var l=this._events[p];if(l.fn)l.fn===y&&(!a||l.once)&&(!c||l.context===c)&&n(this,p);else{for(var u=0,s=[],i=l.length;u<i;u++)(l[u].fn!==y||a&&!l[u].once||c&&l[u].context!==c)&&s.push(l[u]);s.length?this._events[p]=s.length===1?s[0]:s:n(this,p)}return this},I.prototype.removeAllListeners=function(f){var y;return f?(y=P?P+f:f,this._events[y]&&n(this,y)):(this._events=new F,this._eventsCount=0),this},I.prototype.off=I.prototype.removeListener,I.prototype.addListener=I.prototype.on,I.prefixed=P,I.EventEmitter=I,ne.exports=I},"./node_modules/url-toolkit/src/url-toolkit.js":function(ne,Y,M){(function(z){var P=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,F=/^([^\/?#]*)([^]*)$/,G=/(?:\/|^)\.(?=\/)/g,K=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,n={buildAbsoluteURL:function(I,b,f){if(f=f||{},I=I.trim(),b=b.trim(),!b){if(!f.alwaysNormalize)return I;var y=n.parseURL(I);if(!y)throw new Error("Error trying to parse base URL.");return y.path=n.normalizePath(y.path),n.buildURLFromParts(y)}var c=n.parseURL(b);if(!c)throw new Error("Error trying to parse relative URL.");if(c.scheme)return f.alwaysNormalize?(c.path=n.normalizePath(c.path),n.buildURLFromParts(c)):b;var a=n.parseURL(I);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var p=F.exec(a.path);a.netLoc=p[1],a.path=p[2]}a.netLoc&&!a.path&&(a.path="/");var l={scheme:a.scheme,netLoc:c.netLoc,path:null,params:c.params,query:c.query,fragment:c.fragment};if(!c.netLoc&&(l.netLoc=a.netLoc,c.path[0]!=="/"))if(!c.path)l.path=a.path,c.params||(l.params=a.params,c.query||(l.query=a.query));else{var u=a.path,s=u.substring(0,u.lastIndexOf("/")+1)+c.path;l.path=n.normalizePath(s)}return l.path===null&&(l.path=f.alwaysNormalize?n.normalizePath(c.path):c.path),n.buildURLFromParts(l)},parseURL:function(I){var b=P.exec(I);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(I){for(I=I.split("").reverse().join("").replace(G,"");I.length!==(I=I.replace(K,"")).length;);return I.split("").reverse().join("")},buildURLFromParts:function(I){return I.scheme+I.netLoc+I.path+I.params+I.query+I.fragment}};ne.exports=n})(this)},"./node_modules/webworkify-webpack/index.js":function(ne,Y,M){function z(f){var y={};function c(p){if(y[p])return y[p].exports;var l=y[p]={i:p,l:!1,exports:{}};return f[p].call(l.exports,l,l.exports,c),l.l=!0,l.exports}c.m=f,c.c=y,c.i=function(p){return p},c.d=function(p,l,u){c.o(p,l)||Object.defineProperty(p,l,{configurable:!1,enumerable:!0,get:u})},c.r=function(p){Object.defineProperty(p,"__esModule",{value:!0})},c.n=function(p){var l=p&&p.__esModule?function(){return p.default}:function(){return p};return c.d(l,"a",l),l},c.o=function(p,l){return Object.prototype.hasOwnProperty.call(p,l)},c.p="/",c.oe=function(p){throw console.error(p),p};var a=c(c.s=ENTRY_MODULE);return a.default||a}var P="[\\.|\\-|\\+|\\w|/|@]+",F="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+P+").*?\\)";function G(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function K(f){return!isNaN(1*f)}function n(f,y,c){var a={};a[c]=[];var p=y.toString(),l=p.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!l)return a;for(var u=l[1],s=new RegExp("(\\\\n|\\W)"+G(u)+F,"g"),i;i=s.exec(p);){if(i[3]==="dll-reference")continue;a[c].push(i[3])}for(s=new RegExp("\\("+G(u)+'\\("(dll-reference\\s('+P+'))"\\)\\)'+F,"g");i=s.exec(p);)f[i[2]]||(a[c].push(i[1]),f[i[2]]=M(i[1]).m),a[i[2]]=a[i[2]]||[],a[i[2]].push(i[4]);for(var D=Object.keys(a),A=0;A<D.length;A++)for(var S=0;S<a[D[A]].length;S++)K(a[D[A]][S])&&(a[D[A]][S]=1*a[D[A]][S]);return a}function I(f){var y=Object.keys(f);return y.reduce(function(c,a){return c||f[a].length>0},!1)}function b(f,y){for(var c={main:[y]},a={main:[]},p={main:{}};I(c);)for(var l=Object.keys(c),u=0;u<l.length;u++){var s=l[u],i=c[s],D=i.pop();if(p[s]=p[s]||{},p[s][D]||!f[s][D])continue;p[s][D]=!0,a[s]=a[s]||[],a[s].push(D);for(var A=n(f,f[s][D],s),S=Object.keys(A),R=0;R<S.length;R++)c[S[R]]=c[S[R]]||[],c[S[R]]=c[S[R]].concat(A[S[R]])}return a}ne.exports=function(f,y){y=y||{};var c={main:M.m},a=y.all?{main:Object.keys(c.main)}:b(c,f),p="";Object.keys(a).filter(function(D){return D!=="main"}).forEach(function(D){for(var A=0;a[D][A];)A++;a[D].push(A),c[D][A]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",p=p+"var "+D+" = ("+z.toString().replace("ENTRY_MODULE",JSON.stringify(A))+")({"+a[D].map(function(S){return""+JSON.stringify(S)+": "+c[D][S].toString()}).join(",")+`});
`}),p=p+"new (("+z.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+a.main.map(function(D){return""+JSON.stringify(D)+": "+c.main[D].toString()}).join(",")+"}))(self);";var l=new window.Blob([p],{type:"text/javascript"});if(y.bare)return l;var u=window.URL||window.webkitURL||window.mozURL||window.msURL,s=u.createObjectURL(l),i=new window.Worker(s);return i.objectURL=s,i}},"./src/config.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"hlsDefaultConfig",function(){return R}),M.d(Y,"mergeConfig",function(){return m}),M.d(Y,"enableStreamingMode",function(){return v});var z=M("./src/controller/abr-controller.ts"),P=M("./src/controller/audio-stream-controller.ts"),F=M("./src/controller/audio-track-controller.ts"),G=M("./src/controller/subtitle-stream-controller.ts"),K=M("./src/controller/subtitle-track-controller.ts"),n=M("./src/controller/buffer-controller.ts"),I=M("./src/controller/timeline-controller.ts"),b=M("./src/controller/cap-level-controller.ts"),f=M("./src/controller/fps-controller.ts"),y=M("./src/controller/eme-controller.ts"),c=M("./src/controller/cmcd-controller.ts"),a=M("./src/utils/xhr-loader.ts"),p=M("./src/utils/fetch-loader.ts"),l=M("./src/utils/cues.ts"),u=M("./src/utils/mediakeys-helper.ts"),s=M("./src/utils/logger.ts");function i(){return i=Object.assign||function(h){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(h[E]=C[E])}return h},i.apply(this,arguments)}function D(h,d){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);d&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(h,w).enumerable})),C.push.apply(C,E)}return C}function A(h){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?D(Object(C),!0).forEach(function(E){S(h,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):D(Object(C)).forEach(function(E){Object.defineProperty(h,E,Object.getOwnPropertyDescriptor(C,E))})}return h}function S(h,d,C){return d in h?Object.defineProperty(h,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):h[d]=C,h}var R=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:z.default,bufferController:n.default,capLevelController:b.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:u.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},O()),{},{subtitleStreamController:G.SubtitleStreamController,subtitleTrackController:K.default,timelineController:I.TimelineController,audioStreamController:P.default,audioTrackController:F.default,emeController:y.default,cmcdController:c.default});function O(){return{cueHandler:l.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 m(h,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return i({},h,d)}function v(h){var d=h.loader;if(d!==p.default&&d!==a.default)s.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var C=Object(p.fetchSupported)();C&&(h.loader=p.default,h.progressive=!0,h.enableSoftwareAES=!0,s.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/polyfills/number.ts"),P=M("./src/utils/ewma-bandwidth-estimator.ts"),F=M("./src/events.ts"),G=M("./src/utils/buffer-helper.ts"),K=M("./src/errors.ts"),n=M("./src/types/loader.ts"),I=M("./src/utils/logger.ts");function b(c,a){for(var p=0;p<a.length;p++){var l=a[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function f(c,a,p){return a&&b(c.prototype,a),p&&b(c,p),c}var y=function(){function c(p){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=p;var l=p.config;this.bwEstimator=new P.default(l.abrEwmaSlowVoD,l.abrEwmaFastVoD,l.abrEwmaDefaultEstimate),this.registerListeners()}var a=c.prototype;return a.registerListeners=function(){var l=this.hls;l.on(F.Events.FRAG_LOADING,this.onFragLoading,this),l.on(F.Events.FRAG_LOADED,this.onFragLoaded,this),l.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.on(F.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(F.Events.FRAG_LOADING,this.onFragLoading,this),l.off(F.Events.FRAG_LOADED,this.onFragLoaded,this),l.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this),l.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),l.off(F.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(l,u){var s=u.frag;if(s.type===n.PlaylistLevelType.MAIN&&!this.timer){var i;this.fragCurrent=s,this.partCurrent=(i=u.part)!=null?i:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(l,u){var s=this.hls.config;u.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,i=s.autoLevelEnabled,D=s.config,A=s.media;if(!l||!A)return;var S=u?u.stats:l.stats,R=u?u.duration:l.duration;if(S.aborted){I.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!i||A.paused||!A.playbackRate||!A.readyState)return;var O=performance.now()-S.loading.start,m=Math.abs(A.playbackRate);if(O<=500*R/m)return;var v=s.levels,h=s.minAutoLevel,d=v[l.level],C=S.total||Math.max(S.loaded,Math.round(R*d.maxBitrate/8)),E=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/O),w=(C-S.loaded)/E,j=A.currentTime,W=(G.BufferHelper.bufferInfo(A,j,D.maxBufferHole).end-j)/m;if(W>=2*R/m||w<=W)return;var T=Number.POSITIVE_INFINITY,N;for(N=l.level-1;N>h;N--){var _=v[N].maxBitrate;if(T=R*_/(8*.8*E),T<W)break}if(T>=w)return;var x=this.bwEstimator.getEstimate();I.logger.warn("Fragment "+l.sn+(u?" part "+u.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+N+`
Current BW estimate: `+(Object(z.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+w.toFixed(3)+` s
Estimated load time for the next fragment: `+T.toFixed(3)+` s
Time to underbuffer: `+W.toFixed(3)+" s"),s.nextLoadLevel=N,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),s.trigger(F.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:S})},a.onFragLoaded=function(l,u){var s=u.frag,i=u.part;if(s.type===n.PlaylistLevelType.MAIN&&Object(z.isFiniteNumber)(s.sn)){var D=i?i.stats:s.stats,A=i?i.duration:s.duration;if(this.clearTimer(),this.lastLoadedFragLevel=s.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[s.level],R=(S.loaded?S.loaded.bytes:0)+D.loaded,O=(S.loaded?S.loaded.duration:0)+A;S.loaded={bytes:R,duration:O},S.realBitrate=Math.round(8*R/O)}if(s.bitrateTest){var m={stats:D,frag:s,part:i,id:s.type};this.onFragBuffered(F.Events.FRAG_BUFFERED,m),s.bitrateTest=!1}}},a.onFragBuffered=function(l,u){var s=u.frag,i=u.part,D=i?i.stats:s.stats;if(D.aborted)return;if(s.type!==n.PlaylistLevelType.MAIN||s.sn==="initSegment")return;var A=D.parsing.end-D.loading.start;this.bwEstimator.sample(A,D.loaded),D.bwEstimate=this.bwEstimator.getEstimate(),s.bitrateTest?this.bitrateTestDelay=A/1e3:this.bitrateTestDelay=0},a.onError=function(l,u){switch(u.details){case K.ErrorDetails.FRAG_LOAD_ERROR:case K.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var l=this.fragCurrent,u=this.partCurrent,s=this.hls,i=s.maxAutoLevel,D=s.config,A=s.minAutoLevel,S=s.media,R=u?u.duration:l?l.duration:0,O=S?S.currentTime:0,m=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():D.abrEwmaDefaultEstimate,h=(G.BufferHelper.bufferInfo(S,O,D.maxBufferHole).end-O)/m,d=this.findBestLevel(v,A,i,h,D.abrBandWidthFactor,D.abrBandWidthUpFactor);if(d>=0)return d;I.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=R?Math.min(R,D.maxStarvationDelay):D.maxStarvationDelay,E=D.abrBandWidthFactor,w=D.abrBandWidthUpFactor;if(!h){var j=this.bitrateTestDelay;if(j){var W=R?Math.min(R,D.maxLoadingDelay):D.maxLoadingDelay;C=W-j,I.logger.trace("bitrate test took "+Math.round(1e3*j)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=w=1}}return d=this.findBestLevel(v,A,i,h+C,E,w),Math.max(d,0)},a.findBestLevel=function(l,u,s,i,D,A){for(var S,R=this.fragCurrent,O=this.partCurrent,m=this.lastLoadedFragLevel,v=this.hls.levels,h=v[m],d=!!(h!=null&&(S=h.details)!==null&&S!==void 0&&S.live),C=h==null?void 0:h.codecSet,E=O?O.duration:R?R.duration:0,w=s;w>=u;w--){var j=v[w];if(!j||C&&j.codecSet!==C)continue;var W=j.details,T=(O?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||E,N=void 0;w<=m?N=D*l:N=A*l;var _=v[w].maxBitrate,x=_*T/N;if(I.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(N)+"/"+_+"/"+T+"/"+i+"/"+x),N>_&&(!x||d&&!this.bitrateTestDelay||x<i))return w}return-1},f(c,[{key:"nextAutoLevel",get:function(){var l=this._nextAutoLevel,u=this.bwEstimator;if(l!==-1&&(!u||!u.canEstimate()))return l;var s=this.getNextABRAutoLevel();return l!==-1&&(s=Math.min(l,s)),s},set:function(l){this._nextAutoLevel=l}}]),c}();Y.default=y},"./src/controller/audio-stream-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/polyfills/number.ts"),P=M("./src/controller/base-stream-controller.ts"),F=M("./src/events.ts"),G=M("./src/utils/buffer-helper.ts"),K=M("./src/controller/fragment-tracker.ts"),n=M("./src/types/level.ts"),I=M("./src/types/loader.ts"),b=M("./src/loader/fragment.ts"),f=M("./src/demux/chunk-cache.ts"),y=M("./src/demux/transmuxer-interface.ts"),c=M("./src/types/transmuxer.ts"),a=M("./src/controller/fragment-finders.ts"),p=M("./src/utils/discontinuities.ts"),l=M("./src/errors.ts"),u=M("./src/utils/logger.ts");function s(){return s=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var m=arguments[O];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(R[v]=m[v])}return R},s.apply(this,arguments)}function i(R,O){R.prototype=Object.create(O.prototype),R.prototype.constructor=R,D(R,O)}function D(R,O){return D=Object.setPrototypeOf||function(v,h){return v.__proto__=h,v},D(R,O)}var A=100,S=function(R){i(O,R);function O(v,h){var d;return d=R.call(this,v,h,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var m=O.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var h=this.hls;h.on(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(F.Events.ERROR,this.onError,this),h.on(F.Events.BUFFER_RESET,this.onBufferReset,this),h.on(F.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m._unregisterListeners=function(){var h=this.hls;h.off(F.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(F.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(F.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(F.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(F.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(F.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(F.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(F.Events.ERROR,this.onError,this),h.off(F.Events.BUFFER_RESET,this.onBufferReset,this),h.off(F.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(F.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(F.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(F.Events.FRAG_BUFFERED,this.onFragBuffered,this)},m.onInitPtsFound=function(h,d){var C=d.frag,E=d.id,w=d.initPTS;if(E==="main"){var j=C.cc;this.initPTS[C.cc]=w,this.log("InitPTS for cc: "+j+" found from main: "+w),this.videoTrackCC=j,this.state===P.State.WAITING_INIT_PTS&&this.tick()}},m.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=P.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(A),this.fragLoadError=0,d>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=P.State.IDLE):(this.loadedmetadata=!1,this.state=P.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},m.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_TRACK:{var h,d=this.levels,C=this.trackId,E=d==null||((h=d[C])===null||h===void 0)?void 0:h.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=P.State.WAITING_INIT_PTS}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var w,j=performance.now(),W=this.retryDate;(!W||j>=W||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=P.State.IDLE);break}case P.State.WAITING_INIT_PTS:{var T=this.waitingData;if(T){var N=T.frag,_=T.part,x=T.cache,H=T.complete;if(this.initPTS[N.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.FRAG_LOADING;var X=x.flush(),ee={frag:N,part:_,payload:X,networkDetails:null};this._handleFragmentLoadProgress(ee),H&&R.prototype._handleFragmentLoadComplete.call(this,ee)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+N.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var J=this.getLoadPosition(),ce=G.BufferHelper.bufferInfo(this.mediaBuffer,J,this.config.maxBufferHole),me=Object(a.fragmentWithinToleranceTest)(ce.end,this.config.maxFragLookUpTolerance,N);me<0&&(u.logger.log("Waiting fragment cc ("+N.cc+") @ "+N.start+" cancelled because another fragment at "+ce.end+" is needed"),this.clearWaitingFragment())}}else this.state=P.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=P.State.IDLE)},m.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:h,C=d.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},m.doTickIdle=function(){var h,d,C=this.hls,E=this.levels,w=this.media,j=this.trackId,W=C.config;if(!E||!E[j])return;if(!w&&(this.startFragRequested||!W.startFragPrefetch))return;var T=E[j],N=T.details;if(!N||N.live&&this.levelLastLoaded!==j||this.waitForCdnTuneIn(N)){this.state=P.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,I.PlaylistLevelType.AUDIO));var _=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,I.PlaylistLevelType.AUDIO);if(_===null)return;var x=_.len,H=this.getMaxBufferLength(),X=this.audioSwitch;if(x>=H&&!X)return;if(!X&&this._streamEnded(_,N)){C.trigger(F.Events.BUFFER_EOS,{type:"audio"}),this.state=P.State.ENDED;return}var ee=N.fragments,J=ee[0].start,ce=_.end;if(X){var me=this.getLoadPosition();ce=me,N.PTSKnown&&me<J&&((_.end>J||_.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=J+.05))}var ue=this.getNextFragment(ce,N);if(!ue){this.bufferFlushed=!0;return}((h=ue.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((d=ue.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ue,N):this.loadFragment(ue,N,ce)},m.getMaxBufferLength=function(){var h=R.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,I.PlaylistLevelType.MAIN);return d===null?h:Math.max(h,d.len)},m.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(h,d){var C=d.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},m.onAudioTrackSwitching=function(h,d){var C=!!d.url;this.trackId=d.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(A):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=P.State.IDLE):this.state=P.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(h,d){this.mainDetails=d.details},m.onAudioTrackLoaded=function(h,d){var C,E=this.levels,w=d.details,j=d.id;if(!E){this.warn("Audio tracks were reset while loading level "+j);return}this.log("Track "+j+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var W=E[j],T=0;if(w.live||(C=W.details)!==null&&C!==void 0&&C.live){var N=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!N)return;!W.details&&w.hasProgramDateTime&&N.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(w,N),T=w.fragments[0].start):T=this.alignPlaylists(w,W.details)}W.details=w,this.levelLastLoaded=j,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(W.details,T),this.state===P.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=P.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(h){var d,C=h.frag,E=h.part,w=h.payload,j=this.config,W=this.trackId,T=this.levels;if(!T){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var N=T[W];console.assert(N,"Audio track is defined on fragment load progress");var _=N.details;console.assert(_,"Audio track details are defined on fragment load progress");var x=j.defaultAudioCodec||N.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new y.default(this.hls,I.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var X=this.initPTS[C.cc],ee=(d=C.initSegment)===null||d===void 0?void 0:d.data;if(X!==void 0){var J=!1,ce=E?E.index:-1,me=ce!==-1,ue=new c.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,w.byteLength,ce,me);H.push(w,ee,x,"",C,E,_.totalduration,J,ue,X)}else{u.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+_.startSN+" ,"+_.endSN+"],track "+W);var pe=this.waitingData=this.waitingData||{frag:C,part:E,cache:new f.default,complete:!1},xe=pe.cache;xe.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=P.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,h)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(h,d){var C=d.tracks.audio;C&&(this.mediaBuffer=C.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},m.onFragBuffered=function(h,d){var C=d.frag,E=d.part;if(C.type!==I.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},m.onError=function(h,d){switch(d.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(I.PlaylistLevelType.AUDIO,d);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==P.State.ERROR&&this.state!==P.State.STOPPED&&(this.state=d.fatal?P.State.ERROR:P.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,I.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},m.onBufferFlushed=function(h,d){var C=d.type;C===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(h){var d,C="audio",E=this.hls,w=h.remuxResult,j=h.chunkMeta,W=this.getCurrentContext(j);if(!W){this.warn("The loading context changed while buffering fragment "+j.sn+" of level "+j.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(j.level);return}var T=W.frag,N=W.part,_=w.audio,x=w.text,H=w.id3,X=w.initSegment;if(this.fragContextChanged(T))return;if(this.state=P.State.PARSING,this.audioSwitch&&_&&this.completeAudioSwitch(),X!=null&&X.tracks&&(this._bufferInitSegment(X.tracks,T,j),E.trigger(F.Events.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:C,tracks:X.tracks})),_){var ee=_.startPTS,J=_.endPTS,ce=_.startDTS,me=_.endDTS;N&&(N.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ee,endPTS:J,startDTS:ce,endDTS:me}),T.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ee,J,ce,me),this.bufferFragmentData(_,T,N,j)}if(H!=null&&(d=H.samples)!==null&&d!==void 0&&d.length){var ue=s({frag:T,id:C},H);E.trigger(F.Events.FRAG_PARSING_METADATA,ue)}if(x){var pe=s({frag:T,id:C},x);E.trigger(F.Events.FRAG_PARSING_USERDATA,pe)}},m._bufferInitSegment=function(h,d,C){if(this.state!==P.State.PARSING)return;h.video&&delete h.video;var E=h.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(F.Events.BUFFER_CODECS,h);var w=E.initSegment;if(w!=null&&w.byteLength){var j={type:"audio",frag:d,part:null,chunkMeta:C,parent:d.type,data:w};this.hls.trigger(F.Events.BUFFER_APPENDING,j)}this.tick()},m.loadFragment=function(h,d,C){var E=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||E===K.FragmentState.NOT_LOADED||E===K.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):d.live&&!Object(z.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=P.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,h,d,C)))},m.completeAudioSwitch=function(){var h=this.hls,d=this.media,C=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(F.Events.AUDIO_TRACK_SWITCHED,{id:C})},O}(P.default);Y.default=S},"./src/controller/audio-track-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/events.ts"),P=M("./src/errors.ts"),F=M("./src/controller/base-playlist-controller.ts"),G=M("./src/types/loader.ts");function K(y,c){for(var a=0;a<c.length;a++){var p=c[a];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(y,p.key,p)}}function n(y,c,a){return c&&K(y.prototype,c),a&&K(y,a),y}function I(y,c){y.prototype=Object.create(c.prototype),y.prototype.constructor=y,b(y,c)}function b(y,c){return b=Object.setPrototypeOf||function(p,l){return p.__proto__=l,p},b(y,c)}var f=function(y){I(c,y);function c(p){var l;return l=y.call(this,p,"[audio-track-controller]")||this,l.tracks=[],l.groupId=null,l.tracksInGroup=[],l.trackId=-1,l.trackName="",l.selectDefaultTrack=!0,l.registerListeners(),l}var a=c.prototype;return a.registerListeners=function(){var l=this.hls;l.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.on(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.on(z.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var l=this.hls;l.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),l.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),l.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),l.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),l.off(z.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),l.off(z.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,y.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(l,u){this.tracks=u.audioTracks||[]},a.onAudioTrackLoaded=function(l,u){var s=u.id,i=u.details,D=this.tracksInGroup[s];if(!D){this.warn("Invalid audio track id "+s);return}var A=D.details;D.details=u.details,this.log("audioTrack "+s+" loaded ["+i.startSN+"-"+i.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,u,A))},a.onLevelLoading=function(l,u){this.switchLevel(u.level)},a.onLevelSwitching=function(l,u){this.switchLevel(u.level)},a.switchLevel=function(l){var u=this.hls.levels[l];if(!(u!=null&&u.audioGroupIds))return;var s=u.audioGroupIds[u.urlId];if(this.groupId!==s){this.groupId=s;var i=this.tracks.filter(function(A){return!s||A.groupId===s});this.selectDefaultTrack&&!i.some(function(A){return A.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=i;var D={audioTracks:i};this.log("Updating audio tracks, "+i.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(z.Events.AUDIO_TRACKS_UPDATED,D),this.selectInitialTrack()}},a.onError=function(l,u){if(y.prototype.onError.call(this,l,u),u.fatal||!u.context)return;u.context.type===G.PlaylistContextType.AUDIO_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},a.setAudioTrack=function(l){var u=this.tracksInGroup;if(l<0||l>=u.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var s=u[this.trackId];this.log("Now switching to audio-track index "+l);var i=u[l],D=i.id,A=i.groupId,S=A===void 0?"":A,R=i.name,O=i.type,m=i.url;if(this.trackId=l,this.trackName=R,this.selectDefaultTrack=!1,this.hls.trigger(z.Events.AUDIO_TRACK_SWITCHING,{id:D,groupId:S,name:R,type:O,url:m}),i.details&&!i.details.live)return;var v=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(v)},a.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var u=this.trackName,s=this.findTrackId(u)||this.findTrackId();s!==-1?this.setAudioTrack(s):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(l){for(var u=this.tracksInGroup,s=0;s<u.length;s++){var i=u[s];if((!this.selectDefaultTrack||i.default)&&(!l||l===i.name))return i.id}return-1},a.loadPlaylist=function(l){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var s=u.id,i=u.groupId,D=u.url;if(l)try{D=l.addDirectives(D)}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(z.Events.AUDIO_TRACK_LOADING,{url:D,id:s,groupId:i,deliveryDirectives:l||null})}},n(c,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(l){this.selectDefaultTrack=!1,this.setAudioTrack(l)}}]),c}(F.default);Y.default=f},"./src/controller/base-playlist-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return n});var z=M("./src/polyfills/number.ts"),P=M("./src/types/level.ts"),F=M("./src/controller/level-helper.ts"),G=M("./src/utils/logger.ts"),K=M("./src/errors.ts"),n=function(){function I(f,y){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=G.logger.log.bind(G.logger,y+":"),this.warn=G.logger.warn.bind(G.logger,y+":"),this.hls=f}var b=I.prototype;return b.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},b.onError=function(y,c){c.fatal&&c.type===K.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},b.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},b.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},b.stopLoad=function(){this.canLoad=!1,this.clearTimer()},b.switchParams=function(y,c){var a=c==null?void 0:c.renditionReports;if(a)for(var p=0;p<a.length;p++){var l=a[p],u=""+l.URI;if(u===y.substr(-u.length)){var s=parseInt(l["LAST-MSN"]),i=parseInt(l["LAST-PART"]);if(c&&this.hls.config.lowLatencyMode){var D=Math.min(c.age-c.partTarget,c.targetduration);i!==void 0&&D>c.partTarget&&(i+=1)}if(Object(z.isFiniteNumber)(s))return new P.HlsUrlParameters(s,Object(z.isFiniteNumber)(i)?i:void 0,P.HlsSkip.No)}}},b.loadPlaylist=function(y){},b.shouldLoadTrack=function(y){return this.canLoad&&y&&!!y.url&&(!y.details||y.details.live)},b.playlistLoaded=function(y,c,a){var p=this,l=c.details,u=c.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-s,l.live||a!=null&&a.live){if(l.reloaded(a),a&&this.log("live playlist "+y+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),a&&l.fragments.length>0&&Object(F.mergeDetails)(a,l),!this.canLoad||!l.live)return;var i,D=void 0,A=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,R=l.lastPartSn,O=l.endSN,m=l.lastPartIndex,v=m!==-1,h=R===O,d=S?0:m;v?(D=h?O+1:R,A=h?d:m+1):D=O+1;var C=l.age,E=C+l.ageHeader,w=Math.min(E-l.partTarget,l.targetduration*1.5);if(w>0){if(a&&w>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+w+" with playlist age: "+l.age),w=0;else{var j=Math.floor(w/l.targetduration);if(D+=j,A!==void 0){var W=Math.round(w%l.targetduration/l.partTarget);A+=W}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+w+" skip sn "+j+" to part "+A)}l.tuneInGoal=w}if(i=this.getDeliveryDirectives(l,c.deliveryDirectives,D,A),S||!h){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(l,c.deliveryDirectives,D,A);var T=Object(F.computeReloadInterval)(l,u);D!==void 0&&l.canBlockReload&&(T-=l.partTarget||1),this.log("reload live playlist "+y+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(i)},T)}else this.clearTimer()},b.getDeliveryDirectives=function(y,c,a,p){var l=Object(P.getSkipValue)(y,a);return c!=null&&c.skip&&y.deltaUpdateFailed&&(a=c.msn,p=c.part,l=P.HlsSkip.No),new P.HlsUrlParameters(a,p,l)},b.retryLoadingOrFail=function(y){var c=this,a=this.hls.config,p=this.retryCount<a.levelLoadingMaxRetry;if(p){var l;if(this.retryCount++,y.details.indexOf("LoadTimeOut")>-1&&(l=y.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+y.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return c.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+y.details+'"')}}else this.warn('cannot recover from error "'+y.details+'"'),this.clearTimer(),y.fatal=!0;return p},I}()},"./src/controller/base-stream-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"State",function(){return O}),M.d(Y,"default",function(){return m});var z=M("./src/polyfills/number.ts"),P=M("./src/task-loop.ts"),F=M("./src/controller/fragment-tracker.ts"),G=M("./src/utils/buffer-helper.ts"),K=M("./src/utils/logger.ts"),n=M("./src/events.ts"),I=M("./src/errors.ts"),b=M("./src/types/transmuxer.ts"),f=M("./src/utils/mp4-tools.ts"),y=M("./src/utils/discontinuities.ts"),c=M("./src/controller/fragment-finders.ts"),a=M("./src/controller/level-helper.ts"),p=M("./src/loader/fragment-loader.ts"),l=M("./src/crypt/decrypter.ts"),u=M("./src/utils/time-ranges.ts"),s=M("./src/types/loader.ts");function i(v,h){for(var d=0;d<h.length;d++){var C=h[d];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(v,C.key,C)}}function D(v,h,d){return h&&i(v.prototype,h),d&&i(v,d),v}function A(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function S(v,h){v.prototype=Object.create(h.prototype),v.prototype.constructor=v,R(v,h)}function R(v,h){return R=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},R(v,h)}var O={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"},m=function(v){S(h,v);function h(C,E,w){var j;return j=v.call(this)||this,j.hls=void 0,j.fragPrevious=null,j.fragCurrent=null,j.fragmentTracker=void 0,j.transmuxer=null,j._state=O.STOPPED,j.media=void 0,j.mediaBuffer=void 0,j.config=void 0,j.bitrateTest=!1,j.lastCurrentTime=0,j.nextLoadPosition=0,j.startPosition=0,j.loadedmetadata=!1,j.fragLoadError=0,j.retryDate=0,j.levels=null,j.fragmentLoader=void 0,j.levelLastLoaded=null,j.startFragRequested=!1,j.decrypter=void 0,j.initPTS=[],j.onvseeking=null,j.onvended=null,j.logPrefix="",j.log=void 0,j.warn=void 0,j.logPrefix=w,j.log=K.logger.log.bind(K.logger,w+":"),j.warn=K.logger.warn.bind(K.logger,w+":"),j.hls=C,j.fragmentLoader=new p.default(C.config),j.fragmentTracker=E,j.config=C.config,j.decrypter=new l.default(C,C.config),C.on(n.Events.KEY_LOADED,j.onKeyLoaded,A(j)),j}var d=h.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(E){},d.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},d._streamEnded=function(E,w){var j=this.fragCurrent,W=this.fragmentTracker;if(!w.live&&j&&j.sn===w.endSN&&!E.nextStart){var T=W.getState(j);return T===F.FragmentState.PARTIAL||T===F.FragmentState.OK}return!1},d.onMediaAttached=function(E,w){var j=this.media=this.mediaBuffer=w.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),j.addEventListener("seeking",this.onvseeking),j.addEventListener("ended",this.onvended);var W=this.config;this.levels&&W.autoStartLoad&&this.state===O.STOPPED&&this.startLoad(W.startPosition)},d.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var E=this.config,w=this.fragCurrent,j=this.media,W=this.mediaBuffer,T=this.state,N=j?j.currentTime:0,_=G.BufferHelper.bufferInfo(W||j,N,E.maxBufferHole);if(this.log("media seeking to "+(Object(z.isFiniteNumber)(N)?N.toFixed(3):N)+", state: "+T),T===O.ENDED)this.resetLoadingState();else if(w&&!_.len){var x=E.maxFragLookUpTolerance,H=w.start-x,X=w.start+w.duration+x,ee=N>X;(N<H||ee)&&(ee&&w.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),w.loader.abort()),this.resetLoadingState())}j&&(this.lastCurrentTime=N),!this.loadedmetadata&&!_.len&&(this.nextLoadPosition=this.startPosition=N),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(E,w){if(this.state!==O.KEY_LOADING||w.frag!==this.fragCurrent||!this.levels)return;this.state=O.IDLE;var j=this.levels[w.frag.level].details;j&&this.loadFragment(w.frag,j,w.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),v.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(n.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,v.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(E,w){this.log("Loading key for "+E.sn+" of ["+w.startSN+"-"+w.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=O.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(n.Events.KEY_LOADING,{frag:E})},d.loadFragment=function(E,w,j){this._loadFragForPlayback(E,w,j)},d._loadFragForPlayback=function(E,w,j){var W=this,T=function(_){if(W.fragContextChanged(E)){W.warn("Fragment "+E.sn+(_.part?" p: "+_.part.index:"")+" of level "+E.level+" was dropped during download."),W.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,W._handleFragmentLoadProgress(_)};this._doFragLoad(E,w,j,T).then(function(N){if(!N)return;W.fragLoadError=0;var _=W.state;if(W.fragContextChanged(E)){(_===O.FRAG_LOADING||_===O.BACKTRACKING||!W.fragCurrent&&_===O.PARSING)&&(W.fragmentTracker.removeFragment(E),W.state=O.IDLE);return}if("payload"in N&&(W.log("Loaded fragment "+E.sn+" of level "+E.level),W.hls.trigger(n.Events.FRAG_LOADED,N),W.state===O.BACKTRACKING)){W.fragmentTracker.backtrack(E,N),W.resetFragmentLoading(E);return}W._handleFragmentLoadComplete(N)}).catch(function(N){W.warn(N),W.resetFragmentLoading(E)})},d.flushMainBuffer=function(E,w,j){if(j===void 0&&(j=null),!(E-w))return;var W={startOffset:E,endOffset:w,type:j};this.fragLoadError=0,this.hls.trigger(n.Events.BUFFER_FLUSHING,W)},d._loadInitSegment=function(E){var w=this;this._doFragLoad(E).then(function(j){if(!j||w.fragContextChanged(E)||!w.levels)throw new Error("init load aborted");return j}).then(function(j){var W=w.hls,T=j.payload,N=E.decryptdata;if(T&&T.byteLength>0&&N&&N.key&&N.iv&&N.method==="AES-128"){var _=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(T),N.key.buffer,N.iv.buffer).then(function(x){var H=self.performance.now();return W.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:x,stats:{tstart:_,tdecrypt:H}}),j.payload=x,j})}return j}).then(function(j){var W=w.fragCurrent,T=w.hls,N=w.levels;if(!N)throw new Error("init load aborted, missing levels");var _=N[E.level].details;console.assert(_,"Level details are defined when init segment is loaded");var x=E.stats;w.state=O.IDLE,w.fragLoadError=0,E.data=new Uint8Array(j.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),j.frag===W&&T.trigger(n.Events.FRAG_BUFFERED,{stats:x,frag:W,part:null,id:E.type}),w.tick()}).catch(function(j){w.warn(j),w.resetFragmentLoading(E)})},d.fragContextChanged=function(E){var w=this.fragCurrent;return!E||!w||E.level!==w.level||E.sn!==w.sn||E.urlId!==w.urlId},d.fragBufferedComplete=function(E,w){var j=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(w?" part: "+w.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+u.default.toString(G.BufferHelper.getBuffered(j))),this.state=O.IDLE,this.tick()},d._handleFragmentLoadComplete=function(E){var w=this.transmuxer;if(!w)return;var j=E.frag,W=E.part,T=E.partsLoaded,N=!T||T.length===0||T.some(function(x){return!x}),_=new b.ChunkMetadata(j.level,j.sn,j.stats.chunkCount+1,0,W?W.index:-1,!N);w.flush(_)},d._handleFragmentLoadProgress=function(E){},d._doFragLoad=function(E,w,j,W){var T=this;if(j===void 0&&(j=null),!this.levels)throw new Error("frag load aborted, missing levels");if(j=Math.max(E.start,j||0),this.config.lowLatencyMode&&w){var N=w.partList;if(N&&W){j>E.end&&w.fragmentHint&&(E=w.fragmentHint);var _=this.getNextPart(N,E,j);if(_>-1){var x=N[_];return this.log("Loading part sn: "+E.sn+" p: "+x.index+" cc: "+E.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+_+"-"+(N.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(j.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:N[_],targetBufferTime:j}),this.doFragPartsLoad(E,N,_,W).catch(function(H){return T.handleFragLoadError(H)})}else if(!E.url||this.loadedEndOfParts(N,j))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(w?"of ["+w.startSN+"-"+w.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(j.toFixed(3))),Object(z.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,targetBufferTime:j}),this.fragmentLoader.load(E,W).catch(function(H){return T.handleFragLoadError(H)})},d.doFragPartsLoad=function(E,w,j,W){var T=this;return new Promise(function(N,_){var x=[],H=function X(ee){var J=w[ee];T.fragmentLoader.loadPart(E,J,W).then(function(ce){x[J.index]=ce;var me=ce.part;T.hls.trigger(n.Events.FRAG_LOADED,ce);var ue=w[ee+1];if(ue&&ue.fragment===E)X(ee+1);else return N({frag:E,part:me,partsLoaded:x})}).catch(_)};H(j)})},d.handleFragLoadError=function(E){var w=E.data;return w&&w.details===I.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(n.Events.ERROR,w),null},d._handleTransmuxerFlush=function(E){var w=this.getCurrentContext(E);if(!w||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var j=w.frag,W=w.part,T=w.level,N=self.performance.now();j.stats.parsing.end=N,W&&(W.stats.parsing.end=N),this.updateLevelTiming(j,W,T,E.partial)},d.getCurrentContext=function(E){var w=this.levels,j=E.level,W=E.sn,T=E.part;if(!w||!w[j])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+j+". The current chunk will not be buffered."),null;var N=w[j],_=T>-1?Object(a.getPartWith)(N,W,T):null,x=_?_.fragment:Object(a.getFragmentWithSN)(N,W,this.fragCurrent);return x?{frag:x,part:_,level:N}:null},d.bufferFragmentData=function(E,w,j,W){if(!E||this.state!==O.PARSING)return;var T=E.data1,N=E.data2,_=T;if(T&&N&&(_=Object(f.appendUint8Array)(T,N)),!_||!_.length)return;var x={type:E.type,frag:w,part:j,chunkMeta:W,parent:w.type,data:_};this.hls.trigger(n.Events.BUFFER_APPENDING,x),E.dropped&&E.independent&&!j&&this.flushBufferGap(w)},d.flushBufferGap=function(E){var w=this.media;if(!w)return;if(!G.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,E.start);return}var j=w.currentTime,W=G.BufferHelper.bufferInfo(w,j,0),T=E.duration,N=Math.min(this.config.maxFragLookUpTolerance*2,T*.25),_=Math.max(Math.min(E.start-N,W.end-N),j+N);E.start-_>N&&this.flushMainBuffer(_,E.start)},d.getFwdBufferInfo=function(E,w){var j=this.config,W=this.getLoadPosition();if(!Object(z.isFiniteNumber)(W))return null;var T=G.BufferHelper.bufferInfo(E,W,j.maxBufferHole);if(T.len===0&&T.nextStart!==void 0){var N=this.fragmentTracker.getBufferedFrag(W,w);if(N&&T.nextStart<N.end)return G.BufferHelper.bufferInfo(E,W,Math.max(T.nextStart,j.maxBufferHole))}return T},d.getMaxBufferLength=function(E){var w=this.config,j;return E?j=Math.max(8*w.maxBufferSize/E,w.maxBufferLength):j=w.maxBufferLength,Math.min(j,w.maxMaxBufferLength)},d.reduceMaxBufferLength=function(E){var w=this.config,j=E||w.maxBufferLength;return w.maxMaxBufferLength>=j?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(E,w){var j,W,T=w.fragments,N=T.length;if(!N)return null;var _=this.config,x=T[0].start,H;if(w.live){var X=_.initialLiveManifestSize;if(N<X)return this.warn("Not enough fragments to start playback (have: "+N+", need: "+X+")"),null;!w.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(w,T),this.startPosition=H?this.hls.liveSyncPosition||H.start:E)}else E<=x&&(H=T[0]);if(!H){var ee=_.lowLatencyMode?w.partEnd:w.fragmentEnd;H=this.getFragmentAtPosition(E,ee,w)}return(j=H)!==null&&j!==void 0&&j.initSegment&&!((W=H)!==null&&W!==void 0&&W.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},d.getNextPart=function(E,w,j){for(var W=-1,T=!1,N=!0,_=0,x=E.length;_<x;_++){var H=E[_];if(N=N&&!H.independent,W>-1&&j<H.start)break;var X=H.loaded;!X&&(T||H.independent||N)&&H.fragment===w&&(W=_),T=X}return W},d.loadedEndOfParts=function(E,w){var j=E[E.length-1];return j&&w>j.start&&j.loaded},d.getInitialLiveFragment=function(E,w){var j=this.fragPrevious,W=null;if(j){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+j.programDateTime),W=Object(c.findFragmentByPDT)(w,j.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var T=j.sn+1;if(T>=E.startSN&&T<=E.endSN){var N=w[T-E.startSN];j.cc===N.cc&&(W=N,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(c.findFragWithCC)(w,j.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var _=this.hls.liveSyncPosition;_!==null&&(W=this.getFragmentAtPosition(_,this.bitrateTest?E.fragmentEnd:E.edge,E))}return W},d.getFragmentAtPosition=function(E,w,j){var W=this.config,T=this.fragPrevious,N=j.fragments,_=j.endSN,x=j.fragmentHint,H=W.maxFragLookUpTolerance,X=!!(W.lowLatencyMode&&j.partList&&x);X&&x&&!this.bitrateTest&&(N=N.concat(x),_=x.sn);var ee;if(E<w){var J=E>w-H?0:H;ee=Object(c.findFragmentByPTS)(T,N,E,J)}else ee=N[N.length-1];if(ee){var ce=ee.sn-j.startSN,me=T&&ee.level===T.level,ue=N[ce+1],pe=this.fragmentTracker.getState(ee);if(pe===F.FragmentState.BACKTRACKED){ee=null;for(var xe=ce;N[xe]&&this.fragmentTracker.getState(N[xe])===F.FragmentState.BACKTRACKED;)T?ee=N[xe--]:ee=N[--xe];ee||(ee=ue)}else T&&ee.sn===T.sn&&!X&&(me&&(ee.sn<_&&this.fragmentTracker.getState(ue)!==F.FragmentState.OK?(this.log("SN "+ee.sn+" just loaded, load next one: "+ue.sn),ee=ue):ee=null))}return ee},d.synchronizeToLiveEdge=function(E){var w=this.config,j=this.media;if(!j)return;var W=this.hls.liveSyncPosition,T=j.currentTime,N=E.fragments[0].start,_=E.edge,x=T>=N-w.maxFragLookUpTolerance&&T<=_;if(W!==null&&j.duration>W&&(T<W||!x)){var H=w.liveMaxLatencyDuration!==void 0?w.liveMaxLatencyDuration:w.liveMaxLatencyDurationCount*E.targetduration;(!x&&j.readyState<4||T<_-H)&&(this.loadedmetadata||(this.nextLoadPosition=W),j.readyState&&(this.warn("Playback: "+T.toFixed(3)+" is located too far from the end of live sliding playlist: "+_+", reset currentTime to : "+W.toFixed(3)),j.currentTime=W))}},d.alignPlaylists=function(E,w){var j=this.levels,W=this.levelLastLoaded,T=this.fragPrevious,N=W!==null?j[W]:null,_=E.fragments.length;if(!_)return this.warn("No fragments in live playlist"),0;var x=E.fragments[0].start,H=!w,X=E.alignedSliding&&Object(z.isFiniteNumber)(x);if(H||!X&&!x){Object(y.alignStream)(T,N,E);var ee=E.fragments[0].start;return this.log("Live playlist sliding: "+ee.toFixed(2)+" start-sn: "+(w?w.startSN:"na")+"->"+E.startSN+" prev-sn: "+(T?T.sn:"na")+" fragments: "+_),ee}return x},d.waitForCdnTuneIn=function(E){var w=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*w)},d.setStartPosition=function(E,w){var j=this.startPosition;if(j<w&&(j=-1),j===-1||this.lastCurrentTime===-1){var W=E.startTimeOffset;Object(z.isFiniteNumber)(W)?(j=w+W,W<0&&(j+=E.totalduration),j=Math.min(Math.max(w,j),w+E.totalduration),this.log("Start time offset "+W+" found in playlist, adjust startPosition to "+j),this.startPosition=j):E.live?j=this.hls.liveSyncPosition||w:this.startPosition=j=0,this.lastCurrentTime=j}this.nextLoadPosition=j},d.getLoadPosition=function(){var E=this.media,w=0;return this.loadedmetadata&&E?w=E.currentTime:this.nextLoadPosition&&(w=this.nextLoadPosition),w},d.handleFragLoadAborted=function(E,w){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(w?" part"+w.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},d.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=O.IDLE)},d.onFragmentOrKeyLoadError=function(E,w){if(w.fatal)return;var j=w.frag;if(!j||j.type!==E)return;var W=this.fragCurrent;console.assert(W&&j.sn===W.sn&&j.level===W.level&&j.urlId===W.urlId,"Frag load error must match current frag to retry");var T=this.config;if(this.fragLoadError+1<=T.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(j.level))return;var N=Math.min(Math.pow(2,this.fragLoadError)*T.fragLoadingRetryDelay,T.fragLoadingMaxRetryTimeout);this.warn("Fragment "+j.sn+" of "+E+" "+j.level+" failed to load, retrying in "+N+"ms"),this.retryDate=self.performance.now()+N,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else w.levelRetry?(E===s.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(K.logger.error(w.details+" reaches max retry, redispatch as fatal ..."),w.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)},d.afterBufferFlushed=function(E,w,j){if(!E)return;var W=G.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(w,W,j),this.state===O.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},d.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var w=this.levels?this.levels[E].details:null;if(w!=null&&w.live)return this.startPosition=-1,this.setStartPosition(w,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(E,w,j,W){var T=this,N=j.details;console.assert(!!N,"level.details must be defined");var _=Object.keys(E.elementaryStreams).reduce(function(x,H){var X=E.elementaryStreams[H];if(X){var ee=X.endPTS-X.startPTS;if(ee<=0)return T.warn("Could not parse fragment "+E.sn+" "+H+" duration reliably ("+ee+") resetting transmuxer to fallback to playlist timing"),T.resetTransmuxer(),x||!1;var J=W?0:Object(a.updateFragPTSDTS)(N,E,X.startPTS,X.endPTS,X.startDTS,X.endDTS);return T.hls.trigger(n.Events.LEVEL_PTS_UPDATED,{details:N,level:j,drift:J,type:H,frag:E,start:X.startPTS,end:X.endPTS}),!0}return x},!1);_?(this.state=O.PARSED,this.hls.trigger(n.Events.FRAG_PARSED,{frag:E,part:w})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},D(h,[{key:"state",get:function(){return this._state},set:function(E){var w=this._state;w!==E&&(this._state=E,this.log(w+"->"+E))}}]),h}(P.default)},"./src/controller/buffer-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return c});var z=M("./src/polyfills/number.ts"),P=M("./src/events.ts"),F=M("./src/utils/logger.ts"),G=M("./src/errors.ts"),K=M("./src/utils/buffer-helper.ts"),n=M("./src/utils/mediasource-helper.ts"),I=M("./src/loader/fragment.ts"),b=M("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),y=/([ha]vc.)(?:\.[^.,]+)+/,c=function(){function a(l){var u=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=u.hls,i=u.media,D=u.mediaSource;F.logger.log("[buffer-controller]: Media source opened"),i&&(u.updateMediaElementDuration(),s.trigger(P.Events.MEDIA_ATTACHED,{media:i})),D&&D.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){F.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){F.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=a.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null},p.registerListeners=function(){var u=this.hls;u.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(P.Events.BUFFER_RESET,this.onBufferReset,this),u.on(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(P.Events.BUFFER_EOS,this.onBufferEos,this),u.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(P.Events.FRAG_PARSED,this.onFragParsed,this),u.on(P.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var u=this.hls;u.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(P.Events.BUFFER_RESET,this.onBufferReset,this),u.off(P.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(P.Events.BUFFER_EOS,this.onBufferEos,this),u.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(P.Events.FRAG_PARSED,this.onFragParsed,this),u.off(P.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},p.onManifestParsed=function(u,s){var i=2;(s.audio&&!s.video||!s.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,F.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(u,s){var i=this.media=s.media;if(i&&f){var D=this.mediaSource=new f;D.addEventListener("sourceopen",this._onMediaSourceOpen),D.addEventListener("sourceended",this._onMediaSourceEnded),D.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(D),this._objectUrl=i.src}},p.onMediaDetaching=function(){var u=this.media,s=this.mediaSource,i=this._objectUrl;if(s){if(F.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(D){F.logger.warn("[buffer-controller]: onMediaDetaching: "+D.message+" while calling endOfStream")}this.onBufferReset(),s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),u&&(i&&self.URL.revokeObjectURL(i),u.src===i?(u.removeAttribute("src"),u.load()):F.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(P.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var u=this;this.getSourceBufferTypes().forEach(function(s){var i=u.sourceBuffer[s];try{i&&(u.removeBufferListeners(s),u.mediaSource&&u.mediaSource.removeSourceBuffer(i),u.sourceBuffer[s]=void 0)}catch(D){F.logger.warn("[buffer-controller]: Failed to reset the "+s+" buffer",D)}}),this._initSourceBuffer()},p.onBufferCodecs=function(u,s){var i=this,D=this.getSourceBufferTypes().length;if(Object.keys(s).forEach(function(A){if(D){var S=i.tracks[A];if(S&&typeof S.buffer.changeType=="function"){var R=s[A],O=R.codec,m=R.levelCodec,v=R.container,h=(S.levelCodec||S.codec).replace(y,"$1"),d=(m||O).replace(y,"$1");if(h!==d){var C=v+";codecs="+(m||O);i.appendChangeType(A,C)}}}else i.pendingTracks[A]=s[A]}),D)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},p.appendChangeType=function(u,s){var i=this,D=this.operationQueue,A={execute:function(){var R=i.sourceBuffer[u];R&&(F.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),R.changeType(s)),D.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(R){F.logger.warn("[buffer-controller]: Failed to change "+u+" SourceBuffer type",R)}};D.append(A,u)},p.onBufferAppending=function(u,s){var i=this,D=this.hls,A=this.operationQueue,S=this.tracks,R=s.data,O=s.type,m=s.frag,v=s.part,h=s.chunkMeta,d=h.buffering[O],C=self.performance.now();d.start=C;var E=m.stats.buffering,w=v?v.stats.buffering:null;E.start===0&&(E.start=C),w&&w.start===0&&(w.start=C);var j=S.audio,W=O==="audio"&&h.id===1&&(j==null?void 0:j.container)==="audio/mpeg",T={execute:function(){if(d.executeStart=self.performance.now(),W){var _=i.sourceBuffer[O];if(_){var x=m.start-_.timestampOffset;Math.abs(x)>=.1&&(F.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+x+") sn: "+m.sn+")"),_.timestampOffset=m.start)}}i.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var _=self.performance.now();d.executeEnd=d.end=_,E.first===0&&(E.first=_),w&&w.first===0&&(w.first=_);var x=i.sourceBuffer,H={};for(var X in x)H[X]=K.BufferHelper.getBuffered(x[X]);i.appendError=0,i.hls.trigger(P.Events.BUFFER_APPENDED,{type:O,frag:m,part:v,chunkMeta:h,parent:m.type,timeRanges:H})},onError:function(_){F.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",_);var x={type:G.ErrorTypes.MEDIA_ERROR,parent:m.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:_,fatal:!1};_.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=G.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,x.details=G.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>D.config.appendErrorMaxRetry&&(F.logger.error("[buffer-controller]: Failed "+D.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),D.trigger(P.Events.ERROR,x)}};A.append(T,O)},p.onBufferFlushing=function(u,s){var i=this,D=this.operationQueue,A=function(R){return{execute:i.removeExecutor.bind(i,R,s.startOffset,s.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(P.Events.BUFFER_FLUSHED,{type:R})},onError:function(m){F.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",m)}}};s.type?D.append(A(s.type),s.type):this.getSourceBufferTypes().forEach(function(S){D.append(A(S),S)})},p.onFragParsed=function(u,s){var i=this,D=s.frag,A=s.part,S=[],R=A?A.elementaryStreams:D.elementaryStreams;R[I.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(R[I.ElementaryStreamTypes.AUDIO]&&S.push("audio"),R[I.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var v=self.performance.now();D.stats.buffering.end=v,A&&(A.stats.buffering.end=v);var h=A?A.stats:D.stats;i.hls.trigger(P.Events.FRAG_BUFFERED,{frag:D,part:A,stats:h,id:D.type})};S.length===0&&F.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+D.type+" level: "+D.level+" sn: "+D.sn),this.blockBuffers(O,S)},p.onFragChanged=function(u,s){this.flushBackBuffer()},p.onBufferEos=function(u,s){var i=this,D=this.getSourceBufferTypes().reduce(function(A,S){var R=i.sourceBuffer[S];return(!s.type||s.type===S)&&(R&&!R.ended&&(R.ended=!0,F.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),A&&!!(!R||R.ended)},!0);D&&this.blockBuffers(function(){var A=i.mediaSource;if(!A||A.readyState!=="open")return;A.endOfStream()})},p.onLevelUpdated=function(u,s){var i=s.details;if(!i.fragments.length)return;this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},p.flushBackBuffer=function(){var u=this.hls,s=this.details,i=this.media,D=this.sourceBuffer;if(!i||s===null)return;var A=this.getSourceBufferTypes();if(!A.length)return;var S=s.live&&u.config.liveBackBufferLength!==null?u.config.liveBackBufferLength:u.config.backBufferLength;if(!Object(z.isFiniteNumber)(S)||S<0)return;var R=i.currentTime,O=s.levelTargetDuration,m=Math.max(S,O),v=Math.floor(R/O)*O-m;A.forEach(function(h){var d=D[h];if(d){var C=K.BufferHelper.getBuffered(d);C.length>0&&v>C.start(0)&&(u.trigger(P.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),s.live&&u.trigger(P.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),u.trigger(P.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:h}))}})},p.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var u=this.details,s=this.hls,i=this.media,D=this.mediaSource,A=u.fragments[0].start+u.totalduration,S=i.duration,R=Object(z.isFiniteNumber)(D.duration)?D.duration:0;u.live&&s.config.liveDurationInfinity?(F.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),D.duration=Infinity,this.updateSeekableRange(u)):(A>R&&A>S||!Object(z.isFiniteNumber)(S))&&(F.logger.log("[buffer-controller]: Updating Media Source duration to "+A.toFixed(3)),D.duration=A)},p.updateSeekableRange=function(u){var s=this.mediaSource,i=u.fragments,D=i.length;if(D&&u.live&&s!==null&&s!==void 0&&s.setLiveSeekableRange){var A=Math.max(0,i[0].start),S=Math.max(A,A+u.totalduration);s.setLiveSeekableRange(A,S)}},p.checkPendingTracks=function(){var u=this.bufferCodecEventsExpected,s=this.operationQueue,i=this.pendingTracks,D=Object.keys(i).length;if(D&&!u||D===2){this.createSourceBuffers(i),this.pendingTracks={};var A=this.getSourceBufferTypes();if(A.length===0){this.hls.trigger(P.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}A.forEach(function(S){s.executeNext(S)})}},p.createSourceBuffers=function(u){var s=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var D=0;for(var A in u)if(!s[A]){var S=u[A];if(!S)throw Error("source buffer exists for track "+A+", however track does not");var R=S.levelCodec||S.codec,O=S.container+";codecs="+R;F.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var m=s[A]=i.addSourceBuffer(O),v=A;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[A]={buffer:m,codec:R,container:S.container,levelCodec:S.levelCodec,id:S.id},D++}catch(h){F.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(P.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:O})}}D&&this.hls.trigger(P.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(u){var s=this.operationQueue,i=s.current(u);i.onStart()},p._onSBUpdateEnd=function(u){var s=this.operationQueue,i=s.current(u);i.onComplete(),s.shiftAndExecuteNext(u)},p._onSBUpdateError=function(u,s){F.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(P.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(u);i&&i.onError(s)},p.removeExecutor=function(u,s,i){var D=this.media,A=this.mediaSource,S=this.operationQueue,R=this.sourceBuffer,O=R[u];if(!D||!A||!O){F.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var m=Object(z.isFiniteNumber)(D.duration)?D.duration:Infinity,v=Object(z.isFiniteNumber)(A.duration)?A.duration:Infinity,h=Math.max(0,s),d=Math.min(i,m,v);d>h?(F.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(h,d)):S.shiftAndExecuteNext(u)},p.appendExecutor=function(u,s){var i=this.operationQueue,D=this.sourceBuffer,A=D[s];if(!A){F.logger.warn("[buffer-controller]: Attempting to append to the "+s+" SourceBuffer, but it does not exist"),i.shiftAndExecuteNext(s);return}A.ended=!1,console.assert(!A.updating,s+" sourceBuffer must not be updating"),A.appendBuffer(u)},p.blockBuffers=function(u,s){var i=this;if(s===void 0&&(s=this.getSourceBufferTypes()),!s.length){F.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(u);return}var D=this.operationQueue,A=s.map(function(S){return D.appendBlocker(S)});Promise.all(A).then(function(){u(),s.forEach(function(S){var R=i.sourceBuffer[S];(!R||!R.updating)&&D.shiftAndExecuteNext(S)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(u,s,i){var D=this.sourceBuffer[u];if(!D)return;var A=i.bind(this,u);this.listeners[u].push({event:s,listener:A}),D.addEventListener(s,A)},p.removeBufferListeners=function(u){var s=this.sourceBuffer[u];if(!s)return;this.listeners[u].forEach(function(i){s.removeEventListener(i.event,i.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return P});var z=M("./src/utils/logger.ts"),P=function(){function F(K){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=K}var G=F.prototype;return G.append=function(n,I){var b=this.queues[I];b.push(n),b.length===1&&this.buffers[I]&&this.executeNext(I)},G.insertAbort=function(n,I){var b=this.queues[I];b.unshift(n),this.executeNext(I)},G.appendBlocker=function(n){var I,b=new Promise(function(y){I=y}),f={execute:I,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),b},G.executeNext=function(n){var I=this.buffers,b=this.queues,f=I[n],y=b[n];if(y.length){var c=y[0];try{c.execute()}catch(a){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),c.onError(a),(!f||!f.updating)&&(y.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},F}()},"./src/controller/cap-level-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/events.ts");function P(K,n){for(var I=0;I<n.length;I++){var b=n[I];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(K,b.key,b)}}function F(K,n,I){return n&&P(K.prototype,n),I&&P(K,I),K}var G=function(){function K(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 n=K.prototype;return n.setStreamController=function(b){this.streamController=b},n.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},n.registerListeners=function(){var b=this.hls;b.on(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.unregisterListener=function(){var b=this.hls;b.off(z.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),b.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),b.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off(z.Events.BUFFER_CODECS,this.onBufferCodecs,this),b.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},n.onFpsDropLevelCapping=function(b,f){K.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},n.onMediaAttaching=function(b,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},n.onManifestParsed=function(b,f){var y=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,y.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onBufferCodecs=function(b,f){var y=this.hls;y.config.capLevelToPlayerSize&&f.video&&this.startCapping()},n.onMediaDetaching=function(){this.stopCapping()},n.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(b.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},n.getMaxLevel=function(b){var f=this,y=this.hls.levels;if(!y.length)return-1;var c=y.filter(function(a,p){return K.isLevelAllowed(p,f.restrictedLevels)&&p<=b});return this.clientRect=null,K.getMaxLevelByMediaSize(c,this.mediaWidth,this.mediaHeight)},n.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},n.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},n.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,f={width:0,height:0};if(b){var y=b.getBoundingClientRect();f.width=y.width,f.height=y.height,!f.width&&!f.height&&(f.width=y.right-y.left||b.width||0,f.height=y.bottom-y.top||b.height||0)}return this.clientRect=f,f},K.isLevelAllowed=function(b,f){return f===void 0&&(f=[]),f.indexOf(b)===-1},K.getMaxLevelByMediaSize=function(b,f,y){if(!b||!b.length)return-1;for(var c=function(s,i){return i?s.width!==i.width||s.height!==i.height:!0},a=b.length-1,p=0;p<b.length;p+=1){var l=b[p];if((l.width>=f||l.height>=y)&&c(l,b[p+1])){a=p;break}}return a},F(K,[{key:"mediaWidth",get:function(){return this.getDimensions().width*K.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*K.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(f){}return b}}]),K}();Y.default=G},"./src/controller/cmcd-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return c});var z=M("./src/events.ts"),P=M("./src/types/cmcd.ts"),F=M("./src/utils/buffer-helper.ts"),G=M("./src/utils/logger.ts");function K(a,p){for(var l=0;l<p.length;l++){var u=p[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(a,u.key,u)}}function n(a,p,l){return p&&K(a.prototype,p),l&&K(a,l),a}function I(a,p){var l=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(l)return(l=l.call(a)).next.bind(l);if(Array.isArray(a)||(l=b(a))||p&&a&&typeof a.length=="number"){l&&(a=l);var u=0;return function(){return u>=a.length?{done:!0}:{done:!1,value:a[u++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(a,p){if(!a)return;if(typeof a=="string")return f(a,p);var l=Object.prototype.toString.call(a).slice(8,-1);if(l==="Object"&&a.constructor&&(l=a.constructor.name),l==="Map"||l==="Set")return Array.from(a);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return f(a,p)}function f(a,p){(p==null||p>a.length)&&(p=a.length);for(var l=0,u=new Array(p);l<p;l++)u[l]=a[l];return u}function y(){return y=Object.assign||function(a){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},y.apply(this,arguments)}var c=function(){function a(l){var u=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(){u.initialized&&(u.starved=!0),u.buffering=!0},this.onPlaying=function(){u.initialized||(u.initialized=!0),u.buffering=!1},this.applyPlaylistData=function(D){try{u.apply(D,{ot:P.CMCDObjectType.MANIFEST,su:!u.initialized})}catch(A){G.logger.warn("Could not generate manifest CMCD data.",A)}},this.applyFragmentData=function(D){try{var A=D.frag,S=u.hls.levels[A.level],R=u.getObjectType(A),O={d:A.duration*1e3,ot:R};(R===P.CMCDObjectType.VIDEO||R===P.CMCDObjectType.AUDIO||R==P.CMCDObjectType.MUXED)&&(O.br=S.bitrate/1e3,O.tb=u.getTopBandwidth(R),O.bl=u.getBufferLength(R)),u.apply(D,O)}catch(m){G.logger.warn("Could not generate segment CMCD data.",m)}},this.hls=l;var s=this.config=l.config,i=s.cmcd;i!=null&&(s.pLoader=this.createPlaylistLoader(),s.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||a.uuid(),this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.registerListeners())}var p=a.prototype;return p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),u.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},p.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},p.onMediaAttached=function(u,s){this.media=s.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},p.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},p.onBufferCreated=function(u,s){var i,D;this.audioBuffer=(i=s.tracks.audio)===null||i===void 0?void 0:i.buffer,this.videoBuffer=(D=s.tracks.video)===null||D===void 0?void 0:D.buffer},p.createData=function(){var u;return{v:P.CMCDVersion,sf:P.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(u=this.media)===null||u===void 0?void 0:u.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},p.apply=function(u,s){s===void 0&&(s={}),y(s,this.createData());var i=s.ot===P.CMCDObjectType.INIT||s.ot===P.CMCDObjectType.VIDEO||s.ot===P.CMCDObjectType.MUXED;if(this.starved&&i&&(s.bs=!0,s.su=!0,this.starved=!1),s.su==null&&(s.su=this.buffering),this.useHeaders){var D=a.toHeaders(s);if(!Object.keys(D).length)return;u.headers||(u.headers={}),y(u.headers,D)}else{var A=a.toQuery(s);if(!A)return;u.url=a.appendQueryToUri(u.url,A)}},p.getObjectType=function(u){var s=u.type;return s==="subtitle"?P.CMCDObjectType.TIMED_TEXT:u.sn==="initSegment"?P.CMCDObjectType.INIT:s==="audio"?P.CMCDObjectType.AUDIO:s==="main"?this.hls.audioTracks.length?P.CMCDObjectType.VIDEO:P.CMCDObjectType.MUXED:void 0},p.getTopBandwidth=function(u){for(var s=0,i=u===P.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,D=I(i),A;!(A=D()).done;){var S=A.value;S.bitrate>s&&(s=S.bitrate)}return s>0?s:NaN},p.getBufferLength=function(u){var s=this.hls.media,i=u===P.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!s)return NaN;var D=F.BufferHelper.bufferInfo(i,s.currentTime,this.config.maxBufferHole);return D.len*1e3},p.createPlaylistLoader=function(){var u=this.config.pLoader,s=this.applyPlaylistData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var A=D.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(R,O,m){s(R),this.loader.load(R,O,m)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},p.createFragmentLoader=function(){var u=this.config.fLoader,s=this.applyFragmentData,i=u||this.config.loader;return function(){function D(S){this.loader=void 0,this.loader=new i(S)}var A=D.prototype;return A.destroy=function(){this.loader.destroy()},A.abort=function(){this.loader.abort()},A.load=function(R,O,m){s(R),this.loader.load(R,O,m)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},a.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},a.serialize=function(u){for(var s=[],i=function(W){return!Number.isNaN(W)&&W!=null&&W!==""&&W!==!1},D=function(W){return Math.round(W)},A=function(W){return D(W/100)*100},S=function(W){return encodeURIComponent(W)},R={br:D,d:D,bl:A,dl:A,mtp:A,nor:S,rtp:A,tb:D},O=Object.keys(u||{}).sort(),m=I(O),v;!(v=m()).done;){var h=v.value,d=u[h];if(!i(d))continue;if(h==="v"&&d===1)continue;if(h=="pr"&&d===1)continue;var C=R[h];C&&(d=C(d));var E=typeof d,w=void 0;h==="ot"||h==="sf"||h==="st"?w=h+"="+d:E==="boolean"?w=h:E==="number"?w=h+"="+d:w=h+"="+JSON.stringify(d),s.push(w)}return s.join(",")},a.toHeaders=function(u){for(var s=Object.keys(u),i={},D=["Object","Request","Session","Status"],A=[{},{},{},{}],S={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},R=0,O=s;R<O.length;R++){var m=O[R],v=S[m]!=null?S[m]:1;A[v][m]=u[m]}for(var h=0;h<A.length;h++){var d=a.serialize(A[h]);d&&(i["CMCD-"+D[h]]=d)}return i},a.toQuery=function(u){return"CMCD="+encodeURIComponent(a.serialize(u))},a.appendQueryToUri=function(u,s){if(!s)return u;var i=u.includes("?")?"&":"?";return""+u+i+s},a}()},"./src/controller/eme-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/events.ts"),P=M("./src/errors.ts"),F=M("./src/utils/logger.ts"),G=M("./src/utils/mediakeys-helper.ts");function K(c,a){for(var p=0;p<a.length;p++){var l=a[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,a,p){return a&&K(c.prototype,a),p&&K(c,p),c}var I=3,b=function(a,p,l){var u={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(s){u.audioCapabilities.push({contentType:'audio/mp4; codecs="'+s+'"',robustness:l.audioRobustness||""})}),p.forEach(function(s){u.videoCapabilities.push({contentType:'video/mp4; codecs="'+s+'"',robustness:l.videoRobustness||""})}),[u]},f=function(a,p,l,u){switch(a){case G.KeySystems.WIDEVINE:return b(p,l,u);default:throw new Error("Unknown key-system: "+a)}},y=function(){function c(p){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=p,this._config=p.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(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(z.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(l){switch(l){case G.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+l+'"')},a._attemptKeySystemAccess=function(l,u,s){var i=this,D=f(l,u,s,this._drmSystemOptions);F.logger.log("Requesting encrypted media key-system access");var A=this.requestMediaKeySystemAccess(l,D);this.mediaKeysPromise=A.then(function(S){return i._onMediaKeySystemAccessObtained(l,S)}),A.catch(function(S){F.logger.error('Failed to obtain key-system "'+l+'" access:',S)})},a._onMediaKeySystemAccessObtained=function(l,u){var s=this;F.logger.log('Access for key-system "'+l+'" obtained');var i={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:u,mediaKeySystemDomain:l};this._mediaKeysList.push(i);var D=Promise.resolve().then(function(){return u.createMediaKeys()}).then(function(A){return i.mediaKeys=A,F.logger.log('Media-keys created for key-system "'+l+'"'),s._onMediaKeysCreated(),A});return D.catch(function(A){F.logger.error("Failed to create media-keys:",A)}),D},a._onMediaKeysCreated=function(){var l=this;this._mediaKeysList.forEach(function(u){u.mediaKeysSession||(u.mediaKeysSession=u.mediaKeys.createSession(),l._onNewMediaKeySession(u.mediaKeysSession))})},a._onNewMediaKeySession=function(l){var u=this;F.logger.log("New key-system session "+l.sessionId),l.addEventListener("message",function(s){u._onKeySessionMessage(l,s.message)},!1)},a._onKeySessionMessage=function(l,u){F.logger.log("Got EME message event, creating license request"),this._requestLicense(u,function(s){F.logger.log("Received license data (length: "+(s&&s.byteLength)+"), updating key-session"),l.update(s)})},a.onMediaEncrypted=function(l){var u=this;if(F.logger.log('Media is encrypted using "'+l.initDataType+'" init data type'),!this.mediaKeysPromise){F.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var s=function(D){if(!u._media)return;u._attemptSetMediaKeys(D),u._generateRequestWithPreferredKeySession(l.initDataType,l.initData)};this.mediaKeysPromise.then(s).catch(s)},a._attemptSetMediaKeys=function(l){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var u=this._mediaKeysList[0];if(!u||!u.mediaKeys){F.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}F.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(u.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(l,u){var s=this,i=this._mediaKeysList[0];if(!i){F.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(i.mediaKeysSessionInitialized){F.logger.warn("Key-Session already initialized but requested again");return}var D=i.mediaKeysSession;if(!D){F.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!u){F.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}F.logger.log('Generating key-session request for "'+l+'" init data type'),i.mediaKeysSessionInitialized=!0,D.generateRequest(l,u).then(function(){F.logger.debug("Key-session generation succeeded")}).catch(function(A){F.logger.error("Error generating key-session request:",A),s.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(l,u,s){var i=new XMLHttpRequest;i.responseType="arraybuffer",i.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,i,l,u,s);var D=this._licenseXhrSetup;if(D)try{D.call(this.hls,i,l),D=void 0}catch(A){F.logger.error(A)}try{i.readyState||i.open("POST",l,!0),D&&D.call(this.hls,i,l)}catch(A){throw new Error("issue setting up KeySystem license XHR "+A)}return i},a._onLicenseRequestReadyStageChange=function(l,u,s,i){switch(l.readyState){case 4:if(l.status===200){this._requestLicenseFailureCount=0,F.logger.log("License request succeeded");var D=l.response,A=this._licenseResponseCallback;if(A)try{D=A.call(this.hls,l,u)}catch(R){F.logger.error(R)}i(D)}else{if(F.logger.error("License Request XHR failed ("+u+"). Status: "+l.status+" ("+l.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>I){this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=I-this._requestLicenseFailureCount+1;F.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,i)}break}},a._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},a._requestLicense=function(l,u){F.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){F.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(s.mediaKeySystemDomain),D=this._createLicenseXhr(i,l,u);F.logger.log("Sending license request to URL: "+i);var A=this._generateLicenseRequestChallenge(s,l);D.send(A)}catch(S){F.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.KEY_SYSTEM_ERROR,details:P.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var l=this._media,u=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(u.map(function(s){if(s.mediaKeysSession)return s.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(l,u){if(!this._emeEnabled)return;var s=u.levels.map(function(D){return D.audioCodec}).filter(function(D){return!!D}),i=u.levels.map(function(D){return D.videoCodec}).filter(function(D){return!!D});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,s,i)},n(c,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),c}();Y.default=y},"./src/controller/fps-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/events.ts"),P=M("./src/utils/logger.ts"),F=function(){function G(n){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=n,this.registerListeners()}var K=G.prototype;return K.setStreamController=function(I){this.streamController=I},K.registerListeners=function(){this.hls.on(z.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},K.unregisterListeners=function(){this.hls.off(z.Events.MEDIA_ATTACHING,this.onMediaAttaching)},K.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},K.onMediaAttaching=function(I,b){var f=this.hls.config;if(f.capLevelOnFPSDrop){var y=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=y,y&&typeof y.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},K.checkFPS=function(I,b,f){var y=performance.now();if(b){if(this.lastTime){var c=y-this.lastTime,a=f-this.lastDroppedFrames,p=b-this.lastDecodedFrames,l=1e3*a/c,u=this.hls;if(u.trigger(z.Events.FPS_DROP,{currentDropped:a,currentDecoded:p,totalDroppedFrames:f}),l>0&&a>u.config.fpsDroppedMonitoringThreshold*p){var s=u.currentLevel;P.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+s),s>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=s)&&(s=s-1,u.trigger(z.Events.FPS_DROP_LEVEL_CAPPING,{level:s,droppedLevel:u.currentLevel}),u.autoLevelCapping=s,this.streamController.nextLevelSwitch())}}this.lastTime=y,this.lastDroppedFrames=f,this.lastDecodedFrames=b}},K.checkFPSInterval=function(){var I=this.media;if(I)if(this.isVideoPlaybackQualityAvailable){var b=I.getVideoPlaybackQuality();this.checkFPS(I,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(I,I.webkitDecodedFrameCount,I.webkitDroppedFrameCount)},G}();Y.default=F},"./src/controller/fragment-finders.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"findFragmentByPDT",function(){return F}),M.d(Y,"findFragmentByPTS",function(){return G}),M.d(Y,"fragmentWithinToleranceTest",function(){return K}),M.d(Y,"pdtWithinToleranceTest",function(){return n}),M.d(Y,"findFragWithCC",function(){return I});var z=M("./src/polyfills/number.ts"),P=M("./src/utils/binary-search.ts");function F(b,f,y){if(f===null||!Array.isArray(b)||!b.length||!Object(z.isFiniteNumber)(f))return null;var c=b[0].programDateTime;if(f<(c||0))return null;var a=b[b.length-1].endProgramDateTime;if(f>=(a||0))return null;y=y||0;for(var p=0;p<b.length;++p){var l=b[p];if(n(f,y,l))return l}return null}function G(b,f,y,c){y===void 0&&(y=0),c===void 0&&(c=0);var a=null;if(b?a=f[b.sn-f[0].sn+1]||null:y===0&&f[0].start===0&&(a=f[0]),a&&K(y,c,a)===0)return a;var p=P.default.search(f,K.bind(null,y,c));return p||a}function K(b,f,y){b===void 0&&(b=0),f===void 0&&(f=0);var c=Math.min(f,y.duration+(y.deltaPTS?y.deltaPTS:0));return y.start+y.duration-c<=b?1:y.start-c>b&&y.start?-1:0}function n(b,f,y){var c=Math.min(f,y.duration+(y.deltaPTS?y.deltaPTS:0))*1e3,a=y.endProgramDateTime||0;return a-c>b}function I(b,f){return P.default.search(b,function(y){return y.cc<f?1:y.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"FragmentState",function(){return F}),M.d(Y,"FragmentTracker",function(){return G});var z=M("./src/events.ts"),P=M("./src/types/loader.ts"),F;(function(I){I.NOT_LOADED="NOT_LOADED",I.BACKTRACKED="BACKTRACKED",I.APPENDING="APPENDING",I.PARTIAL="PARTIAL",I.OK="OK"})(F||(F={}));var G=function(){function I(f){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=f,this._registerListeners()}var b=I.prototype;return b._registerListeners=function(){var y=this.hls;y.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),y.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),y.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var y=this.hls;y.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),y.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),y.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(y,c){if(c===P.PlaylistLevelType.MAIN){var a=this.activeFragment,p=this.activeParts;if(!a)return null;if(p)for(var l=p.length;l--;){var u=p[l],s=u?u.end:a.appendedPTS;if(u.start<=y&&s!==void 0&&y<=s)return l>9&&(this.activeParts=p.slice(l-9)),u}else if(a.start<=y&&a.appendedPTS!==void 0&&y<=a.appendedPTS)return a}return this.getBufferedFrag(y,c)},b.getBufferedFrag=function(y,c){for(var a=this.fragments,p=Object.keys(a),l=p.length;l--;){var u=a[p[l]];if((u==null?void 0:u.body.type)===c&&u.buffered){var s=u.body;if(s.start<=y&&y<=s.end)return s}}return null},b.detectEvictedFragments=function(y,c,a){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(!u.buffered){u.body.type===a&&p.removeFragment(u.body);return}var s=u.range[y];if(!s)return;s.time.some(function(i){var D=!p.isTimeBuffered(i.startPTS,i.endPTS,c);return D&&p.removeFragment(u.body),D})})},b.detectPartialFragments=function(y){var c=this,a=this.timeRanges,p=y.frag,l=y.part;if(!a||p.sn==="initSegment")return;var u=n(p),s=this.fragments[u];if(!s)return;Object.keys(a).forEach(function(i){var D=p.elementaryStreams[i];if(!D)return;var A=a[i],S=l!==null||D.partial===!0;s.range[i]=c.getBufferedTimes(p,l,S,A)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},b.fragBuffered=function(y){var c=n(y),a=this.fragments[c];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},b.getBufferedTimes=function(y,c,a,p){for(var l={time:[],partial:a},u=c?c.start:y.start,s=c?c.end:y.end,i=y.minEndPTS||s,D=y.maxStartPTS||u,A=0;A<p.length;A++){var S=p.start(A)-this.bufferPadding,R=p.end(A)+this.bufferPadding;if(D>=S&&i<=R){l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});break}else if(u<R&&s>S)l.partial=!0,l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});else if(s<=S)break}return l},b.getPartialFragment=function(y){var c=null,a,p,l,u=0,s=this.bufferPadding,i=this.fragments;return Object.keys(i).forEach(function(D){var A=i[D];if(!A)return;K(A)&&(p=A.body.start-s,l=A.body.end+s,y>=p&&y<=l&&(a=Math.min(y-p,l-y),u<=a&&(c=A.body,u=a)))}),c},b.getState=function(y){var c=n(y),a=this.fragments[c];return a?a.buffered?K(a)?F.PARTIAL:F.OK:a.backtrack?F.BACKTRACKED:F.APPENDING:F.NOT_LOADED},b.backtrack=function(y,c){var a=n(y),p=this.fragments[a];if(!p||p.backtrack)return null;var l=p.backtrack=c||p.loaded;return p.loaded=null,l},b.getBacktrackData=function(y){var c=n(y),a=this.fragments[c];if(a){var p,l=a.backtrack;if(l!=null&&(p=l.payload)!==null&&p!==void 0&&p.byteLength)return l;this.removeFragment(y)}return null},b.isTimeBuffered=function(y,c,a){for(var p,l,u=0;u<a.length;u++){if(p=a.start(u)-this.bufferPadding,l=a.end(u)+this.bufferPadding,y>=p&&c<=l)return!0;if(c<=p)return!1}return!1},b.onFragLoaded=function(y,c){var a=c.frag,p=c.part;if(a.sn==="initSegment"||a.bitrateTest||p)return;var l=n(a);this.fragments[l]={body:a,loaded:c,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(y,c){var a=this,p=c.frag,l=c.part,u=c.timeRanges;if(p.type===P.PlaylistLevelType.MAIN)if(this.activeFragment=p,l){var s=this.activeParts;s||(this.activeParts=s=[]),s.push(l)}else this.activeParts=null;this.timeRanges=u,Object.keys(u).forEach(function(i){var D=u[i];if(a.detectEvictedFragments(i,D),!l)for(var A=0;A<D.length;A++)p.appendedPTS=Math.max(D.end(A),p.appendedPTS||0)})},b.onFragBuffered=function(y,c){this.detectPartialFragments(c)},b.hasFragment=function(y){var c=n(y);return!!this.fragments[c]},b.removeFragmentsInRange=function(y,c,a){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(u.buffered){var s=u.body;s.type===a&&s.start<c&&s.end>y&&p.removeFragment(s)}})},b.removeFragment=function(y){var c=n(y);y.stats.loaded=0,y.clearElementaryStreamInfo(),delete this.fragments[c]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},I}();function K(I){var b,f;return I.buffered&&(((b=I.range.video)===null||b===void 0?void 0:b.partial)||((f=I.range.audio)===null||f===void 0?void 0:f.partial))}function n(I){return I.type+"_"+I.level+"_"+I.urlId+"_"+I.sn}},"./src/controller/gap-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return K}),M.d(Y,"MAX_START_GAP_JUMP",function(){return n}),M.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return I}),M.d(Y,"SKIP_BUFFER_RANGE_START",function(){return b}),M.d(Y,"default",function(){return f});var z=M("./src/utils/buffer-helper.ts"),P=M("./src/errors.ts"),F=M("./src/events.ts"),G=M("./src/utils/logger.ts"),K=250,n=2,I=.1,b=.05,f=function(){function y(a,p,l,u){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=p,this.fragmentTracker=l,this.hls=u}var c=y.prototype;return c.destroy=function(){this.hls=this.fragmentTracker=this.media=null},c.poll=function(p){var l=this.config,u=this.media,s=this.stalled,i=u.currentTime,D=u.seeking,A=this.seeking&&!D,S=!this.seeking&&D;if(this.seeking=D,i!==p){if(this.moved=!0,s!==null){if(this.stallReported){var R=self.performance.now()-s;G.logger.warn("playback not stuck anymore @"+i+", after "+Math.round(R)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||A)&&(this.stalled=null),u.paused||u.ended||u.playbackRate===0||!z.BufferHelper.getBuffered(u).length)return;var O=z.BufferHelper.bufferInfo(u,i,0),m=O.len>0,v=O.nextStart||0;if(!m&&!v)return;if(D){var h=O.len>n,d=!v||v-i>n&&!this.fragmentTracker.getPartialFragment(i);if(h||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(v,O.start||0)-i,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,j=w==null||((C=w.details)===null||C===void 0)?void 0:C.live,W=j?w.details.targetduration*2:n;if(E>0&&E<=W){this._trySkipBufferHole(null);return}}var T=self.performance.now();if(s===null){this.stalled=T;return}var N=T-s;!D&&N>=K&&this._reportStall(O.len);var _=z.BufferHelper.bufferInfo(u,i,l.maxBufferHole);this._tryFixBufferStall(_,N)},c._tryFixBufferStall=function(p,l){var u=this.config,s=this.fragmentTracker,i=this.media,D=i.currentTime,A=s.getPartialFragment(D);if(A){var S=this._trySkipBufferHole(A);if(S)return}p.len>u.maxBufferHole&&l>u.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},c._reportStall=function(p){var l=this.hls,u=this.media,s=this.stallReported;s||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+u.currentTime+" due to low buffer (buffer="+p+")"),l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},c._trySkipBufferHole=function(p){for(var l=this.config,u=this.hls,s=this.media,i=s.currentTime,D=0,A=z.BufferHelper.getBuffered(s),S=0;S<A.length;S++){var R=A.start(S);if(i+l.maxBufferHole>=D&&i<R){var O=Math.max(R+b,s.currentTime+I);return G.logger.warn("skipping hole, adjusting currentTime from "+i+" to "+O),this.moved=!0,this.stalled=null,s.currentTime=O,p&&u.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+i+" to "+O,frag:p}),O}D=A.end(S)}return 0},c._tryNudgeBuffer=function(){var p=this.config,l=this.hls,u=this.media,s=u.currentTime,i=(this.nudgeRetry||0)+1;if(this.nudgeRetry=i,i<p.nudgeMaxRetry){var D=s+i*p.nudgeOffset;G.logger.warn("Nudging 'currentTime' from "+s+" to "+D),u.currentTime=D,l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else G.logger.error("Playhead still not moving while enough data buffered @"+s+" after "+p.nudgeMaxRetry+" nudges"),l.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},y}()},"./src/controller/id3-track-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/events.ts"),P=M("./src/utils/texttrack-utils.ts"),F=M("./src/demux/id3.ts"),G=.25,K=function(){function n(b){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=b,this._registerListeners()}var I=n.prototype;return I.destroy=function(){this._unregisterListeners()},I._registerListeners=function(){var f=this.hls;f.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I._unregisterListeners=function(){var f=this.hls;f.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(z.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},I.onMediaAttached=function(f,y){this.media=y.media},I.onMediaDetaching=function(){if(!this.id3Track)return;Object(P.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},I.getID3Track=function(f){if(!this.media)return;for(var y=0;y<f.length;y++){var c=f[y];if(c.kind==="metadata"&&c.label==="id3")return Object(P.sendAddTrackEvent)(c,this.media),c}return this.media.addTextTrack("metadata","id3")},I.onFragParsingMetadata=function(f,y){if(!this.media)return;var c=y.frag,a=y.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var p=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,l=0;l<a.length;l++){var u=F.getID3Frames(a[l].data);if(u){var s=a[l].pts,i=l<a.length-1?a[l+1].pts:c.end,D=i-s;D<=0&&(i=s+G);for(var A=0;A<u.length;A++){var S=u[A];if(!F.isTimeStampFrame(S)){var R=new p(s,i,"");R.value=S,this.id3Track.addCue(R)}}}}},I.onBufferFlushing=function(f,y){var c=y.startOffset,a=y.endOffset,p=y.type;if(!p||p==="audio"){var l=this.id3Track;l&&Object(P.removeCuesInRange)(l,c,a)}},n}();Y.default=K},"./src/controller/latency-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return n});var z=M("./src/errors.ts"),P=M("./src/events.ts"),F=M("./src/utils/logger.ts");function G(I,b){for(var f=0;f<b.length;f++){var y=b[f];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(I,y.key,y)}}function K(I,b,f){return b&&G(I.prototype,b),f&&G(I,f),I}var n=function(){function I(f){var y=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 y.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var b=I.prototype;return b.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},b.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(P.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(P.Events.ERROR,this.onError,this)},b.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(P.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(P.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(P.Events.ERROR,this.onError)},b.onMediaAttached=function(y,c){this.media=c.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},b.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},b.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},b.onLevelUpdated=function(y,c){var a=c.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},b.onError=function(y,c){if(c.details!==z.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,F.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},b.timeupdate=function(){var y=this.media,c=this.levelDetails;if(!y||!c)return;this.currentTime=y.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var p=this.config,l=p.lowLatencyMode,u=p.maxLiveSyncPlaybackRate;if(!l||u===1)return;var s=this.targetLatency;if(s===null)return;var i=a-s,D=Math.min(this.maxLatency,s+c.targetduration),A=i<D;if(c.live&&A&&i>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,u)),R=Math.round(2/(1+Math.exp(-.75*i-this.edgeStalled))*20)/20;y.playbackRate=Math.min(S,Math.max(1,R))}else y.playbackRate!==1&&y.playbackRate!==0&&(y.playbackRate=1)},b.estimateLiveEdge=function(){var y=this.levelDetails;return y===null?null:y.edge+y.age},b.computeLatency=function(){var y=this.estimateLiveEdge();return y===null?null:y-this.currentTime},K(I,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var y=this.config,c=this.levelDetails;return y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:c?y.liveMaxLatencyDurationCount*c.targetduration:0}},{key:"targetLatency",get:function(){var y=this.levelDetails;if(y===null)return null;var c=y.holdBack,a=y.partHoldBack,p=y.targetduration,l=this.config,u=l.liveSyncDuration,s=l.liveSyncDurationCount,i=l.lowLatencyMode,D=this.hls.userConfig,A=i&&a||c;(D.liveSyncDuration||D.liveSyncDurationCount||A===0)&&(A=u!==void 0?u:s*p);var S=p,R=1;return A+Math.min(this.stallCount*R,S)}},{key:"liveSyncPosition",get:function(){var y=this.estimateLiveEdge(),c=this.targetLatency,a=this.levelDetails;if(y===null||c===null||a===null)return null;var p=a.edge,l=y-c-this.edgeStalled,u=p-a.totalduration,s=p-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var y=this.levelDetails;return y===null?1:y.drift}},{key:"edgeStalled",get:function(){var y=this.levelDetails;if(y===null)return 0;var c=(this.config.lowLatencyMode&&y.partTarget||y.targetduration)*3;return Math.max(y.age-c,0)}},{key:"forwardBufferLength",get:function(){var y=this.media,c=this.levelDetails;if(!y||!c)return 0;var a=y.buffered.length;return a?y.buffered.end(a-1):c.edge-this.currentTime}}]),I}()},"./src/controller/level-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return l});var z=M("./src/types/level.ts"),P=M("./src/events.ts"),F=M("./src/errors.ts"),G=M("./src/utils/codecs.ts"),K=M("./src/controller/level-helper.ts"),n=M("./src/controller/base-playlist-controller.ts"),I=M("./src/types/loader.ts");function b(){return b=Object.assign||function(u){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var D in i)Object.prototype.hasOwnProperty.call(i,D)&&(u[D]=i[D])}return u},b.apply(this,arguments)}function f(u,s){for(var i=0;i<s.length;i++){var D=s[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function y(u,s,i){return s&&f(u.prototype,s),i&&f(u,i),u}function c(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,a(u,s)}function a(u,s){return a=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},a(u,s)}var p=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=function(u){c(s,u);function s(D){var A;return A=u.call(this,D,"[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 i=s.prototype;return i._registerListeners=function(){var A=this.hls;A.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),A.on(P.Events.ERROR,this.onError,this)},i._unregisterListeners=function(){var A=this.hls;A.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),A.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(P.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),A.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),A.off(P.Events.ERROR,this.onError,this)},i.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,u.prototype.destroy.call(this)},i.startLoad=function(){var A=this._levels;A.forEach(function(S){S.loadError=0}),u.prototype.startLoad.call(this)},i.onManifestLoaded=function(A,S){var R=[],O=[],m=[],v,h={},d,C=!1,E=!1,w=!1;if(S.levels.forEach(function(N){var _=N.attrs;C=C||!!(N.width&&N.height),E=E||!!N.videoCodec,w=w||!!N.audioCodec,p&&N.audioCodec&&N.audioCodec.indexOf("mp4a.40.34")!==-1&&(N.audioCodec=void 0);var x=N.bitrate+"-"+N.attrs.RESOLUTION+"-"+N.attrs.CODECS;d=h[x],d?d.url.push(N.url):(d=new z.Level(N),h[x]=d,R.push(d)),_&&(_.AUDIO&&Object(K.addGroupId)(d,"audio",_.AUDIO),_.SUBTITLES&&Object(K.addGroupId)(d,"text",_.SUBTITLES))}),(C||E)&&w&&(R=R.filter(function(N){var _=N.videoCodec,x=N.width,H=N.height;return!!_||!!(x&&H)})),R=R.filter(function(N){var _=N.audioCodec,x=N.videoCodec;return(!_||Object(G.isCodecSupportedInMp4)(_,"audio"))&&(!x||Object(G.isCodecSupportedInMp4)(x,"video"))}),S.audioTracks&&(O=S.audioTracks.filter(function(N){return!N.audioCodec||Object(G.isCodecSupportedInMp4)(N.audioCodec,"audio")}),Object(K.assignTrackIdsByGroup)(O)),S.subtitles&&(m=S.subtitles,Object(K.assignTrackIdsByGroup)(m)),R.length>0){v=R[0].bitrate,R.sort(function(N,_){return N.bitrate-_.bitrate}),this._levels=R;for(var j=0;j<R.length;j++)if(R[j].bitrate===v){this._firstLevel=j,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+v);break}var W=w&&!E,T={levels:R,audioTracks:O,subtitleTracks:m,firstLevel:this._firstLevel,stats:S.stats,audio:w,video:E,altAudio:!W&&O.some(function(N){return!!N.url})};this.hls.trigger(P.Events.MANIFEST_PARSED,T),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.MEDIA_ERROR,details:F.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},i.onError=function(A,S){if(u.prototype.onError.call(this,A,S),S.fatal)return;var R=S.context,O=this._levels[this.currentLevelIndex];if(R&&(R.type===I.PlaylistContextType.AUDIO_TRACK&&O.audioGroupIds&&R.groupId===O.audioGroupIds[O.urlId]||R.type===I.PlaylistContextType.SUBTITLE_TRACK&&O.textGroupIds&&R.groupId===O.textGroupIds[O.urlId])){this.redundantFailover(this.currentLevelIndex);return}var m=!1,v=!0,h;switch(S.details){case F.ErrorDetails.FRAG_LOAD_ERROR:case F.ErrorDetails.FRAG_LOAD_TIMEOUT:case F.ErrorDetails.KEY_LOAD_ERROR:case F.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var d=this._levels[S.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=S.frag.level)):h=S.frag.level}break;case F.ErrorDetails.LEVEL_LOAD_ERROR:case F.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(v=!1),h=R.level),m=!0;break;case F.ErrorDetails.REMUX_ALLOC_ERROR:h=S.level,m=!0;break}h!==void 0&&this.recoverLevel(S,h,m,v)},i.recoverLevel=function(A,S,R,O){var m=A.details,v=this._levels[S];if(v.loadError++,R){var h=this.retryLoadingOrFail(A);if(h)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var d=v.url.length;if(d>1&&v.loadError<d)A.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var C=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(m+": switch to "+C),A.levelRetry=!0,this.hls.nextAutoLevel=C)}}},i.redundantFailover=function(A){var S=this._levels[A],R=S.url.length;if(R>1){var O=(S.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(m){m.urlId=O}),this.level=A}},i.onFragLoaded=function(A,S){var R=S.frag;if(R!==void 0&&R.type===I.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},i.onLevelLoaded=function(A,S){var R,O=S.level,m=S.details,v=this._levels[O];if(!v){var h;this.warn("Invalid level index "+O),(h=S.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(m.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,v.details)):(R=S.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(m.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(A,S){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,m=this.hls.audioTracks[S.id].groupId,v=0;v<R.audioGroupIds.length;v++)if(R.audioGroupIds[v]===m){O=v;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},i.loadPlaylist=function(A){var S=this.currentLevelIndex,R=this._levels[S];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,m=R.url[O];if(A)try{m=A.addDirectives(m)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+S+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+O+" "+m),this.clearTimer(),this.hls.trigger(P.Events.LEVEL_LOADING,{url:m,level:S,id:O,deliveryDirectives:A||null})}},i.removeLevel=function(A,S){var R=function(v,h){return h!==S},O=this._levels.filter(function(m,v){return v!==A?!0:m.url.length>1&&S!==void 0?(m.url=m.url.filter(R),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(R)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(R)),m.urlId=0,!0):!1}).map(function(m,v){var h=m.details;return h!=null&&h.fragments&&h.fragments.forEach(function(d){d.level=v}),m});this._levels=O,this.hls.trigger(P.Events.LEVELS_UPDATED,{levels:O})},y(s,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(A){var S,R=this._levels;if(R.length===0)return;if(this.currentLevelIndex===A&&(S=R[A])!==null&&S!==void 0&&S.details)return;if(A<0||A>=R.length){var O=A<0;if(this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.OTHER_ERROR,details:F.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:O,reason:"invalid level idx"}),O)return;A=Math.min(A,R.length-1)}this.clearTimer();var m=this.currentLevelIndex,v=R[m],h=R[A];this.log("switching to level "+A+" from "+m),this.currentLevelIndex=A;var d=b({},h,{level:A,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete d._urlId,this.hls.trigger(P.Events.LEVEL_SWITCHING,d);var C=h.details;if(!C||C.live){var E=this.switchParams(h.uri,v==null?void 0:v.details);this.loadPlaylist(E)}}},{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}(n.default)},"./src/controller/level-helper.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"addGroupId",function(){return F}),M.d(Y,"assignTrackIdsByGroup",function(){return G}),M.d(Y,"updatePTS",function(){return K}),M.d(Y,"updateFragPTSDTS",function(){return I}),M.d(Y,"mergeDetails",function(){return b}),M.d(Y,"mapPartIntersection",function(){return f}),M.d(Y,"mapFragmentIntersection",function(){return y}),M.d(Y,"adjustSliding",function(){return c}),M.d(Y,"addSliding",function(){return a}),M.d(Y,"computeReloadInterval",function(){return p}),M.d(Y,"getFragmentWithSN",function(){return l}),M.d(Y,"getPartWith",function(){return u});var z=M("./src/polyfills/number.ts"),P=M("./src/utils/logger.ts");function F(s,i,D){switch(i){case"audio":s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds.push(D);break;case"text":s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds.push(D);break}}function G(s){var i={};s.forEach(function(D){var A=D.groupId||"";D.id=i[A]=i[A]||0,i[A]++})}function K(s,i,D){var A=s[i],S=s[D];n(A,S)}function n(s,i){var D=i.startPTS;if(Object(z.isFiniteNumber)(D)){var A=0,S;i.sn>s.sn?(A=D-s.start,S=s):(A=s.start-D,S=i),S.duration!==A&&(S.duration=A)}else if(i.sn>s.sn){var R=s.cc===i.cc;R&&s.minEndPTS?i.start=s.start+(s.minEndPTS-s.start):i.start=s.start+s.duration}else i.start=Math.max(s.start-i.duration,0)}function I(s,i,D,A,S,R){var O=A-D;O<=0&&(P.logger.warn("Fragment should have a positive duration",i),A=D+i.duration,R=S+i.duration);var m=D,v=A,h=i.startPTS,d=i.endPTS;if(Object(z.isFiniteNumber)(h)){var C=Math.abs(h-D);Object(z.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(C,i.deltaPTS):i.deltaPTS=C,m=Math.max(D,h),D=Math.min(D,h),S=Math.min(S,i.startDTS),v=Math.min(A,d),A=Math.max(A,d),R=Math.max(R,i.endDTS)}i.duration=A-D;var E=D-i.start;i.appendedPTS=A,i.start=i.startPTS=D,i.maxStartPTS=m,i.startDTS=S,i.endPTS=A,i.minEndPTS=v,i.endDTS=R;var w=i.sn;if(!s||w<s.startSN||w>s.endSN)return 0;var j,W=w-s.startSN,T=s.fragments;for(T[W]=i,j=W;j>0;j--)n(T[j],T[j-1]);for(j=W;j<T.length-1;j++)n(T[j],T[j+1]);return s.fragmentHint&&n(T[T.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,E}function b(s,i){for(var D=null,A=s.fragments,S=A.length-1;S>=0;S--){var R=A[S].initSegment;if(R){D=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,m;if(y(s,i,function(j,W){j.relurl&&(O=j.cc-W.cc),Object(z.isFiniteNumber)(j.startPTS)&&Object(z.isFiniteNumber)(j.endPTS)&&(W.start=W.startPTS=j.startPTS,W.startDTS=j.startDTS,W.appendedPTS=j.appendedPTS,W.maxStartPTS=j.maxStartPTS,W.endPTS=j.endPTS,W.endDTS=j.endDTS,W.minEndPTS=j.minEndPTS,W.duration=j.endPTS-j.startPTS,W.duration&&(m=W),i.PTSKnown=i.alignedSliding=!0),W.elementaryStreams=j.elementaryStreams,W.loader=j.loader,W.stats=j.stats,W.urlId=j.urlId,j.initSegment&&(W.initSegment=j.initSegment,D=j.initSegment)}),D){var v=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;v.forEach(function(j){var W;(!j.initSegment||j.initSegment.relurl===((W=D)===null||W===void 0?void 0:W.relurl))&&(j.initSegment=D)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(j){return!j}),i.deltaUpdateFailed)){P.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=i.skippedSegments;h--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var d=i.fragments;if(O){P.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<d.length;C++)d[C].cc+=O}i.skippedSegments&&(i.startCC=i.fragments[0].cc),f(s.partList,i.partList,function(j,W){W.elementaryStreams=j.elementaryStreams,W.stats=j.stats}),m?I(i,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):c(s,i),d.length&&(i.totalduration=i.edge-d[0].start),i.driftStartTime=s.driftStartTime,i.driftStart=s.driftStart;var E=i.advancedDateTime;if(i.advanced&&E){var w=i.edge;i.driftStart||(i.driftStartTime=E,i.driftStart=w),i.driftEndTime=E,i.driftEnd=w}else i.driftEndTime=s.driftEndTime,i.driftEnd=s.driftEnd,i.advancedDateTime=s.advancedDateTime}function f(s,i,D){if(s&&i)for(var A=0,S=0,R=s.length;S<=R;S++){var O=s[S],m=i[S+A];O&&m&&O.index===m.index&&O.fragment.sn===m.fragment.sn?D(O,m):A--}}function y(s,i,D){for(var A=i.skippedSegments,S=Math.max(s.startSN,i.startSN)-i.startSN,R=(s.fragmentHint?1:0)+(A?i.endSN:Math.min(s.endSN,i.endSN))-i.startSN,O=i.startSN-s.startSN,m=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,v=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments,h=S;h<=R;h++){var d=v[O+h],C=m[h];A&&!C&&h<A&&(C=i.fragments[h]=d),d&&C&&D(d,C)}}function c(s,i){var D=i.startSN+i.skippedSegments-s.startSN,A=s.fragments;if(D<0||D>=A.length)return;a(i,A[D].start)}function a(s,i){if(i){for(var D=s.fragments,A=s.skippedSegments;A<D.length;A++)D[A].start+=i;s.fragmentHint&&(s.fragmentHint.start+=i)}}function p(s,i){var D=1e3*s.levelTargetDuration,A=D/2,S=s.age,R=S>0&&S<D*3,O=i.loading.end-i.loading.start,m,v=s.availabilityDelay;if(s.updated===!1)if(R){var h=333*s.misses;m=Math.max(Math.min(A,O*2),h),s.availabilityDelay=(s.availabilityDelay||0)+m}else m=A;else R?(v=Math.min(v||D/2,S),s.availabilityDelay=v,m=v+D-S):m=D-O;return Math.round(m)}function l(s,i,D){if(!s||!s.details)return null;var A=s.details,S=A.fragments[i-A.startSN];return S||(S=A.fragmentHint,S&&S.sn===i?S:i<A.startSN&&D&&D.sn===i?D:null)}function u(s,i,D){if(!s||!s.details)return null;var A=s.details.partList;if(A)for(var S=A.length;S--;){var R=A[S];if(R.index===D&&R.fragment.sn===i)return R}return null}},"./src/controller/stream-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return A});var z=M("./src/polyfills/number.ts"),P=M("./src/controller/base-stream-controller.ts"),F=M("./src/is-supported.ts"),G=M("./src/events.ts"),K=M("./src/utils/buffer-helper.ts"),n=M("./src/controller/fragment-tracker.ts"),I=M("./src/types/loader.ts"),b=M("./src/loader/fragment.ts"),f=M("./src/demux/transmuxer-interface.ts"),y=M("./src/types/transmuxer.ts"),c=M("./src/controller/gap-controller.ts"),a=M("./src/errors.ts"),p=M("./src/utils/logger.ts");function l(S,R){for(var O=0;O<R.length;O++){var m=R[O];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(S,m.key,m)}}function u(S,R,O){return R&&l(S.prototype,R),O&&l(S,O),S}function s(S,R){S.prototype=Object.create(R.prototype),S.prototype.constructor=S,i(S,R)}function i(S,R){return i=Object.setPrototypeOf||function(m,v){return m.__proto__=v,m},i(S,R)}var D=100,A=function(S){s(R,S);function R(m,v){var h;return h=S.call(this,m,v,"[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 O=R.prototype;return O._registerListeners=function(){var v=this.hls;v.on(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.on(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.on(G.Events.LEVEL_LOADING,this.onLevelLoading,this),v.on(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.on(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.on(G.Events.ERROR,this.onError,this),v.on(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.on(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.on(G.Events.BUFFER_CREATED,this.onBufferCreated,this),v.on(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.on(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.on(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O._unregisterListeners=function(){var v=this.hls;v.off(G.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(G.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(G.Events.MANIFEST_LOADING,this.onManifestLoading,this),v.off(G.Events.MANIFEST_PARSED,this.onManifestParsed,this),v.off(G.Events.LEVEL_LOADED,this.onLevelLoaded,this),v.off(G.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),v.off(G.Events.ERROR,this.onError,this),v.off(G.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),v.off(G.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),v.off(G.Events.BUFFER_CREATED,this.onBufferCreated,this),v.off(G.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),v.off(G.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),v.off(G.Events.FRAG_BUFFERED,this.onFragBuffered,this)},O.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},O.startLoad=function(v){if(this.levels){var h=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(D),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=d.startLevel;C===-1&&(d.config.testBandwidth?(C=0,this.bitrateTest=!0):C=d.nextAutoLevel),this.level=d.nextLoadLevel=C,this.loadedmetadata=!1}h>0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),v=h),this.state=P.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=P.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case P.State.IDLE:this.doTickIdle();break;case P.State.WAITING_LEVEL:{var v,h=this.levels,d=this.level,C=h==null||((v=h[d])===null||v===void 0)?void 0:v.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=P.State.IDLE;break}break}case P.State.FRAG_LOADING_WAITING_RETRY:{var E,w=self.performance.now(),j=this.retryDate;(!j||w>=j||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=P.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var v,h,d=this.hls,C=this.levelLastLoaded,E=this.levels,w=this.media,j=d.config,W=d.nextLoadLevel;if(C===null||!w&&(this.startFragRequested||!j.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[W])return;var T=E[W];this.level=d.nextLoadLevel=W;var N=T.details;if(!N||this.state===P.State.WAITING_LEVEL||N.live&&this.levelLastLoaded!==W){this.state=P.State.WAITING_LEVEL;return}var _=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,I.PlaylistLevelType.MAIN);if(_===null)return;var x=_.len,H=this.getMaxBufferLength(T.maxBitrate);if(x>=H)return;if(this._streamEnded(_,N)){var X={};this.altAudio&&(X.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,X),this.state=P.State.ENDED;return}var ee=_.end,J=this.getNextFragment(ee,N);if(this.couldBacktrack&&!this.fragPrevious&&J&&J.sn!=="initSegment"){var ce=J.sn-N.startSN;ce>1&&(J=N.fragments[ce-1],this.fragmentTracker.removeFragment(J))}if(J&&this.fragmentTracker.getState(J)===n.FragmentState.OK&&this.nextLoadPosition>ee){var me=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,me,I.PlaylistLevelType.MAIN),J=this.getNextFragment(this.nextLoadPosition,N)}if(!J)return;J.initSegment&&!J.initSegment.data&&!this.bitrateTest&&(J=J.initSegment),((v=J.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((h=J.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(J,N):this.loadFragment(J,N,ee)},O.loadFragment=function(v,h,d){var C,E=this.fragmentTracker.getState(v);if(this.fragCurrent=v,E===n.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(v);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,v,h,d)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(v){var h=this.fragmentTracker.getAppendedFrag(v,I.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},O.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,I.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var v=this.levels,h=this.media;if(h!=null&&h.readyState){var d,C=this.getAppendedFrag(h.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!h.paused&&v){var E=this.hls.nextLoadLevel,w=v[E],j=this.fragLastKbps;j&&this.fragCurrent?d=this.fragCurrent.duration*w.maxBitrate/(1e3*j)+1:d=0}else d=0;var W=this.getBufferedFrag(h.currentTime+d);if(W){var T=this.followingBufferedFrag(W);if(T){this.abortCurrentFrag();var N=T.maxStartPTS?T.maxStartPTS:T.start,_=T.duration,x=Math.max(W.end,N+Math.min(Math.max(_-this.config.maxFragLookUpTolerance,_*.5),_*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===P.State.KEY_LOADING&&(this.state=P.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(v,h){S.prototype.flushMainBuffer.call(this,v,h,this.altAudio?"video":null)},O.onMediaAttached=function(v,h){S.prototype.onMediaAttached.call(this,v,h);var d=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new c.default(this.config,d,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var v=this.media,h=v?v.currentTime:null;Object(z.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(v,h){var d=!1,C=!1,E;h.levels.forEach(function(w){E=w.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(d=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=d&&C&&!Object(F.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},O.onLevelLoading=function(v,h){var d=this.levels;if(!d||this.state!==P.State.IDLE)return;var C=d[h.level];(!C.details||C.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(C.details))&&(this.state=P.State.WAITING_LEVEL)},O.onLevelLoaded=function(v,h){var d,C=this.levels,E=h.level,w=h.details,j=w.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+j);var W=this.fragCurrent;W&&(this.state===P.State.FRAG_LOADING||this.state===P.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==h.level&&W.loader&&(this.state=P.State.IDLE,W.loader.abort()));var T=C[E],N=0;if(w.live||(d=T.details)!==null&&d!==void 0&&d.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;N=this.alignPlaylists(w,T.details)}if(T.details=w,this.levelLastLoaded=E,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:w,level:E}),this.state===P.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=P.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,N),this.tick()},O._handleFragmentLoadProgress=function(v){var h,d=v.frag,C=v.part,E=v.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var j=w[d.level],W=j.details;if(!W){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var T=j.videoCodec,N=W.PTSKnown||!W.live,_=(h=d.initSegment)===null||h===void 0?void 0:h.data,x=this._getAudioCodec(j),H=this.transmuxer=this.transmuxer||new f.default(this.hls,I.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),X=C?C.index:-1,ee=X!==-1,J=new y.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,E.byteLength,X,ee),ce=this.initPTS[d.cc];H.push(E,_,x,T,d,C,W.totalduration,N,J,ce)},O.onAudioTrackSwitching=function(v,h){var d=this.altAudio,C=!!h.url,E=h.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w!=null&&w.loader&&(this.log("Switching to main audio track, cancel main fragment load"),w.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var j=this.hls;d&&j.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),j.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:E})}},O.onAudioTrackSwitched=function(v,h){var d=h.id,C=!!this.hls.audioTracks[d].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},O.onBufferCreated=function(v,h){var d=h.tracks,C,E,w=!1;for(var j in d){var W=d[j];if(W.id==="main"){if(E=j,C=W,j==="video"){var T=d[j];T&&(this.videoBuffer=T.buffer)}}else w=!0}w&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(v,h){var d=h.frag,C=h.part;if(d&&d.type!==I.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(C?" p: "+C.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===P.State.PARSED&&(this.state=P.State.IDLE);return}var E=C?C.stats:d.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,C)},O.onError=function(v,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!==P.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=P.State.ERROR):!h.levelRetry&&this.state===P.State.WAITING_LEVEL&&(this.state=P.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===P.State.PARSING||this.state===P.State.PARSED)){var d=!0,C=this.getFwdBufferInfo(this.media,I.PlaylistLevelType.MAIN);C&&C.len>.5&&(d=!this.reduceMaxBufferLength(C.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var v=this.media,h=this.gapController;if(!v||!h||!v.readyState)return;var d=K.BufferHelper.getBuffered(v);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=P.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(v,h){var d=h.type;if(d!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(d===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,d,I.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(v,h){this.levels=h.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var v=this.media,h=v.currentTime,d=this.startPosition;if(d>=0&&h<d){if(v.seeking){p.logger.log("could not seek to "+d+", already seeking at "+h);return}var C=K.BufferHelper.getBuffered(v),E=C.length?C.start(0):0,w=E-d;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(p.logger.log("adjusting start position by "+w+" to match buffer start"),d+=w,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+h),v.currentTime=d}},O._getAudioCodec=function(v){var h=this.config.defaultAudioCodec||v.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},O._loadBitrateTestFrag=function(v){var h=this;this._doFragLoad(v).then(function(d){var C=h.hls;if(!d||C.nextLoadLevel||h.fragContextChanged(v))return;h.fragLoadError=0,h.state=P.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var E=v.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger(G.Events.FRAG_LOADED,d)})},O._handleTransmuxComplete=function(v){var h,d="main",C=this.hls,E=v.remuxResult,w=v.chunkMeta,j=this.getCurrentContext(w);if(!j){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(w.level);return}var W=j.frag,T=j.part,N=j.level,_=E.video,x=E.text,H=E.id3,X=E.initSegment,ee=this.altAudio?void 0:E.audio;if(this.fragContextChanged(W))return;if(this.state=P.State.PARSING,X){X.tracks&&(this._bufferInitSegment(N,X.tracks,W,w),C.trigger(G.Events.FRAG_PARSING_INIT_SEGMENT,{frag:W,id:d,tracks:X.tracks}));var J=X.initPTS,ce=X.timescale;Object(z.isFiniteNumber)(J)&&(this.initPTS[W.cc]=J,C.trigger(G.Events.INIT_PTS_FOUND,{frag:W,id:d,initPTS:J,timescale:ce}))}if(_&&E.independent!==!1){if(N.details){var me=_.startPTS,ue=_.endPTS,pe=_.startDTS,xe=_.endDTS;if(T)T.elementaryStreams[_.type]={startPTS:me,endPTS:ue,startDTS:pe,endDTS:xe};else if(_.firstKeyFrame&&_.independent&&(this.couldBacktrack=!0),_.dropped&&_.independent){var se=this.getLoadPosition()+this.config.maxBufferHole;if(se<me){this.backtrack(W);return}W.setElementaryStreamInfo(_.type,W.start,ue,W.start,xe,!0)}W.setElementaryStreamInfo(_.type,me,ue,pe,xe),this.bufferFragmentData(_,W,T,w)}}else if(E.independent===!1){this.backtrack(W);return}if(ee){var ae=ee.startPTS,Ce=ee.endPTS,ze=ee.startDTS,Ye=ee.endDTS;T&&(T.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:Ce,startDTS:ze,endDTS:Ye}),W.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,ae,Ce,ze,Ye),this.bufferFragmentData(ee,W,T,w)}if(H!=null&&(h=H.samples)!==null&&h!==void 0&&h.length){var He={frag:W,id:d,samples:H.samples};C.trigger(G.Events.FRAG_PARSING_METADATA,He)}if(x){var Ve={frag:W,id:d,samples:x.samples};C.trigger(G.Events.FRAG_PARSING_USERDATA,Ve)}},O._bufferInitSegment=function(v,h,d,C){var E=this;if(this.state!==P.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var w=h.audio,j=h.video,W=h.audiovideo;if(w){var T=v.audioCodec,N=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(T&&(T.indexOf("mp4a.40.5")!==-1?T="mp4a.40.2":T="mp4a.40.5"),w.metadata.channelCount!==1&&N.indexOf("firefox")===-1&&(T="mp4a.40.5")),N.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(T="mp4a.40.2",this.log("Android: force audio codec to "+T)),v.audioCodec&&v.audioCodec!==T&&this.log('Swapping manifest audio codec "'+v.audioCodec+'" for "'+T+'"'),w.levelCodec=T,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(T||"")+"/"+(v.audioCodec||"")+"/"+w.codec+"]")}j&&(j.levelCodec=v.videoCodec,j.id="main",this.log("Init video buffer, container:"+j.container+", codecs[level/parsed]=["+(v.videoCodec||"")+"/"+j.codec+"]")),W&&this.log("Init audiovideo buffer, container:"+W.container+", codecs[level/parsed]=["+(v.attrs.CODECS||"")+"/"+W.codec+"]"),this.hls.trigger(G.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(_){var x=h[_],H=x.initSegment;H!=null&&H.byteLength&&E.hls.trigger(G.Events.BUFFER_APPENDING,{type:_,data:H,frag:d,part:null,chunkMeta:C,parent:d.type})}),this.tick()},O.backtrack=function(v){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(v);var h=this.fragmentTracker.backtrack(v);this.fragPrevious=null,this.nextLoadPosition=v.start,h?this.resetFragmentLoading(v):this.state=P.State.BACKTRACKING},O.checkFragmentChanged=function(){var v=this.media,h=null;if(v&&v.readyState>1&&v.seeking===!1){var d=v.currentTime;if(K.BufferHelper.isBuffered(v,d)?h=this.getAppendedFrag(d):K.BufferHelper.isBuffered(v,d+.1)&&(h=this.getAppendedFrag(d+.1)),h){var C=this.fragPlaying,E=h.level;(!C||h.sn!==C.sn||C.level!==E||h.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:h}),(!C||C.level!==E)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=h)}}},u(R,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var h=this.getAppendedFrag(v.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var h=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(P.default)},"./src/controller/subtitle-stream-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"SubtitleStreamController",function(){return s});var z=M("./src/events.ts"),P=M("./src/utils/logger.ts"),F=M("./src/utils/buffer-helper.ts"),G=M("./src/controller/fragment-finders.ts"),K=M("./src/utils/discontinuities.ts"),n=M("./src/controller/level-helper.ts"),I=M("./src/controller/fragment-tracker.ts"),b=M("./src/controller/base-stream-controller.ts"),f=M("./src/types/loader.ts"),y=M("./src/types/level.ts");function c(i,D){for(var A=0;A<D.length;A++){var S=D[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(i,S.key,S)}}function a(i,D,A){return D&&c(i.prototype,D),A&&c(i,A),i}function p(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,l(i,D)}function l(i,D){return l=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},l(i,D)}var u=500,s=function(i){p(D,i);function D(S,R){var O;return O=i.call(this,S,R,"[subtitle-stream-controller]")||this,O.levels=[],O.currentTrackId=-1,O.tracksBuffered=[],O.mainDetails=null,O._registerListeners(),O}var A=D.prototype;return A.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},A._registerListeners=function(){var R=this.hls;R.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(z.Events.ERROR,this.onError,this),R.on(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var R=this.hls;R.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(z.Events.ERROR,this.onError,this),R.off(z.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(z.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(z.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(z.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.startLoad=function(){this.stopLoad(),this.state=b.State.IDLE,this.setInterval(u),this.tick()},A.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},A.onLevelLoaded=function(R,O){this.mainDetails=O.details},A.onSubtitleFragProcessed=function(R,O){var m=O.frag,v=O.success;if(this.fragPrevious=m,this.state=b.State.IDLE,!v)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var d,C=m.start,E=0;E<h.length;E++)if(C>=h[E].start&&C<=h[E].end){d=h[E];break}var w=m.start+m.duration;d?d.end=w:(d={start:C,end:w},h.push(d)),this.fragmentTracker.fragBuffered(m)},A.onBufferFlushing=function(R,O){var m=O.startOffset,v=O.endOffset;if(m===0&&v!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,d=this.levels;if(!d.length||!d[h]||!d[h].details)return;var C=d[h].details,E=C.targetduration,w=v-E;if(w<=0)return;O.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(j){for(var W=0;W<j.length;){if(j[W].end<=w){j.shift();continue}else if(j[W].start<w)j[W].start=w;else break;W++}}),this.fragmentTracker.removeFragmentsInRange(m,w,f.PlaylistLevelType.SUBTITLE)}},A.onError=function(R,O){var m,v=O.frag;if(!v||v.type!==f.PlaylistLevelType.SUBTITLE)return;(m=this.fragCurrent)!==null&&m!==void 0&&m.loader&&this.fragCurrent.loader.abort(),this.state=b.State.IDLE},A.onSubtitleTracksUpdated=function(R,O){var m=this,v=O.subtitleTracks;this.tracksBuffered=[],this.levels=v.map(function(h){return new y.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){m.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},A.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var m=this.levels[this.currentTrackId];m!=null&&m.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,m&&this.setInterval(u)},A.onSubtitleTrackLoaded=function(R,O){var m,v=O.details,h=O.id,d=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[d];if(h>=C.length||h!==d||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(m=E.details)!==null&&m!==void 0&&m.live){var w=this.mainDetails;if(v.deltaUpdateFailed||!w)return;var j=w.fragments[0];if(!E.details)v.hasProgramDateTime&&w.hasProgramDateTime?Object(K.alignMediaPlaylistByPDT)(v,w):j&&Object(n.addSliding)(v,j.start);else{var W=this.alignPlaylists(v,E.details);W===0&&j&&Object(n.addSliding)(v,j.start)}}if(E.details=v,this.levelLastLoaded=h,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var T=Object(G.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);T||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},A._handleFragmentLoadComplete=function(R){var O=R.frag,m=R.payload,v=O.decryptdata,h=this.hls;if(this.fragContextChanged(O))return;if(m&&m.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),v.key.buffer,v.iv.buffer).then(function(C){var E=performance.now();h.trigger(z.Events.FRAG_DECRYPTED,{frag:O,payload:C,stats:{tstart:d,tdecrypt:E}})})}},A.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var R,O=this.currentTrackId,m=this.levels;if(!m.length||!m[O]||!m[O].details)return;var v=m[O].details,h=v.targetduration,d=this.config,C=this.media,E=F.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-h,d.maxBufferHole),w=E.end,j=E.len,W=this.getMaxBufferLength()+h;if(j>W)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var T=v.fragments,N=T.length,_=v.edge,x,H=this.fragPrevious;if(w<_){var X=d.maxFragLookUpTolerance;H&&v.hasProgramDateTime&&(x=Object(G.findFragmentByPDT)(T,H.endProgramDateTime,X)),x||(x=Object(G.findFragmentByPTS)(H,T,w,X),!x&&H&&H.start<T[0].start&&(x=T[0]))}else x=T[N-1];(R=x)!==null&&R!==void 0&&R.encrypted?(P.logger.log("Loading key for "+x.sn),this.state=b.State.KEY_LOADING,this.hls.trigger(z.Events.KEY_LOADING,{frag:x})):x&&this.fragmentTracker.getState(x)===I.FragmentState.NOT_LOADED&&this.loadFragment(x,v,w)}},A.loadFragment=function(R,O,m){this.fragCurrent=R,i.prototype.loadFragment.call(this,R,O,m)},a(D,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),D}(b.default)},"./src/controller/subtitle-track-controller.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/events.ts"),P=M("./src/utils/texttrack-utils.ts"),F=M("./src/controller/base-playlist-controller.ts"),G=M("./src/types/loader.ts");function K(c,a){for(var p=0;p<a.length;p++){var l=a[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(c,l.key,l)}}function n(c,a,p){return a&&K(c.prototype,a),p&&K(c,p),c}function I(c,a){c.prototype=Object.create(a.prototype),c.prototype.constructor=c,b(c,a)}function b(c,a){return b=Object.setPrototypeOf||function(l,u){return l.__proto__=u,l},b(c,a)}var f=function(c){I(a,c);function a(l){var u;return u=c.call(this,l,"[subtitle-track-controller]")||this,u.media=null,u.tracks=[],u.groupId=null,u.tracksInGroup=[],u.trackId=-1,u.selectDefaultTrack=!0,u.queuedDefaultTrack=-1,u.trackChangeListener=function(){return u.onTextTracksChanged()},u.asyncPollTrackChange=function(){return u.pollTrackChange(0)},u.useTextTrackPolling=!1,u.subtitlePollingInterval=-1,u.subtitleDisplay=!0,u.registerListeners(),u}var p=a.prototype;return p.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,c.prototype.destroy.call(this)},p.registerListeners=function(){var u=this.hls;u.on(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.on(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.on(z.Events.ERROR,this.onError,this)},p.unregisterListeners=function(){var u=this.hls;u.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(z.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(z.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),u.off(z.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),u.off(z.Events.ERROR,this.onError,this)},p.onMediaAttached=function(u,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)},p.pollTrackChange=function(u){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,u)},p.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var u=y(this.media.textTracks);u.forEach(function(s){Object(P.clearCurrentCues)(s)}),this.subtitleTrack=-1,this.media=null},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(u,s){this.tracks=s.subtitleTracks},p.onSubtitleTrackLoaded=function(u,s){var i=s.id,D=s.details,A=this.trackId,S=this.tracksInGroup[A];if(!S){this.warn("Invalid subtitle track id "+i);return}var R=S.details;S.details=s.details,this.log("subtitle track "+i+" loaded ["+D.startSN+"-"+D.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,s,R))},p.onLevelLoading=function(u,s){this.switchLevel(s.level)},p.onLevelSwitching=function(u,s){this.switchLevel(s.level)},p.switchLevel=function(u){var s=this.hls.levels[u];if(!(s!=null&&s.textGroupIds))return;var i=s.textGroupIds[s.urlId];if(this.groupId!==i){var D=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,A=this.tracks.filter(function(O){return!i||O.groupId===i});this.tracksInGroup=A;var S=this.findTrackId(D==null?void 0:D.name)||this.findTrackId();this.groupId=i;var R={subtitleTracks:A};this.log("Updating subtitle tracks, "+A.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(z.Events.SUBTITLE_TRACKS_UPDATED,R),S!==-1&&this.setSubtitleTrack(S,D)}},p.findTrackId=function(u){for(var s=this.tracksInGroup,i=0;i<s.length;i++){var D=s[i];if((!this.selectDefaultTrack||D.default)&&(!u||u===D.name))return D.id}return-1},p.onError=function(u,s){if(c.prototype.onError.call(this,u,s),s.fatal||!s.context)return;s.context.type===G.PlaylistContextType.SUBTITLE_TRACK&&s.context.id===this.trackId&&s.context.groupId===this.groupId&&this.retryLoadingOrFail(s)},p.loadPlaylist=function(u){var s=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(s)){var i=s.id,D=s.groupId,A=s.url;if(u)try{A=u.addDirectives(A)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(z.Events.SUBTITLE_TRACK_LOADING,{url:A,id:i,groupId:D,deliveryDirectives:u||null})}},p.toggleTrackModes=function(u){var s=this,i=this.media,D=this.subtitleDisplay,A=this.trackId;if(!i)return;var S=y(i.textTracks),R=S.filter(function(v){return v.groupId===s.groupId});if(u===-1)[].slice.call(S).forEach(function(v){v.mode="disabled"});else{var O=R[A];O&&(O.mode="disabled")}var m=R[u];m&&(m.mode=D?"showing":"hidden")},p.setSubtitleTrack=function(u,s){var i,D=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=u;return}if(this.trackId!==u&&this.toggleTrackModes(u),this.trackId===u&&(u===-1||(i=D[u])!==null&&i!==void 0&&i.details)||u<-1||u>=D.length)return;this.clearTimer();var A=D[u];if(this.log("Switching to subtitle track "+u),this.trackId=u,A){var S=A.id,R=A.groupId,O=R===void 0?"":R,m=A.name,v=A.type,h=A.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:m,type:v,url:h});var d=this.switchParams(A.url,s==null?void 0:s.details);this.loadPlaylist(d)}else this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:u})},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var u=-1,s=y(this.media.textTracks),i=0;i<s.length;i++)if(s[i].mode==="hidden")u=i;else if(s[i].mode==="showing"){u=i;break}this.subtitleTrack!==u&&(this.subtitleTrack=u)},n(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(u){this.selectDefaultTrack=!1;var s=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(u,s)}}]),a}(F.default);function y(c){for(var a=[],p=0;p<c.length;p++){var l=c[p];l.kind==="subtitles"&&l.label&&a.push(c[p])}return a}Y.default=f},"./src/controller/timeline-controller.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"TimelineController",function(){return y});var z=M("./src/polyfills/number.ts"),P=M("./src/events.ts"),F=M("./src/utils/cea-608-parser.ts"),G=M("./src/utils/output-filter.ts"),K=M("./src/utils/webvtt-parser.ts"),n=M("./src/utils/texttrack-utils.ts"),I=M("./src/utils/imsc1-ttml-parser.ts"),b=M("./src/types/loader.ts"),f=M("./src/utils/logger.ts"),y=function(){function l(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=p(),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 i=new G.default(this,"textTrack1"),D=new G.default(this,"textTrack2"),A=new G.default(this,"textTrack3"),S=new G.default(this,"textTrack4");this.cea608Parser1=new F.default(1,i,D),this.cea608Parser2=new F.default(3,A,S)}s.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),s.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),s.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),s.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),s.on(P.Events.FRAG_LOADING,this.onFragLoading,this),s.on(P.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),s.on(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),s.on(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),s.on(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),s.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=l.prototype;return u.destroy=function(){var i=this.hls;i.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.off(P.Events.FRAG_LOADING,this.onFragLoading,this),i.off(P.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(P.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.off(P.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.off(P.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.off(P.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(i,D,A,S,R){for(var O=!1,m=R.length;m--;){var v=R[m],h=a(v[0],v[1],D,A);if(h>=0&&(v[0]=Math.min(v[0],D),v[1]=Math.max(v[1],A),O=!0,h/(A-D)>.5))return}if(O||R.push([D,A]),this.config.renderTextTracksNatively){var d=this.captionsTracks[i];this.Cues.newCue(d,D,A,S)}else{var C=this.Cues.newCue(null,D,A,S);this.hls.trigger(P.Events.CUES_PARSED,{type:"captions",cues:C,track:i})}},u.onInitPtsFound=function(i,D){var A=this,S=D.frag,R=D.id,O=D.initPTS,m=D.timescale,v=this.unparsedVttFrags;R==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=m),v.length&&(this.unparsedVttFrags=[],v.forEach(function(h){A.onFragLoaded(P.Events.FRAG_LOADED,h)}))},u.getExistingTrack=function(i){var D=this.media;if(D)for(var A=0;A<D.textTracks.length;A++){var S=D.textTracks[A];if(S[i])return S}return null},u.createCaptionsTrack=function(i){this.config.renderTextTracksNatively?this.createNativeTrack(i):this.createNonNativeTrack(i)},u.createNativeTrack=function(i){if(this.captionsTracks[i])return;var D=this.captionsProperties,A=this.captionsTracks,S=this.media,R=D[i],O=R.label,m=R.languageCode,v=this.getExistingTrack(i);if(v)A[i]=v,Object(n.clearCurrentCues)(A[i]),Object(n.sendAddTrackEvent)(A[i],S);else{var h=this.createTextTrack("captions",O,m);h&&(h[i]=!0,A[i]=h)}},u.createNonNativeTrack=function(i){if(this.nonNativeCaptionsTracks[i])return;var D=this.captionsProperties[i];if(!D)return;var A=D.label,S={_id:i,label:A,kind:"captions",default:D.media?!!D.media.default:!1,closedCaptions:D.media};this.nonNativeCaptionsTracks[i]=S,this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},u.createTextTrack=function(i,D,A){var S=this.media;return S?S.addTextTrack(i,D,A):void 0},u.onMediaAttaching=function(i,D){this.media=D.media,this._cleanTracks()},u.onMediaDetaching=function(){var i=this.captionsTracks;Object.keys(i).forEach(function(D){Object(n.clearCurrentCues)(i[D]),delete i[D]}),this.nonNativeCaptionsTracks={}},u.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=p(),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())},u._cleanTracks=function(){var i=this.media;if(!i)return;var D=i.textTracks;if(D)for(var A=0;A<D.length;A++)Object(n.clearCurrentCues)(D[A])},u.onSubtitleTracksUpdated=function(i,D){var A=this;this.textTracks=[];var S=D.subtitleTracks||[],R=S.some(function(h){return h.textCodec===I.IMSC1_CODEC});if(this.config.enableWebVTT||R&&this.config.enableIMSC1){var O=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var m=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,d){var C;if(d<m.length){for(var E=null,w=0;w<m.length;w++)if(c(m[w],h)){E=m[w];break}E&&(C=E)}C?Object(n.clearCurrentCues)(C):(C=A.createTextTrack("subtitles",h.name,h.lang),C&&(C.mode="disabled")),C&&(C.groupId=h.groupId,A.textTracks.push(C))})}else if(!O&&this.tracks&&this.tracks.length){var v=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(P.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:v})}}},u.onManifestLoaded=function(i,D){var A=this;this.config.enableCEA708Captions&&D.captions&&D.captions.forEach(function(S){var R=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!R)return;var O="textTrack"+R[1],m=A.captionsProperties[O];if(!m)return;m.label=S.name,S.lang&&(m.languageCode=S.lang),m.media=S})},u.onFragLoading=function(i,D){var A=this.cea608Parser1,S=this.cea608Parser2,R=this.lastSn,O=this.lastPartIndex;if(!this.enabled||!(A&&S))return;if(D.frag.type===b.PlaylistLevelType.MAIN){var m,v,h=D.frag.sn,d=(m=D==null||((v=D.part)===null||v===void 0)?void 0:v.index)!=null?m:-1;h===R+1||h===R&&d===O+1||(A.reset(),S.reset()),this.lastSn=h,this.lastPartIndex=d}},u.onFragLoaded=function(i,D){var A=D.frag,S=D.payload,R=this.initPTS,O=this.unparsedVttFrags;if(A.type===b.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(z.isFiniteNumber)(R[A.cc])){O.push(D),R.length&&this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Missing initial subtitle PTS")});return}var m=A.decryptdata;if(m==null||m.key==null||m.method!=="AES-128"){var v=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),v&&v.textCodec===I.IMSC1_CODEC?this._parseIMSC1(A,S):this._parseVTTs(A,S,h)}}else this.hls.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:A,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(i,D){var A=this,S=this.hls;Object(I.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(R){A._appendCues(R,i.level),S.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(R){f.logger.log("Failed to parse IMSC1: "+R),S.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:R})})},u._parseVTTs=function(i,D,A){var S=this,R=this.hls;Object(K.parseWebVTT)(D,this.initPTS[i.cc],this.timescale[i.cc],A,i.cc,i.start,function(O){S._appendCues(O,i.level),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},function(O){S._fallbackToIMSC1(i,D),f.logger.log("Failed to parse VTT cue: "+O),R.trigger(P.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:O})})},u._fallbackToIMSC1=function(i,D){var A=this,S=this.tracks[i.level];S.textCodec||Object(I.parseIMSC1)(D,this.initPTS[i.cc],this.timescale[i.cc],function(){S.textCodec=I.IMSC1_CODEC,A._parseIMSC1(i,D)},function(){S.textCodec="wvtt"})},u._appendCues=function(i,D){var A=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[D];if(S.mode==="disabled")return;i.forEach(function(m){return Object(n.addCueToTrack)(S,m)})}else{var R=this.tracks[D],O=R.default?"default":"subtitles"+D;A.trigger(P.Events.CUES_PARSED,{type:"subtitles",cues:i,track:O})}},u.onFragDecrypted=function(i,D){var A=D.frag;if(A.type===b.PlaylistLevelType.SUBTITLE){if(!Object(z.isFiniteNumber)(this.initPTS[A.cc])){this.unparsedVttFrags.push(D);return}this.onFragLoaded(P.Events.FRAG_LOADED,D)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(i,D){var A=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(A&&S))return;for(var R=0;R<D.samples.length;R++){var O=D.samples[R].bytes;if(O){var m=this.extractCea608Data(O);A.addData(D.samples[R].pts,m[0]),S.addData(D.samples[R].pts,m[1])}}},u.onBufferFlushing=function(i,D){var A=D.startOffset,S=D.endOffset,R=D.endOffsetSubtitles,O=D.type,m=this.media;if(!m||m.currentTime<S)return;if(!O||O==="video"){var v=this.captionsTracks;Object.keys(v).forEach(function(d){return Object(n.removeCuesInRange)(v[d],A,S)})}if(this.config.renderTextTracksNatively&&(A===0&&R!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(d){return Object(n.removeCuesInRange)(h[d],A,R)})}},u.extractCea608Data=function(i){for(var D=i[0]&31,A=2,S=[[],[]],R=0;R<D;R++){var O=i[A++],m=127&i[A++],v=127&i[A++],h=(4&O)!==0,d=3&O;if(m===0&&v===0)continue;h&&((d===0||d===1)&&(S[d].push(m),S[d].push(v)))}return S},l}();function c(l,u){return l&&l.label===u.name&&!(l.textTrack1||l.textTrack2)}function a(l,u,s,i){return Math.min(u,i)-Math.max(l,s)}function p(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return z});var z=function(){function P(G,K){this.subtle=void 0,this.aesIV=void 0,this.subtle=G,this.aesIV=K}var F=P.prototype;return F.decrypt=function(K,n){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},n,K)},P}()},"./src/crypt/aes-decryptor.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"removePadding",function(){return P}),M.d(Y,"default",function(){return F});var z=M("./src/utils/typed-array.ts");function P(G){var K=G.byteLength,n=K&&new DataView(G.buffer).getUint8(K-1);return n?Object(z.sliceUint8)(G,0,K-n):G}var F=function(){function G(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var K=G.prototype;return K.uint8ArrayToUint32Array_=function(I){for(var b=new DataView(I),f=new Uint32Array(4),y=0;y<4;y++)f[y]=b.getUint32(y*4);return f},K.initTable=function(){var I=this.sBox,b=this.invSBox,f=this.subMix,y=f[0],c=f[1],a=f[2],p=f[3],l=this.invSubMix,u=l[0],s=l[1],i=l[2],D=l[3],A=new Uint32Array(256),S=0,R=0,O=0;for(O=0;O<256;O++)O<128?A[O]=O<<1:A[O]=O<<1^283;for(O=0;O<256;O++){var m=R^R<<1^R<<2^R<<3^R<<4;m=m>>>8^m&255^99,I[S]=m,b[m]=S;var v=A[S],h=A[v],d=A[h],C=A[m]*257^m*16843008;y[S]=C<<24|C>>>8,c[S]=C<<16|C>>>16,a[S]=C<<8|C>>>24,p[S]=C,C=d*16843009^h*65537^v*257^S*16843008,u[m]=C<<24|C>>>8,s[m]=C<<16|C>>>16,i[m]=C<<8|C>>>24,D[m]=C,S?(S=v^A[A[A[d^v]]],R^=A[A[R]]):S=R=1}},K.expandKey=function(I){for(var b=this.uint8ArrayToUint32Array_(I),f=!0,y=0;y<b.length&&f;)f=b[y]===this.key[y],y++;if(f)return;this.key=b;var c=this.keySize=b.length;if(c!==4&&c!==6&&c!==8)throw new Error("Invalid aes key size="+c);var a=this.ksRows=(c+6+1)*4,p,l,u=this.keySchedule=new Uint32Array(a),s=this.invKeySchedule=new Uint32Array(a),i=this.sBox,D=this.rcon,A=this.invSubMix,S=A[0],R=A[1],O=A[2],m=A[3],v,h;for(p=0;p<a;p++){if(p<c){v=u[p]=b[p];continue}h=v,p%c===0?(h=h<<8|h>>>24,h=i[h>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[h&255],h^=D[p/c|0]<<24):c>6&&p%c===4&&(h=i[h>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[h&255]),u[p]=v=(u[p-c]^h)>>>0}for(l=0;l<a;l++)p=a-l,l&3?h=u[p]:h=u[p-4],l<4||p<=4?s[l]=h:s[l]=S[i[h>>>24]]^R[i[h>>>16&255]]^O[i[h>>>8&255]]^m[i[h&255]],s[l]=s[l]>>>0},K.networkToHostOrderSwap=function(I){return I<<24|(I&65280)<<8|(I&16711680)>>8|I>>>24},K.decrypt=function(I,b,f){for(var y=this.keySize+6,c=this.invKeySchedule,a=this.invSBox,p=this.invSubMix,l=p[0],u=p[1],s=p[2],i=p[3],D=this.uint8ArrayToUint32Array_(f),A=D[0],S=D[1],R=D[2],O=D[3],m=new Int32Array(I),v=new Int32Array(m.length),h,d,C,E,w,j,W,T,N,_,x,H,X,ee,J=this.networkToHostOrderSwap;b<m.length;){for(N=J(m[b]),_=J(m[b+1]),x=J(m[b+2]),H=J(m[b+3]),w=N^c[0],j=H^c[1],W=x^c[2],T=_^c[3],X=4,ee=1;ee<y;ee++)h=l[w>>>24]^u[j>>16&255]^s[W>>8&255]^i[T&255]^c[X],d=l[j>>>24]^u[W>>16&255]^s[T>>8&255]^i[w&255]^c[X+1],C=l[W>>>24]^u[T>>16&255]^s[w>>8&255]^i[j&255]^c[X+2],E=l[T>>>24]^u[w>>16&255]^s[j>>8&255]^i[W&255]^c[X+3],w=h,j=d,W=C,T=E,X=X+4;h=a[w>>>24]<<24^a[j>>16&255]<<16^a[W>>8&255]<<8^a[T&255]^c[X],d=a[j>>>24]<<24^a[W>>16&255]<<16^a[T>>8&255]<<8^a[w&255]^c[X+1],C=a[W>>>24]<<24^a[T>>16&255]<<16^a[w>>8&255]<<8^a[j&255]^c[X+2],E=a[T>>>24]<<24^a[w>>16&255]<<16^a[j>>8&255]<<8^a[W&255]^c[X+3],v[b]=J(h^A),v[b+1]=J(E^S),v[b+2]=J(C^R),v[b+3]=J(d^O),A=N,S=_,R=x,O=H,b=b+4}return v.buffer},G}()},"./src/crypt/decrypter.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return b});var z=M("./src/crypt/aes-crypto.ts"),P=M("./src/crypt/fast-aes-key.ts"),F=M("./src/crypt/aes-decryptor.ts"),G=M("./src/utils/logger.ts"),K=M("./src/utils/mp4-tools.ts"),n=M("./src/utils/typed-array.ts"),I=16,b=function(){function f(c,a,p){var l=p===void 0?{}:p,u=l.removePKCS7Padding,s=u===void 0?!0:u;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 i=self.crypto;i&&(this.subtle=i.subtle||i.webkitSubtle)}catch(D){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var y=f.prototype;return y.destroy=function(){this.observer=null},y.isSync=function(){return this.config.enableSoftwareAES},y.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var p=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(F.removePadding)(p):p},y.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},y.decrypt=function(a,p,l,u){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),p,l);var s=this.flush();s&&u(s.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),p,l).then(u)},y.softwareDecrypt=function(a,p,l){var u=this.currentIV,s=this.currentResult,i=this.remainderData;this.logOnce("JS AES decrypt"),i&&(a=Object(K.appendUint8Array)(i,a),this.remainderData=null);var D=this.getValidChunk(a);if(!D.length)return null;u&&(l=u);var A=this.softwareDecrypter;A||(A=this.softwareDecrypter=new F.default),A.expandKey(p);var S=s;return this.currentResult=A.decrypt(D.buffer,0,l),this.currentIV=Object(n.sliceUint8)(D,-16).buffer,S||null},y.webCryptoDecrypt=function(a,p,l){var u=this,s=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new P.default(s,p)),this.fastAesKey.expandKey().then(function(i){if(!s)return Promise.reject(new Error("web crypto not initialized"));var D=new z.default(s,l);return D.decrypt(a.buffer,i)}).catch(function(i){return u.onWebCryptoError(i,a,p,l)})},y.onWebCryptoError=function(a,p,l,u){return G.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(p,l,u)},y.getValidChunk=function(a){var p=a,l=a.length-a.length%I;return l!==a.length&&(p=Object(n.sliceUint8)(a,0,l),this.remainderData=Object(n.sliceUint8)(a,l)),p},y.logOnce=function(a){if(!this.logEnabled)return;G.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return z});var z=function(){function P(G,K){this.subtle=void 0,this.key=void 0,this.subtle=G,this.key=K}var F=P.prototype;return F.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},P}()},"./src/demux/aacdemuxer.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/demux/base-audio-demuxer.ts"),P=M("./src/demux/adts.ts"),F=M("./src/utils/logger.ts"),G=M("./src/demux/id3.ts");function K(b,f){b.prototype=Object.create(f.prototype),b.prototype.constructor=b,n(b,f)}function n(b,f){return n=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},n(b,f)}var I=function(b){K(f,b);function f(c,a){var p;return p=b.call(this)||this,p.observer=void 0,p.config=void 0,p.observer=c,p.config=a,p}var y=f.prototype;return y.resetInitSegment=function(a,p,l){b.prototype.resetInitSegment.call(this,a,p,l),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var p=G.getID3Data(a,0)||[],l=p.length,u=a.length;l<u;l++)if(P.probe(a,l))return F.logger.log("ADTS sync word found !"),!0;return!1},y.canParse=function(a,p){return P.canParse(a,p)},y.appendFrame=function(a,p,l){P.initTrackConfig(a,this.observer,p,l,a.manifestCodec);var u=P.appendFrame(a,p,l,this.initPTS,this.frameIndex);if(u&&u.missing===0)return u},f}(z.default);I.minProbeByteLength=9,Y.default=I},"./src/demux/adts.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"getAudioConfig",function(){return G}),M.d(Y,"isHeaderPattern",function(){return K}),M.d(Y,"getHeaderLength",function(){return n}),M.d(Y,"getFullFrameLength",function(){return I}),M.d(Y,"canGetFrameLength",function(){return b}),M.d(Y,"isHeader",function(){return f}),M.d(Y,"canParse",function(){return y}),M.d(Y,"probe",function(){return c}),M.d(Y,"initTrackConfig",function(){return a}),M.d(Y,"getFrameDuration",function(){return p}),M.d(Y,"parseFrameHeader",function(){return l}),M.d(Y,"appendFrame",function(){return u});var z=M("./src/utils/logger.ts"),P=M("./src/errors.ts"),F=M("./src/events.ts");function G(s,i,D,A){var S,R,O,m,v=navigator.userAgent.toLowerCase(),h=A,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((i[D+2]&192)>>>6)+1;var C=(i[D+2]&60)>>>2;if(C>d.length-1){s.trigger(F.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return O=(i[D+2]&1)<<2,O|=(i[D+3]&192)>>>6,z.logger.log("manifest codec:"+A+", ADTS type:"+S+", samplingIndex:"+C),/firefox/i.test(v)?C>=6?(S=5,m=new Array(4),R=C-3):(S=2,m=new Array(2),R=C):v.indexOf("android")!==-1?(S=2,m=new Array(2),R=C):(S=5,m=new Array(4),A&&(A.indexOf("mp4a.40.29")!==-1||A.indexOf("mp4a.40.5")!==-1)||!A&&C>=6?R=C-3:((A&&A.indexOf("mp4a.40.2")!==-1&&(C>=6&&O===1||/vivaldi/i.test(v))||!A&&O===1)&&(S=2,m=new Array(2)),R=C)),m[0]=S<<3,m[0]|=(C&14)>>1,m[1]|=(C&1)<<7,m[1]|=O<<3,S===5&&(m[1]|=(R&14)>>1,m[2]=(R&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:d[C],channelCount:O,codec:"mp4a.40."+S,manifestCodec:h}}function K(s,i){return s[i]===255&&(s[i+1]&246)===240}function n(s,i){return s[i+1]&1?7:9}function I(s,i){return(s[i+3]&3)<<11|s[i+4]<<3|(s[i+5]&224)>>>5}function b(s,i){return i+5<s.length}function f(s,i){return i+1<s.length&&K(s,i)}function y(s,i){return b(s,i)&&K(s,i)&&I(s,i)<=s.length-i}function c(s,i){if(f(s,i)){var D=n(s,i);if(i+D>=s.length)return!1;var A=I(s,i);if(A<=D)return!1;var S=i+A;return S===s.length||f(s,S)}return!1}function a(s,i,D,A,S){if(!s.samplerate){var R=G(i,D,A,S);if(!R)return;s.config=R.config,s.samplerate=R.samplerate,s.channelCount=R.channelCount,s.codec=R.codec,s.manifestCodec=R.manifestCodec,z.logger.log("parsed codec:"+s.codec+", rate:"+R.samplerate+", channels:"+R.channelCount)}}function p(s){return 1024*9e4/s}function l(s,i,D,A,S){var R=n(s,i),O=I(s,i);if(O-=R,O>0){var m=D+A*S;return{headerLength:R,frameLength:O,stamp:m}}}function u(s,i,D,A,S){var R=p(s.samplerate),O=l(i,D,A,S,R);if(O){var m=O.frameLength,v=O.headerLength,h=O.stamp,d=v+m,C=Math.max(0,D+d-i.length),E;C?(E=new Uint8Array(d-v),E.set(i.subarray(D+v,i.length),0)):E=i.subarray(D+v,D+d);var w={unit:E,pts:h};return C||s.samples.push(w),{sample:w,length:d,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"initPTSFn",function(){return I});var z=M("./src/polyfills/number.ts"),P=M("./src/demux/id3.ts"),F=M("./src/demux/dummy-demuxed-track.ts"),G=M("./src/utils/mp4-tools.ts"),K=M("./src/utils/typed-array.ts"),n=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=b.prototype;return f.resetInitSegment=function(c,a,p){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(c,a){return!1},f.appendFrame=function(c,a,p){},f.demux=function(c,a){this.cachedData&&(c=Object(G.appendUint8Array)(this.cachedData,c),this.cachedData=null);var p=P.getID3Data(c,0),l=p?p.length:0,u,s,i=this._audioTrack,D=this._id3Track,A=p?P.getTimeStamp(p):void 0,S=c.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=I(A,a)),p&&p.length>0&&D.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),s=this.initPTS;l<S;){if(this.canParse(c,l)){var R=this.appendFrame(i,c,l);R?(this.frameIndex++,s=R.sample.pts,l+=R.length,u=l):l=S}else P.canParse(c,l)?(p=P.getID3Data(c,l),D.samples.push({pts:s,dts:s,data:p}),l+=p.length,u=l):l++;if(l===S&&u!==S){var O=Object(K.sliceUint8)(c,u);this.cachedData?this.cachedData=Object(G.appendUint8Array)(this.cachedData,O):this.cachedData=O}}return{audioTrack:i,avcTrack:Object(F.dummyTrack)(),id3Track:D,textTrack:Object(F.dummyTrack)()}},f.demuxSampleAes=function(c,a,p){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(c){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(F.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(F.dummyTrack)()}},f.destroy=function(){},b}(),I=function(f,y){return Object(z.isFiniteNumber)(f)?f*90:y*9e4};Y.default=n},"./src/demux/chunk-cache.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return z});var z=function(){function F(){this.chunks=[],this.dataLength=0}var G=F.prototype;return G.push=function(n){this.chunks.push(n),this.dataLength+=n.length},G.flush=function(){var n=this.chunks,I=this.dataLength,b;if(n.length)n.length===1?b=n[0]:b=P(n,I);else return new Uint8Array(0);return this.reset(),b},G.reset=function(){this.chunks.length=0,this.dataLength=0},F}();function P(F,G){for(var K=new Uint8Array(G),n=0,I=0;I<F.length;I++){var b=F[I];K.set(b,n),n+=b.length}return K}},"./src/demux/dummy-demuxed-track.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"dummyTrack",function(){return z});function z(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/utils/logger.ts"),P=function(){function F(K){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=K,this.bytesAvailable=K.byteLength,this.word=0,this.bitsAvailable=0}var G=F.prototype;return G.loadWord=function(){var n=this.data,I=this.bytesAvailable,b=n.byteLength-I,f=new Uint8Array(4),y=Math.min(4,I);if(y===0)throw new Error("no bytes available");f.set(n.subarray(b,b+y)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=y*8,this.bytesAvailable-=y},G.skipBits=function(n){var I;this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,I=n>>3,n-=I>>3,this.bytesAvailable-=I,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var I=Math.min(this.bitsAvailable,n),b=this.word>>>32-I;return n>32&&z.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=n-I,I>0&&this.bitsAvailable?b<<I|this.readBits(I):b},G.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if((this.word&2147483648>>>n)!==0)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},G.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(n){for(var I=8,b=8,f,y=0;y<n;y++)b!==0&&(f=this.readEG(),b=(I+f+256)%256),I=b===0?I:b},G.readSPS=function(){var n=0,I=0,b=0,f=0,y,c,a,p=this.readUByte.bind(this),l=this.readBits.bind(this),u=this.readUEG.bind(this),s=this.readBoolean.bind(this),i=this.skipBits.bind(this),D=this.skipEG.bind(this),A=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);p();var R=p();if(l(5),i(3),p(),A(),R===100||R===110||R===122||R===244||R===44||R===83||R===86||R===118||R===128){var O=u();if(O===3&&i(1),A(),A(),i(1),s())for(c=O!==3?8:12,a=0;a<c;a++)s()&&(a<6?S(16):S(64))}A();var m=u();if(m===0)u();else if(m===1)for(i(1),D(),D(),y=u(),a=0;a<y;a++)D();A(),i(1);var v=u(),h=u(),d=l(1);d===0&&i(1),i(1),s()&&(n=u(),I=u(),b=u(),f=u());var C=[1,1];if(s()&&s()){var E=p();switch(E){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[p()<<8|p(),p()<<8|p()];break}}}return{width:Math.ceil((v+1)*16-n*2-I*2),height:(2-d)*(h+1)*16-(d?2:4)*(b+f),pixelRatio:C}},G.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},F}();Y.default=P},"./src/demux/id3.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"isHeader",function(){return z}),M.d(Y,"isFooter",function(){return P}),M.d(Y,"getID3Data",function(){return F}),M.d(Y,"canParse",function(){return K}),M.d(Y,"getTimeStamp",function(){return n}),M.d(Y,"isTimeStampFrame",function(){return I}),M.d(Y,"getID3Frames",function(){return f}),M.d(Y,"decodeFrame",function(){return y}),M.d(Y,"utf8ArrayToStr",function(){return u}),M.d(Y,"testables",function(){return s});var z=function(S,R){return R+10<=S.length&&(S[R]===73&&S[R+1]===68&&S[R+2]===51&&(S[R+3]<255&&S[R+4]<255&&(S[R+6]<128&&S[R+7]<128&&S[R+8]<128&&S[R+9]<128)))},P=function(S,R){return R+10<=S.length&&(S[R]===51&&S[R+1]===68&&S[R+2]===73&&(S[R+3]<255&&S[R+4]<255&&(S[R+6]<128&&S[R+7]<128&&S[R+8]<128&&S[R+9]<128)))},F=function(S,R){for(var O=R,m=0;z(S,R);){m+=10;var v=G(S,R+6);m+=v,P(S,R+10)&&(m+=10),R+=m}return m>0?S.subarray(O,O+m):void 0},G=function(S,R){var O=0;return O=(S[R]&127)<<21,O|=(S[R+1]&127)<<14,O|=(S[R+2]&127)<<7,O|=S[R+3]&127,O},K=function(S,R){return z(S,R)&&G(S,R+6)+10<=S.length-R},n=function(S){for(var R=f(S),O=0;O<R.length;O++){var m=R[O];if(I(m))return l(m)}return},I=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},b=function(S){var R=String.fromCharCode(S[0],S[1],S[2],S[3]),O=G(S,4),m=10;return{type:R,size:O,data:S.subarray(m,m+O)}},f=function(S){for(var R=0,O=[];z(S,R);){var m=G(S,R+6);R+=10;for(var v=R+m;R+8<v;){var h=b(S.subarray(R)),d=y(h);d&&O.push(d),R+=h.size+10}P(S,R)&&(R+=10)}return O},y=function(S){return S.type==="PRIV"?c(S):S.type[0]==="W"?p(S):a(S)},c=function(S){if(S.size<2)return;var R=u(S.data,!0),O=new Uint8Array(S.data.subarray(R.length+1));return{key:S.type,info:R,data:O.buffer}},a=function(S){if(S.size<2)return;if(S.type==="TXXX"){var R=1,O=u(S.data.subarray(R),!0);R+=O.length+1;var m=u(S.data.subarray(R));return{key:S.type,info:O,data:m}}var v=u(S.data.subarray(1));return{key:S.type,data:v}},p=function(S){if(S.type==="WXXX"){if(S.size<2)return;var R=1,O=u(S.data.subarray(R),!0);R+=O.length+1;var m=u(S.data.subarray(R));return{key:S.type,info:O,data:m}}var v=u(S.data);return{key:S.type,data:v}},l=function(S){if(S.data.byteLength===8){var R=new Uint8Array(S.data),O=R[3]&1,m=(R[4]<<23)+(R[5]<<15)+(R[6]<<7)+R[7];return m/=45,O&&(m+=4772185884e-2),Math.round(m)}return},u=function(S,R){R===void 0&&(R=!1);var O=D();if(O){var m=O.decode(S);if(R){var v=m.indexOf("\0");return v!==-1?m.substring(0,v):m}return m.replace(/\0/g,"")}for(var h=S.length,d,C,E,w="",j=0;j<h;){if(d=S[j++],d===0&&R)return w;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(d);break;case 12:case 13:C=S[j++],w+=String.fromCharCode((d&31)<<6|C&63);break;case 14:C=S[j++],E=S[j++],w+=String.fromCharCode((d&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return w},s={decodeTextFrame:a},i;function D(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/demux/base-audio-demuxer.ts"),P=M("./src/demux/id3.ts"),F=M("./src/utils/logger.ts"),G=M("./src/demux/mpegaudio.ts");function K(b,f){b.prototype=Object.create(f.prototype),b.prototype.constructor=b,n(b,f)}function n(b,f){return n=Object.setPrototypeOf||function(c,a){return c.__proto__=a,c},n(b,f)}var I=function(b){K(f,b);function f(){return b.apply(this,arguments)||this}var y=f.prototype;return y.resetInitSegment=function(a,p,l){b.prototype.resetInitSegment.call(this,a,p,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var p=P.getID3Data(a,0)||[],l=p.length,u=a.length;l<u;l++)if(G.probe(a,l))return F.logger.log("MPEG Audio sync word found !"),!0;return!1},y.canParse=function(a,p){return G.canParse(a,p)},y.appendFrame=function(a,p,l){return this.initPTS===null?void 0:G.appendFrame(a,p,l,this.initPTS,this.frameIndex)},f}(z.default);I.minProbeByteLength=4,Y.default=I},"./src/demux/mp4demuxer.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/utils/mp4-tools.ts"),P=M("./src/demux/dummy-demuxed-track.ts"),F=function(){function G(n,I){this.remainderData=null,this.config=void 0,this.config=I}var K=G.prototype;return K.resetTimeStamp=function(){},K.resetInitSegment=function(){},K.resetContiguity=function(){},G.probe=function(I){return Object(z.findBox)({data:I,start:0,end:Math.min(I.length,16384)},["moof"]).length>0},K.demux=function(I){var b=I,f=Object(P.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(z.appendUint8Array)(this.remainderData,I));var y=Object(z.segmentValidRange)(b);this.remainderData=y.remainder,f.samples=y.valid||new Uint8Array}else f.samples=b;return{audioTrack:Object(P.dummyTrack)(),avcTrack:f,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},K.flush=function(){var I=Object(P.dummyTrack)();return I.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(P.dummyTrack)(),avcTrack:I,id3Track:Object(P.dummyTrack)(),textTrack:Object(P.dummyTrack)()}},K.demuxSampleAes=function(I,b,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},K.destroy=function(){},G}();F.minProbeByteLength=1024,Y.default=F},"./src/demux/mpegaudio.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"appendFrame",function(){return n}),M.d(Y,"parseHeader",function(){return I}),M.d(Y,"isHeaderPattern",function(){return b}),M.d(Y,"isHeader",function(){return f}),M.d(Y,"canParse",function(){return y}),M.d(Y,"probe",function(){return c});var z=null,P=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],F=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],K=[0,1,1,4];function n(a,p,l,u,s){if(l+24>p.length)return;var i=I(p,l);if(i&&l+i.frameLength<=p.length){var D=i.samplesPerFrame*9e4/i.sampleRate,A=u+s*D,S={unit:p.subarray(l,l+i.frameLength),pts:A,dts:A};return a.config=[],a.channelCount=i.channelCount,a.samplerate=i.sampleRate,a.samples.push(S),{sample:S,length:i.frameLength,missing:0}}}function I(a,p){var l=a[p+1]>>3&3,u=a[p+1]>>1&3,s=a[p+2]>>4&15,i=a[p+2]>>2&3;if(l!==1&&s!==0&&s!==15&&i!==3){var D=a[p+2]>>1&1,A=a[p+3]>>6,S=l===3?3-u:u===3?3:4,R=P[S*14+s-1]*1e3,O=l===3?0:l===2?1:2,m=F[O*3+i],v=A===3?1:2,h=G[l][u],d=K[u],C=h*8*d,E=Math.floor(h*R/m+D)*d;if(z===null){var w=navigator.userAgent||"",j=w.match(/Chrome\/(\d+)/i);z=j?parseInt(j[1]):0}var W=!!z&&z<=87;return W&&u===2&&R>=224e3&&A===0&&(a[p+3]=a[p+3]|128),{sampleRate:m,channelCount:v,frameLength:E,samplesPerFrame:C}}}function b(a,p){return a[p]===255&&(a[p+1]&224)===224&&(a[p+1]&6)!==0}function f(a,p){return p+1<a.length&&b(a,p)}function y(a,p){var l=4;return b(a,p)&&l<=a.length-p}function c(a,p){if(p+1<a.length&&b(a,p)){var l=4,u=I(a,p),s=l;u!=null&&u.frameLength&&(s=u.frameLength);var i=p+s;return i===a.length||f(a,i)}return!1}},"./src/demux/sample-aes.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/crypt/decrypter.ts"),P=M("./src/demux/tsdemuxer.ts"),F=function(){function G(n,I,b){this.keyData=void 0,this.decrypter=void 0,this.keyData=b,this.decrypter=new z.default(n,I,{removePKCS7Padding:!1})}var K=G.prototype;return K.decryptBuffer=function(I,b){this.decrypter.decrypt(I,this.keyData.key.buffer,this.keyData.iv.buffer,b)},K.decryptAacSample=function(I,b,f,y){var c=I[b].unit,a=c.subarray(16,c.length-c.length%16),p=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),l=this;this.decryptBuffer(p,function(u){var s=new Uint8Array(u);c.set(s,16),y||l.decryptAacSamples(I,b+1,f)})},K.decryptAacSamples=function(I,b,f){for(;;b++){if(b>=I.length){f();return}if(I[b].unit.length<32)continue;var y=this.decrypter.isSync();if(this.decryptAacSample(I,b,f,y),!y)return}},K.getAvcEncryptedData=function(I){for(var b=Math.floor((I.length-48)/160)*16+16,f=new Int8Array(b),y=0,c=32;c<=I.length-16;c+=160,y+=16)f.set(I.subarray(c,c+16),y);return f},K.getAvcDecryptedUnit=function(I,b){for(var f=new Uint8Array(b),y=0,c=32;c<=I.length-16;c+=160,y+=16)I.set(f.subarray(y,y+16),c);return I},K.decryptAvcSample=function(I,b,f,y,c,a){var p=Object(P.discardEPB)(c.data),l=this.getAvcEncryptedData(p),u=this;this.decryptBuffer(l.buffer,function(s){c.data=u.getAvcDecryptedUnit(p,s),a||u.decryptAvcSamples(I,b,f+1,y)})},K.decryptAvcSamples=function(I,b,f,y){if(I instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,f=0){if(b>=I.length){y();return}for(var c=I[b].units;!(f>=c.length);f++){var a=c[f];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(I,b,f,y,a,p),!p)return}}},G}();Y.default=F},"./src/demux/transmuxer-interface.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return c});var z=M("./node_modules/webworkify-webpack/index.js"),P=M.n(z),F=M("./src/events.ts"),G=M("./src/demux/transmuxer.ts"),K=M("./src/utils/logger.ts"),n=M("./src/errors.ts"),I=M("./src/utils/mediasource-helper.ts"),b=M("./node_modules/eventemitter3/index.js"),f=M.n(b),y=Object(I.getMediaSource)()||{isTypeSupported:function(){return!1}},c=function(){function a(l,u,s,i){var D=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=l,this.id=u,this.onTransmuxComplete=s,this.onFlush=i;var A=l.config,S=function(h,d){d=d||{},d.frag=D.frag,d.id=D.id,l.trigger(h,d)};this.observer=new b.EventEmitter,this.observer.on(F.Events.FRAG_DECRYPTED,S),this.observer.on(F.Events.ERROR,S);var R={mp4:y.isTypeSupported("video/mp4"),mpeg:y.isTypeSupported("audio/mpeg"),mp3:y.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){K.logger.log("demuxing in webworker");var m;try{m=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(v){l.trigger(F.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},m.postMessage({cmd:"init",typeSupported:R,vendor:O,id:u,config:JSON.stringify(A)})}catch(v){K.logger.warn("Error in worker:",v),K.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new G.default(this.observer,R,A,O,u),this.worker=null}}else this.transmuxer=new G.default(this.observer,R,A,O,u)}var p=a.prototype;return p.destroy=function(){var u=this.worker;if(u)u.removeEventListener("message",this.onwmsg),u.terminate(),this.worker=null;else{var s=this.transmuxer;s&&(s.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},p.push=function(u,s,i,D,A,S,R,O,m,v){var h=this;m.transmuxing.start=self.performance.now();var d=this.transmuxer,C=this.worker,E=S?S.start:A.start,w=A.decryptdata,j=this.frag,W=!(j&&A.cc===j.cc),T=!(j&&m.level===j.level),N=j?m.sn-j.sn:-1,_=this.part?m.part-this.part.index:1,x=!T&&(N===1||N===0&&_===1),H=self.performance.now();(T||N||A.stats.parsing.start===0)&&(A.stats.parsing.start=H),S&&(_||!x)&&(S.stats.parsing.start=H);var X=new G.TransmuxState(W,x,O,T,E);if(!x||W){K.logger.log("[transmuxer-interface, "+A.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+`
discontinuity: `+W+`
trackSwitch: `+T+`
contiguous: `+x+`
accurateTimeOffset: `+O+`
timeOffset: `+E);var ee=new G.TransmuxConfig(i,D,s,R,v);this.configureTransmuxer(ee)}if(this.frag=A,this.part=S,C)C.postMessage({cmd:"demux",data:u,decryptdata:w,chunkMeta:m,state:X},u instanceof ArrayBuffer?[u]:[]);else if(d){var J=d.push(u,w,m,X);Object(G.isPromise)(J)?J.then(function(ce){h.handleTransmuxComplete(ce)}):this.handleTransmuxComplete(J)}},p.flush=function(u){var s=this;u.transmuxing.start=self.performance.now();var i=this.transmuxer,D=this.worker;if(D)D.postMessage({cmd:"flush",chunkMeta:u});else if(i){var A=i.flush(u);Object(G.isPromise)(A)?A.then(function(S){s.handleFlushResult(S,u)}):this.handleFlushResult(A,u)}},p.handleFlushResult=function(u,s){var i=this;u.forEach(function(D){i.handleTransmuxComplete(D)}),this.onFlush(s)},p.onWorkerMessage=function(u){var s=u.data,i=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,i.trigger(s.event,s.data);break}}},p.configureTransmuxer=function(u){var s=this.worker,i=this.transmuxer;s?s.postMessage({cmd:"configure",config:u}):i&&i.configure(u)},p.handleTransmuxComplete=function(u){u.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(u)},a}()},"./src/demux/transmuxer-worker.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return n});var z=M("./src/demux/transmuxer.ts"),P=M("./src/events.ts"),F=M("./src/utils/logger.ts"),G=M("./node_modules/eventemitter3/index.js"),K=M.n(G);function n(c){var a=new G.EventEmitter,p=function(u,s){c.postMessage({event:u,data:s})};a.on(P.Events.FRAG_DECRYPTED,p),a.on(P.Events.ERROR,p),c.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);c.transmuxer=new z.default(a,u.typeSupported,s,u.vendor,u.id),Object(F.enableLogs)(s.debug),p("init",null);break}case"configure":{c.transmuxer.configure(u.config);break}case"demux":{var i=c.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(z.isPromise)(i)?i.then(function(S){I(c,S)}):I(c,i);break}case"flush":{var D=u.chunkMeta,A=c.transmuxer.flush(D);Object(z.isPromise)(A)?A.then(function(S){f(c,S,D)}):f(c,A,D);break}default:break}})}function I(c,a){if(y(a.remuxResult))return;var p=[],l=a.remuxResult,u=l.audio,s=l.video;u&&b(p,u),s&&b(p,s),c.postMessage({event:"transmuxComplete",data:a},p)}function b(c,a){a.data1&&c.push(a.data1.buffer),a.data2&&c.push(a.data2.buffer)}function f(c,a,p){a.forEach(function(l){I(c,l)}),c.postMessage({event:"flush",data:p})}function y(c){return!c.audio&&!c.video&&!c.text&&!c.id3&&!c.initSegment}},"./src/demux/transmuxer.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return s}),M.d(Y,"isPromise",function(){return A}),M.d(Y,"TransmuxConfig",function(){return S}),M.d(Y,"TransmuxState",function(){return R});var z=M("./src/events.ts"),P=M("./src/errors.ts"),F=M("./src/crypt/decrypter.ts"),G=M("./src/demux/aacdemuxer.ts"),K=M("./src/demux/mp4demuxer.ts"),n=M("./src/demux/tsdemuxer.ts"),I=M("./src/demux/mp3demuxer.ts"),b=M("./src/remux/mp4-remuxer.ts"),f=M("./src/remux/passthrough-remuxer.ts"),y=M("./src/demux/chunk-cache.ts"),c=M("./src/utils/mp4-tools.ts"),a=M("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(O){a.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var l=[{demux:n.default,remux:b.default},{demux:K.default,remux:f.default},{demux:G.default,remux:b.default},{demux:I.default,remux:b.default}],u=1024;l.forEach(function(O){var m=O.demux;u=Math.max(u,m.minProbeByteLength)});var s=function(){function O(v,h,d,C,E){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new y.default,this.observer=v,this.typeSupported=h,this.config=d,this.vendor=C,this.id=E}var m=O.prototype;return m.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},m.push=function(h,d,C,E){var w=this,j=C.transmuxing;j.executeStart=p();var W=new Uint8Array(h),T=this.cache,N=this.config,_=this.currentTransmuxState,x=this.transmuxConfig;E&&(this.currentTransmuxState=E);var H=i(W,d);if(H&&H.method==="AES-128"){var X=this.getDecrypter();if(N.enableSoftwareAES){var ee=X.softwareDecrypt(W,H.key.buffer,H.iv.buffer);if(!ee)return j.executeEnd=p(),D(C);W=new Uint8Array(ee)}else return this.decryptionPromise=X.webCryptoDecrypt(W,H.key.buffer,H.iv.buffer).then(function(Ke){var nt=w.push(Ke,null,C);return w.decryptionPromise=null,nt}),this.decryptionPromise}var J=E||_,ce=J.contiguous,me=J.discontinuity,ue=J.trackSwitch,pe=J.accurateTimeOffset,xe=J.timeOffset,se=x.audioCodec,ae=x.videoCodec,Ce=x.defaultInitPts,ze=x.duration,Ye=x.initSegmentData;if((me||ue)&&this.resetInitSegment(Ye,se,ae,ze),me&&this.resetInitialTimestamp(Ce),ce||this.resetContiguity(),this.needsProbing(W,me,ue)){if(T.dataLength){var He=T.flush();W=Object(c.appendUint8Array)(He,W)}this.configureTransmuxer(W,x)}var Ve=this.transmux(W,H,xe,pe,C),Fe=this.currentTransmuxState;return Fe.contiguous=!0,Fe.discontinuity=!1,Fe.trackSwitch=!1,j.executeEnd=p(),Ve},m.flush=function(h){var d=this,C=h.transmuxing;C.executeStart=p();var E=this.decrypter,w=this.cache,j=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return d.flush(h)});var T=[],N=j.timeOffset;if(E){var _=E.flush();_&&T.push(this.push(_,null,h))}var x=w.dataLength;w.reset();var H=this.demuxer,X=this.remuxer;if(!H||!X)return x>=u&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:P.ErrorTypes.MEDIA_ERROR,details:P.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=p(),[D(h)];var ee=H.flush(N);return A(ee)?ee.then(function(J){return d.flushRemux(T,J,h),T}):(this.flushRemux(T,ee,h),T)},m.flushRemux=function(h,d,C){var E=d.audioTrack,w=d.avcTrack,j=d.id3Track,W=d.textTrack,T=this.currentTransmuxState,N=T.accurateTimeOffset,_=T.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var x=this.remuxer.remux(E,w,j,W,_,N,!0,this.id);h.push({remuxResult:x,chunkMeta:C}),C.transmuxing.executeEnd=p()},m.resetInitialTimestamp=function(h){var d=this.demuxer,C=this.remuxer;if(!d||!C)return;d.resetTimeStamp(h),C.resetTimeStamp(h)},m.resetContiguity=function(){var h=this.demuxer,d=this.remuxer;if(!h||!d)return;h.resetContiguity(),d.resetNextTimestamp()},m.resetInitSegment=function(h,d,C,E){var w=this.demuxer,j=this.remuxer;if(!w||!j)return;w.resetInitSegment(d,C,E),j.resetInitSegment(h,d,C)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(h,d,C,E,w){var j;return d&&d.method==="SAMPLE-AES"?j=this.transmuxSampleAes(h,d,C,E,w):j=this.transmuxUnencrypted(h,C,E,w),j},m.transmuxUnencrypted=function(h,d,C,E){var w=this.demuxer.demux(h,d,!1,!this.config.progressive),j=w.audioTrack,W=w.avcTrack,T=w.id3Track,N=w.textTrack,_=this.remuxer.remux(j,W,T,N,d,C,!1,this.id);return{remuxResult:_,chunkMeta:E}},m.transmuxSampleAes=function(h,d,C,E,w){var j=this;return this.demuxer.demuxSampleAes(h,d,C).then(function(W){var T=j.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,E,!1,j.id);return{remuxResult:T,chunkMeta:w}})},m.configureTransmuxer=function(h,d){for(var C=this.config,E=this.observer,w=this.typeSupported,j=this.vendor,W=d.audioCodec,T=d.defaultInitPts,N=d.duration,_=d.initSegmentData,x=d.videoCodec,H,X=0,ee=l.length;X<ee;X++)if(l[X].demux.probe(h)){H=l[X];break}H||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:K.default,remux:f.default});var J=this.demuxer,ce=this.remuxer,me=H.remux,ue=H.demux;(!ce||!(ce instanceof me))&&(this.remuxer=new me(E,C,w,j)),(!J||!(J instanceof ue))&&(this.demuxer=new ue(E,C,w),this.probe=ue.probe),this.resetInitSegment(_,W,x,N),this.resetInitialTimestamp(T)},m.needsProbing=function(h,d,C){return!this.demuxer||!this.remuxer||d||C},m.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new F.default(this.observer,this.config)),h},O}();function i(O,m){var v=null;return O.byteLength>0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(v=m),v}var D=function(m){return{remuxResult:{},chunkMeta:m}};function A(O){return"then"in O&&O.then instanceof Function}var S=function(m,v,h,d,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=v,this.initSegmentData=h,this.duration=d,this.defaultInitPts=C},R=function(m,v,h,d,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=v,this.accurateTimeOffset=h,this.trackSwitch=d,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"discardEPB",function(){return D});var z=M("./src/demux/adts.ts"),P=M("./src/demux/mpegaudio.ts"),F=M("./src/demux/exp-golomb.ts"),G=M("./src/demux/id3.ts"),K=M("./src/demux/sample-aes.ts"),n=M("./src/events.ts"),I=M("./src/utils/mp4-tools.ts"),b=M("./src/utils/logger.ts"),f=M("./src/errors.ts"),y={video:1,audio:2,id3:3,text:4},c=function(){function A(R,O,m){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=R,this.config=O,this.typeSupported=m}A.probe=function(O){var m=A.syncOffset(O);return m<0?!1:(m&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},A.syncOffset=function(O){for(var m=Math.min(1e3,O.length-3*188),v=0;v<m;){if(O[v]===71&&O[v+188]===71&&O[v+2*188]===71)return v;v++}return-1},A.createTrack=function(O,m){return{container:O==="video"||O==="audio"?"video/mp2t":void 0,type:O,id:y[O],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:O==="audio"?m:void 0}};var S=A.prototype;return S.resetInitSegment=function(O,m,v){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=A.createTrack("video",v),this._audioTrack=A.createTrack("audio",v),this._id3Track=A.createTrack("id3",v),this._txtTrack=A.createTrack("text",v),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=O,this.videoCodec=m,this._duration=v},S.resetTimeStamp=function(){},S.resetContiguity=function(){var O=this._audioTrack,m=this._avcTrack,v=this._id3Track;O&&(O.pesData=null),m&&(m.pesData=null),v&&(v.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(O,m,v,h){v===void 0&&(v=!1),h===void 0&&(h=!1),v||(this.sampleAes=null);var d,C=this._avcTrack,E=this._audioTrack,w=this._id3Track,j=C.pid,W=C.pesData,T=E.pid,N=w.pid,_=E.pesData,x=w.pesData,H=!1,X=this.pmtParsed,ee=this._pmtId,J=O.length;if(this.remainderData&&(O=Object(I.appendUint8Array)(this.remainderData,O),J=O.length,this.remainderData=null),J<188&&!h)return this.remainderData=O,{audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};var ce=Math.max(0,A.syncOffset(O));J-=(J+ce)%188,J<O.byteLength&&!h&&(this.remainderData=new Uint8Array(O.buffer,J,O.buffer.byteLength-J));for(var me=ce;me<J;me+=188)if(O[me]===71){var ue=!!(O[me+1]&64),pe=((O[me+1]&31)<<8)+O[me+2],xe=(O[me+3]&48)>>4,se=void 0;if(xe>1){if(se=me+5+O[me+4],se===me+188)continue}else se=me+4;switch(pe){case j:ue&&(W&&(d=u(W))&&this.parseAVCPES(d,!1),W={data:[],size:0}),W&&(W.data.push(O.subarray(se,me+188)),W.size+=me+188-se);break;case T:ue&&(_&&(d=u(_))&&(E.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),_={data:[],size:0}),_&&(_.data.push(O.subarray(se,me+188)),_.size+=me+188-se);break;case N:ue&&(x&&(d=u(x))&&this.parseID3PES(d),x={data:[],size:0}),x&&(x.data.push(O.subarray(se,me+188)),x.size+=me+188-se);break;case 0:ue&&(se+=O[se]+1),ee=this._pmtId=p(O,se);break;case ee:{ue&&(se+=O[se]+1);var ae=l(O,se,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);j=ae.avc,j>0&&(C.pid=j),T=ae.audio,T>0&&(E.pid=T,E.isAAC=ae.isAAC),N=ae.id3,N>0&&(w.pid=N),H&&!X&&(b.logger.log("reparse from beginning"),H=!1,me=ce-188),X=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=W,E.pesData=_,w.pesData=x;var Ce={audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(Ce),Ce},S.flush=function(){var O=this.remainderData;this.remainderData=null;var m;return O?m=this.demux(O,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},S.extractRemainingSamples=function(O){var m=O.audioTrack,v=O.avcTrack,h=O.id3Track,d=v.pesData,C=m.pesData,E=h.pesData,w;d&&(w=u(d))?(this.parseAVCPES(w,!0),v.pesData=null):v.pesData=d,C&&(w=u(C))?(m.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),m.pesData=null):(C!=null&&C.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=C),E&&(w=u(E))?(this.parseID3PES(w),h.pesData=null):h.pesData=E},S.demuxSampleAes=function(O,m,v){var h=this.demux(O,v,!0,!this.config.progressive),d=this.sampleAes=new K.default(this.observer,this.config,m);return this.decrypt(h,d)},S.decrypt=function(O,m){return new Promise(function(v){var h=O.audioTrack,d=O.avcTrack;h.samples&&h.isAAC?m.decryptAacSamples(h.samples,0,function(){d.samples?m.decryptAvcSamples(d.samples,0,0,function(){v(O)}):v(O)}):d.samples&&m.decryptAvcSamples(d.samples,0,0,function(){v(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,m){var v=this,h=this._avcTrack,d=this.parseAVCNALu(O.data),C=!1,E=this.avcSample,w,j=!1;O.data=null,E&&d.length&&!h.audFound&&(s(E,h),E=this.avcSample=a(!1,O.pts,O.dts,"")),d.forEach(function(W){switch(W.type){case 1:{w=!0,E||(E=v.avcSample=a(!0,O.pts,O.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var T=W.data;if(j&&T.length>4){var N=new F.default(T).readSliceType();(N===2||N===4||N===7||N===9)&&(E.key=!0)}break}case 5:w=!0,E||(E=v.avcSample=a(!0,O.pts,O.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{w=!0,C&&E&&(E.debug+="SEI ");var _=new F.default(D(W.data));_.readUByte();for(var x=0,H=0,X=!1,ee=0;!X&&_.bytesAvailable>1;){x=0;do ee=_.readUByte(),x+=ee;while(ee===255);H=0;do ee=_.readUByte(),H+=ee;while(ee===255);if(x===4&&_.bytesAvailable!==0){X=!0;var J=_.readUByte();if(J===181){var ce=_.readUShort();if(ce===49){var me=_.readUInt();if(me===1195456820){var ue=_.readUByte();if(ue===3){for(var pe=_.readUByte(),xe=_.readUByte(),se=31&pe,ae=[pe,xe],Ce=0;Ce<se;Ce++)ae.push(_.readUByte()),ae.push(_.readUByte()),ae.push(_.readUByte());i(v._txtTrack.samples,{type:3,pts:O.pts,bytes:ae})}}}}}else if(x===5&&_.bytesAvailable!==0){if(X=!0,H>16){for(var ze=[],Ye=0;Ye<16;Ye++)ze.push(_.readUByte().toString(16)),(Ye===3||Ye===5||Ye===7||Ye===9)&&ze.push("-");for(var He=H-16,Ve=new Uint8Array(He),Fe=0;Fe<He;Fe++)Ve[Fe]=_.readUByte();i(v._txtTrack.samples,{pts:O.pts,payloadType:x,uuid:ze.join(""),userData:Object(G.utf8ArrayToStr)(Ve),userDataBytes:Ve})}}else if(H<_.bytesAvailable)for(var Ke=0;Ke<H;Ke++)_.readUByte()}break}case 7:if(w=!0,j=!0,C&&E&&(E.debug+="SPS "),!h.sps){var nt=new F.default(W.data),he=nt.readSPS();h.width=he.width,h.height=he.height,h.pixelRatio=he.pixelRatio,h.sps=[W.data],h.duration=v._duration;for(var Re=W.data.subarray(1,4),Ne="avc1.",Ue=0;Ue<3;Ue++){var rt=Re[Ue].toString(16);rt.length<2&&(rt="0"+rt),Ne+=rt}h.codec=Ne}break;case 8:w=!0,C&&E&&(E.debug+="PPS "),h.pps||(h.pps=[W.data]);break;case 9:w=!1,h.audFound=!0,E&&s(E,h),E=v.avcSample=a(!1,O.pts,O.dts,C?"AUD ":"");break;case 12:w=!1;break;default:w=!1,E&&(E.debug+="unknown NAL "+W.type+" ");break}if(E&&w){var st=E.units;st.push(W)}}),m&&E&&(s(E,h),this.avcSample=null)},S.getLastNalUnit=function(){var O,m=this.avcSample,v;if(!m||m.units.length===0){var h=this._avcTrack.samples;m=h[h.length-1]}if((O=m)!==null&&O!==void 0&&O.units){var d=m.units;v=d[d.length-1]}return v},S.parseAVCNALu=function(O){var m=O.byteLength,v=this._avcTrack,h=v.naluState||0,d=h,C=[],E=0,w,j,W,T=-1,N=0;for(h===-1&&(T=0,N=O[0]&31,h=0,E=1);E<m;){if(w=O[E++],!h){h=w?0:1;continue}if(h===1){h=w?0:2;continue}if(!w)h=3;else if(w===1){if(T>=0){var _={data:O.subarray(T,E-h-1),type:N};C.push(_)}else{var x=this.getLastNalUnit();if(x&&(d&&E<=4-d&&(x.state&&(x.data=x.data.subarray(0,x.data.byteLength-d))),j=E-h-1,j>0)){var H=new Uint8Array(x.data.byteLength+j);H.set(x.data,0),H.set(O.subarray(0,j),x.data.byteLength),x.data=H,x.state=0}}E<m?(W=O[E]&31,T=E,N=W,h=0):h=-1}else h=0}if(T>=0&&h>=0){var X={data:O.subarray(T,m),type:N,state:h};C.push(X)}if(C.length===0){var ee=this.getLastNalUnit();if(ee){var J=new Uint8Array(ee.data.byteLength+O.byteLength);J.set(ee.data,0),J.set(O,ee.data.byteLength),ee.data=J}}return v.naluState=h,C},S.parseAACPES=function(O){var m=0,v=this._audioTrack,h=this.aacOverFlow,d=O.data;if(h){this.aacOverFlow=null;var C=h.sample.unit.byteLength,E=Math.min(h.missing,C),w=C-E;h.sample.unit.set(d.subarray(0,E),w),v.samples.push(h.sample),m=h.missing}var j,W;for(j=m,W=d.length;j<W-1&&!z.isHeader(d,j);j++);if(j!==m){var T,N;if(j<W-1?(T="AAC PES did not start with ADTS header,offset:"+j,N=!1):(T="no ADTS header found in AAC PES",N=!0),b.logger.warn("parsing error:"+T),this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:N,reason:T}),N)return}z.initTrackConfig(v,this.observer,d,j,this.audioCodec);var _;if(O.pts!==void 0)_=O.pts;else if(h){var x=z.getFrameDuration(v.samplerate);_=h.sample.pts+x}else{b.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;j<W;)if(z.isHeader(d,j)){if(j+5<W){var X=z.appendFrame(v,d,j,_,H);if(X)if(X.missing)this.aacOverFlow=X;else{j+=X.length,H++;continue}}break}else j++},S.parseMPEGPES=function(O){var m=O.data,v=m.length,h=0,d=0,C=O.pts;if(C===void 0){b.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<v;)if(P.isHeader(m,d)){var E=P.appendFrame(this._audioTrack,m,d,C,h);if(E)d+=E.length,h++;else break}else d++},S.parseID3PES=function(O){if(O.pts===void 0){b.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(O)},A}();c.minProbeByteLength=188;function a(A,S,R,O){return{key:A,frame:!1,pts:S,dts:R,units:[],debug:O,length:0}}function p(A,S){return(A[S+10]&31)<<8|A[S+11]}function l(A,S,R,O){var m={audio:-1,avc:-1,id3:-1,isAAC:!0},v=(A[S+1]&15)<<8|A[S+2],h=S+3+v-4,d=(A[S+10]&15)<<8|A[S+11];for(S+=12+d;S<h;){var C=(A[S+1]&31)<<8|A[S+2];switch(A[S]){case 207:if(!O){b.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:m.audio===-1&&(m.audio=C);break;case 21:m.id3===-1&&(m.id3=C);break;case 219:if(!O){b.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:m.avc===-1&&(m.avc=C);break;case 3:case 4:R?m.audio===-1&&(m.audio=C,m.isAAC=!1):b.logger.log("MPEG audio found, not supported in this browser");break;case 36:b.logger.warn("Unsupported HEVC stream type found");break;default:break}S+=((A[S+3]&15)<<8|A[S+4])+5}return m}function u(A){var S=0,R,O,m,v,h,d=A.data;if(!A||A.size===0)return null;for(;d[0].length<19&&d.length>1;){var C=new Uint8Array(d[0].length+d[1].length);C.set(d[0]),C.set(d[1],d[0].length),d[0]=C,d.splice(1,1)}R=d[0];var E=(R[0]<<16)+(R[1]<<8)+R[2];if(E===1){if(O=(R[4]<<8)+R[5],O&&O>A.size-6)return null;var w=R[7];w&192&&(v=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,w&64?(h=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,v-h>60*9e4&&(b.logger.warn(Math.round((v-h)/9e4)+"s delta between PTS and DTS, align them"),v=h)):h=v),m=R[8];var j=m+9;if(A.size<=j)return null;A.size-=j;for(var W=new Uint8Array(A.size),T=0,N=d.length;T<N;T++){R=d[T];var _=R.byteLength;if(j)if(j>_){j-=_;continue}else R=R.subarray(j),_-=j,j=0;W.set(R,S),S+=_}return O&&(O-=m+3),{data:W,pts:v,dts:h,len:O}}return null}function s(A,S){if(A.units.length&&A.frame){if(A.pts===void 0){var R=S.samples,O=R.length;if(O){var m=R[O-1];A.pts=m.pts,A.dts=m.dts}else{S.dropped++;return}}S.samples.push(A)}A.debug.length&&b.logger.log(A.pts+"/"+A.dts+":"+A.debug)}function i(A,S){var R=A.length;if(R>0){if(S.pts>=A[R-1].pts)A.push(S);else for(var O=R-1;O>=0;O--)if(S.pts<A[O].pts){A.splice(O,0,S);break}}else A.push(S)}function D(A){for(var S=A.byteLength,R=[],O=1;O<S-2;)A[O]===0&&A[O+1]===0&&A[O+2]===3?(R.push(O+2),O+=2):O++;if(R.length===0)return A;var m=S-R.length,v=new Uint8Array(m),h=0;for(O=0;O<m;h++,O++)h===R[0]&&(h++,R.shift()),v[O]=A[h];return v}Y.default=c},"./src/errors.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"ErrorTypes",function(){return z}),M.d(Y,"ErrorDetails",function(){return P});var z;(function(F){F.NETWORK_ERROR="networkError",F.MEDIA_ERROR="mediaError",F.KEY_SYSTEM_ERROR="keySystemError",F.MUX_ERROR="muxError",F.OTHER_ERROR="otherError"})(z||(z={}));var P;(function(F){F.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",F.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",F.KEY_SYSTEM_NO_SESSION="keySystemNoSession",F.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",F.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",F.MANIFEST_LOAD_ERROR="manifestLoadError",F.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",F.MANIFEST_PARSING_ERROR="manifestParsingError",F.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",F.LEVEL_EMPTY_ERROR="levelEmptyError",F.LEVEL_LOAD_ERROR="levelLoadError",F.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",F.LEVEL_SWITCH_ERROR="levelSwitchError",F.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",F.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",F.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",F.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",F.FRAG_LOAD_ERROR="fragLoadError",F.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",F.FRAG_DECRYPT_ERROR="fragDecryptError",F.FRAG_PARSING_ERROR="fragParsingError",F.REMUX_ALLOC_ERROR="remuxAllocError",F.KEY_LOAD_ERROR="keyLoadError",F.KEY_LOAD_TIMEOUT="keyLoadTimeOut",F.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",F.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",F.BUFFER_APPEND_ERROR="bufferAppendError",F.BUFFER_APPENDING_ERROR="bufferAppendingError",F.BUFFER_STALLED_ERROR="bufferStalledError",F.BUFFER_FULL_ERROR="bufferFullError",F.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",F.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",F.INTERNAL_EXCEPTION="internalException",F.INTERNAL_ABORTED="aborted",F.UNKNOWN="unknown"})(P||(P={}))},"./src/events.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"Events",function(){return z});var z;(function(P){P.MEDIA_ATTACHING="hlsMediaAttaching",P.MEDIA_ATTACHED="hlsMediaAttached",P.MEDIA_DETACHING="hlsMediaDetaching",P.MEDIA_DETACHED="hlsMediaDetached",P.BUFFER_RESET="hlsBufferReset",P.BUFFER_CODECS="hlsBufferCodecs",P.BUFFER_CREATED="hlsBufferCreated",P.BUFFER_APPENDING="hlsBufferAppending",P.BUFFER_APPENDED="hlsBufferAppended",P.BUFFER_EOS="hlsBufferEos",P.BUFFER_FLUSHING="hlsBufferFlushing",P.BUFFER_FLUSHED="hlsBufferFlushed",P.MANIFEST_LOADING="hlsManifestLoading",P.MANIFEST_LOADED="hlsManifestLoaded",P.MANIFEST_PARSED="hlsManifestParsed",P.LEVEL_SWITCHING="hlsLevelSwitching",P.LEVEL_SWITCHED="hlsLevelSwitched",P.LEVEL_LOADING="hlsLevelLoading",P.LEVEL_LOADED="hlsLevelLoaded",P.LEVEL_UPDATED="hlsLevelUpdated",P.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",P.LEVELS_UPDATED="hlsLevelsUpdated",P.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",P.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",P.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",P.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",P.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",P.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",P.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",P.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",P.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",P.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",P.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",P.CUES_PARSED="hlsCuesParsed",P.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",P.INIT_PTS_FOUND="hlsInitPtsFound",P.FRAG_LOADING="hlsFragLoading",P.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",P.FRAG_LOADED="hlsFragLoaded",P.FRAG_DECRYPTED="hlsFragDecrypted",P.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",P.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",P.FRAG_PARSING_METADATA="hlsFragParsingMetadata",P.FRAG_PARSED="hlsFragParsed",P.FRAG_BUFFERED="hlsFragBuffered",P.FRAG_CHANGED="hlsFragChanged",P.FPS_DROP="hlsFpsDrop",P.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",P.ERROR="hlsError",P.DESTROYING="hlsDestroying",P.KEY_LOADING="hlsKeyLoading",P.KEY_LOADED="hlsKeyLoaded",P.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",P.BACK_BUFFER_REACHED="hlsBackBufferReached"})(z||(z={}))},"./src/hls.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return A});var z=M("./node_modules/url-toolkit/src/url-toolkit.js"),P=M.n(z),F=M("./src/loader/playlist-loader.ts"),G=M("./src/loader/key-loader.ts"),K=M("./src/controller/id3-track-controller.ts"),n=M("./src/controller/latency-controller.ts"),I=M("./src/controller/level-controller.ts"),b=M("./src/controller/fragment-tracker.ts"),f=M("./src/controller/stream-controller.ts"),y=M("./src/is-supported.ts"),c=M("./src/utils/logger.ts"),a=M("./src/config.ts"),p=M("./node_modules/eventemitter3/index.js"),l=M.n(p),u=M("./src/events.ts"),s=M("./src/errors.ts");function i(S,R){for(var O=0;O<R.length;O++){var m=R[O];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(S,m.key,m)}}function D(S,R,O){return R&&i(S.prototype,R),O&&i(S,O),S}var A=function(){S.isSupported=function(){return Object(y.isSupported)()};function S(O){O===void 0&&(O={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 m=this.config=Object(a.mergeConfig)(S.DefaultConfig,O);this.userConfig=O,Object(c.enableLogs)(m.debug),this._autoLevelCapping=-1,m.progressive&&Object(a.enableStreamingMode)(m);var v=m.abrController,h=m.bufferController,d=m.capLevelController,C=m.fpsController,E=this.abrController=new v(this),w=this.bufferController=new h(this),j=this.capLevelController=new d(this),W=new C(this),T=new F.default(this),N=new G.default(this),_=new K.default(this),x=this.levelController=new I.default(this),H=new b.FragmentTracker(this),X=this.streamController=new f.default(this,H);j.setStreamController(X),W.setStreamController(X);var ee=[x,X];this.networkControllers=ee;var J=[T,N,E,w,j,W,_,H];this.audioTrackController=this.createController(m.audioTrackController,null,ee),this.createController(m.audioStreamController,H,ee),this.subtitleTrackController=this.createController(m.subtitleTrackController,null,ee),this.createController(m.subtitleStreamController,H,ee),this.createController(m.timelineController,null,J),this.emeController=this.createController(m.emeController,null,J),this.cmcdController=this.createController(m.cmcdController,null,J),this.latencyController=this.createController(n.default,null,J),this.coreComponents=J}var R=S.prototype;return R.createController=function(m,v,h){if(m){var d=v?new m(this,v):new m(this);return h&&h.push(d),d}return null},R.on=function(m,v,h){h===void 0&&(h=this),this._emitter.on(m,v,h)},R.once=function(m,v,h){h===void 0&&(h=this),this._emitter.once(m,v,h)},R.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},R.off=function(m,v,h,d){h===void 0&&(h=this),this._emitter.off(m,v,h,d)},R.listeners=function(m){return this._emitter.listeners(m)},R.emit=function(m,v,h){return this._emitter.emit(m,v,h)},R.trigger=function(m,v){if(this.config.debug)return this.emit(m,m,v);try{return this.emit(m,m,v)}catch(h){c.logger.error("An internal error happened while handling event "+m+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(u.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:h})}return!1},R.listenerCount=function(m){return this._emitter.listenerCount(m)},R.destroy=function(){c.logger.log("destroy"),this.trigger(u.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},R.attachMedia=function(m){c.logger.log("attachMedia"),this._media=m,this.trigger(u.Events.MEDIA_ATTACHING,{media:m})},R.detachMedia=function(){c.logger.log("detachMedia"),this.trigger(u.Events.MEDIA_DETACHING,void 0),this._media=null},R.loadSource=function(m){this.stopLoad();var v=this.media,h=this.url,d=this.url=z.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});c.logger.log("loadSource:"+d),v&&h&&h!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(v)),this.trigger(u.Events.MANIFEST_LOADING,{url:m})},R.startLoad=function(m){m===void 0&&(m=-1),c.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(v){v.startLoad(m)})},R.stopLoad=function(){c.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},R.swapAudioCodec=function(){c.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},R.recoverMediaError=function(){c.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},R.removeLevel=function(m,v){v===void 0&&(v=0),this.levelController.removeLevel(m,v)},D(S,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){c.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){c.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){c.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){c.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){c.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var v=!!m;v!==this.config.capLevelToPlayerSize&&(v?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=v)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(c.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,v=this.config.minAutoBitrate;if(!m)return 0;for(var h=m.length,d=0;d<h;d++)if(m[d].maxBitrate>v)return d;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,v=this.autoLevelCapping,h;return v===-1&&m&&m.length?h=m.length-1:h=v,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var v=this.audioTrackController;v&&(v.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{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 u.Events}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:a.hlsDefaultConfig},set:function(m){S.defaultConfig=m}}]),S}();A.defaultConfig=void 0},"./src/is-supported.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"isSupported",function(){return F}),M.d(Y,"changeTypeSupported",function(){return G});var z=M("./src/utils/mediasource-helper.ts");function P(){return self.SourceBuffer||self.WebKitSourceBuffer}function F(){var K=Object(z.getMediaSource)();if(!K)return!1;var n=P(),I=K&&typeof K.isTypeSupported=="function"&&K.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!I&&!!b}function G(){var K,n=P();return typeof(n==null||((K=n.prototype)===null||K===void 0)?void 0:K.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return c}),M.d(Y,"LoadError",function(){return p});var z=M("./src/polyfills/number.ts"),P=M("./src/errors.ts");function F(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,b(l,u)}function G(l){var u=typeof Map=="function"?new Map:void 0;return G=function(i){if(i===null||!I(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof u!="undefined"){if(u.has(i))return u.get(i);u.set(i,D)}function D(){return K(i,arguments,f(this).constructor)}return D.prototype=Object.create(i.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),b(D,i)},G(l)}function K(l,u,s){return n()?K=Reflect.construct:K=function(D,A,S){var R=[null];R.push.apply(R,A);var O=Function.bind.apply(D,R),m=new O;return S&&b(m,S.prototype),m},K.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function I(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function b(l,u){return b=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},b(l,u)}function f(l){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},f(l)}var y=Math.pow(2,17),c=function(){function l(s){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=s}var u=l.prototype;return u.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},u.abort=function(){this.loader&&this.loader.abort()},u.load=function(i,D){var A=this,S=i.url;if(!S)return Promise.reject(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var R=this.config,O=R.fLoader,m=R.loader;return new Promise(function(v,h){A.loader&&A.loader.destroy();var d=A.loader=i.loader=O?new O(R):new m(R),C=a(i),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:y};i.stats=d.stats,d.load(C,E,{onSuccess:function(j,W,T,N){A.resetLoader(i,d),v({frag:i,part:null,payload:j.data,networkDetails:N})},onError:function(j,W,T){A.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:j,networkDetails:T}))},onAbort:function(j,W,T){A.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:T}))},onTimeout:function(j,W,T){A.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:T}))},onProgress:function(j,W,T,N){D&&D({frag:i,part:null,payload:T,networkDetails:N})}})})},u.loadPart=function(i,D,A){var S=this;this.abort();var R=this.config,O=R.fLoader,m=R.loader;return new Promise(function(v,h){S.loader&&S.loader.destroy();var d=S.loader=i.loader=O?new O(R):new m(R),C=a(i,D),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:y};D.stats=d.stats,d.load(C,E,{onSuccess:function(j,W,T,N){S.resetLoader(i,d),S.updateStatsFromPart(i,D);var _={frag:i,part:D,payload:j.data,networkDetails:N};A(_),v(_)},onError:function(j,W,T){S.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:D,response:j,networkDetails:T}))},onAbort:function(j,W,T){i.stats.aborted=D.stats.aborted,S.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:D,networkDetails:T}))},onTimeout:function(j,W,T){S.resetLoader(i,d),h(new p({type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,part:D,networkDetails:T}))}})})},u.updateStatsFromPart=function(i,D){var A=i.stats,S=D.stats,R=S.total;if(A.loaded+=S.loaded,R){var O=Math.round(i.duration/D.duration),m=Math.min(Math.round(A.loaded/R),O),v=O-m,h=v*Math.round(A.loaded/m);A.total=A.loaded+h}else A.total=Math.max(A.loaded,A.total);var d=A.loading,C=S.loading;d.start?d.first+=C.first-C.start:(d.start=C.start,d.first=C.first),d.end=C.end},u.resetLoader=function(i,D){i.loader=null,this.loader===D&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),D.destroy()},l}();function a(l,u){u===void 0&&(u=null);var s=u||l,i={frag:l,part:u,responseType:"arraybuffer",url:s.url,headers:{},rangeStart:0,rangeEnd:0},D=s.byteRangeStartOffset,A=s.byteRangeEndOffset;return Object(z.isFiniteNumber)(D)&&Object(z.isFiniteNumber)(A)&&(i.rangeStart=D,i.rangeEnd=A),i}var p=function(l){F(u,l);function u(s){for(var i,D=arguments.length,A=new Array(D>1?D-1:0),S=1;S<D;S++)A[S-1]=arguments[S];return i=l.call.apply(l,[this].concat(A))||this,i.data=void 0,i.data=s,i}return u}(G(Error))},"./src/loader/fragment.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"ElementaryStreamTypes",function(){return c}),M.d(Y,"BaseSegment",function(){return a}),M.d(Y,"Fragment",function(){return p}),M.d(Y,"Part",function(){return l});var z=M("./src/polyfills/number.ts"),P=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(P),G=M("./src/utils/logger.ts"),K=M("./src/loader/level-key.ts"),n=M("./src/loader/load-stats.ts");function I(u,s){u.prototype=Object.create(s.prototype),u.prototype.constructor=u,b(u,s)}function b(u,s){return b=Object.setPrototypeOf||function(D,A){return D.__proto__=A,D},b(u,s)}function f(u,s){for(var i=0;i<s.length;i++){var D=s[i];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(u,D.key,D)}}function y(u,s,i){return s&&f(u.prototype,s),i&&f(u,i),u}var c;(function(u){u.AUDIO="audio",u.VIDEO="video",u.AUDIOVIDEO="audiovideo"})(c||(c={}));var a=function(){function u(i){var D;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(D={},D[c.AUDIO]=null,D[c.VIDEO]=null,D[c.AUDIOVIDEO]=null,D),this.baseurl=i}var s=u.prototype;return s.setByteRange=function(D,A){var S=D.split("@",2),R=[];S.length===1?R[0]=A?A.byteRangeEndOffset:0:R[0]=parseInt(S[1]),R[1]=parseInt(S[0])+R[0],this._byteRange=R},y(u,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(P.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(D){this._url=D}}]),u}(),p=function(u){I(s,u);function s(D,A){var S;return S=u.call(this,A)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new n.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=D,S}var i=s.prototype;return i.createInitializationVector=function(A){for(var S=new Uint8Array(16),R=12;R<16;R++)S[R]=A>>8*(15-R)&255;return S},i.setDecryptDataFromLevelKey=function(A,S){var R=A;return(A==null?void 0:A.method)==="AES-128"&&A.uri&&!A.iv&&(R=K.LevelKey.fromURI(A.uri),R.method=A.method,R.iv=this.createInitializationVector(S),R.keyFormat="identity"),R},i.setElementaryStreamInfo=function(A,S,R,O,m,v){v===void 0&&(v=!1);var h=this.elementaryStreams,d=h[A];if(!d){h[A]={startPTS:S,endPTS:R,startDTS:O,endDTS:m,partial:v};return}d.startPTS=Math.min(d.startPTS,S),d.endPTS=Math.max(d.endPTS,R),d.startDTS=Math.min(d.startDTS,O),d.endDTS=Math.max(d.endDTS,m)},i.clearElementaryStreamInfo=function(){var A=this.elementaryStreams;A[c.AUDIO]=null,A[c.VIDEO]=null,A[c.AUDIOVIDEO]=null},y(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&&G.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(z.isFiniteNumber)(this.programDateTime))return null;var A=Object(z.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),l=function(u){I(s,u);function s(i,D,A,S,R){var O;O=u.call(this,A)||this,O.fragOffset=0,O.duration=0,O.gap=!1,O.independent=!1,O.relurl=void 0,O.fragment=void 0,O.index=void 0,O.stats=new n.LoadStats,O.duration=i.decimalFloatingPoint("DURATION"),O.gap=i.bool("GAP"),O.independent=i.bool("INDEPENDENT"),O.relurl=i.enumeratedString("URI"),O.fragment=D,O.index=S;var m=i.enumeratedString("BYTERANGE");return m&&O.setByteRange(m,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return y(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 D=this.elementaryStreams;return!!(D.audio||D.video||D.audiovideo)}}]),s}(a)},"./src/loader/key-loader.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return G});var z=M("./src/events.ts"),P=M("./src/errors.ts"),F=M("./src/utils/logger.ts"),G=function(){function K(I){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=I,this._registerListeners()}var n=K.prototype;return n._registerListeners=function(){this.hls.on(z.Events.KEY_LOADING,this.onKeyLoading,this)},n._unregisterListeners=function(){this.hls.off(z.Events.KEY_LOADING,this.onKeyLoading)},n.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var f=this.loaders[b];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(b,f){var y=f.frag,c=y.type,a=this.loaders[c];if(!y.decryptdata){F.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=y.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(a&&(F.logger.warn("abort previous key loader for type:"+c),a.abort()),!p){F.logger.warn("key uri is falsy");return}var u=l.loader,s=y.loader=this.loaders[c]=new u(l);this.decrypturl=p,this.decryptkey=null;var i={url:p,frag:y,responseType:"arraybuffer"},D={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},A={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};s.load(i,D,A)}else this.decryptkey&&(y.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:y}))},n.loadsuccess=function(b,f,y){var c=y.frag;if(!c.decryptdata){F.logger.error("after key load, decryptdata unset");return}this.decryptkey=c.decryptdata.key=new Uint8Array(b.data),c.loader=null,delete this.loaders[c.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:c})},n.loaderror=function(b,f){var y=f.frag,c=y.loader;c&&c.abort(),delete this.loaders[y.type],this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:y,response:b})},n.loadtimeout=function(b,f){var y=f.frag,c=y.loader;c&&c.abort(),delete this.loaders[y.type],this.hls.trigger(z.Events.ERROR,{type:P.ErrorTypes.NETWORK_ERROR,details:P.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:y})},K}()},"./src/loader/level-details.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"LevelDetails",function(){return K});var z=M("./src/polyfills/number.ts");function P(n,I){for(var b=0;b<I.length;b++){var f=I[b];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function F(n,I,b){return I&&P(n.prototype,I),b&&P(n,b),n}var G=10,K=function(){function n(b){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=b}var I=n.prototype;return I.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var y=this.lastPartSn-f.lastPartSn,c=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!c||!!y,this.advanced=this.endSN>f.endSN||y>0||y===0&&c>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},F(n,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(z.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||G}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var y=this.driftEnd-this.driftStart;return y*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),n}()},"./src/loader/level-key.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"LevelKey",function(){return K});var z=M("./node_modules/url-toolkit/src/url-toolkit.js"),P=M.n(z);function F(n,I){for(var b=0;b<I.length;b++){var f=I[b];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(n,f.key,f)}}function G(n,I,b){return I&&F(n.prototype,I),b&&F(n,b),n}var K=function(){n.fromURL=function(b,f){return new n(b,f)},n.fromURI=function(b){return new n(b)};function n(I,b){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,b?this._uri=Object(z.buildAbsoluteURL)(I,b,{alwaysNormalize:!0}):this._uri=I}return G(n,[{key:"uri",get:function(){return this._uri}}]),n}()},"./src/loader/load-stats.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"LoadStats",function(){return z});var z=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(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return s});var z=M("./src/polyfills/number.ts"),P=M("./node_modules/url-toolkit/src/url-toolkit.js"),F=M.n(P),G=M("./src/loader/fragment.ts"),K=M("./src/loader/level-details.ts"),n=M("./src/loader/level-key.ts"),I=M("./src/utils/attr-list.ts"),b=M("./src/utils/logger.ts"),f=M("./src/utils/codecs.ts"),y=/#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"),p=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("|")),l=/\.(mp4|m4s|m4v|m4a)$/i;function u(R){var O,m;return l.test((O=(m=P.parseURL(R))===null||m===void 0?void 0:m.path)!=null?O:"")}var s=function(){function R(){}return R.findGroup=function(m,v){for(var h=0;h<m.length;h++){var d=m[h];if(d.id===v)return d}},R.convertAVC1ToAVCOTI=function(m){var v=m.split(".");if(v.length>2){var h=v.shift()+".";return h+=parseInt(v.shift()).toString(16),h+=("000"+parseInt(v.shift()).toString(16)).substr(-4),h}return m},R.resolve=function(m,v){return P.buildAbsoluteURL(v,m,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(m,v){var h=[],d={},C=!1;y.lastIndex=0;for(var E;(E=y.exec(m))!=null;)if(E[1]){var w=new I.AttrList(E[1]),j={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:R.resolve(E[2],v)},W=w.decimalResolution("RESOLUTION");W&&(j.width=W.width,j.height=W.height),i((w.CODECS||"").split(/[ ,]+/).filter(function(N){return N}),j),j.videoCodec&&j.videoCodec.indexOf("avc1")!==-1&&(j.videoCodec=R.convertAVC1ToAVCOTI(j.videoCodec)),h.push(j)}else if(E[3]){var T=new I.AttrList(E[3]);T["DATA-ID"]&&(C=!0,d[T["DATA-ID"]]=T)}return{levels:h,sessionData:C?d:null}},R.parseMasterPlaylistMedia=function(m,v,h,d){d===void 0&&(d=[]);var C,E=[],w=0;for(c.lastIndex=0;(C=c.exec(m))!==null;){var j=new I.AttrList(C[1]);if(j.TYPE===h){var W={attrs:j,bitrate:0,id:w++,groupId:j["GROUP-ID"],instreamId:j["INSTREAM-ID"],name:j.NAME||j.LANGUAGE||"",type:h,default:j.bool("DEFAULT"),autoselect:j.bool("AUTOSELECT"),forced:j.bool("FORCED"),lang:j.LANGUAGE,url:j.URI?R.resolve(j.URI,v):""};if(d.length){var T=R.findGroup(d,W.groupId)||d[0];D(W,T,"audioCodec"),D(W,T,"textCodec")}E.push(W)}}return E},R.parseLevelPlaylist=function(m,v,h,d,C){var E=new K.LevelDetails(v),w=E.fragments,j=null,W=0,T=0,N=0,_=0,x=null,H=new G.Fragment(d,v),X,ee,J,ce=-1,me=!1;for(a.lastIndex=0,E.m3u8=m;(X=a.exec(m))!==null;){me&&(me=!1,H=new G.Fragment(d,v),H.start=N,H.sn=W,H.cc=_,H.level=h,j&&(H.initSegment=j,H.rawProgramDateTime=j.rawProgramDateTime));var ue=X[1];if(ue){H.duration=parseFloat(ue);var pe=(" "+X[2]).slice(1);H.title=pe||null,H.tagList.push(pe?["INF",ue,pe]:["INF",ue])}else if(X[3])Object(z.isFiniteNumber)(H.duration)&&(H.start=N,J&&(H.levelkey=J),H.sn=W,H.level=h,H.cc=_,H.urlId=C,w.push(H),H.relurl=(" "+X[3]).slice(1),S(H,x),x=H,N+=H.duration,W++,T=0,me=!0);else if(X[4]){var xe=(" "+X[4]).slice(1);x?H.setByteRange(xe,x):H.setByteRange(xe)}else if(X[5])H.rawProgramDateTime=(" "+X[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),ce===-1&&(ce=w.length);else{if(X=X[0].match(p),!X){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(ee=1;ee<X.length&&!(typeof X[ee]!="undefined");ee++);var se=(" "+X[ee]).slice(1),ae=(" "+X[ee+1]).slice(1),Ce=X[ee+2]?(" "+X[ee+2]).slice(1):"";switch(se){case"PLAYLIST-TYPE":E.type=ae.toUpperCase();break;case"MEDIA-SEQUENCE":W=E.startSN=parseInt(ae);break;case"SKIP":{var ze=new I.AttrList(ae),Ye=ze.decimalInteger("SKIPPED-SEGMENTS");if(Object(z.isFiniteNumber)(Ye)){E.skippedSegments=Ye;for(var He=Ye;He--;)w.unshift(null);W+=Ye}var Ve=ze.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ve&&(E.recentlyRemovedDateranges=Ve.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(ae);break;case"VERSION":E.version=parseInt(ae);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(ae||Ce)&&H.tagList.push(Ce?[ae,Ce]:[ae]);break;case"DIS":_++;case"GAP":H.tagList.push([se]);break;case"BITRATE":H.tagList.push([se,ae]);break;case"DISCONTINUITY-SEQ":_=parseInt(ae);break;case"KEY":{var Fe,Ke=new I.AttrList(ae),nt=Ke.enumeratedString("METHOD"),he=Ke.URI,Re=Ke.hexadecimalInteger("IV"),Ne=Ke.enumeratedString("KEYFORMATVERSIONS"),Ue=Ke.enumeratedString("KEYID"),rt=(Fe=Ke.enumeratedString("KEYFORMAT"))!=null?Fe:"identity",st=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(st.indexOf(rt)>-1){b.logger.warn("Keyformat "+rt+" is not supported from the manifest");continue}else if(rt!=="identity")continue;nt&&(J=n.LevelKey.fromURL(v,he),he&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(nt)>=0&&(J.method=nt,J.keyFormat=rt,Ue&&(J.keyID=Ue),Ne&&(J.keyFormatVersions=Ne),J.iv=Re));break}case"START":{var dt=new I.AttrList(ae),at=dt.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(at)&&(E.startTimeOffset=at);break}case"MAP":{var bt=new I.AttrList(ae);H.relurl=bt.URI,bt.BYTERANGE&&H.setByteRange(bt.BYTERANGE),H.level=h,H.sn="initSegment",J&&(H.levelkey=J),H.initSegment=null,j=H,me=!0;break}case"SERVER-CONTROL":{var gt=new I.AttrList(ae);E.canBlockReload=gt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=gt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&gt.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=gt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=gt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var xt=new I.AttrList(ae);E.partTarget=xt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Je=E.partList;Je||(Je=E.partList=[]);var kt=T>0?Je[Je.length-1]:void 0,Ot=T++,tt=new G.Part(new I.AttrList(ae),H,v,Ot,kt);Je.push(tt),H.duration+=tt.duration;break}case"PRELOAD-HINT":{var ft=new I.AttrList(ae);E.preloadHint=ft;break}case"RENDITION-REPORT":{var be=new I.AttrList(ae);E.renditionReports=E.renditionReports||[],E.renditionReports.push(be);break}default:b.logger.warn("line parsed but not handled: "+X);break}}}x&&!x.relurl?(w.pop(),N-=x.duration,E.partList&&(E.fragmentHint=x)):E.partList&&(S(H,x),H.cc=_,E.fragmentHint=H);var Ee=w.length,ge=w[0],de=w[Ee-1];if(N+=E.skippedSegments*E.targetduration,N>0&&Ee&&de){E.averagetargetduration=N/Ee;var fe=de.sn;E.endSN=fe!=="initSegment"?fe:0,ge&&(E.startCC=ge.cc,ge.initSegment||E.fragments.every(function(we){return we.relurl&&u(we.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new G.Fragment(d,v),H.relurl=de.relurl,H.level=h,H.sn="initSegment",ge.initSegment=H,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(N+=E.fragmentHint.duration),E.totalduration=N,E.endCC=_,ce>0&&A(w,ce),E},R}();function i(R,O){["video","audio","text"].forEach(function(m){var v=R.filter(function(d){return Object(f.isCodecType)(d,m)});if(v.length){var h=v.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});O[m+"Codec"]=h.length>0?h[0]:v[0],R=R.filter(function(d){return v.indexOf(d)===-1})}}),O.unknownCodecs=R}function D(R,O,m){var v=O[m];v&&(R[m]=v)}function A(R,O){for(var m=R[O],v=O;v--;){var h=R[v];if(!h)return;h.programDateTime=m.programDateTime-h.duration*1e3,m=h}}function S(R,O){R.rawProgramDateTime?R.programDateTime=Date.parse(R.rawProgramDateTime):O!=null&&O.programDateTime&&(R.programDateTime=O.endProgramDateTime),Object(z.isFiniteNumber)(R.programDateTime)||(R.programDateTime=null,R.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/polyfills/number.ts"),P=M("./src/events.ts"),F=M("./src/errors.ts"),G=M("./src/utils/logger.ts"),K=M("./src/utils/mp4-tools.ts"),n=M("./src/loader/m3u8-parser.ts"),I=M("./src/types/loader.ts"),b=M("./src/utils/attr-list.ts");function f(a){var p=a.type;switch(p){case I.PlaylistContextType.AUDIO_TRACK:return I.PlaylistLevelType.AUDIO;case I.PlaylistContextType.SUBTITLE_TRACK:return I.PlaylistLevelType.SUBTITLE;default:return I.PlaylistLevelType.MAIN}}function y(a,p){var l=a.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var c=function(){function a(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=a.prototype;return p.registerListeners=function(){var u=this.hls;u.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var u=this.hls;u.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(P.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(P.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(u){var s=this.hls.config,i=s.pLoader,D=s.loader,A=i||D,S=new A(s);return u.loader=S,this.loaders[u.type]=S,S},p.getInternalLoader=function(u){return this.loaders[u.type]},p.resetInternalLoader=function(u){this.loaders[u]&&delete this.loaders[u]},p.destroyInternalLoaders=function(){for(var u in this.loaders){var s=this.loaders[u];s&&s.destroy(),this.resetInternalLoader(u)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(u,s){var i=s.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:I.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},p.onLevelLoading=function(u,s){var i=s.id,D=s.level,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:null,level:D,responseType:"text",type:I.PlaylistContextType.LEVEL,url:A,deliveryDirectives:S})},p.onAudioTrackLoading=function(u,s){var i=s.id,D=s.groupId,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:I.PlaylistContextType.AUDIO_TRACK,url:A,deliveryDirectives:S})},p.onSubtitleTrackLoading=function(u,s){var i=s.id,D=s.groupId,A=s.url,S=s.deliveryDirectives;this.load({id:i,groupId:D,level:null,responseType:"text",type:I.PlaylistContextType.SUBTITLE_TRACK,url:A,deliveryDirectives:S})},p.load=function(u){var s,i=this.hls.config,D=this.getInternalLoader(u);if(D){var A=D.context;if(A&&A.url===u.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+u.type),D.abort()}var S,R,O,m;switch(u.type){case I.PlaylistContextType.MANIFEST:S=i.manifestLoadingMaxRetry,R=i.manifestLoadingTimeOut,O=i.manifestLoadingRetryDelay,m=i.manifestLoadingMaxRetryTimeout;break;case I.PlaylistContextType.LEVEL:case I.PlaylistContextType.AUDIO_TRACK:case I.PlaylistContextType.SUBTITLE_TRACK:S=0,R=i.levelLoadingTimeOut;break;default:S=i.levelLoadingMaxRetry,R=i.levelLoadingTimeOut,O=i.levelLoadingRetryDelay,m=i.levelLoadingMaxRetryTimeout;break}if(D=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var v;if(u.type===I.PlaylistContextType.LEVEL&&u.level!==null?v=this.hls.levels[u.level].details:u.type===I.PlaylistContextType.AUDIO_TRACK&&u.id!==null?v=this.hls.audioTracks[u.id].details:u.type===I.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(v=this.hls.subtitleTracks[u.id].details),v){var h=v.partTarget,d=v.targetduration;h&&d&&(R=Math.min(Math.max(h*3,d*.8)*1e3,R))}}var C={timeout:R,maxRetry:S,retryDelay:O,maxRetryDelay:m,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};D.load(u,C,E)},p.loadsuccess=function(u,s,i,D){if(D===void 0&&(D=null),i.isSidxRequest){this.handleSidxRequest(u,i),this.handlePlaylistLoaded(u,s,i,D);return}this.resetInternalLoader(i.type);var A=u.data;if(A.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(u,i,"no EXTM3U delimiter",D);return}s.parsing.start=performance.now(),A.indexOf("#EXTINF:")>0||A.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(u,s,i,D):this.handleMasterPlaylist(u,s,i,D)},p.loaderror=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!1,u)},p.loadtimeout=function(u,s,i){i===void 0&&(i=null),this.handleNetworkError(s,i,!0)},p.handleMasterPlaylist=function(u,s,i,D){var A=this.hls,S=u.data,R=y(u,i),O=n.default.parseMasterPlaylist(S,R),m=O.levels,v=O.sessionData;if(!m.length){this.handleManifestParsingError(u,i,"no level found in manifest",D);return}var h=m.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),d=m.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),C=n.default.parseMasterPlaylistMedia(S,R,"AUDIO",h),E=n.default.parseMasterPlaylistMedia(S,R,"SUBTITLES",d),w=n.default.parseMasterPlaylistMedia(S,R,"CLOSED-CAPTIONS");if(C.length){var j=C.some(function(W){return!W.url});!j&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(G.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}A.trigger(P.Events.MANIFEST_LOADED,{levels:m,audioTracks:C,subtitles:E,captions:w,url:R,stats:s,networkDetails:D,sessionData:v})},p.handleTrackOrLevelPlaylist=function(u,s,i,D){var A=this.hls,S=i.id,R=i.level,O=i.type,m=y(u,i),v=Object(z.isFiniteNumber)(S)?S:0,h=Object(z.isFiniteNumber)(R)?R:v,d=f(i),C=n.default.parseLevelPlaylist(u.data,m,h,d,v);if(!C.fragments.length){A.trigger(P.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(O===I.PlaylistContextType.MANIFEST){var E={attrs:new b.AttrList({}),bitrate:0,details:C,name:"",url:m};A.trigger(P.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:m,stats:s,networkDetails:D,sessionData:null})}if(s.parsing.end=performance.now(),C.needSidxRanges){var w,j=(w=C.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:j,isSidxRequest:!0,type:O,level:R,levelDetails:C,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}i.levelDetails=C,this.handlePlaylistLoaded(u,s,i,D)},p.handleSidxRequest=function(u,s){var i=Object(K.parseSegmentIndex)(new Uint8Array(u.data));if(!i)return;var D=i.references,A=s.levelDetails;D.forEach(function(S,R){var O=S.info,m=A.fragments[R];m.byteRange.length===0&&m.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),m.initSegment&&m.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(u,s,i,D){this.hls.trigger(P.Events.ERROR,{type:F.ErrorTypes.NETWORK_ERROR,details:F.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===I.PlaylistContextType.MANIFEST,url:u.url,reason:i,response:u,context:s,networkDetails:D})},p.handleNetworkError=function(u,s,i,D){i===void 0&&(i=!1),G.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+u.type+" level: "+u.level+" id: "+u.id+' group-id: "'+u.groupId+'"');var A=F.ErrorDetails.UNKNOWN,S=!1,R=this.getInternalLoader(u);switch(u.type){case I.PlaylistContextType.MANIFEST:A=i?F.ErrorDetails.MANIFEST_LOAD_TIMEOUT:F.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case I.PlaylistContextType.LEVEL:A=i?F.ErrorDetails.LEVEL_LOAD_TIMEOUT:F.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case I.PlaylistContextType.AUDIO_TRACK:A=i?F.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:F.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case I.PlaylistContextType.SUBTITLE_TRACK:A=i?F.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:F.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}R&&this.resetInternalLoader(u.type);var O={type:F.ErrorTypes.NETWORK_ERROR,details:A,fatal:S,url:u.url,loader:R,context:u,networkDetails:s};D&&(O.response=D),this.hls.trigger(P.Events.ERROR,O)},p.handlePlaylistLoaded=function(u,s,i,D){var A=i.type,S=i.level,R=i.id,O=i.groupId,m=i.loader,v=i.levelDetails,h=i.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",D);return}if(!m)return;v.live&&(m.getCacheAge&&(v.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(A){case I.PlaylistContextType.MANIFEST:case I.PlaylistContextType.LEVEL:this.hls.trigger(P.Events.LEVEL_LOADED,{details:v,level:S||0,id:R||0,stats:s,networkDetails:D,deliveryDirectives:h});break;case I.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(P.Events.AUDIO_TRACK_LOADED,{details:v,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:h});break;case I.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADED,{details:v,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:h});break}},a}();Y.default=c},"./src/polyfills/number.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"isFiniteNumber",function(){return z}),M.d(Y,"MAX_SAFE_INTEGER",function(){return P});var z=Number.isFinite||function(F){return typeof F=="number"&&isFinite(F)},P=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ne,Y,M){"use strict";M.r(Y);var z=function(){function P(){}return P.getSilentFrame=function(G,K){switch(G){case"mp4a.40.2":if(K===1)return new Uint8Array([0,200,0,128,35,128]);if(K===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(K===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(K===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(K===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(K===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(K===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(K===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(K===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}return},P}();Y.default=z},"./src/remux/mp4-generator.ts":function(ne,Y,M){"use strict";M.r(Y);var z=Math.pow(2,32)-1,P=function(){function F(){}return F.init=function(){F.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var K;for(K in F.types)F.types.hasOwnProperty(K)&&(F.types[K]=[K.charCodeAt(0),K.charCodeAt(1),K.charCodeAt(2),K.charCodeAt(3)]);var n=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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]);F.HDLR_TYPES={video:n,audio:I};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);F.STTS=F.STSC=F.STCO=f,F.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),F.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),F.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),F.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var y=new Uint8Array([105,115,111,109]),c=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);F.FTYP=F.box(F.types.ftyp,y,a,y,c),F.DINF=F.box(F.types.dinf,F.box(F.types.dref,b))},F.box=function(K){for(var n=8,I=arguments.length,b=new Array(I>1?I-1:0),f=1;f<I;f++)b[f-1]=arguments[f];for(var y=b.length,c=y;y--;)n+=b[y].byteLength;var a=new Uint8Array(n);for(a[0]=n>>24&255,a[1]=n>>16&255,a[2]=n>>8&255,a[3]=n&255,a.set(K,4),y=0,n=8;y<c;y++)a.set(b[y],n),n+=b[y].byteLength;return a},F.hdlr=function(K){return F.box(F.types.hdlr,F.HDLR_TYPES[K])},F.mdat=function(K){return F.box(F.types.mdat,K)},F.mdhd=function(K,n){n*=K;var I=Math.floor(n/(z+1)),b=Math.floor(n%(z+1));return F.box(F.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,K>>24&255,K>>16&255,K>>8&255,K&255,I>>24,I>>16&255,I>>8&255,I&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},F.mdia=function(K){return F.box(F.types.mdia,F.mdhd(K.timescale,K.duration),F.hdlr(K.type),F.minf(K))},F.mfhd=function(K){return F.box(F.types.mfhd,new Uint8Array([0,0,0,0,K>>24,K>>16&255,K>>8&255,K&255]))},F.minf=function(K){return K.type==="audio"?F.box(F.types.minf,F.box(F.types.smhd,F.SMHD),F.DINF,F.stbl(K)):F.box(F.types.minf,F.box(F.types.vmhd,F.VMHD),F.DINF,F.stbl(K))},F.moof=function(K,n,I){return F.box(F.types.moof,F.mfhd(K),F.traf(I,n))},F.moov=function(K){for(var n=K.length,I=[];n--;)I[n]=F.trak(K[n]);return F.box.apply(null,[F.types.moov,F.mvhd(K[0].timescale,K[0].duration)].concat(I).concat(F.mvex(K)))},F.mvex=function(K){for(var n=K.length,I=[];n--;)I[n]=F.trex(K[n]);return F.box.apply(null,[F.types.mvex].concat(I))},F.mvhd=function(K,n){n*=K;var I=Math.floor(n/(z+1)),b=Math.floor(n%(z+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,K>>24&255,K>>16&255,K>>8&255,K&255,I>>24,I>>16&255,I>>8&255,I&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return F.box(F.types.mvhd,f)},F.sdtp=function(K){var n=K.samples||[],I=new Uint8Array(4+n.length),b,f;for(b=0;b<n.length;b++)f=n[b].flags,I[b+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return F.box(F.types.sdtp,I)},F.stbl=function(K){return F.box(F.types.stbl,F.stsd(K),F.box(F.types.stts,F.STTS),F.box(F.types.stsc,F.STSC),F.box(F.types.stsz,F.STSZ),F.box(F.types.stco,F.STCO))},F.avc1=function(K){var n=[],I=[],b,f,y;for(b=0;b<K.sps.length;b++)f=K.sps[b],y=f.byteLength,n.push(y>>>8&255),n.push(y&255),n=n.concat(Array.prototype.slice.call(f));for(b=0;b<K.pps.length;b++)f=K.pps[b],y=f.byteLength,I.push(y>>>8&255),I.push(y&255),I=I.concat(Array.prototype.slice.call(f));var c=F.box(F.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|K.sps.length].concat(n).concat([K.pps.length]).concat(I))),a=K.width,p=K.height,l=K.pixelRatio[0],u=K.pixelRatio[1];return F.box(F.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,p>>8&255,p&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),c,F.box(F.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),F.box(F.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},F.esds=function(K){var n=K.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(K.config).concat([6,1,2]))},F.mp4a=function(K){var n=K.samplerate;return F.box(F.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,K.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),F.box(F.types.esds,F.esds(K)))},F.mp3=function(K){var n=K.samplerate;return F.box(F.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,K.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},F.stsd=function(K){return K.type==="audio"?!K.isAAC&&K.codec==="mp3"?F.box(F.types.stsd,F.STSD,F.mp3(K)):F.box(F.types.stsd,F.STSD,F.mp4a(K)):F.box(F.types.stsd,F.STSD,F.avc1(K))},F.tkhd=function(K){var n=K.id,I=K.duration*K.timescale,b=K.width,f=K.height,y=Math.floor(I/(z+1)),c=Math.floor(I%(z+1));return F.box(F.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,n&255,0,0,0,0,y>>24,y>>16&255,y>>8&255,y&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,b>>8&255,b&255,0,0,f>>8&255,f&255,0,0]))},F.traf=function(K,n){var I=F.sdtp(K),b=K.id,f=Math.floor(n/(z+1)),y=Math.floor(n%(z+1));return F.box(F.types.traf,F.box(F.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),F.box(F.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,y>>24,y>>16&255,y>>8&255,y&255])),F.trun(K,I.length+16+20+8+16+8+8),I)},F.trak=function(K){return K.duration=K.duration||4294967295,F.box(F.types.trak,F.tkhd(K),F.mdia(K))},F.trex=function(K){var n=K.id;return F.box(F.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},F.trun=function(K,n){var I=K.samples||[],b=I.length,f=12+16*b,y=new Uint8Array(f),c,a,p,l,u,s;for(n+=8+f,y.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),c=0;c<b;c++)a=I[c],p=a.duration,l=a.size,u=a.flags,s=a.cts,y.set([p>>>24&255,p>>>16&255,p>>>8&255,p&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&240<<8,u.degradPrio&15,s>>>24&255,s>>>16&255,s>>>8&255,s&255],12+16*c);return F.box(F.types.trun,y)},F.initSegment=function(K){F.types||F.init();var n=F.moov(K),I=new Uint8Array(F.FTYP.byteLength+n.byteLength);return I.set(F.FTYP),I.set(n,F.FTYP.byteLength),I},F}();P.types=void 0,P.HDLR_TYPES=void 0,P.STTS=void 0,P.STSC=void 0,P.STCO=void 0,P.STSZ=void 0,P.VMHD=void 0,P.SMHD=void 0,P.STSD=void 0,P.FTYP=void 0,P.DINF=void 0,Y.default=P},"./src/remux/mp4-remuxer.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return s}),M.d(Y,"normalizePts",function(){return i});var z=M("./src/polyfills/number.ts"),P=M("./src/remux/aac-helper.ts"),F=M("./src/remux/mp4-generator.ts"),G=M("./src/events.ts"),K=M("./src/errors.ts"),n=M("./src/utils/logger.ts"),I=M("./src/types/loader.ts"),b=M("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var O=1;O<arguments.length;O++){var m=arguments[O];for(var v in m)Object.prototype.hasOwnProperty.call(m,v)&&(R[v]=m[v])}return R},f.apply(this,arguments)}var y=10*1e3,c=1024,a=1152,p=null,l=null,u=!1,s=function(){function R(m,v,h,d){if(d===void 0&&(d=""),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=m,this.config=v,this.typeSupported=h,this.ISGenerated=!1,p===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);p=E?parseInt(E[1]):0}if(l===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);l=w?parseInt(w[1]):0}u=!!p&&p<75||!!l&&l<600}var O=R.prototype;return O.destroy=function(){},O.resetTimeStamp=function(v){n.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=v},O.resetNextTimestamp=function(){n.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},O.resetInitSegment=function(){n.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},O.getVideoStartPts=function(v){var h=!1,d=v.reduce(function(C,E){var w=E.pts-C;return w<-4294967296?(h=!0,i(C,E.pts)):w>0?C:E.pts},v[0].pts);return h&&n.logger.debug("PTS rollover detected"),d},O.remux=function(v,h,d,C,E,w,j,W){var T,N,_,x,H,X,ee=E,J=E,ce=v.pid>-1,me=h.pid>-1,ue=h.samples.length,pe=v.samples.length>0,xe=ue>1,se=(!ce||pe)&&(!me||xe)||this.ISGenerated||j;if(se){this.ISGenerated||(_=this.generateIS(v,h,E));var ae=this.isVideoContiguous,Ce=-1;if(xe&&(Ce=D(h.samples),!ae&&this.config.forceKeyFrameOnDiscontinuity))if(X=!0,Ce>0){n.logger.warn("[mp4-remuxer]: Dropped "+Ce+" out of "+ue+" video samples due to a missing keyframe");var ze=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(Ce),h.dropped+=Ce,J+=(h.samples[0].pts-ze)/(h.timescale||9e4)}else Ce===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),X=!1);if(this.ISGenerated){if(pe&&xe){var Ye=this.getVideoStartPts(h.samples),He=i(v.samples[0].pts,Ye)-Ye,Ve=He/h.inputTimeScale;ee+=Math.max(0,Ve),J+=Math.max(0,-Ve)}if(pe){if(v.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),_=this.generateIS(v,h,E)),N=this.remuxAudio(v,ee,this.isAudioContiguous,w,me||xe||W===I.PlaylistLevelType.AUDIO?J:void 0),xe){var Fe=N?N.endPTS-N.startPTS:0;h.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),_=this.generateIS(v,h,E)),T=this.remuxVideo(h,J,ae,Fe)}}else xe&&(T=this.remuxVideo(h,J,ae,0));T&&(T.firstKeyFrame=Ce,T.independent=Ce!==-1)}}return this.ISGenerated&&(d.samples.length&&(H=this.remuxID3(d,E)),C.samples.length&&(x=this.remuxText(C,E))),{audio:N,video:T,initSegment:_,independent:X,text:x,id3:H}},O.generateIS=function(v,h,d){var C=v.samples,E=h.samples,w=this.typeSupported,j={},W=!Object(z.isFiniteNumber)(this._initPTS),T="audio/mp4",N,_,x;if(W&&(N=_=Infinity),v.config&&C.length&&(v.timescale=v.samplerate,v.isAAC||(w.mpeg?(T="audio/mpeg",v.codec=""):w.mp3&&(v.codec="mp3")),j.audio={id:"audio",container:T,codec:v.codec,initSegment:!v.isAAC&&w.mpeg?new Uint8Array(0):F.default.initSegment([v]),metadata:{channelCount:v.channelCount}},W&&(x=v.inputTimeScale,N=_=C[0].pts-Math.round(x*d))),h.sps&&h.pps&&E.length&&(h.timescale=h.inputTimeScale,j.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:F.default.initSegment([h]),metadata:{width:h.width,height:h.height}},W)){x=h.inputTimeScale;var H=this.getVideoStartPts(E),X=Math.round(x*d);_=Math.min(_,i(E[0].dts,H)-X),N=Math.min(N,H-X)}if(Object.keys(j).length)return this.ISGenerated=!0,W&&(this._initPTS=N,this._initDTS=_),{tracks:j,initPTS:N,timescale:x}},O.remuxVideo=function(v,h,d,C){var E=v.inputTimeScale,w=v.samples,j=[],W=w.length,T=this._initPTS,N=this.nextAvcDts,_=8,x,H,X,ee=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,ce=0,me=!1;if(!d||N===null){var ue=h*E,pe=w[0].pts-i(w[0].dts,w[0].pts);N=ue-pe}for(var xe=0;xe<W;xe++){var se=w[xe];if(se.pts=i(se.pts-T,N),se.dts=i(se.dts-T,N),se.dts>se.pts){var ae=9e4*.2;ce=Math.max(Math.min(ce,se.pts-se.dts),-1*ae)}se.dts<w[xe>0?xe-1:xe].dts&&(me=!0)}me&&w.sort(function(_n,bn){var Kt=_n.dts-bn.dts,rr=_n.pts-bn.pts;return Kt||rr}),H=w[0].dts,X=w[w.length-1].dts;var Ce=Math.round((X-H)/(W-1));if(ce<0){if(ce<Ce*-2){n.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(b.toMsFromMpegTsClock)(-Ce,!0)+" ms");for(var ze=ce,Ye=0;Ye<W;Ye++)w[Ye].dts=ze=Math.max(ze,w[Ye].pts-Ce),w[Ye].pts=Math.max(ze,w[Ye].pts)}else{n.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(b.toMsFromMpegTsClock)(ce,!0)+" ms to overcome this issue");for(var He=0;He<W;He++)w[He].dts=w[He].dts+ce}H=w[0].dts}if(d){var Ve=H-N,Fe=Ve>Ce,Ke=Ve<-1;if(Fe||Ke){Fe?n.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(Ve,!0)+" ms ("+Ve+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-Ve,!0)+" ms ("+Ve+"dts) overlapping between fragments detected"),H=N;var nt=w[0].pts-Ve;w[0].dts=H,w[0].pts=nt,n.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(nt,!0)+"/"+Object(b.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(Ve,!0)+" ms")}}u&&(H=Math.max(0,H));for(var he=0,Re=0,Ne=0;Ne<W;Ne++){for(var Ue=w[Ne],rt=Ue.units,st=rt.length,dt=0,at=0;at<st;at++)dt+=rt[at].data.length;Re+=dt,he+=st,Ue.length=dt,Ue.dts=Math.max(Ue.dts,H),Ue.pts=Math.max(Ue.pts,Ue.dts,0),ee=Math.min(Ue.pts,ee),J=Math.max(Ue.pts,J)}X=w[W-1].dts;var bt=Re+4*he+8,gt;try{gt=new Uint8Array(bt)}catch(_n){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:bt,reason:"fail allocating video mdat "+bt});return}var xt=new DataView(gt.buffer);xt.setUint32(0,bt),gt.set(F.default.types.mdat,4);for(var Je=0;Je<W;Je++){for(var kt=w[Je],Ot=kt.units,tt=0,ft=0,be=Ot.length;ft<be;ft++){var Ee=Ot[ft],ge=Ee.data,de=Ee.data.byteLength;xt.setUint32(_,de),_+=4,gt.set(ge,_),_+=de,tt+=4+de}if(Je<W-1)x=w[Je+1].dts-kt.dts;else{var fe=this.config,we=kt.dts-w[Je>0?Je-1:Je].dts;if(fe.stretchShortVideoTrack&&this.nextAudioPts!==null){var De=Math.floor(fe.maxBufferHole*E),ke=(C?ee+C*E:this.nextAudioPts)-kt.pts;ke>De?(x=ke-we,x<0&&(x=we),n.logger.log("[mp4-remuxer]: It is approximately "+ke/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=we}else x=we}var Ze=Math.round(kt.pts-kt.dts);j.push(new A(kt.key,x,tt,Ze))}if(j.length&&p&&p<70){var ht=j[0].flags;ht.dependsOn=2,ht.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=N=X+x,this.isVideoContiguous=!0;var Ut=F.default.moof(v.sequenceNumber++,H,f({},v,{samples:j})),nn="video",tn={data1:Ut,data2:gt,startPTS:ee/E,endPTS:(J+x)/E,startDTS:H/E,endDTS:N/E,type:nn,hasAudio:!1,hasVideo:!0,nb:j.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(gt.length,"MDAT length must not be zero"),tn},O.remuxAudio=function(v,h,d,C,E){var w=v.inputTimeScale,j=v.samplerate?v.samplerate:w,W=w/j,T=v.isAAC?c:a,N=T*W,_=this._initPTS,x=!v.isAAC&&this.typeSupported.mpeg,H=[],X=v.samples,ee=x?0:8,J=this.nextAudioPts||-1,ce=h*w;if(this.isAudioContiguous=d=d||X.length&&J>0&&(C&&Math.abs(ce-J)<9e3||Math.abs(i(X[0].pts-_,ce)-J)<20*N),X.forEach(function(ge){ge.pts=i(ge.pts-_,ce)}),!d||J<0){if(X=X.filter(function(ge){return ge.pts>=0}),!X.length)return;E===0?J=0:C?J=Math.max(0,ce):J=X[0].pts}if(v.isAAC)for(var me=E!==void 0,ue=this.config.maxAudioFramesDrift,pe=0,xe=J;pe<X.length;pe++){var se=X[pe],ae=se.pts,Ce=ae-xe,ze=Math.abs(1e3*Ce/w);if(Ce<=-ue*N&&me)pe===0&&(n.logger.warn("Audio frame @ "+(ae/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Ce/w)+" ms."),this.nextAudioPts=J=xe=ae);else if(Ce>=ue*N&&ze<y&&me){var Ye=Math.round(Ce/N);xe=ae-Ye*N,xe<0&&(Ye--,xe+=N),pe===0&&(this.nextAudioPts=J=xe),n.logger.warn("[mp4-remuxer]: Injecting "+Ye+" audio frame @ "+(xe/w).toFixed(3)+"s due to "+Math.round(1e3*Ce/w)+" ms gap.");for(var He=0;He<Ye;He++){var Ve=Math.max(xe,0),Fe=P.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);Fe||(n.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Fe=se.unit.subarray()),X.splice(pe,0,{unit:Fe,pts:Ve}),xe+=N,pe++}}se.pts=xe,xe+=N}for(var Ke=null,nt=null,he,Re=0,Ne=X.length;Ne--;)Re+=X[Ne].unit.byteLength;for(var Ue=0,rt=X.length;Ue<rt;Ue++){var st=X[Ue],dt=st.unit,at=st.pts;if(nt!==null){var bt=H[Ue-1];bt.duration=Math.round((at-nt)/W)}else if(d&&v.isAAC&&(at=J),Ke=at,Re>0){Re+=ee;try{he=new Uint8Array(Re)}catch(ge){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Re,reason:"fail allocating audio mdat "+Re});return}if(!x){var gt=new DataView(he.buffer);gt.setUint32(0,Re),he.set(F.default.types.mdat,4)}}else return;he.set(dt,ee);var xt=dt.byteLength;ee+=xt,H.push(new A(!0,T,xt,0)),nt=at}var Je=H.length;if(!Je)return;var kt=H[H.length-1];this.nextAudioPts=J=nt+W*kt.duration;var Ot=x?new Uint8Array(0):F.default.moof(v.sequenceNumber++,Ke/W,f({},v,{samples:H}));v.samples=[];var tt=Ke/w,ft=J/w,be="audio",Ee={data1:Ot,data2:he,startPTS:tt,endPTS:ft,startDTS:tt,endDTS:ft,type:be,hasAudio:!0,hasVideo:!1,nb:Je};return this.isAudioContiguous=!0,console.assert(he.length,"MDAT length must not be zero"),Ee},O.remuxEmptyAudio=function(v,h,d,C){var E=v.inputTimeScale,w=v.samplerate?v.samplerate:E,j=E/w,W=this.nextAudioPts,T=(W!==null?W:C.startDTS*E)+this._initDTS,N=C.endDTS*E+this._initDTS,_=j*c,x=Math.ceil((N-T)/_),H=P.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(n.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){n.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var X=[],ee=0;ee<x;ee++){var J=T+ee*_;X.push({unit:H,pts:J,dts:J})}return v.samples=X,this.remuxAudio(v,h,d,!1)},O.remuxID3=function(v,h){var d=v.samples.length;if(!d)return;for(var C=v.inputTimeScale,E=this._initPTS,w=this._initDTS,j=0;j<d;j++){var W=v.samples[j];W.pts=i(W.pts-E,h*C)/C,W.dts=i(W.dts-w,h*C)/C}var T=v.samples;return v.samples=[],{samples:T}},O.remuxText=function(v,h){var d=v.samples.length;if(!d)return;for(var C=v.inputTimeScale,E=this._initPTS,w=0;w<d;w++){var j=v.samples[w];j.pts=i(j.pts-E,h*C)/C}v.samples.sort(function(T,N){return T.pts-N.pts});var W=v.samples;return v.samples=[],{samples:W}},R}();function i(R,O){var m;if(O===null)return R;for(O<R?m=-8589934592:m=8589934592;Math.abs(R-O)>4294967296;)R+=m;return R}function D(R){for(var O=0;O<R.length;O++)if(R[O].key)return O;return-1}var A=function(O,m,v,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=m,this.size=v,this.cts=h,this.flags=new S(O)},S=function(O){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=O?2:1,this.isNonSync=O?0:1}},"./src/remux/passthrough-remuxer.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/polyfills/number.ts"),P=M("./src/utils/mp4-tools.ts"),F=M("./src/loader/fragment.ts"),G=M("./src/utils/logger.ts"),K=function(){function b(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var f=b.prototype;return f.destroy=function(){},f.resetTimeStamp=function(c){this.initPTS=c,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(c,a,p){this.audioCodec=a,this.videoCodec=p,this.generateInitSegment(c),this.emitInitSegment=!0},f.generateInitSegment=function(c){var a=this.audioCodec,p=this.videoCodec;if(!c||!c.byteLength){this.initTracks=void 0,this.initData=void 0;return}var l=this.initData=Object(P.parseInitSegment)(c);a||(a=I(l.audio,F.ElementaryStreamTypes.AUDIO)),p||(p=I(l.video,F.ElementaryStreamTypes.VIDEO));var u={};l.audio&&l.video?u.audiovideo={container:"video/mp4",codec:a+","+p,initSegment:c,id:"main"}:l.audio?u.audio={container:"audio/mp4",codec:a,initSegment:c,id:"audio"}:l.video?u.video={container:"video/mp4",codec:p,initSegment:c,id:"main"}:G.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},f.remux=function(c,a,p,l,u){var s=this.initPTS,i=this.lastEndDTS,D={audio:void 0,video:void 0,text:l,id3:p,initSegment:void 0};Object(z.isFiniteNumber)(i)||(i=this.lastEndDTS=u||0);var A=a.samples;if(!A||!A.length)return D;var S={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(A),R=this.initData),!R||!R.length)return G.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),D;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(z.isFiniteNumber)(s)||(this.initPTS=S.initPTS=s=n(R,A,i));var O=Object(P.getDuration)(A,R),m=i,v=O+m;Object(P.offsetStartDTS)(R,A,s),O>0?this.lastEndDTS=v:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!R.audio,d=!!R.video,C="";h&&(C+="audio"),d&&(C+="video");var E={data1:A,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:C,hasAudio:h,hasVideo:d,nb:1,dropped:0};return D.audio=E.type==="audio"?E:void 0,D.video=E.type!=="audio"?E:void 0,D.text=l,D.id3=p,D.initSegment=S,D},b}(),n=function(f,y,c){return Object(P.getStartDTS)(f,y)-c};function I(b,f){var y=b==null?void 0:b.codec;return y&&y.length>4?y:y==="hvc1"?"hvc1.1.c.L120.90":y==="av01"?"av01.0.04M.08":y==="avc1"||f===F.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=K},"./src/task-loop.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return z});var z=function(){function P(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var F=P.prototype;return F.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},F.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},F.onHandlerDestroyed=function(){},F.hasInterval=function(){return!!this._tickInterval},F.hasNextTick=function(){return!!this._tickTimer},F.setInterval=function(K){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,K),!0)},F.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},F.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},F.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},F.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},F.doTick=function(){},P}()},"./src/types/cmcd.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"CMCDVersion",function(){return z}),M.d(Y,"CMCDObjectType",function(){return P}),M.d(Y,"CMCDStreamingFormat",function(){return F}),M.d(Y,"CMCDStreamType",function(){return G});var z=1,P;(function(K){K.MANIFEST="m",K.AUDIO="a",K.VIDEO="v",K.MUXED="av",K.INIT="i",K.CAPTION="c",K.TIMED_TEXT="tt",K.KEY="k",K.OTHER="o"})(P||(P={}));var F;(function(K){K.DASH="d",K.HLS="h",K.SMOOTH="s",K.OTHER="o"})(F||(F={}));var G;(function(K){K.VOD="v",K.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"HlsSkip",function(){return F}),M.d(Y,"getSkipValue",function(){return G}),M.d(Y,"HlsUrlParameters",function(){return K}),M.d(Y,"Level",function(){return n});function z(I,b){for(var f=0;f<b.length;f++){var y=b[f];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(I,y.key,y)}}function P(I,b,f){return b&&z(I.prototype,b),f&&z(I,f),I}var F;(function(I){I.No="",I.Yes="YES",I.v2="v2"})(F||(F={}));function G(I,b){var f=I.canSkipUntil,y=I.canSkipDateRanges,c=I.endSN,a=b!==void 0?b-c:0;return f&&a<f?y?F.v2:F.Yes:F.No}var K=function(){function I(f,y,c){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=y,this.skip=c}var b=I.prototype;return b.addDirectives=function(y){var c=new self.URL(y);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}(),n=function(){function I(b){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[b.url],this.attrs=b.attrs,this.bitrate=b.bitrate,b.details&&(this.details=b.details),this.id=b.id||0,this.name=b.name,this.width=b.width||0,this.height=b.height||0,this.audioCodec=b.audioCodec,this.videoCodec=b.videoCodec,this.unknownCodecs=b.unknownCodecs,this.codecSet=[b.videoCodec,b.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return P(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(f){var y=f%this.url.length;this._urlId!==y&&(this.details=void 0,this._urlId=y)}}]),I}()},"./src/types/loader.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"PlaylistContextType",function(){return z}),M.d(Y,"PlaylistLevelType",function(){return P});var z;(function(F){F.MANIFEST="manifest",F.LEVEL="level",F.AUDIO_TRACK="audioTrack",F.SUBTITLE_TRACK="subtitleTrack"})(z||(z={}));var P;(function(F){F.MAIN="main",F.AUDIO="audio",F.SUBTITLE="subtitle"})(P||(P={}))},"./src/types/transmuxer.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"ChunkMetadata",function(){return z});var z=function(G,K,n,I,b,f){I===void 0&&(I=0),b===void 0&&(b=-1),f===void 0&&(f=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=P(),this.buffering={audio:P(),video:P(),audiovideo:P()},this.level=G,this.sn=K,this.id=n,this.size=I,this.part=b,this.partial=f};function P(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"AttrList",function(){return F});var z=/^(\d+)x(\d+)$/,P=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,F=function(){function G(n){typeof n=="string"&&(n=G.parseAttrList(n));for(var I in n)n.hasOwnProperty(I)&&(this[I]=n[I])}var K=G.prototype;return K.decimalInteger=function(I){var b=parseInt(this[I],10);return b>Number.MAX_SAFE_INTEGER?Infinity:b},K.hexadecimalInteger=function(I){if(this[I]){var b=(this[I]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var f=new Uint8Array(b.length/2),y=0;y<b.length/2;y++)f[y]=parseInt(b.slice(y*2,y*2+2),16);return f}else return null},K.hexadecimalIntegerAsNumber=function(I){var b=parseInt(this[I],16);return b>Number.MAX_SAFE_INTEGER?Infinity:b},K.decimalFloatingPoint=function(I){return parseFloat(this[I])},K.optionalFloat=function(I,b){var f=this[I];return f?parseFloat(f):b},K.enumeratedString=function(I){return this[I]},K.bool=function(I){return this[I]==="YES"},K.decimalResolution=function(I){var b=z.exec(this[I]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},G.parseAttrList=function(I){var b,f={},y='"';for(P.lastIndex=0;(b=P.exec(I))!==null;){var c=b[2];c.indexOf(y)===0&&c.lastIndexOf(y)===c.length-1&&(c=c.slice(1,-1)),f[b[1]]=c}return f},G}()},"./src/utils/binary-search.ts":function(ne,Y,M){"use strict";M.r(Y);var z={search:function(F,G){for(var K=0,n=F.length-1,I=null,b=null;K<=n;){I=(K+n)/2|0,b=F[I];var f=G(b);if(f>0)K=I+1;else if(f<0)n=I-1;else return b}return null}};Y.default=z},"./src/utils/buffer-helper.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"BufferHelper",function(){return F});var z=M("./src/utils/logger.ts"),P={length:0,start:function(){return 0},end:function(){return 0}},F=function(){function G(){}return G.isBuffered=function(n,I){try{if(n){for(var b=G.getBuffered(n),f=0;f<b.length;f++)if(I>=b.start(f)&&I<=b.end(f))return!0}}catch(y){}return!1},G.bufferInfo=function(n,I,b){try{if(n){var f=G.getBuffered(n),y=[],c;for(c=0;c<f.length;c++)y.push({start:f.start(c),end:f.end(c)});return this.bufferedInfo(y,I,b)}}catch(a){}return{len:0,start:I,end:I,nextStart:void 0}},G.bufferedInfo=function(n,I,b){I=Math.max(0,I),n.sort(function(S,R){var O=S.start-R.start;return O||R.end-S.end});var f=[];if(b)for(var y=0;y<n.length;y++){var c=f.length;if(c){var a=f[c-1].end;n[y].start-a<b?n[y].end>a&&(f[c-1].end=n[y].end):f.push(n[y])}else f.push(n[y])}else f=n;for(var p=0,l,u=I,s=I,i=0;i<f.length;i++){var D=f[i].start,A=f[i].end;if(I+b>=D&&I<A)u=D,s=A,p=s-I;else if(I+b<D){l=D;break}}return{len:p,start:u||0,end:s||0,nextStart:l}},G.getBuffered=function(n){try{return n.buffered}catch(I){return z.logger.log("failed to get media.buffered",I),P}},G}()},"./src/utils/cea-608-parser.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"Row",function(){return s}),M.d(Y,"CaptionScreen",function(){return i});var z=M("./src/utils/logger.ts"),P={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},F=function(v){var h=v;return P.hasOwnProperty(v)&&(h=P[v]),String.fromCharCode(h)},G=15,K=100,n={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},b={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},y=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],c;(function(m){m[m.ERROR=0]="ERROR",m[m.TEXT=1]="TEXT",m[m.WARNING=2]="WARNING",m[m.INFO=2]="INFO",m[m.DEBUG=3]="DEBUG",m[m.DATA=3]="DATA"})(c||(c={}));var a=function(){function m(){this.time=null,this.verboseLevel=c.ERROR}var v=m.prototype;return v.log=function(d,C){this.verboseLevel>=d&&z.logger.log(this.time+" ["+d+"] "+C)},m}(),p=function(v){for(var h=[],d=0;d<v.length;d++)h.push(v[d].toString(16));return h},l=function(){function m(h,d,C,E,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=d||!1,this.italics=C||!1,this.background=E||"black",this.flash=w||!1}var v=m.prototype;return v.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},v.setStyles=function(d){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var w=C[E];d.hasOwnProperty(w)&&(this[w]=d[w])}},v.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},v.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},v.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},v.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},m}(),u=function(){function m(h,d,C,E,w,j){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new l(d,C,E,w,j)}var v=m.prototype;return v.reset=function(){this.uchar=" ",this.penState.reset()},v.setChar=function(d,C){this.uchar=d,this.penState.copy(C)},v.setPenState=function(d){this.penState.copy(d)},v.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},v.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},v.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},m}(),s=function(){function m(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 d=0;d<K;d++)this.chars.push(new u);this.logger=h,this.pos=0,this.currPenState=new l}var v=m.prototype;return v.equals=function(d){for(var C=!0,E=0;E<K;E++)if(!this.chars[E].equals(d.chars[E])){C=!1;break}return C},v.copy=function(d){for(var C=0;C<K;C++)this.chars[C].copy(d.chars[C])},v.isEmpty=function(){for(var d=!0,C=0;C<K;C++)if(!this.chars[C].isEmpty()){d=!1;break}return d},v.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(c.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>K&&(this.logger.log(c.DEBUG,"Too large cursor position "+this.pos),this.pos=K)},v.moveCursor=function(d){var C=this.pos+d;if(d>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},v.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},v.insertChar=function(d){d>=144&&this.backSpace();var C=F(d);if(this.pos>=K){this.logger.log(c.ERROR,"Cannot insert "+d.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(d){var C;for(C=d;C<K;C++)this.chars[C].reset()},v.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},v.clearToEndOfRow=function(){this.clearFromPos(this.pos)},v.getTextString=function(){for(var d=[],C=!0,E=0;E<K;E++){var w=this.chars[E].uchar;w!==" "&&(C=!1),d.push(w)}return C?"":d.join("")},v.setPenStyles=function(d){this.currPenState.setStyles(d);var C=this.chars[this.pos];C.setPenState(this.currPenState)},m}(),i=function(){function m(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 d=0;d<G;d++)this.rows.push(new s(h));this.logger=h,this.currRow=G-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var v=m.prototype;return v.reset=function(){for(var d=0;d<G;d++)this.rows[d].clear();this.currRow=G-1},v.equals=function(d){for(var C=!0,E=0;E<G;E++)if(!this.rows[E].equals(d.rows[E])){C=!1;break}return C},v.copy=function(d){for(var C=0;C<G;C++)this.rows[C].copy(d.rows[C])},v.isEmpty=function(){for(var d=!0,C=0;C<G;C++)if(!this.rows[C].isEmpty()){d=!1;break}return d},v.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},v.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},v.insertChar=function(d){var C=this.rows[this.currRow];C.insertChar(d)},v.setPen=function(d){var C=this.rows[this.currRow];C.setPenStyles(d)},v.moveCursor=function(d){var C=this.rows[this.currRow];C.moveCursor(d)},v.setCursor=function(d){this.logger.log(c.INFO,"setCursor: "+d);var C=this.rows[this.currRow];C.setCursor(d)},v.setPAC=function(d){this.logger.log(c.INFO,"pacData = "+JSON.stringify(d));var C=d.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var E=0;E<G;E++)this.rows[E].clear();var w=this.currRow+1-this.nrRollUpRows,j=this.lastOutputScreen;if(j){var W=j.rows[w].cueStartTime,T=this.logger.time;if(W&&T!==null&&W<T)for(var N=0;N<this.nrRollUpRows;N++)this.rows[C-this.nrRollUpRows+N+1].copy(j.rows[w+N])}}this.currRow=C;var _=this.rows[this.currRow];if(d.indent!==null){var x=d.indent,H=Math.max(x-1,0);_.setCursor(d.indent),d.color=_.chars[H].penState.foreground}var X={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(X)},v.setBkgData=function(d){this.logger.log(c.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},v.setRollUpRows=function(d){this.nrRollUpRows=d},v.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 d=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(d,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(c.INFO,"Rolling up")},v.getDisplayText=function(d){d=d||!1;for(var C=[],E="",w=-1,j=0;j<G;j++){var W=this.rows[j].getTextString();W&&(w=j+1,d?C.push("Row "+w+": '"+W+"'"):C.push(W.trim()))}return C.length>0&&(d?E="["+C.join(" | ")+"]":E=C.join(`
`)),E},v.getTextAndFormat=function(){return this.rows},m}(),D=function(){function m(h,d,C){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=h,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new i(C),this.nonDisplayedMemory=new i(C),this.lastOutputScreen=new i(C),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var v=m.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(d){this.outputFilter=d},v.setPAC=function(d){this.writeScreen.setPAC(d)},v.setBkgData=function(d){this.writeScreen.setBkgData(d)},v.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(c.INFO,"MODE="+d),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=d},v.insertChars=function(d){for(var C=0;C<d.length;C++)this.writeScreen.insertChar(d[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(c.INFO,E+": "+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())},v.ccRCL=function(){this.logger.log(c.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},v.ccBS=function(){if(this.logger.log(c.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},v.ccAOF=function(){},v.ccAON=function(){},v.ccDER=function(){this.logger.log(c.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},v.ccRU=function(d){this.logger.log(c.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},v.ccFON=function(){this.logger.log(c.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},v.ccRDC=function(){this.logger.log(c.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},v.ccTR=function(){this.logger.log(c.INFO,"TR"),this.setMode("MODE_TEXT")},v.ccRTD=function(){this.logger.log(c.INFO,"RTD"),this.setMode("MODE_TEXT")},v.ccEDM=function(){this.logger.log(c.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},v.ccCR=function(){this.logger.log(c.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},v.ccENM=function(){this.logger.log(c.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},v.ccEOC=function(){if(this.logger.log(c.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(c.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},v.ccTO=function(d){this.logger.log(c.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},v.ccMIDROW=function(d){var C={flash:!1};if(C.underline=d%2===1,C.italics=d>=46,C.italics)C.foreground="white";else{var E=Math.floor(d/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=w[E]}this.logger.log(c.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},v.outputDataUpdate=function(d){d===void 0&&(d=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},m}(),A=function(){function m(h,d,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new a;this.channels=[null,new D(h,d,E),new D(h+1,C,E)],this.cmdHistory=O(),this.logger=E}var v=m.prototype;return v.getHandler=function(d){return this.channels[d].getHandler()},v.setHandler=function(d,C){this.channels[d].setHandler(C)},v.addData=function(d,C){var E,w,j,W=!1;this.logger.time=d;for(var T=0;T<C.length;T+=2){if(w=C[T]&127,j=C[T+1]&127,w===0&&j===0)continue;if(this.logger.log(c.DATA,"["+p([C[T],C[T+1]])+"] -> ("+p([w,j])+")"),E=this.parseCmd(w,j),E||(E=this.parseMidrow(w,j)),E||(E=this.parsePAC(w,j)),E||(E=this.parseBackgroundAttributes(w,j)),!E&&(W=this.parseChars(w,j),W)){var N=this.currentChannel;if(N&&N>0){var _=this.channels[N];_.insertChars(W)}else this.logger.log(c.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!W&&this.logger.log(c.WARNING,"Couldn't parse cleaned data "+p([w,j])+" orig: "+p([C[T],C[T+1]]))}},v.parseCmd=function(d,C){var E=this.cmdHistory,w=(d===20||d===28||d===21||d===29)&&C>=32&&C<=47,j=(d===23||d===31)&&C>=33&&C<=35;if(!(w||j))return!1;if(R(d,C,E))return S(null,null,E),this.logger.log(c.DEBUG,"Repeated command ("+p([d,C])+") is dropped"),!0;var W=d===20||d===21||d===23?1:2,T=this.channels[W];return d===20||d===21||d===28||d===29?C===32?T.ccRCL():C===33?T.ccBS():C===34?T.ccAOF():C===35?T.ccAON():C===36?T.ccDER():C===37?T.ccRU(2):C===38?T.ccRU(3):C===39?T.ccRU(4):C===40?T.ccFON():C===41?T.ccRDC():C===42?T.ccTR():C===43?T.ccRTD():C===44?T.ccEDM():C===45?T.ccCR():C===46?T.ccENM():C===47&&T.ccEOC():T.ccTO(C-32),S(d,C,E),this.currentChannel=W,!0},v.parseMidrow=function(d,C){var E=0;if((d===17||d===25)&&C>=32&&C<=47){if(d===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(c.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[E];return w?(w.ccMIDROW(C),this.logger.log(c.DEBUG,"MIDROW ("+p([d,C])+")"),!0):!1}return!1},v.parsePAC=function(d,C){var E,w=this.cmdHistory,j=(d>=17&&d<=23||d>=25&&d<=31)&&C>=64&&C<=127,W=(d===16||d===24)&&C>=64&&C<=95;if(!(j||W))return!1;if(R(d,C,w))return S(null,null,w),!0;var T=d<=23?1:2;C>=64&&C<=95?E=T===1?n[d]:b[d]:E=T===1?I[d]:f[d];var N=this.channels[T];return N?(N.setPAC(this.interpretPAC(E,C)),S(d,C,w),this.currentChannel=T,!0):!1},v.interpretPAC=function(d,C){var E,w={color:null,italics:!1,indent:null,underline:!1,row:d};return C>95?E=C-96:E=C-64,w.underline=(E&1)===1,E<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((E-16)/2)*4,w},v.parseChars=function(d,C){var E,w=null,j=null;if(d>=25?(E=2,j=d-8):(E=1,j=d),j>=17&&j<=19){var W;j===17?W=C+80:j===18?W=C+112:W=C+144,this.logger.log(c.INFO,"Special char '"+F(W)+"' in channel "+E),w=[W]}else d>=32&&d<=127&&(w=C===0?[d]:[d,C]);if(w){var T=p(w);this.logger.log(c.DEBUG,"Char codes = "+T.join(",")),S(d,C,this.cmdHistory)}return w},v.parseBackgroundAttributes=function(d,C){var E=(d===16||d===24)&&C>=32&&C<=47,w=(d===23||d===31)&&C>=45&&C<=47;if(!(E||w))return!1;var j,W={};d===16||d===24?(j=Math.floor((C-32)/2),W.background=y[j],C%2===1&&(W.background=W.background+"_semi")):C===45?W.background="transparent":(W.foreground="black",C===47&&(W.underline=!0));var T=d<=23?1:2,N=this.channels[T];return N.setBkgData(W),S(d,C,this.cmdHistory),!0},v.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var C=this.channels[d];C&&C.reset()}this.cmdHistory=O()},v.cueSplitAtTime=function(d){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(d)}},m}();function S(m,v,h){h.a=m,h.b=v}function R(m,v,h){return h.a===m&&h.b===v}function O(){return{a:null,b:null}}Y.default=A},"./src/utils/codecs.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"isCodecType",function(){return P}),M.d(Y,"isCodecSupportedInMp4",function(){return F});var z={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function P(G,K){var n=z[K];return!!n&&n[G.slice(0,4)]===!0}function F(G,K){return MediaSource.isTypeSupported((K||"video")+'/mp4;codecs="'+G+'"')}},"./src/utils/cues.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/utils/vttparser.ts"),P=M("./src/utils/webvtt-parser.ts"),F=M("./src/utils/texttrack-utils.ts"),G=/\s/,K={newCue:function(I,b,f,y){for(var c=[],a,p,l,u,s,i=self.VTTCue||self.TextTrackCue,D=0;D<y.rows.length;D++)if(a=y.rows[D],l=!0,u=0,s="",!a.isEmpty()){for(var A=0;A<a.chars.length;A++)G.test(a.chars[A].uchar)&&l?u++:(s+=a.chars[A].uchar,l=!1);a.cueStartTime=b,b===f&&(f+=1e-4),u>=16?u--:u++;var S=Object(z.fixLineBreaks)(s.trim()),R=Object(P.generateCueId)(b,f,S);(!I||!I.cues||!I.cues.getCueById(R))&&(p=new i(b,f,S),p.id=R,p.line=D+1,p.align="left",p.position=10+Math.min(80,Math.floor(u*8/32)*10),c.push(p))}return I&&c.length&&(c.sort(function(O,m){return O.line==="auto"||m.line==="auto"?0:O.line>8&&m.line>8?m.line-O.line:O.line-m.line}),c.forEach(function(O){return Object(F.addCueToTrack)(I,O)})),c}};Y.default=K},"./src/utils/discontinuities.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"findFirstFragWithCC",function(){return G}),M.d(Y,"shouldAlignOnDiscontinuities",function(){return K}),M.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),M.d(Y,"adjustSlidingStart",function(){return b}),M.d(Y,"alignStream",function(){return f}),M.d(Y,"alignPDT",function(){return c}),M.d(Y,"alignFragmentByPDTDelta",function(){return a}),M.d(Y,"alignMediaPlaylistByPDT",function(){return p});var z=M("./src/polyfills/number.ts"),P=M("./src/utils/logger.ts"),F=M("./src/controller/level-helper.ts");function G(l,u){for(var s=null,i=0,D=l.length;i<D;i++){var A=l[i];if(A&&A.cc===u){s=A;break}}return s}function K(l,u,s){return!!(u.details&&(s.endCC>s.startCC||l&&l.cc<s.startCC))}function n(l,u){var s=l.fragments,i=u.fragments;if(!i.length||!s.length){P.logger.log("No fragments to align");return}var D=G(s,i[0].cc);if(!D||D&&!D.startPTS){P.logger.log("No frag in previous level to align on");return}return D}function I(l,u){if(l){var s=l.start+u;l.start=l.startPTS=s,l.endPTS=s+l.duration}}function b(l,u){for(var s=u.fragments,i=0,D=s.length;i<D;i++)I(s[i],l);u.fragmentHint&&I(u.fragmentHint,l),u.alignedSliding=!0}function f(l,u,s){if(!u)return;y(l,s,u),!s.alignedSliding&&u.details&&c(s,u.details),!s.alignedSliding&&u.details&&!s.skippedSegments&&Object(F.adjustSliding)(u.details,s)}function y(l,u,s){if(K(l,s,u)){var i=n(s.details,u);i&&Object(z.isFiniteNumber)(i.start)&&(P.logger.log("Adjusting PTS using last level due to CC increase within current level "+u.url),b(i.start,u))}}function c(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,i=l.fragments[0].programDateTime,D=(i-s)/1e3+u.fragments[0].start;D&&Object(z.isFiniteNumber)(D)&&(P.logger.log("Adjusting PTS using programDateTime delta "+(i-s)+"ms, sliding:"+D.toFixed(3)+" "+l.url+" "),b(D,l))}function a(l,u){var s=l.programDateTime;if(!s)return;var i=(s-u)/1e3;l.start=l.startPTS=i,l.endPTS=i+l.duration}function p(l,u){if(!u.fragments.length||!l.hasProgramDateTime||!u.hasProgramDateTime)return;var s=u.fragments[0].programDateTime,i=u.fragments[0].start,D=s-i*1e3;l.fragments.forEach(function(A){a(A,D)}),l.fragmentHint&&a(l.fragmentHint,D),l.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/utils/ewma.ts"),P=function(){function F(K,n,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 z.default(K),this.fast_=new z.default(n)}var G=F.prototype;return G.update=function(n,I){var b=this.slow_,f=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new z.default(n,b.getEstimate(),b.getTotalWeight())),this.fast_.halfLife!==I&&(this.fast_=new z.default(I,f.getEstimate(),f.getTotalWeight()))},G.sample=function(n,I){n=Math.max(n,this.minDelayMs_);var b=8*I,f=n/1e3,y=b/f;this.fast_.sample(f,y),this.slow_.sample(f,y)},G.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},F}();Y.default=P},"./src/utils/ewma.ts":function(ne,Y,M){"use strict";M.r(Y);var z=function(){function P(G,K,n){K===void 0&&(K=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=K,this.totalWeight_=n}var F=P.prototype;return F.sample=function(K,n){var I=Math.pow(this.alpha_,K);this.estimate_=n*(1-I)+I*this.estimate_,this.totalWeight_+=K},F.getTotalWeight=function(){return this.totalWeight_},F.getEstimate=function(){if(this.alpha_){var K=1-Math.pow(this.alpha_,this.totalWeight_);if(K)return this.estimate_/K}return this.estimate_},P}();Y.default=z},"./src/utils/fetch-loader.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"fetchSupported",function(){return a});var z=M("./src/polyfills/number.ts"),P=M("./src/loader/load-stats.ts"),F=M("./src/demux/chunk-cache.ts");function G(i,D){i.prototype=Object.create(D.prototype),i.prototype.constructor=i,f(i,D)}function K(i){var D=typeof Map=="function"?new Map:void 0;return K=function(S){if(S===null||!b(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof D!="undefined"){if(D.has(S))return D.get(S);D.set(S,R)}function R(){return n(S,arguments,y(this).constructor)}return R.prototype=Object.create(S.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),f(R,S)},K(i)}function n(i,D,A){return I()?n=Reflect.construct:n=function(R,O,m){var v=[null];v.push.apply(v,O);var h=Function.bind.apply(R,v),d=new h;return m&&f(d,m.prototype),d},n.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(i){return!1}}function b(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function f(i,D){return f=Object.setPrototypeOf||function(S,R){return S.__proto__=R,S},f(i,D)}function y(i){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},y(i)}function c(){return c=Object.assign||function(i){for(var D=1;D<arguments.length;D++){var A=arguments[D];for(var S in A)Object.prototype.hasOwnProperty.call(A,S)&&(i[S]=A[S])}return i},c.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(i){}return!1}var p=function(){function i(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||u,this.controller=new self.AbortController,this.stats=new P.LoadStats}var D=i.prototype;return D.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},D.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},D.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},D.load=function(S,R,O){var m=this,v=this.stats;if(v.loading.start)throw new Error("Loader can only be used once.");v.loading.start=self.performance.now();var h=l(S,this.controller.signal),d=O.onProgress,C=S.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=S,this.config=R,this.callbacks=O,this.request=this.fetchSetup(S,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){m.abortInternal(),O.onTimeout(v,S,m.response)},R.timeout),self.fetch(this.request).then(function(w){if(m.response=m.loader=w,!w.ok){var j=w.status,W=w.statusText;throw new s(W||"fetch, bad network response",j,w)}return v.loading.first=Math.max(self.performance.now(),v.loading.start),v.total=parseInt(w.headers.get("Content-Length")||"0"),d&&Object(z.isFiniteNumber)(R.highWaterMark)?m.loadProgressively(w,v,S,R.highWaterMark,d):C?w.arrayBuffer():w.text()}).then(function(w){var j=m.response;self.clearTimeout(m.requestTimeout),v.loading.end=Math.max(self.performance.now(),v.loading.first),v.loaded=v.total=w[E];var W={url:j.url,data:w};d&&!Object(z.isFiniteNumber)(R.highWaterMark)&&d(v,S,w,j),O.onSuccess(W,v,S,j)}).catch(function(w){if(self.clearTimeout(m.requestTimeout),v.aborted)return;var j=w.code||0;O.onError({code:j,text:w.message},S,w.details)})},D.getCacheAge=function(){var S=null;if(this.response){var R=this.response.headers.get("age");S=R?parseFloat(R):null}return S},D.loadProgressively=function(S,R,O,m,v){m===void 0&&(m=0);var h=new F.default,d=S.body.getReader(),C=function E(){return d.read().then(function(w){if(w.done)return h.dataLength&&v(R,O,h.flush(),S),Promise.resolve(new ArrayBuffer(0));var j=w.value,W=j.length;return R.loaded+=W,W<m||h.dataLength?(h.push(j),h.dataLength>=m&&v(R,O,h.flush(),S)):v(R,O,j,S),E()}).catch(function(){return Promise.reject()})};return C()},i}();function l(i,D){var A={method:"GET",mode:"cors",credentials:"same-origin",signal:D,headers:new self.Headers(c({},i.headers))};return i.rangeEnd&&A.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),A}function u(i,D){return new self.Request(i.url,D)}var s=function(i){G(D,i);function D(A,S,R){var O;return O=i.call(this,A)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=R,O}return D}(K(Error));Y.default=p},"./src/utils/imsc1-ttml-parser.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"IMSC1_CODEC",function(){return b}),M.d(Y,"parseIMSC1",function(){return a});var z=M("./src/utils/mp4-tools.ts"),P=M("./src/utils/vttparser.ts"),F=M("./src/utils/vttcue.ts"),G=M("./src/demux/id3.ts"),K=M("./src/utils/timescale-conversion.ts"),n=M("./src/utils/webvtt-parser.ts");function I(){return I=Object.assign||function(m){for(var v=1;v<arguments.length;v++){var h=arguments[v];for(var d in h)Object.prototype.hasOwnProperty.call(h,d)&&(m[d]=h[d])}return m},I.apply(this,arguments)}var b="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,y=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,c={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(m,v,h,d,C){var E=Object(z.findBox)(new Uint8Array(m),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var w=E[0],j=Object(G.utf8ArrayToStr)(new Uint8Array(m,w.start,w.end-w.start)),W=Object(K.toTimescaleFromScale)(v,1,h);try{d(p(j,W))}catch(T){C(T)}}function p(m,v){var h=new DOMParser,d=h.parseFromString(m,"text/xml"),C=d.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},w=Object.keys(E).reduce(function(_,x){return _[x]=C.getAttribute("ttp:"+x)||E[x],_},{}),j=C.getAttribute("xml:space")!=="preserve",W=u(l(C,"styling","style")),T=u(l(C,"layout","region")),N=l(C,"body","[begin]");return[].map.call(N,function(_){var x=s(_,j);if(!x||!_.hasAttribute("begin"))return null;var H=S(_.getAttribute("begin"),w),X=S(_.getAttribute("dur"),w),ee=S(_.getAttribute("end"),w);if(H===null)throw A(_);if(ee===null){if(X===null)throw A(_);ee=H+X}var J=new F.default(H-v,ee-v,x);J.id=Object(n.generateCueId)(J.startTime,J.endTime,J.text);var ce=T[_.getAttribute("region")],me=W[_.getAttribute("style")];J.position=10,J.size=80;var ue=i(ce,me),pe=ue.textAlign;if(pe){var xe=c[pe];xe&&(J.lineAlign=xe),J.align=pe}return I(J,ue),J}).filter(function(_){return _!==null})}function l(m,v,h){var d=m.getElementsByTagName(v)[0];return d?[].slice.call(d.querySelectorAll(h)):[]}function u(m){return m.reduce(function(v,h){var d=h.getAttribute("xml:id");return d&&(v[d]=h),v},{})}function s(m,v){return[].slice.call(m.childNodes).reduce(function(h,d,C){var E;return d.nodeName==="br"&&C?h+`
`:(E=d.childNodes)!==null&&E!==void 0&&E.length?s(d,v):v?h+d.textContent.trim().replace(/\s+/g," "):h+d.textContent},"")}function i(m,v){var h="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(C,E){var w=D(v,h,E)||D(m,h,E);return w&&(C[E]=w),C},{})}function D(m,v,h){return m.hasAttributeNS(v,h)?m.getAttributeNS(v,h):null}function A(m){return new Error("Could not parse ttml timestamp "+m)}function S(m,v){if(!m)return null;var h=Object(P.parseTimeStamp)(m);return h===null&&(f.test(m)?h=R(m,v):y.test(m)&&(h=O(m,v))),h}function R(m,v){var h=f.exec(m),d=(h[4]|0)+(h[5]|0)/v.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+d/v.frameRate}function O(m,v){var h=y.exec(m),d=Number(h[1]),C=h[2];switch(C){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/v.frameRate;case"t":return d/v.tickRate}return d}},"./src/utils/logger.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"enableLogs",function(){return n}),M.d(Y,"logger",function(){return I});var z=function(){},P={trace:z,debug:z,log:z,warn:z,info:z,error:z},F=P;function G(b){var f=self.console[b];return f?f.bind(self.console,"["+b+"] >"):z}function K(b){for(var f=arguments.length,y=new Array(f>1?f-1:0),c=1;c<f;c++)y[c-1]=arguments[c];y.forEach(function(a){F[a]=b[a]?b[a].bind(b):G(a)})}function n(b){if(self.console&&b===!0||typeof b=="object"){K(b,"debug","log","info","warn","error");try{F.log()}catch(f){F=P}}else F=P}var I=F},"./src/utils/mediakeys-helper.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"KeySystems",function(){return z}),M.d(Y,"requestMediaKeySystemAccess",function(){return P});var z;(function(F){F.WIDEVINE="com.widevine.alpha",F.PLAYREADY="com.microsoft.playready"})(z||(z={}));var P=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"getMediaSource",function(){return z});function z(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"bin2str",function(){return K}),M.d(Y,"readUint16",function(){return n}),M.d(Y,"readUint32",function(){return I}),M.d(Y,"writeUint32",function(){return b}),M.d(Y,"findBox",function(){return f}),M.d(Y,"parseSegmentIndex",function(){return y}),M.d(Y,"parseInitSegment",function(){return c}),M.d(Y,"getStartDTS",function(){return a}),M.d(Y,"getDuration",function(){return p}),M.d(Y,"computeRawDurationFromSamples",function(){return l}),M.d(Y,"offsetStartDTS",function(){return u}),M.d(Y,"segmentValidRange",function(){return s}),M.d(Y,"appendUint8Array",function(){return i});var z=M("./src/utils/typed-array.ts"),P=M("./src/loader/fragment.ts"),F=Math.pow(2,32)-1,G=[].push;function K(D){return String.fromCharCode.apply(null,D)}function n(D,A){"data"in D&&(A+=D.start,D=D.data);var S=D[A]<<8|D[A+1];return S<0?65536+S:S}function I(D,A){"data"in D&&(A+=D.start,D=D.data);var S=D[A]<<24|D[A+1]<<16|D[A+2]<<8|D[A+3];return S<0?4294967296+S:S}function b(D,A,S){"data"in D&&(A+=D.start,D=D.data),D[A]=S>>24,D[A+1]=S>>16&255,D[A+2]=S>>8&255,D[A+3]=S&255}function f(D,A){var S=[];if(!A.length)return S;var R,O,m;"data"in D?(R=D.data,O=D.start,m=D.end):(R=D,O=0,m=R.byteLength);for(var v=O;v<m;){var h=I(R,v),d=K(R.subarray(v+4,v+8)),C=h>1?v+h:m;if(d===A[0])if(A.length===1)S.push({data:R,start:v+8,end:C});else{var E=f({data:R,start:v+8,end:C},A.slice(1));E.length&&G.apply(S,E)}v=C}return S}function y(D){var A=f(D,["moov"]),S=A[0],R=S?S.end:null,O=f(D,["sidx"]);if(!O||!O[0])return null;var m=[],v=O[0],h=v.data[0],d=h===0?8:16,C=I(v,d);d+=4;var E=0,w=0;h===0?d+=8:d+=16,d+=2;var j=v.end+w,W=n(v,d);d+=2;for(var T=0;T<W;T++){var N=d,_=I(v,N);N+=4;var x=_&2147483647,H=(_&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var X=I(v,N);N+=4,m.push({referenceSize:x,subsegmentDuration:X,info:{duration:X/C,start:j,end:j+x-1}}),j+=x,N+=4,d=N}return{earliestPresentationTime:E,timescale:C,version:h,referencesCount:W,references:m,moovEndOffset:R}}function c(D){for(var A=[],S=f(D,["moov","trak"]),R=0;R<S.length;R++){var O=S[R],m=f(O,["tkhd"])[0];if(m){var v=m.data[m.start],h=v===0?12:20,d=I(m,h),C=f(O,["mdia","mdhd"])[0];if(C){v=C.data[C.start],h=v===0?12:20;var E=I(C,h),w=f(O,["mdia","hdlr"])[0];if(w){var j=K(w.data.subarray(w.start+8,w.start+12)),W={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[j];if(W){var T=f(O,["mdia","minf","stbl","stsd"])[0],N=void 0;T&&(N=K(T.data.subarray(T.start+12,T.start+16))),A[d]={timescale:E,type:W},A[W]={timescale:E,id:d,codec:N}}}}}}var _=f(D,["moov","mvex","trex"]);return _.forEach(function(x){var H=I(x,4),X=A[H];X&&(X.default={duration:I(x,12),flags:I(x,20)})}),A}function a(D,A){return f(A,["moof","traf"]).reduce(function(S,R){var O=f(R,["tfdt"])[0],m=O.data[O.start],v=f(R,["tfhd"]).reduce(function(h,d){var C=I(d,4),E=D[C];if(E){var w=I(O,4);m===1&&(w*=Math.pow(2,32),w+=I(O,8));var j=E.timescale||9e4,W=w/j;if(isFinite(W)&&(h===null||W<h))return W}return h},null);return v!==null&&isFinite(v)&&(S===null||v<S)?v:S},null)||0}function p(D,A){for(var S=0,R=0,O=0,m=f(D,["moof","traf"]),v=0;v<m.length;v++){var h=m[v],d=f(h,["tfhd"])[0],C=I(d,4),E=A[C];if(!E)continue;var w=E.default,j=I(d,0)|(w==null?void 0:w.flags),W=w==null?void 0:w.duration;j&8&&(j&2?W=I(d,12):W=I(d,8));for(var T=E.timescale||9e4,N=f(h,["trun"]),_=0;_<N.length;_++){if(W){var x=I(N[_],4);S=W*x}else S=l(N[_]);E.type===P.ElementaryStreamTypes.VIDEO?R+=S/T:E.type===P.ElementaryStreamTypes.AUDIO&&(O+=S/T)}}if(R===0&&O===0){var H=y(D);if(H!=null&&H.references)return H.references.reduce(function(X,ee){return X+ee.info.duration||0},0)}return R||O}function l(D){var A=I(D,0),S=8;A&1&&(S+=4),A&4&&(S+=4);for(var R=0,O=I(D,4),m=0;m<O;m++){if(A&256){var v=I(D,S);R+=v,S+=4}A&512&&(S+=4),A&1024&&(S+=4),A&2048&&(S+=4)}return R}function u(D,A,S){f(A,["moof","traf"]).forEach(function(R){f(R,["tfhd"]).forEach(function(O){var m=I(O,4),v=D[m];if(!v)return;var h=v.timescale||9e4;f(R,["tfdt"]).forEach(function(d){var C=d.data[d.start],E=I(d,4);if(C===0)b(d,4,E-S*h);else{E*=Math.pow(2,32),E+=I(d,8),E-=S*h,E=Math.max(E,0);var w=Math.floor(E/(F+1)),j=Math.floor(E%(F+1));b(d,4,w),b(d,8,j)}})})})}function s(D){var A={valid:null,remainder:null},S=f(D,["moof"]);if(S){if(S.length<2)return A.remainder=D,A}else return A;var R=S[S.length-1];return A.valid=Object(z.sliceUint8)(D,0,R.start-8),A.remainder=Object(z.sliceUint8)(D,R.start-8),A}function i(D,A){var S=new Uint8Array(D.length+A.length);return S.set(D),S.set(A,D.length),S}},"./src/utils/output-filter.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"default",function(){return z});var z=function(){function P(G,K){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=G,this.trackName=K}var F=P.prototype;return F.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},F.newCue=function(K,n,I){(this.startTime===null||this.startTime>K)&&(this.startTime=K),this.endTime=n,this.screen=I,this.timelineController.createCaptionsTrack(this.trackName)},F.reset=function(){this.cueRanges=[]},P}()},"./src/utils/texttrack-utils.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"sendAddTrackEvent",function(){return P}),M.d(Y,"addCueToTrack",function(){return F}),M.d(Y,"clearCurrentCues",function(){return G}),M.d(Y,"removeCuesInRange",function(){return K}),M.d(Y,"getCuesInRange",function(){return I});var z=M("./src/utils/logger.ts");function P(b,f){var y;try{y=new Event("addtrack")}catch(c){y=document.createEvent("Event"),y.initEvent("addtrack",!1,!1)}y.track=b,f.dispatchEvent(y)}function F(b,f){var y=b.mode;if(y==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(f.id))try{if(b.addCue(f),!b.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(a){z.logger.debug("[texttrack-utils]: "+a);var c=new self.TextTrackCue(f.startTime,f.endTime,f.text);c.id=f.id,b.addCue(c)}y==="disabled"&&(b.mode=y)}function G(b){var f=b.mode;if(f==="disabled"&&(b.mode="hidden"),b.cues)for(var y=b.cues.length;y--;)b.removeCue(b.cues[y]);f==="disabled"&&(b.mode=f)}function K(b,f,y){var c=b.mode;if(c==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var a=I(b.cues,f,y),p=0;p<a.length;p++)b.removeCue(a[p]);c==="disabled"&&(b.mode=c)}function n(b,f){if(f<b[0].startTime)return 0;var y=b.length-1;if(f>b[y].endTime)return-1;for(var c=0,a=y;c<=a;){var p=Math.floor((a+c)/2);if(f<b[p].startTime)a=p-1;else if(f>b[p].startTime&&c<y)c=p+1;else return p}return b[c].startTime-f<f-b[a].startTime?c:a}function I(b,f,y){var c=[],a=n(b,f);if(a>-1)for(var p=a,l=b.length;p<l;p++){var u=b[p];if(u.startTime>=f&&u.endTime<=y)c.push(u);else if(u.startTime>y)return c}return c}},"./src/utils/time-ranges.ts":function(ne,Y,M){"use strict";M.r(Y);var z={toString:function(F){for(var G="",K=F.length,n=0;n<K;n++)G+="["+F.start(n).toFixed(3)+","+F.end(n).toFixed(3)+"]";return G}};Y.default=z},"./src/utils/timescale-conversion.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"toTimescaleFromBase",function(){return P}),M.d(Y,"toTimescaleFromScale",function(){return F}),M.d(Y,"toMsFromMpegTsClock",function(){return G}),M.d(Y,"toMpegTsClockFromTimescale",function(){return K});var z=9e4;function P(n,I,b,f){b===void 0&&(b=1),f===void 0&&(f=!1);var y=n*I*b;return f?Math.round(y):y}function F(n,I,b,f){return b===void 0&&(b=1),f===void 0&&(f=!1),P(n,I,1/b,f)}function G(n,I){return I===void 0&&(I=!1),P(n,1e3,1/z,I)}function K(n,I){return I===void 0&&(I=1),P(n,z,1/I)}},"./src/utils/typed-array.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"sliceUint8",function(){return z});function z(P,F,G){return Uint8Array.prototype.slice?P.slice(F,G):new Uint8Array(Array.prototype.slice.call(P,F,G))}},"./src/utils/vttcue.ts":function(ne,Y,M){"use strict";M.r(Y),Y.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var z=["","lr","rl"],P=["start","middle","end","left","right"];function F(b,f){if(typeof f!="string")return!1;if(!Array.isArray(b))return!1;var y=f.toLowerCase();return~b.indexOf(y)?y:!1}function G(b){return F(z,b)}function K(b){return F(P,b)}function n(b){for(var f=arguments.length,y=new Array(f>1?f-1:0),c=1;c<f;c++)y[c-1]=arguments[c];for(var a=1;a<arguments.length;a++){var p=arguments[a];for(var l in p)b[l]=p[l]}return b}function I(b,f,y){var c=this,a={enumerable:!0};c.hasBeenReset=!1;var p="",l=!1,u=b,s=f,i=y,D=null,A="",S=!0,R="auto",O="start",m=50,v="middle",h=50,d="middle";Object.defineProperty(c,"id",n({},a,{get:function(){return p},set:function(E){p=""+E}})),Object.defineProperty(c,"pauseOnExit",n({},a,{get:function(){return l},set:function(E){l=!!E}})),Object.defineProperty(c,"startTime",n({},a,{get:function(){return u},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");u=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"endTime",n({},a,{get:function(){return s},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");s=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"text",n({},a,{get:function(){return i},set:function(E){i=""+E,this.hasBeenReset=!0}})),Object.defineProperty(c,"region",n({},a,{get:function(){return D},set:function(E){D=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"vertical",n({},a,{get:function(){return A},set:function(E){var w=G(E);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");A=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"snapToLines",n({},a,{get:function(){return S},set:function(E){S=!!E,this.hasBeenReset=!0}})),Object.defineProperty(c,"line",n({},a,{get:function(){return R},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");R=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"lineAlign",n({},a,{get:function(){return O},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");O=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"position",n({},a,{get:function(){return m},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");m=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"positionAlign",n({},a,{get:function(){return v},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");v=w,this.hasBeenReset=!0}})),Object.defineProperty(c,"size",n({},a,{get:function(){return h},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");h=E,this.hasBeenReset=!0}})),Object.defineProperty(c,"align",n({},a,{get:function(){return d},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");d=w,this.hasBeenReset=!0}})),c.displayState=void 0}return I.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},I}()},"./src/utils/vttparser.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"parseTimeStamp",function(){return F}),M.d(Y,"fixLineBreaks",function(){return f}),M.d(Y,"VTTParser",function(){return y});var z=M("./src/utils/vttcue.ts"),P=function(){function c(){}var a=c.prototype;return a.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},c}();function F(c){function a(l,u,s,i){return(l|0)*3600+(u|0)*60+(s|0)+parseFloat(i||0)}var p=c.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?a(p[2],p[3],0,p[4]):a(p[1],p[2],p[3],p[4]):null}var G=function(){function c(){this.values=Object.create(null)}var a=c.prototype;return a.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},a.get=function(l,u,s){return s?this.has(l)?this.values[l]:u[s]:this.has(l)?this.values[l]:u},a.has=function(l){return l in this.values},a.alt=function(l,u,s){for(var i=0;i<s.length;++i)if(u===s[i]){this.set(l,u);break}},a.integer=function(l,u){/^-?\d+$/.test(u)&&this.set(l,parseInt(u,10))},a.percent=function(l,u){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(u)){var s=parseFloat(u);if(s>=0&&s<=100)return this.set(l,s),!0}return!1},c}();function K(c,a,p,l){var u=l?c.split(l):[c];for(var s in u){if(typeof u[s]!="string")continue;var i=u[s].split(p);if(i.length!==2)continue;var D=i[0],A=i[1];a(D,A)}}var n=new z.default(0,0,""),I=n.align==="middle"?"middle":"center";function b(c,a,p){var l=c;function u(){var D=F(c);if(D===null)throw new Error("Malformed timestamp: "+l);return c=c.replace(/^[^\sa-zA-Z-]+/,""),D}function s(D,A){var S=new G;K(D,function(m,v){var h;switch(m){case"region":for(var d=p.length-1;d>=0;d--)if(p[d].id===v){S.set(m,p[d].region);break}break;case"vertical":S.alt(m,v,["rl","lr"]);break;case"line":h=v.split(","),S.integer(m,h[0]),S.percent(m,h[0])&&S.set("snapToLines",!1),S.alt(m,h[0],["auto"]),h.length===2&&S.alt("lineAlign",h[1],["start",I,"end"]);break;case"position":h=v.split(","),S.percent(m,h[0]),h.length===2&&S.alt("positionAlign",h[1],["start",I,"end","line-left","line-right","auto"]);break;case"size":S.percent(m,v);break;case"align":S.alt(m,v,["start",I,"end","left","right"]);break}},/:/,/\s/),A.region=S.get("region",null),A.vertical=S.get("vertical","");var R=S.get("line","auto");R==="auto"&&n.line===-1&&(R=-1),A.line=R,A.lineAlign=S.get("lineAlign","start"),A.snapToLines=S.get("snapToLines",!0),A.size=S.get("size",100),A.align=S.get("align",I);var O=S.get("position","auto");O==="auto"&&n.position===50&&(O=A.align==="start"||A.align==="left"?0:A.align==="end"||A.align==="right"?100:50),A.position=O}function i(){c=c.replace(/^\s+/,"")}if(i(),a.startTime=u(),i(),c.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);c=c.substr(3),i(),a.endTime=u(),i(),s(c,a)}function f(c){return c.replace(/<br(?: \/)?>/gi,`
`)}var y=function(){function c(){this.state="INITIAL",this.buffer="",this.decoder=new P,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=c.prototype;return a.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function s(){var O=u.buffer,m=0;for(O=f(O);m<O.length&&O[m]!=="\r"&&O[m]!==`
`;)++m;var v=O.substr(0,m);return O[m]==="\r"&&++m,O[m]===`
`&&++m,u.buffer=O.substr(m),v}function i(O){K(O,function(m,v){},/:/)}try{var D="";if(u.state==="INITIAL"){if(!/\r\n|\n/.test(u.buffer))return this;D=s();var A=D.match(/^()?WEBVTT([ \t].*)?$/);if(!A||!A[0])throw new Error("Malformed WebVTT signature.");u.state="HEADER"}for(var S=!1;u.buffer;){if(!/\r\n|\n/.test(u.buffer))return this;S?S=!1:D=s();switch(u.state){case"HEADER":/:/.test(D)?i(D):D||(u.state="ID");continue;case"NOTE":D||(u.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(D)){u.state="NOTE";break}if(!D)continue;if(u.cue=new z.default(0,0,""),u.state="CUE",D.indexOf("-->")===-1){u.cue.id=D;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{b(D,u.cue,u.regionList)}catch(O){u.cue=null,u.state="BADCUE";continue}u.state="CUETEXT";continue;case"CUETEXT":{var R=D.indexOf("-->")!==-1;if(!D||R&&(S=!0)){u.oncue&&u.cue&&u.oncue(u.cue),u.cue=null,u.state="ID";continue}if(u.cue===null)continue;u.cue.text&&(u.cue.text+=`
`),u.cue.text+=D}continue;case"BADCUE":D||(u.state="ID")}}}catch(O){u.state==="CUETEXT"&&u.cue&&u.oncue&&u.oncue(u.cue),u.cue=null,u.state=u.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(u){l.onparsingerror&&l.onparsingerror(u)}return l.onflush&&l.onflush(),this},c}()},"./src/utils/webvtt-parser.ts":function(ne,Y,M){"use strict";M.r(Y),M.d(Y,"generateCueId",function(){return y}),M.d(Y,"parseWebVTT",function(){return a});var z=M("./src/polyfills/number.ts"),P=M("./src/utils/vttparser.ts"),F=M("./src/demux/id3.ts"),G=M("./src/utils/timescale-conversion.ts"),K=M("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,I=function(l,u,s){return s===void 0&&(s=0),l.substr(s,u.length)===u},b=function(l){var u=parseInt(l.substr(-3)),s=parseInt(l.substr(-6,2)),i=parseInt(l.substr(-9,2)),D=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(z.isFiniteNumber)(u)||!Object(z.isFiniteNumber)(s)||!Object(z.isFiniteNumber)(i)||!Object(z.isFiniteNumber)(D))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return u+=1e3*s,u+=60*1e3*i,u+=60*60*1e3*D,u},f=function(l){for(var u=5381,s=l.length;s;)u=u*33^l.charCodeAt(--s);return(u>>>0).toString()};function y(p,l,u){return f(p.toString())+f(l.toString())+f(u)}var c=function(l,u,s){var i=l[u],D=l[i.prevCC];if(!D||!D.new&&i.new){l.ccOffset=l.presentationOffset=i.start,i.new=!1;return}for(;(A=D)!==null&&A!==void 0&&A.new;){var A;l.ccOffset+=i.start-D.start,i.new=!1,i=D,D=l[i.prevCC]}l.presentationOffset=s};function a(p,l,u,s,i,D,A,S){var R=new P.VTTParser,O=Object(F.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,`
`).split(`
`),m=[],v=Object(G.toMpegTsClockFromTimescale)(l,u),h="00:00.000",d=0,C=0,E,w=!0,j=!1;R.oncue=function(W){var T=s[i],N=s.ccOffset,_=(d-v)/9e4;if(T!=null&&T.new&&(C!==void 0?N=s.ccOffset=T.start:c(s,i,_)),_&&(N=_-s.presentationOffset),j){var x=W.endTime-W.startTime,H=Object(K.normalizePts)((W.startTime+N-C)*9e4,D*9e4)/9e4;W.startTime=H,W.endTime=H+x}var X=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(X)),W.id||(W.id=y(W.startTime,W.endTime,X)),W.endTime>0&&m.push(W)},R.onparsingerror=function(W){E=W},R.onflush=function(){if(E){S(E);return}A(m)},O.forEach(function(W){if(w)if(I(W,"X-TIMESTAMP-MAP=")){w=!1,j=!0,W.substr(16).split(",").forEach(function(T){I(T,"LOCAL:")?h=T.substr(6):I(T,"MPEGTS:")&&(d=parseInt(T.substr(7)))});try{C=b(h)/1e3}catch(T){j=!1,E=T}return}else W===""&&(w=!1);R.parse(W+`
`)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ne,Y,M){"use strict";M.r(Y);var z=M("./src/utils/logger.ts"),P=M("./src/loader/load-stats.ts"),F=/^age:\s*[\d.]+\s*$/m,G=function(){function K(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 P.LoadStats,this.retryDelay=0}var n=K.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},n.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(b,f,y){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=f,this.callbacks=y,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var b=this.config,f=this.context;if(!b)return;var y=this.loader=new self.XMLHttpRequest,c=this.stats;c.loading.first=0,c.loaded=0;var a=this.xhrSetup;try{if(a)try{a(y,f.url)}catch(u){y.open("GET",f.url,!0),a(y,f.url)}y.readyState||y.open("GET",f.url,!0);var p=this.context.headers;if(p)for(var l in p)y.setRequestHeader(l,p[l])}catch(u){this.callbacks.onError({code:y.status,text:u.message},f,y);return}f.rangeEnd&&y.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),y.onreadystatechange=this.readystatechange.bind(this),y.onprogress=this.loadprogress.bind(this),y.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),y.send()},n.readystatechange=function(){var b=this.context,f=this.loader,y=this.stats;if(!b||!f)return;var c=f.readyState,a=this.config;if(y.aborted)return;if(c>=2)if(self.clearTimeout(this.requestTimeout),y.loading.first===0&&(y.loading.first=Math.max(self.performance.now(),y.loading.start)),c===4){f.onreadystatechange=null,f.onprogress=null;var p=f.status;if(p>=200&&p<300){y.loading.end=Math.max(self.performance.now(),y.loading.first);var l,u;if(b.responseType==="arraybuffer"?(l=f.response,u=l.byteLength):(l=f.responseText,u=l.length),y.loaded=y.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(y,b,l,f),!this.callbacks)return;var i={url:f.responseURL,data:l};this.callbacks.onSuccess(i,y,b,f)}else y.retry>=a.maxRetry||p>=400&&p<499?(z.logger.error(p+" while loading "+b.url),this.callbacks.onError({code:p,text:f.statusText},b,f)):(z.logger.warn(p+" while loading "+b.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,a.maxRetryDelay),y.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},n.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(b){var f=this.stats;f.loaded=b.loaded,b.lengthComputable&&(f.total=b.total)},n.getCacheAge=function(){var b=null;if(this.loader&&F.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");b=f?parseFloat(f):null}return b},K}();Y.default=G}}).default})},vHTk:function(ut,ve,U){ut.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(ut,ve,U){"use strict";var ne=U("+L6B"),Y=U("2/Rp"),M=U("5NDa"),z=U("5rEg"),P=U("y8nQ"),F=U("Vl3Y"),G=U("tJVT"),K=U("q1tI"),n=U.n(K),I=U("a+yL"),b=U.n(I),f=function(c){var a=c.value,p=c.onChange,l=F.a.useForm(),u=Object(G.a)(l,1),s=u[0];Object(K.useEffect)(function(){a&&s.setFieldsValue(a)},a);var i=function(A){p(A)};return n.a.createElement("div",{className:b.a.search},n.a.createElement(F.a,{className:b.a.formWrap,colon:!1,form:s,size:"large",layout:"inline",onFinish:i},n.a.createElement(F.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(F.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(F.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},n.a.createElement(z.a,{style:{width:200,height:40}})),n.a.createElement(Y.a,{className:b.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};ve.a=f},wNkr:function(ut,ve){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAoCAYAAACFFRgXAAAAAXNSR0IArs4c6QAABIdJREFUWEftWGtMm1UYfg5taScYNhbt5qAFioMRE6aRkGiQP8vEJcZFZ5YYr9Fd3NTID/3hdS5xXoKZZpvrNsBtJotZlkxHyOIIZjLnLiSGxUWHQKXQsoGAjmAp7dcecw609Lt5GN/XTLOdP6f9Lud73ud93ve85yWUUgv+w4MQEkuFR24CNtlbNx7DvmCshtKYFxR5lAKEAGxmI/GbzYYHQYAQy0ZPnrXZkIZ7ApFeBtYwIAAUFASEz9zg6d9sZoOCBu50OfKNAe6flNjS2oN9mN2bAiD/pwY0G6OLXXbZx645S/SkAFZKgFIKQgjYPC2SFNhaJighJ4xNYKQodjnMAKzNjYZLZS5XwZs2jhnJzVEZDHMA631AyY8yCpWAEt7QXY8QePINSsIXYBrWUbAia6gZncooySyiFvmM8DnjZjGsG3KKqFe4XPWaADCLWo9RDftY0M02zyoBKfOGIHEzCRW75hkLOl9/WEr6VLlzCDSgygHKIFOnHXjmCrhgZ2V1SJp45+ya89UziT0162rp5N99rk5i6o2k8kjF9xZYtlyp7TjJNxdRtZYACqCavXBuTbv+zqRgTJQFknuMjsQYMZVHKhJMcOBCwAvO23Wzwmx2KrOfuQnYbEZVcSzSsJ4kOsovoW/Sn1xvs28d9noOYH3PM+iP9OHzogY0jR7FybFWfOTejqWOUuRYc9AwuAf1Q14cLP4KC223IUanFPdxcBtWLXgYh0cOoePvn3TtnrMkLpR3ovxCiWzhlTkPYdOiV/DlH19gde5jeKp7Ld5Y8i4P0g+CW2GBBV+XHseLvuexx7Mf67qfxkA0mFxjd1Ej9g/tw7nxM+YD/v2eK9hxeTtfOBQPwTu4g//+rGA3Vsx/EFUXKzAqjaCl7BQ2+V5AV7hTBqJ5WSvax89iTBrj1xuH9mKbuw4HhurTA/jScj/W+57lH4vGIzgzfppXZk2lLXDanHiu+wlcnPgZJ8ra8LJvAzrDv/Jnc60LMRkP43DJMTQMejEsDfPrDPwnBTvTB1hLEq8ufg2325w4NHwQuwr3YeUvD6D2jtdhJ3a8F3gL2RnZOFF2Cmt/Ww2vp1ElCab7tDHcdlc7/pJGk25m8tjg3Iwnux5HmIbx0qJaTMRDXM9b8t/H3Vn3wpHhQN3Ah2j+8xvsKqyHy+4GRZyvwZ4rmbcM991aBYlG+bVPL9fhu6stMinNOejSnb701hcCzj2dFaY2yXq9AKZ+l0StkhCws2nxm9HcsbevN2gOdiR7qxCwktneYEhKVGti1q/xFK0o31g9XJiXZawengKsPYTHeg1AqadsrUOsYcD+YGj2BbzIBRoFu7KVVLDkFmMM+wdC0nSfZKZ6n2kjyCt6dYUuqvjlKYwQuI0C7uq9KmXabCLu+H0VgbK+kNjeyGQUS4vmG2O49YcOyZ1XiMxMm0YrSnZKTx7pk40g8RtJkyKRKPqCfqyoWm4M8NHjbb3UpGagyE2EIPDoqmpjzcBj3/5YE4tL3nSDZmAtGdaNj9Tcb6zdKmLF7Ps3XgfebAZF6/3vGf4HhYa6OsTsTGoAAAAASUVORK5CYII="},xTzM:function(ut,ve){ut.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAhCAYAAAC1ONkWAAAACXBIWXMAAAsSAAALEgHS3X78AAAAAXNSR0IArs4c6QAAAqRJREFUWEfNmE1o02AYx/9JzJaltHatZRVR5hSRXHYYbCpMmTIRexAsDD0L8+Rphx10DIQddvDowbugCB68iWOKDqeb7tKD+MGKA8vo3Nzch7ZLlsibJjPrkjRvE8hySUiej9/7/PO+b54wmqZx2IMH4wqWv3kIS19HIcTOgVUP1uRX2XmUVl+DxX10vHpX097FwBmMQC3kP4JtSFElYPiKefnLGJrSd+sFdAb70PMQm8o1KiirMR8D5FXv7pzwE5wyjuSJQbQ9KDiDvWwrgIu2eI8ckOXWWhGtvZ3OYONHlYBS0YeJtT52BnueVMAYMTVAvyZnu8N85mS/67kGMAygGQHNa/PcEC+6gCUqFUueBaQRgD9AP3IaD3kR+HQbWHqje9UG63wE7GumSVG/rbIMTF+nAKs/Fb2nd7An9MH9eEz3eaxY11O39dmYEUHNEgBTWY9gp575GT+97/srFrDl0QGo6h1Ai9JH8lFQNQXwJ3cG2Aab7T+CaPNcoEBUwY4Bje3/PSYvGRUjYGIkPDAmDjRdNsBUYBuMfI9968tBbJGoBhqksXgV4Iy3aPKi5R37nB1CJDUcZC6qWEIHIJ6puEx0W8EyEoR0Tt+7nPYwqkyGsdd4wn4gesMGjNwicrKN4cmZ7Af4RFXFCBiRk+PDkzN+oSLnDil1sIwERsjVo1ggPmIKSNyyATPl3PwbnpyHh6qWC3PIRE55Izw501lgZtBmryRylkvhyjn7wmETJ7NzvRienL/m9O5q9xcskXNjPhw5VRlQSsDvgh1YRsLaQnhybpWBP+sOzchU+1toWlfNnaB6ZaddN6zdEfE14ynymH0zMtNzGivfJ8CH1FpGjnc7d0lkhi7m76H8o5e2EL7sGW4E51eG3f/2+Mrgz3nPgv0D9Cc+LoUg84gAAAAASUVORK5CYII="},xlxt:function(ut,ve,U){ut.exports={flex_box_center:"flex_box_center___1qaRn",flex_space_between:"flex_space_between___3tOTR",flex_box_vertical_center:"flex_box_vertical_center___2XsRs",flex_box_center_end:"flex_box_center_end___3O9De",flex_box_column:"flex_box_column___3bx6a",exportModal:"exportModal___29rdj"}},"yTi+":function(ut,ve,U){ut.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);