(window.webpackJsonp=window.webpackJsonp||[]).push([[237,5,7,8,9,16],{"+NIl":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Y,N){"use strict";function z(h,o){h.cmdState.push(o)}function I(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function M(h){var o=h.cmdState.pop();o&&o.closeBracket()}function G(h){for(var o=h.cmdState,p=o.length-1;p>=0;p--){var l=o[p];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function K(h,o,p){return function(){this.name=h,this.bracketNo=0,this.style=o,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 L(h,o){h.f=o}function x(h,o){var p;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return p=n.hasOwnProperty(l)?n[l]:n.DEFAULT,p=new p,z(o,p),L(o,b),p.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return L(o,function(s,i){return f(s,i,"\\]")}),"keyword";if(h.match("\\("))return L(o,function(s,i){return f(s,i,"\\)")}),"keyword";if(h.match("$$"))return L(o,function(s,i){return f(s,i,"$$")}),"keyword";if(h.match("$"))return L(o,function(s,i){return f(s,i,"$")}),"keyword";var u=h.next();if(u=="%")return h.skipToEnd(),"comment";if(u=="}"||u=="]"){if(p=I(o),p)p.closeBracket(u),L(o,b);else return"error";return"bracket"}else return u=="{"||u=="["?(p=n.DEFAULT,p=new p,z(o,p),"bracket"):/\d/.test(u)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),p=G(o),p.name=="begin"&&(p.argument=h.current()),p.styleIdentifier())}function f(h,o,p){if(h.eatSpace())return null;if(p&&h.match(p))return L(o,x),"keyword";if(h.match(/^\\[a-zA-Z@]+/))return"tag";if(h.match(/^[a-zA-Z]+/))return"variable-2";if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/]/))return"tag";if(h.match(/^[\^_&]/))return"tag";if(h.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(h.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=h.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(h.skipToEnd(),"comment"):"error"}function b(h,o){var p=h.peek(),l;return p=="{"||p=="["?(l=I(o),l.openBracket(p),h.eat(p),L(o,x),"bracket"):/[ \t\r]/.test(p)?(h.eat(p),null):(L(o,x),M(o),x(h,o))}return{startState:function(){var h=N.inMathMode?function(o,p){return f(o,p)}:x;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,o){return o.f(h,o)},blankLine:function(h){h.f=x,h.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"+ua5":function(it,Ee,U){},"+vTd":function(it,Ee,U){it.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(it,Ee,U){it.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(it,Ee,U){"use strict";U.d(Ee,"f",function(){return N}),U.d(Ee,"g",function(){return z}),U.d(Ee,"h",function(){return I}),U.d(Ee,"e",function(){return G}),U.d(Ee,"b",function(){return K}),U.d(Ee,"c",function(){return n}),U.d(Ee,"d",function(){return L}),U.d(Ee,"a",function(){return x});class ie{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+` `+f.stack):f},0)}}emit(f){this.listeners.forEach(b=>{b(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const Y=new ie;function N(f){G(f)||Y.onUnexpectedError(f);return}function z(f){G(f)||Y.onUnexpectedExternalError(f);return}function I(f){if(f instanceof Error){let{name:b,message:h}=f;const o=f.stacktrace||f.stack;return{$isError:!0,name:b,message:h,stack:o}}return f}const M="Canceled";function G(f){return f instanceof Error&&f.name===M&&f.message===M}function K(){const f=new Error(M);return f.name=f.message,f}function n(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function L(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class x extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"19Vz":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(K,n,L){var x=L&&L!=ie.Init;if(n&&!x)K.on("blur",I),K.on("change",M),K.on("swapDoc",M),ie.on(K.getInputField(),"compositionupdate",K.state.placeholderCompose=function(){z(K)}),M(K);else if(!n&&x){K.off("blur",I),K.off("change",M),K.off("swapDoc",M),ie.off(K.getInputField(),"compositionupdate",K.state.placeholderCompose),Y(K);var f=K.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}n&&!K.hasFocus()&&I(K)});function Y(K){K.state.placeholder&&(K.state.placeholder.parentNode.removeChild(K.state.placeholder),K.state.placeholder=null)}function N(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 L=K.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),n.appendChild(L),K.display.lineSpace.insertBefore(n,K.display.lineSpace.firstChild)}function z(K){setTimeout(function(){var n=!1,L=K.getInputField();L.nodeName=="TEXTAREA"?n=!L.value:K.lineCount()==1&&(n=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),n?N(K):Y(K)},20)}function I(K){G(K)&&N(K)}function M(K){var n=K.getWrapperElement(),L=G(K);n.className=n.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?N(K):Y(K)}function G(K){return K.lineCount()===1&&K.getLine(0)===""}})},"1eCo":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"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},N={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(z,I){var M=z.indentUnit,G={},K=I.htmlMode?Y:N;for(var n in K)G[n]=K[n];for(var n in I)G[n]=I[n];var L,x;function f(c,C){function E(W){return C.tokenize=W,W(c,C)}var w=c.next();if(w=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?E(o("atom","]]>")):null:c.match("--")?E(o("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),E(p(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),C.tokenize=o("meta","?>"),"meta"):(L=c.eat("/")?"closeTag":"openTag",C.tokenize=b,"tag bracket");if(w=="&"){var B;return c.eat("#")?c.eat("x")?B=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):B=c.eatWhile(/[\d]/)&&c.eat(";"):B=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),B?"atom":"error"}else return c.eatWhile(/[^&<]/),null}f.isInText=!0;function b(c,C){var E=c.next();if(E==">"||E=="/"&&c.eat(">"))return C.tokenize=f,L=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return L="equals",null;if(E=="<"){C.tokenize=f,C.state=i,C.tagName=C.tagStart=null;var w=C.tokenize(c,C);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=h(E),C.stringStartCol=c.column(),C.tokenize(c,C)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(c){var C=function(E,w){for(;!E.eol();)if(E.next()==c){w.tokenize=b;break}return"string"};return C.isInAttribute=!0,C}function o(c,C){return function(E,w){for(;!E.eol();){if(E.match(C)){w.tokenize=f;break}E.next()}return c}}function p(c){return function(C,E){for(var w;(w=C.next())!=null;){if(w=="<")return E.tokenize=p(c+1),E.tokenize(C,E);if(w==">")if(c==1){E.tokenize=f;break}else return E.tokenize=p(c-1),E.tokenize(C,E)}return"meta"}}function l(c,C,E){this.prev=c.context,this.tagName=C,this.indent=c.indented,this.startOfLine=E,(G.doNotIndent.hasOwnProperty(C)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function s(c,C){for(var E;;){if(!c.context)return;if(E=c.context.tagName,!G.contextGrabbers.hasOwnProperty(E)||!G.contextGrabbers[E].hasOwnProperty(C))return;u(c)}}function i(c,C,E){return c=="openTag"?(E.tagStart=C.column(),D):c=="closeTag"?A:i}function D(c,C,E){return c=="word"?(E.tagName=C.current(),x="tag",O):G.allowMissingTagName&&c=="endTag"?(x="tag bracket",O(c,C,E)):(x="error",D)}function A(c,C,E){if(c=="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?(x="tag",S):(x="tag error",R)}else return G.allowMissingTagName&&c=="endTag"?(x="tag bracket",S(c,C,E)):(x="error",R)}function S(c,C,E){return c!="endTag"?(x="error",S):(u(E),i)}function R(c,C,E){return x="error",S(c,C,E)}function O(c,C,E){if(c=="word")return x="attribute",g;if(c=="endTag"||c=="selfcloseTag"){var w=E.tagName,B=E.tagStart;return E.tagName=E.tagStart=null,c=="selfcloseTag"||G.autoSelfClosers.hasOwnProperty(w)?s(E,w):(s(E,w),E.context=new l(E,w,B==E.indented)),i}return x="error",O}function g(c,C,E){return c=="equals"?_:(G.allowMissing||(x="error"),O(c,C,E))}function _(c,C,E){return c=="string"?d:c=="word"&&G.allowUnquoted?(x="string",O):(x="error",O(c,C,E))}function d(c,C,E){return c=="string"?d:O(c,C,E)}return{startState:function(c){var C={tokenize:f,state:i,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(C.baseIndent=c),C},token:function(c,C){if(!C.tagName&&c.sol()&&(C.indented=c.indentation()),c.eatSpace())return null;L=null;var E=C.tokenize(c,C);return(E||L)&&E!="comment"&&(x=null,C.state=C.state(L||E,c,C),x&&(E=x=="error"?E+" error":x)),E},indent:function(c,C,E){var w=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+M;if(w&&w.noIndent)return ie.Pass;if(c.tokenize!=b&&c.tokenize!=f)return E?E.match(/^(\s*)/)[0].length:0;if(c.tagName)return G.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+M*(G.multilineTagIndentFactor||1);if(G.alignCDATA&&/$/,blockCommentStart:"",configuration:G.htmlMode?"html":"xml",helperType:G.htmlMode?"html":"xml",skipAttribute:function(c){c.state==_&&(c.state=O)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var C=[],E=c.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(it,Ee,U){it.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"24hK":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});class ie{constructor(N){this.element=N,this.next=ie.Undefined,this.prev=ie.Undefined}}ie.Undefined=new ie(void 0);class Y{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let N=this._first;for(;N!==ie.Undefined;){const z=N.next;N.prev=ie.Undefined,N.next=ie.Undefined,N=z}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(N){return this._insert(N,!1)}push(N){return this._insert(N,!0)}_insert(N,z){const I=new ie(N);if(this._first===ie.Undefined)this._first=I,this._last=I;else if(z){const G=this._last;this._last=I,I.prev=G,G.next=I}else{const G=this._first;this._first=I,I.next=G,G.prev=I}this._size+=1;let M=!1;return()=>{M||(M=!0,this._remove(I))}}shift(){if(this._first===ie.Undefined)return;{const N=this._first.element;return this._remove(this._first),N}}pop(){if(this._last===ie.Undefined)return;{const N=this._last.element;return this._remove(this._last),N}}_remove(N){if(N.prev!==ie.Undefined&&N.next!==ie.Undefined){const z=N.prev;z.next=N.next,N.next.prev=z}else N.prev===ie.Undefined&&N.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):N.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):N.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let N=this._first;for(;N!==ie.Undefined;)yield N.element,N=N.next}}},"3/fG":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});function ie(N,z){let I;return z.length===0?I=N:I=N.replace(/\{(\d+)\}/g,function(M,G){const K=G[0];return typeof z[K]!="undefined"?z[K]:M}),I}function Y(N,z,...I){return ie(z,I)}},"55Ip":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return s});var ie=U("Ty5D"),Y=U("dI71"),N=U("q1tI"),z=U.n(N),I=U("YS25"),M=U("17x9"),G=U.n(M),K=U("wx14"),n=U("zLVn"),L=U("9R94"),x=function(_){Object(Y.a)(d,_);function d(){for(var C,E=arguments.length,w=new Array(E),B=0;B=0||E.relatedTarget.className.indexOf("".concat(T,"-next"))>=0))return;_.setState({goInputText:""}),W(_.getValidValue())},_.go=function(E){var w=_.state.goInputText;if(w==="")return;(E.keyCode===h.ENTER||E.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(I.a)(g,[{key:"getValidValue",value:function(){var d=this.state,c=d.goInputText,C=d.current;return!c||isNaN(c)?C:Number(c)}},{key:"getPageSizeOptions",value:function(){var d=this.props,c=d.pageSize,C=d.pageSizeOptions;return C.some(function(E){return E.toString()===c.toString()})?C:C.concat([c.toString()]).sort(function(E,w){var B=isNaN(Number(E))?0:Number(E),W=isNaN(Number(w))?0:Number(w);return B-W})}},{key:"render",value:function(){var d=this,c=this.props,C=c.pageSize,E=c.locale,w=c.rootPrefixCls,B=c.changeSize,W=c.quickGo,T=c.goButton,k=c.selectComponentClass,m=c.buildOptionText,y=c.selectPrefixCls,H=c.disabled,Q=this.state.goInputText,te="".concat(w,"-options"),ae=k,Te=null,_e=null,ge=null;if(!B&&!W)return null;var ve=this.getPageSizeOptions();if(B&&ae){var Oe=ve.map(function(he,V){return n.a.createElement(ae.Option,{key:V,value:he.toString()},(m||d.buildOptionText)(he))});Te=n.a.createElement(ae,{disabled:H,prefixCls:y,showSearch:!1,className:"".concat(te,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||ve[0]).toString(),onChange:this.changeSize,getPopupContainer:function(V){return V.parentNode}},Oe)}return W&&(T&&(ge=typeof T=="boolean"?n.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(te,"-quick-jumper-button")},E.jump_to_confirm):n.a.createElement("span",{onClick:this.go,onKeyUp:this.go},T)),_e=n.a.createElement("div",{className:"".concat(te,"-quick-jumper")},E.jump_to,n.a.createElement("input",{disabled:H,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,ge)),n.a.createElement("li",{className:"".concat(te)},Te,_e)}}]),g}(n.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var p=o,l=U("N2Kk");function u(){}function s(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function i(R,O,g){return g}function D(R,O,g){var _=typeof R=="undefined"?O.pageSize:R;return Math.floor((g.total-1)/_)+1}var A=function(R){Object(M.a)(g,R);var O=Object(G.a)(g);function g(_){var d;Object(z.a)(this,g),d=O.call(this,_),d.getJumpPrevPage=function(){return Math.max(1,d.state.current-(d.props.showLessItems?3:5))},d.getJumpNextPage=function(){return Math.min(D(void 0,d.state,d.props),d.state.current+(d.props.showLessItems?3:5))},d.getItemIcon=function(B,W){var T=d.props.prefixCls,k=B||n.a.createElement("button",{type:"button","aria-label":W,className:"".concat(T,"-item-link")});return typeof B=="function"&&(k=n.a.createElement(B,Object(N.a)({},d.props))),k},d.savePaginationNode=function(B){d.paginationNode=B},d.isValid=function(B){return s(B)&&B!==d.state.current},d.shouldDisplayQuickJumper=function(){var B=d.props,W=B.showQuickJumper,T=B.pageSize,k=B.total;return k<=T?!1:W},d.handleKeyDown=function(B){(B.keyCode===h.ARROW_UP||B.keyCode===h.ARROW_DOWN)&&B.preventDefault()},d.handleKeyUp=function(B){var W=d.getValidValue(B),T=d.state.currentInputValue;W!==T&&d.setState({currentInputValue:W}),B.keyCode===h.ENTER?d.handleChange(W):B.keyCode===h.ARROW_UP?d.handleChange(W-1):B.keyCode===h.ARROW_DOWN&&d.handleChange(W+1)},d.changePageSize=function(B){var W=d.state.current,T=D(B,d.state,d.props);W=W>T?T:W,T===0&&(W=d.state.current),typeof B=="number"&&("pageSize"in d.props||d.setState({pageSize:B}),"current"in d.props||d.setState({current:W,currentInputValue:W})),d.props.onShowSizeChange(W,B),"onChange"in d.props&&d.props.onChange&&d.props.onChange(W,B)},d.handleChange=function(B){var W=d.props.disabled,T=B;if(d.isValid(T)&&!W){var k=D(void 0,d.state,d.props);T>k?T=k:T<1&&(T=1),"current"in d.props||d.setState({current:T,currentInputValue:T});var m=d.state.pageSize;return d.props.onChange(T,m),T}return d.state.current},d.prev=function(){d.hasPrev()&&d.handleChange(d.state.current-1)},d.next=function(){d.hasNext()&&d.handleChange(d.state.current+1)},d.jumpPrev=function(){d.handleChange(d.getJumpPrevPage())},d.jumpNext=function(){d.handleChange(d.getJumpNextPage())},d.hasPrev=function(){return d.state.current>1},d.hasNext=function(){return d.state.current2?T-2:0),m=2;m=C?w=C:w=Number(c),w}},{key:"getShowSizeChanger",value:function(){var d=this.props,c=d.showSizeChanger,C=d.total,E=d.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:C>E}},{key:"renderPrev",value:function(d){var c=this.props,C=c.prevIcon,E=c.itemRender,w=E(d,"prev",this.getItemIcon(C,"prev page")),B=!this.hasPrev();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:B}):w}},{key:"renderNext",value:function(d){var c=this.props,C=c.nextIcon,E=c.itemRender,w=E(d,"next",this.getItemIcon(C,"next page")),B=!this.hasNext();return Object(K.isValidElement)(w)?Object(K.cloneElement)(w,{disabled:B}):w}},{key:"render",value:function(){var d=this,c=this.props,C=c.prefixCls,E=c.className,w=c.style,B=c.disabled,W=c.hideOnSinglePage,T=c.total,k=c.locale,m=c.showQuickJumper,y=c.showLessItems,H=c.showTitle,Q=c.showTotal,te=c.simple,ae=c.itemRender,Te=c.showPrevNextJumpers,_e=c.jumpPrevIcon,ge=c.jumpNextIcon,ve=c.selectComponentClass,Oe=c.selectPrefixCls,he=c.pageSizeOptions,V=this.state,P=V.current,j=V.pageSize,$=V.currentInputValue;if(W===!0&&T<=j)return null;var J=D(void 0,this.state,this.props),X=[],ye=null,Re=null,Ke=null,pe=null,we=null,ke=m&&m.goButton,Ue=y?1:2,Qe=P-1>0?P-1:0,nt=P+1=Ue*2&&P!==1+2&&(X[0]=Object(K.cloneElement)(X[0],{className:"".concat(C,"-item-after-jump-prev")}),X.unshift(ye)),J-P>=Ue*2&&P!==J-2&&(X[X.length-1]=Object(K.cloneElement)(X[X.length-1],{className:"".concat(C,"-item-before-jump-next")}),X.push(Re)),Tt!==1&&X.unshift(Ke),bt!==J&&X.push(pe)}var q=null;Q&&(q=n.a.createElement("li",{className:"".concat(C,"-total-text")},Q(T,[T===0?0:(P-1)*j+1,P*j>T?T:P*j])));var se=!this.hasPrev()||!J,ue=!this.hasNext()||!J;return n.a.createElement("ul",Object(ie.a)({className:x()(C,E,Object(Y.a)({},"".concat(C,"-disabled"),B)),style:w,unselectable:"unselectable",ref:this.savePaginationNode},ot),q,n.a.createElement("li",{title:H?k.prev_page:null,onClick:this.prev,tabIndex:se?null:0,onKeyPress:this.runIfEnterPrev,className:x()("".concat(C,"-prev"),Object(Y.a)({},"".concat(C,"-disabled"),se)),"aria-disabled":se},this.renderPrev(Qe)),X,n.a.createElement("li",{title:H?k.next_page:null,onClick:this.next,tabIndex:ue?null:0,onKeyPress:this.runIfEnterNext,className:x()("".concat(C,"-next"),Object(Y.a)({},"".concat(C,"-disabled"),ue)),"aria-disabled":ue},this.renderNext(nt)),n.a.createElement(p,{disabled:B,locale:k,rootPrefixCls:C,selectComponentClass:ve,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:P,pageSize:j,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ke}))}}],[{key:"getDerivedStateFromProps",value:function(d,c){var C={};if("current"in d&&(C.current=d.current,d.current!==c.current&&(C.currentInputValue=C.current)),"pageSize"in d&&d.pageSize!==c.pageSize){var E=c.current,w=D(d.pageSize,c,d);E=E>w?w:E,"current"in d||(C.current=E,C.currentInputValue=E),C.pageSize=d.pageSize}return C}}]),g}(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(it,Ee,U){var ie,Y;(function(){var N;(function(){"use strict";var I=[function(n,L,x){var f=x(1).Beautifier,b=x(5).Options;function h(o,p){var l=new f(o,p);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new b}},function(n,L,x){var f=x(2).Output,b=x(3).Token,h=x(4),o=x(5).Options,p=x(7).Tokenizer,l=x(7).line_starters,u=x(7).positionable_operators,s=x(7).TOKEN;function i(y,H){return H.indexOf(y)!==-1}function D(y){return y.replace(/^\s+/g,"")}function A(y){for(var H={},Q=0;QQ&&(Q=y.line_indent_level));var te={mode:H,parent:y,last_token:y?y.last_token:new b(s.START_BLOCK,""),last_word:y?y.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Q,alignment:0,line_indent_level:y?y.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return te},k.prototype._reset=function(y){var H=y.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(c.BlockStatement);var Q=new p(y,this._options);return this._tokens=Q.tokenize(),y},k.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,H=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=` `,H&&h.lineBreak.test(H||"")&&(Q=H.match(h.lineBreak)[0]));for(var te=this._tokens.next();te;)this.handle_token(te),this._last_last_text=this._flags.last_token.text,this._flags.last_token=te,te=this._tokens.next();return y=this._output.get_code(Q),y},k.prototype.handle_token=function(y,H){y.type===s.START_EXPR?this.handle_start_expr(y):y.type===s.END_EXPR?this.handle_end_expr(y):y.type===s.START_BLOCK?this.handle_start_block(y):y.type===s.END_BLOCK?this.handle_end_block(y):y.type===s.WORD?this.handle_word(y):y.type===s.RESERVED?this.handle_word(y):y.type===s.SEMICOLON?this.handle_semicolon(y):y.type===s.STRING?this.handle_string(y):y.type===s.EQUALS?this.handle_equals(y):y.type===s.OPERATOR?this.handle_operator(y):y.type===s.COMMA?this.handle_comma(y):y.type===s.BLOCK_COMMENT?this.handle_block_comment(y,H):y.type===s.COMMENT?this.handle_comment(y,H):y.type===s.DOT?this.handle_dot(y):y.type===s.EOF?this.handle_eof(y):y.type===s.UNKNOWN?this.handle_unknown(y,H):this.handle_unknown(y,H)},k.prototype.handle_whitespace_and_comments=function(y,H){var Q=y.newlines,te=this._options.keep_array_indentation&&w(this._flags.mode);if(y.comments_before)for(var ae=y.comments_before.next();ae;)this.handle_whitespace_and_comments(ae,H),this.handle_token(ae,H),ae=y.comments_before.next();if(te)for(var Te=0;Te0,H);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,H);for(var _e=1;_e0&&(!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))},k.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},k.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},k.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},k.prototype.start_of_statement=function(y){var H=!1;return H=H||R(this._flags.last_token,["var","let","const"])&&y.type===s.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&R(this._flags.last_token,m)&&!y.newlines,H=H||S(this._flags.last_token,"else")&&!(S(y,"if")&&!y.comments_before),H=H||this._flags.last_token.type===s.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),H=H||this._flags.last_token.type===s.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==s.WORD&&y.type!==s.RESERVED,H=H||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),H?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,R(y,["do","for","if","while"])),!0):!1},k.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var H=c.Expression;if(y.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(y),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=c.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=c.ForInitializer):i(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=c.Conditional):i(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.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(y);else if(this._flags.last_token.type===s.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var te=this._tokens.peek(-4);R(Q,["async","function"])||Q.text==="*"&&R(te,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(te.text==="{"||te.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(y);(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===c.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(y,y.newlines),this.print_token(y),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},k.prototype.handle_end_expr=function(y){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.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(y),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},k.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var H=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===s.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Q&&(i(Q.text,[":",","])&&i(H.type,[s.STRING,s.WORD,s.RESERVED])||i(H.text,["get","set","..."])&&i(Q.type,[s.WORD,s.RESERVED]))?i(this._last_last_text,["class","interface"])&&!i(Q.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===s.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.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(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var te=!H.comments_before&&H.text==="}",ae=te&&this._flags.last_word==="function"&&this._flags.last_token.type===s.END_EXPR;if(this._options.brace_preserve_inline){var Te=0,_e=null;this._flags.inline_frame=!0;do if(Te+=1,_e=this._tokens.peek(Te-1),_e.newlines){this._flags.inline_frame=!1;break}while(_e.type!==s.EOF&&!(_e.type===s.END_BLOCK&&_e.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==s.OPERATOR&&(ae||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(y),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(y),this.indent(),!te&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},k.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===c.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(y)},k.prototype.handle_word=function(y){if(y.type===s.RESERVED){if(i(y.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)y.type=s.WORD;else if(y.text==="import"&&i(this._tokens.peek().text,["(","."]))y.type=s.WORD;else if(i(y.text,["as","from"])&&!this._flags.import_block)y.type=s.WORD;else if(this._flags.mode===c.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(y.type=s.WORD)}}if(this.start_of_statement(y)?R(this._flags.last_token,["var","let","const"])&&y.type===s.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!B(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(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(S(y,"while")){this._output.space_before_token=!0,this.print_token(y),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(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(y,["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(y),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(y)),S(y,"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()&&!y.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,m)?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&&(B(this._flags.mode)||w(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var Q="NONE";if(this._flags.last_token.type===s.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":R(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&this._flags.mode===c.BlockStatement?Q="NEWLINE":this._flags.last_token.type===s.SEMICOLON&&B(this._flags.mode)?Q="SPACE":this._flags.last_token.type===s.STRING?Q="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===c.ObjectLiteral&&i(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===s.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===s.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),R(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),R(y,["else","catch","finally"]))if((!(this._flags.last_token.type===s.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var te=this._output.current_line;te.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(y,["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(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(y,"if")&&S(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(y,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():Q==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===s.WORD||y.previous.type===s.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===s.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(y,"from")&&(this._flags.import_block=!1))},k.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var H=this._tokens.peek();this._flags.mode===c.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(y)},k.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===s.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),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(y):y.text.startsWith("`")&&this._flags.last_token.type===s.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},k.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},k.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(B(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(y)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},k.prototype.handle_operator=function(y){var H=y.text==="*"&&(R(this._flags.last_token,["function","yield"])||i(this._flags.last_token.type,[s.START_BLOCK,s.COMMA,s.END_BLOCK,s.SEMICOLON])),Q=i(y.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(y)){var te=!H;this.handle_whitespace_and_comments(y,te)}if(y.text==="*"&&this._flags.last_token.type===s.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===s.OPERATOR&&i(this._options.operator_position,d)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),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 ae=!0,Te=!0,_e=!1;if(y.text===":"?this._flags.ternary_depth===0?ae=!1:(this._flags.ternary_depth-=1,_e=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!H&&this._options.preserve_newlines&&i(y.text,u)){var ge=y.text===":",ve=ge&&_e,Oe=ge&&!_e;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!Oe,this.print_token(y),(!ge||ve)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!ge||ve?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case _.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(y),ae=!(this._output.just_added_newline()||Oe),this._output.space_before_token=ae,this.print_token(y),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(y),ae=!1;var he=this._tokens.peek();Te=he&&i(he.type,[s.WORD,s.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),ae=this._flags.last_token.type===s.START_BLOCK,Te=!1;else if(i(y.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===s.COMMA||this._flags.last_token.type===s.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),ae=!1,Te=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var V=R(this._flags.last_token,O)&&y.newlines;V&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(V,!0)}this._flags.last_token.text===";"&&B(this._flags.mode)&&(ae=!0),this._flags.last_token.type===s.RESERVED?ae=!0:this._flags.last_token.type===s.END_EXPR?ae=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===s.OPERATOR&&(ae=i(y.text,["--","-","++","+"])&&i(this._flags.last_token.text,["--","-","++","+"]),i(y.text,["+","-"])&&i(this._flags.last_token.text,["--","++"])&&(Te=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ae,this.print_token(y),this._output.space_before_token=Te},k.prototype.handle_block_comment=function(y,H){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,H),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,H)},k.prototype.print_block_commment=function(y,H){var Q=E(y.text),te,ae=!1,Te=!1,_e=y.whitespace_before,ge=_e.length;if(this.print_newline(!1,H),this.print_token_line_indentation(y),this._output.add_token(Q[0]),this.print_newline(!1,H),Q.length>1){for(Q=Q.slice(1),ae=W(Q,"*"),Te=T(Q,_e),ae&&(this._flags.alignment=1),te=0;te=0;h--)if(this.__items[h].match(b))return!0;return!1},L.prototype.set_indent=function(b,h){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(b){this.__items.push(b);var h=b.lastIndexOf(` `);h!==-1?this.__character_count=b.length-h:this.__character_count+=b.length},L.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function x(b,h){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),h=h||"",b.indent_level>0&&(h=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}x.prototype.get_indent_size=function(b,h){var o=this.__base_string_length;return h=h||0,b<0&&(o=0),o+=b*this.__indent_size,o+=h,o},x.prototype.get_indent_string=function(b,h){var o=this.__base_string;return h=h||0,b<0&&(b=0,o=""),h+=b*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},x.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var b=this.__cache.length,h=0,o="";this.__indent_size&&b>=this.__indent_size&&(h=Math.floor(b/this.__indent_size),b-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),b&&(o+=new Array(b+1).join(" ")),this.__cache.push(o)};function f(b,h){this.__indent_cache=new x(b,h),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(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(b,h){return this.__indent_cache.get_indent_string(b,h)},f.prototype.get_indent_size=function(b,h){return this.__indent_cache.get_indent_size(b,h)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(b){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return b!==` `&&(o=o.replace(/[\n]/g,b)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(b,h){return b=b||0,h=h||0,this.next_line.set_indent(b,h),this.__lines.length>1?(this.current_line.set_indent(b,h),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(b){for(var h=0;h1&&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(b,h){for(var o=this.__lines.length-2;o>=0;){var p=this.__lines[o];if(p.is_empty())break;if(p.item(0).indexOf(b)!==0&&p.item(-1)!==h){this.__lines.splice(o+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},function(n){function L(x,f,b,h){this.type=x,this.text=f,this.comments_before=null,this.newlines=b||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}n.exports.Token=L},function(n,L){var x="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",b="\\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",h="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+x+b+"])",p="(?:\\\\u[0-9a-fA-F]{4}|["+f+b+h+"])*";L.identifier=new RegExp(o+p,"g"),L.identifierStart=new RegExp(o),L.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+b+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;L.newline=/[\n\r\u2028\u2029]/,L.lineBreak=new RegExp(`\r |`+L.newline.source),L.allLineBreaks=new RegExp(L.lineBreak.source,"g")},function(n,L,x){var f=x(6).Options,b=["before-newline","after-newline","preserve-newline"];function h(o){f.call(this,o,"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>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var _=new RegExp(g),d="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=d.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+c.join("|")+")$"),E,w=function(W,T){b.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 k=new l(this._input),m=new u(this._input).read_options(this._options);this.__patterns={template:m,identifier:m.starting_with(p.identifier).matching(p.identifierMatch),number:k.matching(A),punct:k.matching(_),comment:k.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:k.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:k.matching(//),include:k.starting_with(/#include/).until_after(p.lineBreak),shebang:k.starting_with(/#!/).until_after(p.lineBreak),xml:k.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:m.until(/['\\\n\r\u2028\u2029]/),double_quote:m.until(/["\\\n\r\u2028\u2029]/),template_text:m.until(/[`\\$]/),template_expression:m.until(/[`}\\]/)}};w.prototype=new b,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 k=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(i.EOF,""):(k=k||this._read_non_javascript(m),k=k||this._read_string(m),k=k||this._read_word(W),k=k||this._read_singles(m),k=k||this._read_comment(m),k=k||this._read_regexp(m,W),k=k||this._read_xml(m,W),k=k||this._read_punctuation(),k=k||this._create_token(i.UNKNOWN,this._input.next()),k)},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 k="#";if(this._input.hasNext()&&this._input.testChar(S)){do W=this._input.next(),k+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(k+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(k+="{}",this._input.next(),this._input.next())),this._create_token(i.WORD,k)}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 k="";if(this._input.peek(1)==="*"){k=this.__patterns.block_comment.read();var m=D.get_directives(k);m&&m.ignore==="start"&&(k+=D.readIgnored(this._input)),k=k.replace(p.allLineBreaks,` `),T=this._create_token(i.BLOCK_COMMENT,k),T.directives=m}else this._input.peek(1)==="/"&&(k=this.__patterns.comment.read(),T=this._create_token(i.COMMENT,k))}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=B(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 k=this._input.next(),m=!1,y=!1;this._input.hasNext()&&(m||y||this._input.peek()!==W)&&!this._input.testChar(p.newline);)k+=this._input.peek(),m?m=!1:(m=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===W&&(k+=this._input.next(),k+=this._input.read(p.identifier)),this._create_token(i.STRING,k)}return null},w.prototype._read_xml=function(W,T){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(T)){var k="",m=this.__patterns.xml.read_match();if(m){for(var y=m[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=y.indexOf("{")===0,Q=0;m;){var te=!!m[1],ae=m[2],Te=!!m[m.length-1]||ae.slice(0,8)==="![CDATA[";if(!Te&&(ae===y||H&&ae.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(te?--Q:++Q),k+=m[0],Q<=0)break;m=this.__patterns.xml.read_match()}return m||(k+=this._input.match(/[\s\S]*/g)[0]),k=k.replace(p.allLineBreaks,` `),this._create_token(i.STRING,k)}}return null};function B(W){for(var T="",k=0,m=new f(W),y=null;m.hasNext();)if(y=m.match(/([\s]|[^\\]|\\\\)+/g),y&&(T+=y[0]),m.peek()==="\\"){if(m.next(),m.peek()==="x")y=m.match(/x([0-9A-Fa-f]{2})/g);else if(m.peek()==="u")y=m.match(/u([0-9A-Fa-f]{4})/g);else{T+="\\",m.hasNext()&&(T+=m.next());continue}if(!y)return W;if(k=parseInt(y[1],16),k>126&&k<=255&&y[0].indexOf("x")===0)return W;if(k>=0&&k<32){T+="\\"+y[0];continue}else k===34||k===39||k===92?T+="\\"+String.fromCharCode(k):T+=String.fromCharCode(k)}return T}w.prototype._read_string_recursive=function(W,T,k){var m,y;W==="'"?y=this.__patterns.single_quote:W==='"'?y=this.__patterns.double_quote:W==="`"?y=this.__patterns.template_text:W==="}"&&(y=this.__patterns.template_expression);for(var H=y.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===W||!T&&p.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(m=this._input.peek(),m==="x"||m==="u"?this.has_char_escapes=!0:m==="\r"&&this._input.peek(1)===` `&&this._input.next(),Q+=this._input.next()):k&&(k==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),k===Q&&(W==="`"?Q+=this._read_string_recursive("}",T,"`"):Q+=this._read_string_recursive("`",T,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=y.read(),H+=Q}return H},n.exports.Tokenizer=w,n.exports.TOKEN=i,n.exports.positionable_operators=O.slice(),n.exports.line_starters=d.slice()},function(n){var L=RegExp.prototype.hasOwnProperty("sticky");function x(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position=0&&f=0&&b=f.length&&this.__input.substring(b-f.length,b).toLowerCase()===f},n.exports.InputScanner=x},function(n,L,x){var f=x(8).InputScanner,b=x(3).Token,h=x(10).TokenStream,o=x(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 o(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var u,s=new b(p.START,""),i=null,D=[],A=new h;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 h),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 b(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 L(x){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=x}L.prototype.restart=function(){this.__position=0},L.prototype.isEmpty=function(){return this.__tokens_length===0},L.prototype.hasNext=function(){return this.__position=0&&x/),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}/)}}h.prototype=new f,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(o){var p=this._create();return p._disabled[o]=!0,p._update(),p},h.prototype.read_options=function(o){var p=this._create();for(var l in b)p._disabled[l]=o.templating.indexOf(l)===-1;return p._update(),p},h.prototype.exclude=function(o){var p=this._create();return p._excluded[o]=!0,p._update(),p},h.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),o+=p,p=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},h.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},h.prototype._read_template=function(){var o="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(o=o||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},n.exports.TemplatablePattern=h}],M={};function G(n){var L=M[n];if(L!==void 0)return L.exports;var x=M[n]={exports:{}};return I[n](x,x.exports,G),x.exports}var K=G(0);N=K})();var z=N;!(ie=[],Y=function(){return{js_beautify:z}}.apply(Ee,ie),Y!==void 0&&(it.exports=Y))})()},"746U":function(it,Ee,U){"use strict";U.d(Ee,"f",function(){return ie}),U.d(Ee,"l",function(){return Y}),U.d(Ee,"k",function(){return N}),U.d(Ee,"j",function(){return z}),U.d(Ee,"g",function(){return I}),U.d(Ee,"m",function(){return M}),U.d(Ee,"h",function(){return G}),U.d(Ee,"n",function(){return K}),U.d(Ee,"c",function(){return n}),U.d(Ee,"a",function(){return L}),U.d(Ee,"i",function(){return x}),U.d(Ee,"o",function(){return f}),U.d(Ee,"e",function(){return o}),U.d(Ee,"d",function(){return p}),U.d(Ee,"p",function(){return l}),U.d(Ee,"b",function(){return u});function ie(s){return Array.isArray(s)}function Y(s){return typeof s=="string"}function N(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 I(s){return s===!0||s===!1}function M(s){return typeof s=="undefined"}function G(s){return!K(s)}function K(s){return M(s)||s===null}function n(s,i){if(!s)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function L(s){if(K(s))throw new Error("Assertion Failed: argument is undefined or null");return s}function x(s){return typeof s=="function"}function f(s,i){const D=Math.min(s.length,i.length);for(let A=0;Afunction(){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(it,Ee,U){"use strict";var ie=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 N(){if(!ie)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ie(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 I(b){return typeof b=="string"&&z.test(b)}for(var M=I,G=[],K=0;K<256;++K)G.push((K+256).toString(16).substr(1));function n(b){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(G[b[h+0]]+G[b[h+1]]+G[b[h+2]]+G[b[h+3]]+"-"+G[b[h+4]]+G[b[h+5]]+"-"+G[b[h+6]]+G[b[h+7]]+"-"+G[b[h+8]]+G[b[h+9]]+"-"+G[b[h+10]]+G[b[h+11]]+G[b[h+12]]+G[b[h+13]]+G[b[h+14]]+G[b[h+15]]).toLowerCase();if(!M(o))throw TypeError("Stringified UUID is invalid");return o}var L=n;function x(b,h,o){b=b||{};var p=b.random||(b.rng||N)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,h){o=o||0;for(var l=0;l<16;++l)h[o+l]=p[l];return h}return L(p)}var f=Ee.a=x},"7ahc":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return D});var ie=U("k1fw"),Y=U("0Owb"),N=U("+L6B"),z=U("2/Rp"),I=U("y8nQ"),M=U("Vl3Y"),G=U("tJVT"),K=U("OaEy"),n=U("2fM7"),L=U("q1tI"),x=U.n(L),f=U("VrN/"),b=U.n(f),h=U("p77/"),o=U.n(h),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"]};Ee.b=function(A){var S=A.callback,R=A.onCancel,O=Object(L.useState)("python"),g=Object(G.a)(O,2),_=g[0],d=g[1];function c(E){d(i[E][1])}function C(E){S(E)}return x.a.createElement(M.a,Object(Y.a)({},s,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),x.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},x.a.createElement(n.a,{onChange:c},Object.keys(i).map(function(E){return x.a.createElement(u,{key:E,value:E},i[E][0])}))),x.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},x.a.createElement(D,{mode:_})),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement(z.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function D(A){var S=A.value,R=A.onChange,O=A.mode,g=A.options,_=g===void 0?{}:g,d=Object(L.useRef)(),c=Object(L.useState)(),C=Object(G.a)(c,2),E=C[0],w=C[1];return Object(L.useEffect)(function(){if(E){function B(W){var T=W.getValue();R&&R(T)}return E.on("change",B),function(){E.off("change",B)}}},[E,R]),Object(L.useEffect)(function(){E&&E.setOption("mode",O)},[E,O]),Object(L.useEffect)(function(){E&&((S!==E.getValue()||S==="")&&setTimeout(function(){E.setValue(S||" ")},300))},[E,S]),Object(L.useEffect)(function(){if(d.current&&!E){var B=b.a.fromTextArea(d.current,Object(ie.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));w(B)}},[d.current,E]),x.a.createElement("div",{className:"my-codemirror-container"},x.a.createElement("textarea",{ref:d}))}},"815F":function(it,Ee,U){"use strict";U.d(Ee,"e",function(){return G}),U.d(Ee,"c",function(){return n}),U.d(Ee,"d",function(){return L}),U.d(Ee,"a",function(){return f}),U.d(Ee,"f",function(){return b}),U.d(Ee,"b",function(){return h});var ie=U("KQm4"),Y=U("VTBJ"),N=U("Ff2n"),z=U("Zm9Q"),I=U("Kwbf"),M=U("OZM5");function G(o,p){return o!=null?o:p}function K(){var o=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(I.a)(D!=null,"Tree node must have a certain key: [".concat(s).concat(D,"]"));var S=String(D);Object(I.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(o)}function n(o){function p(l){var u=Object(z.a)(l);return u.map(function(s){if(!Object(M.i)(s))return Object(I.a)(!s,"Tree/TreeNode can only accept TreeNode as children."),null;var i=s.key,D=s.props,A=D.children,S=Object(N.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(o)}function L(){var o=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(M.h)(D?D.pos:"0",S),O=G(A.key,R),g=Object(Y.a)(Object(Y.a)({},A),{},{parent:D,pos:R,children:null,data:A,isStart:[].concat(Object(ie.a)(D?D.isStart:[]),[S===0]),isEnd:[].concat(Object(ie.a)(D?D.isEnd:[]),[S===i.length-1])});return u.push(g),p===!0||l.has(O)?g.children=s(A.children||[],g):g.children=[],g})}return s(o),u}function x(o,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:o,R=i?Object(M.h)(A.pos,D):"0";if(i){var O=u(i,R),g={node:i,index:D,pos:R,key:O,parentPos:A.node?A.pos:null,level:A.level+1};p(g)}S&&S.forEach(function(_,d){s(_,d,{node:i,pos:R,level:A?A.level+1:-1})})}s(null)}function f(o){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),x(o,function(R){var O=R.node,g=R.index,_=R.pos,d=R.key,c=R.parentPos,C=R.level,E={node:O,index:g,key:d,pos:_,level:C},w=G(d,_);D[_]=E,A[w]=E,E.parent=D[c],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),u&&u(E,S)},i),s&&s(S),S}function b(o,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,g=O[o],_={eventKey:o,expanded:l.indexOf(o)!==-1,selected:u.indexOf(o)!==-1,loaded:s.indexOf(o)!==-1,loading:i.indexOf(o)!==-1,checked:D.indexOf(o)!==-1,halfChecked:A.indexOf(o)!==-1,pos:String(g?g.pos:""),dragOver:S===o&&R===0,dragOverGapTop:S===o&&R===-1,dragOverGapBottom:S===o&&R===1};return _}function h(o){var p=o.data,l=o.expanded,u=o.selected,s=o.checked,i=o.loaded,D=o.loading,A=o.halfChecked,S=o.dragOver,R=o.dragOverGapTop,O=o.dragOverGapBottom,g=o.pos,_=o.active,d=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:g,active:_});return"props"in d||Object.defineProperty(d,"props",{get:function(){return Object(I.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),d}},"8EBN":function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";ie.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-1&&z.substring(G+1,z.length);if(K)return ie.findModeByExtension(K)},ie.findModeByName=function(z){z=z.toLowerCase();for(var I=0;I=se.length?ue.slice(se.length):ue}).join(` `)}var l=[],u=["
    "],s=new h.a.Renderer,i=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function D(){l.length=0,u=["
      "]}var A={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(me,ne,q,se){if(ne>=me.length||me[ne].level<=q)return ne;var ue=me[ne];se.push("
    • "+ue.text+""),ne++;var oe=[];return ne=S(me,ne,ue.level,oe),oe.length>0&&(se.push("
        "),oe.forEach(function(ce){se.push(ce)}),se.push("
      ")),se.push("
    • "),ne=S(me,ne,q,se),ne}function R(){return S(l,0,0,u),u.push("
    "),u.join("")}var O={heading:function(ne){var q=i.exec(ne);if(q)return{type:"heading",raw:q[0],depth:q[1].length,text:q[2]}},fences:function(ne){var q=this.rules.block.fences.exec(ne);if(q){var se=q[0],ue=p(se,q[3]||""),oe=q[2]?q[2].trim():q[2];if(["latex","katex","math"].indexOf(oe)>=0){var ce=d(),be=ue;ue=ce,c[ce]={type:"block",expression:be}}return{type:"code",raw:se,lang:oe,text:ue}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,d=function(){return"__special_katext_id_".concat(_++,"__")},c={};function C(){return c}function E(){_=0,c={}}function w(me){return me=me.replace(g,function(ne,q){var se=d();return c[se]={type:"inline",expression:q},se}),me}var B=s.listitem;s.listitem=function(me){return B(w(me))};var W=s.paragraph;s.paragraph=function(me){return W(w(me))};var T=s.tablecell;s.tablecell=function(me,ne){return T(w(me),ne)},s.code=function(me,ne,q){var se=(ne||"").match(/\S*/)[0];return se?["latex","katex","math"].indexOf(se)>=0?"

    ".concat(me,"

    "):'
    ').concat(q?me:Object(o.escape)(me,!0),`
    `):'
    '+(q?me:Object(o.escape)(me,!0))+"
    "},s.heading=function(me,ne,q){var se=this.options.headerPrefix+q.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:se,level:ne,text:me}),"'+me+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:O,renderer:s});var k=h.a,m=U("SJMd"),y=U("ulZh"),H=U.n(y),Q=U("m3rI"),te=U("Oy/b"),ae=U("p5ED"),Te=U("ErOA"),_e=U("STEk");/* ********************************** cropro version 1.2.0 @license SEE LICENSE IN LICENSE copyright Alan Mendelevich see README and LICENSE for details ********************************** *//*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var ge=function(me,ne){return(ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(q,se){q.__proto__=se}||function(q,se){for(var ue in se)Object.prototype.hasOwnProperty.call(se,ue)&&(q[ue]=se[ue])})(me,ne)};function ve(me,ne){if(typeof ne!="function"&&ne!==null)throw new TypeError("Class extends value "+String(ne)+" is not a constructor or null");function q(){this.constructor=me}ge(me,ne),me.prototype=ne===null?Object.create(ne):(q.prototype=ne.prototype,new q)}function Oe(me,ne,q,se){return new(q||(q=Promise))(function(ue,oe){function ce(Pe){try{Se(se.next(Pe))}catch(We){oe(We)}}function be(Pe){try{Se(se.throw(Pe))}catch(We){oe(We)}}function Se(Pe){var We;Pe.done?ue(Pe.value):(We=Pe.value,We instanceof q?We:new q(function(et){et(We)})).then(ce,be)}Se((se=se.apply(me,ne||[])).next())})}function he(me,ne){var q,se,ue,oe,ce={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return oe={next:be(0),throw:be(1),return:be(2)},typeof Symbol=="function"&&(oe[Symbol.iterator]=function(){return this}),oe;function be(Se){return function(Pe){return function(We){if(q)throw new TypeError("Generator is already executing.");for(;ce;)try{if(q=1,se&&(ue=2&We[0]?se.return:We[0]?se.throw||((ue=se.return)&&ue.call(se),0):se.next)&&!(ue=ue.call(se,We[1])).done)return ue;switch(se=0,ue&&(We=[2&We[0],ue.value]),We[0]){case 0:case 1:ue=We;break;case 4:return ce.label++,{value:We[1],done:!1};case 5:ce.label++,se=We[1],We=[0];continue;case 7:We=ce.ops.pop(),ce.trys.pop();continue;default:if(!(ue=ce.trys,(ue=ue.length>0&&ue[ue.length-1])||We[0]!==6&&We[0]!==2)){ce=0;continue}if(We[0]===3&&(!ue||We[1]>ue[0]&&We[1]0&&q>0){var se=new we(ne,q),ue=se.ratio>=1?20:se.getHorizontalLength(20),oe=se.ratio<1?20:se.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var be=P.createDefs();ce.appendChild(be);var Se=P.createElement("clipPath",[["id","text-bg-clip"]]);be.appendChild(Se);var Pe=P.createPath(P.getHollowRectanglePath((24-ue)/2,(24-oe)/2,ue,oe,(24-ue)/2+2,(24-oe)/2+2,ue-4,oe-4));ce.appendChild(Pe);var We=P.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(P.createTSpan(ne+":"+q)),ce.appendChild(We);var et=We.getBBox();P.setAttributes(We,[["x",((24-et.width)/2).toString()],["y",((24-et.height)/2-et.y).toString()]]);var yt=P.createPath(P.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(et.width))/2,(24-Math.ceil(et.height))/2,Math.ceil(et.width),Math.ceil(et.height)));return Se.appendChild(yt),P.setAttributes(Pe,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.outerHTML}return''},me}(),Ue=function(me){function ne(q,se,ue){var oe=me.call(this,q,se)||this;return oe.isDropdownOpen=!1,oe.onClick=oe.dropdownButtonClicked,oe.dropdownButtons=ue,oe}return ve(ne,me),ne.prototype.setupDropdown=function(){var q=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(se){se.className=q.className,se.colorsClassName=q.colorsClassName,q.dropdownBlock.appendChild(se.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},ne.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},ne.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},ne.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},ne.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},ne.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},ne}(Ke),Qe=function(){function me(ne,q){this.GRIP_SIZE=10,this.color=ne,this.fillColor=q,this.visual=P.createGroup(),this.visual.appendChild(P.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(P.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return me.prototype.ownsTarget=function(ne){return ne===this.visual||ne===this.visual.childNodes[0]||ne===this.visual.childNodes[1]},me.prototype.setCenter=function(ne,q){this.visual.childNodes.forEach(function(se){return P.setAttributes(se,[["cx",ne.toString()],["cy",q.toString()]])})},me}(),nt=function(){function me(ne,q,se,ue){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=ne,this.canvasHeight=q,this.margin=se,this.container=ue,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(me.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(ne){this._aspectRatio=ne,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ne){this._isGridVisible=ne,this.gridContainer&&P.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(ne){this._zoomFactor=ne,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),me.prototype.open=function(){var ne=this;this.cropShadeElement=P.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=P.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var q=0;qthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-q.height/2),P.setAttributes(this.cropRectElement,[["x",q.x.toString()],["y",q.y.toString()],["width",q.width.toString()],["height",q.height.toString()]]);var se=q.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(oe,ce){var be=q.y+se*(ce+1);P.setAttributes(oe,[["x1",""+q.x],["y1",""+be],["x2",""+(q.x+q.width)],["y2",""+be]])});var ue=q.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(oe,ce){var be=q.x+ue*(ce+1);P.setAttributes(oe,[["x1",""+be],["y1",""+q.y],["x2",""+be],["y2",""+(q.y+q.height)]])}),P.setAttributes(this.cropShadeElement,[["d",P.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,q.x,q.y,q.width,q.height)]]),this.topLeftGrip.setCenter(q.x,q.y),this.topRightGrip.setCenter(q.x+q.width,q.y),this.bottomLeftGrip.setCenter(q.x,q.y+q.height),this.bottomRightGrip.setCenter(q.x+q.width,q.y+q.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},me.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)},me.prototype.clientToLocalCoordinates=function(ne,q){var se=this.container.getBoundingClientRect();return{x:ne-se.left+this.margin,y:q-se.top+this.margin}},me.prototype.onPointerDown=function(ne){this.container.setPointerCapture(ne.pointerId),this.previousPoint=this.clientToLocalCoordinates(ne.clientX,ne.clientY),this.cropRectElement===ne.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(ne.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(ne.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(ne.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(ne.target)&&(this.activeGrip=this.bottomRightGrip)},me.prototype.onPointerMove=function(ne){if(this.isMoving)this.move(this.clientToLocalCoordinates(ne.clientX,ne.clientY));else if(this.activeGrip){var q=this.clientToLocalCoordinates(ne.clientX,ne.clientY);this.resize(q)}ne.preventDefault()},me.prototype.onPointerUp=function(ne){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(ne.pointerId)},me.prototype.move=function(ne){var q=ne.x-this.previousPoint.x,se=ne.y-this.previousPoint.y;this.zoomFactor!==1&&(q=-q/this.zoomFactor,se=-se/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+q),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+se),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=ne},me.prototype.resize=function(ne){var q=Object.assign({},this.cropRect),se=ne.x-this.previousPoint.x,ue=ne.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:q.x+sethis.canvasWidth*this.zoomFactor&&(se=this.canvasWidth*this.zoomFactor-q.width),q.width+=se}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(q.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(se),q.height=this.aspectRatio.getVerticalLength(q.width)):(q.y+=ue,q.height=this.cropRect.y+this.cropRect.height-q.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?q.height=this.aspectRatio.getVerticalLength(q.width):q.height+=ue}q.width<10&&(q.x=this.cropRect.x,q.width=10),q.height<10&&(q.y=this.cropRect.y,q.height=10),this.previousPoint=ne,q.x>=this.margin&&q.y>=this.margin&&q.x-this.margin+q.width<=this.canvasWidth&&q.y-this.margin+q.height<=this.canvasHeight&&(this.cropRect=q,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},me.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var ne=this.cropRect.x+this.cropRect.width/2,q=this.cropRect.y+this.cropRect.height/2,se=this.aspectRatio.getHorizontalLength(this.cropRect.height),ue=this.aspectRatio.getVerticalLength(this.cropRect.width);se/this.canvasWidththis.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=ne-this.cropRect.width/2,this.cropRect.y=q-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)}},me.prototype.getRescaledRect=function(ne,q,se,ue,oe,ce){var be=se/ne,Se=ue/q;return{x:(oe.x-ce)*be+ce,y:(oe.y-ce)*Se+ce,width:oe.width*be,height:oe.height*Se}},me.prototype.scaleCanvas=function(ne,q){var se=this.getRescaledRect(this.canvasWidth,this.canvasHeight,ne,q,this.cropRect,this.margin);this.canvasWidth=ne,this.canvasHeight=q,this.onCropChange&&this.onCropChange(se),this.setCropRectangle(se)},me}(),ot=function(){function me(ne){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=ne,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(me.prototype,"angle",{get:function(){return this._angle},set:function(ne){this._angle=ne,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),me.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},me.prototype.onPointerDown=function(ne){this.controlContainer.setPointerCapture(ne.pointerId),this.isDragging=!0,this.previousPoint={x:ne.clientX,y:ne.clientY}},me.prototype.onPointerMove=function(ne){this.isDragging&&(this.onAngleChange&&this.onAngleChange((ne.clientX-this.previousPoint.x)/5),this.previousPoint.x=ne.clientX)},me.prototype.onPointerUp=function(ne){this.isDragging&&this.onAngleChange&&this.onAngleChange((ne.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(ne.pointerId)},me.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var ne=this.angleLabelText.getBBox();P.setAttributes(this.angleLabelElement,[["x",((this.width-ne.width)/2).toString()],["y",(this.height/2).toString()]])}},me.prototype.positionScaleShape=function(){if(this.scaleShape){var ne=this.scaleShape.transform.baseVal.getItem(0);ne.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(ne,0)}},me.prototype.getVisual=function(){var ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.setAttribute("width",this.width+"px"),ne.setAttribute("height",this.height+"px"),ne.setAttribute("viewBox","0 0 "+this.width+" "+this.height),ne.style.flexShrink="0",document.body.appendChild(ne);for(var q="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,se=1;se<=this.width/5+10;se++){var ue=se%5==0?this.height/3:this.height/6;q+="h4v"+-ue+"h1v"+ue}q+="v1H0Z",this.scaleShape=P.createPath(q);var oe=P.createTransform();this.scaleShape.transform.baseVal.appendItem(oe),ne.appendChild(this.scaleShape),this.angleLabelElement=P.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=P.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=P.createTSpan("");return ce.innerHTML="°",this.angleLabelElement.appendChild(ce),ne.appendChild(this.angleLabelElement),document.body.removeChild(ne),ne},me}(),qe=function(){function me(){this.naturalSize=!1,this.imageType="image/png"}return me.prototype.rasterize=function(ne,q,se,ue,oe,ce,be){var Se=this;return new Promise(function(Pe){var We=document.createElement("canvas");We.width=ne.width.baseVal.value-2*ue,We.height=ne.height.baseVal.value-2*ue;var et=1,yt=1;Se.naturalSize===!0?(et=q.naturalWidth/(ne.width.baseVal.value-2*ue)/ce,yt=q.naturalHeight/(ne.height.baseVal.value-2*ue)/be,We.width=q.naturalWidth/ce,We.height=q.naturalHeight/be):Se.width!==void 0&&Se.height!==void 0&&(et=Se.width/se.width,yt=Se.height/se.height,We.width*=et,We.height*=yt);var Rt=We.getContext("2d");Rt.translate(We.width/2,We.height/2),Rt.rotate(oe*Math.PI/180),Rt.scale(ce,be),Rt.translate(-We.width/2,-We.height/2),Rt.drawImage(q,0,0,We.width,We.height);var kt=document.createElement("canvas");kt.width=se.width*et,kt.height=se.height*yt,kt.getContext("2d").putImageData(Rt.getImageData((se.x-ue)*et,(se.y-ue)*yt,se.width*et,se.height*yt),0,0),Pe(kt.toDataURL(Se.imageType,Se.imageQuality))})},me}(),ft=function(){function me(ne){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=me.instanceCounter++,this.styles=new j(this.instanceNo),this.target=ne,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(me.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(ne){this._zoomToCropEnabled=ne,ne?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(ne){this._isGridVisible=ne,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"gridLines",{get:function(){return this._gridLines},set:function(ne){this._gridLines=ne,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(ne){this._rotationAngle=ne,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(me.prototype,"aspectRatio",{get:function(){var ne;return(ne=this._aspectRatio)!==null&&ne!==void 0?ne:this.aspectRatios[0]},set:function(ne){this._aspectRatio=ne},enumerable:!1,configurable:!0}),me.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},me.prototype.show=function(){this.showUI(),this.open()},me.prototype.close=function(ne){ne===void 0&&(ne=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),ne||this.closeEventListeners.forEach(function(q){return q()}),this._isOpen=!1)},me.prototype.addRenderEventListener=function(ne){this.renderEventListeners.push(ne)},me.prototype.removeRenderEventListener=function(ne){this.renderEventListeners.indexOf(ne)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(ne),1)},me.prototype.addCloseEventListener=function(ne){this.closeEventListeners.push(ne)},me.prototype.removeCloseEventListener=function(ne){this.closeEventListeners.indexOf(ne)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(ne),1)},me.prototype.setupResizeObserver=function(){var ne=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ne.resize(ne.target.clientWidth,ne.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))},me.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var ne=1*this.target.clientWidth/this.target.clientHeight,q=this.contentDiv.clientWidth/ne>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*ne:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,se=q+2*this.CANVAS_MARGINne+this.CANVAS_MARGIN?this.target.offsetTop-(ne+this.CANVAS_MARGIN):0;this.coverDiv.style.top=q+"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},me.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},me.prototype.addTopToolbar=function(){var ne=this;this.topToolbar=new X,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 q=new Re;q.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(q);var se=[];this.aspectRatios.forEach(function(yt){var Rt=new Ke(ke.getIcon(yt.horizontal,yt.vertical),yt.horizontal===0&&yt.vertical===0?"FREE":yt.horizontal+":"+yt.vertical);Rt.onClick=function(){return ne.ratioButtonClicked(yt)},se.push(Rt)}),this.aspectRatioButton=new Ue(ke.getIcon(0,0),"Aspect ratio",se),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,q.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ue=new Ke('',"Toggle grid");ue.isActive=this.isGridVisible,ue.onClick=function(){ne.isGridVisible=!ne.isGridVisible,ue.isActive=ne.isGridVisible},q.addButton(ue);var oe=new Ke('',"Zoom to selection");if(oe.isActive=this.zoomToCropEnabled,oe.onClick=function(){ne.zoomToCropEnabled=!ne.zoomToCropEnabled,oe.isActive=ne.zoomToCropEnabled},q.addButton(oe),!V.isLicensed){var ce=new pe;this.topToolbar.addElementBlock(ce);var be=document.createElement("div");be.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Se=document.createElement("a");Se.style.color="currentColor",Se.href="https://markerjs.com/products/cropro",Se.target="_blank",Se.innerHTML='',be.appendChild(Se),ce.addElement(be)}var Pe=new Re;Pe.minWidth=3*this.toolbarHeight+"px",Pe.contentAlign="end",this.topToolbar.addButtonBlock(Pe);var We=new Ke('',"OK");We.onClick=this.startRenderAndClose,Pe.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var et=new Ke('',"Close");et.onClick=this.close,Pe.addButton(et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},me.prototype.addBottomToolbar=function(){var ne=this;this.bottomToolbar=new X,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 q=new Re;q.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(q);var se=new Ke('',"Rotate left");se.onClick=this.rotateLeftButtonClicked,q.addButton(se);var ue=new Ke('',"Rotate right");ue.onClick=this.rotateRightButtonClicked,q.addButton(ue);var oe=new pe;oe.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(oe),this.straightener=new ot("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(Pe){ne.rotateBy(Pe),ne.straightener.angle=ne.rotationAngle},oe.addElement(this.straightener.getUI());var ce=new Re;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var be=new Ke('',"Flip horizontal");be.onClick=this.flipHorizontallyButtonClicked,ce.addButton(be);var Se=new Ke('',"Flip vertical");Se.onClick=this.flipVerticallyButtonClicked,ce.addButton(Se)},me.prototype.ratioButtonClicked=function(ne){this.aspectRatio=ne,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},me.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ke.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},me.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new we(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},me.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},me.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},me.prototype.restoreState=function(ne){if(ne){var q=this.cropLayer.getRescaledRect(ne.width,ne.height,this.imageWidth,this.imageHeight,ne.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(q),this.cropRectChanged(q),this.flippedHorizontally=ne.flippedHorizontally,this.flippedVertically=ne.flippedVertically,this.applyFlip(),this.rotationAngle=ne.rotationAngle,this.applyRotation()}},me.prototype.clientToLocalCoordinates=function(ne,q){var se=this.cropImage.getBoundingClientRect();return{x:ne-se.left,y:q-se.top}},me.prototype.onWindowResize=function(){this.positionUI()},me.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var ne=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=ne+"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()},me.prototype.rotateLeftButtonClicked=function(){var ne=this.rotationAngle-90;this.rotationAngle%90!=0&&(ne+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(ne)},me.prototype.rotateRightButtonClicked=function(){var ne=this.rotationAngle+90;this.rotationAngle%90!=0&&(ne-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(ne)},me.prototype.rotateTo=function(ne){ne=(ne=ne>180?ne-360:ne)<=-180?ne+360:ne,this.rotationAngle=ne,this.applyRotation()},me.prototype.rotateBy=function(ne){this.rotateTo((this.rotationAngle+ne)%360)},me.prototype.applyRotation=function(){var ne=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var q=this.editingTargetRotationContainer.transform.baseVal.getItem(0);q.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(q,0);var se=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/se.width,this.imageHeight/se.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=ne},me.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},me.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},me.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},me.prototype.startRenderAndClose=function(){return Oe(this,void 0,void 0,function(){var ne,q;return he(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return ne=se.sent(),q=this.getState(),this.renderEventListeners.forEach(function(ue){return ue(ne,q)}),this.close(!0),[2]}})})},me.prototype.render=function(){return Oe(this,void 0,void 0,function(){var ne;return he(this,function(q){switch(q.label){case 0:return(ne=new qe).naturalSize=this.renderAtNaturalSize,ne.imageType=this.renderImageType,ne.imageQuality=this.renderImageQuality,ne.width=this.renderWidth,ne.height=this.renderHeight,this.unzoomFromCrop(),P.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,ne.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 q.sent(),[4,ne.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,q.sent()]}})})},me.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new J("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 J("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new J("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var ne=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new J("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*ne)+`px; height: `+(this.toolbarHeight-2*ne)+`px; padding: `+ne+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new J("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new J("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new $("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new $("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new J("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 J("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new J("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 J("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*ne)+`px; padding: `+ne+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new J("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},me.instanceCounter=0,me}(),lt=U("8hTe"),pt=U.n(lt),Ye=/]*>/g;function Tt(me){var ne=document.createElement("div");return ne.innerHTML=me,ne.childNodes.length===0?"":ne.childNodes[0].nodeValue}var bt=Ee.a=function(me){var ne=me.value,q=ne===void 0?"":ne,se=me.edit,ue=se===void 0?!1:se,oe=me.className,ce=me.showTextOnly,be=me.showLines,Se=me.replaces,Pe=me.zoomImg,We=me.hasMask,et=me.style,yt=et===void 0?{}:et,Rt=me.stylesPrev,kt=Rt===void 0?{}:Rt,mn=String(q),zt=Object(L.useRef)(),Mt=Object(L.useRef)(),Qn=Object(L.useState)(""),un=Object(G.a)(Qn,2),hr=un[0],or=un[1],bn=Object(L.useState)("office"),xr=Object(G.a)(bn,2),br=xr[0],Ar=xr[1],Br=function(){var Rn=new ft(Mt.current);Rn.displayMode="popup",Rn.addRenderEventListener(function(){var jn=Object(M.a)(n.a.mark(function cn(on){var Dn;return n.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return zt.current.style.display="none",Tr.next=3,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on}});case 3:Dn=Tr.sent,Dn!=null&&Dn.id&&Se(Mt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dn==null?void 0:Dn.id,"?type=").concat(Dn.content_type));case 5:case"end":return Tr.stop()}},cn)}));return function(cn){return jn.apply(this,arguments)}}()),Rn.show()},Ht=function(){var Rn=new _e.a(Mt.current);Rn.settings.displayMode="popup",Rn.addEventListener("render",function(){var jn=Object(M.a)(n.a.mark(function cn(on){var Dn;return n.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:if(zt.current.style.display="none",!Mt.current){Tr.next=6;break}return Tr.next=4,Object(Te.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:on.dataUrl}});case 4:Dn=Tr.sent,Dn!=null&&Dn.id&&Se(Mt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dn==null?void 0:Dn.id,"?type=").concat(Dn.content_type));case 6:case"end":return Tr.stop()}},cn)}));return function(cn){return jn.apply(this,arguments)}}()),Rn.show(),window.markerArea=Rn},an=Object(L.useMemo)(function(){zt.current&&(zt.current.style.zIndex=-1);try{var wt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Rn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,jn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;mn=mn.replace(wt,"("+Q.a.API_SERVER+"/api/attachments/").replace(Rn,'"'+Q.a.API_SERVER+"/api/attachments/").replace(jn,'"'+Q.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,` `)}catch(ei){}var cn=k(mn),on=C();if(mn.match(/\[TOC\]/)&&(cn=cn.replace("

    [TOC]

    ",R()),D()),cn=cn.replace(/(__special_katext_id_\d+__)/g,function(ei,Tr){var ct=on[Tr],Qt=ct.type,ji=ct.expression;return Object(te.renderToString)(Tt(ji)||"",{displayMode:Qt==="block",throwOnError:!1,output:"html"})}),cn=cn.replace(/▁/g,"\u2581\u2581\u2581"),E(),ce){var Dn=document.createElement("div");return Dn.innerHTML=cn,Dn.innerText}return setTimeout(function(){return Ir()},500),cn},[mn]),Cn=Object(L.useRef)();A.WebkitLineClamp=be,be&&(yt=Object(I.a)(Object(I.a)({},yt),A));function qn(wt){var Rn=wt.target;if(Rn.tagName.toUpperCase()==="IMG"){if(Pe){var jn=Rn.getAttribute("src");or(jn),Ar("image")}}else if(Rn.tagName.toUpperCase()==="A"){var cn=Rn.getAttribute("href");if(cn.indexOf("office")>-1)wt.preventDefault(),or(cn),Ar("office");else if(cn.indexOf("application/pdf")>-1)wt.preventDefault(),or(cn),Ar("pdf");else if(cn.indexOf("text/html")>-1)wt.preventDefault(),or(cn),Ar("html");else if(cn.startsWith("#")){wt.preventDefault();var on=document.getElementById(cn.replace("#",""));on&&on.scrollIntoView(!0)}}}var Ir=function(){var Rn,jn=(Rn=Cn.current)===null||Rn===void 0?void 0:Rn.querySelectorAll("video");jn==null||jn.forEach(function(cn){if(cn.oncontextmenu=function(){return!1},cn.src.indexOf(".m3u8")>-1&&!cn.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var on=new H.a;on.loadSource(cn.src),on.attachMedia(cn)}}})};Object(L.useEffect)(function(){if(Cn.current&&an&&(an.match(Ye)&&window.PR.prettyPrint()),Cn.current)return Cn.current.addEventListener("click",qn),function(){Cn.current.removeEventListener("click",qn),E(),D()}},[an,Cn.current,qn]);var gn=function(Rn){if(!ue)return;Rn.target.nodeName==="IMG"?(zt.current.style.zIndex=1,zt.current.style.display="flex",zt.current.style.width=Rn.target.clientWidth+"px",zt.current.style.height=Rn.target.clientHeight+"px",zt.current.style.top=Rn.target.offsetTop+"px",zt.current.style.left=Rn.target.offsetLeft+"px",Mt.current.src=Rn.target.getAttribute("src")):zt.current.style.display="none"};return x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:Cn,style:Object(I.a)({},yt),className:"".concat(oe||""," markdown-body ").concat(pt.a.mdBody),onMouseOver:gn,dangerouslySetInnerHTML:{__html:an}}),x.a.createElement("div",{ref:zt,className:pt.a.button},x.a.createElement(Y.a,null,x.a.createElement(z.a,{onClick:function(){return Br()}},"\u88C1\u526A"),x.a.createElement(z.a,{onClick:function(){return Ht()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:Mt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),x.a.createElement(ae.a,{close:!0,data:hr,type:hr!=null&&hr.length?br:"",style:Object(I.a)({},kt),onClose:function(){return or("")}}))}},"9VGf":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return N});var ie=U("q1tI"),Y=U.n(ie);function N(z,I){var M=Object(ie.useRef)();Object(ie.useEffect)(function(){M.current=z}),Object(ie.useEffect)(function(){function G(){M.current()}if(I!==null){var K=setInterval(G,I);return function(){return clearInterval(K)}}},[I])}},"A60/":function(it,Ee,U){it.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(it,Ee,U){"use strict";U.d(Ee,"a",function(){return M});var ie=U("MNnm"),Y="rc-util-key";function N(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(ie.a)())return null;var L=document.createElement("style");if((K=n.csp)===null||K===void 0?void 0:K.nonce){var x;L.nonce=(x=n.csp)===null||x===void 0?void 0:x.nonce}L.innerHTML=G;var f=N(n),b=f.firstChild;return n.prepend&&f.prepend?f.prepend(L):n.prepend&&b?f.insertBefore(L,b):f.appendChild(L),L}var I=new Map;function M(G,K){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},L=N(n);if(!I.has(L)){var x=z("",n),f=x.parentNode;I.set(L,f),f.removeChild(x)}var b=Array.from(I.get(L).children).find(function(u){return u.tagName==="STYLE"&&u[Y]===K});if(b){var h,o;if(((h=n.csp)===null||h===void 0?void 0:h.nonce)&&b.nonce!==((o=n.csp)===null||o===void 0?void 0:o.nonce)){var p;b.nonce=(p=n.csp)===null||p===void 0?void 0:p.nonce}return b.innerHTML!==G&&(b.innerHTML=G),b}var l=z(G,n);return l[Y]=K,l}},Bd2K:function(it,Ee,U){(function(ie){ie(U("VrN/"),U("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(n,L,x){if(x!=ie.Init&&x&&n.removeKeyMap("autoCloseTags"),!L)return;var f={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(f["'/'"]=function(b){return M(b)}),(typeof L!="object"||L.whenOpening!==!1)&&(f["'>'"]=function(b){return z(b)}),n.addKeyMap(f)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],N=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function z(n){if(n.getOption("disableInput"))return ie.Pass;for(var L=n.listSelections(),x=[],f=n.getOption("autoCloseTags"),b=0;bh.ch&&(s=s.slice(0,s.length-o.end+h.ch));var S=s.toLowerCase();if(!s||o.type=="string"&&(o.end!=h.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&u.close||o.string.indexOf("/")==h.ch-o.start-1||D&&G(D,S)>-1||K(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(l)||[],s,h,!0))return ie.Pass;var R=typeof f=="object"&&f.emptyTags;if(R&&G(R,s)>-1){x[b]={text:"/>",newPos:ie.Pos(h.line,h.ch+2)};continue}var O=A&&G(A,S)>-1;x[b]={indent:O,text:">"+(O?` `:"")+"",newPos:O?ie.Pos(h.line+1,0):ie.Pos(h.line,h.ch+1)}}for(var g=typeof f=="object"&&f.dontIndentOnAutoClose,b=L.length-1;b>=0;b--){var _=x[b];n.replaceRange(_.text,L[b].head,L[b].anchor,"+insert");var d=n.listSelections().slice(0);d[b]={head:_.newPos,anchor:_.newPos},n.setSelections(d),!g&&_.indent&&(n.indentLine(_.newPos.line,null,!0),n.indentLine(_.newPos.line+1,null,!0))}}function I(n,L){for(var x=n.listSelections(),f=[],b=L?"/":""&&(D+=">"),f[p]=D}if(n.replaceSelections(f),x=n.listSelections(),!o)for(var p=0;p=0&&L[l]==x;l--)++p;f=o.to;for(var l=1;l0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],x=0;xM,ie.serviceIds.set(M,G),G}function I(M){return function(G,K,n){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");N(M,G,n,!0)}}},DlQD:function(it,Ee,U){(function(ie,Y){it.exports=Y()})(this,function(){"use strict";function ie(q,se){for(var ue=0;ueq.length)&&(se=q.length);for(var ue=0,oe=new Array(se);ue=q.length?{done:!0}:{done:!1,value:q[oe++]}}}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 ue=q[Symbol.iterator](),ue.next.bind(ue)}function M(q,se){return se={exports:{}},q(se,se.exports),se.exports}var G=M(function(q){function se(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ue(oe){q.exports.defaults=oe}q.exports={defaults:se(),getDefaults:se,changeDefaults:ue}}),K=G.defaults,n=G.getDefaults,L=G.changeDefaults,x=/[&<>"']/,f=/[&<>"']/g,b=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},p=function(se){return o[se]};function l(q,se){if(se){if(x.test(q))return q.replace(f,p)}else if(b.test(q))return q.replace(h,p);return q}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function s(q){return q.replace(u,function(se,ue){return ue=ue.toLowerCase(),ue==="colon"?":":ue.charAt(0)==="#"?ue.charAt(1)==="x"?String.fromCharCode(parseInt(ue.substring(2),16)):String.fromCharCode(+ue.substring(1)):""})}var i=/(^|[^\[])\^/g;function D(q,se){q=q.source||q,se=se||"";var ue={replace:function(ce,be){return be=be.source||be,be=be.replace(i,"$1"),q=q.replace(ce,be),ue},getRegex:function(){return new RegExp(q,se)}};return ue}var A=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(q,se,ue){if(q){var oe;try{oe=decodeURIComponent(s(ue)).replace(A,"").toLowerCase()}catch(ce){return null}if(oe.indexOf("javascript:")===0||oe.indexOf("vbscript:")===0||oe.indexOf("data:")===0)return null}se&&!S.test(ue)&&(ue=c(se,ue));try{ue=encodeURI(ue).replace(/%25/g,"%")}catch(ce){return null}return ue}var O={},g=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,d=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(q,se){O[" "+q]||(g.test(q)?O[" "+q]=q+"/":O[" "+q]=B(q,"/",!0)),q=O[" "+q];var ue=q.indexOf(":")===-1;return se.substring(0,2)==="//"?ue?se:q.replace(_,"$1")+se:se.charAt(0)==="/"?ue?se:q.replace(d,"$1")+se:q+se}var C={exec:function(){}};function E(q){for(var se=1,ue,oe;se=0&&Pe[et]==="\\";)We=!We;return We?"|":" |"}),oe=ue.split(/ \|/),ce=0;if(oe.length>se)oe.splice(se);else for(;oe.length=oe.length?ce.slice(oe.length):ce}).join(` `)}var _e=function(){function q(ue){this.options=ue||m}var se=q.prototype;return se.space=function(oe){var ce=this.rules.block.newline.exec(oe);if(ce)return ce[0].length>1?{type:"space",raw:ce[0]}:{raw:` `}},se.code=function(oe,ce){var be=this.rules.block.code.exec(oe);if(be){var Se=ce[ce.length-1];if(Se&&Se.type==="paragraph")return{raw:be[0],text:be[0].trimRight()};var Pe=be[0].replace(/^ {4}/gm,"");return{type:"code",raw:be[0],codeBlockStyle:"indented",text:this.options.pedantic?Pe:y(Pe,` `)}}},se.fences=function(oe){var ce=this.rules.block.fences.exec(oe);if(ce){var be=ce[0],Se=Te(be,ce[3]||"");return{type:"code",raw:be,lang:ce[2]?ce[2].trim():ce[2],text:Se}}},se.heading=function(oe){var ce=this.rules.block.heading.exec(oe);if(ce)return{type:"heading",raw:ce[0],depth:ce[1].length,text:ce[2]}},se.nptable=function(oe){var ce=this.rules.block.nptable.exec(oe);if(ce){var be={type:"table",header:H(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(` `):[],raw:ce[0]};if(be.header.length===be.align.length){var Se=be.align.length,Pe;for(Pe=0;Pe ?/gm,"");return{type:"blockquote",raw:ce[0],text:be}}},se.list=function(oe){var ce=this.rules.block.list.exec(oe);if(ce){for(var be=ce[0],Se=ce[2],Pe=Se.length>1,We=Se[Se.length-1]===")",et={type:"list",raw:be,ordered:Pe,start:Pe?+Se.slice(0,-1):"",loose:!1,items:[]},yt=ce[0].match(this.rules.block.item),Rt=!1,kt,mn,zt,Mt,Qn,un,hr,or=yt.length,bn=0;bn1||this.options.smartLists&&zt!==Se)&&(Mt=yt.slice(bn+1).join(` `),et.raw=et.raw.substring(0,et.raw.length-Mt.length),bn=or-1)),Qn=Rt||/\n\n(?!\s*$)/.test(kt),bn!==or-1&&(Rt=kt.charAt(kt.length-1)===` `,Qn||(Qn=Rt)),Qn&&(et.loose=!0),un=/^\[[ xX]\] /.test(kt),hr=void 0,un&&(hr=kt[1]!==" ",kt=kt.replace(/^\[[ xX]\] +/,"")),et.items.push({type:"list_item",raw:be,task:un,checked:hr,loose:Qn,text:kt});return et}},se.html=function(oe){var ce=this.rules.block.html.exec(oe);if(ce)return{type:this.options.sanitize?"paragraph":"html",raw:ce[0],pre:!this.options.sanitizer&&(ce[1]==="pre"||ce[1]==="script"||ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Q(ce[0]):ce[0]}},se.def=function(oe){var ce=this.rules.block.def.exec(oe);if(ce){ce[3]&&(ce[3]=ce[3].substring(1,ce[3].length-1));var be=ce[1].toLowerCase().replace(/\s+/g," ");return{tag:be,raw:ce[0],href:ce[2],title:ce[3]}}},se.table=function(oe){var ce=this.rules.block.table.exec(oe);if(ce){var be={type:"table",header:H(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(` `):[]};if(be.header.length===be.align.length){be.raw=ce[0];var Se=be.align.length,Pe;for(Pe=0;Pe/i.test(Se[0])&&(ce=!1),!be&&/^<(pre|code|kbd|script)(\s|>)/i.test(Se[0])?be=!0:be&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Se[0])&&(be=!1),{type:this.options.sanitize?"text":"html",raw:Se[0],inLink:ce,inRawBlock:be,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):Q(Se[0]):Se[0]}},se.link=function(oe){var ce=this.rules.inline.link.exec(oe);if(ce){var be=te(ce[2],"()");if(be>-1){var Se=ce[0].indexOf("!")===0?5:4,Pe=Se+ce[1].length+be;ce[2]=ce[2].substring(0,be),ce[0]=ce[0].substring(0,Pe).trim(),ce[3]=""}var We=ce[2],et="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(We);yt?(We=yt[1],et=yt[3]):et=""}else et=ce[3]?ce[3].slice(1,-1):"";We=We.trim().replace(/^<([\s\S]*)>$/,"$1");var Rt=ae(ce,{href:We&&We.replace(this.rules.inline._escapes,"$1"),title:et&&et.replace(this.rules.inline._escapes,"$1")},ce[0]);return Rt}},se.reflink=function(oe,ce){var be;if((be=this.rules.inline.reflink.exec(oe))||(be=this.rules.inline.nolink.exec(oe))){var Se=(be[2]||be[1]).replace(/\s+/g," ");if(Se=ce[Se.toLowerCase()],!Se||!Se.href){var Pe=be[0].charAt(0);return{type:"text",raw:Pe,text:Pe}}var We=ae(be,Se,be[0]);return We}},se.strong=function(oe,ce,be){be===void 0&&(be="");var Se=this.rules.inline.strong.start.exec(oe);if(Se&&(!Se[1]||Se[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){ce=ce.slice(-1*oe.length);var Pe=Se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Pe.lastIndex=0;for(var We;(Se=Pe.exec(ce))!=null;)if(We=this.rules.inline.strong.middle.exec(ce.slice(0,Se.index+3)),We)return{type:"strong",raw:oe.slice(0,We[0].length),text:oe.slice(2,We[0].length-2)}}},se.em=function(oe,ce,be){be===void 0&&(be="");var Se=this.rules.inline.em.start.exec(oe);if(Se&&(!Se[1]||Se[1]&&(be===""||this.rules.inline.punctuation.exec(be)))){ce=ce.slice(-1*oe.length);var Pe=Se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Pe.lastIndex=0;for(var We;(Se=Pe.exec(ce))!=null;)if(We=this.rules.inline.em.middle.exec(ce.slice(0,Se.index+2)),We)return{type:"em",raw:oe.slice(0,We[0].length),text:oe.slice(1,We[0].length-1)}}},se.codespan=function(oe){var ce=this.rules.inline.code.exec(oe);if(ce){var be=ce[2].replace(/\n/g," "),Se=/[^ ]/.test(be),Pe=be.startsWith(" ")&&be.endsWith(" ");return Se&&Pe&&(be=be.substring(1,be.length-1)),be=Q(be,!0),{type:"codespan",raw:ce[0],text:be}}},se.br=function(oe){var ce=this.rules.inline.br.exec(oe);if(ce)return{type:"br",raw:ce[0]}},se.del=function(oe){var ce=this.rules.inline.del.exec(oe);if(ce)return{type:"del",raw:ce[0],text:ce[1]}},se.autolink=function(oe,ce){var be=this.rules.inline.autolink.exec(oe);if(be){var Se,Pe;return be[2]==="@"?(Se=Q(this.options.mangle?ce(be[1]):be[1]),Pe="mailto:"+Se):(Se=Q(be[1]),Pe=Se),{type:"link",raw:be[0],text:Se,href:Pe,tokens:[{type:"text",raw:Se,text:Se}]}}},se.url=function(oe,ce){var be;if(be=this.rules.inline.url.exec(oe)){var Se,Pe;if(be[2]==="@")Se=Q(this.options.mangle?ce(be[0]):be[0]),Pe="mailto:"+Se;else{var We;do We=be[0],be[0]=this.rules.inline._backpedal.exec(be[0])[0];while(We!==be[0]);Se=Q(be[0]),be[1]==="www."?Pe="http://"+Se:Pe=Se}return{type:"link",raw:be[0],text:Se,href:Pe,tokens:[{type:"text",raw:Se,text:Se}]}}},se.inlineText=function(oe,ce,be){var Se=this.rules.inline.text.exec(oe);if(Se){var Pe;return ce?Pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Se[0]):Q(Se[0]):Se[0]:Pe=Q(this.options.smartypants?be(Se[0]):Se[0]),{type:"text",raw:Se[0],text:Pe}}},q}(),ge=k.noopTest,ve=k.edit,Oe=k.merge,he={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ge,table:ge,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=ve(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=ve(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=ve(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=//,he.html=ve(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=ve(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.blockquote=ve(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Oe({},he),he.gfm=Oe({},he.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*|$)"}),he.gfm.nptable=ve(he.gfm.nptable).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.gfm.table=ve(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",he._tag).getRegex(),he.pedantic=Oe({},he.normal,{html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ge,paragraph:ve(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var V={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ge,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ge,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",V.punctuation=ve(V.punctuation).replace(/punctuation/g,V._punctuation).getRegex(),V._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",V._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",V.em.start=ve(V.em.start).replace(/punctuation/g,V._punctuation).getRegex(),V.em.middle=ve(V.em.middle).replace(/punctuation/g,V._punctuation).replace(/overlapSkip/g,V._overlapSkip).getRegex(),V.em.endAst=ve(V.em.endAst,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.em.endUnd=ve(V.em.endUnd,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.strong.start=ve(V.strong.start).replace(/punctuation/g,V._punctuation).getRegex(),V.strong.middle=ve(V.strong.middle).replace(/punctuation/g,V._punctuation).replace(/blockSkip/g,V._blockSkip).getRegex(),V.strong.endAst=ve(V.strong.endAst,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.strong.endUnd=ve(V.strong.endUnd,"g").replace(/punctuation/g,V._punctuation).getRegex(),V.blockSkip=ve(V._blockSkip,"g").getRegex(),V.overlapSkip=ve(V._overlapSkip,"g").getRegex(),V._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,V._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,V._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])?)+(?![-_])/,V.autolink=ve(V.autolink).replace("scheme",V._scheme).replace("email",V._email).getRegex(),V._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,V.tag=ve(V.tag).replace("comment",he._comment).replace("attribute",V._attribute).getRegex(),V._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,V._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,V.link=ve(V.link).replace("label",V._label).replace("href",V._href).replace("title",V._title).getRegex(),V.reflink=ve(V.reflink).replace("label",V._label).getRegex(),V.reflinkSearch=ve(V.reflinkSearch,"g").replace("reflink",V.reflink).replace("nolink",V.nolink).getRegex(),V.normal=Oe({},V),V.pedantic=Oe({},V.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:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",V._label).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V._label).getRegex()}),V.gfm=Oe({},V.normal,{escape:ve(V.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(oe="x"+oe.toString(16)),se+="&#"+oe+";";return se}var Re=function(){function q(ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=ue||j,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var oe={block:$.normal,inline:J.normal};this.options.pedantic?(oe.block=$.pedantic,oe.inline=J.pedantic):this.options.gfm&&(oe.block=$.gfm,this.options.breaks?oe.inline=J.breaks:oe.inline=J.gfm),this.tokenizer.rules=oe}q.lex=function(oe,ce){var be=new q(ce);return be.lex(oe)};var se=q.prototype;return se.lex=function(oe){return oe=oe.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(oe,this.tokens,!0),this.inline(this.tokens),this.tokens},se.blockTokens=function(oe,ce,be){ce===void 0&&(ce=[]),be===void 0&&(be=!0),oe=oe.replace(/^ +$/gm,"");for(var Se,Pe,We,et;oe;){if(Se=this.tokenizer.space(oe)){oe=oe.substring(Se.raw.length),Se.type&&ce.push(Se);continue}if(Se=this.tokenizer.code(oe,ce)){oe=oe.substring(Se.raw.length),Se.type?ce.push(Se):(et=ce[ce.length-1],et.raw+=` `+Se.raw,et.text+=` `+Se.text);continue}if(Se=this.tokenizer.fences(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.heading(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.nptable(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.hr(oe)){oe=oe.substring(Se.raw.length),ce.push(Se);continue}if(Se=this.tokenizer.blockquote(oe)){oe=oe.substring(Se.raw.length),Se.tokens=this.blockTokens(Se.text,[],be),ce.push(Se);continue}if(Se=this.tokenizer.list(oe)){for(oe=oe.substring(Se.raw.length),We=Se.items.length,Pe=0;Pe0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(et))!=null;)Rt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(et=et.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(et))!=null;)et=et.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+et.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;oe;){if(We=this.tokenizer.escape(oe)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.tag(oe,be,Se)){oe=oe.substring(We.raw.length),be=We.inLink,Se=We.inRawBlock,ce.push(We);continue}if(We=this.tokenizer.link(oe)){oe=oe.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,Se)),ce.push(We);continue}if(We=this.tokenizer.reflink(oe,this.tokens.links)){oe=oe.substring(We.raw.length),We.type==="link"&&(We.tokens=this.inlineTokens(We.text,[],!0,Se)),ce.push(We);continue}if(We=this.tokenizer.strong(oe,et,Pe)){oe=oe.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],be,Se),ce.push(We);continue}if(We=this.tokenizer.em(oe,et,Pe)){oe=oe.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],be,Se),ce.push(We);continue}if(We=this.tokenizer.codespan(oe)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.br(oe)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.del(oe)){oe=oe.substring(We.raw.length),We.tokens=this.inlineTokens(We.text,[],be,Se),ce.push(We);continue}if(We=this.tokenizer.autolink(oe,ye)){oe=oe.substring(We.raw.length),ce.push(We);continue}if(!be&&(We=this.tokenizer.url(oe,ye))){oe=oe.substring(We.raw.length),ce.push(We);continue}if(We=this.tokenizer.inlineText(oe,Se,X)){oe=oe.substring(We.raw.length),Pe=We.raw.slice(-1),ce.push(We);continue}if(oe){var kt="Infinite loop on byte: "+oe.charCodeAt(0);if(this.options.silent){console.error(kt);break}else throw new Error(kt)}}return ce},Y(q,null,[{key:"rules",get:function(){return{block:$,inline:J}}}]),q}(),Ke=G.defaults,pe=k.cleanUrl,we=k.escape,ke=function(){function q(ue){this.options=ue||Ke}var se=q.prototype;return se.code=function(oe,ce,be){var Se=(ce||"").match(/\S*/)[0];if(this.options.highlight){var Pe=this.options.highlight(oe,Se);Pe!=null&&Pe!==oe&&(be=!0,oe=Pe)}return Se?'
    '+(be?oe:we(oe,!0))+`
    `:"
    "+(be?oe:we(oe,!0))+`
    `},se.blockquote=function(oe){return`
    `+oe+`
    `},se.html=function(oe){return oe},se.heading=function(oe,ce,be,Se){return this.options.headerIds?"'+oe+" `:""+oe+" `},se.hr=function(){return this.options.xhtml?`
    `:`
    `},se.list=function(oe,ce,be){var Se=ce?"ol":"ul",Pe=ce&&be!==1?' start="'+be+'"':"";return"<"+Se+Pe+`> `+oe+" `},se.listitem=function(oe){return"
  • "+oe+`
  • `},se.checkbox=function(oe){return" "},se.paragraph=function(oe){return"

    "+oe+`

    `},se.table=function(oe,ce){return ce&&(ce=""+ce+""),` `+oe+` `+ce+`
    `},se.tablerow=function(oe){return` `+oe+` `},se.tablecell=function(oe,ce){var be=ce.header?"th":"td",Se=ce.align?"<"+be+' align="'+ce.align+'">':"<"+be+">";return Se+oe+" `},se.strong=function(oe){return""+oe+""},se.em=function(oe){return""+oe+""},se.codespan=function(oe){return""+oe+""},se.br=function(){return this.options.xhtml?"
    ":"
    "},se.del=function(oe){return""+oe+""},se.link=function(oe,ce,be){if(oe=pe(this.options.sanitize,this.options.baseUrl,oe),oe===null)return be;var Se='",Se},se.image=function(oe,ce,be){if(oe=pe(this.options.sanitize,this.options.baseUrl,oe),oe===null)return be;var Se=''+be+'":">",Se},se.text=function(oe){return oe},q}(),Ue=function(){function q(){}var se=q.prototype;return se.strong=function(oe){return oe},se.em=function(oe){return oe},se.codespan=function(oe){return oe},se.del=function(oe){return oe},se.html=function(oe){return oe},se.text=function(oe){return oe},se.link=function(oe,ce,be){return""+be},se.image=function(oe,ce,be){return""+be},se.br=function(){return""},q}(),Qe=function(){function q(){this.seen={}}var se=q.prototype;return se.slug=function(oe){var ce=oe.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ce)){var be=ce;do this.seen[be]++,ce=be+"-"+this.seen[be];while(this.seen.hasOwnProperty(ce))}return this.seen[ce]=0,ce},q}(),nt=G.defaults,ot=k.unescape,qe=function(){function q(ue){this.options=ue||nt,this.options.renderer=this.options.renderer||new ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new Qe}q.parse=function(oe,ce){var be=new q(ce);return be.parse(oe)};var se=q.prototype;return se.parse=function(oe,ce){ce===void 0&&(ce=!0);var be="",Se,Pe,We,et,yt,Rt,kt,mn,zt,Mt,Qn,un,hr,or,bn,xr,br,Ar,Br=oe.length;for(Se=0;Se0&&bn.tokens[0].type==="text"?(bn.tokens[0].text=Ar+" "+bn.tokens[0].text,bn.tokens[0].tokens&&bn.tokens[0].tokens.length>0&&bn.tokens[0].tokens[0].type==="text"&&(bn.tokens[0].tokens[0].text=Ar+" "+bn.tokens[0].tokens[0].text)):bn.tokens.unshift({type:"text",text:Ar}):or+=Ar),or+=this.parse(bn.tokens,hr),zt+=this.renderer.listitem(or,br,xr);be+=this.renderer.list(zt,Qn,un);continue}case"html":{be+=this.renderer.html(Mt.text);continue}case"paragraph":{be+=this.renderer.paragraph(this.parseInline(Mt.tokens));continue}case"text":{for(zt=Mt.tokens?this.parseInline(Mt.tokens):Mt.text;Se+1An error occurred:

    "+pt(We.message+"",!0)+"
    ";throw We}}me.options=me.setOptions=function(q){return ft(me.defaults,q),Tt(me.defaults),me},me.getDefaults=Ye,me.defaults=bt,me.use=function(q){var se=ft({},q);if(q.renderer&&function(){var oe=me.defaults.renderer||new ke,ce=function(Pe){var We=oe[Pe];oe[Pe]=function(){for(var et=arguments.length,yt=new Array(et),Rt=0;Rt-1?i[ge]:"",Oe="";g.choices.map(function(j,$){j.is_answer&&(Oe+=i[$])});var he=_e[g.item_type],V={SINGLE:f.a.createElement(b.a,{className:o.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(ve||"\u65E0")}),MULTIPLE:f.a.createElement(b.a,{className:o.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(Oe||"\u65E0")}),COMPLETION:m()},P=f.a.createElement(b.a,{className:o.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(he||"\u65E0")});return V[g.item_type]||P},H=function(te){var ae=Object(G.a)(_);te.target.checked?ae.push(g.id):ae=ae.filter(function(Te){return Te!==g.id}),c(ae)};return f.a.createElement("div",{className:o.a.itemWrap},f.a.createElement("div",{className:o.a.list},E&&f.a.createElement(M.a,{className:"mr10",onChange:H,checked:_.includes(g.id)}),f.a.createElement("div",{className:o.a.title},f.a.createElement(b.a,{key:1,showLines:1,showTextOnly:!0,className:o.a.topicTitleContent,value:g.name})),f.a.createElement("div",{className:o.a.line},f.a.createElement("b",{className:o.a.b1}),f.a.createElement("b",{className:o.a.b2})),f.a.createElement("div",{onClick:function(){return T(!W)},className:o.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:o.a.itemDetail},f.a.createElement("div",{style:{marginBottom:44}},f.a.createElement(b.a,{key:2,className:o.a.topicTitleContent,value:g.name}),f.a.createElement("div",{className:"".concat(o.a.row," mt15")},k()),f.a.createElement("div",{className:o.a.row},f.a.createElement("div",{className:o.a.updateTimeRow},f.a.createElement("div",{className:o.a.updateTimeWrap},g.item_type==="PROGRAM"&&f.a.createElement("p",{className:o.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(O=g.program_attr)===null||O===void 0?void 0:O.language))))),g.item_type!=="PROGRAM"&&g.item_type!=="COMBINATION"&&f.a.createElement("div",{className:o.a.answerWrapper},f.a.createElement("img",{src:u.a,alt:"",className:o.a.decoration}),f.a.createElement("div",{className:o.a.answer},y()),f.a.createElement("div",{className:o.a.parse},f.a.createElement("div",{className:o.a.parseText},"\u89E3\u6790\uFF1A"),f.a.createElement("div",{className:o.a.parseAnswer},g.analysis?f.a.createElement(b.a,{className:o.a.parseAnswerHtml,value:g.analysis}):"\u6682\u65E0\u89E3\u6790")))))},A=function(R){var O,g,_,d,c,C,E,w,B,W,T,k,m,y,H,Q,te=R.isProblemset,ae=R.data,Te=R.user,_e=R.activeTabsKey,ge=R.onPublicReview,ve=ge===void 0?function(){}:ge,Oe=R.onStartExperience,he=Oe===void 0?function(){}:Oe,V=R.onSetPrivate,P=V===void 0?function(){}:V,j=R.onCorrection,$=j===void 0?function(){}:j,J=R.onCollect,X=J===void 0?function(){}:J,ye=R.onSetPublic,Re=ye===void 0?function(){}:ye,Ke=R.onDelete,pe=Ke===void 0?function(){}:Ke,we=R.onCancel,ke=we===void 0?function(){}:we,Ue=R.onSelect,Qe=Ue===void 0?function(){}:Ue,nt=R.onMoveTo,ot=nt===void 0?function(){}:nt,qe=R.onSetShare,ft=qe===void 0?function(){}:qe,lt=R.onCancelShare,pt=lt===void 0?function(){}:lt,Ye=R.onPublish,Tt=Ye===void 0?function(){}:Ye,bt=R.onCancelPublish,me=bt===void 0?function(){}:bt,ne=ae.item_type==="PROGRAM"?"/problems/".concat((O=ae.program_attr)===null||O===void 0?void 0:O.identifier,"/edit"):"/problemset/edit/".concat(ae.id),q=_e==="0"&&!ae.public&&!ae.apply&&(ae.item_type==="PROGRAM"&&((g=ae.program_attr)===null||g===void 0?void 0:g.status)!==0||ae.item_type!=="PROGRAM"),se=f.a.createElement(z.a,{forceSubMenuRender:!0,className:o.a.menu},_e==="0"&&!ae.public&&f.a.createElement(z.a.Item,{key:"-1"},f.a.createElement("a",{className:o.a.actionLink,target:"_blank",href:ne},"\u7F16\u8F91")),(_e==="0"||_e==="3")&&ae.item_type==="PROGRAM"&&((_=ae.program_attr)===null||_===void 0?void 0:_.status)!==0&&!ae.public&&((d=ae.author)===null||d===void 0?void 0:d.login)===((c=Te.userInfo)===null||c===void 0?void 0:c.login)&&f.a.createElement(z.a.Item,{key:"0"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){var be;return me(ae==null||((be=ae.program_attr)===null||be===void 0)?void 0:be.identifier)}},"\u64A4\u9500\u53D1\u5E03")),_e==="0"&&f.a.createElement(z.a.Item,{key:"1"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return ot(ae.id)}},"\u79FB\u52A8\u5230")),_e==="0"&&!(ae!=null&&ae.is_share)&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return ft(ae.id)}},"\u5171\u4EAB")),(_e==="0"&&(ae==null?void 0:ae.is_share)||_e==="3"&&((C=ae.author)===null||C===void 0?void 0:C.login)===((E=Te.userInfo)===null||E===void 0?void 0:E.login))&&f.a.createElement(z.a.Item,{key:"3"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return pt(ae.id)}},"\u64A4\u9500\u5171\u4EAB")),q&&f.a.createElement(z.a.Item,{key:"4"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return Re(ae.id)}},"\u516C\u5F00")),_e==="0"&&!ae.public&&ae.apply&&(ae.item_type==="PROGRAM"&&ae.program_attr.status!==0||ae.item_type!=="PROGRAM")&&f.a.createElement(z.a.Item,{key:"5"},f.a.createElement("a",{className:o.a.reviewFlag,onClick:ve},"\u5BA1\u6838\u4E2D")),(_e==="0"||_e==="1")&&ae.public&&((w=ae.author)===null||w===void 0?void 0:w.login)===((B=Te.userInfo)===null||B===void 0?void 0:B.login)&&f.a.createElement(z.a.Item,{key:"6"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return P(ae.id)}},"\u64A4\u9500\u516C\u5F00")),_e==="2"&&f.a.createElement(z.a.Item,{key:"7"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return X(ae.id,ae.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(_e==="0"||_e==="3")&&ae.item_type==="PROGRAM"&&((W=ae.program_attr)===null||W===void 0?void 0:W.status)===0&&!ae.public&&((T=ae.author)===null||T===void 0?void 0:T.login)===((k=Te.userInfo)===null||k===void 0?void 0:k.login)&&f.a.createElement(z.a.Item,{key:"8"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){var be;return Tt(ae==null||((be=ae.program_attr)===null||be===void 0)?void 0:be.identifier)}},"\u53D1\u5E03")),(_e==="1"||_e==="3")&&!Object(p.o)()&&!Object(p.m)()&&((m=ae.author)===null||m===void 0?void 0:m.login)!==((y=Te.userInfo)===null||y===void 0?void 0:y.login)&&f.a.createElement(z.a.Item,{key:"9"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return X(ae.id,ae.is_collected)}},ae.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),_e!=="0"&&!Object(p.o)()&&!Object(p.m)()&&f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return $(ae.id)}},"\u7EA0\u9519")),(_e==="0"&&!ae.public||_e==="1"&&Object(p.o)()&&((H=ae.author)===null||H===void 0?void 0:H.login)!==((Q=Te.userInfo)===null||Q===void 0?void 0:Q.login))&&f.a.createElement(z.a.Item,{key:"11"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return pe(ae.id)}},"\u5220\u9664"))),ue=f.a.createElement(z.a,{forceSubMenuRender:!0,className:o.a.menu},f.a.createElement(z.a.Item,{key:"10"},f.a.createElement("a",{className:o.a.actionLink,onClick:function(){return $(ae.id)}},"\u7EA0\u9519"))),oe=_e!=="0"&&!Object(p.o)()&&!Object(p.m)();return f.a.createElement(f.a.Fragment,null,te?f.a.createElement(f.a.Fragment,null,ae.item_type!=="SUBJECTIVE"&&ae.item_type!=="COMBINATION"&&f.a.createElement("span",{className:o.a.textBtn,style:{cursor:"pointer"},onClick:function(){return he(ae)}},"\u4F53\u9A8C"),f.a.createElement(Y.a,{overlay:se},f.a.createElement("span",{style:{cursor:"default"},onClick:function(be){return be.preventDefault()}},f.a.createElement("span",{className:o.a.textBtn},"\u66F4\u591A")))):oe?f.a.createElement(Y.a,{className:"ml40",overlay:ue},f.a.createElement("span",{style:{cursor:"default"},onClick:function(be){return be.preventDefault()}},f.a.createElement("span",null,"\u66F4\u591A"))):f.a.createElement("span",null))};Ee.b=D},ELLl:function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},N=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(o,p,l){l&&l!=ie.Init&&(o.removeKeyMap(I),o.state.closeBrackets=null),p&&(M(z(p,"pairs")),o.state.closeBrackets=p,o.addKeyMap(I))});function z(o,p){return p=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[p]!=null?o[p]:Y[p]}var I={Backspace:n,Enter:L};function M(o){for(var p=0;p=0;s--){var D=u[s].head;o.replaceRange("",N(D.line,D.ch-1),N(D.line,D.ch+1),"+delete")}}function L(o){var p=K(o),l=p&&z(p,"explode");if(!l||o.getOption("disableInput"))return ie.Pass;for(var u=o.listSelections(),s=0;s0;return{anchor:new N(o.anchor.line,o.anchor.ch+(p?-1:1)),head:new N(o.head.line,o.head.ch+(p?1:-1))}}function f(o,p){var l=K(o);if(!l||o.getOption("disableInput"))return ie.Pass;var u=z(l,"pairs"),s=u.indexOf(p);if(s==-1)return ie.Pass;for(var i=z(l,"closeBefore"),D=z(l,"triples"),A=u.charAt(s+1)==p,S=o.listSelections(),R=s%2==0,O,g=0;g=0&&o.getRange(d,N(d.line,d.ch+3))==p+p+p?c="skipThree":c="skip";else if(A&&d.ch>1&&D.indexOf(p)>=0&&o.getRange(N(d.line,d.ch-2),d)==p+p){if(d.ch>2&&/\bstring/.test(o.getTokenTypeAt(N(d.line,d.ch-2))))return ie.Pass;c="addFour"}else if(A){var E=d.ch==0?" ":o.getRange(N(d.line,d.ch-1),d);if(!ie.isWordChar(C)&&E!=p&&!ie.isWordChar(E))c="both";else return ie.Pass}else if(R&&(C.length===0||/\s/.test(C)||i.indexOf(C)>-1))c="both";else return ie.Pass;if(!O)O=c;else if(O!=c)return ie.Pass}var w=s%2?u.charAt(s-1):p,B=s%2?p:u.charAt(s+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var W=0;W<3;W++)o.execCommand("goCharRight");else if(O=="surround"){for(var T=o.getSelections(),W=0;W0?xt[0].callbacks.push(Pt):Pe.push({element:st,callbacks:[Pt]}),{clear:function(){Pe=Pe.filter(function(Zt){return Zt.element!==st})}}}},yt=et,Rt=[{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"}],kt=function(st){var Pt=st.visible,xt=st.basketData,Dt=st.basketTotal,Zt=st.onClose,yn=Zt===void 0?function(){}:Zt,Tn=st.onDelete,en=Tn===void 0?function(){}:Tn,xn=Object(k.useRef)(),Fn=Object(k.useRef)();return Object(k.useEffect)(function(){return Fn.current?(Dt>=0&&!xn.current&&(xn.current=yt.init(Fn.current,function(){yn()})),function(){xn.current&&xn.current.clear()}):void 0},[Fn.current]),m.a.createElement(ce.a,{className:Se.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:Pt,forceRender:!0,onClose:yn},Dt>0?m.a.createElement("div",{style:{height:"100%"},ref:Fn},m.a.createElement("div",{className:Se.a.title},"\u8BD5\u9898\u7BEE"),Rt.map(function(tn){return xt[tn.stateName]>0&&m.a.createElement("div",{className:Se.a.problemset,key:tn.type},m.a.createElement("div",{className:Se.a.content},tn.typeName,"(",xt[tn.stateName],")"),m.a.createElement("div",{className:Se.a.delete,onClick:function(){return en(tn.type)}},m.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Se.a.deleteIcon)})))}),m.a.createElement("div",{className:Se.a.previewWrap},m.a.createElement("div",{className:Se.a.preview,onClick:function(){return y.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):m.a.createElement("div",{ref:Fn},m.a.createElement(ae.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},mn={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"},zt=function(st){var Pt,xt,Dt=st.problemset,Zt=st.globalSetting,yn=st.loading,Tn=st.dispatch,en=st.onReloadData,xn=en===void 0?function(){}:en,Fn=st.onReloadBasketData,tn=Fn===void 0?function(){}:Fn,hn=Object(c.a)(st,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),ar=function(){var Wn=Object(_.a)(T.a.mark(function Bt(){var _n;return T.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Tn({type:"problemset/basketDelete",payload:Dt.actionTabs.params});case 2:_n=kn.sent,Tn({type:"problemset/setActionTabs",payload:{}}),_n.status===0&&(xn(),tn());case 5:case"end":return kn.stop()}},Bt)}));return function(){return Wn.apply(this,arguments)}}();return m.a.createElement(R.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Dt.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:yn["problemset/handleDelete"],width:"442px",onOk:ar,onCancel:function(){Tn({type:"problemset/setActionTabs",payload:{}})}},m.a.createElement("div",{className:_e.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",mn[(Pt=Dt.actionTabs)===null||Pt===void 0||((xt=Pt.params)===null||xt===void 0)?void 0:xt.type]))},Mt=Object(y.a)(function(Vt){var st=Vt.problemset,Pt=Vt.loading,xt=Vt.globalSetting;return{problemset:st,globalSetting:xt,loading:Pt.effects}})(zt),Qn=U("A60/"),un=U.n(Qn),hr=function(st){var Pt=st.count,xt=st.visibleBasket,Dt=st.onToggleVisible,Zt=Dt===void 0?function(){}:Dt;return m.a.createElement("div",{className:"".concat(xt?un.a.right180:un.a.right20," ").concat(un.a.wrap)},m.a.createElement(h.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},m.a.createElement("div",{className:un.a.basket,onClick:Zt},Pt>0&&m.a.createElement("div",{className:un.a.count},Pt),m.a.createElement("span",{className:un.a.iconWrap},m.a.createElement("i",{className:"".concat(un.a.icon," iconfont icon-shitilan")})),m.a.createElement("p",{className:un.a.name},"\u8BD5\u9898\u7BEE"))))},or=U("EJTS"),bn=U("LE3n"),xr=U("1vsH"),br=U("xKgJ"),Ar=U("/zsF"),Br=U("PArb"),Ht=U("jCWc"),an=U("kPKH"),Cn=U("y8nQ"),qn=U("Vl3Y"),Ir=U("nSDg"),gn=U.n(Ir),wt=U("HBuW"),Rn=U("NLgs"),jn=U("vkP9"),cn=E.a.Search,on={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},Dn={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"}]},ei=function(st){var Pt,xt,Dt,Zt,yn=st.classroomList,Tn=st.loading,en=st.dispatch,xn=st.cb,Fn=st.shixunIds,tn=Fn===void 0?[]:Fn,hn=Object(Ke.i)(),ar=Object(Ke.h)(),Wn=yn.actionTabs,Bt=qn.a.useForm(),_n=Object(d.a)(Bt,1),ir=_n[0],kn=yn.shixunLists,Xt=Object(k.useState)([]),sn=Object(d.a)(Xt,2),Sn=sn[0],Nt=sn[1],Ut=Object(k.useState)([]),jt=Object(d.a)(Ut,2),je=jt[0],Yt=jt[1],fn=Object(k.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}),fr=Object(d.a)(fn,2),pn=fr[0],Yr=fr[1];Object(k.useEffect)(function(){yn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})},[yn.actionTabs.key]),Object(k.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(k.useEffect)(function(){$r()},[hn]);var $r=function(){var St=Object(_.a)(T.a.mark(function pr(){var tr;return T.a.wrap(function(Qr){for(;;)switch(Qr.prev=Qr.next){case 0:return Qr.next=2,Object(wt.qb)({});case 2:tr=Qr.sent,Yt((tr==null?void 0:tr.disciplines)||[]);case 4:case"end":return Qr.stop()}},pr)}));return function(){return St.apply(this,arguments)}}(),kr=function(pr,tr,Hn){pn.tag_level=pr,pn.sub_discipline_id=tr,pn.discipline_id=Hn,Yr(Object(g.a)({},pn)),en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})},An=function(){en({type:"classroomList/setActionTabs",payload:{}}),Yr({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 yn.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:m.a.createElement(ce.a,{placement:"bottom",height:"100%",closable:!0,onClose:An,visible:yn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:gn.a.drawer,footer:m.a.createElement("div",{className:"tc"},m.a.createElement(L.a,{size:"large",onClick:function(){An(),Nt([])},style:{marginRight:8}},"\u53D6\u6D88"),m.a.createElement(L.a,{size:"large",onClick:Object(_.a)(T.a.mark(function St(){var pr,tr,Hn;return T.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:pr=function(It){var Jt=Sn[It];if(tn.includes(Jt)){var Mn,wn;return i.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(kn==null||((Mn=kn.shixun_list)===null||Mn===void 0||((wn=Mn.find(function(Vn){return Vn.id===Jt}))===null||wn===void 0))?void 0:wn.title)),{v:void 0}}},tr=0;case 2:if(!(tr<(Sn==null?void 0:Sn.length))){Lt.next=9;break}if(Hn=pr(tr),!(typeof Hn=="object")){Lt.next=6;break}return Lt.abrupt("return",Hn.v);case 6:tr++,Lt.next=2;break;case 9:An(),xn(Sn),Nt([]);case 12:case"end":return Lt.stop()}},St)})),type:"primary"},"\u786E\u5B9A"))},m.a.createElement("section",{className:"tc"},m.a.createElement(jn.a,{onChange:function(pr){Yr(Object(g.a)(Object(g.a)(Object(g.a)({},pn),pr),{},{page:1})),en({type:"classroomList/getShixunLists",payload:Object(g.a)(Object(g.a)(Object(g.a)({},pn),pr),{},{page:1})})}})),m.a.createElement("section",{className:"edu-container"},m.a.createElement("ul",{className:gn.a.menu},m.a.createElement("li",null,on.name),on==null||((Pt=on.children)===null||Pt===void 0)?void 0:Pt.map(function(St,pr){return m.a.createElement("li",{className:pn[on.id]==St.id?gn.a.actived:"",key:St.id,onClick:function(){pn[on.id]=St.id,Yr(Object(g.a)({},pn)),en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})}},m.a.createElement("strong",null,St.name))})),m.a.createElement("ul",{className:gn.a.menuDirection},m.a.createElement("li",{className:gn.a.directionName},"\u65B9\u5411"),m.a.createElement("li",{className:pn.discipline_id?"":gn.a.actived,onClick:function(){kr(null,null,null)}},m.a.createElement("strong",null,"\u5168\u90E8")),je==null?void 0:je.map(function(St,pr){return m.a.createElement("li",{key:pr,className:pn.discipline_id==St.id?gn.a.actived:""},m.a.createElement("strong",{onClick:function(){kr(1,null,St.id)}},St.name),m.a.createElement("div",null,St.sub_disciplines.map(function(tr,Hn){return m.a.createElement("div",{key:Hn,className:"mt5"},m.a.createElement("div",{className:pn.sub_discipline_id==tr.id?"".concat(gn.a.actived2," ").concat(gn.a.subTag):gn.a.subTag,onClick:function(){kr(2,tr.id,St.id)}},tr.name),m.a.createElement("ul",{className:"mt5"},tr.tags&&tr.tags.map(function(Qr,Lt){return m.a.createElement("li",{key:Lt,className:pn.sub_discipline_id==Qr.id&&pn.tag_level===3?gn.a.actived2:"",onClick:function(){kr(3,Qr.id,St.id)}},Qr.name)})))})))})),m.a.createElement("ul",{className:gn.a.menu},m.a.createElement("li",null,Dn.name),Dn==null||((xt=Dn.children)===null||xt===void 0)?void 0:xt.map(function(St,pr){return m.a.createElement("li",{className:pn[Dn.id]==St.id?gn.a.actived:"",key:St.name,onClick:function(){pn[Dn.id]=St.id,Yr(Object(g.a)({},pn)),en({type:"classroomList/getShixunLists",payload:Object(g.a)({},pn)})}},m.a.createElement("strong",null,St.name))})),m.a.createElement(Y.a,null,m.a.createElement(an.a,{flex:"1"},m.a.createElement("div",{className:gn.a.menuCourse,style:{margin:"0px 15px"}},m.a.createElement("ul",null,m.a.createElement("li",null,"\u5DF2\u9009",m.a.createElement("span",{className:"c-blue"},Sn.length),"\u4E2A\u5B9E\u8BAD"),m.a.createElement("li",null,"\u5171",m.a.createElement("span",{className:"c-blue"},kn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),m.a.createElement("li",{className:"current",onClick:function(){var pr=Object(g.a)(Object(g.a)({},pn),{},{order:pn.order==="asc"?"desc":"asc"});Yr(pr),en({type:"classroomList/getShixunLists",payload:pr})}},"\u5B66\u4E60\u4EBA\u6570",m.a.createElement("p",{className:"edu-sorter current ".concat(pn.order)},pn.order==="asc"?m.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):m.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),m.a.createElement(an.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),kn==null||((Dt=kn.shixun_list)===null||Dt===void 0)?void 0:Dt.map(function(St,pr){return m.a.createElement("div",{className:gn.a.listItem,key:pr},m.a.createElement(u.a,{checked:Sn.includes(St.id),value:St.id,disabled:St==null?void 0:St.need_authorize,onChange:function(Hn){var Qr=Sn.indexOf(St.id);Sn.indexOf(St.id)>-1?Nt(Sn.filter(function(Lt){return Lt!==St.id})):Nt(Sn.concat(St.id))}}),m.a.createElement("div",{className:gn.a.info},m.a.createElement("div",{className:gn.a.title},m.a.createElement("div",{className:gn.a.titleLeft},m.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(St==null?void 0:St.identifier,"/challenges"),target:"_blank"},m.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:St.title}})),(St==null?void 0:St.need_authorize)&&m.a.createElement("span",{onClick:function(){Object(Rn.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(br.w)()&&(St==null?void 0:St.mark_status)===1&&m.a.createElement(h.a,{title:St==null?void 0:St.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(br.w)()&&(St==null?void 0:St.mark_status)===2&&m.a.createElement(h.a,{title:St==null?void 0:St.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(br.w)()&&(St==null?void 0:St.mark_status)===3&&m.a.createElement(h.a,{title:St==null?void 0:St.mark_content},m.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),m.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},m.a.createElement("span",{className:gn.a.description,dangerouslySetInnerHTML:{__html:St.description}})),m.a.createElement("div",{className:" mt15"},St.challenge_names.map(function(tr,Hn){return m.a.createElement("span",{key:Hn,className:"mr30 font12"},"\u7B2C",Hn+1,"\u5173 ",tr," ")})),m.a.createElement(Br.a,{dashed:!0}),m.a.createElement("div",{className:"c-light-black mt20 font12"},m.a.createElement("span",null,St.author_name),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,St.author_school_name),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",St.level),m.a.createElement("span",{className:"ml15 mr15"},"|"),m.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),m.a.createElement("span",null,St.study_count))))}),(kn==null||((Zt=kn.shixun_list)===null||Zt===void 0)?void 0:Zt.length)===0&&m.a.createElement(ae.a,null),m.a.createElement("p",null)),m.a.createElement("div",{className:"tc mt20"},m.a.createElement(z.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:pn.page||1,showQuickJumper:!0,total:kn==null?void 0:kn.shixuns_count,onChange:function(pr){var tr=Object(g.a)(Object(g.a)({},pn),{},{page:pr});Yr(tr),en({type:"classroomList/getShixunLists",payload:tr})}})))},Tr=Object(y.a)(function(Vt){var st=Vt.classroomList,Pt=Vt.loading;return{classroomList:st,loading:Pt}})(ei),ct=U("mgmH"),Qt=U("ErOA"),ji=U("ORt/"),Xi=U.n(ji),ua=U("Ot1p"),Bi=function(st,Pt){var xt,Dt=st.data,Zt=qn.a.useForm(),yn=Object(d.a)(Zt,1),Tn=yn[0],en=Object(k.useState)({}),xn=Object(d.a)(en,2),Fn=xn[0],tn=xn[1];return Object(k.useEffect)(function(){Dt&&(tn(Dt),Tn.setFieldsValue(Object(g.a)({},Dt)))},[Dt]),Object(k.useImperativeHandle)(Pt,function(){return{form:Tn}}),m.a.createElement("div",{className:Xi.a.operating},m.a.createElement(qn.a,{form:Tn,scrollToFirstError:!0,onValuesChange:function(){tn(Object(g.a)({},Tn.getFieldsValue()))}},m.a.createElement(qn.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"}]},m.a.createElement(E.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((xt=Fn.name)===null||xt===void 0?void 0:xt.length)||0,"/30")})),m.a.createElement(qn.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},m.a.createElement(u.a.Group,null,m.a.createElement(u.a,{value:"c"},"C"),m.a.createElement(u.a,{value:"c++"},"C++"),m.a.createElement(u.a,{value:"java"},"Java"),m.a.createElement(u.a,{value:"python"},"Python"))),m.a.createElement("div",{className:Xi.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),m.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),m.a.createElement(qn.a.Item,{name:"description"},m.a.createElement(ua.a,{defaultValue:Fn.description||"",watch:!0}))))},ca=Object(k.forwardRef)(Bi),En=U("SVaM"),Ia=U("sesT"),_t=U.n(Ia),Fi=U("wNkr"),yi=U.n(Fi),ba=U("xTzM"),ea=U.n(ba),pi=B.a.TabPane,da=E.a.Search,Ea=E.a.TextArea,ur;(function(Vt){Vt.Mine="0",Vt.Public="1",Vt.Collection="2",Vt.TeachGroupShare="3"})(ur||(ur={}));var xa=function(st){var Pt,xt,Dt,Zt,yn,Tn,en,xn,Fn,tn,hn,ar,Wn=st.classroomList,Bt=st.problemset,_n=st.user,ir=st.globalSetting,kn=st.loading,Xt=st.dispatch,sn=st.match,Sn=st.shixunHomeworks,Nt=Object(c.a)(st,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Ut=Object(k.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=Nt.location)===null||Pt===void 0||((xt=Pt.query)===null||xt===void 0)?void 0:xt.id)||null,exam_id:(sn==null||((Dt=sn.params)===null||Dt===void 0)?void 0:Dt.id)||null,exercise_id:(sn==null||((Zt=sn.params)===null||Zt===void 0)?void 0:Zt.categoryId)||null}),jt=Object(d.a)(Ut,2),je=jt[0],Yt=jt[1],fn=Object(k.useState)(0),fr=Object(d.a)(fn,2),pn=fr[0],Yr=fr[1],$r=Object(k.useState)([]),kr=Object(d.a)($r,2),An=kr[0],St=kr[1],pr=Object(k.useState)(ur.Mine),tr=Object(d.a)(pr,2),Hn=tr[0],Qr=tr[1],Lt=Object(k.useState)(0),Ft=Object(d.a)(Lt,2),It=Ft[0],Jt=Ft[1],Mn=Object(k.useState)(-1),wn=Object(d.a)(Mn,2),Vn=wn[0],sr=wn[1],mi=Object(k.useState)([]),Gn=Object(d.a)(mi,2),Wi=Gn[0],lr=Gn[1],ii=Object(k.useState)(!1),Zr=Object(d.a)(ii,2),Ai=Zr[0],Pa=Zr[1],Lo=Object(k.useState)([]),ta=Object(d.a)(Lo,2),Mr=ta[0],lo=ta[1],uo=Object(k.useState)(0),ha=Object(d.a)(uo,2),fa=ha[0],$a=ha[1],co=Object(k.useState)(!1),ka=Object(d.a)(co,2),Ta=ka[0],ho=ka[1],fo=Object(k.useState)(!1),Ma=Object(d.a)(fo,2),po=Ma[0],Qa=Ma[1],pa=Object(k.useRef)(!1),Yi=Object(k.useRef)(""),ma=Object(k.useRef)(),Ae=Object(k.useRef)(),Me=Object(k.useRef)(),He=Object(k.useState)(),De=Object(d.a)(He,2),le=De[0],xe=De[1],fe=Object(k.useState)([]),Le=Object(d.a)(fe,2),Ce=Le[0],Fe=Le[1],Be=Object(k.useRef)(!1),Ge=(sn==null?void 0:sn.url)==="/problemset",Ze=sn==null||((yn=sn.url)===null||yn===void 0)?void 0:yn.includes("program_homework"),ut=Ze&&sn!==null&&sn!==void 0&&(Tn=sn.params)!==null&&Tn!==void 0&&Tn.categoryId&&sn!==null&&sn!==void 0&&(en=sn.url)!==null&&en!==void 0&&en.includes("edit")?sn==null||((xn=sn.params)===null||xn===void 0)?void 0:xn.categoryId:"",ht=ut?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Ct=Object(k.useState)({}),dn=Object(d.a)(Ct,2),Kn=dn[0],On=dn[1],Nn=Object(k.useState)(!1),Bn=Object(d.a)(Nn,2),Un=Bn[0],Ln=Bn[1],zn=_n.userInfo||{},Xn=zn.admin,Or=zn.business,Yn=zn.is_shixun_marker,nn=zn.is_teacher,qt=zn.user_identity,In=Xn||Or||Yn||nn||qt!=="\u5B66\u751F",nr=Object(k.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),Kt=Object(d.a)(nr,2),rr=Kt[0],Rr=Kt[1],Zn=Sn.commonHomeWorkAddDefaultData,_r=Object(k.useState)([]),mr=Object(d.a)(_r,2),Nr=mr[0],Fr=mr[1],Lr=Object(k.useRef)(null),li=Object(k.useState)(!1),Ti=Object(d.a)(li,2),gi=Ti[0],Wr=Ti[1],wr=Object(k.useState)([]),gr=Object(d.a)(wr,2),ln=gr[0],vr=gr[1],Oi=Object(k.useState)(""),Hi=Object(d.a)(Oi,2),$i=Hi[0],yr=Hi[1],Mi=Object(k.useState)(!1),Ki=Object(d.a)(Mi,2),Er=Ki[0],cr=Ki[1],Pr=Object(k.useRef)(null),Na=[{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(k.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Za=function(){var Je=Object(_.a)(T.a.mark(function $e(){var Ve,tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(Re.q)({id:ut});case 2:Ve=gt.sent,Ve!=null&&Ve.name&&(rt={description:Ve.description,languages:Ve.languages,name:Ve.name},Pr.current.form.setFieldsValue(rt),On(Object(g.a)({},rt)),vr(Object(O.a)(Ve.data)),Fe((tt=Ve.data)===null||tt===void 0?void 0:tt.map(function(mt){return mt.id})));case 4:case"end":return gt.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}();Object(k.useEffect)(function(){ut&&Za()},[ut]),Object(k.useEffect)(function(){var Je,$e=((Je=Nt.location.query)===null||Je===void 0?void 0:Je.group_id)||0;je.group_id=Number($e),Xt({type:"problemset/getDisciplines",payload:Object(g.a)(Object(g.a)({source:"question"},je),{},{group_type:Hn})}),Yt(je),zr(je).then(function(Ve){Ve!=null&&Ve.status||Fr(Ve==null?void 0:Ve.item_banks_group),Wr(!1)}),Ni(),ga()},[]),Object(k.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(k.useEffect)(function(){return Xt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Xt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(k.useEffect)(function(){return Xt({type:"globalSetting/headerFooterToggle",payload:Ge}),function(){Xt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(k.useEffect)(function(){Object(xr.X)(Ze?ht:"\u8BD5\u9898\u5E93")},[Ze,ht]);var na=function($e,Ve){var tt=[];if(!$e){var rt,vt;Bt==null||((rt=Bt.disciplinesData)===null||rt===void 0||((vt=rt.disciplines)===null||vt===void 0))||vt.forEach(function(Ur){var Ri;Ur==null||((Ri=Ur.sub_disciplines)===null||Ri===void 0)||Ri.forEach(function(Vi){var Ra;Vi==null||((Ra=Vi.tag_disciplines)===null||Ra===void 0)||Ra.forEach(function(Di){Di.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&tt.push(Di)})})})}if($e&&!Ve){var gt,mt,$t,$n=Bt==null||((gt=Bt.disciplinesData)===null||gt===void 0||((mt=gt.disciplines)===null||mt===void 0))?void 0:mt.find(function(Ur){return Ur.id===$e});$n==null||(($t=$n.sub_disciplines)===null||$t===void 0)||$t.forEach(function(Ur){var Ri;Ur==null||((Ri=Ur.tag_disciplines)===null||Ri===void 0)||Ri.forEach(function(Vi){Vi.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&tt.push(Vi)})})}if($e&&Ve){var _i,Pn,ci,di,oi=Bt==null||((_i=Bt.disciplinesData)===null||_i===void 0||((Pn=_i.disciplines)===null||Pn===void 0))?void 0:Pn.find(function(Ur){return Ur.id===$e}),bi=oi==null||((ci=oi.sub_disciplines)===null||ci===void 0)?void 0:ci.find(function(Ur){return Ur.id===Ve});bi==null||((di=bi.tag_disciplines)===null||di===void 0)||di.forEach(function(Ur){Ur.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&tt.push(Ur)})}return tt},ga=function(){var Je=Object(_.a)(T.a.mark(function $e(){return T.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:Xt({type:"problemset/getTeachGroupData"});case 1:case"end":return tt.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}();Object(k.useEffect)(function(){var Je=Bt.basketData||{},$e=Je.completion_questions_count,Ve=$e===void 0?0:$e,tt=Je.judgement_questions_count,rt=tt===void 0?0:tt,vt=Je.multiple_questions_count,gt=vt===void 0?0:vt,mt=Je.practical_questions_count,$t=mt===void 0?0:mt,$n=Je.program_questions_count,_i=$n===void 0?0:$n,Pn=Je.single_questions_count,ci=Pn===void 0?0:Pn,di=Je.subjective_questions_count,oi=di===void 0?0:di,bi=Je.combination_questions_count,Ur=bi===void 0?0:bi,Ri=Ve+rt+gt+$t+_i+ci+oi+Ur;$a(Ri)},[Bt.basketData]);var zr=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return tt=Object(g.a)({},Ve),tt.item_type=Ze?"PROGRAM":Ve.item_type,Wr(!0),tt.keyword=encodeURIComponent(Ve.keyword||""),gt.next=6,Xt({type:"problemset/getItemBanks",payload:tt});case 6:if(rt=gt.sent,!(rt&&rt.status!==403&&rt.status!==401&&rt.status!==500)){gt.next=18;break}return Yr(rt.items_count||0),St(rt.items||[]),lr(rt.tag_disciplines||[]),xe(rt.used_shixun_ids||[]),Ua(rt.items||[]),Ze||Fe([]),lo((rt==null?void 0:rt.navigation)||[]),Jt((rt==null?void 0:rt.added_num)||0),Wr(!1),gt.abrupt("return",rt);case 18:case"end":return gt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Ni=function(){Xt({type:"problemset/getBasketList",payload:{}})},Ua=function($e){var Ve=$e.every(function(tt){var rt;return((rt=tt.program_attr)===null||rt===void 0?void 0:rt.status)===0});pa.current=Ve},Io=function($e,Ve){if(je.discipline_id=$e||"",je.sub_discipline_id=Ve||"",je.tag_discipline_id="",je.page=1,je.per_page=20,delete je.id,sr($e===null?-1:null),Yt(je),zr(je),$e===null)return},Po=function($e){je.item_type=$e||"",je.page=1,je.per_page=20,Yt(je),zr(je)},mo=function($e){je.difficulty=$e||"",je.page=1,je.per_page=20,delete je.id,Yt(je),zr(je)},Ja=function($e){je.tag_discipline_id=$e,je.page=1,je.per_page=20,delete je.id,$e===-1&&(je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id=""),sr($e),Yt(je),zr(je)},qa=Object(k.useState)(!1),ra=Object(d.a)(qa,2),va=ra[0],go=ra[1],ja=function($e){Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:$e}}),je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.item_type=null,je.difficulty=null,je.type=$e,$e==="0"?je.group_id=0:je.group_id=null,$e==="3"&&Ze?je.only_published=!0:je.only_published=null,$e==="3"?go(!0):go(!1),je.page=1,je.per_page=20,delete je.id,sr(-1),Qr($e),Yt(je),zr(je)},ya=function($e,Ve){je.page=$e,je.per_page=Ve,Yt(je),zr(je)},ia=function($e){je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.item_type=null,je.difficulty=null,je.page=1,je.keyword=$e,delete je.id,$e?(Qa(!0),Object(En.a)({name:$e,copywriting:$e,position:Ze?"Practice":"ItemBank"})):Qa(!1),sr(-1),Yt(je),zr(je)},Cr=function(){je.per_page=20,Yt(je),zr(je)},wi=function($e){var Ve=$e.length===An.length&&je.page>1?je.page-1:je.page;je.page=Ve,je.per_page=20,Ni(),Yt(je),zr(je)},aa=function(){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},Qi=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve,tt){var rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:if(!tt){gt.next=6;break}return gt.next=3,Object(Re.n)({id:Ve});case 3:gt.t0=gt.sent,gt.next=9;break;case 6:return gt.next=8,Object(Re.G)({id:Ve});case 8:gt.t0=gt.sent;case 9:rt=gt.t0,(rt==null?void 0:rt.status)===0&&Cr();case 11:case"end":return gt.stop()}},$e)}));return function(Ve,tt){return Je.apply(this,arguments)}}(),wa=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Ha(Ve);case 1:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),oa=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Wa([Ve]);case 1:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Ba=function($e){Ae.current="",ma.current="",R.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:m.a.createElement("div",{className:"font14"},m.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),m.a.createElement(A.a.Group,{className:"mt10",onChange:function(tt){return ma.current=tt.target.value}},m.a.createElement(A.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),m.a.createElement(A.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),m.a.createElement(A.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),m.a.createElement(A.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),m.a.createElement(A.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),m.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),m.a.createElement(Ea,{className:"mt10",rows:4,defaultValue:Ae.current,onChange:function(tt){return Ae.current=tt.target.value}})),onOk:function(){return new Promise(function(){var tt=Object(_.a)(T.a.mark(function rt(vt,gt){var mt;return T.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:if(ma.current&&Ae.current){$n.next=3;break}return i.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),$n.abrupt("return",gt());case 3:return $n.next=5,Object(Re.o)({id:$e,clazz:ma.current,description:Ae.current});case 5:mt=$n.sent,mt.status===0&&i.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),vt();case 8:case"end":return $n.stop()}},rt)}));return function(rt,vt){return tt.apply(this,arguments)}}())}})},eo=function($e){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:$e}}})},Fa=function($e){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:$e}}})},to=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt,vt,gt;return T.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:if(tt=Ve.item_type,!(tt==="PROGRAM")){$t.next=12;break}return rt=Ve.program_attr.identifier,$t.next=5,Xt({type:"problemset/startExperience",payload:{id:rt}});case 5:if(vt=$t.sent,!(vt.status===0)){$t.next=10;break}return gt=vt.identifier,Object(xr.S)("/myproblems/".concat(gt)),$t.abrupt("return");case 10:return i.b.warn(vt.message),$t.abrupt("return");case 12:Xt({type:"problemset/setActionTabs",payload:{key:tt,params:Ve}});case 13:case"end":return $t.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Gi=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt,vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(!je.exam_id){mt.next=6;break}return mt.next=3,Object(Re.M)({item_id:Ve,id:je.exam_id});case 3:return tt=mt.sent,tt.status===0&&Cr(),mt.abrupt("return");case 6:if(!(je!=null&&je.exercise_id)){mt.next=12;break}return mt.next=9,Object(Qt.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:je==null?void 0:je.exercise_id,item_bank_ids:[Ve]}});case 9:return rt=mt.sent,rt.status===0&&Cr(),mt.abrupt("return");case 12:return mt.next=14,Xt({type:"problemset/cancel",payload:{id:Ve,item_bank:1}});case 14:vt=mt.sent,vt.status===0&&(Cr(),Ni());case 16:case"end":return mt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Zi=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(Ve),group_type:ur.Mine}}),je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.page=1,je.per_page=20,je.group_id=Math.abs(Ve),sr(-1),Yt(je),zr(je).then(function(vt){return Fr(vt==null?void 0:vt.item_banks_group)});case 10:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),no=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt,vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(!je.exam_id){mt.next=6;break}return mt.next=3,Object(Re.t)({exam_id:je.exam_id,item_bank_ids:[Ve]});case 3:return tt=mt.sent,tt.status===0&&Cr(),mt.abrupt("return");case 6:if(!(je!=null&&je.exercise_id)){mt.next=12;break}return mt.next=9,Object(Qt.a)("/api/exercises/".concat(je==null?void 0:je.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[Ve]}});case 9:return rt=mt.sent,rt.status===0&&Cr(),mt.abrupt("return");case 12:if(!(fa===200)){mt.next=15;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),mt.abrupt("return");case 15:return mt.next=17,Xt({type:"problemset/select",payload:{item_bank_ids:[Ve]}});case 17:vt=mt.sent,vt.status===0&&(Cr(),Ni());case 19:case"end":return mt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),ro=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(Ve){rt.next=3;break}if(Ce!=null&&Ce.length){rt.next=3;break}return rt.abrupt("return",i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Me.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:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow),style:{maxHeight:500,overflow:"auto"}},m.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),m.a.createElement(V.a,{defaultValue:!0,value:Me.current,onChange:function(gt){return Me.current=gt}})),onOk:function(){var vt=Object(_.a)(T.a.mark(function mt(){var $t,$n;return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(Re.f)({ids:Ve?[Ve]:Ce,groups_ids:($t=Me.current)===null||$t===void 0?void 0:$t[0]});case 2:$n=Pn.sent,Me.current=[],($n==null?void 0:$n.status)===0&&Cr();case 5:case"end":return Pn.stop()}},mt)}));function gt(){return vt.apply(this,arguments)}return gt}()});case 5:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),ko=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(Re.D)({clazz:"ItemBank",id:Ve});case 2:tt=gt.sent,rt=(tt==null?void 0:tt.groups)||[],Me.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:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow)},m.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"),m.a.createElement(u.a.Group,{className:ue.a.checkbox,defaultValue:Me.current,onChange:function($t){return Me.current=$t}},rt==null?void 0:rt.map(function(mt){return m.a.createElement(u.a,{key:mt.group_id,value:mt.group_id},mt.name)}))),onOk:function(){var mt=Object(_.a)(T.a.mark(function $n(){return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.abrupt("return",new Promise(function(){var ci=Object(_.a)(T.a.mark(function di(oi,bi){var Ur,Ri,Vi;return T.a.wrap(function(Di){for(;;)switch(Di.prev=Di.next){case 0:if(Me.current.length){Di.next=3;break}return i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Di.abrupt("return",bi());case 3:return Ri=rt==null||((Ur=rt.map(function(_o){return _o.group_id}))===null||Ur===void 0)?void 0:Ur.filter(function(_o){return!Me.current.includes(_o)}),Di.next=6,Object(Re.l)({ids:[Ve],clazz:"ItemBank",group_ids:Ri});case 6:return Vi=Di.sent,Me.current=[],(Vi==null?void 0:Vi.status)===0&&(i.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),Cr()),Di.abrupt("return",oi());case 10:case"end":return Di.stop()}},di)}));return function(di,oi){return ci.apply(this,arguments)}}()));case 1:case"end":return Pn.stop()}},$n)}));function $t(){return mt.apply(this,arguments)}return $t}()});case 6:case"end":return gt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Mo=function($e){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:$e}}})},io=function(){Xt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:je}});return},No=function(){var $e={discipline_id:"&discipline_id=".concat(je.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(je.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(je.tag_discipline_id),difficulty:"&difficulty=".concat(je.difficulty),item_type:"&item_type=".concat(je.item_type),group_id:"&group_id=".concat(je.group_id||0)},Ve="/problemset/newitem?pages=".concat(je.page);Object.keys($e).forEach(function(tt){je[tt]&&(Ve=Ve+$e[tt])}),y.d===null||y.d===void 0||y.d.push(Ve)},Vr=function($e){var Ve=Ce;if(!(Ve!=null&&Ve.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(fa+Ve.length>200&&$e&&Ge){i.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-fa,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(Ve.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}$e?Hr(Ve):ai(Ve)},Hr=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:tt=Object(O.a)(Ve),An.forEach(function(gt){if(tt.includes(gt.id)){var mt;gt.item_type==="PROGRAM"&&((mt=gt.program_attr)===null||mt===void 0?void 0:mt.status)===0&&Object(ot.remove)(tt,function($t){return $t===gt.id})}}),R.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:m.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",Ve.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 gt=Object(_.a)(T.a.mark(function $t(){var $n;return T.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!je.exam_id){Pn.next=6;break}return Pn.next=3,Object(Re.t)({exam_id:je.exam_id,item_bank_ids:tt});case 3:$n=Pn.sent,Pn.next=15;break;case 6:if(!(je!=null&&je.exercise_id)){Pn.next=12;break}return Pn.next=9,Object(Qt.a)("/api/exercises/".concat(je==null?void 0:je.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:tt}});case 9:$n=Pn.sent,Pn.next=15;break;case 12:return Pn.next=14,Xt({type:"problemset/select",payload:{item_bank_ids:tt}});case 14:$n=Pn.sent;case 15:$n.status===0&&(Cr(),Ni());case 16:case"end":return Pn.stop()}},$t)}));function mt(){return gt.apply(this,arguments)}return mt}()});case 3:case"end":return vt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),ai=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(!je.exam_id){vt.next=6;break}return vt.next=3,Object(Qt.a)("/api/examination_banks/".concat(je.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:Ve}});case 3:tt=vt.sent,vt.next=15;break;case 6:if(!(je!=null&&je.exercise_id)){vt.next=12;break}return vt.next=9,Object(Qt.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:je==null?void 0:je.exercise_id,item_bank_ids:Ve}});case 9:tt=vt.sent,vt.next=15;break;case 12:return vt.next=14,Xt({type:"problemset/unselectAll",payload:{item_ids:Ve}});case 14:tt=vt.sent;case 15:tt.status===0&&(Cr(),Ni());case 16:case"end":return vt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Kr=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt;return T.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(!(Ge&&fa===200)){vt.next=3;break}return i.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),vt.abrupt("return");case 3:if(!je.exam_id){vt.next=10;break}return vt.next=6,Object(Re.t)({exam_id:je.exam_id,shixun_ids:Ve});case 6:tt=vt.sent,tt.status===0&&Cr(),vt.next=14;break;case 10:return vt.next=12,Xt({type:"problemset/select",payload:{shixun_ids:Ve}});case 12:tt=vt.sent,tt.status===0&&(Ni(),Cr());case 14:case"end":return vt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Ca=function(){Xt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Wa=function($e){var Ve,tt,rt,vt;if(!((Ve=Bt.teachGroupData)!==null&&Ve!==void 0&&(tt=Ve.groups)!==null&&tt!==void 0&&tt.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:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow)},m.a.createElement(u.a.Group,{className:ue.a.checkbox,defaultValue:Me.current,onChange:function(mt){return Me.current=mt}},(rt=Bt.teachGroupData)===null||rt===void 0||((vt=rt.groups)===null||vt===void 0)?void 0:vt.map(function(gt){return m.a.createElement(u.a,{key:gt.group_id,value:gt.group_id},gt.name)}))),onOk:function(){return new Promise(function(){var mt=Object(_.a)(T.a.mark(function $t($n,_i){var Pn,ci;return T.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:if((Pn=Me.current)!==null&&Pn!==void 0&&Pn.length){oi.next=3;break}return i.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),oi.abrupt("return",_i());case 3:return oi.next=5,Object(Re.l)({ids:$e||Ce,clazz:"ItemBank",group_ids:Me.current});case 5:ci=oi.sent,(ci==null?void 0:ci.status)===0&&(i.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Me.current=[],Fe([]),Cr(),$n());case 7:case"end":return oi.stop()}},$t)}));return function($t,$n){return mt.apply(this,arguments)}}())}})},Ci=function(){var $e=function(){var Ve=Object(_.a)(T.a.mark(function tt(){var rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return Pa(!0),gt.next=3,Object(Re.j)({ids:Ce});case 3:rt=gt.sent,Pa(!1),(rt==null?void 0:rt.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(rt.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(rt.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(){wi(new Array(rt.success))}});case 6:case"end":return gt.stop()}},tt)}));return function(){return Ve.apply(this,arguments)}}();if(Ce!=null&&Ce.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(Ce==null?void 0:Ce.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:$e});return}i.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},ao=function(){var $e,Ve;if(!(Ce!=null&&Ce.length))return i.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(An!=null&&($e=An.filter(function(tt){return Ce.includes(tt.id)}))!==null&&$e!==void 0&&$e.every(function(tt){return tt.public}))return i.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(An!=null&&(Ve=An.filter(function(tt){return Ce.includes(tt.id)}))!==null&&Ve!==void 0&&Ve.find(function(tt){var rt;return tt.item_type==="PROGRAM"&&((rt=tt.program_attr)===null||rt===void 0?void 0:rt.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"||_n.userInfo.professional_certification?Ha():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:m.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",m.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",m.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",m.a.createElement("br",null),m.a.createElement(u.a,{className:"mt10",defaultChecked:!1,onChange:function(rt){return Be.current=rt.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ha()}})},Ha=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){var tt,rt;return T.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return tt=Hn===ur.TeachGroupShare?1:2,gt.next=3,Object(Re.g)({ids:Ve?[Ve]:Ce,source:tt});case 3:rt=gt.sent,rt.status===0&&(Be.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Be.current=!1,Fe([]),Cr());case 5:case"end":return gt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),vo=function($e){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:m.a.createElement(m.a.Fragment,null,m.a.createElement("div",{className:ue.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),m.a.createElement("div",{className:ue.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ve=Object(_.a)(T.a.mark(function rt(){var vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(Re.L)({identifier:$e});case 2:vt=mt.sent,(vt==null?void 0:vt.status)===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),Cr());case 4:case"end":return mt.stop()}},rt)}));function tt(){return Ve.apply(this,arguments)}return tt}()})},sa=function($e){R.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:m.a.createElement("p",{className:ue.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ve=Object(_.a)(T.a.mark(function rt(){var vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(Re.K)({identifier:$e});case 2:vt=mt.sent,(vt==null?void 0:vt.status)===0&&(i.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),Cr());case 4:case"end":return mt.stop()}},rt)}));function tt(){return Ve.apply(this,arguments)}return tt}()})},Ka=function(){var Je=Object(_.a)(T.a.mark(function $e(Ve){return T.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Ve,group_type:ur.TeachGroupShare}}),je.page=1,je.group_id=Ve||null,delete je.id,Yt(Object(g.a)({},je)),zr(je);case 6:case"end":return rt.stop()}},$e)}));return function(Ve){return Je.apply(this,arguments)}}(),Sa=function($e){je.sort_by=$e.type,je.sort_direction=$e.direction,je.page=1,je.per_page=20,Rr($e.name),Yt(je),zr(je)},yo=function(){je.page=1,Yt(je),zr(je)},Ga=function($e){je.discipline_id="",je.sub_discipline_id="",je.tag_discipline_id="",je.item_type=null,je.difficulty=null,je.page=1,je.per_page=20,je.group_id=$e,sr(-1),Yt(je),zr(je).then(function(Ve){return Fr(Ve==null?void 0:Ve.item_banks_group)})},dr=function(){if(!(Ce!=null&&Ce.length)){Xt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:je}});return}R.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:m.a.createElement("div",{className:"font14 ".concat(ue.a.overflow)},"\u5DF2\u9009\u4E2D",Ce==null?void 0:Ce.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(ct.k)({ids:Ce})}})},er=function(){var Je=Object(_.a)(T.a.mark(function $e(){var Ve,tt,rt,vt;return T.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(Re.i)({ids:Ce});case 2:Ve=mt.sent,tt=Ve.data||{},rt=tt.unpublish_program_question_count,vt=tt.total_item_banks,rt===0?R.a.error({title:"\u9519\u8BEF",content:m.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:m.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",vt,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",rt,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var $t=Object(_.a)(T.a.mark(function _i(){var Pn;return T.a.wrap(function(di){for(;;)switch(di.prev=di.next){case 0:return di.next=2,Object(Re.h)({ids:Ce});case 2:Pn=di.sent,Pn.status===0&&(i.b.success("\u53D1\u5E03\u6210\u529F"),Cr());case 4:case"end":return di.stop()}},_i)}));function $n(){return $t.apply(this,arguments)}return $n}()});case 5:case"end":return mt.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}(),ti=m.a.createElement(p.a,null,In&&m.a.createElement(p.a.Item,{onClick:function(){return Vr(!0)}},"\u6279\u91CF\u52A0\u5165"),In&&m.a.createElement(p.a.Item,{onClick:function(){return Vr(!1)}},"\u6279\u91CF\u79FB\u51FA"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:function(){return ro()}},"\u79FB\u52A8\u5230"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:function(){return Wa()}},"\u6279\u91CF\u5171\u4EAB"),Hn===ur.Mine&&Ge&&m.a.createElement(p.a.Item,{onClick:Ci},"\u6279\u91CF\u5220\u9664")),ui=function($e){if(Ze)if((ln==null?void 0:ln.length)<=0){var Ve=An.filter(function($t){return $e.includes($t.id)});vr(Object(O.a)(Ve)),Fe(Ve==null?void 0:Ve.map(function($t){return $t.id}))}else if($e.length>ln.length){var tt,rt=An.filter(function($t){return $e.includes($t.id)}),vt=ln.map(function($t){return $t.id}),gt=rt.filter(function($t){return!vt.includes($t.id)});vr([].concat(Object(O.a)(ln),Object(O.a)(gt))),Fe((tt=[].concat(Object(O.a)(ln),Object(O.a)(gt)))===null||tt===void 0?void 0:tt.map(function($t){return $t.id}))}else{var mt=ln.filter(function($t){return $e.includes($t.id)});vr(Object(O.a)(mt)),Fe(mt==null?void 0:mt.map(function($t){return $t.id}))}else Fe($e)},Ji=function($e){if(Ze)if($e){var Ve,tt=ln==null?void 0:ln.map(function(mt){return mt.id}),rt=An.filter(function(mt){return!tt.includes(mt.id)});vr([].concat(Object(O.a)(ln),Object(O.a)(rt))),Fe((Ve=[].concat(Object(O.a)(ln),Object(O.a)(rt)))===null||Ve===void 0?void 0:Ve.map(function(mt){return mt.id}))}else{var vt=An==null?void 0:An.map(function(mt){return mt.id}),gt=ln.filter(function(mt){return!vt.includes(mt.id)});vr(Object(O.a)(gt)),Fe(gt==null?void 0:gt.map(function(mt){return mt.id}))}else Fe($e?An==null?void 0:An.map(function(mt){return mt.id}):[])},zi=function(){var $e="/problemset/preview";if(je.exam_id&&($e="/paperlibrary/edit/".concat(je.exam_id)),je!=null&&je.exercise_id){var Ve;$e="/classrooms/".concat(sn==null||((Ve=sn.params)===null||Ve===void 0)?void 0:Ve.coursesId,"/exercise/").concat(je==null?void 0:je.exercise_id,"/edit")}y.d.push($e)},Aa=[{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"}],qi={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Jr=function($e,Ve){var tt,rt=Ve.id<0?"--":In?Ve[je.exercise_id?"added":"choosed"]?m.a.createElement("span",{key:1,className:ue.a.btnAdd,onClick:function(mt){mt.target.style.pointerEvents="none",Gi(Ve.id)}},Ge?"\u79FB\u51FA\u8BD5\u9898\u7BEE":m.a.createElement("span",null,m.a.createElement("b",{className:"iconfont icon-yichu ".concat(ue.a.cancelC)}),"\u79FB\u51FA")):Ve.item_type==="PROGRAM"&&((tt=Ve.program_attr)===null||tt===void 0?void 0:tt.status)===0?m.a.createElement(h.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},m.a.createElement("span",{className:ue.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":m.a.createElement("span",{style:{padding:"0 3px"}},m.a.createElement("b",{className:"iconfont icon-jiaru ".concat(ue.a.addC)}),"\u52A0\u5165")," ")):m.a.createElement("span",{className:ue.a.btnAdd,onClick:function(){return no(Ve.id)}},Ge?"\u52A0\u5165\u8BD5\u9898\u7BEE":m.a.createElement("span",{style:{padding:"0 3px"}},m.a.createElement("b",{className:"iconfont icon-jiaru ".concat(ue.a.addC)}),"\u52A0\u5165")):m.a.createElement(m.a.Fragment,null),vt=m.a.createElement("span",{className:ue.a.actonBtn},Ve.id>0&&m.a.createElement(or.a,{isProblemset:Ge,user:_n,key:Ve.id,data:Ve,activeTabsKey:Hn,selectIds:Ce,onCollect:Qi,onSetPublic:wa,onStartExperience:to,onCorrection:Ba,onPublicReview:aa,onSetPrivate:eo,onDelete:Fa,onCancel:Gi,onSelect:no,onMoveTo:ro,onSetShare:oa,onCancelShare:ko,onPublish:vo,onCancelPublish:sa}),rt);return vt};Object(k.useEffect)(function(){if(Ze){var Je=sn.params,$e=Je.coursesId,Ve=Je.categoryId;Xt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:Ve,coursesId:$e,type:5}})}},[Ze]);var Oa=function(){var Je=Object(_.a)(T.a.mark(function $e(){var Ve,tt,rt,vt,gt;return T.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return Pr.current.form.validateFields().catch(function($n){document.body.scrollIntoView()}),$t.next=3,Pr.current.form.validateFields();case 3:if(Ve=Pr.current.form.getFieldsValue(),console.log(Ve,"value"),!((ln==null?void 0:ln.length)<=0)){$t.next=8;break}return i.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),$t.abrupt("return");case 8:return Ln(!0),tt=sn.params,rt=tt.coursesId,vt=tt.categoryId,$t.next=12,Object(Qt.a)(ut?"/api/homework_commons/".concat(vt,"/update_hack.json"):"/api/courses/".concat(rt,"/homework_commons.json"),{method:ut?"put":"post",body:Object(g.a)(Object(g.a)({},Ve),{},{coursesId:rt,category:vt,type:5,hack_ids:ln==null?void 0:ln.map(function($n){return $n.id})})});case 12:gt=$t.sent,(gt==null?void 0:gt.status)===0&&y.d.push("/classrooms/".concat(sn.params.coursesId,"/program_homework/").concat(ut?vt:gt.homework_id,"/detail?tabs=1")),Ln(!1);case 15:case"end":return $t.stop()}},$e)}));return function(){return Je.apply(this,arguments)}}();return m.a.createElement("div",{className:ue.a.page},m.a.createElement("section",null,m.a.createElement("div",{className:ue.a.wrap},Zn.course_name&&Ze&&m.a.createElement("section",{className:"animated fadeIn"},m.a.createElement("aside",{className:"mt10"},Zn.category&&m.a.createElement(f.a,{separator:">"},m.a.createElement(f.a.Item,null,m.a.createElement(H.a,{to:"/classrooms/".concat(Zn.course_id,"/program_homework")},Zn.course_name)),m.a.createElement(f.a.Item,null,m.a.createElement(H.a,{to:"/classrooms/".concat(Zn.course_id,"/program_homework")},Zn.category.category_name)),m.a.createElement(f.a.Item,null,ht)))),m.a.createElement("div",{className:ue.a.title},Ze?ht:"\u8BD5\u9898\u5E93"),Ze&&m.a.createElement(ca,{data:Kn,ref:Pr}),m.a.createElement("div",{className:ue.a.headerWrapper},m.a.createElement("div",{className:ue.a.tabsWrap},m.a.createElement(B.a,{activeKey:Hn,onChange:ja,tabBarExtraContent:m.a.createElement("div",{className:ue.a.searchWrap},Hn===ur.Mine&&Ge&&m.a.createElement(L.a,{className:ue.a.addQuestionBtn,onClick:No},m.a.createElement("img",{src:_t.a,className:ue.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),m.a.createElement(da,{allowClear:!0,suffix:m.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(ue.a.searchIcon),onClick:function(){return ia(je.keyword)}}),className:ue.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function($e){je.keyword=$e.target.value,Yt(Object(g.a)({},je))},onSearch:ia}))},m.a.createElement(pi,{tab:"\u516C\u5171",key:"1"}),((Fn=Bt.teachGroupData)===null||Fn===void 0||((tn=Fn.groups)===null||tn===void 0)?void 0:tn.length)&&m.a.createElement(pi,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(br.o)()&&!Object(br.m)()&&!Ze&&m.a.createElement(pi,{tab:"\u6536\u85CF\u5939",key:"2"}),m.a.createElement(pi,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),m.a.createElement(Q.a,{showSelectAll:!1,className:ue.a.select,disciplinesData:(hn=Bt.disciplinesData)===null||hn===void 0?void 0:hn.disciplines,knowledgeData:Wi,directionValue:je.discipline_id,subDisciplineValue:je.sub_discipline_id,typeValue:je.item_type,isprogram_homework:Ze,showKnowledge:!0,name:$i,setname:yr,difficultyValue:je.difficulty,showShixun:!Object(br.m)()&&!je.exercise_id&&Hn!==ur.TeachGroupShare&&Hn!==ur.Public,onShixunChange:Ca,onDirectionChange:Io,onTypeChange:Po,onDifficultyChange:mo,knowledgeValue:Vn,onKnowledgeChange:Ja,teachGroupData:(ar=Bt.teachGroupData)===null||ar===void 0?void 0:ar.groups,onTeachGroupChange:Ka,teachGroupValue:je.group_id,showTeachGroup:va})),m.a.createElement("div",{className:ue.a.treeWrapper,style:{display:Hn===ur.Mine?"block":"none"}},m.a.createElement("div",{className:ue.a.treeHeader},m.a.createElement(q.a,{data:Mr,onClick:Zi}),m.a.createElement(L.a,{type:"link",onClick:io,className:ue.a.exportBtn},m.a.createElement("img",{src:ea.a,alt:"",className:ue.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),m.a.createElement(K.a,{spinning:gi},m.a.createElement("div",{ref:Lr,className:ue.a.treeContent},m.a.createElement(bn.a,{isProblemset:Ge,reloadData:Cr,data:Nr,onShare:Wa,onOpen:Zi})))),m.a.createElement("div",{className:ue.a.contentWrap},m.a.createElement("div",{className:ue.a.batchWrap},m.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!Ze&&m.a.createElement("div",{className:"font14"},m.a.createElement(M.a,{overlay:m.a.createElement(p.a,{selectedKeys:[rr]},Na==null?void 0:Na.map(function(Je,$e){return m.a.createElement(p.a.Item,{key:Je.name,onClick:function(){return Sa(Je)}},Je.name)}))},m.a.createElement("span",{style:{color:"#464F66"}},m.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),rr))),Ze&&m.a.createElement("div",null,m.a.createElement(u.a,{checked:(An==null?void 0:An.filter(function(Je){return ln==null?void 0:ln.map(function($e){return $e.id}).includes(Je.id)}).length)===An.length,onChange:function($e){return Ji($e.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",Ce==null?void 0:Ce.length,")"))),Ze&&m.a.createElement(R.a,{visible:Er,centered:!0,width:700,okText:"\u786E\u8BA4".concat(ut?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return cr(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:Oa,confirmLoading:Un,title:"\u67E5\u770B\u5DF2\u9009"},m.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",ln==null?void 0:ln.length,"\u4E2A"),m.a.createElement("div",{style:{height:400,overflow:"auto"}},ln==null?void 0:ln.map(function(Je,$e){var Ve,tt,rt,vt,gt,mt;return m.a.createElement("div",{key:$e,className:ue.a.sendModal},m.a.createElement("div",{className:ue.a.li},m.a.createElement("p",null,Je==null?void 0:Je.name),m.a.createElement("div",{className:ue.a.bottom},m.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),m.a.createElement("i",{className:ue.a.line}),m.a.createElement("span",{className:"c-grey-333"},Je.difficulty===1&&"\u7B80\u5355",Je.difficulty===2&&"\u9002\u4E2D",Je.difficulty===3&&"\u56F0\u96BE"),m.a.createElement("i",{className:ue.a.line}),m.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",m.a.createElement(h.a,{title:Je==null||((Ve=Je.author)===null||Ve===void 0)?void 0:Ve.name},m.a.createElement("span",{className:"c-grey-333"},(Je==null||((tt=Je.author)===null||tt===void 0||((rt=tt.name)===null||rt===void 0))?void 0:rt.length)>6?(Je==null||((vt=Je.author)===null||vt===void 0||((gt=vt.name)===null||gt===void 0))?void 0:gt.substr(0,3))+"...":Je==null||((mt=Je.author)===null||mt===void 0)?void 0:mt.name))),m.a.createElement("i",{className:ue.a.line}),m.a.createElement("span",{className:ue.a.des},"\u66F4\u65B0\xA0",m.a.createElement("span",{className:"c-grey-333"},Je==null?void 0:Je.updated_at)))),m.a.createElement("div",{className:ue.a.del,onClick:function(){ui(ln.filter(function($n){return $n.id!==Je.id}).map(function($n){return $n.id}))}},"\u5220\u9664"))})))),m.a.createElement("div",null,Hn===ur.Mine&&Ge&&m.a.createElement(L.a,{onClick:dr,type:"link",className:ue.a.exportBtn},m.a.createElement("img",{src:yi.a,className:ue.a.pngIcon}),m.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?m.a.createElement("div",null,m.a.createElement(L.a,{style:{paddingLeft:0},onClick:function(){je.page=1,je.keyword=null,delete je.id,Yt(je),Qa(!1),zr(je)},type:"link"}," ",m.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),m.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",decodeURIComponent(je.keyword),"\u201D")):null,m.a.createElement("div",{className:ue.a.contentListWrap},pn!==0?m.a.createElement(K.a,{size:"large",spinning:kn["problemset/getItemBanks"]},An.map(function(Je,$e){var Ve,tt;return m.a.createElement("div",{className:ue.a.li},m.a.createElement("div",{className:ue.a.top},m.a.createElement(or.b,{key:Je.id,data:Je,selectIds:Ce,onSelectCheckBox:ui})),m.a.createElement("div",{className:ue.a.bottom},m.a.createElement("p",{className:"".concat(ue.a.actionLeftItem," ").concat(ue.a.questionTypeName)},(Ve=Aa.find(function(rt){return rt.type===Je.item_type}))===null||Ve===void 0?void 0:Ve.name),m.a.createElement("p",{className:ue.a.actionLeftItem},qi[Je.difficulty]),m.a.createElement("p",{className:ue.a.actionLeftItem},"\u521B\u5EFA\u8005",m.a.createElement("span",{className:"c-grey-333"},Je==null||((tt=Je.author)===null||tt===void 0)?void 0:tt.name)),m.a.createElement("p",{className:ue.a.actionLeftItem},"\u66F4\u65B0",m.a.createElement("span",{className:"c-grey-333"},Je==null?void 0:Je.updated_at)),m.a.createElement("p",{className:ue.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",m.a.createElement("span",{className:"c-grey-333"},Je==null?void 0:Je.quotes)),!Ze&&m.a.createElement("div",{className:ue.a.more},Jr({},Je))))})):m.a.createElement(K.a,{size:"large",spinning:kn["problemset/getItemBanks"]},m.a.createElement(ae.a,null))),pn!==0&&!Ze&&m.a.createElement(z.a,{showQuickJumper:!0,onChange:ya,defaultCurrent:1,pageSize:je==null?void 0:je.per_page,current:je.page||1,total:pn,showTotal:function($e){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},$e),"\u6761\u6570\u636E")}}),Ze&&m.a.createElement("div",{style:{height:20}})),Ge&&m.a.createElement(kt,{basketData:Bt.basketData,visible:Ta,basketTotal:fa,onClose:function(){return ho(!1)},onDelete:Mo}),!Object(br.m)()&&Ge&&m.a.createElement(hr,{visibleBasket:Ta,onToggleVisible:function(){return ho(!Ta)},count:fa})),m.a.createElement(ve,null),m.a.createElement(Ue,{onReloadData:Cr}),m.a.createElement(nt,{onReloadData:function(){return wi([null])}}),m.a.createElement(Mt,{onReloadData:Cr,onReloadBasketData:Ni}),Wn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?m.a.createElement(Tr,{shixunIds:le,cb:Kr}):null,m.a.createElement(lt,null),m.a.createElement(Ye,null),m.a.createElement(bt,null),m.a.createElement(ne,null),m.a.createElement(J,null),m.a.createElement(we,{onOk:yo}),m.a.createElement(te.a,{onOk:Ga})),Ge?m.a.createElement(k.Fragment,null,!!(Ce!=null&&Ce.length)&&m.a.createElement("div",{className:ue.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(u.a,{className:"font14",checked:An!=null&&An.length?Ce.length===(An==null?void 0:An.length):!1,onChange:function($e){return Ji($e.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",Ce==null?void 0:Ce.length,")"))),m.a.createElement("div",{className:ue.a.btns},In&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!0)}},m.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),In&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!1)}},m.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return ro()}},m.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:ao}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Wa()}}," ",m.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:Ci}," ",m.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),Hn===ur.Mine&&m.a.createElement("div",{className:ue.a.btn,onClick:er}," ",m.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),m.a.createElement("div",{onClick:function(){return Fe([])},style:{marginLeft:"auto"},className:ue.a.btn}," ",m.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):Ze?"":m.a.createElement("div",{className:ue.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(u.a,{className:"font14",checked:An!=null&&An.length?Ce.length===(An==null?void 0:An.length):!1,onChange:function($e){return Ji($e.target.checked)}},"\u672C\u9875\u5168\u9009",m.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",Ce==null?void 0:Ce.length,")"))),m.a.createElement("div",{className:ue.a.btns},In&&!!(Ce!=null&&Ce.length)&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!0)}},m.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),In&&!!(Ce!=null&&Ce.length)&&m.a.createElement("div",{className:ue.a.btn,onClick:function(){return Vr(!1)}},m.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),m.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",It,"\u9898"),m.a.createElement("div",{onClick:zi,className:ue.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),Ze&&m.a.createElement("div",{className:ue.a.batch},m.a.createElement("aside",null,m.a.createElement("div",{style:{flexShrink:0,marginRight:20}},m.a.createElement(z.a,{showQuickJumper:!0,onChange:ya,defaultCurrent:1,pageSize:je==null?void 0:je.per_page,current:je.page||1,hideOnSinglePage:!0,total:pn,showTotal:function($e){return m.a.createElement("span",{className:"mr10"},"\u5171",m.a.createElement("span",{className:"c-light-primary"},$e),"\u6761\u6570\u636E")}})),m.a.createElement("div",{className:ue.a.btns},m.a.createElement(Y.a,{align:"middle",style:{marginLeft:"auto"}},m.a.createElement(Y.a,{onClick:function(){if((ln==null?void 0:ln.length)<=0){i.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}cr(!0)},align:"middle",className:"current"},m.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),m.a.createElement("span",null,"\u5DF2\u9009",m.a.createElement("span",{className:"c-light-primary"},Ce.length),"\u4E2A")),m.a.createElement(L.a,{className:"mr20 ml40",onClick:function(){if(ut){var $e;y.d.push("/classrooms/".concat(sn.params.coursesId,"/program_homework/").concat(sn==null||(($e=sn.params)===null||$e===void 0)?void 0:$e.categoryId,"/detail?tabs=1"));return}y.d.push("/classrooms/".concat(sn.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),m.a.createElement(L.a,{loading:Un,onClick:Oa,type:"primary"},"\u786E\u8BA4",ut?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Ya=Ee.default=Object(y.a)(function(Vt){var st=Vt.classroomList,Pt=Vt.problemset,xt=Vt.user,Dt=Vt.loading,Zt=Vt.globalSetting,yn=Vt.shixunHomeworks;return{classroomList:st,problemset:Pt,user:xt,globalSetting:Zt,loading:Dt.effects,shixunHomeworks:yn}})(xa)},JYp7:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return ie});var ie;(function(Y){function N(i){return i&&typeof i=="object"&&typeof i[Symbol.iterator]=="function"}Y.is=N;const z=Object.freeze([]);function I(){return z}Y.empty=I;function*M(i){yield i}Y.single=M;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 L(i,D){for(const A of i)if(D(A))return!0;return!1}Y.some=L;function x(i,D){for(const A of i)if(D(A))return A;return}Y.find=x;function*f(i,D){for(const A of i)D(A)&&(yield A)}Y.filter=f;function*b(i,D){let A=0;for(const S of i)yield D(S,A++)}Y.map=b;function*h(...i){for(const D of i)for(const A of D)yield A}Y.concat=h;function*o(i){for(const D of i)for(const A of D)yield A}Y.concatNested=o;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);DS===R){const S=i[Symbol.iterator](),R=D[Symbol.iterator]();for(;;){const O=S.next(),g=R.next();if(O.done!==g.done)return!1;if(O.done)return!0;if(!A(O.value,g.value))return!1}}Y.equals=s})(ie||(ie={}))},LE3n:function(it,Ee,U){"use strict";var ie=U("ozfa"),Y=U("MJZm"),N=U("k1fw"),z=U("+L6B"),I=U("2/Rp"),M=U("5NDa"),G=U("5rEg"),K=U("2qtc"),n=U("kLXV"),L=U("miYZ"),x=U("tsqr"),f=U("9og8"),b=U("tJVT"),h=U("WmNS"),o=U.n(h),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"),g=U("LvDl"),_=U.n(g),d=function(E){var w=E.isProblemset,B=E.name,W=E.id,T=E.itemBanksCount,k=E.onOpen,m=k===void 0?function(){}:k,y=E.onShare,H=y===void 0?function(){}:y,Q=E.onMove,te=Q===void 0?function(){}:Q,ae=E.onDeleteOk,Te=ae===void 0?function(){}:ae,_e=Object(p.useState)(!1),ge=Object(b.a)(_e,2),ve=ge[0],Oe=ge[1],he=Object(p.useState)(B),V=Object(b.a)(he,2),P=V[0],j=V[1],$=Object(p.useState)(B),J=Object(b.a)($,2),X=J[0],ye=J[1],Re=function(){var pe=Object(f.a)(o.a.mark(function we(ke){var Ue,Qe,nt;return o.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:if(Ue=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],X.trim()){qe.next=4;break}return x.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),qe.abrupt("return");case 4:if(!(X.charAt(0)===" ")){qe.next=7;break}return x.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),qe.abrupt("return");case 7:Qe=0;case 8:if(!(Qe0?ae(function(ke){return Oe(ke,J,{children:Re.map(function(Ue){return{title:l.a.createElement(d,{isProblemset:w,name:Ue.name,id:Ue.id,itemBanksCount:Ue.item_banks_count,onMove:_e,onOpen:T,onShare:m,onDeleteOk:ve}),key:Ue.id,icon:l.a.createElement("img",{src:A.a,className:s.a.folderIcon}),isLeaf:!1}})})}):ae(function(ke){return Oe(ke,J,{isLeaf:!0})});case 6:case"end":return we.stop()}},j)}));return function($){return P.apply(this,arguments)}}(),V=function(j,$){var J=$.node,X=$.expanded;ae(function(ye){return Oe(ye,J.key,{icon:X?l.a.createElement("img",{src:R.a,className:s.a.folderIcon}):l.a.createElement("img",{src:A.a,className:s.a.folderIcon})})})};return(te==null?void 0:te.length)>0&&l.a.createElement(Y.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:te,loadData:he,onExpand:V,className:s.a.folderWrapper,selectable:!1})};Ee.a=c},LdHM:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return i}),U.d(Ee,"a",function(){return A});var ie=U("1OyB"),Y=U("vuIU"),N=U("Ji7U"),z=U("LK+K"),I=U("q1tI"),M=U("rePB"),G=U("Ff2n"),K=U("ODXe"),n=U("4IlW"),L=U("bX4T"),x=U("YrtM"),f=U("TSYQ"),b=U.n(f),h=U("+nKL"),o=U("8OUc"),p=function(H,Q){var te=H.prefixCls,ae=H.id,Te=H.flattenOptions,_e=H.childrenAsData,ge=H.values,ve=H.searchValue,Oe=H.multiple,he=H.defaultActiveFirstOption,V=H.height,P=H.itemHeight,j=H.notFoundContent,$=H.open,J=H.menuItemSelectedIcon,X=H.virtual,ye=H.onSelect,Re=H.onToggleOpen,Ke=H.onActiveValue,pe=H.onScroll,we=H.onMouseEnter,ke="".concat(te,"-item"),Ue=Object(x.a)(function(){return Te},[$,Te],function(ne,q){return q[0]&&ne[1]!==q[1]}),Qe=I.useRef(null),nt=function(q){q.preventDefault()},ot=function(q){Qe.current&&Qe.current.scrollTo({index:q})},qe=function(q){for(var se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ue=Ue.length,oe=0;oe1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(y).map(function(Q,te){if(!I.isValidElement(Q)||!Q.type)return null;var ae=Q.type.isSelectOptGroup,Te=Q.key,_e=Q.props,ge=_e.children,ve=Object(G.a)(_e,["children"]);return H||!ae?O(Q):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Te===null?te:Te,"__"),label:Te},ve),{},{options:g(ge)})}).filter(function(Q){return Q})}var _=U("2Qr1"),d=U("qNPg"),c=U("U8pU"),C=U("Kwbf"),E=U("WKfj");function w(y){var H=y.mode,Q=y.options,te=y.children,ae=y.backfill,Te=y.allowClear,_e=y.placeholder,ge=y.getInputElement,ve=y.showSearch,Oe=y.onSearch,he=y.defaultOpen,V=y.autoFocus,P=y.labelInValue,j=y.value,$=y.inputValue,J=y.optionLabelProp,X=H==="multiple"||H==="tags",ye=ve!==void 0?ve:X||H==="combobox",Re=Q||g(te);if(Object(C.a)(H!=="tags"||Re.every(function(ke){return!ke.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Ke=Re.some(function(ke){return ke.options?ke.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in ke?ke.value:ke.key)=="number"});Object(C.a)(!Ke,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!J,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!ae,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!ge,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!ge||!Te||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!ye&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!he||V,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),j!=null){var pe=Object(E.d)(j);Object(C.a)(!P||pe.every(function(ke){return Object(c.a)(ke)==="object"&&("key"in ke||"value"in ke)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!X||Array.isArray(j),"`value` should be array when `mode` is `multiple` or `tags`")}if(te){var we=null;Object(R.a)(te).some(function(ke){if(!I.isValidElement(ke)||!ke.type)return!1;var Ue=ke.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var Qe=Object(R.a)(ke.props.children).every(function(nt){return!I.isValidElement(nt)||!ke.type||nt.type.isSelectOption?!0:(we=nt.type,!1)});return!Qe}return we=Ue,!0}),we&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(we.displayName||we.name||we,"`.")),Object(C.a)($===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=w,W=Object(d.a)({prefixCls:"rc-select",components:{optionList:u},convertChildrenToData:g,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:B,fillOptionsWithMissingValue:_.a}),T=function(y){Object(N.a)(Q,y);var H=Object(z.a)(Q);function Q(){var te;return Object(ie.a)(this,Q),te=H.apply(this,arguments),te.selectRef=I.createRef(),te.focus=function(){te.selectRef.current.focus()},te.blur=function(){te.selectRef.current.blur()},te}return Object(Y.a)(Q,[{key:"render",value:function(){return I.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),Q}(I.Component);T.Option=i,T.OptGroup=A;var k=T,m=Ee.c=k},M8RZ:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return n});var ie=U("fWQN"),Y=U("mtLc"),N=U("yKVA"),z=U("879j"),I=U("q1tI"),M=U.n(I),G=U("i8i4"),K=U.n(G),n=function(L){Object(N.a)(f,L);var x=Object(z.a)(f);function f(b){var h;Object(ie.a)(this,f),h=x.call(this,b);var o=window.document;return h.node=o.createElement("div"),o.body.appendChild(h.node),h}return Object(Y.a)(f,[{key:"render",value:function(){var h=this.props.children;return Object(G.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(M.a.Component)},MI8n:function(it,Ee,U){"use strict";U.d(Ee,"c",function(){return I}),U.d(Ee,"b",function(){return n}),U.d(Ee,"e",function(){return L}),U.d(Ee,"a",function(){return x}),U.d(Ee,"d",function(){return f}),U.d(Ee,"f",function(){return b});var ie=U("/cxE"),Y=U("pmY6"),N=U("24hK"),z=U("5Y4S"),I;(function(h){h.None=()=>Y.a.None;function o(w){return(B,W=null,T)=>{let k=!1,m;return m=w(y=>k?void 0:(m?m.dispose():k=!0,B.call(W,y)),null,T),k&&m.dispose(),m}}h.once=o;function p(w,B){return A((W,T=null,k)=>w(m=>W.call(T,B(m)),null,k))}h.map=p;function l(w,B){return A((W,T=null,k)=>w(m=>{B(m),W.call(T,m)},null,k))}h.forEach=l;function u(w,B){return A((W,T=null,k)=>w(m=>B(m)&&W.call(T,m),null,k))}h.filter=u;function s(w){return w}h.signal=s;function i(...w){return(B,W=null,T)=>Object(Y.e)(...w.map(k=>k(m=>B.call(W,m),null,T)))}h.any=i;function D(w,B,W){let T=W;return p(w,k=>(T=B(T,k),T))}h.reduce=D;function A(w){let B;const W=new n({onFirstListenerAdd(){B=w(W.fire,W)},onLastListenerRemove(){B.dispose()}});return W.event}function S(w,B,W=100,T=!1,k){let m,y,H,Q=0;const te=new n({leakWarningThreshold:k,onFirstListenerAdd(){m=w(ae=>{Q++,y=B(y,ae),T&&!H&&(te.fire(y),y=void 0),clearTimeout(H),H=setTimeout(()=>{const Te=y;y=void 0,H=void 0,(!T||Q>1)&&te.fire(Te),Q=0},W)})},onLastListenerRemove(){m.dispose()}});return te.event}h.debounce=S;function R(w,B=(W,T)=>W===T){let W=!0,T;return u(w,k=>{const m=W||!B(k,T);return W=!1,T=k,m})}h.latch=R;function O(w,B){return[h.filter(w,B),h.filter(w,W=>!B(W))]}h.split=O;function g(w,B=!1,W=[]){let T=W.slice(),k=w(H=>{T?T.push(H):y.fire(H)});const m=()=>{T&&T.forEach(H=>y.fire(H)),T=null},y=new n({onFirstListenerAdd(){k||(k=w(H=>y.fire(H)))},onFirstListenerDidAdd(){T&&(B?setTimeout(m):m())},onLastListenerRemove(){k&&k.dispose(),k=null}});return y.event}h.buffer=g;class _{constructor(w){this.event=w}map(w){return new _(p(this.event,w))}forEach(w){return new _(l(this.event,w))}filter(w){return new _(u(this.event,w))}reduce(w,B){return new _(D(this.event,w,B))}latch(){return new _(R(this.event))}debounce(w,B=100,W=!1,T){return new _(S(this.event,w,B,W,T))}on(w,B,W){return this.event(w,B,W)}once(w,B,W){return o(this.event)(w,B,W)}}function d(w){return new _(w)}h.chain=d;function c(w,B,W=T=>T){const T=(...H)=>y.fire(W(...H)),k=()=>w.on(B,T),m=()=>w.removeListener(B,T),y=new n({onFirstListenerAdd:k,onLastListenerRemove:m});return y.event}h.fromNodeEventEmitter=c;function C(w,B,W=T=>T){const T=(...H)=>y.fire(W(...H)),k=()=>w.addEventListener(B,T),m=()=>w.removeEventListener(B,T),y=new n({onFirstListenerAdd:k,onLastListenerRemove:m});return y.event}h.fromDOMEventEmitter=C;function E(w){return new Promise(B=>o(w)(B))}h.toPromise=E})(I||(I={}));class M{constructor(h){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${h}_${M._idPool++}`}start(h){this._stopWatch=new z.a(!0),this._listenerCount=h}stop(){if(this._stopWatch){const h=this._stopWatch.elapsed();this._elapsedOverall+=h,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${h.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}M._idPool=0;let G=-1;class K{constructor(h,o=Math.random().toString(18).slice(2,5)){this.customThreshold=h,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(h){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||h{const u=this._stacks.get(p)||0;this._stacks.set(p,u-1)}}}class n{constructor(h){var o;this._disposed=!1,this._options=h,this._leakageMon=G>0?new K(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new M(this._options._profName):void 0}get event(){return this._event||(this._event=(h,o,p)=>{var l;this._listeners||(this._listeners=new N.a);const u=this._listeners.isEmpty();u&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const s=this._listeners.push(o?[h,o]:h);u&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,h,o);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(h){var o,p;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new N.a);for(let l of this._listeners)this._deliveryQueue.push([l,h]);for((o=this._perfMon)===null||o===void 0||o.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(ie.f)(s)}}(p=this._perfMon)===null||p===void 0||p.stop()}}dispose(){var h,o,p,l,u;this._disposed||(this._disposed=!0,(h=this._listeners)===null||h===void 0||h.clear(),(o=this._deliveryQueue)===null||o===void 0||o.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 L extends n{constructor(h){super(h);this._isPaused=0,this._eventQueue=new N.a,this._mergeFn=h==null?void 0:h.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const h=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(h))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(h){this._listeners&&(this._isPaused!==0?this._eventQueue.push(h):super.fire(h))}}class x extends L{constructor(h){var o;super(h);this._delay=(o=h.delay)!==null&&o!==void 0?o:100}fire(h){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(h)}}class f{constructor(){this.buffers=[]}wrapEvent(h){return(o,p,l)=>h(u=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>o.call(p,u)):o.call(p,u)},void 0,l)}bufferEvents(h){const o=[];this.buffers.push(o);const p=h();return this.buffers.pop(),o.forEach(l=>l()),p}}class b{constructor(){this.listening=!1,this.inputEvent=I.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(h){this.inputEvent=h,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=h(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(it,Ee,U){"use strict";(function(ie,Y){U.d(Ee,"b",function(){return p}),U.d(Ee,"i",function(){return i}),U.d(Ee,"f",function(){return D}),U.d(Ee,"d",function(){return A}),U.d(Ee,"g",function(){return S}),U.d(Ee,"h",function(){return R}),U.d(Ee,"c",function(){return O}),U.d(Ee,"k",function(){return g}),U.d(Ee,"j",function(){return _}),U.d(Ee,"a",function(){return d}),U.d(Ee,"e",function(){return E});var N;const z="en";let I=!1,M=!1,G=!1,K=!1,n=!1,L=!1,x=!1,f,b=z,h,o;const p=typeof self=="object"?self:typeof ie=="object"?ie:{};let l;typeof p.vscode!="undefined"&&typeof p.vscode.process!="undefined"?l=p.vscode.process:typeof Y!="undefined"&&(l=Y);const u=typeof((N=l==null?void 0:l.versions)===null||N===void 0?void 0:N.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!u)o=navigator.userAgent,I=o.indexOf("Windows")>=0,M=o.indexOf("Macintosh")>=0,x=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,L=!0,f=navigator.language,b=f;else if(typeof l=="object"){I=l.platform==="win32",M=l.platform==="darwin",G=l.platform==="linux",K=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,f=z,b=z;const w=l.env.VSCODE_NLS_CONFIG;if(w)try{const B=JSON.parse(w),W=B.availableLanguages["*"];f=B.locale,b=W||z,h=B._translationsConfigFile}catch(B){}n=!0}else console.error("Unable to resolve platform.");let s=0;M?s=1:I?s=3:G&&(s=2);const i=I,D=M,A=G,S=n,R=L,O=x,g=o,_=function(){if(p.setImmediate)return p.setImmediate.bind(p);if(typeof p.postMessage=="function"&&!p.importScripts){let W=[];p.addEventListener("message",k=>{if(k.data&&k.data.vscodeSetImmediateId)for(let m=0,y=W.length;m{const m=++T;W.push({id:m,callback:k}),p.postMessage({vscodeSetImmediateId:m},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const B=Promise.resolve();return W=>B.then(W)}(),d=M||x?2:I?1:3;let c=!0,C=!1;function E(){if(!C){C=!0;const w=new Uint8Array(2);w[0]=1,w[1]=2;const B=new Uint16Array(w.buffer);c=B[0]===(2<<8)+1}return c}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(it,Ee,U){"use strict";U.d(Ee,"C",function(){return ie}),U.d(Ee,"v",function(){return N}),U.d(Ee,"s",function(){return z}),U.d(Ee,"t",function(){return I}),U.d(Ee,"U",function(){return M}),U.d(Ee,"J",function(){return G}),U.d(Ee,"O",function(){return K}),U.d(Ee,"p",function(){return n}),U.d(Ee,"T",function(){return L}),U.d(Ee,"q",function(){return x}),U.d(Ee,"N",function(){return f}),U.d(Ee,"M",function(){return b}),U.d(Ee,"Q",function(){return h}),U.d(Ee,"u",function(){return o}),U.d(Ee,"x",function(){return p}),U.d(Ee,"I",function(){return l}),U.d(Ee,"f",function(){return u}),U.d(Ee,"h",function(){return s}),U.d(Ee,"g",function(){return i}),U.d(Ee,"i",function(){return D}),U.d(Ee,"G",function(){return A}),U.d(Ee,"H",function(){return S}),U.d(Ee,"r",function(){return R}),U.d(Ee,"R",function(){return O}),U.d(Ee,"d",function(){return g}),U.d(Ee,"e",function(){return _}),U.d(Ee,"E",function(){return d}),U.d(Ee,"F",function(){return c}),U.d(Ee,"j",function(){return C}),U.d(Ee,"z",function(){return E}),U.d(Ee,"K",function(){return B}),U.d(Ee,"L",function(){return W}),U.d(Ee,"m",function(){return k}),U.d(Ee,"k",function(){return y}),U.d(Ee,"A",function(){return Q}),U.d(Ee,"a",function(){return te}),U.d(Ee,"n",function(){return ae}),U.d(Ee,"l",function(){return Te}),U.d(Ee,"D",function(){return _e}),U.d(Ee,"B",function(){return ge}),U.d(Ee,"b",function(){return ve}),U.d(Ee,"S",function(){return Oe}),U.d(Ee,"o",function(){return he}),U.d(Ee,"P",function(){return V}),U.d(Ee,"w",function(){return P}),U.d(Ee,"c",function(){return j}),U.d(Ee,"y",function(){return X});function ie(pe){return!pe||typeof pe!="string"?!0:pe.trim().length===0}const Y=/{(\d+)}/g;function N(pe,...we){return we.length===0?pe:pe.replace(Y,function(ke,Ue){const Qe=parseInt(Ue,10);return isNaN(Qe)||Qe<0||Qe>=we.length?ke:we[Qe]})}function z(pe){return pe.replace(/[<>&]/g,function(we){switch(we){case"<":return"<";case">":return">";case"&":return"&";default:return we}})}function I(pe){return pe.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function M(pe,we=" "){const ke=G(pe,we);return K(ke,we)}function G(pe,we){if(!pe||!we)return pe;const ke=we.length;if(ke===0||pe.length===0)return pe;let Ue=0;for(;pe.indexOf(we,Ue)===Ue;)Ue=Ue+ke;return pe.substring(Ue)}function K(pe,we){if(!pe||!we)return pe;const ke=we.length,Ue=pe.length;if(ke===0||Ue===0)return pe;let Qe=Ue,nt=-1;for(;!(nt=pe.lastIndexOf(we,Qe-1),nt===-1||nt+ke!==Qe);){if(nt===0)return"";Qe=nt}return pe.substring(0,Qe)}function n(pe){return pe.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function L(pe){return pe.replace(/\*/g,"")}function x(pe,we,ke={}){if(!pe)throw new Error("Cannot create regex from empty string");we||(pe=I(pe)),ke.wholeWord&&(/\B/.test(pe.charAt(0))||(pe="\\b"+pe),/\B/.test(pe.charAt(pe.length-1))||(pe=pe+"\\b"));let Ue="";return ke.global&&(Ue+="g"),ke.matchCase||(Ue+="i"),ke.multiline&&(Ue+="m"),ke.unicode&&(Ue+="u"),new RegExp(pe,Ue)}function f(pe){if(pe.source==="^"||pe.source==="^$"||pe.source==="$"||pe.source==="^\\s*$")return!1;const we=pe.exec("");return!!(we&&pe.lastIndex===0)}function b(pe){return(pe.global?"g":"")+(pe.ignoreCase?"i":"")+(pe.multiline?"m":"")+(pe.unicode?"u":"")}function h(pe){return pe.split(/\r\n|\r|\n/)}function o(pe){for(let we=0,ke=pe.length;we=0;ke--){const Ue=pe.charCodeAt(ke);if(Ue!==32&&Ue!==9)return ke}return-1}function u(pe,we){return pewe?1:0}function s(pe,we,ke=0,Ue=pe.length,Qe=0,nt=we.length){for(;kelt)return 1}const ot=Ue-ke,qe=nt-Qe;return otqe?1:0}function i(pe,we){return D(pe,we,0,pe.length,0,we.length)}function D(pe,we,ke=0,Ue=pe.length,Qe=0,nt=we.length){for(;ke=128||lt>=128)return s(pe.toLowerCase(),we.toLowerCase(),ke,Ue,Qe,nt);A(ft)&&(ft-=32),A(lt)&&(lt-=32);const pt=ft-lt;if(pt===0)continue;return pt}const ot=Ue-ke,qe=nt-Qe;return otqe?1:0}function A(pe){return pe>=97&&pe<=122}function S(pe){return pe>=65&&pe<=90}function R(pe,we){return pe.length===we.length&&D(pe,we)===0}function O(pe,we){const ke=we.length;return we.length>pe.length?!1:D(pe,we,0,ke)===0}function g(pe,we){let ke,Ue=Math.min(pe.length,we.length);for(ke=0;ke1){const Ue=pe.charCodeAt(we-2);if(d(Ue))return C(Ue,ke)}return ke}function B(pe,we){const ke=$.getInstance(),Ue=we,Qe=pe.length,nt=E(pe,Qe,we);we+=nt>=65536?2:1;let ot=ke.getGraphemeBreakType(nt);for(;we=65536?2:1,ot=ft}return we-Ue}function W(pe,we){const ke=$.getInstance(),Ue=we,Qe=w(pe,we);we-=Qe>=65536?2:1;let nt=ke.getGraphemeBreakType(Qe);for(;we>0;){const ot=w(pe,we),qe=ke.getGraphemeBreakType(ot);if(j(qe,nt))break;we-=ot>=65536?2:1,nt=qe}return Ue-we}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 k(pe){return T.test(pe)}const m=/(?:[\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 y(pe){return m.test(pe)}const H=/^[\t\n\r\x20-\x7E]*$/;function Q(pe){return H.test(pe)}const te=/[\u2028\u2029]/;function ae(pe){return te.test(pe)}function Te(pe){for(let we=0,ke=pe.length;we=11904&&pe<=55215||pe>=63744&&pe<=64255||pe>=65281&&pe<=65374}function ge(pe){return pe>=127462&&pe<=127487||pe===8986||pe===8987||pe===9200||pe===9203||pe>=9728&&pe<=10175||pe===11088||pe===11093||pe>=127744&&pe<=128591||pe>=128640&&pe<=128764||pe>=128992&&pe<=129003||pe>=129280&&pe<=129535||pe>=129648&&pe<=129750}const ve=String.fromCharCode(65279);function Oe(pe){return!!(pe&&pe.length>0&&pe.charCodeAt(0)===65279)}function he(pe,we=!1){return pe?(we&&(pe=pe.replace(/\\./g,"")),pe.toLowerCase()!==pe):!1}function V(pe){const we=90-65+1;return pe=pe%(2*we),pewe[3*Ue+1])Ue=2*Ue+1;else return we[3*Ue+2];return 0}}$._INSTANCE=null;function J(){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 X(pe,we){if(pe===0)return 0;const ke=ye(pe,we);if(ke!==void 0)return ke;const Ue=w(we,pe);return pe-=Re(Ue),pe}function ye(pe,we){let ke=w(we,pe);for(pe-=Re(ke);Ke(ke)||ke===65039||ke===8419;){if(pe===0)return;ke=w(we,pe),pe-=Re(ke)}if(!ge(ke))return;if(pe>=0){const Ue=w(we,pe);Ue===8205&&(pe-=Re(Ue))}return pe}function Re(pe){return pe>=65536?2:1}function Ke(pe){return 127995<=pe&&pe<=127999}},NLgs:function(it,Ee,U){"use strict";U.d(Ee,"e",function(){return l}),U.d(Ee,"f",function(){return u}),U.d(Ee,"d",function(){return i}),U.d(Ee,"c",function(){return D}),U.d(Ee,"a",function(){return A}),U.d(Ee,"b",function(){return S});var ie=U("miYZ"),Y=U("tsqr"),N=U("9og8"),z=U("2qtc"),I=U("kLXV"),M=U("WmNS"),G=U.n(M),K=U("q1tI"),n=U.n(K),L=U("9kvl"),x=U("xKgJ"),f=U("1vsH"),b=U("RCxd"),h=U("yTi+"),o=U.n(h),p=U("m3rI"),l=function(O){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(u(O)&&s(g))},u=function(O){return Object(x.p)()?!0:(O({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},s=function(){var O,g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,_=Object(L.c)()._store.getState(),d=_.user;return(O=d.userInfo)!==null&&O!==void 0&&O.profile_completed?!0:(I.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:g?"\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(){L.d.push("/account/profile/edit")}}),!1)},i=function(){var O,g=Object(L.c)()._store.getState(),_=g.user;return(O=_.userInfo)!==null&&O!==void 0&&O.professional_certification?!0:(I.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.S)("/account/certification")}}),!1)},D=function(){var O;if(Object(x.a)())return!0;var g=Object(L.c)()._store.getState(),_=g.user,d=g.globalSetting;return I.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+(d==null||((O=d.setting)===null||O===void 0)?void 0:O.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},A=function(O,g){var _;if(O)return!0;var d=Object(L.c)()._store.getState(),c=d.user,C=d.globalSetting;return I.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:n.a.createElement("div",null,n.a.createElement("p",null,g||"\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||((_=C.setting)===null||_===void 0)?void 0:_.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.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(O){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",_=Object(L.c)()._store.getState(),d=_.shixunsDetail.detail;return(d==null?void 0:d.public)===2||(d==null?void 0:d.public)===1||(d==null?void 0:d.shixun_status)===3?(I.a.info({centered:!0,icon:n.a.createElement(b.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",(d==null?void 0:d.public)===2?"\u5DF2\u516C\u5F00":(d==null?void 0:d.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",g,"\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:o.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(d==null?void 0:d.shixun_status)===2?(I.a.confirm({centered:!0,icon:n.a.createElement(b.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",g,"\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(){I.a.confirm({width:440,centered:!0,icon:n.a.createElement(b.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(N.a)(G.a.mark(function w(){var B;return G.a.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,O({type:"shixunsDetail/cancelRelease",payload:{id:d==null?void 0:d.identifier}});case 2:B=T.sent,B.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:d==null?void 0:d.identifier}}),O({type:"practiceSetting/getCommonData",payload:{id:d==null?void 0:d.identifier}}));case 4:case"end":return T.stop()}},w)}));function E(){return C.apply(this,arguments)}return E}()})}}),!0):!1}},NvD2:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return M});var ie=U("Kwbf");function Y(G,K){var n=new Set;return G.forEach(function(L){K.has(L)||n.add(L)}),n}function N(G){var K=G||{},n=K.disabled,L=K.disableCheckbox,x=K.checkable;return!!(n||L)||x===!1}function z(G,K,n,L){for(var x=new Set(G),f=new Set,b=0;b<=n;b+=1){var h=K.get(b)||new Set;h.forEach(function(u){var s=u.key,i=u.node,D=u.children,A=D===void 0?[]:D;x.has(s)&&!L(i)&&A.filter(function(S){return!L(S.node)}).forEach(function(S){x.add(S.key)})})}for(var o=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(L(i)||!u.parent||o.has(u.parent.key))return;if(L(u.parent.node)){o.add(s.key);return}var D=!0,A=!1;(s.children||[]).filter(function(S){return!L(S.node)}).forEach(function(S){var R=S.key,O=x.has(R);D&&!O&&(D=!1),!A&&(O||f.has(R))&&(A=!0)}),D&&x.add(s.key),A&&f.add(s.key),o.add(s.key)})}return{checkedKeys:Array.from(x),halfCheckedKeys:Array.from(Y(f,x))}}function I(G,K,n,L,x){for(var f=new Set(G),b=new Set(K),h=0;h<=L;h+=1){var o=n.get(h)||new Set;o.forEach(function(s){var i=s.key,D=s.node,A=s.children,S=A===void 0?[]:A;!f.has(i)&&!b.has(i)&&!x(D)&&S.filter(function(R){return!x(R.node)}).forEach(function(R){f.delete(R.key)})})}b=new Set;for(var p=new Set,l=L;l>=0;l-=1){var u=n.get(l)||new Set;u.forEach(function(s){var i=s.parent,D=s.node;if(x(D)||!s.parent||p.has(s.parent.key))return;if(x(s.parent.node)){p.add(i.key);return}var A=!0,S=!1;(i.children||[]).filter(function(R){return!x(R.node)}).forEach(function(R){var O=R.key,g=f.has(O);A&&!g&&(A=!1),!S&&(g||b.has(O))&&(S=!0)}),A||f.delete(i.key),S&&b.add(i.key),p.add(i.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(Y(b,f))}}function M(G,K,n,L){var x=[],f;L?f=L:f=N;var b=new Set(G.filter(function(l){var u=!!n[l];return u||x.push(l),u})),h=new Map,o=0;Object.keys(n).forEach(function(l){var u=n[l],s=u.level,i=h.get(s);i||(i=new Set,h.set(s,i)),i.add(u),o=Math.max(o,s)}),Object(ie.a)(!x.length,"Tree missing follow keys: ".concat(x.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var p;return K===!0?p=z(b,h,o,f):p=I(b,K.halfCheckedKeys,h,o,f),p}},"ORt/":function(it,Ee,U){it.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return L}),U.d(Ee,"a",function(){return x}),U.d(Ee,"k",function(){return f}),U.d(Ee,"h",function(){return b}),U.d(Ee,"i",function(){return h}),U.d(Ee,"g",function(){return o}),U.d(Ee,"c",function(){return p}),U.d(Ee,"d",function(){return l}),U.d(Ee,"j",function(){return i}),U.d(Ee,"e",function(){return D}),U.d(Ee,"f",function(){return A});var ie=U("KQm4"),Y=U("U8pU"),N=U("Ff2n"),z=U("q1tI"),I=U.n(z),M=U("Kwbf"),G=U("WaYH"),K=.25,n=2;function L(S,R){var O=S.slice(),g=O.indexOf(R);return g>=0&&O.splice(g,1),O}function x(S,R){var O=S.slice();return O.indexOf(R)===-1&&O.push(R),O}function f(S){return S.split("-")}function b(S,R){return"".concat(S,"-").concat(R)}function h(S){return S&&S.type&&S.type.isTreeNode}function o(S,R){var O=[S],g=R[S];function _(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];d.forEach(function(c){var C=c.key,E=c.children;O.push(C),_(E)})}return _(g.children),O}function p(S,R){var O=S.clientY,g=R.selectHandle.getBoundingClientRect(),_=g.top,d=g.bottom,c=g.height,C=Math.max(c*K,n);return O<=_+C?-1:O>=d-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||{},g=O.processProps,_=g===void 0?u:g,d=Array.isArray(S)?S:[S];return d.map(function(c){var C=c.children,E=Object(N.a)(c,["children"]),w=s(C,R);return I.a.createElement(G.a,Object.assign({},_(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(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function D(S,R){var O=new Set;function g(_){if(O.has(_))return;var d=R[_];if(!d)return;O.add(_);var c=d.parent,C=d.node;if(C.disabled)return;c&&g(c.key)}return(S||[]).forEach(function(_){g(_)}),Object(ie.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(it,Ee,U){"use strict";var ie=U("2qtc"),Y=U("kLXV"),N=U("rAM+"),z=U("miYZ"),I=U("tsqr"),M=U("9og8"),G=U("tJVT"),K=U("jrin"),n=U("WmNS"),L=U.n(n),x=U("q1tI"),f=U.n(x),b=U("VrN/"),h=U.n(b),o=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(Pe){var We=Pe.value,et=We===void 0?"":We,yt=Pe.className,Rt=Pe.showTextOnly,kt=Pe.showLines,mn=Pe.style,zt=mn===void 0?{}:mn,Mt=Object(x.useMemo)(function(){return""},[et]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:Mt}}))},O=U("0Owb"),g=U("dejd"),_=U("C+DQ"),d=U("1vsH"),c=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(Pe){var We=Pe.onActionCallback,et=Pe.title,yt=Pe.icon,Rt=Pe.actionName,kt=Pe.className,mn=kt===void 0?"":kt,zt=Pe.children;function Mt(){We(Rt)}return f.a.createElement("a",{title:et,className:mn,onClick:Mt},f.a.createElement("i",{className:"md-iconfont ".concat(yt)}),zt)}var w=function(Pe){var We=Pe.watch,et=Pe.showNullButton,yt=Pe.onActionCallback,Rt=Pe.fullScreen,kt=Pe.insertTemp,mn=Pe.hidetoolBar,zt=Pe.uuid,Mt=Pe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(d.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(d.F)("_educoder_session"),"&key=").concat(zt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Qn=[].concat(C,[{title:"".concat(We?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(We?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!mn&&Qn.map(function(un,hr){return f.a.createElement("li",{key:hr},un.actionName?f.a.createElement(E,Object(O.a)({},un,{onActionCallback:yt})):f.a.createElement("span",{className:"v-line"}))}),et?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:yt},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt&&f.a.createElement("li",null,f.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(kt),onActionCallback:yt},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(Rt?"icon-shrink":"icon-enlarge"),title:Rt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:yt})))},B=U("M8RZ"),W=U("+L6B"),T=U("2/Rp"),k=U("y8nQ"),m=U("Vl3Y"),y=U("5NDa"),H=U("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},te=function(Pe){var We=Pe.callback,et=Pe.onCancel;function yt(Rt){We(Rt)}return f.a.createElement(m.a,Object(O.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:yt}),f.a.createElement(m.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(m.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:et},"\u53D6\u6D88")))},ae=U("7ahc"),Te=U("HmJG"),_e=U("BjJ7"),ge=m.a.useForm,ve={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},he=function(Pe){var We=Pe.callback,et=Pe.onCancel,yt=ge(),Rt=Object(G.a)(yt,1),kt=Rt[0];function mn(Qn){We(Qn)}function zt(Qn,un){if(Qn.status===-1){I.b.error(Qn.message);return}kt.setFieldsValue({src:"/api/attachments/".concat(Qn.id),type:un.type})}function Mt(Qn){var un=Qn.target.files[0];P(un,zt)}return f.a.createElement(m.a,Object(O.a)({form:kt},Oe,{className:"upload-image-panel",onFinish:mn}),f.a.createElement(m.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(H.a,{style:ve})),f.a.createElement(V,{onFileChange:Mt}))),f.a.createElement(m.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(H.a,{style:{width:264}})),f.a.createElement(m.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:et},"\u53D6\u6D88")))};function V(Pe){var We=Pe.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:We}))}function P(Pe,We){if(!Pe)throw new String("\u6CA1\u6709\u6587\u4EF6");var et=new FormData;et.append("editormd-image-file",Pe),et.append("file_param_name","editormd-image-file"),et.append("byxhr","true");var yt=new window.XMLHttpRequest;yt.withCredentials=!0,yt.addEventListener("load",function(Rt){We(JSON.parse(Rt.target.responseText),Pe)},!1),yt.addEventListener("error",function(Rt){console.error(Rt)},!1),yt.open("POST","".concat(_e.a,"/api/attachments.json")),yt.send(et)}var j=U("giR+"),$=U("fyUT"),J=U("7Kak"),X=U("9yH6"),ye=X.a.Group,Re={margin:"0 8px"},Ke=function(Pe){var We=Pe.callback,et=Pe.onCancel;function yt(Rt){We(Rt)}return f.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:yt},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:Re},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:Re},"\u884C\u6570"),f.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement($.a,null)),f.a.createElement("span",{style:Re},"\u5217\u6570"),f.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement($.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:Re},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(m.a.Item,{name:"align"},f.a.createElement(ye,null,f.a.createElement(X.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(X.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(X.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(X.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:et},"\u53D6\u6D88")))},pe=U("ErOA"),we=U("7Cbv"),ke="link",Ue="upload-image",Qe="code-block",nt="add-table",ot="------------",qe={default:ot,left:":".concat(ot),center:":".concat(ot,":"),right:"".concat(ot,":")},ft=U("9VGf"),lt,pt;function Ye(){}var Tt=0,bt=1e4,me="\u2581",ne=` **\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 q(Pe){return/^\d+$/.test(Pe)?"".concat(Pe,"px"):Pe}var se=navigator.platform.toUpperCase().indexOf("MAC")>=0,ue=se?"Cmd":"Ctrl",oe=["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"],ce=(lt={},Object(K.a)(lt,ue+"-B","bold"),Object(K.a)(lt,ue+"-I","italic"),lt),be=(pt={},Object(K.a)(pt,ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(K.a)(pt,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(K.a)(pt,Ue,"\u6DFB\u52A0\u6587\u4EF6"),Object(K.a)(pt,nt,"\u6DFB\u52A0\u8868\u683C"),pt),Se=Ee.a=function(Pe){var We=Pe.defaultValue,et=We===void 0?"":We,yt=Pe.onChange,Rt=Pe.width,kt=Rt===void 0?"100%":Rt,mn=Pe.height,zt=mn===void 0?400:mn,Mt=Pe.miniToolbar,Qn=Mt===void 0?!1:Mt,un=Pe.isFocus,hr=un===void 0?!1:un,or=Pe.watch,bn=Pe.insertTemp,xr=Pe.mode,br=xr===void 0?"markdown":xr,Ar=Pe.id,Br=Ar===void 0?"markdown-editor-id":Ar,Ht=Pe.showResizeBar,an=Ht===void 0?!1:Ht,Cn=Pe.noStorage,qn=Cn===void 0?!1:Cn,Ir=Pe.showNullButton,gn=Ir===void 0?!1:Ir,wt=Pe.hidetoolBar,Rn=wt===void 0?!1:wt,jn=Pe.fullScreen,cn=jn===void 0?!1:jn,on=Pe.onBlur,Dn=Pe.onCMBeforeChange,ei=Pe.onFullScreen,Tr=Pe.className,ct=Tr===void 0?"":Tr,Qt=Pe.disablePaste,ji=Qt===void 0?!1:Qt,Xi=Pe.placeholder,ua=Xi===void 0?"":Xi,Bi=Pe.values,ca=Bi===void 0?"":Bi,En=Object(x.useState)(null),Ia=Object(G.a)(En,2),_t=Ia[0],Fi=Ia[1],yi=Object(x.useState)(et),ba=Object(G.a)(yi,2),ea=ba[0],pi=ba[1],da=Object(x.useState)(or),Ea=Object(G.a)(da,2),ur=Ea[0],xa=Ea[1],Ya=Object(x.useState)(cn),Vt=Object(G.a)(Ya,2),st=Vt[0],Pt=Vt[1],xt=Object(x.useState)(""),Dt=Object(G.a)(xt,2),Zt=Dt[0],yn=Dt[1],Tn=Object(x.useState)(0),en=Object(G.a)(Tn,2),xn=en[0],Fn=en[1],tn=Object(x.useState)(zt),hn=Object(G.a)(tn,2),ar=hn[0],Wn=hn[1],Bt=Object(x.useState)(!1),_n=Object(G.a)(Bt,2),ir=_n[0],kn=_n[1],Xt=Object(x.useRef)(Object(we.a)()),sn=Object(x.useRef)(!1),Sn=Object(x.useRef)(),Nt=Object(x.useRef)(),Ut=Object(x.useRef)(),jt=Object(x.useRef)(),je=Object(x.useRef)(),Yt=function(){var Lt=Object(M.a)(L.a.mark(function Ft(){var It,Jt;return L.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:return wn.next=2,Object(pe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:Jt=wn.sent,Jt!=null&&(It=Jt.attachments)!==null&&It!==void 0&&It.length&&(console.log("cm:",_t,Nt),Jt.attachments.map(function(Vn){Vn.content_type.indexOf("image")>-1?_t.replaceSelection("![,](/api/attachments/".concat(Vn.id,"?type=").concat(Vn.content_type,")")):Vn.content_type.indexOf("video")>-1?_t.replaceSelection('')):Vn.content_type.indexOf("pdf")>-1?_t.replaceSelection('
    ').concat(Vn.name,"")):_t.replaceSelection("[".concat(Vn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Vn.id,"?type=").concat(Vn.content_type,")"))}));case 4:case"end":return wn.stop()}},Ft)}));return function(){return Lt.apply(this,arguments)}}();Object(x.useEffect)(function(){pi(ca),_t==null||_t.setValue(ca)},[ca]),Object(x.useEffect)(function(){ei==null||ei(st)},[st]),Object(x.useEffect)(function(){if(Nt.current){var Lt=h.a.fromTextArea(Nt.current,{mode:br,lineNumbers:!Qn,lineWrapping:!0,value:et,autoCloseTags:!0,autoCloseBrackets:!0});hr&&Lt.focus();function Ft(It,Jt){if(ji){Jt.preventDefault();return}var Mn=Jt.clipboardData;if(Mn){var wn=Mn.types.toString(),Vn=Mn.items;if(wn==="Files"||Mn.types.indexOf("Files")>-1){if(Jt.preventDefault(),br=="stex")return;try{var sr,mi=Vn[1];((sr=Vn[0])===null||sr===void 0?void 0:sr.kind)==="file"&&(mi=Vn[0]);var Gn=mi.getAsFile(),Wi=Gn.name.split(".").pop();P(Gn,function(lr){if(lr.id){var ii,Zr,Ai;(Gn==null||((ii=Gn.type)===null||ii===void 0)?void 0:ii.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(lr.id,"?type=").concat(lr.content_type,")")):(Gn==null||((Zr=Gn.type)===null||Zr===void 0)?void 0:Zr.indexOf("video"))>-1?Lt.replaceSelection('')):(Gn==null||((Ai=Gn.type)===null||Ai===void 0)?void 0:Ai.indexOf("pdf"))>-1?Lt.replaceSelection('').concat(Gn.name,"")):oe.includes(Wi)?Lt.replaceSelection('').concat(Gn.name,"")):Lt.replaceSelection("[".concat(Gn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(lr.content_type,")"))}else(lr==null?void 0:lr.status)===401&&(document.location.href="/user/login")})}catch(lr){I.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Lt.on("paste",Ft),Lt.on("dragleave",function(It,Jt){Ut.current.classList.remove("mouse-hover-md")}),Lt.on("dragover",function(It,Jt){Ut.current.classList.add("mouse-hover-md")}),Lt.on("drop",function(It,Jt){Ut.current.classList.add("mouse-hover-md");var Mn;if(Mn=Jt.dataTransfer.files,Mn.length>0){Jt.preventDefault(),Jt.stopPropagation();for(var wn=function(mi){var Gn=Mn[mi],Wi=Gn.name.split(".").pop();P(Gn,function(lr){if(lr.id){var ii,Zr,Ai;(Gn==null||((ii=Gn.type)===null||ii===void 0)?void 0:ii.indexOf("image"))>-1?Lt.replaceSelection("![,](/api/attachments/".concat(lr.id,"?type=").concat(lr.content_type,")")):(Gn==null||((Zr=Gn.type)===null||Zr===void 0)?void 0:Zr.indexOf("video"))>-1?Lt.replaceSelection('')):(Gn==null||((Ai=Gn.type)===null||Ai===void 0)?void 0:Ai.indexOf("pdf"))>-1?Lt.replaceSelection('').concat(Gn.name,"")):oe.includes(Wi)?Lt.replaceSelection('').concat(Gn.name,"")):Lt.replaceSelection("[".concat(Gn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(lr.id,"?type=").concat(lr.content_type,")"))}else(lr==null?void 0:lr.status)===401&&(document.location.href="/user/login")})},Vn=0;Vn0||Vn.target.offsetWidth>0)&&(fn(),_t.setSize("100%","100%"),_t.refresh())}}catch(sr){Mn.e(sr)}finally{Mn.f()}});return It.observe(Nt.current.parentElement),It}if(_t){var Ft=Lt();return function(){Ft.unobserve(Nt.current.parentElement)}}},[_t,fn]),Object(x.useEffect)(function(){if(_t){for(var Lt=[],Ft=function(){var Vn=Jt[It];Mn=Object(G.a)(Vn,2);var sr=Mn[0],mi=Mn[1],Gn=Object(K.a)({},sr,function(){fr(mi)});Lt.push(Gn),_t.addKeyMap(Gn)},It=0,Jt=Object.entries(ce);It0){var Lt=new Date().getTime(),Ft=window.sessionStorage.getItem(Br);Lt>=xn+bt&&(!Ft||Ft!==ea)&&(window.sessionStorage.setItem(Br,ea),kn(!0))}},bt),Object(x.useEffect)(function(){xa(or)},[_t,or]),Object(x.useEffect)(function(){_t&&(hr&&_t.focus())},[_t,hr]),Object(x.useEffect)(function(){if(ur&&_t){var Lt=_t.getScrollerElement();function Ft(It){var Jt=It.target;if(je.current){var Mn=Jt.scrollTop/Jt.scrollHeight;je.current.scrollTop=je.current.scrollHeight*Mn}}return Lt.addEventListener("scroll",Ft),function(){Lt.removeEventListener("scroll",Ft)}}},[_t,ur]),Object(x.useEffect)(function(){if(_t&&Dn){function Lt(Ft,It){Dn(Ft,It)}return _t.on("beforeChange",Lt),function(){_t.off("beforeChange",Lt)}}},[_t,Dn]),Object(x.useEffect)(function(){if(_t&&on){function Lt(){on(_t.getValue())}return _t.on("blur",Lt),function(){_t.off("blur",Lt)}}},[_t,on]),Object(x.useEffect)(function(){if(_t){function Lt(Ft){var It=Ft.getValue();pi(It),Fn(new Date().getTime()),Ft.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),yt&&yt(It)}return _t.on("change",Lt),function(){_t.off("change",Lt)}}},[_t,yt]),Object(x.useEffect)(function(){_t&&(et==null?(_t.setValue(""),pi("")):et!==_t.getValue()&&(_t.setValue(et),pi(et),_t.setCursor(_t.lineCount(),0)))},[_t,et]);var fr=Object(x.useCallback)(function(Lt){var Ft=_t.getCursor(),It=_t.getSelection(),Jt=It.split(` `);switch(Lt){case"bold":return _t.replaceSelection("**"+It+"**"),It===""&&_t.setCursor(Ft.line,Ft.ch+2),_t.focus();case"italic":return _t.replaceSelection("*"+It+"*"),It===""&&_t.setCursor(Ft.line,Ft.ch+1),_t.focus();case"code":return _t.replaceSelection("`"+It+"`"),It===""&&_t.setCursor(Ft.line,Ft.ch+1),_t.focus();case"inline-latex":return _t.replaceSelection("`$$"+It+"$$`"),It===""&&_t.setCursor(Ft.line,Ft.ch+3),_t.focus();case"latex":return _t.replaceSelection("```latex\n"+It+"\n```"),_t.setCursor(Ft.line+1,It.length+1),_t.focus();case"line-break":return _t.replaceSelection(`
    `),_t.focus();case"list-ul":return It===""?_t.replaceSelection("- "+It):_t.replaceSelection(Jt.map(function(Mn){return Mn===""?"":"- ".concat(Mn)}).join(` `)),_t.focus();case"list-ol":return It===""?_t.replaceSelection("1. "+It):_t.replaceSelection(Jt.map(function(Mn,wn){return Mn===""?"":"".concat(wn+1,". ").concat(Mn)}).join(` `)),_t.focus();case"add-null-ch":return It===""&&_t.setCursor(Ft.line,Ft.ch+1),_t.replaceSelection(me),_t.focus();case"inster-template-1":return It===""&&_t.setCursor(Ft.line,Ft.ch),_t.replaceSelection(ne),_t.focus();case"eraser":return _t.setValue(""),_t.focus();case"trigger-watch":return xa(!ur),_t.focus();case"trigger-full-screen":return Pt(!st),_t.focus();case ke:yn(ke);return;case Qe:yn(Qe);return;case Ue:yn(Ue);return;case nt:yn(nt);return;default:throw new Error}},[_t,ur,st]),pn=Object(x.useCallback)(function(Lt){yn("");switch(Zt){case ke:var Ft=Lt.title,It=Lt.link;return _t.replaceSelection("[".concat(Ft,"](").concat(It,")")),_t.focus();case Qe:var Jt=Lt.language,Mn=Lt.content;return _t.replaceSelection(["```"+Jt,Mn,"```"].join(` `)),_t.focus();case Ue:var wn=Lt.src,Vn=Lt.alt;return Vn?_t.replaceSelection("![ ".concat(Vn," ]( ").concat(wn,' "').concat(Vn,'" )')):_t.replaceSelection("![,](".concat(wn,")")),_t.focus();case nt:for(var sr=Lt.row,mi=Lt.col,Gn=Lt.align,Wi=` `,lr=0;lr300&&(sr=300);var mi=zt+sr+"px";Wn(mi)}}return Lt.addEventListener("mousedown",Jt),document.addEventListener("mousemove",wn),document.addEventListener("mouseup",Mn),function(){Lt.removeEventListener("mousedown",Jt),document.removeEventListener("mousemove",wn),document.removeEventListener("mouseup",Mn)}}},[_t,jt]),Object(x.useEffect)(function(){Wn(zt)},[zt]);var kr=q(kt),An=q(ar),St={width:kr,height:An},pr=Object(x.useMemo)(function(){if(xn){var Lt=new Date(xn),Ft=Lt.getHours(),It=Lt.getMinutes(),Jt=Lt.getSeconds();return Ft=Ft<10?"0"+Ft:Ft,It=It<10?"0"+It:It,Jt=Jt<10?"0"+Jt:Jt,"".concat(Ft,":").concat(It,":").concat(Jt)}return 0},[xn]);function tr(){window.sessionStorage.removeItem(Br),kn(!1),Fn(0)}function Hn(){kn(!1),Fn(0),_t.setValue(window.sessionStorage.getItem(Br))}function Qr(Lt,Ft){var It=_t.getValue();It=It.replace(Lt,Ft),pi(It),_t==null||_t.setValue(It)}return f.a.createElement(x.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ut},f.a.createElement("div",{className:"markdown-editor-container ".concat(ct," ").concat(ur?"on-preview":""," ").concat(Qn?"mini":""," ").concat(st?"full-screen":""),style:St},f.a.createElement(w,{insertTemp:bn,watch:ur,fullScreen:st,showNullButton:gn,onActionCallback:fr,hidetoolBar:Rn,uuid:Xt.current,setOpenPhones:function(){sn.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:Nt,placeholder:ua})),ur?f.a.createElement("div",{ref:je,className:"preview-container"},br==="stex"&&f.a.createElement(R,{value:ea}),br!=="stex"&&f.a.createElement(S.a,{edit:!0,value:ea,replaces:Qr})):null))),an?f.a.createElement("a",{ref:jt,className:"editor-resize"}):null,f.a.createElement(B.a,null,be[Zt]?f.a.createElement(Y.a,{centered:!0,title:be[Zt],visible:!0,onCancel:$r,footer:null,className:"markdown-popup-form"},Yr):null))}},"P/tu":function(it,Ee,U){"use strict";var ie=U("ozfa"),Y=U("MJZm"),N=U("0Owb"),z=U("9og8"),I=U("tJVT"),M=U("PpiC"),G=U("WmNS"),K=U.n(G),n=U("q1tI"),L=U.n(n),x=U("WCUW"),f=U("spXi"),b=U.n(f),h=function(p){var l=p.value,u=p.onChange,s=p.defaultValue,i=p.disabled,D=Object(M.a)(p,["value","onChange","defaultValue","disabled"]),A=Object(n.useState)([]),S=Object(I.a)(A,2),R=S[0],O=S[1],g=Object(n.useState)("1"),_=Object(I.a)(g,2),d=_[0],c=_[1];Object(n.useEffect)(function(){C()},[]);var C=function(){var B=Object(z.a)(K.a.mark(function W(){var T,k;return K.a.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,Object(x.A)({});case 2:T=y.sent,T!=null&&T.data&&(k=[{title:L.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:b.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:L.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:E(T.data||[])}],O(k),c("2"));case 4:case"end":return y.stop()}},W)}));return function(){return B.apply(this,arguments)}}(),E=function(W){function T(k){var m=k.children,y=Array.isArray(m)&&m.length>0,H=k==null?void 0:k.group_id;return{title:L.a.createElement("div",{title:k==null?void 0:k.name,className:b.a.name},k==null?void 0:k.name),value:H,key:H,icon:L.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:y?m==null?void 0:m.map(function(Q){return T(Q)}):[]}}return W==null?void 0:W.map(function(k){return T(k)})},w=s?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return L.a.createElement("div",{className:b.a.customTree},L.a.createElement(Y.a,Object(N.a)({key:d},w,{showIcon:!0,treeData:R,onSelect:u,disabled:i},D)))};Ee.a=h},Q0Vu:function(it,Ee,U){it.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(it,Ee,U){"use strict";var ie=U("Q9mQ"),Y=U("diRs"),N=U("q1tI"),z=U.n(N),I=U("+z73"),M=U.n(I),G=function(n){var L=n.data,x=L===void 0?[]:L,f=n.onClick,b=function(){return x.map(function(p,l){return z.a.createElement("div",{key:l,className:M.a.few},z.a.createElement("b",{title:p.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return f(p.id)}},p.name),l1&&i5?h():b())};Ee.a=G},SJMd:function(it,Ee){/** * @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,ie,Y,N=!1,z,I;window.PR_SHOULD_USE_CONTINUATION=!0;var M,G;(function(){var K=window,n=["break,continue,do,else,for,if,return,while"],L=[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"],x=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[x,"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"],b=[x,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[x,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",p=[x,"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,h,b,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",g="typ",_="lit",d="pun",c="pln",C="tag",E="dec",w="src",B="atn",W="atv",T="nocode",k="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(ye){for(var Re=0,Ke=!1,pe=!1,we=0,ke=ye.length;we122||(oe<65||ue>90||Tt.push([Math.max(65,ue)|32,Math.min(oe,90)|32]),oe<97||ue>122||Tt.push([Math.max(97,ue)&~32,Math.min(oe,122)&~32]))}}Tt.sort(function(Pe,We){return Pe[0]-We[0]||We[1]-Pe[1]});for(var ce=[],be=[],ne=0;neSe[0]&&(Se[1]+1>Se[0]&&me.push("-"),me.push(ot(Se[1])))}return me.push("]"),me.join("")}function ft(pt){for(var Ye=pt.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")),Tt=Ye.length,bt=[],me=0,ne=0;me=2&&ue==="["?Ye[me]=qe(q):ue!=="\\"&&(Ye[me]=q.replace(/[a-zA-Z]/g,function(be){var Se=be.charCodeAt(0);return"["+String.fromCharCode(Se&~32,Se|32)+"]"}))}return Ye.join("")}for(var lt=[],we=0,ke=ye.length;we=0;)Ke[lt.charAt(pt)]=ft;var Ye=ft[1],Tt=""+Ye;nt.hasOwnProperty(Tt)||(Qe.push(Ye),nt[Tt]=null)}Qe.push(/[\0-\uffff]/),pe=m(Qe)})();var we=Re.length,ke=function(Ue){for(var Qe=Ue.sourceCode,nt=Ue.basePos,ot=Ue.sourceNode,qe=[nt,c],ft=0,lt=Qe.match(pe)||[],pt={},Ye=0,Tt=lt.length;Ye=5&&me.substring(0,5)==="lang-",q&&!(ne&&typeof ne[1]=="string")&&(q=!1,me=w),q||(pt[bt]=me)}var oe=ft;if(ft+=bt.length,!q)qe.push(nt+oe,me);else{var ce=ne[1],be=bt.indexOf(ce),Se=be+ce.length;ne[2]&&(Se=bt.length-ne[2].length,be=Se-ce.length);var Pe=me.substring(5);H(ot,nt+oe,bt.substring(0,be),ke,qe),H(ot,nt+oe+be,ce,V(Pe,ce),qe),H(ot,nt+oe+Se,bt.substring(Se),ke,qe)}}Ue.decorations=qe};return ke}function Te(ye){var Re=[],Ke=[];ye.tripleQuotedStrings?Re.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ye.multiLineStrings?Re.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Re.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ye.verbatimStrings&&Ke.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var pe=ye.hashComments;pe&&(ye.cStyleComments?(pe>1?Re.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Re.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ke.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Re.push([O,/^#[^\r\n]*/,null,"#"])),ye.cStyleComments&&(Ke.push([O,/^\/\/[^\r\n]*/,null]),Ke.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var we=ye.regexLiterals;if(we){var ke=we>1?"":` \r`,Ue=ke?".":"[\\S\\s]",Qe="/(?=[^/*"+ke+"])(?:[^/\\x5B\\x5C"+ke+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+ke+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";Ke.push(["lang-regex",RegExp("^"+k+"("+Qe+")")])}var nt=ye.types;nt&&Ke.push([g,nt]);var ot=(""+ye.keywords).replace(/^ | $/g,"");ot.length&&Ke.push([R,new RegExp("^(?:"+ot.replace(/[\s,]+/g,"|")+")\\b"),null]),Re.push([c,/^\s+/,null,` \r \xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return ye.regexLiterals&&(qe+="(?!s*/)"),Ke.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[d,new RegExp(qe),null]),ae(Re,Ke)}var _e=Te({keywords:D,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ge(ye,Re,Ke){for(var pe=/(?:^|\s)nocode(?:\s|$)/,we=/\r\n?|\n/,ke=ye.ownerDocument,Ue=ke.createElement("li");ye.firstChild;)Ue.appendChild(ye.firstChild);var Qe=[Ue];function nt(Ye){var Tt=Ye.nodeType;if(Tt==1&&!pe.test(Ye.className))if(Ye.nodeName==="br")ot(Ye),Ye.parentNode&&Ye.parentNode.removeChild(Ye);else for(var bt=Ye.firstChild;bt;bt=bt.nextSibling)nt(bt);else if((Tt==3||Tt==4)&&Ke){var me=Ye.nodeValue,ne=me.match(we);if(ne){var q=me.substring(0,ne.index);Ye.nodeValue=q;var se=me.substring(ne.index+ne[0].length);if(se){var ue=Ye.parentNode;ue.insertBefore(ke.createTextNode(se),Ye.nextSibling)}ot(Ye),q||Ye.parentNode.removeChild(Ye)}}}function ot(Ye){for(;!Ye.nextSibling;)if(Ye=Ye.parentNode,!Ye)return;function Tt(ne,q){var se=q?ne.cloneNode(!1):ne,ue=ne.parentNode;if(ue){var oe=Tt(ue,1),ce=ne.nextSibling;oe.appendChild(se);for(var be=ce;be;be=ce)ce=be.nextSibling,oe.appendChild(be)}return se}for(var bt=Tt(Ye.nextSibling,0),me;(me=bt.parentNode)&&me.nodeType===1;)bt=me;Qe.push(bt)}for(var qe=0;qe=ue&&(nt+=2),ke>=oe&&(ft+=2)}}finally{me&&(me.style.display=ne)}}var Oe={};function he(ye,Re){for(var Ke=Re.length;--Ke>=0;){var pe=Re[Ke];Oe.hasOwnProperty(pe)?K.console&&console.warn("cannot override language handler %s",pe):Oe[pe]=ye}}function V(ye,Re){return ye&&Oe.hasOwnProperty(ye)||(ye=/^\s*]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[d,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),he(ae([[c,/^[\s]+/,null,` \r `],[W,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[d,/^[=<>\/]+/],["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"]),he(ae([],[[W,/^[\s\S]+/]]),["uq.val"]),he(Te({keywords:f,hashComments:!0,cStyleComments:!0,types:A}),["c","cc","cpp","cxx","cyc","m"]),he(Te({keywords:"null,true,false"}),["json"]),he(Te({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:A}),["cs"]),he(Te({keywords:b,cStyleComments:!0}),["java"]),he(Te({keywords:i,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),he(Te({keywords:u,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),he(Te({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),he(Te({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),he(Te({keywords:p,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),he(Te({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),he(ae([],[[S,/^[\s\S]+/]]),["regex"]);function P(ye){var Re=ye.langExtension;try{var Ke=y(ye.sourceNode,ye.pre),pe=Ke.sourceCode;ye.sourceCode=pe,ye.spans=Ke.spans,ye.basePos=0,V(Re,pe)(ye),ve(ye)}catch(we){K.console&&console.log(we&&we.stack||we)}}function j(ye,Re,Ke){var pe=Ke||!1,we=Re||null,ke=document.createElement("div");ke.innerHTML="
    "+ye+"
    ",ke=ke.firstChild,pe&&ge(ke,pe,!0);var Ue={langExtension:we,numberLines:pe,sourceNode:ke,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return P(Ue),ke.innerHTML}function $(ye,Re){var Ke=Re||document.body,pe=Ke.ownerDocument||document;function we(se){return Ke.getElementsByTagName(se)}for(var ke=[we("pre"),we("code"),we("xmp")],Ue=[],Qe=0;Qe0&&J[J.length-1])||we[0]!==6&&we[0]!==2)){ye=0;continue}if(we[0]===3&&(!J||we[1]>J[0]&&we[1]',"select"),this.addActionButton($,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton($,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton($,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton($,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton($,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton($,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton($,'',"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(X){var ye=document.createElement("div");ye.className=""+j.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",X.typeName),ye.innerHTML=X.icon,ye.addEventListener("click",function(){j.markerToolbarButtonClicked(ye,X)}),j.buttons.push(ye),j.markerButtons.push(ye)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'',"render"),this.addActionButton(J,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},V.prototype.addButtonClickListener=function(P){this.buttonClickListeners.push(P)},V.prototype.removeButtonClickListener=function(P){this.buttonClickListeners.indexOf(P)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(P),1)},V.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},V.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var P=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var j=0;j0&&this.buttonClickListeners.forEach(function($){return $("marker",j)}),this.markerButtonOverflowBlock.style.display="none"},V.prototype.actionToolbarButtonClicked=function(P,j){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function($){return $("action",j)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},V.prototype.setActiveButton=function(P){this.resetButtonStyles(),P.className=P.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),P.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},V.prototype.setActiveMarkerButton=function(P){var j=this.markerButtons.find(function($){return $.getAttribute("data-type-name")===P});j&&this.setActiveButton(j)},V.prototype.setCurrentMarker=function(P){var j=this;this.currentMarker=P,this.buttons.filter(function($){return/delete|notes/.test($.getAttribute("data-action"))}).forEach(function($){j.currentMarker===void 0?($.style.fillOpacity="0.4",$.style.pointerEvents="none"):($.style.fillOpacity="1",$.style.pointerEvents="all")})},V}(),h=function(){function V(P,j,$,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=P,this.displayMode=j,this.uiStyleSettings=$,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return V.prototype.addStyles=function(){var P;this.toolboxStyleClass=this.styles.addClass(new f("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 f("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var j=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("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 f("toolbox-panel-row_colors",` background-color: `+((P=this.uiStyleSettings.toolboxBackgroundColor)!==null&&P!==void 0?P:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*j)+`px; padding: `+j+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new x("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new x("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},V.prototype.show=function(P){var j;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=P,this.uiContainer.className=this.toolboxStyleClass.name+" "+((j=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},V.prototype.setPanelButtons=function(P){var j,$,J=this;this.panels=P,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((j=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(($=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&$!==void 0?$:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(X){var ye;X.uiStyleSettings=J.uiStyleSettings;var Re=document.createElement("div");Re.className=J.toolboxButtonStyleClass.name+" "+((ye=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:J.toolboxButtonStyleColorsClass.name),Re.innerHTML=X.icon,Re.title=X.title,Re.addEventListener("click",function(){J.panelButtonClick(X)}),J.panelButtons.push(Re),J.buttonRow.appendChild(Re)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},V.prototype.panelButtonClick=function(P){var j=this,$=-1;if(P!==this.activePanel){$=this.panels.indexOf(P),this.panelRow.innerHTML="";var J=P.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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=P}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){j.displayMode==="inline"?j.panelRow.style.display="none":j.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(X,ye){var Re,Ke;X.className=j.toolboxButtonStyleClass.name+" "+(ye===$?""+((Re=j.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Re!==void 0?Re:j.toolboxActiveButtonStyleColorsClass.name):""+((Ke=j.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:j.toolboxButtonStyleColorsClass.name))})},V}(),o=function(V,P){this.title=V,this.icon=P},p=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'')||this;return ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=$,ye.currentColor=J,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.overflow="hidden",$.style.whiteSpace="nowrap",this.colors.forEach(function(J){var X=j.getColorBox(J);$.appendChild(X),j.colorBoxes.push(X)}),$},P.prototype.getColorBox=function(j){var $=this,J=this.uiStyleSettings.toolbarHeight/4,X=this.uiStyleSettings.toolbarHeight-J,ye=document.createElement("div");ye.style.display="inline-block",ye.style.boxSizing="content-box",ye.style.width=X-2+"px",ye.style.height=X-2+"px",ye.style.padding="1px",ye.style.marginRight="2px",ye.style.marginBottom="2px",ye.style.borderWidth="2px",ye.style.borderStyle="solid",ye.style.borderRadius=(X+2)/2+"px",ye.style.borderColor=j===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){$.setCurrentColor(j,ye)});var Re=document.createElement("div");return Re.style.display="inline-block",Re.style.width=X-2+"px",Re.style.height=X-2+"px",Re.style.backgroundColor=j,Re.style.borderRadius=X/2+"px",j==="transparent"&&(Re.style.fill=this.uiStyleSettings.toolboxAccentColor,Re.innerHTML=` `),ye.appendChild(Re),ye},P.prototype.setCurrentColor=function(j,$){var J=this;this.currentColor=j,this.colorBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(j)},P}(o),l=function(){function V(P,j,$){this._state="new",this._isSelected=!1,this._container=P,this._overlayContainer=j,this.globalSettings=$,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(V.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),V.prototype.ownsTarget=function(P){return!1},Object.defineProperty(V.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),V.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},V.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},V.prototype.pointerDown=function(P,j){},V.prototype.dblClick=function(P,j){},V.prototype.manipulate=function(P){},V.prototype.pointerUp=function(P){this.stateChanged()},V.prototype.dispose=function(){},V.prototype.addMarkerVisualToContainer=function(P){this.container.childNodes.length>0?this.container.insertBefore(P,this.container.childNodes[0]):this.container.appendChild(P)},V.prototype.getState=function(){return{typeName:V.typeName,state:this.state,notes:this.notes}},V.prototype.restoreState=function(P){this._state=P.state,this.notes=P.notes},V.prototype.scale=function(P,j){},V.prototype.colorChanged=function(P){this.onColorChanged&&this.onColorChanged(P),this.stateChanged()},V.prototype.fillColorChanged=function(P){this.onFillColorChanged&&this.onFillColorChanged(P),this.stateChanged()},V.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var P=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),P.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(P)&&this.onStateChanged(this)}},V.typeName="MarkerBase",V}(),u=function(){function V(){this.findGripByVisual=this.findGripByVisual.bind(this)}return V.prototype.findGripByVisual=function(P){return this.topLeft.ownsTarget(P)?this.topLeft:this.topCenter.ownsTarget(P)?this.topCenter:this.topRight.ownsTarget(P)?this.topRight:this.centerLeft.ownsTarget(P)?this.centerLeft:this.centerRight.ownsTarget(P)?this.centerRight:this.bottomLeft.ownsTarget(P)?this.bottomLeft:this.bottomCenter.ownsTarget(P)?this.bottomCenter:this.bottomRight.ownsTarget(P)?this.bottomRight:void 0},V}(),s=function(){function V(){this.GRIP_SIZE=10,this.visual=M.createGroup(),this.visual.appendChild(M.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(M.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return V.prototype.ownsTarget=function(P){return P===this.visual||P===this.visual.childNodes[0]||P===this.visual.childNodes[1]},V}(),i=function(){function V(){}return V.toITransformMatrix=function(P){return{a:P.a,b:P.b,c:P.c,d:P.d,e:P.e,f:P.f}},V.toSVGMatrix=function(P,j){return P.a=j.a,P.b=j.b,P.c=j.c,P.d=j.d,P.e=j.e,P.f=j.f,P},V}(),D=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.left=0,X.top=0,X.width=0,X.height=0,X.defaultSize={x:50,y:20},X.offsetX=0,X.offsetY=0,X.rotationAngle=0,X.CB_DISTANCE=10,X._suppressMarkerCreateEvent=!1,X.container.transform.baseVal.appendItem(M.createTransform()),X.setupControlBox(),X}return Y(P,V),Object.defineProperty(P.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"visual",{get:function(){return this._visual},set:function(j){this._visual=j;var $=M.createTransform();this._visual.transform.baseVal.appendItem($)},enumerable:!1,configurable:!0}),P.prototype.ownsTarget=function(j){return!!V.prototype.ownsTarget.call(this,j)||!!(this.controlGrips.findGripByVisual(j)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(j))},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.left=j.x,this.top=j.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(j);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual($),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget($)){this.activeGrip=this.rotatorGrip;var X=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=X.x-this.width/2,this.top=X.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},P.prototype.pointerUp=function(j){var $=this.state;V.prototype.pointerUp.call(this,j),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(j),this._state="select",$==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},P.prototype.moveVisual=function(j){this.visual.style.transform="translate("+j.x+"px, "+j.y+"px)"},P.prototype.manipulate=function(j){var $=this.unrotatePoint(j);this.state==="creating"?this.resize(j):this.state==="move"?(this.left=this.manipulationStartLeft+($.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+($.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize($):this.state==="rotate"&&this.rotate(j)},P.prototype.resize=function(j){var $=this.manipulationStartLeft,J=this.manipulationStartWidth,X=this.manipulationStartTop,ye=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:$=this.manipulationStartLeft+j.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-$;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+j.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:X=this.manipulationStartTop+j.y-this.manipulationStartY,ye=this.manipulationStartHeight+this.manipulationStartTop-X;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ye=this.manipulationStartHeight+j.y-this.manipulationStartY}J>=0?(this.left=$,this.width=J):(this.left=$+J,this.width=-J),ye>=0?(this.top=X,this.height=ye):(this.top=X+ye,this.height=-ye),this.setSize()},P.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},P.prototype.rotate=function(j){if(Math.abs(j.x-this.centerX)>.1){var $=Math.sign(j.x-this.centerX);this.rotationAngle=180*Math.atan((j.y-this.centerY)/(j.x-this.centerX))/Math.PI+90*$,this.applyRotation()}},P.prototype.applyRotation=function(){var j=this.container.transform.baseVal.getItem(0);j.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(j,0)},P.prototype.rotatePoint=function(j){if(this.rotationAngle===0)return j;var $=this.container.getCTM(),J=M.createPoint(j.x,j.y);return{x:(J=J.matrixTransform($)).x,y:J.y}},P.prototype.unrotatePoint=function(j){if(this.rotationAngle===0)return j;var $=this.container.getCTM();$=$.inverse();var J=M.createPoint(j.x,j.y);return{x:(J=J.matrixTransform($)).x,y:J.y}},P.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},P.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},P.prototype.setupControlBox=function(){this.controlBox=M.createGroup();var j=M.createTransform();j.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(j),this.container.appendChild(this.controlBox),this.controlRect=M.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=M.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 u,this.addControlGrips(),this.controlBox.style.display="none"},P.prototype.adjustControlBox=function(){var j=this.controlBox.transform.baseVal.getItem(0);j.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(j,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()},P.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()},P.prototype.createGrip=function(){var j=new s;return j.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(j.visual),j},P.prototype.positionGrips=function(){var j=this.controlGrips.topLeft.GRIP_SIZE,$=-j/2,J=$,X=(this.width+this.CB_DISTANCE)/2-j/2,ye=(this.height+this.CB_DISTANCE)/2-j/2,Re=this.height+this.CB_DISTANCE-j/2,Ke=this.width+this.CB_DISTANCE-j/2;this.positionGrip(this.controlGrips.topLeft.visual,$,J),this.positionGrip(this.controlGrips.topCenter.visual,X,J),this.positionGrip(this.controlGrips.topRight.visual,Ke,J),this.positionGrip(this.controlGrips.centerLeft.visual,$,ye),this.positionGrip(this.controlGrips.centerRight.visual,Ke,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,$,Re),this.positionGrip(this.controlGrips.bottomCenter.visual,X,Re),this.positionGrip(this.controlGrips.bottomRight.visual,Ke,Re),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,X,J-3*this.CB_DISTANCE)},P.prototype.positionGrip=function(j,$,J){var X=j.transform.baseVal.getItem(0);X.setTranslate($,J),j.transform.baseVal.replaceItem(X,0)},P.prototype.hideControlBox=function(){this.controlBox.style.display="none"},P.prototype.showControlBox=function(){this.controlBox.style.display=""},P.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:i.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:i.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},V.prototype.getState.call(this))},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.left=$.left,this.top=$.top,this.width=$.width,this.height=$.height,this.rotationAngle=$.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(i.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,$.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(i.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,$.containerTransformMatrix))},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$);var J=this.rotatePoint({x:this.left,y:this.top}),X=this.unrotatePoint({x:J.x*j,y:J.y*$});this.left=X.x,this.top=X.y,this.width=this.width*j,this.height=this.height*$,this.adjustControlBox()},P}(l),A=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.createVisual=X.createVisual.bind(X),X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual)},P.prototype.createVisual=function(){this.visual=M.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)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},P.prototype.manipulate=function(j){V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),this.setSize()},P.prototype.setSize=function(){V.prototype.setSize.call(this),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},P.prototype.pointerUp=function(j){V.prototype.pointerUp.call(this,j),this.setSize()},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.visual&&M.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(j),this.stateChanged()},P.prototype.setFillColor=function(j){this.fillColor=j,this.visual&&M.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.visual&&M.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.visual&&M.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},P.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},V.prototype.getState.call(this))},P.prototype.restoreState=function(j){var $=j;this.fillColor=$.fillColor,this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.opacity=$.opacity,this.createVisual(),V.prototype.restoreState.call(this,j),this.setSize()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setSize()},P.title="Rectangle marker",P}(D),S=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=$,ye.currentWidth=J,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2",this.widths.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.flexGrow="2",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=J===j.currentWidth?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentWidth(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.innerText=J.toString(),ye.style.marginRight="5px",X.appendChild(ye);var Re=document.createElement("div");Re.style.minHeight="20px",Re.style.flexGrow="2",Re.style.display="flex",Re.style.alignItems="center";var Ke=document.createElement("hr");Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop=J+"px solid "+j.uiStyleSettings.toolboxColor,Ke.style.flexGrow="2",Re.appendChild(Ke),X.appendChild(Re),j.widthBoxes.push(X)}),$},P.prototype.setCurrentWidth=function(j,$){var J=this;this.currentWidth=j,this.widthBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},P}(o),R=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'')||this;return ye.styles=[],ye.styleBoxes=[],ye.styles=$,ye.currentStyle=J,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2",this.styles.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/j.styles.length-5+"%",X.style.borderColor=J===j.currentStyle?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentStyle(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var Re=` `;ye.innerHTML=Re,X.appendChild(ye),j.styleBoxes.push(X)}),$},P.prototype.setCurrentStyle=function(j,$){var J=this;this.currentStyle=j,this.styleBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},P}(o),O=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new p("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Y(P,V),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="FrameMarker",P.title="Frame marker",P.icon='',P}(A),g=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},_=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.x1=0,X.y1=0,X.x2=0,X.y2=0,X.defaultLength=50,X.manipulationStartX=0,X.manipulationStartY=0,X.manipulationStartX1=0,X.manipulationStartY1=0,X.manipulationStartX2=0,X.manipulationStartY2=0,X.setupControlBox(),X}return Y(P,V),P.prototype.ownsTarget=function(j){return!!V.prototype.ownsTarget.call(this,j)||!(!this.grip1.ownsTarget(j)&&!this.grip2.ownsTarget(j))},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.manipulationStartX=j.x,this.manipulationStartY=j.y,this.state==="new"&&(this.x1=j.x,this.y1=j.y,this.x2=j.x,this.y2=j.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($)?this.activeGrip=this.grip1:this.grip2.ownsTarget($)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},P.prototype.pointerUp=function(j){var $=this.state;V.prototype.pointerUp.call(this,j),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(j),this._state="select",$==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},P.prototype.adjustVisual=function(){},P.prototype.manipulate=function(j){this.state==="creating"?this.resize(j):this.state==="move"?(this.x1=this.manipulationStartX1+j.x-this.manipulationStartX,this.y1=this.manipulationStartY1+j.y-this.manipulationStartY,this.x2=this.manipulationStartX2+j.x-this.manipulationStartX,this.y2=this.manipulationStartY2+j.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(j)},P.prototype.resize=function(j){switch(this.activeGrip){case this.grip1:this.x1=j.x,this.y1=j.y;break;case this.grip2:case void 0:this.x2=j.x,this.y2=j.y}this.adjustVisual(),this.adjustControlBox()},P.prototype.select=function(){V.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},P.prototype.deselect=function(){V.prototype.deselect.call(this),this.controlBox.style.display="none"},P.prototype.setupControlBox=function(){this.controlBox=M.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},P.prototype.adjustControlBox=function(){this.positionGrips()},P.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},P.prototype.createGrip=function(){var j=new s;return j.visual.transform.baseVal.appendItem(M.createTransform()),this.controlBox.appendChild(j.visual),j},P.prototype.positionGrips=function(){var j=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-j/2,this.y1-j/2),this.positionGrip(this.grip2.visual,this.x2-j/2,this.y2-j/2)},P.prototype.positionGrip=function(j,$,J){var X=j.transform.baseVal.getItem(0);X.setTranslate($,J),j.transform.baseVal.replaceItem(X,0)},P.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},V.prototype.getState.call(this))},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.x1=$.x1,this.y1=$.y1,this.x2=$.x2,this.y2=$.y2},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.x1=this.x1*j,this.y1=this.y1*$,this.x2=this.x2*j,this.y2=this.y2*$,this.adjustVisual(),this.adjustControlBox()},P}(l),d=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new p("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.selectorLine&&j!==this.visibleLine)},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorLine=M.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=M.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)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},P.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()),M.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.adjustVisual(),this.colorChanged(j)},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.adjustVisual()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.adjustVisual(),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.createVisual(),this.adjustVisual()},P.typeName="LineMarker",P.title="Line marker",P.icon='',P}(_),c=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'')||this;return ye.fonts=[],ye.fontBoxes=[],ye.fonts=$,ye.currentFont=J,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.overflow="hidden",$.style.flexGrow="2",this.fonts.forEach(function(J){var X=document.createElement("div");X.style.display="inline-block",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/j.fonts.length-5+"%",X.style.borderColor=J===j.currentFont?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentFont(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=J,ye.style.overflow="hidden";var Re=document.createElement("div");Re.style.whiteSpace="nowrap",Re.style.overflow="hidden",Re.style.textOverflow="ellipsis",Re.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(Re),X.appendChild(ye),j.fontBoxes.push(X)}),$},P.prototype.setCurrentFont=function(j,$){var J=this;this.currentFont=j,this.fontBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},P}(o),C=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.color="transparent",X.padding=5,X.DEFAULT_TEXT="your text here",X.text=X.DEFAULT_TEXT,X.isMoved=!1,X.color=J.defaultColor,X.fontFamily=J.defaultFontFamily,X.defaultSize={x:100,y:30},X.setColor=X.setColor.bind(X),X.setFont=X.setFont.bind(X),X.renderText=X.renderText.bind(X),X.sizeText=X.sizeText.bind(X),X.textEditDivClicked=X.textEditDivClicked.bind(X),X.showTextEditor=X.showTextEditor.bind(X),X.setSize=X.setSize.bind(X),X.positionTextEditor=X.positionTextEditor.bind(X),X.colorPanel=new p("Color",J.defaultColorSet,J.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.fontFamilyPanel=new c("Font",J.defaultFontFamilies,J.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X}return Y(P,V),P.prototype.ownsTarget=function(j){if(V.prototype.ownsTarget.call(this,j)||j===this.visual||j===this.textElement||j===this.bgRectangle)return!0;var $=!1;return this.textElement.childNodes.forEach(function(J){J===j&&($=!0)}),$},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.bgRectangle=M.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=M.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.textElement.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.isMoved=!1,this.pointerDownPoint=j,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(j),this._state="creating")},P.prototype.renderText=function(){var j=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($){j.textElement.appendChild(M.createTSpan($.trim()===""?" ":$.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},P.prototype.getTextScale=function(){var j=this.textElement.getBBox(),$=1;if(j.width>0&&j.height>0){var J=(1*this.width-this.width*this.padding*2/100)/j.width,X=(1*this.height-this.height*this.padding*2/100)/j.height;$=Math.min(J,X)}return $},P.prototype.getTextPosition=function(j){var $=this.textElement.getBBox(),J=0,X=0;return $.width>0&&$.height>0&&(J=(this.width-$.width*j)/2,X=this.height/2-$.height*j/2),{x:J,y:X}},P.prototype.sizeText=function(){var j=this.textElement.getBBox(),$=this.getTextScale(),J=this.getTextPosition($);J.y-=j.y*$,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+$+", "+$+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale($,$))},P.prototype.manipulate=function(j){V.prototype.manipulate.call(this,j),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(j.x-this.pointerDownPoint.x)>5||Math.abs(j.y-this.pointerDownPoint.y)>5)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),this.isMoved=!0,this.setSize(),this.sizeText()},P.prototype.setSize=function(){V.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},P.prototype.pointerUp=function(j){var $=this.state;$==="creating"&&(this._suppressMarkerCreateEvent=!0),V.prototype.pointerUp.call(this,j),this.setSize(),($==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},P.prototype.showTextEditor=function(){var j=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($){$.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var $=Number.parseFloat(j.textEditor.style.fontSize);j.textEditor.clientWidth>=Number.parseInt(j.textEditor.style.maxWidth)&&$>.9;)$-=.1,j.textEditor.style.fontSize=Math.max($,.9)+"em"}),this.textEditor.addEventListener("keyup",function($){$.cancelBubble=!0}),this.textEditor.addEventListener("paste",function($){if($.clipboardData){var J=$.clipboardData.getData("text"),X=window.getSelection();if(!X.rangeCount)return!1;X.deleteFromDocument(),X.getRangeAt(0).insertNode(document.createTextNode(J)),$.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){j.textEditDivClicked(j.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},P.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var j=this.getTextScale(),$=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),X={x:J.width*j,y:J.height*j};$.x-=X.x/2,$.y-=X.y/2,this.textEditor.style.top=$.y+"px",this.textEditor.style.left=$.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-$.x+"px",this.textEditor.style.fontSize=Math.max(16*j,12)+"px",this.textElement.style.display="none"}},P.prototype.textEditDivClicked=function(j){this.text=j.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},P.prototype.select=function(){V.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},P.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),V.prototype.deselect.call(this)},P.prototype.dblClick=function(j,$){V.prototype.dblClick.call(this,j,$),this.showTextEditor()},P.prototype.setColor=function(j){this.textElement&&M.setAttributes(this.textElement,[["fill",j]]),this.color=j,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(j)},P.prototype.setFont=function(j){this.textElement&&M.setAttributes(this.textElement,[["font-family",j]]),this.fontFamily=j,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},P.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},P.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){var $=j;this.color=$.color,this.fontFamily=$.fontFamily,this.padding=$.padding,this.text=$.text,this.createVisual(),V.prototype.restoreState.call(this,j),this.setSize()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setSize(),this.sizeText(),this.positionTextEditor()},P.typeName="TextMarker",P.title="Text marker",P.icon='',P}(D),E=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.color="transparent",X.lineWidth=3,X.drawing=!1,X.pixelRatio=1,X.color=J.defaultColor,X.lineWidth=J.defaultStrokeWidth,X.pixelRatio=J.freehandPixelRatio,X.setColor=X.setColor.bind(X),X.addCanvas=X.addCanvas.bind(X),X.finishCreation=X.finishCreation.bind(X),X.setLineWidth=X.setLineWidth.bind(X),X.colorPanel=new p("Color",J.defaultColorSet,J.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.lineWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.lineWidthPanel.onWidthChanged=X.setLineWidth,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.drawingImage)},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.drawingImage=M.createImage(),this.visual.appendChild(this.drawingImage);var j=M.createTransform();this.visual.transform.baseVal.appendItem(j),this.addMarkerVisualToContainer(this.visual)},P.prototype.pointerDown=function(j,$){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(j.x,j.y),this.drawing=!0):V.prototype.pointerDown.call(this,j,$)},P.prototype.manipulate=function(j){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(j.x,j.y),this.canvasContext.stroke()):V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){V.prototype.resize.call(this,j),M.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},P.prototype.pointerUp=function(j){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):V.prototype.pointerUp.call(this,j)},P.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)},P.prototype.select=function(){this.state==="creating"&&this.finishCreation(),V.prototype.select.call(this)},P.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),V.prototype.deselect.call(this)},P.prototype.finishCreation=function(){for(var j=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),$=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=$[0],X=$[1],ye=$[2],Re=$[3],Ke=!1,pe=0;pe0&&(Ke=!0,peRe&&(Re=pe),we>ye&&(ye=we));if(Ke){this.left=J/this.pixelRatio,this.top=X/this.pixelRatio,this.width=(ye-J)/this.pixelRatio,this.height=(Re-X)/this.pixelRatio;var ke=document.createElement("canvas");ke.width=ye-J,ke.height=Re-X,ke.getContext("2d").putImageData(this.canvasContext.getImageData(J,X,ye-J,Re-X),0,0),this.drawingImgUrl=ke.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},P.prototype.setDrawingImage=function(){M.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),M.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},P.prototype.setColor=function(j){this.color=j,this.colorChanged(j)},P.prototype.setLineWidth=function(j){this.lineWidth=j},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({drawingImgUrl:this.drawingImgUrl},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){this.createVisual(),V.prototype.restoreState.call(this,j),this.drawingImgUrl=j.drawingImgUrl,this.setDrawingImage()},P.prototype.scale=function(j,$){V.prototype.scale.call(this,j,$),this.setDrawingImage()},P.typeName="FreehandMarker",P.title="Freehand marker",P.icon='',P}(D),w=function(V){function P(j,$,J){var X=V.call(this,j,J||'')||this;return X.typeBoxes=[],X.currentType=$,X.setCurrentType=X.setCurrentType.bind(X),X}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");$.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2";for(var J=function(Re){var Ke="both";switch(Re){case 0:Ke="both";break;case 1:Ke="start";break;case 2:Ke="end";break;case 3:Ke="none"}var pe=document.createElement("div");if(pe.style.display="flex",pe.style.flexGrow="2",pe.style.alignItems="center",pe.style.justifyContent="space-between",pe.style.padding="5px",pe.style.borderWidth="2px",pe.style.borderStyle="solid",pe.style.borderColor=Ke===X.currentType?X.uiStyleSettings.toolboxAccentColor:"transparent",pe.addEventListener("click",function(){j.setCurrentType(Ke,pe)}),$.appendChild(pe),Ke==="both"||Ke==="start"){var we=document.createElement("div");we.style.display="flex",we.style.alignItems="center",we.style.minHeight="20px",we.innerHTML=` `,we.style.marginLeft="5px",pe.appendChild(we)}var ke=document.createElement("div");ke.style.display="flex",ke.style.alignItems="center",ke.style.minHeight="20px",ke.style.flexGrow="2";var Ue=document.createElement("hr");if(Ue.style.minWidth="20px",Ue.style.border="0px",Ue.style.borderTop="3px solid "+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee"),Ue.style.flexGrow="2",ke.appendChild(Ue),pe.appendChild(ke),Ke==="both"||Ke==="end"){var Qe=document.createElement("div");Qe.style.display="flex",Qe.style.alignItems="center",Qe.style.minHeight="20px",Qe.innerHTML=` `,Qe.style.marginRight="5px",pe.appendChild(Qe)}X.typeBoxes.push(pe)},X=this,ye=0;ye<4;ye++)J(ye);return $},P.prototype.setCurrentType=function(j,$){var J=this;this.currentType=j,this.typeBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},P}(o),B=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.arrowType="end",X.arrowBaseHeight=10,X.arrowBaseWidth=10,X.getArrowPoints=X.getArrowPoints.bind(X),X.setArrowType=X.setArrowType.bind(X),X.arrowTypePanel=new w("Arrow type","end"),X.arrowTypePanel.onArrowTypeChanged=X.setArrowType,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.arrow1&&j!==this.arrow2)},P.prototype.getArrowPoints=function(j,$){var J=this.arrowBaseWidth+2*this.strokeWidth,X=this.arrowBaseHeight+2*this.strokeWidth;return j-J/2+","+($+X/2)+" "+j+","+($-X/2)+" "+(j+J/2)+","+($+X/2)},P.prototype.createTips=function(){this.arrow1=M.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=M.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(M.createTransform()),this.visual.appendChild(this.arrow2)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.state==="creating"&&this.createTips()},P.prototype.adjustVisual=function(){if(V.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",M.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),M.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var j=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),$=this.arrow1.transform.baseVal.getItem(0);$.setRotate(j,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem($,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(j+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},P.prototype.setArrowType=function(j){this.arrowType=j,this.adjustVisual(),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({arrowType:this.arrowType},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.arrowType=$.arrowType,this.createTips(),this.adjustVisual()},P.typeName="ArrowMarker",P.title="Arrow marker",P.icon='',P}(d),W=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.fillColor=J.defaultFillColor,X.strokeWidth=0,X.fillPanel=new p("Color",J.defaultColorSet,J.defaultFillColor),X.fillPanel.onColorChanged=X.setFillColor,X}return Y(P,V),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="CoverMarker",P.title="Cover marker",P.icon='',P}(A),T=function(V){function P(j,$,J,X){var ye=V.call(this,j,X||'')||this;return ye.opacities=[],ye.opacityBoxes=[],ye.opacities=$,ye.currentOpacity=J,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return Y(P,V),P.prototype.getUi=function(){var j=this,$=document.createElement("div");return $.style.display="flex",$.style.overflow="hidden",$.style.flexGrow="2",$.style.justifyContent="space-between",this.opacities.forEach(function(J){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="center",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=J===j.currentOpacity?j.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){j.setCurrentOpacity(J,X)}),$.appendChild(X);var ye=document.createElement("div");ye.innerText=100*J+"%",X.appendChild(ye),j.opacityBoxes.push(X)}),$},P.prototype.setCurrentOpacity=function(j,$){var J=this;this.currentOpacity=j,this.opacityBoxes.forEach(function(X){X.style.borderColor=X===$?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},P}(o),k=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.setOpacity=X.setOpacity.bind(X),X.fillColor=J.defaultHighlightColor,X.strokeWidth=0,X.opacity=J.defaultHighlightOpacity,X.fillPanel=new p("Color",J.defaultColorSet,X.fillColor),X.fillPanel.onColorChanged=X.setFillColor,X.opacityPanel=new T("Opacity",J.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return Y(P,V),P.prototype.setOpacity=function(j){this.opacity=j,this.visual&&M.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="HighlightMarker",P.title="Highlight marker",P.icon='',P}(W),m='',y=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.bgColor="transparent",X.tipPosition={x:0,y:0},X.tipBase1Position={x:0,y:0},X.tipBase2Position={x:0,y:0},X.tipMoving=!1,X.color=J.defaultStrokeColor,X.bgColor=J.defaultFillColor,X.fontFamily=J.defaultFontFamily,X.defaultSize={x:100,y:30},X.setBgColor=X.setBgColor.bind(X),X.getTipPoints=X.getTipPoints.bind(X),X.positionTip=X.positionTip.bind(X),X.setTipPoints=X.setTipPoints.bind(X),X.colorPanel=new p("Text color",J.defaultColorSet,X.color,''),X.colorPanel.onColorChanged=X.setColor,X.bgColorPanel=new p("Fill color",J.defaultColorSet,X.bgColor,m),X.bgColorPanel.onColorChanged=X.setBgColor,X.fontFamilyPanel=new c("Font",J.defaultFontFamilies,J.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X.tipGrip=new s,X.tipGrip.visual.transform.baseVal.appendItem(M.createTransform()),X.controlBox.appendChild(X.tipGrip.visual),X}return Y(P,V),P.prototype.ownsTarget=function(j){return V.prototype.ownsTarget.call(this,j)||this.tipGrip.ownsTarget(j)||this.tip===j},P.prototype.createTip=function(){M.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=M.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},P.prototype.pointerDown=function(j,$){this.state==="new"&&V.prototype.pointerDown.call(this,j,$),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget($)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):V.prototype.pointerDown.call(this,j,$)},P.prototype.pointerUp=function(j){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,V.prototype.pointerUp.call(this,j);else{var $=this.state==="creating";V.prototype.pointerUp.call(this,j),this.setTipPoints($),this.positionTip()}},P.prototype.manipulate=function(j){if(this.tipMoving){var $=this.unrotatePoint(j);this.tipPosition={x:$.x-this.manipulationStartLeft,y:$.y-this.manipulationStartTop},this.positionTip()}else V.prototype.manipulate.call(this,j)},P.prototype.setBgColor=function(j){this.bgRectangle&&this.tip&&(M.setAttributes(this.bgRectangle,[["fill",j]]),M.setAttributes(this.tip,[["fill",j]])),this.bgColor=j,this.fillColorChanged(j)},P.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},P.prototype.setTipPoints=function(j){j===void 0&&(j=!1);var $=Math.min(this.height/2,15),J=this.height/5;j&&(this.tipPosition={x:$+J/2,y:this.height+20});var X=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?X.1)){var j=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),$=this.tip1.transform.baseVal.getItem(0);$.setRotate(j,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem($,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(j+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j),this.createTips(),this.adjustVisual()},P.typeName="MeasurementMarker",P.title="Measurement marker",P.icon='',P}(d),te=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokePanel.colors=J.defaultColorSet,X.fillColor="transparent",X}return Y(P,V),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=V.prototype.getState.call(this);return j.typeName=P.typeName,j},P.typeName="EllipseFrameMarker",P.title="Ellipse frame marker",P.icon='',P}(H),ae=function(){function V(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),V.prototype.addUndoStep=function(P){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(P)||(this.undoStack.push(P),JSON.stringify(this.lastRedoStep)!==JSON.stringify(P)&&this.redoStack.splice(0,this.redoStack.length))},V.prototype.replaceLastUndoStep=function(P){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=P)},V.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},V.prototype.undo=function(){if(this.undoStack.length>1){var P=this.undoStack.pop();return P!==void 0&&this.redoStack.push(P),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},V.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},V}(),Te=function(V){function P(j,$,J){var X=V.call(this,j,$,J)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.curveX=0,X.curveY=0,X.manipulationStartCurveX=0,X.manipulationStartCurveY=0,X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.positionGrips=X.positionGrips.bind(X),X.addControlGrips=X.addControlGrips.bind(X),X.adjustVisual=X.adjustVisual.bind(X),X.setupControlBox=X.setupControlBox.bind(X),X.resize=X.resize.bind(X),X.strokeColor=J.defaultColor,X.strokeWidth=J.defaultStrokeWidth,X.strokeDasharray=J.defaultStrokeDasharray,X.strokePanel=new p("Line color",J.defaultColorSet,J.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new S("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new R("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Y(P,V),P.prototype.ownsTarget=function(j){return!(!V.prototype.ownsTarget.call(this,j)&&j!==this.visual&&j!==this.selectorCurve&&j!==this.visibleCurve&&!this.curveGrip.ownsTarget(j))},P.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},P.prototype.createVisual=function(){this.visual=M.createGroup(),this.selectorCurve=M.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=M.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)},P.prototype.pointerDown=function(j,$){V.prototype.pointerDown.call(this,j,$),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=j.x,this.curveY=j.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget($)&&(this.activeGrip=this.curveGrip,this._state="resize")},P.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),M.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),M.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),M.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},P.prototype.setupControlBox=function(){V.prototype.setupControlBox.call(this),this.curveControlLine1=M.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=M.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)},P.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,V.prototype.addControlGrips.call(this)},P.prototype.positionGrips=function(){V.prototype.positionGrips.call(this);var j=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-j/2,this.curveY-j/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()))},P.prototype.manipulate=function(j){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+j.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+j.y-this.manipulationStartY),V.prototype.manipulate.call(this,j)},P.prototype.resize=function(j){this.activeGrip===this.curveGrip&&(this.curveX=j.x,this.curveY=j.y),V.prototype.resize.call(this,j),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},P.prototype.setStrokeColor=function(j){this.strokeColor=j,this.adjustVisual(),this.colorChanged(j)},P.prototype.setStrokeWidth=function(j){this.strokeWidth=j,this.adjustVisual()},P.prototype.setStrokeDasharray=function(j){this.strokeDasharray=j,this.adjustVisual()},P.prototype.scale=function(j,$){this.curveX=this.curveX*j,this.curveY=this.curveY*$,V.prototype.scale.call(this,j,$)},Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),P.prototype.getState=function(){var j=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},V.prototype.getState.call(this));return j.typeName=P.typeName,j},P.prototype.restoreState=function(j){V.prototype.restoreState.call(this,j);var $=j;this.strokeColor=$.strokeColor,this.strokeWidth=$.strokeWidth,this.strokeDasharray=$.strokeDasharray,this.curveX=$.curveX,this.curveY=$.curveY,this.createVisual(),this.adjustVisual()},P.typeName="CurveMarker",P.title="Curve marker",P.icon='',P}(_),_e=function(){function V(P,j){j===void 0&&(j=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=P,this.cancelable=j}return Object.defineProperty(V.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),V.prototype.preventDefault=function(){this._defaultPrevented=!0},V}(),ge=function(V){function P(j,$,J){var X=V.call(this,j,!1)||this;return X.dataUrl=$,X.state=J,X}return Y(P,V),P}(_e),ve=function(V){function P(j,$,J){J===void 0&&(J=!1);var X=V.call(this,j,J)||this;return X.marker=$,X}return Y(P,V),P}(_e),Oe=function(){function V(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return V.prototype.addEventListener=function(P,j){this[P].push(j)},V.prototype.removeEventListener=function(P,j){var $=this[P].indexOf(j);$>-1&&this[P].splice($,1)},V}(),he=function(){function V(P){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new g,this._isOpen=!1,this.undoRedoManager=new ae,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 Oe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=V.instanceCounter++,this.styles=new L(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=P,this.targetRoot=document.body,this.width=P.clientWidth,this.height=P.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(V.prototype,"ALL_MARKER_TYPES",{get:function(){return[O,E,B,C,te,H,k,y,Q,W,d,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[O,E,B,C,H,k,y]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"BASIC_MARKER_TYPES",{get:function(){return[O,E,B,C,k]},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(P){var j=this;this._availableMarkerTypes.splice(0),P.forEach(function($){if(typeof $=="string"){var J=j.ALL_MARKER_TYPES.find(function(X){return X.typeName===$});J!==void 0&&j._availableMarkerTypes.push(J)}else j._availableMarkerTypes.push($)})},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(P){this._zoomLevel=P,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(V.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),V.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),G.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},V.prototype.show=function(){var P=this;this.styles.styleSheetRoot===void 0&&n.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=n.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(j){return j(new _e(P))})},V.prototype.render=function(){return N(this,void 0,void 0,function(){var P;return z(this,function(j){switch(j.label){case 0:return this.setCurrentMarker(),(P=new K).naturalSize=this.renderAtNaturalSize,P.imageType=this.renderImageType,P.imageQuality=this.renderImageQuality,P.markersOnly=this.renderMarkersOnly,P.width=this.renderWidth,P.height=this.renderHeight,[4,P.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return j.sent(),[4,P.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,j.sent()]}})})},V.prototype.close=function(P){var j=this;if(P===void 0&&(P=!1),this.isOpen){var $=!1;P||this.eventListeners.beforeclose.forEach(function(J){var X=new _e(j,!0);J(X),X.defaultPrevented&&($=!0)}),$||(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(J){return J(new _e(j))}),this.detachEvents(),this._isOpen=!1)}},V.prototype.addMarkersToToolbar=function(){for(var P,j=[],$=0;$this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*P:this.editorCanvas.clientWidth,$=j',P.title="Powered by marker.js",P.style.display="grid",P.style.alignItems="center",P.style.justifyItems="center",P.style.padding="3px",P.style.width="20px",P.style.height="20px",this.logoUI.appendChild(P),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},V.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},V.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},V.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},V.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var P=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=P+"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 b(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-1&&this.markers.splice(this.markers.indexOf(P),1),P.dispose()},V.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},V.prototype.toolbarButtonClicked=function(P,j){if(P==="marker"&&j!==void 0)this.createNewMarker(j);else if(P==="action")switch(j){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},V.prototype.deleteSelectedMarker=function(){var P=this;if(this._currentMarker!==void 0){var j=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var X=new ve(P,P._currentMarker,!0);J(X),X.defaultPrevented&&(j=!0)}),!j){var $=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(J){return J(new ve(P,$))})}}},V.prototype.clear=function(){var P=this,j=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var Re=new ve(P,void 0,!0);ye(Re),Re.defaultPrevented&&(j=!0)}),!j)){this.setCurrentMarker();for(var $=function(ye){var Re=J.markers[ye];J.setCurrentMarker(J.markers[ye]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(Ke){return Ke(new ve(P,Re))})},J=this,X=this.markers.length-1;X>=0;X--)$(X);this.addUndoStep()}},Object.defineProperty(V.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),V.prototype.showNotesEditor=function(){var P;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=(P=this._currentMarker.notes)!==null&&P!==void 0?P:"",this.overlayContainer.appendChild(this.notesArea))},V.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},V.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},V.prototype.addUndoStep=function(){var P=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var j=this.getState(),$=this.undoRedoManager.getLastUndoStep();if(!$||$.width===j.width&&$.height===j.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(j),J1&&this.panTo({x:P.clientX,y:P.clientY}))},V.prototype.onPointerUp=function(P){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(P.clientX,P.clientY)),this.isDragging=!1,this.addUndoStep()},V.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},V.prototype.onKeyUp=function(P){this._currentMarker===void 0||this.notesArea!==void 0||P.key!=="Delete"&&P.key!=="Backspace"||this.deleteSelectedMarker()},V.prototype.clientToLocalCoordinates=function(P,j){var $=this.markerImage.getBoundingClientRect();return{x:(P-$.left)/this.zoomLevel,y:(j-$.top)/this.zoomLevel}},V.prototype.onWindowResize=function(){this.positionUI()},V.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var P=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=P+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},V.prototype.addLicenseKey=function(P){G.addKey(P)},V.prototype.addEventListener=function(P,j){this.eventListeners.addEventListener(P,j)},V.prototype.removeEventListener=function(P,j){this.eventListeners.removeEventListener(P,j)},V.prototype.renderState=function(P){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(P),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(V.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),V.prototype.focus=function(){var P=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(j){return j(new _e(P))}))},V.prototype.blur=function(){var P=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(j){return j(new _e(P))}))},V.instanceCounter=0,V}()},T8No:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return G}),U.d(Ee,"e",function(){return K}),U.d(Ee,"c",function(){return d}),U.d(Ee,"b",function(){return c}),U.d(Ee,"d",function(){return C}),U.d(Ee,"f",function(){return B});var ie=U("MNsG"),Y=U("N0LK"),N=U("Cg/j");let z=ie.k||"";const I=new Map;I.set("false",!1),I.set("true",!0),I.set("isMac",ie.f),I.set("isLinux",ie.d),I.set("isWindows",ie.i),I.set("isWeb",ie.h),I.set("isMacNative",ie.f&&!ie.h),I.set("isEdge",z.indexOf("Edg/")>=0),I.set("isFirefox",z.indexOf("Firefox")>=0),I.set("isChrome",z.indexOf("Chrome")>=0),I.set("isSafari",z.indexOf("Safari")>=0);const M=Object.prototype.hasOwnProperty;class G{static has(T){return f.create(T)}static equals(T,k){return b.create(T,k)}static regex(T,k){return S.create(T,k)}static not(T){return l.create(T)}static and(...T){return g.create(T,null)}static or(...T){return _.create(T,null,!0)}static deserialize(T,k=!1){return T?this._deserializeOrExpression(T,k):void 0}static _deserializeOrExpression(T,k){let m=T.split("||");return _.create(m.map(y=>this._deserializeAndExpression(y,k)),null,!0)}static _deserializeAndExpression(T,k){let m=T.split("&&");return g.create(m.map(y=>this._deserializeOne(y,k)),null)}static _deserializeOne(T,k){if(T=T.trim(),T.indexOf("!=")>=0){let m=T.split("!=");return p.create(m[0].trim(),this._deserializeValue(m[1],k))}if(T.indexOf("==")>=0){let m=T.split("==");return b.create(m[0].trim(),this._deserializeValue(m[1],k))}if(T.indexOf("=~")>=0){let m=T.split("=~");return S.create(m[0].trim(),this._deserializeRegexValue(m[1],k))}if(T.indexOf(" in ")>=0){let m=T.split(" in ");return h.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(T)){const m=T.split(">=");return i.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(T)){const m=T.split(">");return s.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(T)){const m=T.split("<=");return A.create(m[0].trim(),m[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(T)){const m=T.split("<");return D.create(m[0].trim(),m[1].trim())}return/^\!\s*/.test(T)?l.create(T.substr(1).trim()):f.create(T)}static _deserializeValue(T,k){if(T=T.trim(),T==="true")return!0;if(T==="false")return!1;let m=/^'([^']*)'$/.exec(T);return m?m[1].trim():T}static _deserializeRegexValue(T,k){if(Object(Y.C)(T)){if(k)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let m=T.indexOf("/"),y=T.lastIndexOf("/");if(m===y||m<0){if(k)throw new Error(`bad regexp-value '${T}', missing /-enclosure`);return console.warn(`bad regexp-value '${T}', missing /-enclosure`),null}let H=T.slice(m+1,y),Q=T[y+1]==="i"?"i":"";try{return new RegExp(H,Q)}catch(te){if(k)throw new Error(`bad regexp-value '${T}', parse error: ${te}`);return console.warn(`bad regexp-value '${T}', parse error: ${te}`),null}}}function K(T,k){const m=T?T.substituteConstants():void 0,y=k?k.substituteConstants():void 0;return!m&&!y?!0:!m||!y?!1:m.equals(y)}function n(T,k){return T.cmp(k)}class L{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 x.INSTANCE}}L.INSTANCE=new L;class x{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 L.INSTANCE}}x.INSTANCE=new x;class f{constructor(T,k){this.key=T,this.negated=k,this.type=2}static create(T,k=null){const m=I.get(T);return typeof m=="boolean"?m?x.INSTANCE:L.INSTANCE:new f(T,k)}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=I.get(this.key);return typeof T=="boolean"?T?x.INSTANCE:L.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 b{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=4}static create(T,k,m=null){if(typeof k=="boolean")return k?f.create(T,m):l.create(T,m);const y=I.get(T);if(typeof y=="boolean"){const H=y?"true":"false";return k===H?x.INSTANCE:L.INSTANCE}return new b(T,k,m)}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=I.get(this.key);if(typeof T=="boolean"){const k=T?"true":"false";return this.value===k?x.INSTANCE:L.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 h{constructor(T,k){this.key=T,this.valueKey=k,this.type=10,this.negated=null}static create(T,k){return new h(T,k)}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 k=T.getValue(this.valueKey),m=T.getValue(this.key);return Array.isArray(k)?k.indexOf(m)>=0:typeof m=="string"&&typeof k=="object"&&k!==null?M.call(k,m):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(T){this._actual=T,this.type=11}static create(T){return new o(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,k,m){this.key=T,this.value=k,this.negated=m,this.type=5}static create(T,k,m=null){if(typeof k=="boolean")return k?l.create(T,m):f.create(T,m);const y=I.get(T);if(typeof y=="boolean"){const H=y?"true":"false";return k===H?L.INSTANCE:x.INSTANCE}return new p(T,k,m)}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=I.get(this.key);if(typeof T=="boolean"){const k=T?"true":"false";return this.value===k?L.INSTANCE:x.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=b.create(this.key,this.value,this)),this.negated}}class l{constructor(T,k){this.key=T,this.negated=k,this.type=3}static create(T,k=null){const m=I.get(T);return typeof m=="boolean"?m?L.INSTANCE:x.INSTANCE:new l(T,k)}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=I.get(this.key);return typeof T=="boolean"?T?L.INSTANCE:x.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,k){if(typeof T=="string"){const m=parseFloat(T);isNaN(m)||(T=m)}return typeof T=="string"||typeof T=="number"?k(T):L.INSTANCE}class s{constructor(T,k,m){this.key=T,this.value=k,this.negated=m,this.type=12}static create(T,k,m=null){return u(k,y=>new s(T,y,m))}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,k,m){this.key=T,this.value=k,this.negated=m,this.type=13}static create(T,k,m=null){return u(k,y=>new i(T,y,m))}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,k,m){this.key=T,this.value=k,this.negated=m,this.type=14}static create(T,k,m=null){return u(k,y=>new D(T,y,m))}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))new A(T,y,m))}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,k){this.key=T,this.regexp=k,this.type=7,this.negated=null}static create(T,k){return new S(T,k)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.keyT.key)return 1;const k=this.regexp?this.regexp.source:"",m=T.regexp?T.regexp.source:"";return km?1:0}equals(T){if(T.type===this.type){const k=this.regexp?this.regexp.source:"",m=T.regexp?T.regexp.source:"";return this.key===T.key&&k===m}return!1}substituteConstants(){return this}evaluate(T){let k=T.getValue(this.key);return this.regexp?this.regexp.test(k):!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 k=null;for(let m=0,y=T.length;mT.expr.length)return 1;for(let k=0,m=this.expr.length;k1;){const H=m[m.length-1];if(H.type!==9)break;m.pop();const Q=m.pop(),te=m.length===0,ae=_.create(H.expr.map(Te=>g.create([Te,Q],null)),null,te);ae&&(m.push(ae),m.sort(n))}return m.length===1?m[0]:new g(m,k)}serialize(){return this.expr.map(T=>T.serialize()).join(" && ")}keys(){const T=[];for(let k of this.expr)T.push(...k.keys());return T}negate(){if(!this.negated){const T=[];for(let k of this.expr)T.push(k.negate());this.negated=_.create(T,this,!0)}return this.negated}}class _{constructor(T,k){this.expr=T,this.negated=k,this.type=9}static create(T,k,m){return _._normalizeArr(T,k,m)}cmp(T){if(T.type!==this.type)return this.type-T.type;if(this.expr.lengthT.expr.length)return 1;for(let k=0,m=this.expr.length;kT.serialize()).join(" || ")}keys(){const T=[];for(let k of this.expr)T.push(...k.keys());return T}negate(){if(!this.negated){let T=[];for(let k of this.expr)T.push(k.negate());for(;T.length>1;){const k=T.shift(),m=T.shift(),y=[];for(const Q of W(k))for(const te of W(m))y.push(g.create([Q,te],null));const H=T.length===0;T.unshift(_.create(y,null,H))}this.negated=T[0]}return this.negated}}class d extends f{constructor(T,k,m){super(T,null);this._defaultValue=k,typeof m=="object"?d._info.push(Object.assign(Object.assign({},m),{key:T})):m!==!0&&d._info.push({key:T,description:m,type:k!=null?typeof k:void 0})}static all(){return d._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 b.create(this.key,T)}}d._info=[];const c=Object(N.c)("contextKeyService"),C="setContext";function E(T,k){return Tk?1:0}function w(T,k,m,y){return Tm?1:ky?1:0}function B(T,k){if(k.type===6&&T.type!==9&&T.type!==6){for(const H of k.expr)if(T.equals(H))return!0}const m=T.negate(),y=W(m).concat(W(k));y.sort(n);for(let H=0;H=0;h--)if(this.__items[h].match(b))return!0;return!1},L.prototype.set_indent=function(b,h){this.is_empty()&&(this.__indent_count=b||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},L.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)},L.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},L.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var b=this.__parent.current_line;return b.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),b.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),b.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,b.__items[0]===" "&&(b.__items.splice(0,1),b.__character_count-=1),!0}return!1},L.prototype.is_empty=function(){return this.__items.length===0},L.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},L.prototype.push=function(b){this.__items.push(b);var h=b.lastIndexOf(` `);h!==-1?this.__character_count=b.length-h:this.__character_count+=b.length},L.prototype.pop=function(){var b=null;return this.is_empty()||(b=this.__items.pop(),this.__character_count-=b.length),b},L.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},L.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},L.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},L.prototype.toString=function(){var b="";return this.is_empty()?this.__parent.indent_empty_lines&&(b=this.__parent.get_indent_string(this.__indent_count)):(b=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),b+=this.__items.join("")),b};function x(b,h){this.__cache=[""],this.__indent_size=b.indent_size,this.__indent_string=b.indent_char,b.indent_with_tabs||(this.__indent_string=new Array(b.indent_size+1).join(b.indent_char)),h=h||"",b.indent_level>0&&(h=new Array(b.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}x.prototype.get_indent_size=function(b,h){var o=this.__base_string_length;return h=h||0,b<0&&(o=0),o+=b*this.__indent_size,o+=h,o},x.prototype.get_indent_string=function(b,h){var o=this.__base_string;return h=h||0,b<0&&(b=0,o=""),h+=b*this.__indent_size,this.__ensure_cache(h),o+=this.__cache[h],o},x.prototype.__ensure_cache=function(b){for(;b>=this.__cache.length;)this.__add_column()},x.prototype.__add_column=function(){var b=this.__cache.length,h=0,o="";this.__indent_size&&b>=this.__indent_size&&(h=Math.floor(b/this.__indent_size),b-=h*this.__indent_size,o=new Array(h+1).join(this.__indent_string)),b&&(o+=new Array(b+1).join(" ")),this.__cache.push(o)};function f(b,h){this.__indent_cache=new x(b,h),this.raw=!1,this._end_with_newline=b.end_with_newline,this.indent_size=b.indent_size,this.wrap_line_length=b.wrap_line_length,this.indent_empty_lines=b.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new L(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(b,h){return this.__indent_cache.get_indent_string(b,h)},f.prototype.get_indent_size=function(b,h){return this.__indent_cache.get_indent_size(b,h)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(b){return this.is_empty()||!b&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(b){this.trim(!0);var h=this.current_line.pop();h&&(h[h.length-1]===` `&&(h=h.replace(/\n+$/g,"")),this.current_line.push(h)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return b!==` `&&(o=o.replace(/[\n]/g,b)),o},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(b,h){return b=b||0,h=h||0,this.next_line.set_indent(b,h),this.__lines.length>1?(this.current_line.set_indent(b,h),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(b){for(var h=0;h1&&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(b,h){for(var o=this.__lines.length-2;o>=0;){var p=this.__lines[o];if(p.is_empty())break;if(p.item(0).indexOf(b)!==0&&p.item(-1)!==h){this.__lines.splice(o+1,0,new L(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},n.exports.Output=f},,,,function(n){function L(b,h){this.raw_options=x(b,h),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"])}L.prototype._get_array=function(b,h){var o=this.raw_options[b],p=h||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(p=o.concat()):typeof o=="string"&&(p=o.split(/[^a-zA-Z0-9_\/\-]+/)),p},L.prototype._get_boolean=function(b,h){var o=this.raw_options[b],p=o===void 0?!!h:!!o;return p},L.prototype._get_characters=function(b,h){var o=this.raw_options[b],p=h||"";return typeof o=="string"&&(p=o.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),p},L.prototype._get_number=function(b,h){var o=this.raw_options[b];h=parseInt(h,10),isNaN(h)&&(h=0);var p=parseInt(o,10);return isNaN(p)&&(p=h),p},L.prototype._get_selection=function(b,h,o){var p=this._get_selection_list(b,h,o);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+b+`' can only be one of the following values: `+h+` You passed in: '`+this.raw_options[b]+"'");return p[0]},L.prototype._get_selection_list=function(b,h,o){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[h[0]],!this._is_valid_selection(o,h))throw new Error("Invalid Default Value!");var p=this._get_array(b,o);if(!this._is_valid_selection(p,h))throw new Error("Invalid Option Value: The option '"+b+`' can contain only the following values: `+h+` You passed in: '`+this.raw_options[b]+"'");return p},L.prototype._is_valid_selection=function(b,h){return b.length&&h.length&&!b.some(function(o){return h.indexOf(o)===-1})};function x(b,h){var o={};b=f(b);var p;for(p in b)p!==h&&(o[p]=b[p]);if(h&&b[h])for(p in b[h])o[p]=b[h][p];return o}function f(b){var h={},o;for(o in b){var p=o.replace(/-/g,"_");h[p]=b[o]}return h}n.exports.Options=L,n.exports.normalizeOpts=f,n.exports.mergeOpts=x},,function(n){var L=RegExp.prototype.hasOwnProperty("sticky");function x(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}x.prototype.restart=function(){this.__position=0},x.prototype.back=function(){this.__position>0&&(this.__position-=1)},x.prototype.hasNext=function(){return this.__position=0&&f=0&&b=f.length&&this.__input.substring(b-f.length,b).toLowerCase()===f},n.exports.InputScanner=x},,,,,function(n){function L(x,f){x=typeof x=="string"?x:x.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(x+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(x+/\sbeautify\signore:end\s/.source+f,"g")}L.prototype.get_directives=function(x){if(!x.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var b=this.__directive_pattern.exec(x);b;)f[b[1]]=b[2],b=this.__directive_pattern.exec(x);return f},L.prototype.readIgnored=function(x){return x.readUntilAfter(this.__directives_end_ignore_pattern)},n.exports.Directives=L},,function(n,L,x){var f=x(16).Beautifier,b=x(17).Options;function h(o,p){var l=new f(o,p);return l.beautify()}n.exports=h,n.exports.defaultOptions=function(){return new b}},function(n,L,x){var f=x(17).Options,b=x(2).Output,h=x(8).InputScanner,o=x(13).Directives,p=new o(/\/\*/,/\*\//),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()),g=0;s.test(this._input.peek());)this._ch=this._input.next(),R&&this._ch===` `&&((g===0||g0&&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 g=R.match(/^[\t ]*/)[0];this._output=new b(this._options,g),this._input=new h(R),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,d=!1,c=!1,C=!1,E=!1,w=!1,B=!1,W=this._ch,T=!1,k,m,y;k=this._input.read(i),m=k!=="",y=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),Q=p.get_directives(H);Q&&Q.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(m),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var te=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);te.match(/[ :]$/)&&(te=this.eatString(": ").replace(/\s$/,""),this.print_string(te),this._output.space_before_token=!0),te=te.replace(/\s$/,""),te==="extend"?E=!0:te==="import"&&(w=!0),te in this.NESTED_AT_RULE?(this._nestedLevel+=1,te in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!d&&_===0&&te.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(m),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),C?(C=!1,d=this._indentLevel>=this._nestedLevel):d=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&d&&(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)):(y==="("?this._output.space_before_token=!1:y!==","&&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(),y==="{"&&this._output.trim(!0),w=!1,E=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),d=!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 ae=0;ae"||this._ch==="+"||this._ch==="~")&&!c&&_===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(m),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 ge=y==='"'||y==="'";this.preserveSingleSpace(ge||m),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&T&&this._output.add_new_line()}var ve=this._output.get_code(O);return ve},n.exports.Beautifier=S},function(n,L,x){var f=x(6).Options;function b(h){f.call(this,h,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var p=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l` ${x} `).trim():""}class G{constructor(n,L,x){this.id=n,this.definition=L,this.description=x,N.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 L=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function x(h){if(h instanceof G)return["codicon","codicon-"+h.id];const o=L.exec(h.id);if(!o)return x(G.error);let[,p,l]=o;const u=["codicon","codicon-"+p];return l&&u.push("codicon-modifier-"+l.substr(1)),u}n.asClassNameArray=x;function f(h){return x(h).join(" ")}n.asClassName=f;function b(h){return"."+x(h).join(".")}n.asCSSSelector=b})(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(it,Ee,U){(function(ie,Y){it.exports=Y()})(this,function(){"use strict";var ie=navigator.userAgent,Y=navigator.platform,N=/gecko\/\d/i.test(ie),z=/MSIE \d/.test(ie),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ie),M=/Edge\/(\d+)/.exec(ie),G=z||I||M,K=G&&(z?document.documentMode||6:+(M||I)[1]),n=!M&&/WebKit\//.test(ie),L=n&&/Qt\/\d+\.\d+/.test(ie),x=!M&&/Chrome\//.test(ie),f=/Opera\//.test(ie),b=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ie),o=/PhantomJS/.test(ie),p=!M&&/AppleWebKit/.test(ie)&&/Mobile\/\w+/.test(ie),l=/Android/.test(ie),u=p||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ie),s=p||/Mac/.test(Y),i=/\bCrOS\b/.test(ie),D=/win/i.test(Y),A=f&&ie.match(/Version\/(\d*\.\d*)/);A&&(A=Number(A[1])),A&&A>=15&&(f=!1,n=!0);var S=s&&(L||f&&(A==null||A<12.11)),R=N||G&&K>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var g=function(e,t){var a=e.className,r=O(t).exec(a);if(r){var v=a.slice(r.index+r[0].length);e.className=a.slice(0,r.index)+(v?r[1]+v:"")}};function _(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function d(e,t){return _(e).appendChild(t)}function c(e,t,a,r){var v=document.createElement(e);if(a&&(v.className=a),r&&(v.style.cssText=r),typeof t=="string")v.appendChild(document.createTextNode(t));else if(t)for(var F=0;F=t)return Z+(t-F);Z+=ee-F,Z+=a-Z%a,F=ee+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};Q.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Q.prototype.set=function(e,t){this.f=t;var a=+new Date+e;(!this.id||a=t)return r+Math.min(Z,t-v);if(v+=F-r,v+=a-v%a,r=F+1,v>=t)return r}}var he=[""];function V(e){for(;he.length<=e;)he.push(P(he)+" ");return he[e]}function P(e){return e[e.length-1]}function j(e,t){for(var a=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ye.test(e))}function Ke(e,t){return t?t.source.indexOf("\\w")>-1&&Re(e)?!0:t.test(e):Re(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var we=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ke(e){return e.charCodeAt(0)>=768&&we.test(e)}function Ue(e,t,a){for(;(a<0?t>0:ta?-1:1;;){if(t==a)return t;var v=(t+a)/2,F=r<0?Math.ceil(v):Math.floor(v);if(F==t)return e(F)?t:a;e(F)?a=F:t=F+r}}function nt(e,t,a,r){if(!e)return r(t,a,"ltr",0);for(var v=!1,F=0;Ft||t==a&&Z.to==t)&&(r(Math.max(Z.from,t),Math.min(Z.to,a),Z.level==1?"rtl":"ltr",F),v=!0)}v||r(t,a,"ltr")}var ot=null;function qe(e,t,a){var r;ot=null;for(var v=0;vt)return v;F.to==t&&(F.from!=F.to&&a=="before"?r=v:ot=v),F.from==t&&(F.from!=F.to&&a!="before"?r=v:ot=v)}return r!=null?r:ot}var ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function a(de){return de<=247?e.charAt(de):1424<=de&&de<=1524?"R":1536<=de&&de<=1785?t.charAt(de-1536):1774<=de&&de<=2220?"r":8192<=de&&de<=8203?"w":de==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,v=/[stwN]/,F=/[LRr]/,Z=/[Lb1n]/,ee=/[1n]/;function re(de,Ie,Ne){this.level=de,this.from=Ie,this.to=Ne}return function(de,Ie){var Ne=Ie=="ltr"?"L":"R";if(de.length==0||Ie=="ltr"&&!r.test(de))return!1;for(var Xe=de.length,ze=[],at=0;at-1&&(r[t]=v.slice(0,F).concat(v.slice(F+1)))}}}function me(e,t){var a=Tt(e,t);if(!a.length)return;for(var r=Array.prototype.slice.call(arguments,2),v=0;v0}function ue(e){e.prototype.on=function(t,a){Ye(this,t,a)},e.prototype.off=function(t,a){bt(this,t,a)}}function oe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function be(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Se(e){oe(e),ce(e)}function Pe(e){return e.target||e.srcElement}function We(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 et=function(){if(G&&K<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),yt;function Rt(e){if(yt==null){var t=c("span","\u200B");d(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&K<8))}var a=yt?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return a.setAttribute("cm-text",""),a}var kt;function mn(e){if(kt!=null)return kt;var t=d(e,document.createTextNode("A\u062EA")),a=E(t,0,1).getBoundingClientRect(),r=E(t,1,2).getBoundingClientRect();return _(e),!a||a.left==a.right?!1:kt=r.right-a.right<3}var zt=` b`.split(/\n/).length!=3?function(e){for(var t=0,a=[],r=e.length;t<=r;){var v=e.indexOf(` `,t);v==-1&&(v=e.length);var F=e.slice(t,e.charAt(v-1)=="\r"?v-1:v),Z=F.indexOf("\r");Z!=-1?(a.push(F.slice(0,Z)),t+=Z+1):(a.push(F),t=v+1)}return a}:function(e){return e.split(/\r\n?|\n/)},Mt=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(a){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Qn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),un=null;function hr(e){if(un!=null)return un;var t=d(e,c("span","x")),a=t.getBoundingClientRect(),r=E(t,0,1).getBoundingClientRect();return un=Math.abs(a.left-r.left)>1}var or={},bn={};function xr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),or[e]=t}function br(e,t){bn[e]=t}function Ar(e){if(typeof e=="string"&&bn.hasOwnProperty(e))e=bn[e];else if(e&&typeof e.name=="string"&&bn.hasOwnProperty(e.name)){var t=bn[e.name];typeof t=="string"&&(t={name:t}),e=X(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ar("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ar("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Br(e,t){t=Ar(t);var a=or[t.name];if(!a)return Br(e,"text/plain");var r=a(e,t);if(Ht.hasOwnProperty(t.name)){var v=Ht[t.name];for(var F in v){if(!v.hasOwnProperty(F))continue;r.hasOwnProperty(F)&&(r["_"+F]=r[F]),r[F]=v[F]}}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var Z in t.modeProps)r[Z]=t.modeProps[Z];return r}var Ht={};function an(e,t){var a=Ht.hasOwnProperty(e)?Ht[e]:Ht[e]={};y(t,a)}function Cn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var a={};for(var r in t){var v=t[r];v instanceof Array&&(v=v.concat([])),a[r]=v}return a}function qn(e,t){for(var a;e.innerMode&&!(a=e.innerMode(t),!a||a.mode==e);)t=a.state,e=a.mode;return a||{mode:e,state:t}}function Ir(e,t,a){return e.startState?e.startState(t,a):!0}var gn=function(e,t,a){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=a};gn.prototype.eol=function(){return this.pos>=this.string.length},gn.prototype.sol=function(){return this.pos==this.lineStart},gn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},gn.prototype.next=function(){if(this.post},gn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},gn.prototype.skipToEnd=function(){this.pos=this.string.length},gn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},gn.prototype.backUp=function(e){this.pos-=e},gn.prototype.column=function(){return this.lastColumnPos0?null:(F&&t!==!1&&(this.pos+=F[0].length),F)}},gn.prototype.current=function(){return this.string.slice(this.start,this.pos)},gn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},gn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},gn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function wt(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 a=e;!a.lines;)for(var r=0;;++r){var v=a.children[r],F=v.chunkSize();if(t=e.first&&ta?ct(a,wt(e,a).text.length):Ia(t,wt(e,t.line).text.length)}function Ia(e,t){var a=e.ch;return a==null||a>t?ct(e.line,t):a<0?ct(e.line,0):e}function _t(e,t){for(var a=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},yi.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}},yi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},yi.fromSaved=function(e,t,a){return t instanceof Fi?new yi(e,Cn(e.mode,t.state),a,t.lookAhead):new yi(e,Cn(e.mode,t),a)},yi.prototype.save=function(e){var t=e!==!1?Cn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Fi(t,this.maxLookAhead):t};function ba(e,t,a,r){var v=[e.state.modeGen],F={};st(e,t.text,e.doc.mode,a,function(de,Ie){return v.push(de,Ie)},F,r);for(var Z=a.state,ee=function(de){a.baseTokens=v;var Ie=e.state.overlays[de],Ne=1,Xe=0;a.state=!0,st(e,t.text,Ie.mode,a,function(ze,at){for(var dt=Ne;Xeze&&v.splice(Ne,1,ze,v[Ne+1],Et),Ne+=2,Xe=Math.min(ze,Et)}if(!at)return;if(Ie.opaque)v.splice(dt,Ne-dt,ze,"overlay "+at),Ne=dt+2;else for(;dte.options.maxHighlightLength&&Cn(e.doc.mode,r.state),F=ba(e,t,r);v&&(r.state=v),t.stateAfter=r.save(!v),t.styles=F.styles,F.classes?t.styleClasses=F.classes:t.styleClasses&&(t.styleClasses=null),a===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pi(e,t,a){var r=e.doc,v=e.display;if(!r.mode.startState)return new yi(r,!0,t);var F=Pt(e,t,a),Z=F>r.first&&wt(r,F-1).stateAfter,ee=Z?yi.fromSaved(r,Z,F):new yi(r,Ir(r.mode),F);return r.iter(F,t,function(re){da(e,re.text,ee);var de=ee.line;re.stateAfter=de==t-1||de%5==0||de>=v.viewFrom&&det.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var xa=function(e,t,a){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=a};function Ya(e,t,a,r){var v=e.doc,F=v.mode,Z;t=En(v,t);var ee=wt(v,t.line),re=pi(e,t.line,a),de=new gn(ee.text,e.options.tabSize,re),Ie;for(r&&(Ie=[]);(r||de.pose.options.maxHighlightLength?(ee=!1,Z&&da(e,t,r,Ie.pos),Ie.pos=t.length,Ne=null):Ne=Vt(ur(a,Ie,r.state,Xe),F),Xe){var ze=Xe[0].name;ze&&(Ne="m-"+(Ne?ze+" "+Ne:ze))}if(!ee||de!=Ne){for(;reZ;--ee){if(ee<=F.first)return F.first;var re=wt(F,ee-1),de=re.stateAfter;if(de&&(!a||ee+(de instanceof Fi?de.lookAhead:0)<=F.modeFrontier))return ee;var Ie=H(re.text,null,e.options.tabSize);(v==null||r>Ie)&&(v=ee-1,r=Ie)}return v}function xt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontiera;r--){var v=wt(e,r).stateAfter;if(v&&(!(v instanceof Fi)||r+v.lookAhead=t:F.to>t);(r||(r=[])).push(new en(Z,F.from,re?null:F.to))}}return r}function ar(e,t,a){var r;if(e)for(var v=0;v=t:F.to>t);if(ee||F.from==t&&Z.type=="bookmark"&&(!a||F.marker.insertLeft)){var re=F.from==null||(Z.inclusiveLeft?F.from<=t:F.from0&&ee)for(var Gt=0;Gt0)continue;var Ie=[re,1],Ne=Qt(de.from,ee.from),Xe=Qt(de.to,ee.to);(Ne<0||!Z.inclusiveLeft&&!Ne)&&Ie.push({from:de.from,to:ee.from}),(Xe>0||!Z.inclusiveRight&&!Xe)&&Ie.push({from:ee.to,to:de.to}),v.splice.apply(v,Ie),re+=Ie.length-3}return v}function ir(e){var t=e.markedSpans;if(!t)return;for(var a=0;at)&&(!r||Sn(r,F.marker)<0)&&(r=F.marker)}return r}function Yt(e,t,a,r,v){var F=wt(e,t),Z=Zt&&F.markedSpans;if(Z)for(var ee=0;ee=0&&Ne<=0||Ie<=0&&Ne>=0)continue;if(Ie<=0&&(re.marker.inclusiveRight&&v.inclusiveLeft?Qt(de.to,a)>=0:Qt(de.to,a)>0)||Ie>=0&&(re.marker.inclusiveRight&&v.inclusiveLeft?Qt(de.from,r)<=0:Qt(de.from,r)<0))return!0}}function fn(e){for(var t;t=Ut(e);)e=t.find(-1,!0).line;return e}function fr(e){for(var t;t=jt(e);)e=t.find(1,!0).line;return e}function pn(e){for(var t,a;t=jt(e);)e=t.find(1,!0).line,(a||(a=[])).push(e);return a}function Yr(e,t){var a=wt(e,t),r=fn(a);return a==r?t:on(r)}function $r(e,t){if(t>e.lastLine())return t;var a=wt(e,t),r;if(!kr(e,a))return t;for(;r=jt(a);)a=r.find(1,!0).line;return on(a)+1}function kr(e,t){var a=Zt&&t.markedSpans;if(a)for(var r=void 0,v=0;vt.maxLineLength&&(t.maxLineLength=v,t.maxLine=r)})}var Hn=function(e,t,a){this.text=e,kn(this,t),this.height=a?a(this):1};Hn.prototype.lineNo=function(){return on(this)},ue(Hn);function Qr(e,t,a,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ir(e),kn(e,a);var v=r?r(e):1;v!=e.height&&cn(e,v)}function Lt(e){e.parent=null,ir(e)}var Ft={},It={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var a=t.addModeClass?It:Ft;return a[e]||(a[e]=e.replace(/\S+/g,"cm-$&"))}function Mn(e,t){var a=C("span",null,null,n?"padding-right: .1px":null),r={pre:C("pre",[a],"CodeMirror-line"),content:a,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var v=0;v<=(t.rest?t.rest.length:0);v++){var F=v?t.rest[v-1]:t.line,Z=void 0;r.pos=0,r.addToken=Vn,mn(e.display.measure)&&(Z=lt(F,e.doc.direction))&&(r.addToken=mi(r.addToken,Z)),r.map=[];var ee=t!=e.display.externalMeasured&&on(F);Wi(F,r,ea(e,F,ee)),F.styleClasses&&(F.styleClasses.bgClass&&(r.bgClass=T(F.styleClasses.bgClass,r.bgClass||"")),F.styleClasses.textClass&&(r.textClass=T(F.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Rt(e.display.measure))),v==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 re=r.content.lastChild;(/\bcm-tab\b/.test(re.className)||re.querySelector&&re.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=T(r.pre.className,r.textClass||"")),r}function wn(e){var t=c("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Vn(e,t,a,r,v,F,Z){if(!t)return;var ee=e.splitSpaces?sr(t,e.trailingSpace):t,re=e.cm.state.specialChars,de=!1,Ie;if(!re.test(t))e.col+=t.length,Ie=document.createTextNode(ee),e.map.push(e.pos,e.pos+t.length,Ie),G&&K<9&&(de=!0),e.pos+=t.length;else{Ie=document.createDocumentFragment();for(var Ne=0;;){re.lastIndex=Ne;var Xe=re.exec(t),ze=Xe?Xe.index-Ne:t.length-Ne;if(ze){var at=document.createTextNode(ee.slice(Ne,Ne+ze));G&&K<9?Ie.appendChild(c("span",[at])):Ie.appendChild(at),e.map.push(e.pos,e.pos+ze,at),e.col+=ze,e.pos+=ze}if(!Xe)break;Ne+=ze+1;var dt=void 0;if(Xe[0]==" "){var Et=e.cm.options.tabSize,At=Et-e.col%Et;dt=Ie.appendChild(c("span",V(At),"cm-tab")),dt.setAttribute("role","presentation"),dt.setAttribute("cm-text"," "),e.col+=At}else Xe[0]=="\r"||Xe[0]==` `?(dt=Ie.appendChild(c("span",Xe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),dt.setAttribute("cm-text",Xe[0]),e.col+=1):(dt=e.cm.options.specialCharPlaceholder(Xe[0]),dt.setAttribute("cm-text",Xe[0]),G&&K<9?Ie.appendChild(c("span",[dt])):Ie.appendChild(dt),e.col+=1);e.map.push(e.pos,e.pos+1,dt),e.pos++}}if(e.trailingSpace=ee.charCodeAt(t.length-1)==32,a||r||v||de||F||Z){var Wt=a||"";r&&(Wt+=r),v&&(Wt+=v);var Ot=c("span",[Ie],Wt,F);if(Z)for(var Gt in Z)Z.hasOwnProperty(Gt)&&Gt!="style"&&Gt!="class"&&Ot.setAttribute(Gt,Z[Gt]);return e.content.appendChild(Ot)}e.content.appendChild(Ie)}function sr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var a=t,r="",v=0;vde&&Ne.from<=de);Xe++);if(Ne.to>=Ie)return e(a,r,v,F,Z,ee,re);e(a,r.slice(0,Ne.to-de),v,F,null,ee,re),F=null,r=r.slice(Ne.to-de),de=Ne.to}}}function Gn(e,t,a,r){var v=!r&&a.widgetNode;v&&e.map.push(e.pos,e.pos+t,v),!r&&e.cm.display.input.needsContentAttribute&&(v||(v=e.content.appendChild(document.createElement("span"))),v.setAttribute("cm-marker",a.id)),v&&(e.cm.display.input.setUneditable(v),e.content.appendChild(v)),e.pos+=t,e.trailingSpace=!1}function Wi(e,t,a){var r=e.markedSpans,v=e.text,F=0;if(!r){for(var Z=1;Zre||Jn.collapsed&&rn.to==re&&rn.from==re)){if(rn.to!=null&&rn.to!=re&&ze>rn.to&&(ze=rn.to,dt=""),Jn.className&&(at+=" "+Jn.className),Jn.css&&(Xe=(Xe?Xe+";":"")+Jn.css),Jn.startStyle&&rn.from==re&&(Et+=" "+Jn.startStyle),Jn.endStyle&&rn.to==ze&&(Gt||(Gt=[])).push(Jn.endStyle,rn.to),Jn.title&&((Wt||(Wt={})).title=Jn.title),Jn.attributes)for(var Dr in Jn.attributes)(Wt||(Wt={}))[Dr]=Jn.attributes[Dr];Jn.collapsed&&(!At||Sn(At.marker,Jn)<0)&&(At=rn)}else rn.from>re&&ze>rn.from&&(ze=rn.from)}if(Gt)for(var hi=0;hi=ee)break;for(var Ui=Math.min(ee,ze);;){if(Ie){var Ii=re+Ie.length;if(!At){var ni=Ii>Ui?Ie.slice(0,Ui-re):Ie;t.addToken(t,ni,Ne?Ne+at:at,Et,re+ni.length==ze?dt:"",Xe,Wt)}if(Ii>=Ui){Ie=Ie.slice(Ui-re),re=Ui;break}re=Ii,Et=""}Ie=v.slice(F,F=a[de++]),Ne=Jt(a[de++],t.cm.options)}}}function lr(e,t,a){this.line=t,this.rest=pn(t),this.size=this.rest?on(P(this.rest))-a+1:1,this.node=this.text=null,this.hidden=kr(e,t)}function ii(e,t,a){for(var r=[],v,F=t;F2&&F.push((re.bottom+de.top)/2-a.top)}}F.push(a.bottom-a.top)}}function fe(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;ra)return{map:e.measure.maps[v],cache:e.measure.caches[v],before:!0}}function Le(e,t){t=fn(t);var a=on(t),r=e.display.externalMeasured=new lr(e.doc,t,a);r.lineN=a;var v=r.built=Mn(e,r);return r.text=v.pre,d(e.display.lineMeasure,v.pre),r}function Ce(e,t,a,r){return Ge(e,Be(e,t),a,r)}function Fe(e,t){if(t>=e.display.viewFrom&&t=a.lineN&&tt)&&(F=re-ee,v=F-1,t>=re&&(Z="right")),v!=null){if(r=e[de+2],ee==re&&a==(r.insertLeft?"left":"right")&&(Z=a),a=="left"&&v==0)for(;de&&e[de-2]==e[de-3]&&e[de-1].insertLeft;)r=e[(de-=3)+2],Z="left";if(a=="right"&&v==re-ee)for(;de=0&&!((a=e[v]).left!=a.right);v--);return a}function Ct(e,t,a,r){var v=ut(t.map,a,r),F=v.node,Z=v.start,ee=v.end,re=v.collapse,de;if(F.nodeType==3){for(var Ie=0;Ie<4;Ie++){for(;Z&&ke(t.line.text.charAt(v.coverStart+Z));)--Z;for(;v.coverStart+ee0&&(re=r="right");var Ne;e.options.lineWrapping&&(Ne=F.getClientRects()).length>1?de=Ne[r=="right"?Ne.length-1:0]:de=F.getBoundingClientRect()}if(G&&K<9&&!Z&&(!de||!de.left&&!de.right)){var Xe=F.parentNode.getClientRects()[0];Xe?de={left:Xe.left,right:Xe.left+Fr(e.display),top:Xe.top,bottom:Xe.bottom}:de=Ze}for(var ze=de.top-t.rect.top,at=de.bottom-t.rect.top,dt=(ze+at)/2,Et=t.view.measure.heights,At=0;At=r.text.length?(re=r.text.length,de="before"):re<=0&&(re=0,de="after"),!ee)return Z(de=="before"?re-1:re,de=="before");function Ie(at,dt,Et){var At=ee[dt],Wt=At.level==1;return Z(Et?at-1:at,Wt!=Et)}var Ne=qe(ee,re,de),Xe=ot,ze=Ie(re,Ne,de=="before");return Xe!=null&&(ze.other=Ie(re,Xe,de!="before")),ze}function nn(e,t){var a=0;t=En(e.doc,t),e.options.lineWrapping||(a=Fr(e.display)*t.ch);var r=wt(e.doc,t.line),v=St(r)+ma(e.display);return{left:a,right:a,top:v,bottom:v+r.height}}function qt(e,t,a,r,v){var F=ct(e,t,a);return F.xRel=v,r&&(F.outside=r),F}function In(e,t,a){var r=e.doc;if(a+=e.display.viewOffset,a<0)return qt(r.first,0,null,-1,-1);var v=Dn(r,a),F=r.first+r.size-1;if(v>F)return qt(r.first+r.size-1,wt(r,F).text.length,null,1,1);t<0&&(t=0);for(var Z=wt(r,v);;){var ee=Rr(e,Z,v,t,a),re=je(Z,ee.ch+(ee.xRel>0||ee.outside>0?1:0));if(!re)return ee;var de=re.find(1);if(de.line==v)return de;Z=wt(r,v=de.line)}}function nr(e,t,a,r){r-=Ln(t);var v=t.text.length,F=Qe(function(Z){return Ge(e,a,Z-1).bottom<=r},v,0);return v=Qe(function(Z){return Ge(e,a,Z).top>r},F,v),{begin:F,end:v}}function Kt(e,t,a,r){a||(a=Be(e,t));var v=zn(e,t,Ge(e,a,r),"line").top;return nr(e,t,a,v)}function rr(e,t,a,r){return e.bottom<=a?!1:e.top>a?!0:(r?e.left:e.right)>t}function Rr(e,t,a,r,v){v-=St(t);var F=Be(e,t),Z=Ln(t),ee=0,re=t.text.length,de=!0,Ie=lt(t,e.doc.direction);if(Ie){var Ne=(e.options.lineWrapping?_r:Zn)(e,t,a,F,Ie,r,v);de=Ne.level!=1,ee=de?Ne.from:Ne.to-1,re=de?Ne.to:Ne.from-1}var Xe=null,ze=null,at=Qe(function(vn){var rn=Ge(e,F,vn);return rn.top+=Z,rn.bottom+=Z,rr(rn,r,v,!1)?(rn.top<=v&&rn.left<=r&&(Xe=vn,ze=rn),!0):!1},ee,re),dt,Et,At=!1;if(ze){var Wt=r-ze.left=Gt.bottom?1:0}return at=Ue(t.text,at,1),qt(a,at,Et,At,r-dt)}function Zn(e,t,a,r,v,F,Z){var ee=Qe(function(Ne){var Xe=v[Ne],ze=Xe.level!=1;return rr(Yn(e,ct(a,ze?Xe.to:Xe.from,ze?"before":"after"),"line",t,r),F,Z,!0)},0,v.length-1),re=v[ee];if(ee>0){var de=re.level!=1,Ie=Yn(e,ct(a,de?re.from:re.to,de?"after":"before"),"line",t,r);rr(Ie,F,Z,!0)&&Ie.top>Z&&(re=v[ee-1])}return re}function _r(e,t,a,r,v,F,Z){var ee=nr(e,t,r,Z),re=ee.begin,de=ee.end;/\s/.test(t.text.charAt(de-1))&&de--;for(var Ie=null,Ne=null,Xe=0;Xe=de||ze.to<=re)continue;var at=ze.level!=1,dt=Ge(e,r,at?Math.min(de,ze.to)-1:Math.max(re,ze.from)).right,Et=dtEt)&&(Ie=ze,Ne=Et)}return Ie||(Ie=v[v.length-1]),Ie.fromde&&(Ie={from:Ie.from,to:de,level:Ie.level}),Ie}var mr;function Nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(mr==null){mr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)mr.appendChild(document.createTextNode("x")),mr.appendChild(c("br"));mr.appendChild(document.createTextNode("x"))}d(e.measure,mr);var a=mr.offsetHeight/50;return a>3&&(e.cachedTextHeight=a),_(e.measure),a||1}function Fr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),a=c("pre",[t],"CodeMirror-line-like");d(e.measure,a);var r=t.getBoundingClientRect(),v=(r.right-r.left)/10;return v>2&&(e.cachedCharWidth=v),v||10}function Lr(e){for(var t=e.display,a={},r={},v=t.gutters.clientLeft,F=t.gutters.firstChild,Z=0;F;F=F.nextSibling,++Z){var ee=e.display.gutterSpecs[Z].className;a[ee]=F.offsetLeft+F.clientLeft+v,r[ee]=F.clientWidth}return{fixedPos:li(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:a,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function li(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ti(e){var t=Nr(e.display),a=e.options.lineWrapping,r=a&&Math.max(5,e.display.scroller.clientWidth/Fr(e.display)-3);return function(v){if(kr(e.doc,v))return 0;var F=0;if(v.widgets)for(var Z=0;Z0&&(de=wt(e.doc,re.line).text).length==re.ch){var Ie=H(de,de.length,e.options.tabSize)-de.length;re=ct(re.line,Math.max(0,Math.round((F-Me(e.display).left)/Fr(e.display))-Ie))}return re}function wr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var a=e.display.view,r=0;rt)&&(v.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=v.viewTo)Zt&&Yr(e.doc,t)v.viewFrom?vr(e):(v.viewFrom+=r,v.viewTo+=r);else if(t<=v.viewFrom&&a>=v.viewTo)vr(e);else if(t<=v.viewFrom){var F=Oi(e,a,a+r,1);F?(v.view=v.view.slice(F.index),v.viewFrom=F.lineN,v.viewTo+=r):vr(e)}else if(a>=v.viewTo){var Z=Oi(e,t,t,-1);Z?(v.view=v.view.slice(0,Z.index),v.viewTo=Z.lineN):vr(e)}else{var ee=Oi(e,t,t,-1),re=Oi(e,a,a+r,1);ee&&re?(v.view=v.view.slice(0,ee.index).concat(ii(e,ee.lineN,re.lineN)).concat(v.view.slice(re.index)),v.viewTo+=r):vr(e)}var de=v.externalMeasured;de&&(a=v.lineN&&t=r.viewTo)return;var F=r.view[wr(e,t)];if(F.node==null)return;var Z=F.changes||(F.changes=[]);te(Z,a)==-1&&Z.push(a)}function vr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Oi(e,t,a,r){var v=wr(e,t),F,Z=e.display.view;if(!Zt||a==e.doc.first+e.doc.size)return{index:v,lineN:a};for(var ee=e.display.viewFrom,re=0;re0){if(v==Z.length-1)return null;F=ee+Z[v].size-t,v++}else F=ee-t;t+=F,a+=F}for(;Yr(e.doc,a)!=a;){if(v==(r<0?0:Z.length-1))return null;a+=r*Z[v-(r<0?1:0)].size,v+=r}return{index:v,lineN:a}}function Hi(e,t,a){var r=e.display,v=r.view;v.length==0||t>=r.viewTo||a<=r.viewFrom?(r.view=ii(e,t,a),r.viewFrom=t):(r.viewFrom>t?r.view=ii(e,t,r.viewFrom).concat(r.view):r.viewFroma&&(r.view=r.view.slice(0,wr(e,a)))),r.viewTo=a}function $i(e){for(var t=e.display.view,a=0,r=0;r=e.display.viewTo||ee.to().line0?t.blinker=setInterval(function(){e.hasFocus()||ga(e),t.cursorDiv.style.visibility=(a=!a)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Na(e){e.state.focused||(e.display.input.focus(),na(e))}function Za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ga(e))},100)}function na(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(me(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()),Pr(e)}function ga(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,g(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zr(e){for(var t=e.display,a=t.lineDiv.offsetTop,r=0;r.005||Ie<-.005)&&(cn(v.line,Z),Ni(v.line),v.rest))for(var Ne=0;Nee.display.sizerWidth){var Xe=Math.ceil(ee/Fr(e.display));Xe>e.display.maxLineLength&&(e.display.maxLineLength=Xe,e.display.maxLine=v.line,e.display.maxLineChanged=!0)}}}function Ni(e){if(e.widgets)for(var t=0;t=Z&&(F=Dn(t,St(wt(t,re))-e.wrapper.clientHeight),Z=re)}return{from:F,to:Math.max(Z,F+1)}}function Io(e,t){if(ne(e,"scrollCursorIntoView"))return;var a=e.display,r=a.sizer.getBoundingClientRect(),v=null;if(t.top+r.top<0?v=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(v=!1),v!=null&&!o){var F=c("div","\u200B",null,`position: absolute; top: `+(t.top-a.viewOffset-ma(e.display))+`px; height: `+(t.bottom-t.top+He(e)+a.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(v),e.display.lineSpace.removeChild(F)}}function Po(e,t,a,r){r==null&&(r=0);var v;!e.options.lineWrapping&&t==a&&(t=t.ch?ct(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,a=t.sticky=="before"?ct(t.line,t.ch+1,"before"):t);for(var F=0;F<5;F++){var Z=!1,ee=Yn(e,t),re=!a||a==t?ee:Yn(e,a);v={left:Math.min(ee.left,re.left),top:Math.min(ee.top,re.top)-r,right:Math.max(ee.left,re.left),bottom:Math.max(ee.bottom,re.bottom)+r};var de=Ja(e,v),Ie=e.doc.scrollTop,Ne=e.doc.scrollLeft;if(de.scrollTop!=null&&(ia(e,de.scrollTop),Math.abs(e.doc.scrollTop-Ie)>1&&(Z=!0)),de.scrollLeft!=null&&(wi(e,de.scrollLeft),Math.abs(e.doc.scrollLeft-Ne)>1&&(Z=!0)),!Z)break}return v}function mo(e,t){var a=Ja(e,t);a.scrollTop!=null&&ia(e,a.scrollTop),a.scrollLeft!=null&&wi(e,a.scrollLeft)}function Ja(e,t){var a=e.display,r=Nr(e.display);t.top<0&&(t.top=0);var v=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:a.scroller.scrollTop,F=le(e),Z={};t.bottom-t.top>F&&(t.bottom=t.top+F);var ee=e.doc.height+Ae(a),re=t.topee-r;if(t.topv+F){var Ie=Math.min(t.top,(de?ee:t.bottom)-F);Ie!=v&&(Z.scrollTop=Ie)}var Ne=e.options.fixedGutter?0:a.gutters.offsetWidth,Xe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:a.scroller.scrollLeft-Ne,ze=De(e)-a.gutters.offsetWidth,at=t.right-t.left>ze;return at&&(t.right=t.left+ze),t.left<10?Z.scrollLeft=0:t.leftze+Xe-3&&(Z.scrollLeft=t.right+(at?0:10)-ze),Z}function qa(e,t){if(t==null)return;ja(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function ra(e){ja(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function va(e,t,a){(t!=null||a!=null)&&ja(e),t!=null&&(e.curOp.scrollLeft=t),a!=null&&(e.curOp.scrollTop=a)}function go(e,t){ja(e),e.curOp.scrollToPos=t}function ja(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var a=nn(e,t.from),r=nn(e,t.to);ya(e,a,r,t.margin)}}function ya(e,t,a,r){var v=Ja(e,{left:Math.min(t.left,a.left),top:Math.min(t.top,a.top)-r,right:Math.max(t.right,a.right),bottom:Math.max(t.bottom,a.bottom)+r});va(e,v.scrollLeft,v.scrollTop)}function ia(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;N||Sa(e,{top:t}),Cr(e,t,!0),N&&Sa(e),Ca(e,100)}function Cr(e,t,a){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!a)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function wi(e,t,a,r){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(a?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)return;e.doc.scrollLeft=t,er(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function aa(e){var t=e.display,a=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ae(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?a:0,docHeight:r,scrollHeight:r+He(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:a}}var Qi=function(e,t,a){this.cm=a;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),v=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=v.tabIndex=-1,e(r),e(v),Ye(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ye(v,"scroll",function(){v.clientWidth&&t(v.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&K<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Qi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,a=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(a){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var v=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+v)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=a?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(a?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+F)+"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:a?r:0,bottom:t?r:0}},Qi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Qi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Qi.prototype.zeroWidthHack=function(){var e=s&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Q,this.disableVert=new Q},Qi.prototype.enableZeroWidthBar=function(e,t,a){e.style.pointerEvents="auto";function r(){var v=e.getBoundingClientRect(),F=a=="vert"?document.elementFromPoint(v.right-1,(v.top+v.bottom)/2):document.elementFromPoint((v.right+v.left)/2,v.bottom-1);F!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Qi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wa=function(){};wa.prototype.update=function(){return{bottom:0,right:0}},wa.prototype.setScrollLeft=function(){},wa.prototype.setScrollTop=function(){},wa.prototype.clear=function(){};function oa(e,t){t||(t=aa(e));var a=e.display.barWidth,r=e.display.barHeight;Ba(e,t);for(var v=0;v<4&&a!=e.display.barWidth||r!=e.display.barHeight;v++)a!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Ba(e,aa(e)),a=e.display.barWidth,r=e.display.barHeight}function Ba(e,t){var a=e.display,r=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=r.right)+"px",a.sizer.style.paddingBottom=(a.barHeight=r.bottom)+"px",a.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(a.scrollbarFiller.style.display="block",a.scrollbarFiller.style.height=r.bottom+"px",a.scrollbarFiller.style.width=r.right+"px"):a.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(a.gutterFiller.style.display="block",a.gutterFiller.style.height=r.bottom+"px",a.gutterFiller.style.width=t.gutterWidth+"px"):a.gutterFiller.style.display=""}var eo={native:Qi,null:wa};function Fa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&g(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),Ye(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,a){a=="horizontal"?wi(e,t):ia(e,t)},e),e.display.scrollbars.addClass&&W(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function Gi(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},Ai(e.curOp)}function Zi(e){var t=e.curOp;t&&Lo(t,function(a){for(var r=0;r=a.viewTo)||a.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ci(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ko(e){e.updatedDisplay=e.mustUpdate&&sa(e.cm,e.update)}function Mo(e){var t=e.cm,a=t.display;e.updatedDisplay&&zr(t),e.barMeasure=aa(t),a.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ce(t,a.maxLine,a.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(a.scroller.clientWidth,a.sizer.offsetLeft+e.adjustWidthTo+He(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,a.sizer.offsetLeft+e.adjustWidthTo-De(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=a.input.prepareSelection())}function io(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var a=+new Date+e.options.workTime,r=pi(e,t.highlightFrontier),v=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(F){if(r.line>=e.display.viewFrom){var Z=F.styles,ee=F.text.length>e.options.maxHighlightLength?Cn(t.mode,r.state):null,re=ba(e,F,r,!0);ee&&(r.state=ee),F.styles=re.styles;var de=F.styleClasses,Ie=re.classes;Ie?F.styleClasses=Ie:de&&(F.styleClasses=null);for(var Ne=!Z||Z.length!=F.styles.length||de!=Ie&&(!de||!Ie||de.bgClass!=Ie.bgClass||de.textClass!=Ie.textClass),Xe=0;!Ne&&Xea)return Ca(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),v.length&&Vr(e,function(){for(var F=0;F=a.viewFrom&&t.visible.to<=a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&$i(e)==0)return!1;ti(e)&&(vr(e),t.dims=Lr(e));var v=r.first+r.size,F=Math.max(t.visible.from-e.options.viewportMargin,r.first),Z=Math.min(v,t.visible.to+e.options.viewportMargin);a.viewFromZ&&a.viewTo-Z<20&&(Z=Math.min(v,a.viewTo)),Zt&&(F=Yr(e.doc,F),Z=$r(e.doc,Z));var ee=F!=a.viewFrom||Z!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth;Hi(e,F,Z),a.viewOffset=St(wt(e.doc,a.viewFrom)),e.display.mover.style.top=a.viewOffset+"px";var re=$i(e);if(!ee&&re==0&&!t.force&&a.renderedView==a.view&&(a.updateLineNumbers==null||a.updateLineNumbers>=a.viewTo))return!1;var de=Ha(e);return re>4&&(a.lineDiv.style.display="none"),yo(e,a.updateLineNumbers,t.dims),re>4&&(a.lineDiv.style.display=""),a.renderedView=a.view,vo(de),_(a.cursorDiv),_(a.selectionDiv),a.gutters.style.height=a.sizer.style.minHeight=0,ee&&(a.lastWrapHeight=t.wrapperHeight,a.lastWrapWidth=t.wrapperWidth,Ca(e,400)),a.updateLineNumbers=null,!0}function Ka(e,t){for(var a=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==De(e)){if(a&&a.top!=null&&(a={top:Math.min(e.doc.height+Ae(e.display)-le(e),a.top)}),t.visible=Ua(e.display,e.doc,a),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ua(e.display,e.doc,a));if(!sa(e,t))break;zr(e);var v=aa(e);yr(e),oa(e,v),dr(e,v),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 Sa(e,t){var a=new Ci(e,t);if(sa(e,a)){zr(e),Ka(e,a);var r=aa(e);yr(e),oa(e,r),dr(e,r),a.finish()}}function yo(e,t,a){var r=e.display,v=e.options.lineNumbers,F=r.lineDiv,Z=F.firstChild;function ee(at){var dt=at.nextSibling;return n&&s&&e.display.currentWheelTarget==at?at.style.display="none":at.parentNode.removeChild(at),dt}for(var re=r.view,de=r.viewFrom,Ie=0;Ie-1&&(ze=!1),uo(e,Ne,de,a)),ze&&(_(Ne.lineNumber),Ne.lineNumber.appendChild(document.createTextNode(Tr(e.options,de)))),Z=Ne.node.nextSibling}de+=Ne.size}for(;Z;)Z=ee(Z)}function Ga(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function dr(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+He(e)+"px"}function er(e){var t=e.display,a=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var r=li(t)-t.scroller.scrollLeft+e.doc.scrollLeft,v=t.gutters.offsetWidth,F=r+"px",Z=0;ZZ.clientWidth,re=Z.scrollHeight>Z.clientHeight;if(!(r&&ee||v&&re))return;if(v&&s&&n){e:for(var de=t.target,Ie=F.view;de!=Z;de=de.parentNode)for(var Ne=0;Ne=0&&Qt(e,r.to())<=0)return a}return-1};var tt=function(e,t){this.anchor=e,this.head=t};tt.prototype.from=function(){return Bi(this.anchor,this.head)},tt.prototype.to=function(){return ua(this.anchor,this.head)},tt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function rt(e,t,a){var r=e&&e.options.selectionsMayTouch,v=t[a];t.sort(function(Xe,ze){return Qt(Xe.from(),ze.from())}),a=te(t,v);for(var F=1;F0:re>=0){var de=Bi(ee.from(),Z.from()),Ie=ua(ee.to(),Z.to()),Ne=ee.empty()?Z.from()==Z.head:ee.from()==ee.head;F<=a&&--a,t.splice(--F,2,new tt(Ne?Ie:de,Ne?de:Ie))}}return new Ve(t,a)}function vt(e,t){return new Ve([new tt(e,t||e)],0)}function gt(e){return e.text?ct(e.from.line+e.text.length-1,P(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function mt(e,t){if(Qt(e,t.from)<0)return e;if(Qt(e,t.to)<=0)return gt(t);var a=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=gt(t).ch-t.to.ch),ct(a,r)}function $t(e,t){for(var a=[],r=0;r1&&e.remove(ee.line+1,at-1),e.insert(ee.line+1,At)}Mr(e,"change",e,t)}function bi(e,t,a){function r(v,F,Z){if(v.linked)for(var ee=0;ee1&&!e.done[e.done.length-2].ranges)return e.done.pop(),P(e.done)}function Es(e,t,a,r){var v=e.history;v.undone.length=0;var F=+new Date,Z,ee;if((v.lastOp==r||v.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&v.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(Z=pl(v,v.lastOp==r)))ee=P(Z.changes),Qt(t.from,t.to)==0&&Qt(t.from,ee.to)==0?ee.to=gt(t):Z.changes.push(Di(e,t));else{var re=P(v.done);for((!re||!re.ranges)&&Qo(e.sel,v.done),Z={changes:[Di(e,t)],generation:v.generation},v.done.push(Z);v.done.length>v.undoDepth;)v.done.shift(),v.done[0].ranges||v.done.shift()}v.done.push(a),v.generation=++v.maxGeneration,v.lastModTime=v.lastSelTime=F,v.lastOp=v.lastSelOp=r,v.lastOrigin=v.lastSelOrigin=t.origin,ee||me(e,"historyAdded")}function ml(e,t,a,r){var v=t.charAt(0);return v=="*"||v=="+"&&a.ranges.length==r.ranges.length&&a.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,a,r){var v=e.history,F=r&&r.origin;a==v.lastSelOp||F&&v.lastSelOrigin==F&&(v.lastModTime==v.lastSelTime&&v.lastOrigin==F||ml(e,F,P(v.done),t))?v.done[v.done.length-1]=t:Qo(t,v.done),v.lastSelTime=+new Date,v.lastSelOrigin=F,v.lastSelOp=a,r&&r.clearRedo!==!1&&_o(v.undone)}function Qo(e,t){var a=P(t);a&&a.ranges&&a.equals(e)||t.push(e)}function xs(e,t,a,r){var v=t["spans_"+e.id],F=0;e.iter(Math.max(e.first,a),Math.min(e.first+e.size,r),function(Z){Z.markedSpans&&((v||(v=t["spans_"+e.id]={}))[F]=Z.markedSpans),++F})}function vl(e){if(!e)return null;for(var t,a=0;a-1&&(P(ee)[Ne]=de[Ne],delete de[Ne]))}}return r}function ls(e,t,a,r){if(r){var v=e.anchor;if(a){var F=Qt(t,v)<0;F!=Qt(a,v)<0?(v=t,t=a):F!=Qt(t,a)<0&&(t=a)}return new tt(v,t)}else return new tt(a||t,t)}function Zo(e,t,a,r,v){v==null&&(v=e.cm&&(e.cm.display.shift||e.extend)),Ei(e,new Ve([ls(e.sel.primary(),t,a,v)],0),r)}function ws(e,t,a){for(var r=[],v=e.cm&&(e.cm.display.shift||e.extend),F=0;F=t.ch:ee.to>t.ch))){if(v&&(me(re,"beforeCursorEnter"),re.explicitlyCleared))if(F.markedSpans){--Z;continue}else break;if(!re.atomic)continue;if(a){var Ne=re.find(r<0?1:-1),Xe=void 0;if((r<0?Ie:de)&&(Ne=Ds(e,Ne,-r,Ne&&Ne.line==t.line?F:null)),Ne&&Ne.line==t.line&&(Xe=Qt(Ne,a))&&(r<0?Xe<0:Xe>0))return Eo(e,Ne,t,r,v)}var ze=re.find(r<0?-1:1);return(r<0?de:Ie)&&(ze=Ds(e,ze,r,ze.line==t.line?F:null)),ze?Eo(e,ze,t,r,v):null}}return t}function qo(e,t,a,r,v){var F=r||1,Z=Eo(e,t,a,F,v)||!v&&Eo(e,t,a,F,!0)||Eo(e,t,a,-F,v)||!v&&Eo(e,t,a,-F,!0);return Z||(e.cantEdit=!0,ct(e.first,0))}function Ds(e,t,a,r){return a<0&&t.ch==0?t.line>e.first?En(e,ct(t.line-1)):null:a>0&&t.ch==(r||wt(e,t.line)).text.length?t.line=0;--v)Ps(e,{from:r[v].from,to:r[v].to,text:v?[""]:t.text,origin:t.origin});else Ps(e,t)}function Ps(e,t){if(t.text.length==1&&t.text[0]==""&&Qt(t.from,t.to)==0)return;var a=$t(e,t);Es(e,t,a,e.cm?e.cm.curOp.id:NaN),Uo(e,t,a,Wn(e,t));var r=[];bi(e,function(v,F){!F&&te(r,v.history)==-1&&(Us(v.history,t),r.push(v.history)),Uo(v,t,null,Wn(v,t))})}function es(e,t,a){var r=e.cm&&e.cm.state.suppressEdits;if(r&&!a)return;for(var v=e.history,F,Z=e.sel,ee=t=="undo"?v.done:v.undone,re=t=="undo"?v.undone:v.done,de=0;de=0;--ze){var at=Xe(ze);if(at)return at.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ve(j(e.sel.ranges,function(v){return new tt(ct(v.anchor.line+t,v.anchor.ch),ct(v.head.line+t,v.head.ch))}),e.sel.primIndex),e.cm){gr(e.cm,e.first,e.first-t,t);for(var a=e.cm.display,r=a.viewFrom;re.lastLine())return;if(t.from.lineF&&(t={from:t.from,to:ct(F,wt(e,F).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Rn(e,t.from,t.to),a||(a=$t(e,t)),e.cm?bl(e.cm,t,r):oi(e,t,r),Jo(e,a,_e),e.cantEdit&&qo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,a){var r=e.doc,v=e.display,F=t.from,Z=t.to,ee=!1,re=F.line;e.options.lineWrapping||(re=on(fn(wt(r,F.line))),r.iter(re,Z.line+1,function(ze){if(ze==v.maxLine)return ee=!0,!0})),r.sel.contains(t.from,t.to)>-1&&q(e),oi(r,t,a,Ti(e)),e.options.lineWrapping||(r.iter(re,F.line+t.text.length,function(ze){var at=pr(ze);at>v.maxLineLength&&(v.maxLine=ze,v.maxLineLength=at,v.maxLineChanged=!0,ee=!1)}),ee&&(e.curOp.updateMaxLine=!0)),xt(r,F.line),Ca(e,400);var de=t.text.length-(Z.line-F.line)-1;t.full?gr(e):F.line==Z.line&&t.text.length==1&&!di(e.doc,t)?ln(e,F.line,"text"):gr(e,F.line,Z.line+1,de);var Ie=se(e,"changes"),Ne=se(e,"change");if(Ne||Ie){var Xe={from:F,to:Z,text:t.text,removed:t.removed,origin:t.origin};Ne&&Mr(e,"change",e,Xe),Ie&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Xe)}e.display.selForContextMenu=null}function To(e,t,a,r,v){var F;r||(r=a),Qt(r,a)<0&&(F=[r,a],a=F[0],r=F[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:a,to:r,text:t,origin:v})}function Ms(e,t,a,r){a1||!(this.children[0]instanceof Bo))){var ee=[];this.collapse(ee),this.children=[new Bo(ee)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var Z=v.lines.length%25+25,ee=Z;ee10);e.parent.maybeSpill()},iterN:function(e,t,a){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=de,e.display.maxLineLength=Ie,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&gr(e,r,v+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Mr(e,"markerCleared",e,this,r,v),t&&Zi(e),this.parent&&this.parent.clear()},za.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var a,r,v=0;v0||Z==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=C("span",[F.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(Yt(e,t.line,t,a,F)||t.line!=a.line&&Yt(e,a.line,t,a,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");Tn()}F.addToHistory&&Es(e,{from:t,to:a,origin:"markText"},e.sel,NaN);var ee=t.line,re=e.cm,de;if(e.iter(ee,a.line+1,function(Ne){re&&F.collapsed&&!re.options.lineWrapping&&fn(Ne)==re.display.maxLine&&(de=!0),F.collapsed&&ee!=t.line&&cn(Ne,0),tn(Ne,new en(F,ee==t.line?t.ch:null,ee==a.line?a.ch:null)),++ee}),F.collapsed&&e.iter(t.line,a.line+1,function(Ne){kr(e,Ne)&&cn(Ne,0)}),F.clearOnEnter&&Ye(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(yn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++Bs,F.atomic=!0),re){if(de&&(re.curOp.updateMaxLine=!0),F.collapsed)gr(re,t.line,a.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var Ie=t.line;Ie<=a.line;Ie++)ln(re,Ie,"text");F.atomic&&Os(re.doc),Mr(re,"markerAdded",re,F)}return F}var Ho=function(e,t){this.markers=e,this.primary=t;for(var a=0;a=0;re--)xo(this,r[re]);ee?Ss(this,ee):this.cm&&ra(this.cm)}),undo:Kr(function(){es(this,"undo")}),redo:Kr(function(){es(this,"redo")}),undoSelection:Kr(function(){es(this,"undo",!0)}),redoSelection:Kr(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,a=0,r=0;r=e.ch)&&t.push(v.marker.parent||v.marker)}return t},findMarks:function(e,t,a){e=En(this,e),t=En(this,t);var r=[],v=e.line;return this.iter(e.line,t.line+1,function(F){var Z=F.markedSpans;if(Z)for(var ee=0;ee=re.to||re.from==null&&v!=e.line||re.from!=null&&v==t.line&&re.from>=t.ch)&&(!a||a(re.marker))&&r.push(re.marker.parent||re.marker)}++v}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var a=t.markedSpans;if(a)for(var r=0;re)return t=e,!0;e-=F,++a}),En(this,ct(a,t))},indexFromPos:function(e){e=En(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var Ie=e.dataTransfer.getData("Text");if(Ie){var Ne;if(t.state.draggingText&&!t.state.draggingText.copy&&(Ne=t.listSelections()),Jo(t.doc,vt(a,a)),Ne)for(var Xe=0;Xe=0;ee--)To(e.doc,"",r[ee].from,r[ee].to,"+delete");ra(e)})}function cs(e,t,a){var r=Ue(e.text,t+a,a);return r<0||r>e.text.length?null:r}function ds(e,t,a){var r=cs(e,t.ch,a);return r==null?null:new ct(t.line,r,a<0?"after":"before")}function hs(e,t,a,r,v){if(e){t.doc.direction=="rtl"&&(v=-v);var F=lt(a,t.doc.direction);if(F){var Z=v<0?P(F):F[0],ee=v<0==(Z.level==1),re=ee?"after":"before",de;if(Z.level>0||t.doc.direction=="rtl"){var Ie=Be(t,a);de=v<0?a.text.length-1:0;var Ne=Ge(t,Ie,de).top;de=Qe(function(Xe){return Ge(t,Ie,Xe).top==Ne},v<0==(Z.level==1)?Z.from:Z.to-1,de),re=="before"&&(de=cs(a,de,1))}else de=v<0?Z.to:Z.from;return new ct(r,de,re)}}return new ct(r,v<0?a.text.length:0,v<0?"before":"after")}function kl(e,t,a,r){var v=lt(t,e.doc.direction);if(!v)return ds(t,a,r);a.ch>=t.text.length?(a.ch=t.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var F=qe(v,a.ch,a.sticky),Z=v[F];if(e.doc.direction=="ltr"&&Z.level%2==0&&(r>0?Z.to>a.ch:Z.from=Z.from&&Xe>=Ie.begin)){var ze=Ne?"before":"after";return new ct(a.line,Xe,ze)}}var at=function(At,Wt,Ot){for(var Gt=function(Dr,hi){return hi?new ct(a.line,ee(Dr,1),"before"):new ct(a.line,Dr,"after")};At>=0&&At0==(vn.level!=1),Jn=rn?Ot.begin:ee(Ot.end,-1);if(vn.from<=Jn&&Jn0?Ie.end:ee(Ie.begin,-1);return Et!=null&&!(r>0&&Et==t.text.length)&&(dt=at(r>0?0:v.length-1,r,de(Et)),dt)?dt:null}var zo={selectAll:Ls,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),_e)},killLine:function(e){return So(e,function(t){if(t.empty()){var a=wt(e.doc,t.head.line).text.length;return t.head.ch==a&&t.head.line0)v=new ct(v.line,v.ch+1),e.replaceRange(F.charAt(v.ch-1)+F.charAt(v.ch-2),ct(v.line,v.ch-2),v,"+transpose");else if(v.line>e.doc.first){var Z=wt(e.doc,v.line-1).text;Z&&(v=new ct(v.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+Z.charAt(Z.length-1),ct(v.line-1,Z.length-1),v,"+transpose"))}}a.push(new tt(v,v))}e.setSelections(a)})},newlineAndIndent:function(e){return Vr(e,function(){for(var t=e.listSelections(),a=t.length-1;a>=0;a--)e.replaceRange(e.doc.lineSeparator(),t[a].anchor,t[a].head,"+input");t=e.listSelections();for(var r=0;re&&Qt(t,this.pos)==0&&a==this.button};var Xo,Yo;function Wl(e,t){var a=+new Date;return Yo&&Yo.compare(a,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(a,e,t)?(Yo=new ps(a,e,t),Xo=null,"double"):(Xo=new ps(a,e,t),Yo=null,"single")}function tl(e){var t=this,a=t.display;if(ne(t,e)||a.activeTouch&&a.input.supportsTouch())return;if(a.input.ensurePolled(),a.shift=e.shiftKey,Yi(a,e)){n||(a.scroller.draggable=!1,setTimeout(function(){return a.scroller.draggable=!0},100));return}if(ms(t,e))return;var r=Wr(t,e),v=We(e),F=r?Wl(r,v):"single";if(window.focus(),v==1&&t.state.selectingText&&t.state.selectingText(e),r&&Hl(t,v,r,F,e))return;v==1?r?Gl(t,r,F,e):Pe(e)==a.scroller&&oe(e):v==2?(r&&Zo(t.doc,r),setTimeout(function(){return a.input.focus()},20)):v==3&&(R?t.display.input.onContextMenu(e):Za(t))}function Hl(e,t,a,r,v){var F="Click";return r=="double"?F="Double"+F:r=="triple"&&(F="Triple"+F),F=(t==1?"Left":t==2?"Middle":"Right")+F,Vo(e,Vs(F,v),v,function(Z){if(typeof Z=="string"&&(Z=zo[Z]),!Z)return!1;var ee=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ee=Z(e,a)!=Te}finally{e.state.suppressEdits=!1}return ee})}function Kl(e,t,a){var r=e.getOption("configureMouse"),v=r?r(e,t,a):{};if(v.unit==null){var F=i?a.shiftKey&&a.metaKey:a.altKey;v.unit=F?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(v.extend==null||e.doc.extend)&&(v.extend=e.doc.extend||a.shiftKey),v.addNew==null&&(v.addNew=s?a.metaKey:a.ctrlKey),v.moveOnDrag==null&&(v.moveOnDrag=!(s?a.altKey:a.ctrlKey)),v}function Gl(e,t,a,r){G?setTimeout(m(Na,e),0):e.curOp.focus=B();var v=Kl(e,a,r),F=e.doc.sel,Z;e.options.dragDrop&&et&&!e.isReadOnly()&&a=="single"&&(Z=F.contains(t))>-1&&(Qt((Z=F.ranges[Z]).from(),t)<0||t.xRel>0)&&(Qt(Z.to(),t)>0||t.xRel<0)?zl(e,r,t,v):Vl(e,r,t,v)}function zl(e,t,a,r){var v=e.display,F=!1,Z=Hr(e,function(de){n&&(v.scroller.draggable=!1),e.state.draggingText=!1,bt(v.wrapper.ownerDocument,"mouseup",Z),bt(v.wrapper.ownerDocument,"mousemove",ee),bt(v.scroller,"dragstart",re),bt(v.scroller,"drop",Z),F||(oe(de),r.addNew||Zo(e.doc,a,null,null,r.extend),n&&!b||G&&K==9?setTimeout(function(){v.wrapper.ownerDocument.body.focus({preventScroll:!0}),v.input.focus()},20):v.input.focus())}),ee=function(de){F=F||Math.abs(t.clientX-de.clientX)+Math.abs(t.clientY-de.clientY)>=10},re=function(){return F=!0};n&&(v.scroller.draggable=!0),e.state.draggingText=Z,Z.copy=!r.moveOnDrag,v.scroller.dragDrop&&v.scroller.dragDrop(),Ye(v.wrapper.ownerDocument,"mouseup",Z),Ye(v.wrapper.ownerDocument,"mousemove",ee),Ye(v.scroller,"dragstart",re),Ye(v.scroller,"drop",Z),Za(e),setTimeout(function(){return v.input.focus()},20)}function nl(e,t,a){if(a=="char")return new tt(t,t);if(a=="word")return e.findWordAt(t);if(a=="line")return new tt(ct(t.line,0),En(e.doc,ct(t.line+1,0)));var r=a(e,t);return new tt(r.from,r.to)}function Vl(e,t,a,r){var v=e.display,F=e.doc;oe(t);var Z,ee,re=F.sel,de=re.ranges;if(r.addNew&&!r.extend?(ee=F.sel.contains(a),ee>-1?Z=de[ee]:Z=new tt(a,a)):(Z=F.sel.primary(),ee=F.sel.primIndex),r.unit=="rectangle")r.addNew||(Z=new tt(a,a)),a=Wr(e,t,!0,!0),ee=-1;else{var Ie=nl(e,a,r.unit);r.extend?Z=ls(Z,Ie.anchor,Ie.head,r.extend):Z=Ie}r.addNew?ee==-1?(ee=de.length,Ei(F,rt(e,de.concat([Z]),ee),{scroll:!1,origin:"*mouse"})):de.length>1&&de[ee].empty()&&r.unit=="char"&&!r.extend?(Ei(F,rt(e,de.slice(0,ee).concat(de.slice(ee+1)),0),{scroll:!1,origin:"*mouse"}),re=F.sel):us(F,ee,Z,ge):(ee=0,Ei(F,new Ve([Z],0),ge),re=F.sel);var Ne=a;function Xe(Ot){if(Qt(Ne,Ot)==0)return;if(Ne=Ot,r.unit=="rectangle"){for(var Gt=[],vn=e.options.tabSize,rn=H(wt(F,a.line).text,a.ch,vn),Jn=H(wt(F,Ot.line).text,Ot.ch,vn),Dr=Math.min(rn,Jn),hi=Math.max(rn,Jn),Gr=Math.min(a.line,Ot.line),Ui=Math.min(e.lastLine(),Math.max(a.line,Ot.line));Gr<=Ui;Gr++){var Ii=wt(F,Gr).text,ni=Oe(Ii,Dr,vn);Dr==hi?Gt.push(new tt(ct(Gr,ni),ct(Gr,ni))):Ii.length>ni&&Gt.push(new tt(ct(Gr,ni),ct(Gr,Oe(Ii,hi,vn))))}Gt.length||Gt.push(new tt(a,a)),Ei(F,rt(e,re.ranges.slice(0,ee).concat(Gt),ee),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ot)}else{var Pi=Z,vi=nl(e,Ot,r.unit),si=Pi.anchor,ri;Qt(vi.anchor,si)>0?(ri=vi.head,si=Bi(Pi.from(),vi.anchor)):(ri=vi.anchor,si=ua(Pi.to(),vi.head));var Xr=re.ranges.slice(0);Xr[ee]=Xl(e,new tt(En(F,si),ri)),Ei(F,rt(e,Xr,ee),ge)}}var ze=v.wrapper.getBoundingClientRect(),at=0;function dt(Ot){var Gt=++at,vn=Wr(e,Ot,!0,r.unit=="rectangle");if(!vn)return;if(Qt(vn,Ne)!=0){e.curOp.focus=B(),Xe(vn);var rn=Ua(v,F);(vn.line>=rn.to||vn.lineze.bottom?20:0;Jn&&setTimeout(Hr(e,function(){if(at!=Gt)return;v.scroller.scrollTop+=Jn,dt(Ot)}),50)}}function Et(Ot){e.state.selectingText=!1,at=Infinity,Ot&&(oe(Ot),v.input.focus()),bt(v.wrapper.ownerDocument,"mousemove",At),bt(v.wrapper.ownerDocument,"mouseup",Wt),F.history.lastSelOrigin=null}var At=Hr(e,function(Ot){Ot.buttons===0||!We(Ot)?Et(Ot):dt(Ot)}),Wt=Hr(e,Et);e.state.selectingText=Wt,Ye(v.wrapper.ownerDocument,"mousemove",At),Ye(v.wrapper.ownerDocument,"mouseup",Wt)}function Xl(e,t){var a=t.anchor,r=t.head,v=wt(e.doc,a.line);if(Qt(a,r)==0&&a.sticky==r.sticky)return t;var F=lt(v);if(!F)return t;var Z=qe(F,a.ch,a.sticky),ee=F[Z];if(ee.from!=a.ch&&ee.to!=a.ch)return t;var re=Z+(ee.from==a.ch==(ee.level!=1)?0:1);if(re==0||re==F.length)return t;var de;if(r.line!=a.line)de=(r.line-a.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Ie=qe(F,r.ch,r.sticky),Ne=Ie-Z||(r.ch-a.ch)*(ee.level==1?-1:1);Ie==re-1||Ie==re?de=Ne<0:de=Ne>0}var Xe=F[re+(de?-1:0)],ze=de==(Xe.level==1),at=ze?Xe.from:Xe.to,dt=ze?"after":"before";return a.ch==at&&a.sticky==dt?t:new tt(new ct(a.line,at,dt),r)}function rl(e,t,a,r){var v,F;if(t.touches)v=t.touches[0].clientX,F=t.touches[0].clientY;else try{v=t.clientX,F=t.clientY}catch(Xe){return!1}if(v>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&oe(t);var Z=e.display,ee=Z.lineDiv.getBoundingClientRect();if(F>ee.bottom||!se(e,a))return be(t);F-=ee.top-Z.viewOffset;for(var re=0;re=v){var Ie=Dn(e.doc,F),Ne=e.display.gutterSpecs[re];return me(e,a,e,Ie,Ne.className,t),be(t)}}}function ms(e,t){return rl(e,t,"gutterClick",!0)}function il(e,t){if(Yi(e.display,t)||Yl(e,t))return;if(ne(e,t,"contextmenu"))return;R||e.display.input.onContextMenu(t)}function Yl(e,t){return se(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-"),Nn(e)}var Ao={toString:function(){return"CodeMirror.Init"}},ol={},is={};function $l(e){var t=e.optionHandlers;function a(r,v,F,Z){e.defaults[r]=v,F&&(t[r]=Z?function(ee,re,de){de!=Ao&&F(ee,re,de)}:F)}e.defineOption=a,e.Init=Ao,a("value","",function(r,v){return r.setValue(v)},!0),a("mode",null,function(r,v){r.doc.modeOption=v,Pn(r)},!0),a("indentUnit",2,Pn,!0),a("indentWithTabs",!1),a("smartIndent",!0),a("tabSize",4,function(r){ci(r),Nn(r),gr(r)},!0),a("lineSeparator",null,function(r,v){if(r.doc.lineSep=v,!v)return;var F=[],Z=r.doc.first;r.doc.iter(function(re){for(var de=0;;){var Ie=re.text.indexOf(v,de);if(Ie==-1)break;de=Ie+v.length,F.push(ct(Z,Ie))}Z++});for(var ee=F.length-1;ee>=0;ee--)To(r.doc,v,F[ee],ct(F[ee].line,F[ee].ch+v.length))}),a("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,v,F){r.state.specialChars=new RegExp(v.source+(v.test(" ")?"":"| "),"g"),F!=Ao&&r.refresh()}),a("specialCharPlaceholder",wn,function(r){return r.refresh()},!0),a("electricChars",!0),a("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),a("spellcheck",!1,function(r,v){return r.getInputField().spellcheck=v},!0),a("autocorrect",!1,function(r,v){return r.getInputField().autocorrect=v},!0),a("autocapitalize",!1,function(r,v){return r.getInputField().autocapitalize=v},!0),a("rtlMoveVisually",!D),a("wholeLineUpdateBefore",!0),a("theme","default",function(r){al(r),zi(r)},!0),a("keyMap","default",function(r,v,F){var Z=ns(v),ee=F!=Ao&&ns(F);ee&&ee.detach&&ee.detach(r,Z),Z.attach&&Z.attach(r,ee||null)}),a("extraKeys",null),a("configureMouse",null),a("lineWrapping",!1,Zl,!0),a("gutters",[],function(r,v){r.display.gutterSpecs=ui(v,r.options.lineNumbers),zi(r)},!0),a("fixedGutter",!0,function(r,v){r.display.gutters.style.left=v?li(r.display)+"px":"0",r.refresh()},!0),a("coverGutterNextToScrollbar",!1,function(r){return oa(r)},!0),a("scrollbarStyle","native",function(r){Fa(r),oa(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),a("lineNumbers",!1,function(r,v){r.display.gutterSpecs=ui(r.options.gutters,v),zi(r)},!0),a("firstLineNumber",1,zi,!0),a("lineNumberFormatter",function(r){return r},zi,!0),a("showCursorWhenSelecting",!1,yr,!0),a("resetSelectionOnContextMenu",!0),a("lineWiseCopyCut",!0),a("pasteLinesPerSelection",!0),a("selectionsMayTouch",!1),a("readOnly",!1,function(r,v){v=="nocursor"&&(ga(r),r.display.input.blur()),r.display.input.readOnlyChanged(v)}),a("screenReaderLabel",null,function(r,v){v=v===""?null:v,r.display.input.screenReaderLabelChanged(v)}),a("disableInput",!1,function(r,v){v||r.display.input.reset()},!0),a("dragDrop",!0,Ql),a("allowDropFileTypes",null),a("cursorBlinkRate",530),a("cursorScrollMargin",0),a("cursorHeight",1,yr,!0),a("singleCursorHeightPerLine",!0,yr,!0),a("workTime",100),a("workDelay",100),a("flattenSpans",!0,ci,!0),a("addModeClass",!1,ci,!0),a("pollInterval",100),a("undoDepth",200,function(r,v){return r.doc.history.undoDepth=v}),a("historyEventDelay",1250),a("viewportMargin",10,function(r){return r.refresh()},!0),a("maxHighlightLength",1e4,ci,!0),a("moveInputWithCursor",!0,function(r,v){v||r.display.input.resetPosition()}),a("tabindex",null,function(r,v){return r.display.input.getField().tabIndex=v||""}),a("autofocus",null),a("direction","ltr",function(r,v){return r.doc.setDirection(v)},!0),a("phrases",null)}function Ql(e,t,a){var r=a&&a!=Ao;if(!t!=!r){var v=e.display.dragFunctions,F=t?Ye:bt;F(e.display.scroller,"dragstart",v.start),F(e.display.scroller,"dragenter",v.enter),F(e.display.scroller,"dragover",v.over),F(e.display.scroller,"dragleave",v.leave),F(e.display.scroller,"drop",v.drop)}}function Zl(e){e.options.lineWrapping?(W(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(g(e.display.wrapper,"CodeMirror-wrap"),tr(e)),gi(e),gr(e),Nn(e),setTimeout(function(){return oa(e)},100)}function jr(e,t){var a=this;if(!(this instanceof jr))return new jr(e,t);this.options=t=t?y(t):{},y(ol,t,!1);var r=t.value;typeof r=="string"?r=new Li(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var v=new jr.inputStyles[t.inputStyle](this),F=this.display=new Aa(e,r,v,t);F.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fa(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!u&&F.input.focus(),G&&K<11&&setTimeout(function(){return a.display.input.reset(!0)},20),Jl(this),Rl(),Gi(this),this.curOp.forceUpdate=!0,Ur(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){a.hasFocus()&&!a.state.focused&&na(a)},20):ga(this);for(var Z in is)is.hasOwnProperty(Z)&&is[Z](this,t[Z],Ao);ti(this),t.finishInit&&t.finishInit(this);for(var ee=0;ee20*20}Ye(t.scroller,"touchstart",function(re){if(!ne(e,re)&&!F(re)&&!ms(e,re)){t.input.ensurePolled(),clearTimeout(a);var de=+new Date;t.activeTouch={start:de,moved:!1,prev:de-r.end<=300?r:null},re.touches.length==1&&(t.activeTouch.left=re.touches[0].pageX,t.activeTouch.top=re.touches[0].pageY)}}),Ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ye(t.scroller,"touchend",function(re){var de=t.activeTouch;if(de&&!Yi(t,re)&&de.left!=null&&!de.moved&&new Date-de.start<300){var Ie=e.coordsChar(t.activeTouch,"page"),Ne;!de.prev||Z(de,de.prev)?Ne=new tt(Ie,Ie):!de.prev.prev||Z(de,de.prev.prev)?Ne=e.findWordAt(Ie):Ne=new tt(ct(Ie.line,0),En(e.doc,ct(Ie.line+1,0))),e.setSelection(Ne.anchor,Ne.head),e.focus(),oe(re)}v()}),Ye(t.scroller,"touchcancel",v),Ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ia(e,t.scroller.scrollTop),wi(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))}),Ye(t.scroller,"mousewheel",function(re){return $e(e,re)}),Ye(t.scroller,"DOMMouseScroll",function(re){return $e(e,re)}),Ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(re){ne(e,re)||Se(re)},over:function(re){ne(e,re)||(Ol(e,re),Se(re))},start:function(re){return Al(e,re)},drop:Hr(e,Sl),leave:function(re){ne(e,re)||Hs(e)}};var ee=t.input.getField();Ye(ee,"keyup",function(re){return qs.call(e,re)}),Ye(ee,"keydown",Hr(e,Js)),Ye(ee,"keypress",Hr(e,el)),Ye(ee,"focus",function(re){return na(e,re)}),Ye(ee,"blur",function(re){return ga(e,re)})}var gs=[];jr.defineInitHook=function(e){return gs.push(e)};function $o(e,t,a,r){var v=e.doc,F;a==null&&(a="add"),a=="smart"&&(v.mode.indent?F=pi(e,t).state:a="prev");var Z=e.options.tabSize,ee=wt(v,t),re=H(ee.text,null,Z);ee.stateAfter&&(ee.stateAfter=null);var de=ee.text.match(/^\s*/)[0],Ie;if(!r&&!/\S/.test(ee.text))Ie=0,a="not";else if(a=="smart"&&(Ie=v.mode.indent(F,ee.text.slice(de.length),ee.text),Ie==Te||Ie>150)){if(!r)return;a="prev"}a=="prev"?t>v.first?Ie=H(wt(v,t-1).text,null,Z):Ie=0:a=="add"?Ie=re+e.options.indentUnit:a=="subtract"?Ie=re-e.options.indentUnit:typeof a=="number"&&(Ie=re+a),Ie=Math.max(0,Ie);var Ne="",Xe=0;if(e.options.indentWithTabs)for(var ze=Math.floor(Ie/Z);ze;--ze)Xe+=Z,Ne+=" ";if(XeZ,re=zt(t),de=null;if(ee&&r.ranges.length>1)if(la&&la.text.join(` `)==t){if(r.ranges.length%la.text.length==0){de=[];for(var Ie=0;Ie=0;Xe--){var ze=r.ranges[Xe],at=ze.from(),dt=ze.to();ze.empty()&&(a&&a>0?at=ct(at.line,at.ch-a):e.state.overwrite&&!ee?dt=ct(dt.line,Math.min(wt(F,dt.line).text.length,dt.ch+P(re).length)):ee&&la&&la.lineWise&&la.text.join(` `)==re.join(` `)&&(at=dt=ct(at.line,0)));var Et={from:at,to:dt,text:de?de[Xe%de.length]:re,origin:v||(ee?"paste":e.state.cutIncoming>Z?"cut":"+input")};xo(e.doc,Et),Mr(e,"inputRead",e,Et)}t&&!ee&&ll(e,t),ra(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ne),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var a=e.clipboardData&&e.clipboardData.getData("Text");if(a)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Vr(t,function(){return vs(t,a,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var a=e.doc.sel,r=a.ranges.length-1;r>=0;r--){var v=a.ranges[r];if(v.head.ch>100||r&&a.ranges[r-1].head.line==v.head.line)continue;var F=e.getModeAt(v.head),Z=!1;if(F.electricChars){for(var ee=0;ee-1){Z=$o(e,v.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(wt(e.doc,v.head.line).text.slice(0,v.head.ch))&&(Z=$o(e,v.head.line,"smart")));Z&&Mr(e,"electricInput",e,v.head.line)}}function ul(e){for(var t=[],a=[],r=0;rF&&($o(this,ee.head.line,r,!0),F=ee.head.line,Z==this.doc.sel.primIndex&&ra(this));else{var re=ee.from(),de=ee.to(),Ie=Math.max(F,re.line);F=Math.min(this.lastLine(),de.line-(de.ch?0:1))+1;for(var Ne=Ie;Ne0&&us(this.doc,Z,new tt(re,Xe[Z].to()),_e)}}}),getTokenAt:function(r,v){return Ya(this,r,v)},getLineTokens:function(r,v){return Ya(this,ct(r),v,!0)},getTokenTypeAt:function(r){r=En(this.doc,r);var v=ea(this,wt(this.doc,r.line)),F=0,Z=(v.length-1)/2,ee=r.ch,re;if(ee==0)re=v[2];else for(;;){var de=F+Z>>1;if((de?v[de*2-1]:0)>=ee)Z=de;else if(v[de*2+1]re&&(r=re,Z=!0),ee=wt(this.doc,r)}else ee=r;return zn(this,ee,{top:0,left:0},v||"page",F||Z).top+(Z?this.doc.height-St(ee):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Fr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,v,F,Z,ee){var re=this.display;r=Yn(this,En(this.doc,r));var de=r.bottom,Ie=r.left;if(v.style.position="absolute",v.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(v),re.sizer.appendChild(v),Z=="over")de=r.top;else if(Z=="above"||Z=="near"){var Ne=Math.max(re.wrapper.clientHeight,this.doc.height),Xe=Math.max(re.sizer.clientWidth,re.lineSpace.clientWidth);(Z=="above"||r.bottom+v.offsetHeight>Ne)&&r.top>v.offsetHeight?de=r.top-v.offsetHeight:r.bottom+v.offsetHeight<=Ne&&(de=r.bottom),Ie+v.offsetWidth>Xe&&(Ie=Xe-v.offsetWidth)}v.style.top=de+"px",v.style.left=v.style.right="",ee=="right"?(Ie=re.sizer.clientWidth-v.offsetWidth,v.style.right="0px"):(ee=="left"?Ie=0:ee=="middle"&&(Ie=(re.sizer.clientWidth-v.offsetWidth)/2),v.style.left=Ie+"px"),F&&mo(this,{left:Ie,top:de,right:Ie+v.offsetWidth,bottom:de+v.offsetHeight})},triggerOnKeyDown:ai(Js),triggerOnKeyPress:ai(el),triggerOnKeyUp:qs,triggerOnMouseDown:ai(tl),execCommand:function(r){if(zo.hasOwnProperty(r))return zo[r].call(null,this)},triggerElectric:ai(function(r){ll(this,r)}),findPosH:function(r,v,F,Z){var ee=1;v<0&&(ee=-1,v=-v);for(var re=En(this.doc,r),de=0;de0&&Ie(F.charAt(Z-1));)--Z;for(;ee.5||this.options.lineWrapping)&&gi(this),me(this,"refresh",this)}),swapDoc:ai(function(r){var v=this.doc;return v.cm=null,this.state.selectingText&&this.state.selectingText(),Ur(this,r),Nn(this),this.display.input.reset(),va(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Mr(this,"swapDoc",this,v),v}),phrase:function(r){var v=this.options.phrases;return v&&Object.prototype.hasOwnProperty.call(v,r)?v[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}},ue(e),e.registerHelper=function(r,v,F){a.hasOwnProperty(r)||(a[r]=e[r]={_global:[]}),a[r][v]=F},e.registerGlobalHelper=function(r,v,F,Z){e.registerHelper(r,v,Z),a[r]._global.push({pred:F,val:Z})}}function ys(e,t,a,r,v){var F=t,Z=a,ee=wt(e,t.line),re=v&&e.direction=="rtl"?-a:a;function de(){var Wt=t.line+re;return Wt=e.first+e.size?!1:(t=new ct(Wt,t.ch,t.sticky),ee=wt(e,Wt))}function Ie(Wt){var Ot;if(r=="codepoint"){var Gt=ee.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Gt)?Ot=null:Ot=new ct(t.line,Math.max(0,Math.min(ee.text.length,t.ch+a*(Gt>=55296&&Gt<56320?2:1))),-a)}else v?Ot=kl(e.cm,ee,t,a):Ot=ds(ee,t,a);if(Ot==null)if(!Wt&&de())t=hs(v,e.cm,ee,t.line,re);else return!1;else t=Ot;return!0}if(r=="char"||r=="codepoint")Ie();else if(r=="column")Ie(!0);else if(r=="word"||r=="group")for(var Ne=null,Xe=r=="group",ze=e.cm&&e.cm.getHelper(t,"wordChars"),at=!0;!(a<0&&!Ie(!at));at=!1){var dt=ee.text.charAt(t.ch)||` `,Et=Ke(dt,ze)?"w":Xe&&dt==` `?"n":!Xe||/\s/.test(dt)?null:"p";if(Xe&&!at&&!Et&&(Et="s"),Ne&&Ne!=Et){a<0&&(a=1,Ie(),t.sticky="after");break}if(Et&&(Ne=Et),a>0&&!Ie(!at))break}var At=qo(e,t,F,Z,!0);return ji(F,At)&&(At.hitSide=!0),At}function hl(e,t,a,r){var v=e.doc,F=t.left,Z;if(r=="page"){var ee=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),re=Math.max(ee-.5*Nr(e.display),3);Z=(a>0?t.bottom:t.top)+a*re}else r=="line"&&(Z=a>0?t.bottom+3:t.top-3);for(var de;!(de=In(e,F,Z),!de.outside);){if(a<0?Z<=0:Z>=v.height){de.hitSide=!0;break}Z+=a*5}return de}var Sr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Sr.prototype.init=function(e){var t=this,a=this,r=a.cm,v=a.div=e.lineDiv;cl(v,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function F(ee){for(var re=ee.target;re;re=re.parentNode){if(re==v)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(re.className))break}return!1}Ye(v,"paste",function(ee){if(!F(ee)||ne(r,ee)||sl(ee,r))return;K<=11&&setTimeout(Hr(r,function(){return t.updateFromDOM()}),20)}),Ye(v,"compositionstart",function(ee){t.composing={data:ee.data,done:!1}}),Ye(v,"compositionupdate",function(ee){t.composing||(t.composing={data:ee.data,done:!1})}),Ye(v,"compositionend",function(ee){t.composing&&(ee.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ye(v,"touchstart",function(){return a.forceCompositionEnd()}),Ye(v,"input",function(){t.composing||t.readFromDOMSoon()});function Z(ee){if(!F(ee)||ne(r,ee))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()}),ee.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var re=ul(r);as({lineWise:!0,text:re.text}),ee.type=="cut"&&r.operation(function(){r.setSelections(re.ranges,0,_e),r.replaceSelection("",null,"cut")})}else return;if(ee.clipboardData){ee.clipboardData.clearData();var de=la.text.join(` `);if(ee.clipboardData.setData("Text",de),ee.clipboardData.getData("Text")==de){ee.preventDefault();return}}var Ie=dl(),Ne=Ie.firstChild;r.display.lineSpace.insertBefore(Ie,r.display.lineSpace.firstChild),Ne.value=la.text.join(` `);var Xe=document.activeElement;k(Ne),setTimeout(function(){r.display.lineSpace.removeChild(Ie),Xe.focus(),Xe==v&&a.showPrimarySelection()},50)}Ye(v,"copy",Z),Ye(v,"cut",Z)},Sr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Sr.prototype.prepareSelection=function(){var e=Mi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Sr.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Sr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Sr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,a=t.doc.sel.primary(),r=a.from(),v=a.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||v.line=t.display.viewFrom&&fl(t,r)||{node:ee[0].measure.map[2],offset:0},de=v.linee.firstLine()&&(r=ct(r.line-1,wt(e.doc,r.line-1).length)),v.ch==wt(e.doc,v.line).text.length&&v.linet.viewTo-1)return!1;var F,Z,ee;r.line==t.viewFrom||(F=wr(e,r.line))==0?(Z=on(t.view[0].line),ee=t.view[0].node):(Z=on(t.view[F].line),ee=t.view[F-1].node.nextSibling);var re=wr(e,v.line),de,Ie;if(re==t.view.length-1?(de=t.viewTo-1,Ie=t.lineDiv.lastChild):(de=on(t.view[re+1].line)-1,Ie=t.view[re+1].node.previousSibling),!ee)return!1;for(var Ne=e.doc.splitLines(tu(e,ee,Ie,Z,de)),Xe=Rn(e.doc,ct(Z,0),ct(de,wt(e.doc,de).text.length));Ne.length>1&&Xe.length>1;)if(P(Ne)==P(Xe))Ne.pop(),Xe.pop(),de--;else if(Ne[0]==Xe[0])Ne.shift(),Xe.shift(),Z++;else break;for(var ze=0,at=0,dt=Ne[0],Et=Xe[0],At=Math.min(dt.length,Et.length);zer.ch&&Wt.charCodeAt(Wt.length-at-1)==Ot.charCodeAt(Ot.length-at-1);)ze--,at++;Ne[Ne.length-1]=Wt.slice(0,Wt.length-at).replace(/^\u200b+/,""),Ne[0]=Ne[0].slice(ze).replace(/\u200b+$/,"");var vn=ct(Z,ze),rn=ct(de,Xe.length?P(Xe).length-at:0);if(Ne.length>1||Ne[0]||Qt(vn,rn))return To(e.doc,Ne,vn,rn,"+input"),!0},Sr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Sr.prototype.reset=function(){this.forceCompositionEnd()},Sr.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Sr.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)},Sr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Vr(this.cm,function(){return gr(e.cm)})},Sr.prototype.setUneditable=function(e){e.contentEditable="false"},Sr.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Hr(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Sr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Sr.prototype.onContextMenu=function(){},Sr.prototype.resetPosition=function(){},Sr.prototype.needsContentAttribute=!0;function fl(e,t){var a=Fe(e,t.line);if(!a||a.hidden)return null;var r=wt(e.doc,t.line),v=fe(a,r,t.line),F=lt(r,e.doc.direction),Z="left";if(F){var ee=qe(F,t.ch);Z=ee%2?"right":"left"}var re=ut(v.map,t.ch,Z);return re.offset=re.collapse=="right"?re.end:re.start,re}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,a,r,v){var F="",Z=!1,ee=e.doc.lineSeparator(),re=!1;function de(ze){return function(at){return at.id==ze}}function Ie(){Z&&(F+=ee,re&&(F+=ee),Z=re=!1)}function Ne(ze){ze&&(Ie(),F+=ze)}function Xe(ze){if(ze.nodeType==1){var at=ze.getAttribute("cm-text");if(at){Ne(at);return}var dt=ze.getAttribute("cm-marker"),Et;if(dt){var At=e.findMarks(ct(r,0),ct(v+1,0),de(+dt));At.length&&(Et=At[0].find(0))&&Ne(Rn(e.doc,Et.from,Et.to).join(ee));return}if(ze.getAttribute("contenteditable")=="false")return;var Wt=/^(pre|div|p|li|table|br)$/i.test(ze.nodeName);if(!/^br$/i.test(ze.nodeName)&&ze.textContent.length==0)return;Wt&&Ie();for(var Ot=0;Ot=9&&t.hasSelection&&(t.hasSelection=null),a.poll()}),Ye(v,"paste",function(Z){if(ne(r,Z)||sl(Z,r))return;r.state.pasteIncoming=+new Date,a.fastPoll()});function F(Z){if(ne(r,Z))return;if(r.somethingSelected())as({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var ee=ul(r);as({lineWise:!0,text:ee.text}),Z.type=="cut"?r.setSelections(ee.ranges,null,_e):(a.prevInput="",v.value=ee.text.join(` `),k(v))}else return;Z.type=="cut"&&(r.state.cutIncoming=+new Date)}Ye(v,"cut",F),Ye(v,"copy",F),Ye(e.scroller,"paste",function(Z){if(Yi(e,Z)||ne(r,Z))return;if(!v.dispatchEvent){r.state.pasteIncoming=+new Date,a.focus();return}var ee=new Event("paste");ee.clipboardData=Z.clipboardData,v.dispatchEvent(ee)}),Ye(e.lineSpace,"selectstart",function(Z){Yi(e,Z)||oe(Z)}),Ye(v,"compositionstart",function(){var Z=r.getCursor("from");a.composing&&a.composing.range.clear(),a.composing={start:Z,range:r.markText(Z,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ye(v,"compositionend",function(){a.composing&&(a.poll(),a.composing.range.clear(),a.composing=null)})},qr.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},qr.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qr.prototype.prepareSelection=function(){var e=this.cm,t=e.display,a=e.doc,r=Mi(e);if(e.options.moveInputWithCursor){var v=Yn(e,a.sel.primary().head,"div"),F=t.wrapper.getBoundingClientRect(),Z=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,v.top+Z.top-F.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,v.left+Z.left-F.left))}return r},qr.prototype.showSelection=function(e){var t=this.cm,a=t.display;d(a.cursorDiv,e.cursors),d(a.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qr.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var a=t.getSelection();this.textarea.value=a,t.state.focused&&k(this.textarea),G&&K>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",G&&K>=9&&(this.hasSelection=null))},qr.prototype.getField=function(){return this.textarea},qr.prototype.supportsTouch=function(){return!1},qr.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},qr.prototype.blur=function(){this.textarea.blur()},qr.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qr.prototype.receivedFocus=function(){this.slowPoll()},qr.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()})},qr.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function a(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,a)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,a)},qr.prototype.poll=function(){var e=this,t=this.cm,a=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Mt(a)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var v=a.value;if(v==r&&!t.somethingSelected())return!1;if(G&&K>=9&&this.hasSelection===v||s&&/[\uf700-\uf7ff]/.test(v))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var F=v.charCodeAt(0);if(F==8203&&!r&&(r="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var Z=0,ee=Math.min(r.length,v.length);Z1e3||v.indexOf(` `)>-1?a.value=e.prevInput="":e.prevInput=v,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qr.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qr.prototype.onKeyPress=function(){G&&K>=9&&(this.hasSelection=null),this.fastPoll()},qr.prototype.onContextMenu=function(e){var t=this,a=t.cm,r=a.display,v=t.textarea;t.contextMenuPending&&t.contextMenuPending();var F=Wr(a,e),Z=r.scroller.scrollTop;if(!F||f)return;var ee=a.options.resetSelectionOnContextMenu;ee&&a.doc.sel.contains(F)==-1&&Hr(a,Ei)(a.doc,vt(F),_e);var re=v.style.cssText,de=t.wrapper.style.cssText,Ie=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",v.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Ie.top-5)+"px; left: "+(e.clientX-Ie.left-5)+`px; z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ne;n&&(Ne=window.scrollY),r.input.focus(),n&&window.scrollTo(null,Ne),r.input.reset(),a.somethingSelected()||(v.value=t.prevInput=" "),t.contextMenuPending=ze,r.selForContextMenu=a.doc.sel,clearTimeout(r.detectingSelectAll);function Xe(){if(v.selectionStart!=null){var dt=a.somethingSelected(),Et="\u200B"+(dt?v.value:"");v.value="\u21DA",v.value=Et,t.prevInput=dt?"":"\u200B",v.selectionStart=1,v.selectionEnd=Et.length,r.selForContextMenu=a.doc.sel}}function ze(){if(t.contextMenuPending!=ze)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=de,v.style.cssText=re,G&&K<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=Z),v.selectionStart!=null){(!G||G&&K<9)&&Xe();var dt=0,Et=function(){r.selForContextMenu==a.doc.sel&&v.selectionStart==0&&v.selectionEnd>0&&t.prevInput=="\u200B"?Hr(a,Ls)(a):dt++<10?r.detectingSelectAll=setTimeout(Et,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Et,200)}}if(G&&K>=9&&Xe(),R){Se(e);var at=function(){bt(window,"mouseup",at),setTimeout(ze,20)};Ye(window,"mouseup",at)}else setTimeout(ze,50)},qr.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qr.prototype.setUneditable=function(){},qr.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?y(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 a=B();t.autofocus=a==e||e.getAttribute("autofocus")!=null&&a==document.body}function r(){e.value=ee.getValue()}var v;if(e.form&&(Ye(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var F=e.form;v=F.submit;try{var Z=F.submit=function(){r(),F.submit=v,F.submit(),F.submit=Z}}catch(re){}}t.finishInit=function(re){re.save=r,re.getTextArea=function(){return e},re.toTextArea=function(){re.toTextArea=isNaN,r(),e.parentNode.removeChild(re.getWrapperElement()),e.style.display="",e.form&&(bt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=v))}},e.style.display="none";var ee=jr(function(re){return e.parentNode.insertBefore(re,e.nextSibling)},t);return ee}function iu(e){e.off=bt,e.on=Ye,e.wheelEventPixels=Je,e.Doc=Li,e.splitLines=zt,e.countColumn=H,e.findColumn=Oe,e.isWordChar=Re,e.Pass=Te,e.signal=me,e.Line=Hn,e.changeEnd=gt,e.scrollbarModel=eo,e.Pos=ct,e.cmpPos=Qt,e.modes=or,e.mimeModes=bn,e.resolveMode=Ar,e.getMode=Br,e.modeExtensions=Ht,e.extendMode=an,e.copyState=Cn,e.startState=Ir,e.innerMode=qn,e.commands=zo,e.keyMap=Da,e.keyName=Xs,e.isModifierKey=zs,e.lookupKey=Co,e.normalizeKeyMap=Pl,e.StringStream=gn,e.SharedTextMarker=Ho,e.TextMarker=za,e.LineWidget=Wo,e.e_preventDefault=oe,e.e_stopPropagation=ce,e.e_stop=Se,e.addClass=W,e.contains=w,e.rmClass=g,e.keyNames=Va}$l(jr),ql(jr);var au="iter insert remove copy getEditor constructor".split(" ");for(var ss in Li.prototype)Li.prototype.hasOwnProperty(ss)&&te(au,ss)<0&&(jr.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(Li.prototype[ss]));return ue(Li),jr.inputStyles={textarea:qr,contenteditable:Sr},jr.defineMode=function(e){!jr.defaults.mode&&e!="null"&&(jr.defaults.mode=e),xr.apply(this,arguments)},jr.defineMIME=br,jr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jr.defineMIME("text/plain","null"),jr.defineExtension=function(e,t){jr.prototype[e]=t},jr.defineDocExtension=function(e,t){Li.prototype[e]=t},jr.fromTextArea=ru,iu(jr),jr.version="5.58.2",jr})},WaYH:function(it,Ee,U){"use strict";var ie=U("rePB"),Y=U("Ff2n"),N=U("VTBJ"),z=U("1OyB"),I=U("vuIU"),M=U("JX7q"),G=U("Ji7U"),K=U("LK+K"),n=U("q1tI"),L=U("TSYQ"),x=U.n(L),f=U("sboe"),b=U("OZM5"),h=function(R){var O=R.prefixCls,g=R.level,_=R.isStart,d=R.isEnd;if(!g)return null;for(var c="".concat(O,"-indent-unit"),C=[],E=0;E1&&arguments[1]!==void 0?arguments[1]:!1,ve=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(ge&&B[ve])return B[ve];var Oe=window.getComputedStyle(_e),he=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),V=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),P=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),j=w.map(function(J){return"".concat(J,":").concat(Oe.getPropertyValue(J))}).join(";"),$={sizingStyle:j,paddingSize:V,borderSize:P,boxSizing:he};return ge&&ve&&(B[ve]=$),$}function k(_e){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=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)),_e.getAttribute("wrap")?W.setAttribute("wrap",_e.getAttribute("wrap")):W.removeAttribute("wrap");var he=T(_e,ge),V=he.paddingSize,P=he.borderSize,j=he.boxSizing,$=he.sizingStyle;W.setAttribute("style","".concat($,";").concat(E)),W.value=_e.value||_e.placeholder||"";var J=Number.MIN_SAFE_INTEGER,X=Number.MAX_SAFE_INTEGER,ye=W.scrollHeight,Re;if(j==="border-box"?ye+=P:j==="content-box"&&(ye-=V),ve!==null||Oe!==null){W.value=" ";var Ke=W.scrollHeight-V;ve!==null&&(J=Ke*ve,j==="border-box"&&(J=J+V+P),ye=Math.max(J,ye)),Oe!==null&&(X=Ke*Oe,j==="border-box"&&(X=X+V+P),Re=ye>X?"":"hidden",ye=Math.min(X,ye))}return{height:ye,minHeight:J,maxHeight:X,overflowY:Re,resize:"none"}}var m=U("Gytx"),y=U.n(m),H;(function(_e){_e[_e.NONE=0]="NONE",_e[_e.RESIZING=1]="RESIZING",_e[_e.RESIZED=2]="RESIZED"})(H||(H={}));var Q=function(_e){Object(z.a)(ve,_e);var ge=Object(I.a)(ve);function ve(Oe){var he;return Object(Y.a)(this,ve),he=ge.call(this,Oe),he.nextFrameActionId=void 0,he.resizeFrameId=void 0,he.textArea=void 0,he.saveTextArea=function(V){he.textArea=V},he.handleResize=function(V){var P=he.state.resizeStatus,j=he.props,$=j.autoSize,J=j.onResize;if(P!==H.NONE)return;typeof J=="function"&&J(V),$&&he.resizeOnNextFrame()},he.resizeOnNextFrame=function(){cancelAnimationFrame(he.nextFrameActionId),he.nextFrameActionId=requestAnimationFrame(he.resizeTextarea)},he.resizeTextarea=function(){var V=he.props.autoSize;if(!V||!he.textArea)return;var P=V.minRows,j=V.maxRows,$=k(he.textArea,!1,P,j);he.setState({textareaStyles:$,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(he.resizeFrameId),he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.RESIZED},function(){he.resizeFrameId=requestAnimationFrame(function(){he.setState({resizeStatus:H.NONE}),he.fixFirefoxAutoScroll()})})})})},he.renderTextArea=function(){var V=he.props,P=V.prefixCls,j=P===void 0?"rc-textarea":P,$=V.autoSize,J=V.onResize,X=V.className,ye=V.disabled,Re=he.state,Ke=Re.textareaStyles,pe=Re.resizeStatus,we=Object(d.a)(he.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ke=C()(j,X,Object(K.a)({},"".concat(j,"-disabled"),ye));"value"in we&&(we.value=we.value||"");var Ue=Object(G.a)(Object(G.a)(Object(G.a)({},he.props.style),Ke),pe===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(_,{onResize:he.handleResize,disabled:!($||J)},M.createElement("textarea",Object(ie.a)({},we,{className:ke,style:Ue,ref:he.saveTextArea})))},he.state={textareaStyles:{},resizeStatus:H.NONE},he}return Object(N.a)(ve,[{key:"componentDidUpdate",value:function(he){(he.value!==this.props.value||!y()(he.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 he=this.textArea.selectionStart,V=this.textArea.selectionEnd;this.textArea.setSelectionRange(he,V)}}catch(P){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ve}(M.Component),te=Q,ae=function(_e){Object(z.a)(ve,_e);var ge=Object(I.a)(ve);function ve(Oe){var he;Object(Y.a)(this,ve),he=ge.call(this,Oe),he.resizableTextArea=void 0,he.focus=function(){he.resizableTextArea.textArea.focus()},he.saveTextArea=function(P){he.resizableTextArea=P},he.handleChange=function(P){var j=he.props.onChange;he.setValue(P.target.value,function(){he.resizableTextArea.resizeTextarea()}),j&&j(P)},he.handleKeyDown=function(P){var j=he.props,$=j.onPressEnter,J=j.onKeyDown;P.keyCode===13&&$&&$(P),J&&J(P)};var V=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return he.state={value:V},he}return Object(N.a)(ve,[{key:"setValue",value:function(he,V){"value"in this.props||this.setState({value:he},V)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(te,Object(ie.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(he){return"value"in he?{value:he.value}:null}}]),ve}(M.Component),Te=Ee.default=ae},ZW9T:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return m});var ie=U("k1fw"),Y=U("oBTY"),N=U("miYZ"),z=U("tsqr"),I=U("rAM+"),M=U("tJVT"),G=U("PpiC"),K=U("q1tI"),n=U.n(K),L=U("bdgK"),x=U("9og8"),f=U("WmNS"),b=U.n(f),h={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},o={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(` `)},{label:"System.out.println",content:["System.out.println($0)"].join(` `)},{label:"System.out.print",content:["System.out.print($0)"].join(` `)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},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 ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].join(` `)},{label:"include ",content:["#include "].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,Q){return Q.map(function(te){return{label:te,kind:H.languages.CompletionItemKind.Keyword,insertText:te}})},A=function(H){return Object.keys(i.tables).map(function(Q){return{label:Q,kind:H.languages.CompletionItemKind.Variable,insertText:Q}})},S=function(H,Q){var te=i.tables[H];return te?te.map(function(ae){return{label:ae,kind:Q.languages.CompletionItemKind.Field,insertText:ae}}):[]};function R(y,H,Q,te,ae){var Te=H.getWordUntilPosition(Q),_e={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:Te.startColumn,endColumn:Te.endColumn},ge=te.map(function(ve){return{label:ve,kind:y.languages.CompletionItemKind.Keyword,insertText:ve,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:_e}});return ae.map(function(ve){ge.push(Object(ie.a)(Object(ie.a)({},ve),{},{range:_e}))}),ge}var O=function(y){i.languages.map(function(ae){return y.languages.registerDocumentFormattingEditProvider(ae,{provideDocumentFormattingEdits:function(_e,ge,ve){return Object(x.a)(b.a.mark(function Oe(){var he;return b.a.wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return he=s()(_e.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}),P.abrupt("return",[{range:_e.getFullModelRange(),text:he}]);case 2:case"end":return P.stop()}},Oe)}))()}}),ae});var H=p.quickKey.map(function(ae){return{label:ae.label,kind:y.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=l.quickKey.map(function(ae){return{label:ae.label,kind:y.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),te=o.quickKey.map(function(ae){return{label:ae.label,kind:y.languages.CompletionItemKind.Method,insertText:ae.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Oe=Te.getLineContent(_e.lineNumber).substring(ge.startColumn-2,ge.endColumn);return{suggestions:[].concat(Object(Y.a)(p.keywords.map(function(he){return{label:he,kind:y.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})),Object(Y.a)(p.quickKey.map(function(he){return{label:he.label,kind:y.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})))}}}),y.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn};return{suggestions:Object(Y.a)(h.keywords.map(function(Oe){return{label:Oe,kind:y.languages.CompletionItemKind.Function,documentation:Oe,insertText:Oe,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}}))}}}),y.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Oe=Te.getLineContent(_e.lineNumber).substring(ge.startColumn-2,ge.endColumn);return{suggestions:[].concat(Object(Y.a)(o.keywords.map(function(he){return{label:he,kind:y.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})),Object(Y.a)(o.quickKey.map(function(he){return{label:he.label,kind:y.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})))}}}),y.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Te,_e){var ge=Te.getWordUntilPosition(_e),ve={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},Oe=Te.getLineContent(_e.lineNumber).substring(ge.startColumn-2,ge.endColumn);return{suggestions:[].concat(Object(Y.a)(l.keywords.map(function(he){return{label:he,kind:y.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})),Object(Y.a)(l.quickKey.map(function(he){return{label:he.label,kind:y.languages.CompletionItemKind.Function,documentation:he.content,insertText:Oe.startsWith("#")?he.content.replace(/#/,""):he.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ve}})))}}})},g="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=U("fjLI"),d=U("LvDl"),c=U("+ua5");function C(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function E(){}var w=!1,B={"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 y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=y;if(Array.isArray(y)){for(var Q=0;Q0||Ir.target.offsetWidth>0)&&ne.current.instance.layout()}}catch(gn){Cn.e(gn)}finally{Cn.f()}}),Ht.observe(me.current)),Ht}function et(){z.b.warn(decodeURIComponent(g))}var yt=function(){var an=ne.current.instance;if(Te!=null&&an&&Se){var Cn=an.getModel();Cn&&Te!==Cn.getValue()&&(w=!0,Cn.setValue(Te),an.layout(),w=!1)}};Object(K.useEffect)(function(){se.current&&clearTimeout(se.current),se.current=setTimeout(function(){yt()},500)},[Te,Se,ne.current]),Object(K.useEffect)(function(){if(pt&&ne.current&&ne.current.instance){var Ht=ne.current.instance;Ht.changeViewZones(function(Cn){var qn=document.createElement("div");qn.style.padding="10px 20px",qn.style.width="calc(100% - 20px)",qn.className="my-error-line-wrp",qn.innerHTML=Tt,Cn.addZone({afterLineNumber:pt||11,heightInLines:3,domNode:qn})});var an={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}};Ht.addOverlayWidget(an),Ht.revealPositionInCenter({lineNumber:20,column:1})}},[pt,ne.current,Se]);function Rt(){var Ht=ne.current.instance;if(Ht){var an=Ht.getSelection(),Cn=ne.current.pastePos||{},qn=new T.Range(Cn.startLineNumber||an.endLineNumber,Cn.startColumn||an.endColumn,Cn.endLineNumber||an.endLineNumber,Cn.endColumn||an.endColumn);setTimeout(function(){Ht.executeEdits("",[{range:qn,text:""}])},300)}}function kt(Ht){(window.navigator.platform.match("Mac")?Ht.metaKey:Ht.ctrlKey)&&Ht.keyCode==83&&(Ht.preventDefault(),ye())}var mn=function(){if(Ke&&ne.current.instance){var an=ne.current.instance.getContentHeight();Ar(an0||Qe.target.offsetWidth>0)&&Ke.layout()}}catch(nt){ke.e(nt)}finally{ke.f()}}),pe.observe(he.current)),pe}Object(K.useEffect)(function(){he.current&&Promise.all([U.e(18),U.e(29)]).then(U.t.bind(null,"M/lh",7)).then(function(Ke){T=Ke;var pe=T.editor.createDiffEditor(he.current,Object(ie.a)(Object(ie.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Oe),{},{wordWrap:!0}));$(pe);var we=J(pe);return function(){pe.dispose();var ke=pe.getModel();ke&&ke.dispose(),we.unobserve(he.current)}})},[]),Object(K.useEffect)(function(){j&&j.setModel({original:T.editor.createModel(Te,ge),modified:T.editor.createModel(_e,ge)})},[Te,_e,ge,j]);var X=C(Q),ye=C(ae),Re={width:X,height:ye};return n.a.createElement("div",{className:"my-diff-editor",ref:he,style:Re})}},"a+yL":function(it,Ee,U){it.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});var ie=U("VTBJ");function Y(N,z){var I=Object(ie.a)({},N);return Array.isArray(z)&&z.forEach(function(M){delete I[M]}),I}},c5Ni:function(it,Ee,U){},d5o6:function(it,Ee,U){it.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(it,Ee,U){},dmUQ:function(it,Ee,U){"use strict";var ie=U("Ff2n"),Y=U("rePB"),N=U("1OyB"),z=U("vuIU"),I=U("Ji7U"),M=U("md7G"),G=U("foSv"),K=U("q1tI"),n=U.n(K),L=U("TSYQ"),x=U.n(L),f=U("4IlW");function b(d,c){var C=Object.keys(d);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(d);c&&(E=E.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable})),C.push.apply(C,E)}return C}function h(d){for(var c=1;c1?te-1:0),Te=1;Te1?m-1:0),H=1;H=0)return parseInt(k.slice(k.indexOf("e-")+2),10);var m=0;return k.indexOf(".")>=0&&(m=k.length-k.indexOf(".")-1),m},w.getInputDisplayValue=function(T){var k=T||w.state,m=k.focused,y=k.inputValue,H=k.value,Q;m?Q=y:Q=w.toPrecisionAsStep(H),Q==null&&(Q="");var te=w.formatWrapper(Q);return S(w.props.decimalSeparator)&&(te=te.toString().replace(".",w.props.decimalSeparator)),te},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 k=w.input.value,m=k.lastIndexOf(T);if(m===-1)return!1;var y=w.cursorBefore.length;return w.lastKeyCode===f.a.DELETE&&w.cursorBefore.charAt(y-1)===T[0]?(w.fixCaret(y,y),!0):m+T.length===k.length?(w.fixCaret(m,m),!0):!1},w.partRestoreByAfter=function(T){return T===void 0?!1:Array.prototype.some.call(T,function(k,m){var y=T.substring(m);return w.restoreByAfter(y)})},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,k,m){w.pressingUpOrDown=!0,w.step("down",T,k,m)},w.up=function(T,k,m){w.pressingUpOrDown=!0,w.step("up",T,k,m)},w.saveInput=function(T){w.input=T};var B=E.value;B===void 0&&(B=E.defaultValue),w.state={focused:E.autoFocus};var W=w.getValidValue(w.toNumber(B));return w.state=h(h({},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 B=this.props,W=B.value,T=B.onChange,k=B.max,m=B.min,y=this.state.focused;if(w){if(!R(w.value,W)||!R(w.max,k)||!R(w.min,m)){var H=y?W:this.getValidValue(W),Q;this.pressingUpOrDown?Q=H:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:Q})}var te="value"in this.props?W:this.state.value;"max"in this.props&&w.max!==k&&typeof te=="number"&&te>k&&T&&T(k),"min"in this.props&&w.min!==m&&typeof te=="number"&&te1&&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:(TW&&(T=W),T)}},{key:"setValue",value:function(w,B){var W=this.props.precision,T=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),k=this.state.value,m=k===void 0?null:k,y=this.state.inputValue,H=y===void 0?null:y,Q=typeof T=="number"?T.toFixed(W):"".concat(T),te=T!==m||Q!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},B)):this.setState({value:T,inputValue:this.toPrecisionAsStep(w)},B),te&&this.props.onChange(T),T}},{key:"getMaxPrecision",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.props,T=W.precision,k=W.step;if(S(T))return T;var m=this.getPrecision(B),y=this.getPrecision(k),H=this.getPrecision(w);return w?Math.max(H,m+y):m+y}},{key:"getPrecisionFactor",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,W=this.getMaxPrecision(w,B);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 B=Math.abs(this.getMaxPrecision(w));return isNaN(B)?w.toString():Number(w).toFixed(B)}},{key:"toNumber",value:function(w){var B=this.props.precision,W=this.state.focused,T=w&&w.length>16&&W;return this.isNotCompleteNumber(w)||T?w:S(B)?Math.round(w*Math.pow(10,B))/Math.pow(10,B):Number(w)}},{key:"upStep",value:function(w,B){var W=this.props.step,T=this.getPrecisionFactor(w,B),k=Math.abs(this.getMaxPrecision(w,B)),m=((T*w+T*W*B)/T).toFixed(k);return this.toNumber(m)}},{key:"downStep",value:function(w,B){var W=this.props.step,T=this.getPrecisionFactor(w,B),k=Math.abs(this.getMaxPrecision(w,B)),m=((T*w-T*W*B)/T).toFixed(k);return this.toNumber(m)}},{key:"step",value:function(w,B){var W=this,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var m=this.props;if(m.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var H=this["".concat(w,"Step")](y,T),Q=H>m.max||Hm.max?H=m.max:H=ae),ne=(ft||ft===0)&&(isNaN(ft)||Number(ft)<=Te),q=me||T||k,se=ne||T||k,ue=x()("".concat(W,"-handler"),"".concat(W,"-handler-up"),Object(Y.a)({},"".concat(W,"-handler-up-disabled"),q)),oe=x()("".concat(W,"-handler"),"".concat(W,"-handler-down"),Object(Y.a)({},"".concat(W,"-handler-down-disabled"),se)),ce=m?{onTouchStart:q?l:this.up,onTouchEnd:this.stop}:{onMouseDown:q?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},be=m?{onTouchStart:se?l:this.down,onTouchEnd:this.stop}:{onMouseDown:se?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return n.a.createElement("div",{className:pt,style:_e,title:ge,onMouseEnter:ve,onMouseLeave:Oe,onMouseOver:he,onMouseOut:V,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"},ce,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:ue}),H||n.a.createElement("span",{unselectable:"on",className:"".concat(W,"-handler-up-inner"),onClick:u})),n.a.createElement("span",Object.assign({unselectable:"on"},be,{role:"button","aria-label":"Decrease Value","aria-disabled":se,className:oe}),Q||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":Te,"aria-valuemax":ae,"aria-valuenow":ft,required:P,type:J,placeholder:X,onPaste:Qe,onClick:j,onMouseUp:this.onMouseUp,className:"".concat(W,"-input"),tabIndex:$,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Tt?this.onKeyDown:l,onKeyUp:Tt?this.onKeyUp:l,autoFocus:ke,maxLength:we,readOnly:k,disabled:T,max:ae,min:Te,step:pe,name:Ue,title:ge,id:ye,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(bt),pattern:Ke,inputMode:Re,onInput:nt},Ye))))}}]),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 g=O,_=Ee.a=g},fAei:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return i.a});var ie=U("rePB"),Y=U("VTBJ"),N=U("KQm4"),z=U("1OyB"),I=U("vuIU"),M=U("Ji7U"),G=U("LK+K"),K=U("q1tI"),n=U("4IlW"),L=U("Kwbf"),x=U("TSYQ"),f=U.n(x),b=U("sboe"),h=U("OZM5"),o=U("815F"),p=U("ODXe"),l=U("Ff2n"),u=U("+nKL"),s=U("8XRh"),i=U("WaYH"),D=function(Te,_e){var ge=Te.className,ve=Te.style,Oe=Te.motion,he=Te.motionNodes,V=Te.motionType,P=Te.onMotionStart,j=Te.onMotionEnd,$=Te.active,J=Te.treeNodeRequiredProps,X=Object(l.a)(Te,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),ye=K.useState(!0),Re=Object(p.a)(ye,2),Ke=Re[0],pe=Re[1],we=K.useContext(b.a),ke=we.prefixCls,Ue=K.useRef(!1),Qe=function(){Ue.current||j(),Ue.current=!0};return Object(K.useEffect)(function(){he&&V==="hide"&&Ke&&pe(!1)},[he]),Object(K.useEffect)(function(){return he&&P(),function(){he&&Qe()}},[]),he?K.createElement(s.default,Object.assign({ref:_e,visible:Ke},Oe,{motionAppear:V==="show",onAppearEnd:Qe,onLeaveEnd:Qe}),function(nt,ot){var qe=nt.className,ft=nt.style;return K.createElement("div",{ref:ot,className:f()("".concat(ke,"-treenode-motion"),qe),style:ft},he.map(function(lt){var pt=lt.data,Ye=pt.key,Tt=Object(l.a)(pt,["key"]),bt=lt.isStart,me=lt.isEnd;delete Tt.children;var ne=Object(o.f)(Ye,J);return K.createElement(i.a,Object.assign({},Tt,ne,{active:$,data:lt.data,key:Ye,isStart:bt,isEnd:me}))}))}):K.createElement(i.a,Object.assign({domRef:_e,className:ge,style:ve},X,{active:$}))};D.displayName="MotionTreeNode";var A=K.forwardRef(D),S=A;function R(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],_e=ae.length,ge=Te.length;if(Math.abs(_e-ge)!==1)return{add:!1,key:null};function ve(Oe,he){var V=new Map;Oe.forEach(function(j){V.set(j,!0)});var P=he.filter(function(j){return!V.has(j)});return P.length===1?P[0]:null}return _e ").concat(Te);return Te}var T=function(Te,_e){var ge=Te.prefixCls,ve=Te.data,Oe=Te.selectable,he=Te.checkable,V=Te.expandedKeys,P=Te.selectedKeys,j=Te.checkedKeys,$=Te.loadedKeys,J=Te.loadingKeys,X=Te.halfCheckedKeys,ye=Te.keyEntities,Re=Te.disabled,Ke=Te.dragging,pe=Te.dragOverNodeKey,we=Te.dropPosition,ke=Te.motion,Ue=Te.height,Qe=Te.itemHeight,nt=Te.virtual,ot=Te.focusable,qe=Te.activeItem,ft=Te.focused,lt=Te.tabIndex,pt=Te.onKeyDown,Ye=Te.onFocus,Tt=Te.onBlur,bt=Te.onActiveChange,me=Te.onListChangeStart,ne=Te.onListChangeEnd,q=Object(l.a)(Te,["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"]),se=K.useRef(null);K.useImperativeHandle(_e,function(){return{scrollTo:function(an){se.current.scrollTo(an)}}});var ue=K.useState(V),oe=Object(p.a)(ue,2),ce=oe[0],be=oe[1],Se=K.useState(ve),Pe=Object(p.a)(Se,2),We=Pe[0],et=Pe[1],yt=K.useState(ve),Rt=Object(p.a)(yt,2),kt=Rt[0],mn=Rt[1],zt=K.useState([]),Mt=Object(p.a)(zt,2),Qn=Mt[0],un=Mt[1],hr=K.useState(null),or=Object(p.a)(hr,2),bn=or[0],xr=or[1];function br(){et(ve),mn(ve),un([]),xr(null),ne()}K.useEffect(function(){be(V);var Ht=R(ce,V);if(Ht.key!==null)if(Ht.add){var an=We.findIndex(function(Rn){var jn=Rn.data.key;return jn===Ht.key}),Cn=w(O(We,ve,Ht.key),nt,Ue,Qe),qn=We.slice();qn.splice(an+1,0,E),mn(qn),un(Cn),xr("show")}else{var Ir=ve.findIndex(function(Rn){var jn=Rn.data.key;return jn===Ht.key}),gn=w(O(ve,We,Ht.key),nt,Ue,Qe),wt=ve.slice();wt.splice(Ir+1,0,E),mn(wt),un(gn),xr("hide")}else We!==ve&&(et(ve),mn(ve))},[V,ve]),K.useEffect(function(){Ke||br()},[Ke]);var Ar=ke?kt:ve,Br={expandedKeys:V,selectedKeys:P,loadedKeys:$,loadingKeys:J,checkedKeys:j,halfCheckedKeys:X,dragOverNodeKey:pe,dropPosition:we,keyEntities:ye};return K.createElement(K.Fragment,null,ft&&qe&&K.createElement("span",{style:g,"aria-live":"assertive"},W(qe)),K.createElement("div",{role:"tree"},K.createElement("input",{style:g,disabled:ot===!1||Re,tabIndex:ot!==!1?lt:null,onKeyDown:pt,onFocus:Ye,onBlur:Tt,value:"",onChange:_})),K.createElement(u.a,Object.assign({},q,{data:Ar,itemKey:B,height:Ue,fullHeight:!1,virtual:nt,itemHeight:Qe,prefixCls:"".concat(ge,"-list"),ref:se}),function(Ht){var an=Ht.pos,Cn=Ht.data,qn=Cn.key,Ir=Object(l.a)(Cn,["key"]),gn=Ht.isStart,wt=Ht.isEnd,Rn=Object(o.e)(qn,an);delete Ir.children;var jn=Object(o.f)(Rn,Br);return K.createElement(S,Object.assign({},Ir,jn,{active:qe&&qn===qe.data.key,pos:an,data:Ht.data,isStart:gn,isEnd:wt,motion:ke,motionNodes:qn===d?Qn:null,motionType:bn,onMotionStart:me,onMotionEnd:br,treeNodeRequiredProps:Br,onMouseMove:function(){bt(null)}}))}))},k=K.forwardRef(T);k.displayName="NodeList";var m=k,y=U("NvD2"),H=function(ae){Object(M.a)(_e,ae);var Te=Object(G.a)(_e);function _e(){var ge;return Object(z.a)(this,_e),ge=Te.apply(this,arguments),ge.destroyed=!1,ge.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},ge.listRef=K.createRef(),ge.onNodeDragStart=function(ve,Oe){var he=ge.state,V=he.expandedKeys,P=he.keyEntities,j=ge.props.onDragStart,$=Oe.props.eventKey;ge.dragNode=Oe;var J=Object(h.b)(V,$);ge.setState({dragging:!0,dragNodesKeys:Object(h.g)($,P)}),ge.setExpandedKeys(J),j&&j({event:ve,node:Object(o.b)(Oe.props)})},ge.onNodeDragEnter=function(ve,Oe){var he=ge.state,V=he.expandedKeys,P=he.keyEntities,j=he.dragNodesKeys,$=ge.props.onDragEnter,J=Oe.props,X=J.pos,ye=J.eventKey;if(!ge.dragNode||j.indexOf(ye)!==-1)return;var Re=Object(h.c)(ve,Oe);if(ge.dragNode.props.eventKey===ye&&Re===0){ge.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ge.setState({dragOverNodeKey:ye,dropPosition:Re}),ge.delayedDragEnterLogic||(ge.delayedDragEnterLogic={}),Object.keys(ge.delayedDragEnterLogic).forEach(function(Ke){clearTimeout(ge.delayedDragEnterLogic[Ke])}),ge.delayedDragEnterLogic[X]=window.setTimeout(function(){if(!ge.state.dragging)return;var Ke=Object(N.a)(V),pe=P[ye];pe&&(pe.children||[]).length&&(Ke=Object(h.a)(V,ye)),"expandedKeys"in ge.props||ge.setExpandedKeys(Ke),$&&$({event:ve,node:Object(o.b)(Oe.props),expandedKeys:Ke})},400)},0)},ge.onNodeDragOver=function(ve,Oe){var he=ge.state.dragNodesKeys,V=ge.props.onDragOver,P=Oe.props.eventKey;if(he.indexOf(P)!==-1)return;if(ge.dragNode&&P===ge.state.dragOverNodeKey){var j=Object(h.c)(ve,Oe);if(j===ge.state.dropPosition)return;ge.setState({dropPosition:j})}V&&V({event:ve,node:Object(o.b)(Oe.props)})},ge.onNodeDragLeave=function(ve,Oe){var he=ge.props.onDragLeave;ge.setState({dragOverNodeKey:""}),he&&he({event:ve,node:Object(o.b)(Oe.props)})},ge.onNodeDragEnd=function(ve,Oe){var he=ge.props.onDragEnd;ge.setState({dragOverNodeKey:""}),ge.cleanDragState(),he&&he({event:ve,node:Object(o.b)(Oe.props)}),ge.dragNode=null},ge.onNodeDrop=function(ve,Oe){var he=ge.state,V=he.dragNodesKeys,P=V===void 0?[]:V,j=he.dropPosition,$=ge.props.onDrop,J=Oe.props,X=J.eventKey,ye=J.pos;if(ge.setState({dragOverNodeKey:""}),ge.cleanDragState(),P.indexOf(X)!==-1){Object(L.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Re=Object(h.k)(ye),Ke={event:ve,node:Object(o.b)(Oe.props),dragNode:ge.dragNode?Object(o.b)(ge.dragNode.props):null,dragNodesKeys:P.slice(),dropPosition:j+Number(Re[Re.length-1]),dropToGap:!1};j!==0&&(Ke.dropToGap=!0),$&&$(Ke),ge.dragNode=null},ge.cleanDragState=function(){var ve=ge.state.dragging;ve&&ge.setState({dragging:!1})},ge.onNodeClick=function(ve,Oe){var he=ge.props.onClick;he&&he(ve,Oe)},ge.onNodeDoubleClick=function(ve,Oe){var he=ge.props.onDoubleClick;he&&he(ve,Oe)},ge.onNodeSelect=function(ve,Oe){var he=ge.state.selectedKeys,V=ge.state.keyEntities,P=ge.props,j=P.onSelect,$=P.multiple,J=Oe.selected,X=Oe.key,ye=!J;ye?$?he=Object(h.a)(he,X):he=[X]:he=Object(h.b)(he,X);var Re=he.map(function(Ke){var pe=V[Ke];return pe?pe.node:null}).filter(function(Ke){return Ke});ge.setUncontrolledState({selectedKeys:he}),j&&j(he,{event:"select",selected:ye,node:Oe,selectedNodes:Re,nativeEvent:ve.nativeEvent})},ge.onNodeCheck=function(ve,Oe,he){var V=ge.state,P=V.keyEntities,j=V.checkedKeys,$=V.halfCheckedKeys,J=ge.props,X=J.checkStrictly,ye=J.onCheck,Re=Oe.key,Ke,pe={event:"check",node:Oe,checked:he,nativeEvent:ve.nativeEvent};if(X){var we=he?Object(h.a)(j,Re):Object(h.b)(j,Re),ke=Object(h.b)($,Re);Ke={checked:we,halfChecked:ke},pe.checkedNodes=we.map(function(ft){return P[ft]}).filter(function(ft){return ft}).map(function(ft){return ft.node}),ge.setUncontrolledState({checkedKeys:we})}else{var Ue=Object(y.a)([].concat(Object(N.a)(j),[Re]),!0,P),Qe=Ue.checkedKeys,nt=Ue.halfCheckedKeys;if(!he){var ot=new Set(Qe);ot.delete(Re);var qe=Object(y.a)(Array.from(ot),{checked:!1,halfCheckedKeys:nt},P);Qe=qe.checkedKeys,nt=qe.halfCheckedKeys}Ke=Qe,pe.checkedNodes=[],pe.checkedNodesPositions=[],pe.halfCheckedKeys=nt,Qe.forEach(function(ft){var lt=P[ft];if(!lt)return;var pt=lt.node,Ye=lt.pos;pe.checkedNodes.push(pt),pe.checkedNodesPositions.push({node:pt,pos:Ye})}),ge.setUncontrolledState({checkedKeys:Qe},!1,{halfCheckedKeys:nt})}ye&&ye(Ke,pe)},ge.onNodeLoad=function(ve){return new Promise(function(Oe){ge.setState(function(he){var V=he.loadedKeys,P=V===void 0?[]:V,j=he.loadingKeys,$=j===void 0?[]:j,J=ge.props,X=J.loadData,ye=J.onLoad,Re=ve.key;if(!X||P.indexOf(Re)!==-1||$.indexOf(Re)!==-1)return{};var Ke=X(ve);return Ke.then(function(){var pe=ge.state,we=pe.loadedKeys,ke=pe.loadingKeys,Ue=Object(h.a)(we,Re),Qe=Object(h.b)(ke,Re);ye&&ye(Ue,{event:"load",node:ve}),ge.setUncontrolledState({loadedKeys:Ue}),ge.setState({loadingKeys:Qe}),Oe()}),{loadingKeys:Object(h.a)($,Re)}})})},ge.onNodeMouseEnter=function(ve,Oe){var he=ge.props.onMouseEnter;he&&he({event:ve,node:Oe})},ge.onNodeMouseLeave=function(ve,Oe){var he=ge.props.onMouseLeave;he&&he({event:ve,node:Oe})},ge.onNodeContextMenu=function(ve,Oe){var he=ge.props.onRightClick;he&&(ve.preventDefault(),he({event:ve,node:Oe}))},ge.onFocus=function(){var ve=ge.props.onFocus;ge.setState({focused:!0}),ve&&ve.apply(void 0,arguments)},ge.onBlur=function(){var ve=ge.props.onBlur;ge.setState({focused:!1}),ge.onActiveChange(null),ve&&ve.apply(void 0,arguments)},ge.getTreeNodeRequiredProps=function(){var ve=ge.state,Oe=ve.expandedKeys,he=ve.selectedKeys,V=ve.loadedKeys,P=ve.loadingKeys,j=ve.checkedKeys,$=ve.halfCheckedKeys,J=ve.dragOverNodeKey,X=ve.dropPosition,ye=ve.keyEntities;return{expandedKeys:Oe||[],selectedKeys:he||[],loadedKeys:V||[],loadingKeys:P||[],checkedKeys:j||[],halfCheckedKeys:$||[],dragOverNodeKey:J,dropPosition:X,keyEntities:ye}},ge.setExpandedKeys=function(ve){var Oe=ge.state.treeData,he=Object(o.d)(Oe,ve);ge.setUncontrolledState({expandedKeys:ve,flattenNodes:he},!0)},ge.onNodeExpand=function(ve,Oe){var he=ge.state.expandedKeys,V=ge.state.listChanging,P=ge.props,j=P.onExpand,$=P.loadData,J=Oe.key,X=Oe.expanded;if(V)return;var ye=he.indexOf(J),Re=!X;if(Object(L.a)(X&&ye!==-1||!X&&ye===-1,"Expand state not sync with index check"),Re?he=Object(h.a)(he,J):he=Object(h.b)(he,J),ge.setExpandedKeys(he),j&&j(he,{node:Oe,expanded:Re,nativeEvent:ve.nativeEvent}),Re&&$){var Ke=ge.onNodeLoad(Oe);Ke&&Ke.then(function(){var pe=Object(o.d)(ge.state.treeData,he);ge.setUncontrolledState({flattenNodes:pe})})}},ge.onListChangeStart=function(){ge.setUncontrolledState({listChanging:!0})},ge.onListChangeEnd=function(){setTimeout(function(){ge.setUncontrolledState({listChanging:!1})})},ge.onActiveChange=function(ve){var Oe=ge.state.activeKey,he=ge.props.onActiveChange;if(Oe===ve)return;ge.setState({activeKey:ve}),ve!==null&&ge.scrollTo({key:ve}),he&&he(ve)},ge.getActiveItem=function(){var ve=ge.state,Oe=ve.activeKey,he=ve.flattenNodes;return Oe===null?null:he.find(function(V){var P=V.data.key;return P===Oe})||null},ge.offsetActiveKey=function(ve){var Oe=ge.state,he=Oe.flattenNodes,V=Oe.activeKey,P=he.findIndex(function(J){var X=J.data.key;return X===V});P===-1&&ve<0&&(P=he.length),P=(P+ve+he.length)%he.length;var j=he[P];if(j){var $=j.data.key;ge.onActiveChange($)}else ge.onActiveChange(null)},ge.onKeyDown=function(ve){var Oe=ge.state,he=Oe.activeKey,V=Oe.expandedKeys,P=Oe.checkedKeys,j=ge.props,$=j.onKeyDown,J=j.checkable,X=j.selectable;switch(ve.which){case n.a.UP:{ge.offsetActiveKey(-1),ve.preventDefault();break}case n.a.DOWN:{ge.offsetActiveKey(1),ve.preventDefault();break}}var ye=ge.getActiveItem();if(ye&&ye.data){var Re=ge.getTreeNodeRequiredProps(),Ke=ye.data.isLeaf===!1||!!(ye.data.children||[]).length,pe=Object(o.b)(Object(Y.a)(Object(Y.a)({},Object(o.f)(he,Re)),{},{data:ye.data,active:!0}));switch(ve.which){case n.a.LEFT:{Ke&&V.includes(he)?ge.onNodeExpand({},pe):ye.parent&&ge.onActiveChange(ye.parent.data.key),ve.preventDefault();break}case n.a.RIGHT:{Ke&&!V.includes(he)?ge.onNodeExpand({},pe):ye.children&&ye.children.length&&ge.onActiveChange(ye.children[0].data.key),ve.preventDefault();break}case n.a.ENTER:case n.a.SPACE:{J&&!pe.disabled&&pe.checkable!==!1&&!pe.disableCheckbox?ge.onNodeCheck({},pe,!P.includes(he)):!J&&X&&!pe.disabled&&pe.selectable!==!1&&ge.onNodeSelect({},pe);break}}}$&&$(ve)},ge.setUncontrolledState=function(ve){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ge.destroyed)return;var V=!1,P=!0,j={};Object.keys(ve).forEach(function($){if($ in ge.props){P=!1;return}V=!0,j[$]=ve[$]}),V&&(!Oe||P)&&ge.setState(Object(Y.a)(Object(Y.a)({},j),he))},ge.scrollTo=function(ve){ge.listRef.current.scrollTo(ve)},ge}return Object(I.a)(_e,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ve,Oe=this.state,he=Oe.focused,V=Oe.flattenNodes,P=Oe.keyEntities,j=Oe.dragging,$=Oe.activeKey,J=this.props,X=J.prefixCls,ye=J.className,Re=J.style,Ke=J.showLine,pe=J.focusable,we=J.tabIndex,ke=we===void 0?0:we,Ue=J.selectable,Qe=J.showIcon,nt=J.icon,ot=J.switcherIcon,qe=J.draggable,ft=J.checkable,lt=J.checkStrictly,pt=J.disabled,Ye=J.motion,Tt=J.loadData,bt=J.filterTreeNode,me=J.height,ne=J.itemHeight,q=J.virtual,se=J.titleRender,ue=J.onContextMenu,oe=Object(h.f)(this.props);return K.createElement(b.a.Provider,{value:{prefixCls:X,selectable:Ue,showIcon:Qe,icon:nt,switcherIcon:ot,draggable:qe,checkable:ft,checkStrictly:lt,disabled:pt,keyEntities:P,loadData:Tt,filterTreeNode:bt,titleRender:se,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()(X,ye,(ve={},Object(ie.a)(ve,"".concat(X,"-show-line"),Ke),Object(ie.a)(ve,"".concat(X,"-focused"),he),Object(ie.a)(ve,"".concat(X,"-active-focused"),$!==null),ve))},K.createElement(m,Object.assign({ref:this.listRef,prefixCls:X,style:Re,data:V,disabled:pt,selectable:Ue,checkable:!!ft,motion:Ye,dragging:j,height:me,itemHeight:ne,virtual:q,focusable:pe,focused:he,tabIndex:ke,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ue},this.getTreeNodeRequiredProps(),oe))))}}],[{key:"getDerivedStateFromProps",value:function(ve,Oe){var he=Oe.prevProps,V={prevProps:ve};function P(nt){return!he&&nt in ve||he&&he[nt]!==ve[nt]}var j;if(P("treeData")?j=ve.treeData:P("children")&&(Object(L.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),j=Object(o.c)(ve.children)),j){V.treeData=j;var $=Object(o.a)(j);V.keyEntities=Object(Y.a)(Object(ie.a)({},d,C),$.keyEntities)}var J=V.keyEntities||Oe.keyEntities;if(P("expandedKeys")||he&&P("autoExpandParent"))V.expandedKeys=ve.autoExpandParent||!he&&ve.defaultExpandParent?Object(h.e)(ve.expandedKeys,J):ve.expandedKeys;else if(!he&&ve.defaultExpandAll){var X=Object(Y.a)({},J);delete X[d],V.expandedKeys=Object.keys(X).map(function(nt){return X[nt].key})}else!he&&ve.defaultExpandedKeys&&(V.expandedKeys=ve.autoExpandParent||ve.defaultExpandParent?Object(h.e)(ve.defaultExpandedKeys,J):ve.defaultExpandedKeys);if(V.expandedKeys||delete V.expandedKeys,j||V.expandedKeys){var ye=Object(o.d)(j||Oe.treeData,V.expandedKeys||Oe.expandedKeys);V.flattenNodes=ye}if(ve.selectable&&(P("selectedKeys")?V.selectedKeys=Object(h.d)(ve.selectedKeys,ve):!he&&ve.defaultSelectedKeys&&(V.selectedKeys=Object(h.d)(ve.defaultSelectedKeys,ve))),ve.checkable){var Re;if(P("checkedKeys")?Re=Object(h.j)(ve.checkedKeys)||{}:!he&&ve.defaultCheckedKeys?Re=Object(h.j)(ve.defaultCheckedKeys)||{}:j&&(Re=Object(h.j)(ve.checkedKeys)||{checkedKeys:Oe.checkedKeys,halfCheckedKeys:Oe.halfCheckedKeys}),Re){var Ke=Re,pe=Ke.checkedKeys,we=pe===void 0?[]:pe,ke=Ke.halfCheckedKeys,Ue=ke===void 0?[]:ke;if(!ve.checkStrictly){var Qe=Object(y.a)(we,!0,J);we=Qe.checkedKeys,Ue=Qe.halfCheckedKeys}V.checkedKeys=we,V.halfCheckedKeys=Ue}}return P("loadedKeys")&&(V.loadedKeys=ve.loadedKeys),V}}]),_e}(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 Q=H,te=Ee.b=Q},fcSX:function(it,Ee,U){"use strict";var ie=U("Ff2n"),Y=U("1OyB"),N=U("vuIU"),z=U("Ji7U"),I=U("md7G"),M=U("foSv"),G=U("1W/9"),K=U("q1tI"),n=U("rePB"),L=U("JX7q"),x=U("TSYQ"),f=U.n(x),b=U("qx4F"),h=U("4IlW");function o(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 k=document.getElementsByTagName("html")[0];return T in(k?k.style:{})})[0],u=p[l];function s(T,k,m,y){T.addEventListener?T.addEventListener(k,m,y):T.attachEvent&&T.attachEvent("on".concat(k),m)}function i(T,k,m,y){T.removeEventListener?T.removeEventListener(k,m,y):T.attachEvent&&T.detachEvent("on".concat(k),m)}function D(T,k){var m=typeof T=="function"?T(k):T;return Array.isArray(m)?m.length===2?m:[m[0],m[1]]:[m]}var A=function(k){return!isNaN(parseFloat(k))&&isFinite(k)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),R=function T(k,m,y,H){if(!m||m===document||m instanceof Document)return!1;if(m===k.parentNode)return!0;var Q=Math.max(Math.abs(y),Math.abs(H))===Math.abs(H),te=Math.max(Math.abs(y),Math.abs(H))===Math.abs(y),ae=m.scrollHeight-m.clientHeight,Te=m.scrollWidth-m.clientWidth,_e=document.defaultView.getComputedStyle(m),ge=_e.overflowY==="auto"||_e.overflowY==="scroll",ve=_e.overflowX==="auto"||_e.overflowX==="scroll",Oe=ae&&ge,he=Te&&ve;return Q&&(!Oe||Oe&&(m.scrollTop>=ae&&H<0||m.scrollTop<=0&&H>0))||te&&(!he||he&&(m.scrollLeft>=Te&&y<0||m.scrollLeft<=0&&y>0))?T(k,m.parentNode,y,H):!1};function O(T){var k=g();return function(){var y=Object(M.a)(T),H;if(k){var Q=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,Q)}else H=y.apply(this,arguments);return Object(I.a)(this,H)}}function g(){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 _={},d=function(T){Object(z.a)(m,T);var k=O(m);function m(y){var H;return Object(Y.a)(this,m),H=k.call(this,y),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(Q){if(Q.touches.length>1)return;H.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},H.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var te=Q.currentTarget,ae=Q.changedTouches[0].clientX-H.startPos.x,Te=Q.changedTouches[0].clientY-H.startPos.y;(te===H.maskDom||te===H.handlerDom||te===H.contentDom&&R(te,Q.target,ae,Te))&&Q.cancelable&&Q.preventDefault()},H.transitionEnd=function(Q){var te=Q.target;i(te,u,H.transitionEnd),te.style.transition=""},H.onKeyDown=function(Q){if(Q.keyCode===h.a.ESC){var te=H.props.onClose;Q.stopPropagation(),te&&te(Q)}},H.onWrapperTransitionEnd=function(Q){var te=H.props,ae=te.open,Te=te.afterVisibleChange;Q.target===H.contentWrapper&&Q.propertyName.match(/transform$/)&&(H.dom.style.transition="",!ae&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),Te&&Te(!!ae))},H.openLevelTransition=function(){var Q=H.props,te=Q.open,ae=Q.width,Te=Q.height,_e=H.getHorizontalBoolAndPlacementName(),ge=_e.isHorizontal,ve=_e.placementName,Oe=H.contentDom?H.contentDom.getBoundingClientRect()[ge?"width":"height"]:0,he=(ge?ae:Te)||Oe;H.setLevelAndScrolling(te,ve,he)},H.setLevelTransform=function(Q,te,ae,Te){var _e=H.props,ge=_e.placement,ve=_e.levelMove,Oe=_e.duration,he=_e.ease,V=_e.showMask;H.levelDom.forEach(function(P){P.style.transition="transform ".concat(Oe," ").concat(he),s(P,u,H.transitionEnd);var j=Q?ae:0;if(ve){var $=D(ve,{target:P,open:Q});j=Q?$[0]:$[1]||0}var J=typeof j=="number"?"".concat(j,"px"):j,X=ge==="left"||ge==="top"?J:"-".concat(J);X=V&&ge==="right"&&Te?"calc(".concat(X," + ").concat(Te,"px)"):X,P.style.transform=j?"".concat(te,"(").concat(X,")"):""})},H.setLevelAndScrolling=function(Q,te,ae){var Te=H.props.onChange;if(!S){var _e=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(b.a)(!0):0;H.setLevelTransform(Q,te,ae,_e),H.toggleScrollingToDrawerAndBody(_e)}Te&&Te(Q)},H.toggleScrollingToDrawerAndBody=function(Q){var te=H.props,ae=te.getOpenCount,Te=te.getContainer,_e=te.showMask,ge=te.open,ve=Te&&Te(),Oe=ae&&ae();if(ve&&ve.parentNode===document.body&&_e){var he=["touchstart"],V=[document.body,H.maskDom,H.handlerDom,H.contentDom];ge&&document.body.style.overflow!=="hidden"?(Q&&H.addScrollingEffect(Q),Oe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",V.forEach(function(P,j){if(!P)return;s(P,he[j]||"touchmove",j?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Oe||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&H.remScrollingEffect(Q),V.forEach(function(P,j){if(!P)return;i(P,he[j]||"touchmove",j?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(Q){var te=H.props,ae=te.placement,Te=te.duration,_e=te.ease,ge=te.getOpenCount,ve=te.switchScrollingEffect,Oe=ge&&ge();Oe===1&&ve();var he="width ".concat(Te," ").concat(_e),V="transform ".concat(Te," ").concat(_e);H.dom.style.transition="none";switch(ae){case"right":H.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(Q,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(V,",").concat(he),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(Q){var te=H.props,ae=te.placement,Te=te.duration,_e=te.ease,ge=te.getOpenCount,ve=te.switchScrollingEffect,Oe=ge&&ge();Oe||ve(!0),l&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var he,V="width ".concat(Te," ").concat(_e),P="transform ".concat(Te," ").concat(_e);switch(ae){case"left":{H.dom.style.width="100%",V="width 0s ".concat(_e," ").concat(Te);break}case"right":{H.dom.style.transform="translateX(".concat(Q,"px)"),H.dom.style.width="100%",V="width 0s ".concat(_e," ").concat(Te),H.maskDom&&(H.maskDom.style.left="-".concat(Q,"px"),H.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(Q,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",he="height 0s ".concat(_e," ").concat(Te);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(P,",").concat(he?"".concat(he,","):"").concat(V),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(Q){return _[Q]})},H.getLevelDom=function(Q){var te=Q.level,ae=Q.getContainer;if(S)return;var Te=ae&&ae(),_e=Te?Te.parentNode:null;if(H.levelDom=[],te==="all"){var ge=_e?Array.prototype.slice.call(_e.children):[];ge.forEach(function(ve){ve.nodeName!=="SCRIPT"&&ve.nodeName!=="STYLE"&&ve.nodeName!=="LINK"&&ve!==Te&&H.levelDom.push(ve)})}else te&&o(te).forEach(function(ve){document.querySelectorAll(ve).forEach(function(Oe){H.levelDom.push(Oe)})})},H.getHorizontalBoolAndPlacementName=function(){var Q=H.props.placement,te=Q==="left"||Q==="right",ae="translate".concat(te?"X":"Y");return{isHorizontal:te,placementName:ae}},H.state={_self:Object(L.a)(H)},H}return Object(N.a)(m,[{key:"componentDidMount",value:function(){var H=this;if(!S){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(ge){}this.passive=Q?{passive:!1}:!1}var te=this.props,ae=te.open,Te=te.getContainer,_e=Te&&Te();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ae&&(_e&&_e.parentNode===document.body&&(_[this.drawerId]=ae),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var Q=this.props,te=Q.open,ae=Q.getContainer,Te=ae&&ae();te!==H.open&&(te&&this.domFocus(),Te&&Te.parentNode===document.body&&(_[this.drawerId]=!!te),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,Q=H.getOpenCount,te=H.open,ae=H.switchScrollingEffect,Te=typeof Q=="function"&&Q();delete _[this.drawerId],te&&(this.setLevelTransform(!1),document.body.style.touchAction=""),Te||(document.body.style.overflow="",ae(!0))}},{key:"render",value:function(){var H,Q=this,te=this.props,ae=te.className,Te=te.children,_e=te.style,ge=te.width,ve=te.height,Oe=te.defaultOpen,he=te.open,V=te.prefixCls,P=te.placement,j=te.level,$=te.levelMove,J=te.ease,X=te.duration,ye=te.getContainer,Re=te.handler,Ke=te.onChange,pe=te.afterVisibleChange,we=te.showMask,ke=te.maskClosable,Ue=te.maskStyle,Qe=te.onClose,nt=te.onHandleClick,ot=te.keyboard,qe=te.getOpenCount,ft=te.switchScrollingEffect,lt=Object(ie.a)(te,["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"]),pt=this.dom?he:!1,Ye=f()(V,(H={},Object(n.a)(H,"".concat(V,"-").concat(P),!0),Object(n.a)(H,"".concat(V,"-open"),pt),Object(n.a)(H,ae||"",!!ae),Object(n.a)(H,"no-mask",!we),H)),Tt=this.getHorizontalBoolAndPlacementName(),bt=Tt.placementName,me=P==="left"||P==="top"?"-100%":"100%",ne=pt?"":"".concat(bt,"(").concat(me,")"),q=Re&&K.cloneElement(Re,{onClick:function(ue){Re.props.onClick&&Re.props.onClick(),nt&&nt(ue)},ref:function(ue){Q.handlerDom=ue}});return K.createElement("div",Object.assign({},lt,{tabIndex:-1,className:Ye,style:_e,ref:function(ue){Q.dom=ue},onKeyDown:pt&&ot?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),we&&K.createElement("div",{className:"".concat(V,"-mask"),onClick:ke?Qe:void 0,style:Ue,ref:function(ue){Q.maskDom=ue}}),K.createElement("div",{className:"".concat(V,"-content-wrapper"),style:{transform:ne,msTransform:ne,width:A(ge)?"".concat(ge,"px"):ge,height:A(ve)?"".concat(ve,"px"):ve},ref:function(ue){Q.contentWrapper=ue}},K.createElement("div",{className:"".concat(V,"-content"),ref:function(ue){Q.contentDom=ue},onTouchStart:pt&&we?this.removeStartHandler:void 0,onTouchMove:pt&&we?this.removeMoveHandler:void 0},Te),q))}}],[{key:"getDerivedStateFromProps",value:function(H,Q){var te=Q.prevProps,ae=Q._self,Te={prevProps:H};if(te!==void 0){var _e=H.placement,ge=H.level;_e!==te.placement&&(ae.contentDom=null),ge!==te.level&&ae.getLevelDom(H)}return Te}}]),m}(K.Component);d.defaultProps={switchScrollingEffect:function(){}};var c=d;function C(T){var k=E();return function(){var y=Object(M.a)(T),H;if(k){var Q=Object(M.a)(this).constructor;H=Reflect.construct(y,arguments,Q)}else H=y.apply(this,arguments);return Object(I.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)(m,T);var k=C(m);function m(y){var H;Object(Y.a)(this,m),H=k.call(this,y),H.onHandleClick=function(te){var ae=H.props,Te=ae.onHandleClick,_e=ae.open;if(Te&&Te(te),typeof _e=="undefined"){var ge=H.state.open;H.setState({open:!ge})}},H.onClose=function(te){var ae=H.props,Te=ae.onClose,_e=ae.open;Te&&Te(te),typeof _e=="undefined"&&H.setState({open:!1})};var Q=typeof y.open!="undefined"?y.open:!!y.defaultOpen;return H.state={open:Q},"onMaskClick"in y&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(N.a)(m,[{key:"render",value:function(){var H=this,Q=this.props,te=Q.defaultOpen,ae=Q.getContainer,Te=Q.wrapperClassName,_e=Q.forceRender,ge=Q.handler,ve=Object(ie.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Oe=this.state.open;if(!ae)return K.createElement("div",{className:Te,ref:function(P){H.dom=P}},K.createElement(c,Object.assign({},ve,{open:Oe,handler:ge,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var he=!!ge||_e;return K.createElement(G.a,{visible:Oe,forceRender:he,getContainer:ae,wrapperClassName:Te},function(V){var P=V.visible,j=V.afterClose,$=Object(ie.a)(V,["visible","afterClose"]);return K.createElement(c,Object.assign({},ve,$,{open:P!==void 0?P:Oe,afterVisibleChange:j!==void 0?j:ve.afterVisibleChange,handler:ge,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,Q){var te=Q.prevProps,ae={prevProps:H};return typeof te!="undefined"&&H.open!==te.open&&(ae.open=H.open),ae}}]),m}(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 B=w,W=Ee.a=B},fjLI:function(it,Ee,U){"use strict";U.d(Ee,"f",function(){return b}),U.d(Ee,"b",function(){return h}),U.d(Ee,"a",function(){return o}),U.d(Ee,"d",function(){return p}),U.d(Ee,"e",function(){return l}),U.d(Ee,"c",function(){return u});var ie=U("8HAY"),Y=U("Vhoy"),N=U("MI8n"),z=U("JYp7"),I=U("pmY6"),M=U("24hK"),G=U("nnTU"),K=U("T8No"),n=U("Cg/j"),L=U("t9D7"),x=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 g=s.length-1;g>=0;g--)(O=s[g])&&(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 b(s){return s.command!==void 0}class h{constructor(s){this.id=h._idPool++,this._debugName=s}}h._idPool=0,h.CommandPalette=new h("CommandPalette"),h.EditorContext=new h("EditorContext"),h.SimpleEditorContext=new h("SimpleEditorContext"),h.EditorContextCopy=new h("EditorContextCopy"),h.EditorContextPeek=new h("EditorContextPeek"),h.MenubarEditMenu=new h("MenubarEditMenu"),h.MenubarCopy=new h("MenubarCopy"),h.MenubarGoMenu=new h("MenubarGoMenu"),h.MenubarSelectionMenu=new h("MenubarSelectionMenu"),h.InlineCompletionsActions=new h("InlineCompletionsActions");const o=Object(n.c)("menuService"),p=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new N.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:s=>s===h.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(I.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 M.a;for(const{id:A,item:S}of s){let R=this._menuItems.get(A);R||(R=new M.a,this._menuItems.set(A,R)),D.push(R.push(S)),i.add(A)}return this._onDidChangeMenu.fire(i),Object(I.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===h.CommandPalette&&this._appendImplicitItems(i),i}_appendImplicitItems(s){const i=new Set;for(const D of s)b(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 ie.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 ie.d));return s.length&&s.pop(),s}}let u=class s{constructor(i,D,A,S,R){var O,g;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=(g=typeof i.tooltip=="string"?i.tooltip:(O=i.tooltip)===null||O===void 0?void 0:O.value)!==null&&g!==void 0?g:"",this.enabled=!i.precondition||S.contextMatchesRules(i.precondition),this.checked=void 0,i.toggled){const _=i.toggled.condition?i.toggled:{condition:i.toggled};this.checked=S.contextMatchesRules(_.condition),this.checked&&_.tooltip&&(this.tooltip=typeof _.tooltip=="string"?_.tooltip:_.tooltip.value),_.title&&(this.label=typeof _.title=="string"?_.title:_.title.value)}this.item=i,this.alt=D?new s(D,void 0,A,S,R):void 0,this._options=A,L.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=x([f(3,K.b),f(4,G.b)],u)},i8i3:function(it,Ee,U){it.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(it,Ee,U){it.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(it,Ee,U){"use strict";U.d(Ee,"a",function(){return z});var ie=U("FWmy"),Y=U("746U");class N{constructor(){this.data=new Map}add(I,M){ie.a(Y.l(I)),ie.a(Y.k(M)),ie.a(!this.data.has(I),"There is already an extension with this id"),this.data.set(I,M)}as(I){return this.data.get(I)||null}}const z=new N},iris:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return b});var ie=U("qVdP"),Y=U("jsC+"),N=U("lUTK"),z=U("BvKs"),I=U("tJVT"),M=U("q1tI"),G=U.n(M),K=U("Q0Vu"),n=U.n(K),L=[{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"}],x=[{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}],b=function(o){var p=o.showSelectAll,l=p===void 0?!1:p,u=o.disciplinesData,s=u===void 0?[]:u,i=o.knowledgeData,D=i===void 0?[]:i,A=o.directionValue,S=o.subDisciplineValue,R=o.typeValue,O=o.knowledgeValue,g=o.showKnowledge,_=g===void 0?!1:g,d=o.showRandomType,c=d===void 0?!1:d,C=o.difficultyValue,E=o.randomValue,w=o.selectAll,B=o.languagesvalue,W=o.className,T=o.languages,k=T===void 0?[]:T,m=o.isprogram_homework,y=o.showShixun,H=y===void 0?!1:y,Q=o.showItemType,te=Q===void 0?!0:Q,ae=o.onShixunChange,Te=ae===void 0?function(){}:ae,_e=o.onDirectionChange,ge=_e===void 0?function(){}:_e,ve=o.onTypeChange,Oe=ve===void 0?function(){}:ve,he=o.onDifficultyChange,V=he===void 0?function(){}:he,P=o.handlelanguagesChange,j=P===void 0?function(){}:P,$=o.onKnowledgeChange,J=$===void 0?function(){}:$,X=o.onRandomChange,ye=X===void 0?function(){}:X,Re=o.showTeachGroup,Ke=Re===void 0?!1:Re,pe=o.teachGroupData,we=pe===void 0?[]:pe,ke=o.onTeachGroupChange,Ue=ke===void 0?function(){}:ke,Qe=o.teachGroupValue,nt=Object(M.useState)(0),ot=Object(I.a)(nt,2),qe=ot[0],ft=ot[1],lt=Object(M.useRef)(null),pt=Object(M.useState)(0),Ye=Object(I.a)(pt,2),Tt=Ye[0],bt=Ye[1],me=Object(M.useRef)(null);Object(M.useEffect)(function(){if(s.length!==0){var q;(lt==null||((q=lt.current)===null||q===void 0)?void 0:q.clientHeight)>108?ft(1):ft(0)}s.length===0&&ft(0)},[s]),Object(M.useEffect)(function(){if(console.log(D.length===0,"\u6570\u91CF"),D.length!==0){var q,se;console.log(me==null||((q=me.current)===null||q===void 0)?void 0:q.clientHeight,"\u9AD8\u5EA6"),(me==null||((se=me.current)===null||se===void 0)?void 0:se.clientHeight)>108?bt(1):bt(0)}D.length===0&&bt(0)},[D]);var ne=function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ue=arguments.length>1?arguments[1]:void 0;return G.a.createElement(z.a,{className:n.a.subMenu},se.map(function(oe){return G.a.createElement(z.a.Item,{key:oe.id},G.a.createElement("a",{className:"".concat(n.a.subItem," ").concat(S===oe.id?n.a.subActive:""),onClick:function(){return ge(ue,oe.id)}},oe.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},m&&G.a.createElement("div",{className:n.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Ke&&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(Qe?"":n.a.active," "),onClick:function(){return Ue(null)}},"\u5168\u90E8"),we==null?void 0:we.map(function(q){return G.a.createElement("li",{key:q.group_id,className:"".concat(n.a.directionItem," ").concat(Qe===q.group_id?n.a.active:""," "),onClick:function(){return Ue(q.group_id)}},q.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:qe===1?88:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A?"":n.a.active," "),onClick:function(){return ge(null)}},"\u5168\u90E8"),s.map(function(q){var se;return G.a.createElement(G.a.Fragment,{key:q.id},((se=q.sub_disciplines)===null||se===void 0?void 0:se.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(oe){return oe.parentNode},overlay:function(){return ne(q.sub_disciplines,q.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name))})),G.a.createElement("div",{className:n.a.directionContentWrap,ref:lt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},s.map(function(q){var se;return G.a.createElement(G.a.Fragment,{key:q.id},((se=q.sub_disciplines)===null||se===void 0?void 0:se.length)>0?G.a.createElement(Y.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(oe){return oe.parentNode},overlay:function(){return ne(q.sub_disciplines,q.id)}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name)):G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(A===q.id?n.a.active:""," "),onClick:function(){return ge(q.id)}},q.name))})),!!qe&&G.a.createElement("div",{className:n.a.action},qe===1&&G.a.createElement("span",{onClick:function(){return ft(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),qe===2&&G.a.createElement("span",{onClick:function(){return ft(1)}},"\u6536\u8D77",G.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),_&&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:Tt===1?106:"auto"}},G.a.createElement("li",{className:"".concat(n.a.directionItem," ").concat(O===-1?n.a.active:""," "),onClick:function(){return J(-1)}},"\u5168\u90E8"),D.map(function(q){return G.a.createElement("li",{key:q.id,className:"".concat(n.a.directionItem," ").concat(O===q.id?n.a.active:""," "),onClick:function(){return J(q.id)}},q.name)})),G.a.createElement("div",{ref:me,className:n.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},D.map(function(q){return G.a.createElement("li",{key:q.id,className:"".concat(n.a.directionItem," ").concat(O===q.id?n.a.active:""," "),onClick:function(){return J(q.id)}},q.name)})),!!Tt&&G.a.createElement("div",{className:n.a.action},Tt===1&&G.a.createElement("span",{onClick:function(){return bt(2)}},"\u5C55\u5F00",G.a.createElement("i",{className:"iconfont icon-xiala"})),Tt===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"})))),te&&!m&&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 Oe(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},L.map(function(q){return G.a.createElement("li",{key:q.name,className:"".concat(n.a.directionItem," ").concat(R===q.value?n.a.active:""," "),onClick:function(){return Oe(q.value)}},q.name)}),H&&G.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:n.a.directionItem,onClick:function(){return Te()}},"\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 V(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},x.map(function(q){return G.a.createElement("li",{key:q.name,className:"".concat(n.a.directionItem," ").concat(C===q.value?n.a.active:""," "),onClick:function(){return V(q.value)}},q.name)}))),c&&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 ye(null)}},"\u5168\u90E8"),G.a.createElement("div",{className:n.a.directionContentWrap},f.map(function(q){return G.a.createElement("li",{key:q.name,className:"".concat(n.a.directionItem," ").concat(E===q.value?n.a.active:""," "),onClick:function(){return ye(q.value)}},q.name)})))))}},jcZT:function(it,Ee,U){"use strict";var ie=U("2qtc"),Y=U("kLXV"),N=U("5NDa"),z=U("5rEg"),I=U("miYZ"),M=U("tsqr"),G=U("9og8"),K=U("tJVT"),n=U("WmNS"),L=U.n(n),x=U("q1tI"),f=U.n(x),b=U("d5o6"),h=U.n(b),o=U("P/tu"),p=U("WCUW"),l=U("9kvl"),u=function(i){var D=i.problemset,A=i.dispatch,S=i.onOk,R=Object(x.useState)(""),O=Object(K.a)(R,2),g=O[0],_=O[1],d=Object(x.useState)([0]),c=Object(K.a)(d,2),C=c[0],E=c[1],w=function(){A({type:"problemset/setActionTabs",payload:{}})};Object(x.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]),_("")}},[D.actionTabs.key]);var B=function(){var W=Object(G.a)(L.a.mark(function T(){var k,m,y;return L.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(k=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],g.trim()){Q.next=4;break}return M.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Q.abrupt("return");case 4:if(!(g.charAt(0)===" ")){Q.next=7;break}return M.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Q.abrupt("return");case 7:m=0;case 8:if(!(m0?C[0]:0,name:g});case 17:y=Q.sent,y.status===0&&(w(),S(y==null?void 0:y.id));case 19:case"end":return Q.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:B,destroyOnClose:!0},f.a.createElement("div",{className:h.a.addModal},f.a.createElement("div",{className:h.a.row},f.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),f.a.createElement(z.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:g,onChange:function(T){return _(T.target.value)}})),f.a.createElement("div",{className:h.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},f.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),f.a.createElement(o.a,{value:C,onChange:function(T){return E(T)}}))))};Ee.a=Object(l.a)(function(s){var i=s.problemset;return{problemset:i}})(u)},k3GJ:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return fo});var ie=U("rePB"),Y=U("ODXe"),N=U("Ff2n"),z=U("VTBJ"),I=U("q1tI"),M=U("TSYQ"),G=U.n(M),K=U("Zm9Q"),n=U("6cGi"),L=U("KQm4"),x=U("xEkU"),f=U.n(x),b=U("t23M");function h(Ae){var Me=Object(I.useRef)(),He=Object(I.useRef)(!1);function De(){for(var le=arguments.length,xe=new Array(le),fe=0;feGe&&(ht=Ge-ut),Object(I.useMemo)(function(){if(!xe.length)return[0,0];for(var Ct=xe.length,dn=Ct,Kn=0;KnBe+ht){dn=Kn-1;break}}for(var Nn=0,Bn=Ct-1;Bn>=0;Bn-=1){var Un=Ae.get(xe[Bn].key)||D;if(Un[Fe]1&&arguments[1]!==void 0?arguments[1]:!1,De=Me&&typeof Me.getBoundingClientRect=="function"&&Me.getBoundingClientRect().width;if(De){if(He){var le=getComputedStyle(Me),xe=le.marginLeft,fe=le.marginRight;De+=+xe.replace("px","")+ +fe.replace("px","")}De=+De.toFixed(6)}return De||0},ke=function(Me,He,De){Me&&Object(W.a)(Me.style)==="object"&&(Me.style[He]=De)},Ue=function(){return $.any},Qe=U("bdgK"),nt=U("i8i4"),ot=U.n(nt),qe=U("wgJM"),ft=U("l4aY"),lt=U("m+aA"),pt=U("c+Xe"),Ye=U("zT1h"),Tt=U("QC+M");function bt(Ae,Me,He){return He?Ae[0]===Me[0]:Ae[0]===Me[0]&&Ae[1]===Me[1]}function me(Ae,Me,He){var De=Ae[Me]||{};return Object(z.a)(Object(z.a)({},De),He)}function ne(Ae,Me,He,De){for(var le=He.points,xe=Object.keys(Ae),fe=0;fe1&&arguments[1]!==void 0?arguments[1]:2;Me();var xe=Object(qe.a)(function(){le<=1?De({isCanceled:function(){return xe!==Ae.current}}):He(De,le-1)});Ae.current=xe}return I.useEffect(function(){return function(){Me()}},[]),[He,Me]},qn=[bn,xr,br,Ar],Ir=!1,gn=!0;function wt(Ae){return Ae===br||Ae===Ar}var Rn=function(Ae,Me){var He=I.useState(or),De=Object(Y.a)(He,2),le=De[0],xe=De[1],fe=Cn(),Le=Object(Y.a)(fe,2),Ce=Le[0],Fe=Le[1];function Be(){xe(bn)}return an(function(){if(le!==or&&le!==Ar){var Ge=qn.indexOf(le),Ze=qn[Ge+1],ut=Me(le);ut===Ir?xe(Ze):Ce(function(ht){function Ct(){if(ht.isCanceled())return;xe(Ze)}ut===!0?Ct():Promise.resolve(ut).then(Ct)})}},[Ae,le]),I.useEffect(function(){return function(){Fe()}},[]),[Be,le]},jn=function(Ae){var Me=Object(I.useRef)(),He=Object(I.useRef)(Ae);He.current=Ae;var De=I.useCallback(function(fe){He.current(fe)},[]);function le(fe){fe&&(fe.removeEventListener(mn,De),fe.removeEventListener(kt,De))}function xe(fe){Me.current&&Me.current!==fe&&le(Me.current),fe&&fe!==Me.current&&(fe.addEventListener(mn,De),fe.addEventListener(kt,De),Me.current=fe)}return I.useEffect(function(){return function(){le(Me.current)}},[]),[xe,le]};function cn(Ae,Me,He,De){var le=De.motionEnter,xe=le===void 0?!0:le,fe=De.motionAppear,Le=fe===void 0?!0:fe,Ce=De.motionLeave,Fe=Ce===void 0?!0:Ce,Be=De.motionDeadline,Ge=De.motionLeaveImmediately,Ze=De.onAppearPrepare,ut=De.onEnterPrepare,ht=De.onLeavePrepare,Ct=De.onAppearStart,dn=De.onEnterStart,Kn=De.onLeaveStart,On=De.onAppearActive,Nn=De.onEnterActive,Bn=De.onLeaveActive,Un=De.onAppearEnd,Ln=De.onEnterEnd,zn=De.onLeaveEnd,Xn=De.onVisibleChanged,Or=Br(),Yn=Object(Y.a)(Or,2),nn=Yn[0],qt=Yn[1],In=Br(Mt),nr=Object(Y.a)(In,2),Kt=nr[0],rr=nr[1],Rr=Br(null),Zn=Object(Y.a)(Rr,2),_r=Zn[0],mr=Zn[1],Nr=Object(I.useRef)(!1),Fr=Object(I.useRef)(null),Lr=Object(I.useRef)(!1),li=Object(I.useRef)(null);function Ti(){var Er=He();return Er||li.current}var gi=Object(I.useRef)(!1);function Wr(Er){var cr=Ti();if(Er&&!Er.deadline&&Er.target!==cr)return;var Pr;Kt===Qn&&gi.current?Pr=Un==null?void 0:Un(cr,Er):Kt===un&&gi.current?Pr=Ln==null?void 0:Ln(cr,Er):Kt===hr&&gi.current&&(Pr=zn==null?void 0:zn(cr,Er)),Pr!==!1&&!Lr.current&&(rr(Mt),mr(null))}var wr=jn(Wr),gr=Object(Y.a)(wr,1),ln=gr[0],vr=I.useMemo(function(){var Er,cr,Pr;switch(Kt){case"appear":return Er={},Object(ie.a)(Er,bn,Ze),Object(ie.a)(Er,xr,Ct),Object(ie.a)(Er,br,On),Er;case"enter":return cr={},Object(ie.a)(cr,bn,ut),Object(ie.a)(cr,xr,dn),Object(ie.a)(cr,br,Nn),cr;case"leave":return Pr={},Object(ie.a)(Pr,bn,ht),Object(ie.a)(Pr,xr,Kn),Object(ie.a)(Pr,br,Bn),Pr;default:return{}}},[Kt]),Oi=Rn(Kt,function(Er){if(Er===bn){var cr=vr[bn];return cr?cr(Ti()):Ir}if(yr in vr){var Pr;mr(((Pr=vr[yr])===null||Pr===void 0?void 0:Pr.call(vr,Ti(),null))||null)}return yr===br&&(ln(Ti()),Be>0&&(clearTimeout(Fr.current),Fr.current=setTimeout(function(){Wr({deadline:!0})},Be))),gn}),Hi=Object(Y.a)(Oi,2),$i=Hi[0],yr=Hi[1],Mi=wt(yr);gi.current=Mi,an(function(){qt(Me);var Er=Nr.current;if(Nr.current=!0,!Ae)return;var cr;!Er&&Me&&Le&&(cr=Qn),Er&&Me&&xe&&(cr=un),(Er&&!Me&&Fe||!Er&&Ge&&!Me&&Fe)&&(cr=hr),cr&&(rr(cr),$i())},[Me]),Object(I.useEffect)(function(){(Kt===Qn&&!Le||Kt===un&&!xe||Kt===hr&&!Fe)&&rr(Mt)},[Le,xe,Fe]),Object(I.useEffect)(function(){return function(){clearTimeout(Fr.current),Lr.current=!0}},[]),Object(I.useEffect)(function(){nn!==void 0&&Kt===Mt&&(Xn==null||Xn(nn))},[nn,Kt]);var Ki=_r;return vr[bn]&&yr===xr&&(Ki=Object(z.a)({transition:"none"},Ki)),[Kt,yr,Ki,nn!=null?nn:Me]}var on=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){return Object(R.a)(this,He),Me.apply(this,arguments)}return Object(O.a)(He,[{key:"render",value:function(){return this.props.children}}]),He}(I.Component),Dn=on;function ei(Ae){var Me=Ae;Object(W.a)(Ae)==="object"&&(Me=Ae.transitionSupport);function He(le){return!!(le.motionName&&Me)}var De=I.forwardRef(function(le,xe){var fe=le.visible,Le=fe===void 0?!0:fe,Ce=le.removeOnLeave,Fe=Ce===void 0?!0:Ce,Be=le.forceRender,Ge=le.children,Ze=le.motionName,ut=le.leavedClassName,ht=le.eventProps,Ct=He(le),dn=Object(I.useRef)(),Kn=Object(I.useRef)();function On(){try{return Object(lt.a)(dn.current||Kn.current)}catch(rr){return null}}var Nn=cn(Ct,Le,On,le),Bn=Object(Y.a)(Nn,4),Un=Bn[0],Ln=Bn[1],zn=Bn[2],Xn=Bn[3],Or=I.useRef(Xn);Xn&&(Or.current=!0);var Yn=Object(I.useRef)(xe);Yn.current=xe;var nn=I.useCallback(function(rr){dn.current=rr,Object(pt.b)(Yn.current,rr)},[]),qt,In=Object(z.a)(Object(z.a)({},ht),{},{visible:Le});if(!Ge)qt=null;else if(Un===Mt||!He(le))Xn?qt=Ge(Object(z.a)({},In),nn):!Fe&&Or.current?qt=Ge(Object(z.a)(Object(z.a)({},In),{},{className:ut}),nn):Be?qt=Ge(Object(z.a)(Object(z.a)({},In),{},{style:{display:"none"}}),nn):qt=null;else{var nr,Kt;Ln===bn?Kt="prepare":wt(Ln)?Kt="active":Ln===xr&&(Kt="start"),qt=Ge(Object(z.a)(Object(z.a)({},In),{},{className:G()(zt(Ze,Un),(nr={},Object(ie.a)(nr,zt(Ze,"".concat(Un,"-").concat(Kt)),Kt),Object(ie.a)(nr,Ze,typeof Ze=="string"),nr)),style:zn}),nn)}return I.createElement(Dn,{ref:Kn},qt)});return De.displayName="CSSMotion",De}var Tr=ei(Rt),ct="add",Qt="keep",ji="remove",Xi="removed";function ua(Ae){var Me;return Ae&&Object(W.a)(Ae)==="object"&&"key"in Ae?Me=Ae:Me={key:Ae},Object(z.a)(Object(z.a)({},Me),{},{key:String(Me.key)})}function Bi(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Ae.map(ua)}function ca(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],He=[],De=0,le=Me.length,xe=Bi(Ae),fe=Bi(Me);xe.forEach(function(Fe){for(var Be=!1,Ge=De;Ge1});return Ce.forEach(function(Fe){He=He.filter(function(Be){var Ge=Be.key,Ze=Be.status;return Ge!==Fe||Ze!==ji}),He.forEach(function(Be){Be.key===Fe&&(Be.status=Qt)})}),He}var En=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Ia(Ae){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tr,He=function(De){Object(_.a)(xe,De);var le=Object(d.a)(xe);function xe(){var fe;return Object(R.a)(this,xe),fe=le.apply(this,arguments),fe.state={keyEntities:[]},fe.removeKey=function(Le){fe.setState(function(Ce){var Fe=Ce.keyEntities;return{keyEntities:Fe.map(function(Be){return Be.key!==Le?Be:Object(z.a)(Object(z.a)({},Be),{},{status:Xi})})}})},fe}return Object(O.a)(xe,[{key:"render",value:function(){var Le=this,Ce=this.state.keyEntities,Fe=this.props,Be=Fe.component,Ge=Fe.children,Ze=Fe.onVisibleChanged,ut=Object(N.a)(Fe,["component","children","onVisibleChanged"]),ht=Be||I.Fragment,Ct={};return En.forEach(function(dn){Ct[dn]=ut[dn],delete ut[dn]}),delete ut.keys,I.createElement(ht,ut,Ce.map(function(dn){var Kn=dn.status,On=Object(N.a)(dn,["status"]),Nn=Kn===ct||Kn===Qt;return I.createElement(Me,Object(S.a)({},Ct,{key:On.key,visible:Nn,eventProps:On,onVisibleChanged:function(Un){Ze==null||Ze(Un,{key:On.key}),Un||Le.removeKey(On.key)}}),Ge)}))}}],[{key:"getDerivedStateFromProps",value:function(Le,Ce){var Fe=Le.keys,Be=Ce.keyEntities,Ge=Bi(Fe),Ze=ca(Be,Ge);return{keyEntities:Ze.filter(function(ut){var ht=Be.find(function(Ct){var dn=Ct.key;return ut.key===dn});return!(ht&&ht.status===Xi&&ut.status===ji)})}}}]),xe}(I.Component);return He.defaultProps={component:"div"},He}var _t=Ia(Rt),Fi=Tr;function yi(Ae){var Me=Ae.prefixCls,He=Ae.motion,De=Ae.animation,le=Ae.transitionName;return He||(De?{motionName:"".concat(Me,"-").concat(De)}:le?{motionName:le}:null)}function ba(Ae){var Me=Ae.prefixCls,He=Ae.visible,De=Ae.zIndex,le=Ae.mask,xe=Ae.maskMotion,fe=Ae.maskAnimation,Le=Ae.maskTransitionName;if(!le)return null;var Ce={};return(xe||Le||fe)&&(Ce=Object(z.a)({motionAppear:!0},yi({motion:xe,prefixCls:Me,transitionName:Le,animation:fe}))),I.createElement(Fi,Object(S.a)({},Ce,{visible:He,removeOnLeave:!0}),function(Fe){var Be=Fe.className;return I.createElement("div",{style:{zIndex:De},className:G()("".concat(Me,"-mask"),Be)})})}var ea=U("9mu1"),pi=U("o0o1"),da=U.n(pi),Ea=U("HaE+"),ur=["measure","align",null,"motion"],xa=function(Ae,Me){var He=Object(I.useState)(null),De=Object(Y.a)(He,2),le=De[0],xe=De[1],fe=Object(I.useRef)(),Le=Object(I.useRef)(!1);function Ce(Ge){Le.current||xe(Ge)}function Fe(){qe.a.cancel(fe.current)}function Be(Ge){Fe(),fe.current=Object(qe.a)(function(){Ce(function(Ze){switch(le){case"align":return"motion";case"motion":return"stable";default:}return Ze}),Ge==null||Ge()})}return Object(I.useEffect)(function(){Ce("measure")},[Ae]),Object(I.useEffect)(function(){switch(le){case"measure":Me();break;default:}le&&(fe.current=Object(qe.a)(Object(Ea.a)(da.a.mark(function Ge(){var Ze,ut;return da.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:Ze=ur.indexOf(le),ut=ur[Ze+1],ut&&Ze!==-1&&Ce(ut);case 3:case"end":return Ct.stop()}},Ge)}))))},[le]),Object(I.useEffect)(function(){return function(){Le.current=!0,Fe()}},[]),[le,Be]},Ya=function(Ae){var Me=I.useState({width:0,height:0}),He=Object(Y.a)(Me,2),De=He[0],le=He[1];function xe(Le){le({width:Le.offsetWidth,height:Le.offsetHeight})}var fe=I.useMemo(function(){var Le={};if(Ae){var Ce=De.width,Fe=De.height;Ae.indexOf("height")!==-1&&Fe?Le.height=Fe:Ae.indexOf("minHeight")!==-1&&Fe&&(Le.minHeight=Fe),Ae.indexOf("width")!==-1&&Ce?Le.width=Ce:Ae.indexOf("minWidth")!==-1&&Ce&&(Le.minWidth=Ce)}return Le},[Ae,De]);return[fe,xe]},Vt=I.forwardRef(function(Ae,Me){var He=Ae.visible,De=Ae.prefixCls,le=Ae.className,xe=Ae.style,fe=Ae.children,Le=Ae.zIndex,Ce=Ae.stretch,Fe=Ae.destroyPopupOnHide,Be=Ae.forceRender,Ge=Ae.align,Ze=Ae.point,ut=Ae.getRootDomNode,ht=Ae.getClassNameFromAlign,Ct=Ae.onAlign,dn=Ae.onMouseEnter,Kn=Ae.onMouseLeave,On=Ae.onMouseDown,Nn=Ae.onTouchStart,Bn=Object(I.useRef)(),Un=Object(I.useRef)(),Ln=Object(I.useState)(),zn=Object(Y.a)(Ln,2),Xn=zn[0],Or=zn[1],Yn=Ya(Ce),nn=Object(Y.a)(Yn,2),qt=nn[0],In=nn[1];function nr(){Ce&&In(ut())}var Kt=xa(He,nr),rr=Object(Y.a)(Kt,2),Rr=rr[0],Zn=rr[1],_r=Object(I.useRef)();function mr(){return Ze||ut}function Nr(){var wr;(wr=Bn.current)===null||wr===void 0||wr.forceAlign()}function Fr(wr,gr){var ln=ht(gr);Xn!==ln&&Or(ln),Rr==="align"&&(Xn!==ln?Promise.resolve().then(function(){Nr()}):Zn(function(){var vr;(vr=_r.current)===null||vr===void 0||vr.call(_r)}),Ct==null||Ct(wr,gr))}var Lr=Object(z.a)({},yi(Ae));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(wr){var gr=Lr[wr];Lr[wr]=function(ln,vr){return Zn(),gr==null?void 0:gr(ln,vr)}});function li(){return new Promise(function(wr){_r.current=wr})}I.useEffect(function(){!Lr.motionName&&Rr==="motion"&&Zn()},[Lr.motionName,Rr]),I.useImperativeHandle(Me,function(){return{forceAlign:Nr,getElement:function(){return Un.current}}});var Ti=Object(z.a)(Object(z.a)({},qt),{},{zIndex:Le,opacity:Rr==="motion"||Rr==="stable"||!He?void 0:0,pointerEvents:Rr==="stable"?void 0:"none"},xe),gi=!0;(Ge==null?void 0:Ge.points)&&(Rr==="align"||Rr==="stable")&&(gi=!1);var Wr=fe;return I.Children.count(fe)>1&&(Wr=I.createElement("div",{className:"".concat(De,"-content")},fe)),I.createElement(Fi,Object(S.a)({visible:He,ref:Un,leavedClassName:"".concat(De,"-hidden")},Lr,{onAppearPrepare:li,onEnterPrepare:li,removeOnLeave:Fe,forceRender:Be}),function(wr,gr){var ln=wr.className,vr=wr.style,Oi=G()(De,le,Xn,ln);return I.createElement(ea.a,{target:mr(),key:"popup",ref:Bn,monitorWindowResize:!0,disabled:gi,align:Ge,onAlign:Fr},I.createElement("div",{ref:gr,className:Oi,onMouseEnter:dn,onMouseLeave:Kn,onMouseDownCapture:On,onTouchStartCapture:Nn,style:Object(z.a)(Object(z.a)({},vr),Ti)},Wr))})});Vt.displayName="PopupInner";var st=Vt,Pt=I.forwardRef(function(Ae,Me){var He=Ae.prefixCls,De=Ae.visible,le=Ae.zIndex,xe=Ae.children,fe=Ae.mobile;fe=fe===void 0?{}:fe;var Le=fe.popupClassName,Ce=fe.popupStyle,Fe=fe.popupMotion,Be=Fe===void 0?{}:Fe,Ge=fe.popupRender,Ze=I.useRef();I.useImperativeHandle(Me,function(){return{forceAlign:function(){},getElement:function(){return Ze.current}}});var ut=Object(z.a)({zIndex:le},Ce),ht=xe;return I.Children.count(xe)>1&&(ht=I.createElement("div",{className:"".concat(He,"-content")},xe)),Ge&&(ht=Ge(ht)),I.createElement(Fi,Object(S.a)({visible:De,ref:Ze,removeOnLeave:!0},Be),function(Ct,dn){var Kn=Ct.className,On=Ct.style,Nn=G()(He,Le,Kn);return I.createElement("div",{ref:dn,className:Nn,style:Object(z.a)(Object(z.a)({},On),ut)},ht)})});Pt.displayName="MobilePopupInner";var xt=Pt,Dt=["visible","mobile"],Zt=I.forwardRef(function(Ae,Me){var He=Ae.visible,De=Ae.mobile,le=Object(N.a)(Ae,Dt),xe=Object(I.useState)(He),fe=Object(Y.a)(xe,2),Le=fe[0],Ce=fe[1],Fe=Object(I.useState)(!1),Be=Object(Y.a)(Fe,2),Ge=Be[0],Ze=Be[1],ut=Object(z.a)(Object(z.a)({},le),{},{visible:Le});Object(I.useEffect)(function(){Ce(He),He&&De&&Ze(q())},[He,De]);var ht=Ge?I.createElement(xt,Object(S.a)({},ut,{mobile:De,ref:Me})):I.createElement(st,Object(S.a)({},ut,{ref:Me}));return I.createElement("div",null,I.createElement(ba,ut),ht)});Zt.displayName="Popup";var yn=Zt,Tn=I.createContext(null),en=Tn;function xn(){}function Fn(){return""}function tn(Ae){return Ae?Ae.ownerDocument:window.document}var hn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function ar(Ae){var Me=function(He){Object(_.a)(le,He);var De=Object(d.a)(le);function le(xe){var fe;Object(R.a)(this,le),fe=De.call(this,xe),fe.popupRef=I.createRef(),fe.triggerRef=I.createRef(),fe.attachId=void 0,fe.clickOutsideHandler=void 0,fe.touchOutsideHandler=void 0,fe.contextMenuOutsideHandler1=void 0,fe.contextMenuOutsideHandler2=void 0,fe.mouseDownTimeout=void 0,fe.focusTime=void 0,fe.preClickTime=void 0,fe.preTouchTime=void 0,fe.delayTimer=void 0,fe.hasPopupMouseDown=void 0,fe.onMouseEnter=function(Ce){var Fe=fe.props.mouseEnterDelay;fe.fireEvents("onMouseEnter",Ce),fe.delaySetPopupVisible(!0,Fe,Fe?null:Ce)},fe.onMouseMove=function(Ce){fe.fireEvents("onMouseMove",Ce),fe.setPoint(Ce)},fe.onMouseLeave=function(Ce){fe.fireEvents("onMouseLeave",Ce),fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onPopupMouseEnter=function(){fe.clearDelayTimer()},fe.onPopupMouseLeave=function(Ce){var Fe;if(Ce.relatedTarget&&!Ce.relatedTarget.setTimeout&&Object(ft.a)((Fe=fe.popupRef.current)===null||Fe===void 0?void 0:Fe.getElement(),Ce.relatedTarget))return;fe.delaySetPopupVisible(!1,fe.props.mouseLeaveDelay)},fe.onFocus=function(Ce){fe.fireEvents("onFocus",Ce),fe.clearDelayTimer(),fe.isFocusToShow()&&(fe.focusTime=Date.now(),fe.delaySetPopupVisible(!0,fe.props.focusDelay))},fe.onMouseDown=function(Ce){fe.fireEvents("onMouseDown",Ce),fe.preClickTime=Date.now()},fe.onTouchStart=function(Ce){fe.fireEvents("onTouchStart",Ce),fe.preTouchTime=Date.now()},fe.onBlur=function(Ce){fe.fireEvents("onBlur",Ce),fe.clearDelayTimer(),fe.isBlurToHide()&&fe.delaySetPopupVisible(!1,fe.props.blurDelay)},fe.onContextMenu=function(Ce){Ce.preventDefault(),fe.fireEvents("onContextMenu",Ce),fe.setPopupVisible(!0,Ce)},fe.onContextMenuClose=function(){fe.isContextMenuToShow()&&fe.close()},fe.onClick=function(Ce){if(fe.fireEvents("onClick",Ce),fe.focusTime){var Fe;if(fe.preClickTime&&fe.preTouchTime?Fe=Math.min(fe.preClickTime,fe.preTouchTime):fe.preClickTime?Fe=fe.preClickTime:fe.preTouchTime&&(Fe=fe.preTouchTime),Math.abs(Fe-fe.focusTime)<20)return;fe.focusTime=0}fe.preClickTime=0,fe.preTouchTime=0,fe.isClickToShow()&&(fe.isClickToHide()||fe.isBlurToHide())&&Ce&&Ce.preventDefault&&Ce.preventDefault();var Be=!fe.state.popupVisible;(fe.isClickToHide()&&!Be||Be&&fe.isClickToShow())&&fe.setPopupVisible(!fe.state.popupVisible,Ce)},fe.onPopupMouseDown=function(){if(fe.hasPopupMouseDown=!0,clearTimeout(fe.mouseDownTimeout),fe.mouseDownTimeout=window.setTimeout(function(){fe.hasPopupMouseDown=!1},0),fe.context){var Ce;(Ce=fe.context).onPopupMouseDown.apply(Ce,arguments)}},fe.onDocumentClick=function(Ce){if(fe.props.mask&&!fe.props.maskClosable)return;var Fe=Ce.target,Be=fe.getRootDomNode(),Ge=fe.getPopupDomNode();(!Object(ft.a)(Be,Fe)||fe.isContextMenuOnly())&&!Object(ft.a)(Ge,Fe)&&!fe.hasPopupMouseDown&&fe.close()},fe.getRootDomNode=function(){var Ce=fe.props.getTriggerDOMNode;if(Ce)return Ce(fe.triggerRef.current);try{var Fe=Object(lt.a)(fe.triggerRef.current);if(Fe)return Fe}catch(Be){}return ot.a.findDOMNode(Object(g.a)(fe))},fe.getPopupClassNameFromAlign=function(Ce){var Fe=[],Be=fe.props,Ge=Be.popupPlacement,Ze=Be.builtinPlacements,ut=Be.prefixCls,ht=Be.alignPoint,Ct=Be.getPopupClassNameFromAlign;return Ge&&Ze&&Fe.push(ne(Ze,ut,Ce,ht)),Ct&&Fe.push(Ct(Ce)),Fe.join(" ")},fe.getComponent=function(){var Ce=fe.props,Fe=Ce.prefixCls,Be=Ce.destroyPopupOnHide,Ge=Ce.popupClassName,Ze=Ce.onPopupAlign,ut=Ce.popupMotion,ht=Ce.popupAnimation,Ct=Ce.popupTransitionName,dn=Ce.popupStyle,Kn=Ce.mask,On=Ce.maskAnimation,Nn=Ce.maskTransitionName,Bn=Ce.maskMotion,Un=Ce.zIndex,Ln=Ce.popup,zn=Ce.stretch,Xn=Ce.alignPoint,Or=Ce.mobile,Yn=Ce.forceRender,nn=fe.state,qt=nn.popupVisible,In=nn.point,nr=fe.getPopupAlign(),Kt={};return fe.isMouseEnterToShow()&&(Kt.onMouseEnter=fe.onPopupMouseEnter),fe.isMouseLeaveToHide()&&(Kt.onMouseLeave=fe.onPopupMouseLeave),Kt.onMouseDown=fe.onPopupMouseDown,Kt.onTouchStart=fe.onPopupMouseDown,I.createElement(yn,Object(S.a)({prefixCls:Fe,destroyPopupOnHide:Be,visible:qt,point:Xn&&In,className:Ge,align:nr,onAlign:Ze,animation:ht,getClassNameFromAlign:fe.getPopupClassNameFromAlign},Kt,{stretch:zn,getRootDomNode:fe.getRootDomNode,style:dn,mask:Kn,zIndex:Un,transitionName:Ct,maskAnimation:On,maskTransitionName:Nn,maskMotion:Bn,ref:fe.popupRef,motion:ut,mobile:Or,forceRender:Yn}),typeof Ln=="function"?Ln():Ln)},fe.attachParent=function(Ce){qe.a.cancel(fe.attachId);var Fe=fe.props,Be=Fe.getPopupContainer,Ge=Fe.getDocument,Ze=fe.getRootDomNode(),ut;Be?(Ze||Be.length===0)&&(ut=Be(Ze)):ut=Ge(fe.getRootDomNode()).body,ut?ut.appendChild(Ce):fe.attachId=Object(qe.a)(function(){fe.attachParent(Ce)})},fe.getContainer=function(){var Ce=fe.props.getDocument,Fe=Ce(fe.getRootDomNode()).createElement("div");return Fe.style.position="absolute",Fe.style.top="0",Fe.style.left="0",Fe.style.width="100%",fe.attachParent(Fe),Fe},fe.setPoint=function(Ce){var Fe=fe.props.alignPoint;if(!Fe||!Ce)return;fe.setState({point:{pageX:Ce.pageX,pageY:Ce.pageY}})},fe.handlePortalUpdate=function(){fe.state.prevPopupVisible!==fe.state.popupVisible&&fe.props.afterPopupVisibleChange(fe.state.popupVisible)},fe.triggerContextValue={onPopupMouseDown:fe.onPopupMouseDown};var Le;return"popupVisible"in xe?Le=!!xe.popupVisible:Le=!!xe.defaultPopupVisible,fe.state={prevPopupVisible:Le,popupVisible:Le},hn.forEach(function(Ce){fe["fire".concat(Ce)]=function(Fe){fe.fireEvents(Ce,Fe)}}),fe}return Object(O.a)(le,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var fe=this.props,Le=this.state;if(Le.popupVisible){var Ce;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(Ce=fe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ye.a)(Ce,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(Ce=Ce||fe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ye.a)(Ce,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(Ce=Ce||fe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ye.a)(Ce,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ye.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),qe.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var fe;return((fe=this.popupRef.current)===null||fe===void 0?void 0:fe.getElement())||null}},{key:"getPopupAlign",value:function(){var fe=this.props,Le=fe.popupPlacement,Ce=fe.popupAlign,Fe=fe.builtinPlacements;return Le&&Fe?me(Fe,Le,Ce):Ce}},{key:"setPopupVisible",value:function(fe,Le){var Ce=this.props.alignPoint,Fe=this.state.popupVisible;this.clearDelayTimer(),Fe!==fe&&("popupVisible"in this.props||this.setState({popupVisible:fe,prevPopupVisible:Fe}),this.props.onPopupVisibleChange(fe)),Ce&&Le&&fe&&this.setPoint(Le)}},{key:"delaySetPopupVisible",value:function(fe,Le,Ce){var Fe=this,Be=Le*1e3;if(this.clearDelayTimer(),Be){var Ge=Ce?{pageX:Ce.pageX,pageY:Ce.pageY}:null;this.delayTimer=window.setTimeout(function(){Fe.setPopupVisible(fe,Ge),Fe.clearDelayTimer()},Be)}else this.setPopupVisible(fe,Ce)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(fe){var Le=this.props.children.props,Ce=this.props;return Le[fe]&&Ce[fe]?this["fire".concat(fe)]:Le[fe]||Ce[fe]}},{key:"isClickToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("click")!==-1||Ce.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var fe=this.props.action;return fe==="contextMenu"||fe.length===1&&fe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("contextMenu")!==-1||Ce.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var fe=this.props,Le=fe.action,Ce=fe.hideAction;return Le.indexOf("click")!==-1||Ce.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("hover")!==-1||Ce.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var fe=this.props,Le=fe.action,Ce=fe.hideAction;return Le.indexOf("hover")!==-1||Ce.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var fe=this.props,Le=fe.action,Ce=fe.showAction;return Le.indexOf("focus")!==-1||Ce.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var fe=this.props,Le=fe.action,Ce=fe.hideAction;return Le.indexOf("focus")!==-1||Ce.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var fe;(fe=this.popupRef.current)===null||fe===void 0||fe.forceAlign()}}},{key:"fireEvents",value:function(fe,Le){var Ce=this.props.children.props[fe];Ce&&Ce(Le);var Fe=this.props[fe];Fe&&Fe(Le)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var fe=this.state.popupVisible,Le=this.props,Ce=Le.children,Fe=Le.forceRender,Be=Le.alignPoint,Ge=Le.className,Ze=Le.autoDestroy,ut=I.Children.only(Ce),ht={key:"trigger"};this.isContextMenuToShow()?ht.onContextMenu=this.onContextMenu:ht.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(ht.onClick=this.onClick,ht.onMouseDown=this.onMouseDown,ht.onTouchStart=this.onTouchStart):(ht.onClick=this.createTwoChains("onClick"),ht.onMouseDown=this.createTwoChains("onMouseDown"),ht.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(ht.onMouseEnter=this.onMouseEnter,Be&&(ht.onMouseMove=this.onMouseMove)):ht.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?ht.onMouseLeave=this.onMouseLeave:ht.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(ht.onFocus=this.onFocus,ht.onBlur=this.onBlur):(ht.onFocus=this.createTwoChains("onFocus"),ht.onBlur=this.createTwoChains("onBlur"));var Ct=G()(ut&&ut.props&&ut.props.className,Ge);Ct&&(ht.className=Ct);var dn=Object(z.a)({},ht);Object(pt.c)(ut)&&(dn.ref=Object(pt.a)(this.triggerRef,ut.ref));var Kn=I.cloneElement(ut,dn),On;return(fe||this.popupRef.current||Fe)&&(On=I.createElement(Ae,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!fe&&Ze&&(On=null),I.createElement(en.Provider,{value:this.triggerContextValue},Kn,On)}}],[{key:"getDerivedStateFromProps",value:function(fe,Le){var Ce=fe.popupVisible,Fe={};return Ce!==void 0&&Le.popupVisible!==Ce&&(Fe.popupVisible=Ce,Fe.prevPopupVisible=Le.popupVisible),Fe}}]),le}(I.Component);return Me.contextType=en,Me.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:Fn,getDocument:tn,onPopupVisibleChange:xn,afterPopupVisibleChange:xn,onPopupAlign:xn,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Me}var Wn=ar(Tt.a),Bt={adjustX:1,adjustY:1},_n={topLeft:{points:["bl","tl"],overflow:Bt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Bt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Bt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Bt,offset:[4,0]}},ir={topLeft:{points:["bl","tl"],overflow:Bt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Bt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Bt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Bt,offset:[4,0]}},kn=_n,Xt=0,sn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Sn=function(Me,He,De){var le=ye(He),xe=Me.getState();Me.setState({defaultActiveFirst:Object(z.a)(Object(z.a)({},xe.defaultActiveFirst),{},Object(ie.a)({},le,De))})},Nt=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(De){var le;Object(R.a)(this,He),le=Me.call(this,De),le.onDestroy=function(Be){le.props.onDestroy(Be)},le.onKeyDown=function(Be){var Ge=Be.keyCode,Ze=le.menuInstance,ut=le.props.store,ht=le.getVisible();if(Ge===p.a.ENTER)return le.onTitleClick(Be),Sn(ut,le.props.eventKey,!0),!0;if(Ge===p.a.RIGHT)return ht?Ze.onKeyDown(Be):(le.triggerOpenChange(!0),Sn(ut,le.props.eventKey,!0)),!0;if(Ge===p.a.LEFT){var Ct;if(ht)Ct=Ze.onKeyDown(Be);else return;return Ct||(le.triggerOpenChange(!1),Ct=!0),Ct}return ht&&(Ge===p.a.UP||Ge===p.a.DOWN)?Ze.onKeyDown(Be):void 0},le.onOpenChange=function(Be){le.props.onOpenChange(Be)},le.onPopupVisibleChange=function(Be){le.triggerOpenChange(Be,Be?"mouseenter":"mouseleave")},le.onMouseEnter=function(Be){var Ge=le.props,Ze=Ge.eventKey,ut=Ge.onMouseEnter,ht=Ge.store;Sn(ht,le.props.eventKey,!1),ut({key:Ze,domEvent:Be})},le.onMouseLeave=function(Be){var Ge=le.props,Ze=Ge.parentMenu,ut=Ge.eventKey,ht=Ge.onMouseLeave;Ze.subMenuInstance=Object(g.a)(le),ht({key:ut,domEvent:Be})},le.onTitleMouseEnter=function(Be){var Ge=le.props,Ze=Ge.eventKey,ut=Ge.onItemHover,ht=Ge.onTitleMouseEnter;ut({key:Ze,hover:!0}),ht({key:Ze,domEvent:Be})},le.onTitleMouseLeave=function(Be){var Ge=le.props,Ze=Ge.parentMenu,ut=Ge.eventKey,ht=Ge.onItemHover,Ct=Ge.onTitleMouseLeave;Ze.subMenuInstance=Object(g.a)(le),ht({key:ut,hover:!1}),Ct({key:ut,domEvent:Be})},le.onTitleClick=function(Be){var Ge=Object(g.a)(le),Ze=Ge.props;if(Ze.onTitleClick({key:Ze.eventKey,domEvent:Be}),Ze.triggerSubMenuAction==="hover")return;le.triggerOpenChange(!le.getVisible(),"click"),Sn(Ze.store,le.props.eventKey,!1)},le.onSubMenuClick=function(Be){typeof le.props.onClick=="function"&&le.props.onClick(le.addKeyPath(Be))},le.onSelect=function(Be){le.props.onSelect(Be)},le.onDeselect=function(Be){le.props.onDeselect(Be)},le.getPrefixCls=function(){return"".concat(le.props.rootPrefixCls,"-submenu")},le.getActiveClassName=function(){return"".concat(le.getPrefixCls(),"-active")},le.getDisabledClassName=function(){return"".concat(le.getPrefixCls(),"-disabled")},le.getSelectedClassName=function(){return"".concat(le.getPrefixCls(),"-selected")},le.getOpenClassName=function(){return"".concat(le.props.rootPrefixCls,"-submenu-open")},le.getVisible=function(){return le.state.isOpen},le.getMode=function(){return le.state.mode},le.saveMenuInstance=function(Be){le.menuInstance=Be},le.addKeyPath=function(Be){return Object(z.a)(Object(z.a)({},Be),{},{keyPath:(Be.keyPath||[]).concat(le.props.eventKey)})},le.triggerOpenChange=function(Be,Ge){var Ze=le.props.eventKey,ut=function(){le.onOpenChange({key:Ze,item:Object(g.a)(le),trigger:Ge,open:Be})};Ge==="mouseenter"?le.mouseenterTimeout=setTimeout(function(){ut()},0):ut()},le.isChildrenSelected=function(){var Be={find:!1};return Ke(le.props.children,le.props.selectedKeys,Be),Be.find},le.isInlineMode=function(){return le.getMode()==="inline"},le.adjustWidth=function(){if(!le.subMenuTitle||!le.menuInstance)return;var Be=nt.findDOMNode(le.menuInstance);if(Be.offsetWidth>=le.subMenuTitle.offsetWidth)return;Be.style.minWidth="".concat(le.subMenuTitle.offsetWidth,"px")},le.saveSubMenuTitle=function(Be){le.subMenuTitle=Be},le.getBaseProps=function(){var Be=Object(g.a)(le),Ge=Be.props,Ze=le.getMode();return{mode:Ze==="horizontal"?"vertical":Ze,visible:le.getVisible(),level:Ge.level+1,inlineIndent:Ge.inlineIndent,focusable:!1,onClick:le.onSubMenuClick,onSelect:le.onSelect,onDeselect:le.onDeselect,onDestroy:le.onDestroy,selectedKeys:Ge.selectedKeys,eventKey:"".concat(Ge.eventKey,"-menu-"),openKeys:Ge.openKeys,motion:Ge.motion,onOpenChange:le.onOpenChange,subMenuOpenDelay:Ge.subMenuOpenDelay,parentMenu:Object(g.a)(le),subMenuCloseDelay:Ge.subMenuCloseDelay,forceSubMenuRender:Ge.forceSubMenuRender,triggerSubMenuAction:Ge.triggerSubMenuAction,builtinPlacements:Ge.builtinPlacements,defaultActiveFirst:Ge.store.getState().defaultActiveFirst[ye(Ge.eventKey)],multiple:Ge.multiple,prefixCls:Ge.rootPrefixCls,id:le.internalMenuId,manualRef:le.saveMenuInstance,itemIcon:Ge.itemIcon,expandIcon:Ge.expandIcon,direction:Ge.direction}},le.getMotion=function(Be,Ge){var Ze=Object(g.a)(le),ut=Ze.haveRendered,ht=le.props,Ct=ht.motion,dn=ht.rootPrefixCls,Kn=Object(z.a)(Object(z.a)({},Ct),{},{leavedClassName:"".concat(dn,"-hidden"),removeOnLeave:!1,motionAppear:ut||!Ge||Be!=="inline"});return Kn};var xe=De.store,fe=De.eventKey,Le=xe.getState(),Ce=Le.defaultActiveFirst;le.isRootMenu=!1;var Fe=!1;return Ce&&(Fe=Ce[fe]),Sn(xe,fe,Fe),le.state={mode:De.mode,isOpen:De.isOpen},le}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var le=this,xe=this.props,fe=xe.mode,Le=xe.parentMenu,Ce=xe.manualRef,Fe=xe.isOpen,Be=function(){le.setState({mode:fe,isOpen:Fe})},Ge=Fe!==this.state.isOpen,Ze=fe!==this.state.mode;if((Ze||Ge)&&(qe.a.cancel(this.updateStateRaf),Ze?this.updateStateRaf=Object(qe.a)(Be):Be()),Ce&&Ce(this),fe!=="horizontal"||!(Le==null?void 0:Le.isRootMenu)||!Fe)return;this.minWidthTimeout=setTimeout(function(){return le.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var le=this.props,xe=le.onDestroy,fe=le.eventKey;xe&&xe(fe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),qe.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(le,xe){var fe=this.getBaseProps();return I.createElement(tr,Object(S.a)({},fe,{id:this.internalMenuId,className:le,style:xe}),this.props.children)}},{key:"renderChildren",value:function(){var le=this,xe=this.getBaseProps(),fe=xe.mode,Le=xe.visible,Ce=xe.forceSubMenuRender,Fe=xe.direction,Be=this.getMotion(fe,Le);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Le||Ce,!this.haveOpened)return I.createElement("div",null);var Ge=G()("".concat(xe.prefixCls,"-sub"),Object(ie.a)({},"".concat(xe.prefixCls,"-rtl"),Fe==="rtl"));return this.isInlineMode()?I.createElement(Fi,Object(S.a)({visible:xe.visible,forceRender:Ce},Be),function(Ze){var ut=Ze.className,ht=Ze.style,Ct=G()(Ge,ut);return le.renderPopupMenu(Ct,ht)}):this.renderPopupMenu(Ge)}},{key:"render",value:function(){var le,xe,fe,Le=Object(z.a)({},this.props),Ce=this.getVisible(),Fe=this.getPrefixCls(),Be=this.isInlineMode(),Ge=this.getMode(),Ze=G()(Fe,"".concat(Fe,"-").concat(Ge),(le={},Object(ie.a)(le,Le.className,!!Le.className),Object(ie.a)(le,this.getOpenClassName(),Ce),Object(ie.a)(le,this.getActiveClassName(),Le.active||Ce&&!Be),Object(ie.a)(le,this.getDisabledClassName(),Le.disabled),Object(ie.a)(le,this.getSelectedClassName(),this.isChildrenSelected()),le));this.internalMenuId||(Le.eventKey?this.internalMenuId="".concat(Le.eventKey,"$Menu"):(Xt+=1,this.internalMenuId="$__$".concat(Xt,"$Menu")));var ut={},ht={},Ct={};Le.disabled||(ut={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ht={onClick:this.onTitleClick},Ct={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var dn={},Kn=Le.direction,On=Kn==="rtl";Be&&(On?dn.paddingRight=Le.inlineIndent*Le.level:dn.paddingLeft=Le.inlineIndent*Le.level);var Nn={};this.getVisible()&&(Nn={"aria-owns":this.internalMenuId});var Bn=null;Ge!=="horizontal"&&(Bn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Bn=I.createElement(this.props.expandIcon,Object(z.a)({},this.props))));var Un=I.createElement("div",Object(S.a)({ref:this.saveSubMenuTitle,style:dn,className:"".concat(Fe,"-title"),role:"button"},Ct,ht,{"aria-expanded":Ce},Nn,{"aria-haspopup":"true",title:typeof Le.title=="string"?Le.title:void 0}),Le.title,Bn||I.createElement("i",{className:"".concat(Fe,"-arrow")})),Ln=this.renderChildren(),zn=((xe=Le.parentMenu)===null||xe===void 0?void 0:xe.isRootMenu)?Le.parentMenu.props.getPopupContainer:function(mr){return mr.parentNode},Xn=sn[Ge],Or=Le.popupOffset?{offset:Le.popupOffset}:{},Yn=G()((fe={},Object(ie.a)(fe,Le.popupClassName,Le.popupClassName&&!Be),Object(ie.a)(fe,"".concat(Fe,"-rtl"),On),fe)),nn=Le.disabled,qt=Le.triggerSubMenuAction,In=Le.subMenuOpenDelay,nr=Le.forceSubMenuRender,Kt=Le.subMenuCloseDelay,rr=Le.builtinPlacements;pe.forEach(function(mr){return delete Le[mr]}),delete Le.onClick;var Rr=On?Object(z.a)(Object(z.a)({},ir),rr):Object(z.a)(Object(z.a)({},_n),rr);delete Le.direction;var Zn=this.getBaseProps(),_r=Be?null:this.getMotion(Zn.mode,Zn.visible);return I.createElement("li",Object(S.a)({},Le,ut,{className:Ze,role:"menuitem"}),I.createElement(Wn,{prefixCls:Fe,popupClassName:G()("".concat(Fe,"-popup"),Yn),getPopupContainer:zn,builtinPlacements:Rr,popupPlacement:Xn,popupVisible:Be?!1:Ce,popupAlign:Or,popup:Be?null:Ln,action:nn||Be?[]:[qt],mouseEnterDelay:In,mouseLeaveDelay:Kt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:nr,popupMotion:_r},Un),Be?Ln:null)}}]),He}(I.Component);Nt.defaultProps={onMouseEnter:J,onMouseLeave:J,onTitleMouseEnter:J,onTitleMouseLeave:J,onTitleClick:J,manualRef:J,mode:"vertical",title:""};var Ut=Object(c.b)(function(Ae,Me){var He=Ae.openKeys,De=Ae.activeKey,le=Ae.selectedKeys,xe=Me.eventKey,fe=Me.subMenuKey;return{isOpen:He.indexOf(xe)>-1,active:De[fe]===xe,selectedKeys:le}})(Nt);Ut.isSubMenu=!0;var jt=Ut,je="menuitem-overflowed",Yt=.5,fn=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){var De;return Object(R.a)(this,He),De=Me.apply(this,arguments),De.resizeObserver=null,De.mutationObserver=null,De.originalTotalWidth=0,De.overflowedItems=[],De.menuItemSizes=[],De.cancelFrameId=null,De.state={lastVisibleIndex:void 0},De.childRef=I.createRef(),De.getMenuItemNodes=function(){var le=De.props.prefixCls,xe=De.childRef.current;return xe?[].slice.call(xe.children).filter(function(fe){return fe.className.split(" ").indexOf("".concat(le,"-overflowed-submenu"))<0}):[]},De.getOverflowedSubMenuItem=function(le,xe,fe){var Le=De.props,Ce=Le.overflowedIndicator,Fe=Le.level,Be=Le.mode,Ge=Le.prefixCls,Ze=Le.theme;if(Fe!==1||Be!=="horizontal")return null;var ut=De.props.children[0],ht=ut.props,Ct=ht.children,dn=ht.title,Kn=ht.style,On=Object(N.a)(ht,["children","title","style"]),Nn=Object(z.a)({},Kn),Bn="".concat(le,"-overflowed-indicator"),Un="".concat(le,"-overflowed-indicator");xe.length===0&&fe!==!0?Nn=Object(z.a)(Object(z.a)({},Nn),{},{display:"none"}):fe&&(Nn=Object(z.a)(Object(z.a)({},Nn),{},{visibility:"hidden",position:"absolute"}),Bn="".concat(Bn,"-placeholder"),Un="".concat(Un,"-placeholder"));var Ln=Ze?"".concat(Ge,"-").concat(Ze):"",zn={};return pe.forEach(function(Xn){On[Xn]!==void 0&&(zn[Xn]=On[Xn])}),I.createElement(jt,Object(S.a)({title:Ce,className:"".concat(Ge,"-overflowed-submenu"),popupClassName:Ln},zn,{key:Bn,eventKey:Un,disabled:!1,style:Nn}),xe)},De.setChildrenWidthAndResize=function(){if(De.props.mode!=="horizontal")return;var le=De.childRef.current;if(!le)return;var xe=le.children;if(!xe||xe.length===0)return;var fe=le.children[xe.length-1];ke(fe,"display","inline-block");var Le=De.getMenuItemNodes(),Ce=Le.filter(function(Fe){return Fe.className.split(" ").indexOf(je)>=0});Ce.forEach(function(Fe){ke(Fe,"display","inline-block")}),De.menuItemSizes=Le.map(function(Fe){return we(Fe,!0)}),Ce.forEach(function(Fe){ke(Fe,"display","none")}),De.overflowedIndicatorWidth=we(le.children[le.children.length-1],!0),De.originalTotalWidth=De.menuItemSizes.reduce(function(Fe,Be){return Fe+Be},0),De.handleResize(),ke(fe,"display","none")},De.handleResize=function(){if(De.props.mode!=="horizontal")return;var le=De.childRef.current;if(!le)return;var xe=we(le);De.overflowedItems=[];var fe=0,Le;De.originalTotalWidth>xe+Yt&&(Le=-1,De.menuItemSizes.forEach(function(Ce){fe+=Ce,fe+De.overflowedIndicatorWidth<=xe&&(Le+=1)})),De.setState({lastVisibleIndex:Le})},De}return Object(O.a)(He,[{key:"componentDidMount",value:function(){var le=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var xe=this.childRef.current;if(!xe)return;this.resizeObserver=new Qe.default(function(fe){fe.forEach(function(){var Le=le.cancelFrameId;cancelAnimationFrame(Le),le.cancelFrameId=requestAnimationFrame(le.setChildrenWidthAndResize)})}),[].slice.call(xe.children).concat(xe).forEach(function(fe){le.resizeObserver.observe(fe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){le.resizeObserver.disconnect(),[].slice.call(xe.children).concat(xe).forEach(function(fe){le.resizeObserver.observe(fe)}),le.setChildrenWidthAndResize()}),this.mutationObserver.observe(xe,{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(le){var xe=this,fe=this.state.lastVisibleIndex;return(le||[]).reduce(function(Le,Ce,Fe){var Be=Ce;if(xe.props.mode==="horizontal"){var Ge=xe.getOverflowedSubMenuItem(Ce.props.eventKey,[]);fe!==void 0&&xe.props.className.indexOf("".concat(xe.props.prefixCls,"-root"))!==-1&&(Fe>fe&&(Be=I.cloneElement(Ce,{style:{display:"none"},eventKey:"".concat(Ce.props.eventKey,"-hidden"),className:"".concat(je)})),Fe===fe+1&&(xe.overflowedItems=le.slice(fe+1).map(function(ut){return I.cloneElement(ut,{key:ut.props.eventKey,mode:"vertical-left"})}),Ge=xe.getOverflowedSubMenuItem(Ce.props.eventKey,xe.overflowedItems)));var Ze=[].concat(Object(L.a)(Le),[Ge,Be]);return Fe===le.length-1&&Ze.push(xe.getOverflowedSubMenuItem(Ce.props.eventKey,[],!0)),Ze}return[].concat(Object(L.a)(Le),[Be])},[])}},{key:"render",value:function(){var le=this.props,xe=le.visible,fe=le.prefixCls,Le=le.overflowedIndicator,Ce=le.mode,Fe=le.level,Be=le.tag,Ge=le.children,Ze=le.theme,ut=Object(N.a)(le,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),ht=Be;return I.createElement(ht,Object(S.a)({ref:this.childRef},ut),this.renderChildren(Ge))}}]),He}(I.Component);fn.defaultProps={tag:"div",className:""};var fr=fn;function pn(Ae){return Ae.length?Ae.every(function(Me){return!!Me.props.disabled}):!0}function Yr(Ae,Me,He){var De=Ae.getState();Ae.setState({activeKey:Object(z.a)(Object(z.a)({},De.activeKey),{},Object(ie.a)({},Me,He))})}function $r(Ae){return Ae.eventKey||"0-menu-"}function kr(Ae,Me){var He=Me,De=Ae.children,le=Ae.eventKey;if(He){var xe;if(Re(De,function(fe,Le){fe&&fe.props&&!fe.props.disabled&&He===X(fe,le,Le)&&(xe=!0)}),xe)return He}return He=null,Ae.defaultActiveFirst&&Re(De,function(fe,Le){!He&&fe&&!fe.props.disabled&&(He=X(fe,le,Le))}),He}function An(Ae){if(!Ae)return;var Me=this.instanceArray.indexOf(Ae);Me!==-1?this.instanceArray[Me]=Ae:this.instanceArray.push(Ae)}var St=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(De){var le;return Object(R.a)(this,He),le=Me.call(this,De),le.onKeyDown=function(xe,fe){var Le=xe.keyCode,Ce;if(le.getFlatInstanceArray().forEach(function(Be){Be&&Be.props.active&&Be.onKeyDown&&(Ce=Be.onKeyDown(xe))}),Ce)return 1;var Fe=null;return(Le===p.a.UP||Le===p.a.DOWN)&&(Fe=le.step(Le===p.a.UP?-1:1)),Fe?(xe.preventDefault(),Yr(le.props.store,$r(le.props),Fe.props.eventKey),typeof fe=="function"&&fe(Fe),1):void 0},le.onItemHover=function(xe){var fe=xe.key,Le=xe.hover;Yr(le.props.store,$r(le.props),Le?fe:null)},le.onDeselect=function(xe){le.props.onDeselect(xe)},le.onSelect=function(xe){le.props.onSelect(xe)},le.onClick=function(xe){le.props.onClick(xe)},le.onOpenChange=function(xe){le.props.onOpenChange(xe)},le.onDestroy=function(xe){le.props.onDestroy(xe)},le.getFlatInstanceArray=function(){return le.instanceArray},le.step=function(xe){var fe=le.getFlatInstanceArray(),Le=le.props.store.getState().activeKey[$r(le.props)],Ce=fe.length;if(!Ce)return null;xe<0&&(fe=fe.concat().reverse());var Fe=-1;if(fe.every(function(ut,ht){return ut&&ut.props.eventKey===Le?(Fe=ht,!1):!0}),!le.props.defaultActiveFirst&&Fe!==-1&&pn(fe.slice(Fe,Ce-1)))return;var Be=(Fe+1)%Ce,Ge=Be;do{var Ze=fe[Ge];if(!Ze||Ze.props.disabled)Ge=(Ge+1)%Ce;else return Ze}while(Ge!==Be);return null},le.renderCommonMenuItem=function(xe,fe,Le){var Ce=le.props.store.getState(),Fe=Object(g.a)(le),Be=Fe.props,Ge=X(xe,Be.eventKey,fe),Ze=xe.props;if(!Ze||typeof xe.type=="string")return xe;var ut=Ge===Ce.activeKey,ht=Object(z.a)(Object(z.a)({mode:Ze.mode||Be.mode,level:Be.level,inlineIndent:Be.inlineIndent,renderMenuItem:le.renderMenuItem,rootPrefixCls:Be.prefixCls,index:fe,parentMenu:Be.parentMenu,manualRef:Ze.disabled?void 0:Object(E.a)(xe.ref,An.bind(Object(g.a)(le))),eventKey:Ge,active:!Ze.disabled&&ut,multiple:Be.multiple,onClick:function(dn){(Ze.onClick||J)(dn),le.onClick(dn)},onItemHover:le.onItemHover,motion:Be.motion,subMenuOpenDelay:Be.subMenuOpenDelay,subMenuCloseDelay:Be.subMenuCloseDelay,forceSubMenuRender:Be.forceSubMenuRender,onOpenChange:le.onOpenChange,onDeselect:le.onDeselect,onSelect:le.onSelect,builtinPlacements:Be.builtinPlacements,itemIcon:Ze.itemIcon||le.props.itemIcon,expandIcon:Ze.expandIcon||le.props.expandIcon},Le),{},{direction:Be.direction});return(Be.mode==="inline"||Ue())&&(ht.triggerSubMenuAction="click"),I.cloneElement(xe,Object(z.a)(Object(z.a)({},ht),{},{key:Ge||fe}))},le.renderMenuItem=function(xe,fe,Le){if(!xe)return null;var Ce=le.props.store.getState(),Fe={openKeys:Ce.openKeys,selectedKeys:Ce.selectedKeys,triggerSubMenuAction:le.props.triggerSubMenuAction,subMenuKey:Le};return le.renderCommonMenuItem(xe,fe,Fe)},De.store.setState({activeKey:Object(z.a)(Object(z.a)({},De.store.getState().activeKey),{},Object(ie.a)({},De.eventKey,kr(De,De.activeKey)))}),le.instanceArray=[],le}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(le){return this.props.visible||le.visible||this.props.className!==le.className||!B()(this.props.style,le.style)}},{key:"componentDidUpdate",value:function(le){var xe=this.props,fe="activeKey"in xe?xe.activeKey:xe.store.getState().activeKey[$r(xe)],Le=kr(xe,fe);if(Le!==fe)Yr(xe.store,$r(xe),Le);else if("activeKey"in le){var Ce=kr(le,le.activeKey);Le!==Ce&&Yr(xe.store,$r(xe),Le)}}},{key:"render",value:function(){var le=this,xe=Object(S.a)({},this.props);this.instanceArray=[];var fe=G()(xe.prefixCls,xe.className,"".concat(xe.prefixCls,"-").concat(xe.mode)),Le={className:fe,role:xe.role||"menu"};xe.id&&(Le.id=xe.id),xe.focusable&&(Le.tabIndex=0,Le.onKeyDown=this.onKeyDown);var Ce=xe.prefixCls,Fe=xe.eventKey,Be=xe.visible,Ge=xe.level,Ze=xe.mode,ut=xe.overflowedIndicator,ht=xe.theme;return pe.forEach(function(Ct){return delete xe[Ct]}),delete xe.onClick,I.createElement(fr,Object(S.a)({},xe,{prefixCls:Ce,mode:Ze,tag:"ul",level:Ge,theme:ht,visible:Be,overflowedIndicator:ut},Le),Object(K.a)(xe.children).map(function(Ct,dn){return le.renderMenuItem(Ct,dn,Fe||"0-menu-")}))}}]),He}(I.Component);St.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:J};var pr=Object(c.b)()(St),tr=pr,Hn=U("Kwbf");function Qr(Ae,Me,He){var De=Ae.prefixCls,le=Ae.motion,xe=Ae.defaultMotions,fe=xe===void 0?{}:xe,Le=Ae.openAnimation,Ce=Ae.openTransitionName,Fe=Me.switchingModeFromInline;if(le)return le;if(Object(W.a)(Le)==="object"&&Le)Object(Hn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Le=="string")return{motionName:"".concat(De,"-open-").concat(Le)};if(Ce)return{motionName:Ce};var Be=fe[He];return Be||(Fe?null:fe.other)}var Lt=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(De){var le;Object(R.a)(this,He),le=Me.call(this,De),le.onSelect=function(Le){var Ce=Object(g.a)(le),Fe=Ce.props;if(Fe.selectable){var Be=le.store.getState(),Ge=Be.selectedKeys,Ze=Le.key;Fe.multiple?Ge=Ge.concat([Ze]):Ge=[Ze],"selectedKeys"in Fe||le.store.setState({selectedKeys:Ge}),Fe.onSelect(Object(z.a)(Object(z.a)({},Le),{},{selectedKeys:Ge}))}},le.onClick=function(Le){var Ce=le.getRealMenuMode(),Fe=Object(g.a)(le),Be=Fe.store,Ge=Fe.props.onOpenChange;Ce!=="inline"&&!("openKeys"in le.props)&&(Be.setState({openKeys:[]}),Ge([])),le.props.onClick(Le)},le.onKeyDown=function(Le,Ce){le.innerMenu.getWrappedInstance().onKeyDown(Le,Ce)},le.onOpenChange=function(Le){var Ce=Object(g.a)(le),Fe=Ce.props,Be=le.store.getState().openKeys.concat(),Ge=!1,Ze=function(ht){var Ct=!1;if(ht.open)Ct=Be.indexOf(ht.key)===-1,Ct&&Be.push(ht.key);else{var dn=Be.indexOf(ht.key);Ct=dn!==-1,Ct&&Be.splice(dn,1)}Ge=Ge||Ct};Array.isArray(Le)?Le.forEach(Ze):Ze(Le),Ge&&("openKeys"in le.props||le.store.setState({openKeys:Be}),Fe.onOpenChange(Be))},le.onDeselect=function(Le){var Ce=Object(g.a)(le),Fe=Ce.props;if(Fe.selectable){var Be=le.store.getState().selectedKeys.concat(),Ge=Le.key,Ze=Be.indexOf(Ge);Ze!==-1&&Be.splice(Ze,1),"selectedKeys"in Fe||le.store.setState({selectedKeys:Be}),Fe.onDeselect(Object(z.a)(Object(z.a)({},Le),{},{selectedKeys:Be}))}},le.onMouseEnter=function(Le){le.restoreModeVerticalFromInline();var Ce=le.props.onMouseEnter;Ce&&Ce(Le)},le.onTransitionEnd=function(Le){var Ce=Le.propertyName==="width"&&Le.target===Le.currentTarget,Fe=Le.target.className,Be=Object.prototype.toString.call(Fe)==="[object SVGAnimatedString]"?Fe.animVal:Fe,Ge=Le.propertyName==="font-size"&&Be.indexOf("anticon")>=0;(Ce||Ge)&&le.restoreModeVerticalFromInline()},le.setInnerMenu=function(Le){le.innerMenu=Le},le.isRootMenu=!0;var xe=De.defaultSelectedKeys,fe=De.defaultOpenKeys;return"selectedKeys"in De&&(xe=De.selectedKeys||[]),"openKeys"in De&&(fe=De.openKeys||[]),le.store=Object(c.c)({selectedKeys:xe,openKeys:fe,activeKey:{"0-menu-":kr(De,De.activeKey)}}),le.state={switchingModeFromInline:!1,prevProps:De,inlineOpenKeys:[],store:le.store},le}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(le){var xe=this.props,fe=xe.siderCollapsed,Le=xe.inlineCollapsed,Ce=xe.onOpenChange;(!le.inlineCollapsed&&Le||!le.siderCollapsed&&fe)&&Ce([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var le=this.props.collapsedWidth,xe=this.store,fe=this.prevOpenKeys,Le=this.getInlineCollapsed()&&(le===0||le==="0"||le==="0px");Le?(this.prevOpenKeys=xe.getState().openKeys.concat(),this.store.setState({openKeys:[]})):fe&&(this.store.setState({openKeys:fe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var le=this.props.mode,xe=this.state.switchingModeFromInline,fe=this.getInlineCollapsed();return xe&&fe?"inline":fe?"vertical":le}},{key:"getInlineCollapsed",value:function(){var le=this.props,xe=le.inlineCollapsed,fe=le.siderCollapsed;return fe!==void 0?fe:xe}},{key:"restoreModeVerticalFromInline",value:function(){var le=this.state.switchingModeFromInline;le&&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 le=Object(z.a)({},Object(C.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),xe=this.getRealMenuMode();return le.className+=" ".concat(le.prefixCls,"-root"),le.direction==="rtl"&&(le.className+=" ".concat(le.prefixCls,"-rtl")),le=Object(z.a)(Object(z.a)({},le),{},{mode:xe,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Qr(this.props,this.state,xe)}),delete le.openAnimation,delete le.openTransitionName,I.createElement(c.a,{store:this.store},I.createElement(tr,Object(S.a)({},le,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(le,xe){var fe=xe.prevProps,Le=xe.store,Ce=Le.getState(),Fe={},Be={prevProps:le};return fe.mode==="inline"&&le.mode!=="inline"&&(Be.switchingModeFromInline=!0),"openKeys"in le?Fe.openKeys=le.openKeys||[]:((le.inlineCollapsed&&!fe.inlineCollapsed||le.siderCollapsed&&!fe.siderCollapsed)&&(Be.switchingModeFromInline=!0,Be.inlineOpenKeys=Ce.openKeys,Fe.openKeys=[]),(!le.inlineCollapsed&&fe.inlineCollapsed||!le.siderCollapsed&&fe.siderCollapsed)&&(Fe.openKeys=xe.inlineOpenKeys,Be.inlineOpenKeys=[])),Object.keys(Fe).length&&Le.setState(Fe),Be}}]),He}(I.Component);Lt.defaultProps={selectable:!0,onClick:J,onSelect:J,onOpenChange:J,onDeselect:J,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:I.createElement("span",null,"\xB7\xB7\xB7")};var Ft=Lt,It=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){var De;return Object(R.a)(this,He),De=Me.apply(this,arguments),De.onKeyDown=function(le){var xe=le.keyCode;return xe===p.a.ENTER?(De.onClick(le),!0):void 0},De.onMouseLeave=function(le){var xe=De.props,fe=xe.eventKey,Le=xe.onItemHover,Ce=xe.onMouseLeave;Le({key:fe,hover:!1}),Ce({key:fe,domEvent:le})},De.onMouseEnter=function(le){var xe=De.props,fe=xe.eventKey,Le=xe.onItemHover,Ce=xe.onMouseEnter;Le({key:fe,hover:!0}),Ce({key:fe,domEvent:le})},De.onClick=function(le){var xe=De.props,fe=xe.eventKey,Le=xe.multiple,Ce=xe.onClick,Fe=xe.onSelect,Be=xe.onDeselect,Ge=xe.isSelected,Ze={key:fe,keyPath:[fe],item:Object(g.a)(De),domEvent:le};Ce(Ze),Le?Ge?Be(Ze):Fe(Ze):Ge||Fe(Ze)},De.saveNode=function(le){De.node=le},De}return Object(O.a)(He,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var le=this.props;le.onDestroy&&le.onDestroy(le.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 le,xe=Object(z.a)({},this.props),fe=G()(this.getPrefixCls(),xe.className,(le={},Object(ie.a)(le,this.getActiveClassName(),!xe.disabled&&xe.active),Object(ie.a)(le,this.getSelectedClassName(),xe.isSelected),Object(ie.a)(le,this.getDisabledClassName(),xe.disabled),le)),Le=Object(z.a)(Object(z.a)({},xe.attribute),{},{title:typeof xe.title=="string"?xe.title:void 0,className:fe,role:xe.role||"menuitem","aria-disabled":xe.disabled});xe.role==="option"?Le=Object(z.a)(Object(z.a)({},Le),{},{role:"option","aria-selected":xe.isSelected}):(xe.role===null||xe.role==="none")&&(Le.role="none");var Ce={onClick:xe.disabled?null:this.onClick,onMouseLeave:xe.disabled?null:this.onMouseLeave,onMouseEnter:xe.disabled?null:this.onMouseEnter},Fe=Object(z.a)({},xe.style);xe.mode==="inline"&&(xe.direction==="rtl"?Fe.paddingRight=xe.inlineIndent*xe.level:Fe.paddingLeft=xe.inlineIndent*xe.level),pe.forEach(function(Ge){return delete xe[Ge]}),delete xe.direction;var Be=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Be=I.createElement(this.props.itemIcon,this.props)),I.createElement("li",Object(S.a)({},Object(C.a)(xe,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Le,Ce,{style:Fe,ref:this.saveNode}),xe.children,Be)}}]),He}(I.Component);It.isMenuItem=!0,It.defaultProps={onSelect:J,onMouseEnter:J,onMouseLeave:J,manualRef:J};var Jt=Object(c.b)(function(Ae,Me){var He=Ae.activeKey,De=Ae.selectedKeys,le=Me.eventKey,xe=Me.subMenuKey;return{active:He[xe]===le,isSelected:Array.isArray(De)?De.indexOf(le)!==-1:De===le}})(It),Mn=Jt,wn=function(Ae){Object(_.a)(He,Ae);var Me=Object(d.a)(He);function He(){var De;return Object(R.a)(this,He),De=Me.apply(this,arguments),De.renderInnerMenuItem=function(le){var xe=De.props,fe=xe.renderMenuItem,Le=xe.index;return fe(le,Le,De.props.subMenuKey)},De}return Object(O.a)(He,[{key:"render",value:function(){var le=Object(S.a)({},this.props),xe=le.className,fe=xe===void 0?"":xe,Le=le.rootPrefixCls,Ce="".concat(Le,"-item-group-title"),Fe="".concat(Le,"-item-group-list"),Be=le.title,Ge=le.children;return pe.forEach(function(Ze){return delete le[Ze]}),delete le.direction,I.createElement("li",Object(S.a)({},le,{onClick:function(ut){return ut.stopPropagation()},className:"".concat(fe," ").concat(Le,"-item-group")}),I.createElement("div",{className:Ce,title:typeof Be=="string"?Be:void 0},Be),I.createElement("ul",{className:Fe},I.Children.map(Ge,this.renderInnerMenuItem)))}}]),He}(I.Component);wn.isMenuItemGroup=!0,wn.defaultProps={disabled:!0};var Vn=wn,sr=function(Me){var He=Me.className,De=Me.rootPrefixCls,le=Me.style;return I.createElement("li",{className:"".concat(He," ").concat(De,"-item-divider"),style:le})};sr.defaultProps={disabled:!0,className:"",style:{}};var mi=sr,Gn=Ft,Wi=U("eDIo");function lr(Ae,Me){var He=Ae.prefixCls,De=Ae.editable,le=Ae.locale,xe=Ae.style;return!De||De.showAdd===!1?null:I.createElement("button",{ref:Me,type:"button",className:"".concat(He,"-nav-add"),style:xe,"aria-label":(le==null?void 0:le.addAriaLabel)||"Add tab",onClick:function(Le){De.onEdit("add",{event:Le})}},De.addIcon||"+")}var ii=I.forwardRef(lr);function Zr(Ae,Me){var He=Ae.prefixCls,De=Ae.id,le=Ae.tabs,xe=Ae.locale,fe=Ae.mobile,Le=Ae.moreIcon,Ce=Le===void 0?"More":Le,Fe=Ae.moreTransitionName,Be=Ae.style,Ge=Ae.className,Ze=Ae.editable,ut=Ae.tabBarGutter,ht=Ae.rtl,Ct=Ae.onTabClick,dn=Object(I.useState)(!1),Kn=Object(Y.a)(dn,2),On=Kn[0],Nn=Kn[1],Bn=Object(I.useState)(null),Un=Object(Y.a)(Bn,2),Ln=Un[0],zn=Un[1],Xn="".concat(De,"-more-popup"),Or="".concat(He,"-dropdown"),Yn=Ln!==null?"".concat(Xn,"-").concat(Ln):null,nn=xe==null?void 0:xe.dropdownAriaLabel,qt=I.createElement(Gn,{onClick:function(_r){var mr=_r.key,Nr=_r.domEvent;Ct(mr,Nr),Nn(!1)},id:Xn,tabIndex:-1,role:"listbox","aria-activedescendant":Yn,selectedKeys:[Ln],"aria-label":nn!==void 0?nn:"expanded dropdown"},le.map(function(Zn){return I.createElement(Mn,{key:Zn.key,id:"".concat(Xn,"-").concat(Zn.key),role:"option","aria-controls":De&&"".concat(De,"-panel-").concat(Zn.key),disabled:Zn.disabled},Zn.tab)}));function In(Zn){for(var _r=le.filter(function(li){return!li.disabled}),mr=_r.findIndex(function(li){return li.key===Ln})||0,Nr=_r.length,Fr=0;Frrr?(nr=qt,Xn.current="x"):(nr=In,Xn.current="y");var Rr=Date.now();Rr-Ln.current>100&&(zn.current=!1),(Me(-nr,-nr)||zn.current)&&(nn.preventDefault(),zn.current=!0),Ln.current=Rr}var Yn=Object(I.useRef)(null);Yn.current={onTouchStart:Nn,onTouchMove:Bn,onTouchEnd:Un,onWheel:Or},I.useEffect(function(){function nn(Kt){Yn.current.onTouchStart(Kt)}function qt(Kt){Yn.current.onTouchMove(Kt)}function In(Kt){Yn.current.onTouchEnd(Kt)}function nr(Kt){Yn.current.onWheel(Kt)}return document.addEventListener("touchmove",qt,{passive:!1}),document.addEventListener("touchend",In,{passive:!1}),Ae.current.addEventListener("touchstart",nn,{passive:!1}),Ae.current.addEventListener("wheel",nr),function(){document.removeEventListener("touchmove",qt),document.removeEventListener("touchend",In)}},[])}function fa(){var Ae=Object(I.useRef)(new Map);function Me(De){return Ae.current.has(De)||Ae.current.set(De,I.createRef()),Ae.current.get(De)}function He(De){Ae.current.delete(De)}return[Me,He]}function $a(Ae,Me){var He=I.useRef(Ae),De=I.useState({}),le=Object(Y.a)(De,2),xe=le[1];function fe(Le){var Ce=typeof Le=="function"?Le(He.current):Le;Ce!==He.current&&Me(Ce,He.current),He.current=Ce,xe({})}return[He.current,fe]}var co=function(Me){var He=Me.position,De=Me.prefixCls,le=Me.extra;if(!le)return null;var xe,fe=le;return He==="right"&&(xe=fe.right||!fe.left&&fe||null),He==="left"&&(xe=fe.left||null),xe?I.createElement("div",{className:"".concat(De,"-extra-content")},xe):null};function ka(Ae,Me){var He,De=I.useContext(Pa),le=De.prefixCls,xe=De.tabs,fe=Ae.className,Le=Ae.style,Ce=Ae.id,Fe=Ae.animated,Be=Ae.activeKey,Ge=Ae.rtl,Ze=Ae.extra,ut=Ae.editable,ht=Ae.locale,Ct=Ae.tabPosition,dn=Ae.tabBarGutter,Kn=Ae.children,On=Ae.onTabClick,Nn=Ae.onTabScroll,Bn=Object(I.useRef)(),Un=Object(I.useRef)(),Ln=Object(I.useRef)(),zn=Object(I.useRef)(),Xn=fa(),Or=Object(Y.a)(Xn,2),Yn=Or[0],nn=Or[1],qt=Ct==="top"||Ct==="bottom",In=$a(0,function(dr,er){qt&&Nn&&Nn({direction:dr>er?"left":"right"})}),nr=Object(Y.a)(In,2),Kt=nr[0],rr=nr[1],Rr=$a(0,function(dr,er){!qt&&Nn&&Nn({direction:dr>er?"top":"bottom"})}),Zn=Object(Y.a)(Rr,2),_r=Zn[0],mr=Zn[1],Nr=Object(I.useState)(0),Fr=Object(Y.a)(Nr,2),Lr=Fr[0],li=Fr[1],Ti=Object(I.useState)(0),gi=Object(Y.a)(Ti,2),Wr=gi[0],wr=gi[1],gr=Object(I.useState)(0),ln=Object(Y.a)(gr,2),vr=ln[0],Oi=ln[1],Hi=Object(I.useState)(0),$i=Object(Y.a)(Hi,2),yr=$i[0],Mi=$i[1],Ki=Object(I.useState)(null),Er=Object(Y.a)(Ki,2),cr=Er[0],Pr=Er[1],Na=Object(I.useState)(null),Za=Object(Y.a)(Na,2),na=Za[0],ga=Za[1],zr=Object(I.useState)(0),Ni=Object(Y.a)(zr,2),Ua=Ni[0],Io=Ni[1],Po=Object(I.useState)(0),mo=Object(Y.a)(Po,2),Ja=mo[0],qa=mo[1],ra=o(new Map),va=Object(Y.a)(ra,2),go=va[0],ja=va[1],ya=i(xe,go,Lr),ia="".concat(le,"-nav-operations-hidden"),Cr=0,wi=0;qt?Ge?(Cr=0,wi=Math.max(0,Lr-cr)):(Cr=Math.min(0,cr-Lr),wi=0):(Cr=Math.min(0,na-Wr),wi=0);function aa(dr){return drwi?[wi,!1]:[dr,!0]}var Qi=Object(I.useRef)(),wa=Object(I.useState)(),oa=Object(Y.a)(wa,2),Ba=oa[0],eo=oa[1];function Fa(){eo(Date.now())}function to(){window.clearTimeout(Qi.current)}ha(Bn,function(dr,er){var ti=!1;function ui(Ji,zi){Ji(function(Aa){var qi=aa(Aa+zi),Jr=Object(Y.a)(qi,2),Oa=Jr[0],Je=Jr[1];return ti=Je,Oa})}if(qt){if(cr>=Lr)return ti;ui(rr,dr)}else{if(na>=Wr)return ti;ui(mr,er)}return to(),Fa(),ti}),Object(I.useEffect)(function(){return to(),Ba&&(Qi.current=window.setTimeout(function(){eo(0)},100)),to},[Ba]);function Gi(){var dr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Be,er=ya.get(dr);if(!er)return;if(qt){var ti=Kt;Ge?er.rightKt+cr&&(ti=er.right+er.width-cr):er.left<-Kt?ti=-er.left:er.left+er.width>-Kt+cr&&(ti=-(er.left+er.width-cr)),mr(0),rr(aa(ti)[0])}else{var ui=_r;er.top<-_r?ui=-er.top:er.top+er.height>-_r+na&&(ui=-(er.top+er.height-na)),rr(0),mr(aa(ui)[0])}}var Zi=A(ya,{width:cr,height:na,left:Kt,top:_r},{width:vr,height:yr},{width:Ua,height:Ja},Object(z.a)(Object(z.a)({},Ae),{},{tabs:xe})),no=Object(Y.a)(Zi,2),ro=no[0],ko=no[1],Mo=xe.map(function(dr){var er=dr.key;return I.createElement(u,{id:Ce,prefixCls:le,key:er,rtl:Ge,tab:dr,closable:dr.closable,editable:ut,active:er===Be,tabPosition:Ct,tabBarGutter:dn,renderWrapper:Kn,removeAriaLabel:ht==null?void 0:ht.removeAriaLabel,ref:Yn(er),onClick:function(ui){On(er,ui)},onRemove:function(){nn(er)},onFocus:function(){Gi(er),Fa(),Ge||(Bn.current.scrollLeft=0),Bn.current.scrollTop=0}})}),io=h(function(){var dr,er,ti,ui,Ji,zi,Aa,qi,Jr,Oa=((dr=Bn.current)===null||dr===void 0?void 0:dr.offsetWidth)||0,Je=((er=Bn.current)===null||er===void 0?void 0:er.offsetHeight)||0,$e=((ti=zn.current)===null||ti===void 0?void 0:ti.offsetWidth)||0,Ve=((ui=zn.current)===null||ui===void 0?void 0:ui.offsetHeight)||0,tt=((Ji=Ln.current)===null||Ji===void 0?void 0:Ji.offsetWidth)||0,rt=((zi=Ln.current)===null||zi===void 0?void 0:zi.offsetHeight)||0;Pr(Oa),ga(Je),Io($e),qa(Ve);var vt=(((Aa=Un.current)===null||Aa===void 0?void 0:Aa.offsetWidth)||0)-$e,gt=(((qi=Un.current)===null||qi===void 0?void 0:qi.offsetHeight)||0)-Ve;li(vt),wr(gt);var mt=(Jr=Ln.current)===null||Jr===void 0?void 0:Jr.className.includes(ia);Oi(vt-(mt?0:tt)),Mi(gt-(mt?0:rt)),ja(function(){var $t=new Map;return xe.forEach(function($n){var _i=$n.key,Pn=Yn(_i).current;Pn&&$t.set(_i,{width:Pn.offsetWidth,height:Pn.offsetHeight,left:Pn.offsetLeft,top:Pn.offsetTop})}),$t})}),No=xe.slice(0,ro),Vr=xe.slice(ko+1),Hr=[].concat(Object(L.a)(No),Object(L.a)(Vr)),ai=Object(I.useState)(),Kr=Object(Y.a)(ai,2),Ca=Kr[0],Wa=Kr[1],Ci=ya.get(Be),ao=Object(I.useRef)();function Ha(){f.a.cancel(ao.current)}Object(I.useEffect)(function(){var dr={};return Ci&&(qt?(Ge?dr.right=Ci.right:dr.left=Ci.left,dr.width=Ci.width):(dr.top=Ci.top,dr.height=Ci.height)),Ha(),ao.current=f()(function(){Wa(dr)}),Ha},[Ci,qt,Ge]),Object(I.useEffect)(function(){Gi()},[Be,Ci,ya,qt]),Object(I.useEffect)(function(){io()},[Ge,dn,Be,xe.map(function(dr){return dr.key}).join("_")]);var vo=!!Hr.length,sa="".concat(le,"-nav-wrap"),Ka,Sa,yo,Ga;return qt?Ge?(Sa=Kt>0,Ka=Kt+cr` "'(~:]+/,o=/^(~~~+|```+)[ \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(m,y,H){return y.f=y.inline=H,H(m,y)}function i(m,y,H){return y.f=y.block=H,H(m,y)}function D(m){return!m||!/\S/.test(m.string)}function A(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==R){var y=I;if(!y){var H=ie.innerMode(z,m.htmlState);y=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}y&&(m.f=d,m.block=S,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function S(m,y){var H=m.column()===y.indentation,Q=D(y.prevLine.stream),te=y.indentedCode,ae=y.prevLine.hr,Te=y.list!==!1,_e=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var ge=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,Te)){for(y.list=null;ge=4&&(te||y.prevLine.fencedCodeEnd||y.prevLine.header||Q))return m.skipToEnd(),y.indentedCode=!0,G.code;if(m.eatSpace())return null;if(H&&y.indentation<=_e&&(he=m.match(f))&&he[1].length<=6)return y.quote=0,y.header=he[1].length,y.thisLine.header=!0,N.highlightFormatting&&(y.formatting="header"),y.f=y.inline,g(y);if(y.indentation<=_e&&m.eat(">"))return y.quote=H?1:y.quote+1,N.highlightFormatting&&(y.formatting="quote"),m.eatSpace(),g(y);if(!Oe&&!y.setext&&H&&y.indentation<=_e&&(he=m.match(L))){var V=he[1]?"ol":"ul";return y.indentation=ge+m.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,N.taskLists&&m.match(x,!1)&&(y.taskList=!0),y.f=y.inline,N.highlightFormatting&&(y.formatting=["list","list-"+V]),g(y)}else{if(H&&y.indentation<=_e&&(he=m.match(o,!0)))return y.quote=0,y.fencedEndRE=new RegExp(he[1]+"+ *$"),y.localMode=N.fencedCodeBlockHighlighting&&M(he[2]||N.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=ie.startState(y.localMode)),y.f=y.block=O,N.highlightFormatting&&(y.formatting="code-block"),y.code=-1,g(y);if(y.setext||(!ve||!Te)&&!y.quote&&y.list===!1&&!y.code&&!Oe&&!p.test(m.string)&&(he=m.lookAhead(1))&&(he=he.match(b)))return y.setext?(y.header=y.setext,y.setext=0,m.skipToEnd(),N.highlightFormatting&&(y.formatting="header")):(y.header=he[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,g(y);if(Oe)return m.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,G.hr;if(m.peek()==="[")return s(m,y,B)}return s(m,y,y.inline)}function R(m,y){var H=z.token(m,y.htmlState);if(!I){var Q=ie.innerMode(z,y.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||y.md_inside&&m.current().indexOf(">")>-1)&&(y.f=d,y.block=S,y.htmlState=null)}return H}function O(m,y){var H=y.listStack[y.listStack.length-1]||0,Q=y.indentation=m.quote?y.push(G.formatting+"-"+m.formatting[H]+"-"+m.quote):y.push("error"))}if(m.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(m.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(m.linkHref?y.push(G.linkHref,"url"):(m.strong&&y.push(G.strong),m.em&&y.push(G.em),m.strikethrough&&y.push(G.strikethrough),m.emoji&&y.push(G.emoji),m.linkText&&y.push(G.linkText),m.code&&y.push(G.code),m.image&&y.push(G.image),m.imageAltText&&y.push(G.imageAltText,"link"),m.imageMarker&&y.push(G.imageMarker)),m.header&&y.push(G.header,G.header+"-"+m.header),m.quote&&(y.push(G.quote),!N.maxBlockquoteDepth||N.maxBlockquoteDepth>=m.quote?y.push(G.quote+"-"+m.quote):y.push(G.quote+"-"+N.maxBlockquoteDepth)),m.list!==!1){var Q=(m.listStack.length-1)%3;Q?Q===1?y.push(G.list2):y.push(G.list3):y.push(G.list1)}return m.trailingSpaceNewLine?y.push("trailing-space-new-line"):m.trailingSpace&&y.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function _(m,y){return m.match(h,!0)?g(y):void 0}function d(m,y){var H=y.text(m,y);if(typeof H!="undefined")return H;if(y.list)return y.list=null,g(y);if(y.taskList){var Q=m.match(x,!0)[1]===" ";return Q?y.taskOpen=!0:y.taskClosed=!0,N.highlightFormatting&&(y.formatting="task"),y.taskList=!1,g(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&m.match(/^#+$/,!0))return N.highlightFormatting&&(y.formatting="header"),g(y);var te=m.next();if(y.linkTitle){y.linkTitle=!1;var ae=te;te==="("&&(ae=")"),ae=(ae+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Te="^\\s*(?:[^"+ae+"\\\\]+|\\\\\\\\|\\\\.)"+ae;if(m.match(new RegExp(Te),!0))return G.linkHref}if(te==="`"){var _e=y.formatting;N.highlightFormatting&&(y.formatting="code"),m.eatWhile("`");var ge=m.current().length;if(y.code==0&&(!y.quote||ge==1))return y.code=ge,g(y);if(ge==y.code){var ve=g(y);return y.code=0,ve}else return y.formatting=_e,g(y)}else if(y.code)return g(y);if(te==="\\"&&(m.next(),N.highlightFormatting)){var Oe=g(y),he=G.formatting+"-escape";return Oe?Oe+" "+he:he}if(te==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,N.highlightFormatting&&(y.formatting="image"),g(y);if(te==="["&&y.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,N.highlightFormatting&&(y.formatting="image"),g(y);if(te==="]"&&y.imageAltText){N.highlightFormatting&&(y.formatting="image");var Oe=g(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=C,Oe}if(te==="["&&!y.image)return y.linkText&&m.match(/^.*?\]/)||(y.linkText=!0,N.highlightFormatting&&(y.formatting="link")),g(y);if(te==="]"&&y.linkText){N.highlightFormatting&&(y.formatting="link");var Oe=g(y);return y.linkText=!1,y.inline=y.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?C:d,Oe}if(te==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=c,N.highlightFormatting&&(y.formatting="link");var Oe=g(y);return Oe?Oe+=" ":Oe="",Oe+G.linkInline}if(te==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=c,N.highlightFormatting&&(y.formatting="link");var Oe=g(y);return Oe?Oe+=" ":Oe="",Oe+G.linkEmail}if(N.xml&&te==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var V=m.string.indexOf(">",m.pos);if(V!=-1){var P=m.string.substring(m.start,V);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(P)&&(y.md_inside=!0)}return m.backUp(1),y.htmlState=ie.startState(z),i(m,y,R)}if(N.xml&&te==="<"&&m.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(te==="*"||te==="_"){for(var j=1,$=m.pos==1?" ":m.string.charAt(m.pos-2);j<3&&m.eat(te);)j++;var J=m.peek()||" ",X=!/\s/.test(J)&&(!l.test(J)||/\s/.test($)||l.test($)),ye=!/\s/.test($)&&(!l.test($)||/\s/.test(J)||l.test(J)),Re=null,Ke=null;if(j%2&&(!y.em&&X&&(te==="*"||!ye||l.test($))?Re=!0:y.em==te&&ye&&(te==="*"||!X||l.test(J))&&(Re=!1)),j>1&&(!y.strong&&X&&(te==="*"||!ye||l.test($))?Ke=!0:y.strong==te&&ye&&(te==="*"||!X||l.test(J))&&(Ke=!1)),Ke!=null||Re!=null){N.highlightFormatting&&(y.formatting=Re==null?"strong":Ke==null?"em":"strong em"),Re===!0&&(y.em=te),Ke===!0&&(y.strong=te);var ve=g(y);return Re===!1&&(y.em=!1),Ke===!1&&(y.strong=!1),ve}}else if(te===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return g(y);m.backUp(1)}if(N.strikethrough){if(te==="~"&&m.eatWhile(te)){if(y.strikethrough){N.highlightFormatting&&(y.formatting="strikethrough");var ve=g(y);return y.strikethrough=!1,ve}else if(m.match(/^[^\s]/,!1))return y.strikethrough=!0,N.highlightFormatting&&(y.formatting="strikethrough"),g(y)}else if(te===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return g(y);m.backUp(2)}}if(N.emoji&&te===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,N.highlightFormatting&&(y.formatting="emoji");var pe=g(y);return y.emoji=!1,pe}return te===" "&&(m.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),g(y)}function c(m,y){var H=m.next();if(H===">"){y.f=y.inline=d,N.highlightFormatting&&(y.formatting="link");var Q=g(y);return Q?Q+=" ":Q="",Q+G.linkInline}return m.match(/^[^>]+/,!0),G.linkInline}function C(m,y){if(m.eatSpace())return null;var H=m.next();return H==="("||H==="["?(y.f=y.inline=w(H==="("?")":"]"),N.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,g(y)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(m){return function(y,H){var Q=y.next();if(Q===m){H.f=H.inline=d,N.highlightFormatting&&(H.formatting="link-string");var te=g(H);return H.linkHref=!1,te}return y.match(E[m]),H.linkHref=!0,g(H)}}function B(m,y){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=W,m.next(),N.highlightFormatting&&(y.formatting="link"),y.linkText=!0,g(y)):s(m,y,d)}function W(m,y){if(m.match(/^\]:/,!0)){y.f=y.inline=T,N.highlightFormatting&&(y.formatting="link");var H=g(y);return y.linkText=!1,H}return m.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function T(m,y){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?y.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=d,G.linkHref+" url")}var k={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:d,text:_,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(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&ie.copyState(z,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?ie.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,y){if(y.formatting=!1,m!=y.thisLine.stream){if(y.header=0,y.hr=!1,m.match(/^\s*$/,!0))return A(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:m},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=R)){var H=m.match(/^\s*/,!0)[0].replace(/\t/g,u).length;if(y.indentation=H,y.indentationDiff=null,H>0)return null}}return y.f(m,y)},innerMode:function(m){return m.block==R?{state:m.htmlState,mode:z}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:k}},indent:function(m,y,H){return m.block==R&&z.indent?z.indent(m.htmlState,y,H):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,y,H):ie.Pass},blankLine:A,getType:g,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return k},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},mgmH:function(it,Ee,U){"use strict";U.d(Ee,"d",function(){return b}),U.d(Ee,"b",function(){return h}),U.d(Ee,"e",function(){return o}),U.d(Ee,"c",function(){return p}),U.d(Ee,"n",function(){return l}),U.d(Ee,"g",function(){return u}),U.d(Ee,"h",function(){return s}),U.d(Ee,"j",function(){return D}),U.d(Ee,"a",function(){return A}),U.d(Ee,"l",function(){return S}),U.d(Ee,"f",function(){return R}),U.d(Ee,"k",function(){return O}),U.d(Ee,"m",function(){return g}),U.d(Ee,"i",function(){return _}),U.d(Ee,"o",function(){return d}),U.d(Ee,"t",function(){return c}),U.d(Ee,"s",function(){return C}),U.d(Ee,"p",function(){return E}),U.d(Ee,"q",function(){return w}),U.d(Ee,"r",function(){return B}),U.d(Ee,"v",function(){return W}),U.d(Ee,"u",function(){return T});var ie=U("miYZ"),Y=U("tsqr"),N=U("k1fw"),z=U("9og8"),I=U("WmNS"),M=U.n(I),G=U("oUNq"),K=U("9kvl"),n=U("1vsH"),L=U("m3rI"),x=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:""}})},b=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return x(),te.next=3,Object(G.t)(Object(N.a)({},y));case 3:if(H=te.sent,!(H.status===0)){te.next=7;break}return te.next=7,Object(n.w)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/export_couser_info.json"),query:y}));case 7:f();case 8:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),h=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.r)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_member_act_score")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),o=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.u)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_score")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_score")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),p=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.s)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),l=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.z)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),u=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.v)(Object(N.a)({},y));case 2:if(H=te.sent,!(H.status===0)){te.next=8;break}Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_homework")),te.next=13;break;case 8:if(!(H.status===-2)){te.next=12;break}return te.abrupt("return",H);case 12:H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),s=function(){var k=Object(z.a)(M.a.mark(function m(y,H){var Q;return M.a.wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:return ae.next=2,Object(G.x)(Object(N.a)({},y));case 2:Q=ae.sent,Q.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/").concat(H))):Q.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/").concat(H)));case 4:case"end":return ae.stop()}},m)}));return function(y,H){return k.apply(this,arguments)}}(),i=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return x(),te.next=3,Object(G.w)(Object(N.a)({},y));case 3:if(H=te.sent,!(H.status===0)){te.next=7;break}return te.next=7,Object(n.w)("",Object(n.Y)({url:L.a.API_SERVER+"/api/homework_commons/".concat(y.categoryId,"/works_list.zip"),query:y}));case 7:f();case 8:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),D=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return x(),te.next=3,Object(G.A)(Object(N.a)({},y));case 3:if(H=te.sent,!(H.status===0)){te.next=7;break}return te.next=7,Object(n.w)("",Object(n.Y)({url:L.a.API_SERVER+"/api/polls/".concat(y.categoryId,"/commit_result.xlsx"),query:y}));case 7:f();case 8:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),A=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/attendances/export_xlsx_data.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),S=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/video_study_statics.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),R=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/".concat(y.coursesId,"/export_course_students_info.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),O=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/item_banks/export.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),g=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),_=function(){var k=Object(z.a)(M.a.mark(function m(y){var H;return M.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.next=2,Object(G.y)(Object(N.a)({},y));case 2:H=te.sent,H.status===0?(Y.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/exercise_score"))):H.status===-3&&(Object(K.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),K.d.push("/classrooms/".concat(y.coursesId,"/exportlist/exercise_score")));case 4:case"end":return te.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),d=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Q.next=3,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/export_records/".concat(y.id,".xlsx"),query:y}));case 3:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),c=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),C=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_training_objectives.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),E=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)(y==null?void 0:y.name,Object(n.Y)({url:L.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),w=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_courses.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),B=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/ec_years/".concat(y==null?void 0:y.ec_year_id,"/ec_graduation_requirements.xlsx"),query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),W=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/rank_list.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}(),T=function(){var k=Object(z.a)(M.a.mark(function m(y){return M.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(n.v)("",Object(n.Y)({url:L.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:y}));case 2:case"end":return Q.stop()}},m)}));return function(y){return k.apply(this,arguments)}}()},nEHx:function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return ie});var ie;(function(Y){Y.DARK="dark",Y.LIGHT="light",Y.HIGH_CONTRAST="hc"})(ie||(ie={}))},nSDg:function(it,Ee,U){it.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(it,Ee,U){"use strict";U.d(Ee,"b",function(){return G}),U.d(Ee,"a",function(){return K});var ie=U("MI8n"),Y=U("JYp7"),N=U("pmY6"),z=U("24hK"),I=U("746U"),M=U("Cg/j");const G=Object(M.c)("commandService"),K=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new ie.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,L){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!L)throw new Error("invalid command");return this.registerCommand({id:n,handler:L})}if(n.description){const o=[];for(let l of n.description.args)o.push(l.constraint);const p=n.handler;n.handler=function(l,...u){return Object(I.o)(u,o),p(l,...u)}}const{id:x}=n;let f=this._commands.get(x);f||(f=new z.a,this._commands.set(x,f));let b=f.unshift(n),h=Object(N.i)(()=>{b();const o=this._commands.get(x);(o==null?void 0:o.isEmpty())&&this._commands.delete(x)});return this._onDidRegisterCommand.fire(x),h}registerCommandAlias(n,L){return K.registerCommand(n,(x,...f)=>x.get(G).executeCommand(L,...f))}getCommand(n){const L=this._commands.get(n);return!L||L.isEmpty()?void 0:Y.a.first(L)}getCommands(){const n=new Map;for(const L of this._commands.keys()){const x=this.getCommand(L);x&&n.set(L,x)}return n}};K.registerCommand("noop",()=>{})},osHv:function(it,Ee,U){(function(ie){ie(U("VrN/"))})(function(ie){"use strict";var Y=ie.Pos;function N(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",I=z+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+z+"]["+I+"]*)","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 L(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function x(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(L(l))continue;return}if(!K(l,u+1)){l.ch=u;continue}M.lastIndex=u,l.ch=u;var s=M.exec(l.text);if(s&&s.index==u)return s}}function b(l){for(;;){M.lastIndex=l.ch;var u=M.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 h(l){for(;;){var u=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(u==-1){if(L(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 o(l,u){for(var s=[];;){var i=b(l),D,A=l.line,S=l.ch-(i?i[0].length:0);if(!i||!(D=x(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=h(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)}}}}ie.registerHelper("fold","xml",function(l,u){for(var s=new G(l,u.line,0);;){var i=b(s);if(!i||s.line!=u.line)return;var D=x(s);if(!D)return;if(!i[1]&&D!="selfClose"){var A=Y(s.line,s.ch),S=o(s,i[2]);return S&&N(S.from,A)>0?{from:A,to:S.from}:null}}}),ie.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=x(i),A=D&&Y(i.line,i.ch),S=D&&f(i);if(!D||!S||N(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:o(i,S[2]),at:"open"})},ie.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=o(S,A.tag);if(R)return{open:A,close:R}}},ie.scanForClosingTag=function(l,u,s,i){var D=new G(l,u.line,u.ch,i?{from:0,to:i}:null);return o(D,s)}})},p5ED:function(it,Ee,U){"use strict";var ie=U("+L6B"),Y=U("2/Rp"),N=U("5Dmo"),z=U("3S7+"),I=U("k1fw"),M=U("9og8"),G=U("tJVT"),K=U("WmNS"),n=U.n(K),L=U("q1tI"),x=U.n(L),f=U("vHTk"),b=U.n(f),h=U("yEEn"),o=U("ZW9T"),p=U("1vsH"),l=U("V0Rq"),u=U("m3rI");Ee.a=function(s){var i,D,A,S,R,O,g,_=s.editOffice,d=_===void 0?"view":_,c=s.data,C=s.theme,E=s.type,w=s.filename,B=s.monacoEditor,W=s.className,T=s.style,k=s.close,m=s.onClose,y=s.hasMask,H=s.disabledDownload,Q=Object(L.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),te=Object(G.a)(Q,2),ae=te[0],Te=te[1],_e=Object(L.useState)(""),ge=Object(G.a)(_e,2),ve=ge[0],Oe=ge[1],he=Object(L.useState)(),V=Object(G.a)(he,2),P=V[0],j=V[1],$=window.ENV==="build"?"/react/build":"",J=u.a.PROXY_SERVER||location.origin,X,ye=1024*1024,Re=10*ye,Ke=Object(L.useRef)();(i=c)!==null&&i!==void 0&&i.startsWith("/api")&&E!=="txt"&&(c=(u.a.API_SERVER||location.origin)+c),E==="office"&&(X=Object(p.T)(c).filesize,X>Re&&(E="other")),w&&B&&(B.filename=w),Object(L.useEffect)(function(){var Ue,Qe,nt=(Ue=document.cookie)===null||Ue===void 0||((Qe=Ue.replace(/\s/g,""))===null||Qe===void 0)?void 0:Qe.split(";");nt==null||nt.map(function(ot){var qe=ot.split("=");qe[0]==="_educoder_session"&&Oe(qe[1])})},[]),Object(L.useEffect)(function(){E==="office"&&pe()},[E,c]);var pe=function(){var Ue=Object(M.a)(n.a.mark(function Qe(){var nt,ot,qe;return n.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return console.log("data:",c),nt=c,c.startsWith("http")||(nt=location.origin+nt),ot=new URL(nt).pathname.split("/").pop(),lt.next=6,Object(l.V)({attachment_id:ot});case 6:qe=lt.sent,j(qe);case 8:case"end":return lt.stop()}},Qe)}));return function(){return Ue.apply(this,arguments)}}(),we=function(){if(c.startsWith("http")||c.startsWith("blob:")){ke();return}Object(p.z)(w||"educoder",c,w)},ke=function(){Object(p.x)(w||"educoder",decodeURIComponent(c))};return x.a.createElement("div",{style:Object(I.a)({},T||{}),className:"".concat(y&&b.a.bgBlack," ").concat(E?b.a.wrp:"hide")},k&&x.a.createElement("div",{className:b.a.close,ref:Ke},!H&&x.a.createElement(z.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ke.current}},x.a.createElement("span",{onClick:ke},x.a.createElement("i",{className:"icon-quxiaozhiding"}))),x.a.createElement(z.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ke.current}},x.a.createElement("span",{className:"",onClick:m},x.a.createElement("i",{className:"icon-guanbi1"})))),x.a.createElement("div",{className:"".concat(b.a[W]," ").concat(W," ").concat(b.a.monaco," ").concat(E==="txt"?"show":"hide")},E==="txt"&&x.a.createElement(o.b,B)),E==="audio"&&x.a.createElement("audio",{src:"".concat(((D=c)===null||D===void 0?void 0:D.indexOf("http://"))>-1||((A=c)===null||A===void 0?void 0:A.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),E==="video"&&x.a.createElement(x.a.Fragment,null,((S=c)===null||S===void 0?void 0:S.indexOf("http"))>-1?x.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):x.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),E==="office"&&P&&x.a.createElement("iframe",{src:"".concat($,"/office.html?key=").concat(P.key,"&url=").concat(J+P.url,"&callbackUrl=").concat(J+P.callbackUrl,"&fileType=").concat(P.fileType,"&title=").concat(P.title,"&model=").concat(d,"&officeServer=").concat(u.a.OFFICE_SERVER,"&disabledDownload=").concat(!!H)}),E==="html"&&x.a.createElement("iframe",{src:c+"&disposition=inline"}),E==="pdf"&&x.a.createElement("iframe",{src:"".concat($,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!H)}),E==="image"&&x.a.createElement("img",{src:"".concat(((R=c)===null||R===void 0?void 0:R.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(g=c)!==null&&g!==void 0&&g.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),E==="other"&&x.a.createElement("div",null,x.a.createElement(Y.a,{type:"primary",size:"large",onClick:we},x.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),E==="download"&&x.a.createElement(Y.a,{type:"primary",size:"large",onClick:we},x.a.createElement(h.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(it,Ee,U){},pmY6:function(it,Ee,U){"use strict";U.d(Ee,"h",function(){return L}),U.d(Ee,"g",function(){return f}),U.d(Ee,"f",function(){return b}),U.d(Ee,"e",function(){return h}),U.d(Ee,"i",function(){return o}),U.d(Ee,"b",function(){return p}),U.d(Ee,"a",function(){return l}),U.d(Ee,"d",function(){return u}),U.d(Ee,"c",function(){return s});var ie=U("C/vA"),Y=U("JYp7");const N=!1;let z=null;function I(i){z=i}if(N){const i="__is_disposable_tracked__";I(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 M(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 L(i){return z==null||z.markAsSingleton(i),i}class x 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 b(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 x(D);return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function h(...i){const D=o(()=>b(i));return n(i,D),D}function o(i){const D=M({dispose:Object(ie.a)(()=>{G(D),i()})});return D}class p{constructor(){this._toDispose=new Set,this._isDisposed=!1,M(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{b(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,M(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,M(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(it,Ee,U){var ie,Y;(function(){var N;(function(){"use strict";var G=[,,function(x){function f(o){this.__parent=o,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}f.prototype.clone_empty=function(){var o=new f(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},f.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},f.prototype.has_match=function(o){for(var p=this.__items.length-1;p>=0;p--)if(this.__items[p].match(o))return!0;return!1},f.prototype.set_indent=function(o,p){this.is_empty()&&(this.__indent_count=o||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 o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(o){this.__items.push(o);var p=o.lastIndexOf(` `);p!==-1?this.__character_count=o.length-p:this.__character_count+=o.length},f.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function b(o,p){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),p=p||"",o.indent_level>0&&(p=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=p,this.__base_string_length=p.length}b.prototype.get_indent_size=function(o,p){var l=this.__base_string_length;return p=p||0,o<0&&(l=0),l+=o*this.__indent_size,l+=p,l},b.prototype.get_indent_string=function(o,p){var l=this.__base_string;return p=p||0,o<0&&(o=0,l=""),p+=o*this.__indent_size,this.__ensure_cache(p),l+=this.__cache[p],l},b.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var o=this.__cache.length,p=0,l="";this.__indent_size&&o>=this.__indent_size&&(p=Math.floor(o/this.__indent_size),o-=p*this.__indent_size,l=new Array(p+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function h(o,p){this.__indent_cache=new b(o,p),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}h.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},h.prototype.get_line_number=function(){return this.__lines.length},h.prototype.get_indent_string=function(o,p){return this.__indent_cache.get_indent_string(o,p)},h.prototype.get_indent_size=function(o,p){return this.__indent_cache.get_indent_size(o,p)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(o){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 o!==` `&&(l=l.replace(/[\n]/g,o)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(o,p){return o=o||0,p=p||0,this.next_line.set_indent(o,p),this.__lines.length>1?(this.current_line.set_indent(o,p),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(o){for(var p=0;p1&&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},h.prototype.just_added_newline=function(){return this.current_line.is_empty()},h.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},h.prototype.ensure_empty_line_above=function(o,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(o)!==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--}},x.exports.Output=h},function(x){function f(b,h,o,p){this.type=b,this.text=h,this.comments_before=null,this.newlines=o||0,this.whitespace_before=p||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}x.exports.Token=f},,,function(x){function f(o,p){this.raw_options=b(o,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(o,p){var l=this.raw_options[o],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(o,p){var l=this.raw_options[o],u=l===void 0?!!p:!!l;return u},f.prototype._get_characters=function(o,p){var l=this.raw_options[o],u=p||"";return typeof l=="string"&&(u=l.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),u},f.prototype._get_number=function(o,p){var l=this.raw_options[o];p=parseInt(p,10),isNaN(p)&&(p=0);var u=parseInt(l,10);return isNaN(u)&&(u=p),u},f.prototype._get_selection=function(o,p,l){var u=this._get_selection_list(o,p,l);if(u.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values: `+p+` You passed in: '`+this.raw_options[o]+"'");return u[0]},f.prototype._get_selection_list=function(o,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(o,l);if(!this._is_valid_selection(u,p))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values: `+p+` You passed in: '`+this.raw_options[o]+"'");return u},f.prototype._is_valid_selection=function(o,p){return o.length&&p.length&&!o.some(function(l){return p.indexOf(l)===-1})};function b(o,p){var l={};o=h(o);var u;for(u in o)u!==p&&(l[u]=o[u]);if(p&&o[p])for(u in o[p])l[u]=o[p][u];return l}function h(o){var p={},l;for(l in o){var u=l.replace(/-/g,"_");p[u]=o[l]}return p}x.exports.Options=f,x.exports.normalizeOpts=h,x.exports.mergeOpts=b},,function(x){var f=RegExp.prototype.hasOwnProperty("sticky");function b(h){this.__input=h||"",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=0&&h=0&&o=h.length&&this.__input.substring(o-h.length,o).toLowerCase()===h},x.exports.InputScanner=b},function(x,f,b){var h=b(8).InputScanner,o=b(3).Token,p=b(10).TokenStream,l=b(11).WhitespacePattern,u={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(i,D){this._input=new h(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 o(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 o(i,D,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return A},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},x.exports.Tokenizer=s,x.exports.TOKEN=u},function(x){function f(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position=0&&b/),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 h,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 o)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},x.exports.TemplatablePattern=p},,,,function(x,f,b){var h=b(19).Beautifier,o=b(20).Options;function p(l,u,s,i){var D=new h(l,u,s,i);return D.beautify()}x.exports=p,x.exports.defaultOptions=function(){return new o}},function(x,f,b){var h=b(20).Options,o=b(2).Output,p=b(21).Tokenizer,l=b(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 o(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.newlines0);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,B=null;return E.closed?(C==="script"?w="text/javascript":C==="style"&&(w="text/css"),w=D(E)||w,w.search("text/css")>-1?B="css":w.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?B="javascript":w.search(/(text|application|dojo)\/(x-)?(html)/)>-1?B="html":w.search(/test\/null/)>-1&&(B="null"),B):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 g(C,E,w,B){this._source_text=C||"",E=E||{},this._js_beautify=w,this._css_beautify=B,this._tag_stack=null;var W=new h(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"}g.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],B={text:"",type:""},W=new _,T=new i(this._options,w),k=new p(C,this._options).tokenize();this._tag_stack=new O(T);for(var m=null,y=k.next();y.type!==l.EOF;)y.type===l.TAG_OPEN||y.type===l.COMMENT?(m=this._handle_tag_open(T,y,W,B),W=m):y.type===l.ATTRIBUTE||y.type===l.EQUALS||y.type===l.VALUE||y.type===l.TEXT&&!W.tag_complete?m=this._handle_inside_tag(T,y,W,k):y.type===l.TAG_CLOSE?m=this._handle_tag_close(T,y,W):y.type===l.TEXT?m=this._handle_text(T,y,W):T.add_raw_token(y),B=m,y=k.next();var H=T._output.get_code(E);return H},g.prototype._handle_tag_close=function(C,E,w){var B={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(),B},g.prototype._handle_inside_tag=function(C,E,w,B){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 k=w.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&w.attr_count===1){var m=!0,y=0,H;do{if(H=B.peek(y),H.type===l.ATTRIBUTE){m=!1;break}y+=1}while(y<4&&H.type!==l.EOF&&H.type!==l.TAG_CLOSE);k=!m}k&&(C.print_newline(!1),W=!0)}C.print_token(E),W=W||C.previous_token_wrapped(),w.has_wrapped_attrs=W}return T},g.prototype._handle_text=function(C,E,w){var B={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)),B},g.prototype._print_custom_beatifier_text=function(C,E,w){var B=this;if(E.text!==""){var W=E.text,T,k=1,m="",y="";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(_e,ge){var ve=new g(_e,ge,B._js_beautify,B._css_beautify);return ve.beautify()}),this._options.indent_scripts==="keep"?k=0:this._options.indent_scripts==="separate"&&(k=-C.indent_level);var H=C.get_full_indent(k);if(W=W.replace(/\n[ \t]*$/,""),w.custom_beautifier_name!=="html"&&W[0]==="<"&&W.match(/^(|]]>)$/.exec(W);if(!Q){C.add_raw_token(E);return}m=H+Q[1]+` `,W=Q[4],Q[5]&&(y=H+Q[5]),W=W.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(` `)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(E.whitespace_before=Q[0]))}if(W)if(T){var te=function(){this.eol=` `};te.prototype=this._options.raw_options;var ae=new te;W=T(H+W,ae)}else{var Te=E.whitespace_before;Te&&(W=W.replace(new RegExp(` (`+Te+")?","g"),` `)),W=H+W.replace(/\n/g,` `+H)}m&&(W?W=m+W+` `+y:W=m+y),C.print_newline(!1),W&&(E.text=W,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},g.prototype._handle_tag_open=function(C,E,w,B){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("]*)/),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 B=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(B=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(B)))}};g.prototype._get_tag_open_token=function(C){var E=new _(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},g.prototype._set_tag_position=function(C,E,w,B,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&&B.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 k=!1;k=w.start_tag_token&&w.start_tag_token.multiline_content,k=k||!w.is_inline_element&&!(B.is_inline_element||B.is_unformatted)&&!(W.type===l.TAG_CLOSE&&w.start_tag_token===B)&&W.type!=="TK_CONTENT",(w.is_content_unformatted||w.is_unformatted)&&(k=!1),k&&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)},g.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 d=["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"],c=["a","audio","del","ins","map","noscript","video"];g.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"&&d.indexOf(C.tag_name)!==-1){var w=C.parent.parent;(!w||c.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},x.exports.Beautifier=g},function(x,f,b){var h=b(6).Options;function o(p){h.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"])}o.prototype=new h,x.exports.Options=o},function(x,f,b){var h=b(9).Tokenizer,o=b(9).TOKEN,p=b(13).Directives,l=b(14).TemplatablePattern,u=b(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:o.START,RAW:o.RAW,EOF:o.EOF},i=new p(/<\!--/,/-->/),D=function(A,S){h.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(//),cdata:O.starting_with(//),conditional_comment:O.starting_with(//),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 g=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(g).until_after(g)}};D.prototype=new h,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 g=this._input.peek(1);g==="!"&&(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 g=this._input.peek(1);(g==="!"||g==="?")&&(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,g="";if(R&&R.text[0]==="<")if(A==="=")O=this._create_token(s.EQUALS,this._input.next());else if(A==='"'||A==="'"){var _=this._input.next();A==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),O=this._create_token(s.VALUE,_)}else g=this.__patterns.attribute.read(),g&&(S.type===s.EQUALS?O=this._create_token(s.VALUE,g):O=this._create_token(s.ATTRIBUTE,g));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 g=S.opened.text.substr(1).toLowerCase();if(g==="script"||g==="style"){var _=this._read_comment_or_cdata(A);if(_)return _.type=s.TEXT,_;O=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(g)&&(O=this._input.readUntil(new RegExp("","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)},x.exports.Tokenizer=D,x.exports.TOKEN=s}],K={};function n(x){var f=K[x];if(f!==void 0)return f.exports;var b=K[x]={exports:{}};return G[x](b,b.exports,n),b.exports}var L=n(18);N=L})();var z=N;if(!0)!(ie=[U,U("6UM0"),U("TXwP")],Y=function(G){var K=U("6UM0"),n=U("TXwP");return{html_beautify:function(L,x){return z(L,x,K.js_beautify,n.css_beautify)}}}.apply(Ee,ie),Y!==void 0&&(it.exports=Y));else var I,M})()},"rAM+":function(it,Ee,U){"use strict";U.d(Ee,"a",function(){return Y});var ie=U("Qw5x");function Y(N,z){var I;if(typeof Symbol=="undefined"||N[Symbol.iterator]==null){if(Array.isArray(N)||(I=Object(ie.a)(N))||z&&N&&typeof N.length=="number"){I&&(N=I);var M=0,G=function(){};return{s:G,n:function(){return M>=N.length?{done:!0}:{done:!1,value:N[M++]}},e:function(f){throw f},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var K=!0,n=!1,L;return{s:function(){I=N[Symbol.iterator]()},n:function(){var f=I.next();return K=f.done,f},e:function(f){n=!0,L=f},f:function(){try{!K&&I.return!=null&&I.return()}finally{if(n)throw L}}}}},rUJ1:function(it,Ee){const U=/[&<>"']/,ie=/[&<>"']/g,Y=/[<>"']|&(?!#?\w+;)/,N=/[<>"']|&(?!#?\w+;)/g,z={"&":"&","<":"<",">":">",'"':""","'":"'"},I=O=>z[O];function M(O,g){if(g){if(U.test(O))return O.replace(ie,I)}else if(Y.test(O))return O.replace(N,I);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function K(O){return O.replace(G,(g,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const n=/(^|[^\[])\^/g;function L(O,g){O=O.source||O,g=g||"";const _={replace:(d,c)=>(c=c.source||c,c=c.replace(n,"$1"),O=O.replace(d,c),_),getRegex:()=>new RegExp(O,g)};return _}const x=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(O,g,_){if(O){let d;try{d=decodeURIComponent(K(_)).replace(x,"").toLowerCase()}catch(c){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}g&&!f.test(_)&&(_=u(g,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(d){return null}return _}const h={},o=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(O,g){h[" "+O]||(o.test(O)?h[" "+O]=O+"/":h[" "+O]=A(O,"/",!0)),O=h[" "+O];const _=O.indexOf(":")===-1;return g.substring(0,2)==="//"?_?g:O.replace(p,"$1")+g:g.charAt(0)==="/"?_?g:O.replace(l,"$1")+g:O+g}const s={exec:function(){}};function i(O){let g=1,_,d;for(;g{let B=!1,W=E;for(;--W>=0&&w[W]==="\\";)B=!B;return B?"|":" |"}),d=_.split(/ \|/);let c=0;if(d.length>g)d.splice(g);else for(;d.length1)Object(L.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(i.length===0)return Object(L.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var D=i[0];if(M.isValidElement(D)&&Object(x.c)(D)){var A=D.ref;i[0]=M.cloneElement(D,{ref:Object(x.a)(A,this.setChildNode)})}return i.length===1?i[0]:i.map(function(S,R){return!M.isValidElement(S)||"key"in S&&S.key!==null?S:M.cloneElement(S,{key:"".concat(b,"-").concat(R)})})}}]),l}(M.Component);h.displayName="ResizeObserver",Ee.a=h},t9D7:function(it,Ee,U){"use strict";U.d(Ee,"b",function(){return G}),U.d(Ee,"g",function(){return n}),U.d(Ee,"d",function(){return L}),U.d(Ee,"e",function(){return x}),U.d(Ee,"a",function(){return f}),U.d(Ee,"f",function(){return o}),U.d(Ee,"c",function(){return p});var ie=U("Vhoy"),Y=U("MI8n"),N=U("pmY6"),z=U("Cg/j"),I=U("ic2d"),M=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 L;(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(`^\\$\\((${ie.a.iconNameExpression}(?:${ie.a.iconModifierExpression})?)\\)$`);function i(R){const O=s.exec(R);if(!O)return;let[,g]=O;return{id:g}}l.fromString=i;function D(R,O){let g=R.id;const _=g.lastIndexOf("~");return _!==-1&&(g=g.substring(0,_)),O&&(g=`${g}~${O}`),{id:g}}l.modify=D;function A(R,O){var g,_;return R.id===O.id&&((g=R.color)===null||g===void 0?void 0:g.id)===((_=O.color)===null||_===void 0?void 0:_.id)}l.isEqual=A;function S(R,O){return{id:R.id,color:O?n(O):void 0}}l.asThemeIcon=S,l.asClassNameArray=ie.a.asClassNameArray,l.asClassName=ie.a.asClassName,l.asCSSSelector=ie.a.asCSSSelector})(L||(L={}));function x(l){switch(l){case M.a.DARK:return"vs-dark";case M.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class b{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Y.b}onColorThemeChange(l){return this.themingParticipants.push(l),this.onThemingParticipantAddedEmitter.fire(l),Object(N.i)(()=>{const u=this.themingParticipants.indexOf(l);this.themingParticipants.splice(u,1)})}getThemingParticipants(){return this.themingParticipants}}let h=new b;I.a.add(f.ThemingContribution,h);function o(l){return h.onColorThemeChange(l)}class p extends N.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(it,Ee,U){it.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(it,Ee,U){typeof window!="undefined"&&function(Y,N){it.exports=N()}(this,function(){return function(ie){var Y={};function N(z){if(Y[z])return Y[z].exports;var I=Y[z]={i:z,l:!1,exports:{}};return ie[z].call(I.exports,I,I.exports,N),I.l=!0,I.exports}return N.m=ie,N.c=Y,N.d=function(z,I,M){N.o(z,I)||Object.defineProperty(z,I,{enumerable:!0,get:M})},N.r=function(z){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(z,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(z,"__esModule",{value:!0})},N.t=function(z,I){if(I&1&&(z=N(z)),I&8)return z;if(I&4&&typeof z=="object"&&z&&z.__esModule)return z;var M=Object.create(null);if(N.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:z}),I&2&&typeof z!="string")for(var G in z)N.d(M,G,function(K){return z[K]}.bind(null,G));return M},N.n=function(z){var I=z&&z.__esModule?function(){return z.default}:function(){return z};return N.d(I,"a",I),I},N.o=function(z,I){return Object.prototype.hasOwnProperty.call(z,I)},N.p="/dist/",N(N.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ie,Y,N){"use strict";var z=Object.prototype.hasOwnProperty,I="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(I=!1));function G(x,f,b){this.fn=x,this.context=f,this.once=b||!1}function K(x,f,b,h,o){if(typeof b!="function")throw new TypeError("The listener must be a function");var p=new G(b,h||x,o),l=I?I+f:f;return x._events[l]?x._events[l].fn?x._events[l]=[x._events[l],p]:x._events[l].push(p):(x._events[l]=p,x._eventsCount++),x}function n(x,f){--x._eventsCount===0?x._events=new M:delete x._events[f]}function L(){this._events=new M,this._eventsCount=0}L.prototype.eventNames=function(){var f=[],b,h;if(this._eventsCount===0)return f;for(h in b=this._events)z.call(b,h)&&f.push(I?h.slice(1):h);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(b)):f},L.prototype.listeners=function(f){var b=I?I+f:f,h=this._events[b];if(!h)return[];if(h.fn)return[h.fn];for(var o=0,p=h.length,l=new Array(p);o0},!1)}function x(f,b){for(var h={main:[b]},o={main:[]},p={main:{}};L(h);)for(var l=Object.keys(h),u=0;u=2*R/g||w<=W)return;var T=Number.POSITIVE_INFINITY,k;for(k=l.level-1;k>d;k--){var m=_[k].maxBitrate;if(T=R*m/(8*.8*E),T=w)return;var y=this.bwEstimator.getEstimate();L.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 "+k+` Current BW estimate: `+(Object(z.isFiniteNumber)(y)?(y/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=k,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),s.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:u,stats:S})},o.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 g={stats:D,frag:s,part:i,id:s.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,g),s.bitrateTest=!1}}},o.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},o.onError=function(l,u){switch(u.details){case K.ErrorDetails.FRAG_LOAD_ERROR:case K.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var 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,g=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():D.abrEwmaDefaultEstimate,d=(G.BufferHelper.bufferInfo(S,O,D.maxBufferHole).end-O)/g,c=this.findBestLevel(_,A,i,d,D.abrBandWidthFactor,D.abrBandWidthUpFactor);if(c>=0)return c;L.logger.trace((d?"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(!d){var B=this.bitrateTestDelay;if(B){var W=R?Math.min(R,D.maxLoadingDelay):D.maxLoadingDelay;C=W-B,L.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=w=1}}return c=this.findBestLevel(_,A,i,d+C,E,w),Math.max(c,0)},o.findBestLevel=function(l,u,s,i,D,A){for(var S,R=this.fragCurrent,O=this.partCurrent,g=this.lastLoadedFragLevel,_=this.hls.levels,d=_[g],c=!!(d!=null&&(S=d.details)!==null&&S!==void 0&&S.live),C=d==null?void 0:d.codecSet,E=O?O.duration:R?R.duration:0,w=s;w>=u;w--){var B=_[w];if(!B||C&&B.codecSet!==C)continue;var W=B.details,T=(O?W==null?void 0:W.partTarget:W==null?void 0:W.averagetargetduration)||E,k=void 0;w<=g?k=D*l:k=A*l;var m=_[w].maxBitrate,y=m*T/k;if(L.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+w+"/"+Math.round(k)+"/"+m+"/"+T+"/"+i+"/"+y),k>m&&(!y||c&&!this.bitrateTestDelay||y0&&d===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=I.State.IDLE):(this.loadedmetadata=!1,this.state=I.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=d,this.tick()},g.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var d,c=this.levels,C=this.trackId,E=c==null||((d=c[C])===null||d===void 0)?void 0:d.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var w,B=performance.now(),W=this.retryDate;(!W||B>=W||(w=this.media)!==null&&w!==void 0&&w.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=I.State.IDLE);break}case I.State.WAITING_INIT_PTS:{var T=this.waitingData;if(T){var k=T.frag,m=T.part,y=T.cache,H=T.complete;if(this.initPTS[k.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var Q=y.flush(),te={frag:k,part:m,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(te),H&&R.prototype._handleFragmentLoadComplete.call(this,te)}else if(this.videoTrackCC!==this.waitingVideoCC)u.logger.log("Waiting fragment cc ("+k.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ae=this.getLoadPosition(),Te=G.BufferHelper.bufferInfo(this.mediaBuffer,ae,this.config.maxBufferHole),_e=Object(o.fragmentWithinToleranceTest)(Te.end,this.config.maxFragLookUpTolerance,k);_e<0&&(u.logger.log("Waiting fragment cc ("+k.cc+") @ "+k.start+" cancelled because another fragment at "+Te.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},g.clearWaitingFragment=function(){var d=this.waitingData;d&&(this.fragmentTracker.removeFragment(d.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},g.onTickEnd=function(){var d=this.media;if(!d||!d.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:d,C=c.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=d.currentTime},g.doTickIdle=function(){var d,c,C=this.hls,E=this.levels,w=this.media,B=this.trackId,W=C.config;if(!E||!E[B])return;if(!w&&(this.startFragRequested||!W.startFragPrefetch))return;var T=E[B],k=T.details;if(!k||k.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(k)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,x.ElementaryStreamTypes.AUDIO,L.PlaylistLevelType.AUDIO));var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,L.PlaylistLevelType.AUDIO);if(m===null)return;var y=m.len,H=this.getMaxBufferLength(),Q=this.audioSwitch;if(y>=H&&!Q)return;if(!Q&&this._streamEnded(m,k)){C.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var te=k.fragments,ae=te[0].start,Te=m.end;if(Q){var _e=this.getLoadPosition();Te=_e,k.PTSKnown&&_eae||m.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),w.currentTime=ae+.05))}var ge=this.getNextFragment(Te,k);if(!ge){this.bufferFlushed=!0;return}((d=ge.decryptdata)===null||d===void 0?void 0:d.keyFormat)==="identity"&&!((c=ge.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(ge,k):this.loadFragment(ge,k,Te)},g.getMaxBufferLength=function(){var d=R.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,L.PlaylistLevelType.MAIN);return c===null?d:Math.max(d,c.len)},g.onMediaDetaching=function(){this.videoBuffer=null,R.prototype.onMediaDetaching.call(this)},g.onAudioTracksUpdated=function(d,c){var C=c.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new n.Level(E)})},g.onAudioTrackSwitching=function(d,c){var C=!!c.url;this.trackId=c.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=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},g.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},g.onLevelLoaded=function(d,c){this.mainDetails=c.details},g.onAudioTrackLoaded=function(d,c){var C,E=this.levels,w=c.details,B=c.id;if(!E){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+w.startSN+","+w.endSN+"],duration:"+w.totalduration);var W=E[B],T=0;if(w.live||(C=W.details)!==null&&C!==void 0&&C.live){var k=this.mainDetails;if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed||!k)return;!W.details&&w.hasProgramDateTime&&k.hasProgramDateTime?(Object(p.alignMediaPlaylistByPDT)(w,k),T=w.fragments[0].start):T=this.alignPlaylists(w,W.details)}W.details=w,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!w.live)&&this.setStartPosition(W.details,T),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(w)&&(this.state=I.State.IDLE),this.tick()},g._handleFragmentLoadProgress=function(d){var c,C=d.frag,E=d.part,w=d.payload,B=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 k=T[W];console.assert(k,"Audio track is defined on fragment load progress");var m=k.details;console.assert(m,"Audio track details are defined on fragment load progress");var y=B.defaultAudioCodec||k.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new b.default(this.hls,L.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[C.cc],te=(c=C.initSegment)===null||c===void 0?void 0:c.data;if(Q!==void 0){var ae=!1,Te=E?E.index:-1,_e=Te!==-1,ge=new h.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,w.byteLength,Te,_e);H.push(w,te,y,"",C,E,m.totalduration,ae,ge,Q)}else{u.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+m.startSN+" ,"+m.endSN+"],track "+W);var ve=this.waitingData=this.waitingData||{frag:C,part:E,cache:new f.default,complete:!1},Oe=ve.cache;Oe.push(new Uint8Array(w)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},g._handleFragmentLoadComplete=function(d){if(this.waitingData){this.waitingData.complete=!0;return}R.prototype._handleFragmentLoadComplete.call(this,d)},g.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},g.onBufferCreated=function(d,c){var C=c.tracks.audio;C&&(this.mediaBuffer=C.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},g.onFragBuffered=function(d,c){var C=c.frag,E=c.part;if(C.type!==L.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(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},g.onError=function(d,c){switch(c.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.AUDIO,c);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==I.State.ERROR&&this.state!==I.State.STOPPED&&(this.state=c.fatal?I.State.ERROR:I.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,L.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}},g.onBufferFlushed=function(d,c){var C=c.type;C===x.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},g._handleTransmuxComplete=function(d){var c,C="audio",E=this.hls,w=d.remuxResult,B=d.chunkMeta,W=this.getCurrentContext(B);if(!W){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var T=W.frag,k=W.part,m=w.audio,y=w.text,H=w.id3,Q=w.initSegment;if(this.fragContextChanged(T))return;if(this.state=I.State.PARSING,this.audioSwitch&&m&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,T,B),E.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:T,id:C,tracks:Q.tracks})),m){var te=m.startPTS,ae=m.endPTS,Te=m.startDTS,_e=m.endDTS;k&&(k.elementaryStreams[x.ElementaryStreamTypes.AUDIO]={startPTS:te,endPTS:ae,startDTS:Te,endDTS:_e}),T.setElementaryStreamInfo(x.ElementaryStreamTypes.AUDIO,te,ae,Te,_e),this.bufferFragmentData(m,T,k,B)}if(H!=null&&(c=H.samples)!==null&&c!==void 0&&c.length){var ge=s({frag:T,id:C},H);E.trigger(M.Events.FRAG_PARSING_METADATA,ge)}if(y){var ve=s({frag:T,id:C},y);E.trigger(M.Events.FRAG_PARSING_USERDATA,ve)}},g._bufferInitSegment=function(d,c,C){if(this.state!==I.State.PARSING)return;d.video&&delete d.video;var E=d.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(M.Events.BUFFER_CODECS,d);var w=E.initSegment;if(w!=null&&w.byteLength){var B={type:"audio",frag:c,part:null,chunkMeta:C,parent:c.type,data:w};this.hls.trigger(M.Events.BUFFER_APPENDING,B)}this.tick()},g.loadFragment=function(d,c,C){var E=this.fragmentTracker.getState(d);this.fragCurrent=d,(this.audioSwitch||E===K.FragmentState.NOT_LOADED||E===K.FragmentState.PARTIAL)&&(d.sn==="initSegment"?this._loadInitSegment(d):c.live&&!Object(z.isFiniteNumber)(this.initPTS[d.cc])?(this.log("Waiting for video PTS in continuity counter "+d.cc+" of live stream before loading audio fragment "+d.sn+" of level "+this.trackId),this.state=I.State.WAITING_INIT_PTS):(this.startFragRequested=!0,R.prototype.loadFragment.call(this,d,c,C)))},g.completeAudioSwitch=function(){var d=this.hls,c=this.media,C=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),R.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,d.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:C})},O}(I.default);Y.default=S},"./src/controller/audio-track-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/controller/base-playlist-controller.ts"),G=N("./src/types/loader.ts");function K(b,h){for(var o=0;o=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,g=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:g}),i.details&&!i.details.live)return;var _=this.switchParams(i.url,s==null?void 0:s.details);this.loadPlaylist(_)},o.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:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(l){for(var u=this.tracksInGroup,s=0;sh.partTarget&&(i+=1)}if(Object(z.isFiniteNumber)(s))return new I.HlsUrlParameters(s,Object(z.isFiniteNumber)(i)?i:void 0,I.HlsSkip.No)}}},x.loadPlaylist=function(b){},x.shouldLoadTrack=function(b){return this.canLoad&&b&&!!b.url&&(!b.details||b.details.live)},x.playlistLoaded=function(b,h,o){var p=this,l=h.details,u=h.stats,s=u.loading.end?Math.max(0,self.performance.now()-u.loading.end):0;if(l.advancedDateTime=Date.now()-s,l.live||o!=null&&o.live){if(l.reloaded(o),o&&this.log("live playlist "+b+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),o&&l.fragments.length>0&&Object(M.mergeDetails)(o,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,g=l.lastPartIndex,_=g!==-1,d=R===O,c=S?0:g;_?(D=d?O+1:R,A=d?c:g+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(o&&w>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+w+" with playlist age: "+l.age),w=0;else{var B=Math.floor(w/l.targetduration);if(D+=B,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 "+B+" to part "+A)}l.tuneInGoal=w}if(i=this.getDeliveryDirectives(l,h.deliveryDirectives,D,A),S||!d){this.loadPlaylist(i);return}}else i=this.getDeliveryDirectives(l,h.deliveryDirectives,D,A);var T=Object(M.computeReloadInterval)(l,u);D!==void 0&&l.canBlockReload&&(T-=l.partTarget||1),this.log("reload live playlist "+b+" in "+Math.round(T)+" ms"),this.timer=self.setTimeout(function(){return p.loadPlaylist(i)},T)}else this.clearTimer()},x.getDeliveryDirectives=function(b,h,o,p){var l=Object(I.getSkipValue)(b,o);return h!=null&&h.skip&&b.deltaUpdateFailed&&(o=h.msn,p=h.part,l=I.HlsSkip.No),new I.HlsUrlParameters(o,p,l)},x.retryLoadingOrFail=function(b){var h=this,o=this.hls.config,p=this.retryCount-1&&(l=b.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+b.details+'"'),this.loadPlaylist();else{var u=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},u),this.warn("retry playlist loading #"+this.retryCount+" in "+u+' ms after "'+b.details+'"')}}else this.warn('cannot recover from error "'+b.details+'"'),this.clearTimer(),b.fatal=!0;return p},L}()},"./src/controller/base-stream-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"State",function(){return O}),N.d(Y,"default",function(){return g});var z=N("./src/polyfills/number.ts"),I=N("./src/task-loop.ts"),M=N("./src/controller/fragment-tracker.ts"),G=N("./src/utils/buffer-helper.ts"),K=N("./src/utils/logger.ts"),n=N("./src/events.ts"),L=N("./src/errors.ts"),x=N("./src/types/transmuxer.ts"),f=N("./src/utils/mp4-tools.ts"),b=N("./src/utils/discontinuities.ts"),h=N("./src/controller/fragment-finders.ts"),o=N("./src/controller/level-helper.ts"),p=N("./src/loader/fragment-loader.ts"),l=N("./src/crypt/decrypter.ts"),u=N("./src/utils/time-ranges.ts"),s=N("./src/types/loader.ts");function i(_,d){for(var c=0;cQ;(k0&&k&&k.key&&k.iv&&k.method==="AES-128"){var m=self.performance.now();return w.decrypter.webCryptoDecrypt(new Uint8Array(T),k.key.buffer,k.iv.buffer).then(function(y){var H=self.performance.now();return W.trigger(n.Events.FRAG_DECRYPTED,{frag:E,payload:y,stats:{tstart:m,tdecrypt:H}}),B.payload=y,B})}return B}).then(function(B){var W=w.fragCurrent,T=w.hls,k=w.levels;if(!k)throw new Error("init load aborted, missing levels");var m=k[E.level].details;console.assert(m,"Level details are defined when init segment is loaded");var y=E.stats;w.state=O.IDLE,w.fragLoadError=0,E.data=new Uint8Array(B.payload),y.parsing.start=y.buffering.start=self.performance.now(),y.parsing.end=y.buffering.end=self.performance.now(),B.frag===W&&T.trigger(n.Events.FRAG_BUFFERED,{stats:y,frag:W,part:null,id:E.type}),w.tick()}).catch(function(B){w.warn(B),w.resetFragmentLoading(E)})},c.fragContextChanged=function(E){var w=this.fragCurrent;return!E||!w||E.level!==w.level||E.sn!==w.sn||E.urlId!==w.urlId},c.fragBufferedComplete=function(E,w){var B=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(B))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(E){var w=this.transmuxer;if(!w)return;var B=E.frag,W=E.part,T=E.partsLoaded,k=!T||T.length===0||T.some(function(y){return!y}),m=new x.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,W?W.index:-1,!k);w.flush(m)},c._handleFragmentLoadProgress=function(E){},c._doFragLoad=function(E,w,B,W){var T=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(E.start,B||0),this.config.lowLatencyMode&&w){var k=w.partList;if(k&&W){B>E.end&&w.fragmentHint&&(E=w.fragmentHint);var m=this.getNextPart(k,E,B);if(m>-1){var y=k[m];return this.log("Loading part sn: "+E.sn+" p: "+y.index+" cc: "+E.cc+" of playlist ["+w.startSN+"-"+w.endSN+"] parts [0-"+m+"-"+(k.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=y.start+y.duration,this.state=O.FRAG_LOADING,this.hls.trigger(n.Events.FRAG_LOADING,{frag:E,part:k[m],targetBufferTime:B}),this.doFragPartsLoad(E,k,m,W).catch(function(H){return T.handleFragLoadError(H)})}else if(!E.url||this.loadedEndOfParts(k,B))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(B.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:B}),this.fragmentLoader.load(E,W).catch(function(H){return T.handleFragLoadError(H)})},c.doFragPartsLoad=function(E,w,B,W){var T=this;return new Promise(function(k,m){var y=[],H=function Q(te){var ae=w[te];T.fragmentLoader.loadPart(E,ae,W).then(function(Te){y[ae.index]=Te;var _e=Te.part;T.hls.trigger(n.Events.FRAG_LOADED,Te);var ge=w[te+1];if(ge&&ge.fragment===E)Q(te+1);else return k({frag:E,part:_e,partsLoaded:y})}).catch(m)};H(B)})},c.handleFragLoadError=function(E){var w=E.data;return w&&w.details===L.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(w.frag,w.part):this.hls.trigger(n.Events.ERROR,w),null},c._handleTransmuxerFlush=function(E){var w=this.getCurrentContext(E);if(!w||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var B=w.frag,W=w.part,T=w.level,k=self.performance.now();B.stats.parsing.end=k,W&&(W.stats.parsing.end=k),this.updateLevelTiming(B,W,T,E.partial)},c.getCurrentContext=function(E){var w=this.levels,B=E.level,W=E.sn,T=E.part;if(!w||!w[B])return this.warn("Levels object was unset while buffering fragment "+W+" of level "+B+". The current chunk will not be buffered."),null;var k=w[B],m=T>-1?Object(o.getPartWith)(k,W,T):null,y=m?m.fragment:Object(o.getFragmentWithSN)(k,W,this.fragCurrent);return y?{frag:y,part:m,level:k}:null},c.bufferFragmentData=function(E,w,B,W){if(!E||this.state!==O.PARSING)return;var T=E.data1,k=E.data2,m=T;if(T&&k&&(m=Object(f.appendUint8Array)(T,k)),!m||!m.length)return;var y={type:E.type,frag:w,part:B,chunkMeta:W,parent:w.type,data:m};this.hls.trigger(n.Events.BUFFER_APPENDING,y),E.dropped&&E.independent&&!B&&this.flushBufferGap(w)},c.flushBufferGap=function(E){var w=this.media;if(!w)return;if(!G.BufferHelper.isBuffered(w,w.currentTime)){this.flushMainBuffer(0,E.start);return}var B=w.currentTime,W=G.BufferHelper.bufferInfo(w,B,0),T=E.duration,k=Math.min(this.config.maxFragLookUpTolerance*2,T*.25),m=Math.max(Math.min(E.start-k,W.end-k),B+k);E.start-m>k&&this.flushMainBuffer(m,E.start)},c.getFwdBufferInfo=function(E,w){var B=this.config,W=this.getLoadPosition();if(!Object(z.isFiniteNumber)(W))return null;var T=G.BufferHelper.bufferInfo(E,W,B.maxBufferHole);if(T.len===0&&T.nextStart!==void 0){var k=this.fragmentTracker.getBufferedFrag(W,w);if(k&&T.nextStart=B?(w.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+w.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(E,w){var B,W,T=w.fragments,k=T.length;if(!k)return null;var m=this.config,y=T[0].start,H;if(w.live){var Q=m.initialLiveManifestSize;if(k-1&&BB.start&&B.loaded},c.getInitialLiveFragment=function(E,w){var B=this.fragPrevious,W=null;if(B){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),W=Object(h.findFragmentByPDT)(w,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!W){var T=B.sn+1;if(T>=E.startSN&&T<=E.endSN){var k=w[T-E.startSN];B.cc===k.cc&&(W=k,this.log("Live playlist, switching playlist, load frag with next SN: "+W.sn))}W||(W=Object(h.findFragWithCC)(w,B.cc),W&&this.log("Live playlist, switching playlist, load frag with same CC: "+W.sn))}}else{var m=this.hls.liveSyncPosition;m!==null&&(W=this.getFragmentAtPosition(m,this.bitrateTest?E.fragmentEnd:E.edge,E))}return W},c.getFragmentAtPosition=function(E,w,B){var W=this.config,T=this.fragPrevious,k=B.fragments,m=B.endSN,y=B.fragmentHint,H=W.maxFragLookUpTolerance,Q=!!(W.lowLatencyMode&&B.partList&&y);Q&&y&&!this.bitrateTest&&(k=k.concat(y),m=y.sn);var te;if(Ew-H?0:H;te=Object(h.findFragmentByPTS)(T,k,E,ae)}else te=k[k.length-1];if(te){var Te=te.sn-B.startSN,_e=T&&te.level===T.level,ge=k[Te+1],ve=this.fragmentTracker.getState(te);if(ve===M.FragmentState.BACKTRACKED){te=null;for(var Oe=Te;k[Oe]&&this.fragmentTracker.getState(k[Oe])===M.FragmentState.BACKTRACKED;)T?te=k[Oe--]:te=k[--Oe];te||(te=ge)}else T&&te.sn===T.sn&&!Q&&(_e&&(te.sn=k-w.maxFragLookUpTolerance&&T<=m;if(W!==null&&B.duration>W&&(T"+E.startSN+" prev-sn: "+(T?T.sn:"na")+" fragments: "+m),te}return y},c.waitForCdnTuneIn=function(E){var w=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*w)},c.setStartPosition=function(E,w){var B=this.startPosition;if(B"+E))}}]),d}(I.default)},"./src/controller/buffer-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h});var z=N("./src/polyfills/number.ts"),I=N("./src/events.ts"),M=N("./src/utils/logger.ts"),G=N("./src/errors.ts"),K=N("./src/utils/buffer-helper.ts"),n=N("./src/utils/mediasource-helper.ts"),L=N("./src/loader/fragment.ts"),x=N("./src/controller/buffer-operation-queue.ts"),f=Object(n.getMediaSource)(),b=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function o(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;M.logger.log("[buffer-controller]: Media source opened"),i&&(u.updateMediaElementDuration(),s.trigger(I.Events.MEDIA_ATTACHED,{media:i})),D&&D.removeEventListener("sourceopen",u._onMediaSourceOpen),u.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=o.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(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.on(I.Events.BUFFER_RESET,this.onBufferReset,this),u.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.on(I.Events.BUFFER_EOS,this.onBufferEos,this),u.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.on(I.Events.FRAG_PARSED,this.onFragParsed,this),u.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var u=this.hls;u.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),u.off(I.Events.BUFFER_RESET,this.onBufferReset,this),u.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),u.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),u.off(I.Events.BUFFER_EOS,this.onBufferEos,this),u.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),u.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),u.off(I.Events.FRAG_PARSED,this.onFragParsed,this),u.off(I.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new x.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,M.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(M.logger.log("[buffer-controller]: media source detaching"),s.readyState==="open")try{s.endOfStream()}catch(D){M.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()):M.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(I.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){M.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,g=R.levelCodec,_=R.container,d=(S.levelCodec||S.codec).replace(b,"$1"),c=(g||O).replace(b,"$1");if(d!==c){var C=_+";codecs="+(g||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&&(M.logger.log("[buffer-controller]: changing "+u+" sourceBuffer type to "+s),R.changeType(s)),D.shiftAndExecuteNext(u)},onStart:function(){},onComplete:function(){},onError:function(R){M.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,g=s.frag,_=s.part,d=s.chunkMeta,c=d.buffering[O],C=self.performance.now();c.start=C;var E=g.stats.buffering,w=_?_.stats.buffering:null;E.start===0&&(E.start=C),w&&w.start===0&&(w.start=C);var B=S.audio,W=O==="audio"&&d.id===1&&(B==null?void 0:B.container)==="audio/mpeg",T={execute:function(){if(c.executeStart=self.performance.now(),W){var m=i.sourceBuffer[O];if(m){var y=g.start-m.timestampOffset;Math.abs(y)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+g.start+" (delta: "+y+") sn: "+g.sn+")"),m.timestampOffset=g.start)}}i.appendExecutor(R,O)},onStart:function(){},onComplete:function(){var m=self.performance.now();c.executeEnd=c.end=m,E.first===0&&(E.first=m),w&&w.first===0&&(w.first=m);var y=i.sourceBuffer,H={};for(var Q in y)H[Q]=K.BufferHelper.getBuffered(y[Q]);i.appendError=0,i.hls.trigger(I.Events.BUFFER_APPENDED,{type:O,frag:g,part:_,chunkMeta:d,parent:g.type,timeRanges:H})},onError:function(m){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",m);var y={type:G.ErrorTypes.MEDIA_ERROR,parent:g.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:m,fatal:!1};m.code===DOMException.QUOTA_EXCEEDED_ERR?y.details=G.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,y.details=G.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>D.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+D.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),y.fatal=!0)),D.trigger(I.Events.ERROR,y)}};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(I.Events.BUFFER_FLUSHED,{type:R})},onError:function(g){M.logger.warn("[buffer-controller]: Failed to remove from "+R+" SourceBuffer",g)}}};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[L.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(R[L.ElementaryStreamTypes.AUDIO]&&S.push("audio"),R[L.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var _=self.performance.now();D.stats.buffering.end=_,A&&(A.stats.buffering.end=_);var d=A?A.stats:D.stats;i.hls.trigger(I.Events.FRAG_BUFFERED,{frag:D,part:A,stats:d,id:D.type})};S.length===0&&M.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,M.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,g=Math.max(S,O),_=Math.floor(R/O)*O-g;A.forEach(function(d){var c=D[d];if(c){var C=K.BufferHelper.getBuffered(c);C.length>0&&_>C.start(0)&&(u.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),s.live&&u.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),u.trigger(I.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:d}))}})},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?(M.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))&&(M.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(I.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;M.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var g=s[A]=i.addSourceBuffer(O),_=A;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[A]={buffer:g,codec:R,container:S.container,levelCodec:S.levelCodec,id:S.id},D++}catch(d){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+d.message),this.hls.trigger(I.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:d,mimeType:O})}}D&&this.hls.trigger(I.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){M.logger.error("[buffer-controller]: "+u+" SourceBuffer error",s),this.hls.trigger(I.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){M.logger.warn("[buffer-controller]: Attempting to remove from the "+u+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(u);return}var g=Object(z.isFiniteNumber)(D.duration)?D.duration:Infinity,_=Object(z.isFiniteNumber)(A.duration)?A.duration:Infinity,d=Math.max(0,s),c=Math.min(i,g,_);c>d?(M.logger.log("[buffer-controller]: Removing ["+d+","+c+"] from the "+u+" SourceBuffer"),console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.remove(d,c)):S.shiftAndExecuteNext(u)},p.appendExecutor=function(u,s){var i=this.operationQueue,D=this.sourceBuffer,A=D[s];if(!A){M.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){M.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)})},o}()},"./src/controller/buffer-operation-queue.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return I});var z=N("./src/utils/logger.ts"),I=function(){function M(K){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=K}var G=M.prototype;return G.append=function(n,L){var x=this.queues[L];x.push(n),x.length===1&&this.buffers[L]&&this.executeNext(L)},G.insertAbort=function(n,L){var x=this.queues[L];x.unshift(n),this.executeNext(L)},G.appendBlocker=function(n){var L,x=new Promise(function(b){L=b}),f={execute:L,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,n),x},G.executeNext=function(n){var L=this.buffers,x=this.queues,f=L[n],b=x[n];if(b.length){var h=b[0];try{h.execute()}catch(o){z.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(o),(!f||!f.updating)&&(b.shift(),this.executeNext(n))}}},G.shiftAndExecuteNext=function(n){this.queues[n].shift(),this.executeNext(n)},G.current=function(n){return this.queues[n][0]},M}()},"./src/controller/cap-level-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts");function I(K,n){for(var L=0;L0&&this.mediaWidth>0){var x=this.hls.levels;if(x.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(x.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},n.getMaxLevel=function(x){var f=this,b=this.hls.levels;if(!b.length)return-1;var h=b.filter(function(o,p){return K.isLevelAllowed(p,f.restrictedLevels)&&p<=x});return this.clientRect=null,K.getMaxLevelByMediaSize(h,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 x=this.media,f={width:0,height:0};if(x){var b=x.getBoundingClientRect();f.width=b.width,f.height=b.height,!f.width&&!f.height&&(f.width=b.right-b.left||x.width||0,f.height=b.bottom-b.top||x.height||0)}return this.clientRect=f,f},K.isLevelAllowed=function(x,f){return f===void 0&&(f=[]),f.indexOf(x)===-1},K.getMaxLevelByMediaSize=function(x,f,b){if(!x||!x.length)return-1;for(var h=function(s,i){return i?s.width!==i.width||s.height!==i.height:!0},o=x.length-1,p=0;p=f||l.height>=b)&&h(l,x[p+1])){o=p;break}}return o},M(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 x=1;try{x=self.devicePixelRatio}catch(f){}return x}}]),K}();Y.default=G},"./src/controller/cmcd-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h});var z=N("./src/events.ts"),I=N("./src/types/cmcd.ts"),M=N("./src/utils/buffer-helper.ts"),G=N("./src/utils/logger.ts");function K(o,p){for(var l=0;l=o.length?{done:!0}:{done:!1,value:o[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 x(o,p){if(!o)return;if(typeof o=="string")return f(o,p);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return f(o,p)}function f(o,p){(p==null||p>o.length)&&(p=o.length);for(var l=0,u=new Array(p);ls&&(s=S.bitrate)}return s>0?s:NaN},p.getBufferLength=function(u){var s=this.hls.media,i=u===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!s)return NaN;var D=M.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,g){s(R),this.loader.load(R,O,g)},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,g){s(R),this.loader.load(R,O,g)},n(D,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),D}()},o.uuid=function(){var u=URL.createObjectURL(new Blob),s=u.toString();return URL.revokeObjectURL(u),s.substr(s.lastIndexOf("/")+1)},o.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(),g=L(O),_;!(_=g()).done;){var d=_.value,c=u[d];if(!i(c))continue;if(d==="v"&&c===1)continue;if(d=="pr"&&c===1)continue;var C=R[d];C&&(c=C(c));var E=typeof c,w=void 0;d==="ot"||d==="sf"||d==="st"?w=d+"="+c:E==="boolean"?w=d:E==="number"?w=d+"="+c:w=d+"="+JSON.stringify(c),s.push(w)}return s.join(",")},o.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;RL){this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=L-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(s,i)}break}},o._generateLicenseRequestChallenge=function(l,u){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return u}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,u){M.logger.log("Requesting content license for key-system");var s=this._mediaKeysList[0];if(!s){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var i=this.getLicenseServerUrl(s.mediaKeySystemDomain),D=this._createLicenseXhr(i,l,u);M.logger.log("Sending license request to URL: "+i);var A=this._generateLicenseRequestChallenge(s,l);D.send(A)}catch(S){M.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(l,u){if(!this._emeEnabled)return;var s=u.media;this._media=s,s.addEventListener("encrypted",this._onMediaEncrypted)},o.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(){})},o.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(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();Y.default=b},"./src/controller/fps-controller.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/events.ts"),I=N("./src/utils/logger.ts"),M=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(L){this.streamController=L},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(L,x){var f=this.hls.config;if(f.capLevelOnFPSDrop){var b=x.media instanceof self.HTMLVideoElement?x.media:null;this.media=b,b&&typeof b.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},K.checkFPS=function(L,x,f){var b=performance.now();if(x){if(this.lastTime){var h=b-this.lastTime,o=f-this.lastDroppedFrames,p=x-this.lastDecodedFrames,l=1e3*o/h,u=this.hls;if(u.trigger(z.Events.FPS_DROP,{currentDropped:o,currentDecoded:p,totalDroppedFrames:f}),l>0&&o>u.config.fpsDroppedMonitoringThreshold*p){var s=u.currentLevel;I.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=b,this.lastDroppedFrames=f,this.lastDecodedFrames=x}},K.checkFPSInterval=function(){var L=this.media;if(L)if(this.isVideoPlaybackQualityAvailable){var x=L.getVideoPlaybackQuality();this.checkFPS(L,x.totalVideoFrames,x.droppedVideoFrames)}else this.checkFPS(L,L.webkitDecodedFrameCount,L.webkitDroppedFrameCount)},G}();Y.default=M},"./src/controller/fragment-finders.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"findFragmentByPDT",function(){return M}),N.d(Y,"findFragmentByPTS",function(){return G}),N.d(Y,"fragmentWithinToleranceTest",function(){return K}),N.d(Y,"pdtWithinToleranceTest",function(){return n}),N.d(Y,"findFragWithCC",function(){return L});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/binary-search.ts");function M(x,f,b){if(f===null||!Array.isArray(x)||!x.length||!Object(z.isFiniteNumber)(f))return null;var h=x[0].programDateTime;if(f<(h||0))return null;var o=x[x.length-1].endProgramDateTime;if(f>=(o||0))return null;b=b||0;for(var p=0;px&&b.start?-1:0}function n(x,f,b){var h=Math.min(f,b.duration+(b.deltaPTS?b.deltaPTS:0))*1e3,o=b.endProgramDateTime||0;return o-h>x}function L(x,f){return I.default.search(x,function(b){return b.ccf?-1:0})}},"./src/controller/fragment-tracker.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"FragmentState",function(){return M}),N.d(Y,"FragmentTracker",function(){return G});var z=N("./src/events.ts"),I=N("./src/types/loader.ts"),M;(function(L){L.NOT_LOADED="NOT_LOADED",L.BACKTRACKED="BACKTRACKED",L.APPENDING="APPENDING",L.PARTIAL="PARTIAL",L.OK="OK"})(M||(M={}));var G=function(){function L(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 x=L.prototype;return x._registerListeners=function(){var b=this.hls;b.on(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),b.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),b.on(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x._unregisterListeners=function(){var b=this.hls;b.off(z.Events.BUFFER_APPENDED,this.onBufferAppended,this),b.off(z.Events.FRAG_BUFFERED,this.onFragBuffered,this),b.off(z.Events.FRAG_LOADED,this.onFragLoaded,this)},x.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},x.getAppendedFrag=function(b,h){if(h===I.PlaylistLevelType.MAIN){var o=this.activeFragment,p=this.activeParts;if(!o)return null;if(p)for(var l=p.length;l--;){var u=p[l],s=u?u.end:o.appendedPTS;if(u.start<=b&&s!==void 0&&b<=s)return l>9&&(this.activeParts=p.slice(l-9)),u}else if(o.start<=b&&o.appendedPTS!==void 0&&b<=o.appendedPTS)return o}return this.getBufferedFrag(b,h)},x.getBufferedFrag=function(b,h){for(var o=this.fragments,p=Object.keys(o),l=p.length;l--;){var u=o[p[l]];if((u==null?void 0:u.body.type)===h&&u.buffered){var s=u.body;if(s.start<=b&&b<=s.end)return s}}return null},x.detectEvictedFragments=function(b,h,o){var p=this;Object.keys(this.fragments).forEach(function(l){var u=p.fragments[l];if(!u)return;if(!u.buffered){u.body.type===o&&p.removeFragment(u.body);return}var s=u.range[b];if(!s)return;s.time.some(function(i){var D=!p.isTimeBuffered(i.startPTS,i.endPTS,h);return D&&p.removeFragment(u.body),D})})},x.detectPartialFragments=function(b){var h=this,o=this.timeRanges,p=b.frag,l=b.part;if(!o||p.sn==="initSegment")return;var u=n(p),s=this.fragments[u];if(!s)return;Object.keys(o).forEach(function(i){var D=p.elementaryStreams[i];if(!D)return;var A=o[i],S=l!==null||D.partial===!0;s.range[i]=h.getBufferedTimes(p,l,S,A)}),s.backtrack=s.loaded=null,Object.keys(s.range).length?s.buffered=!0:this.removeFragment(s.body)},x.fragBuffered=function(b){var h=n(b),o=this.fragments[h];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},x.getBufferedTimes=function(b,h,o,p){for(var l={time:[],partial:o},u=h?h.start:b.start,s=h?h.end:b.end,i=b.minEndPTS||s,D=b.maxStartPTS||u,A=0;A=S&&i<=R){l.time.push({startPTS:Math.max(u,p.start(A)),endPTS:Math.min(s,p.end(A))});break}else if(uS)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},x.getPartialFragment=function(b){var h=null,o,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,b>=p&&b<=l&&(o=Math.min(b-p,l-b),u<=o&&(h=A.body,u=o)))}),h},x.getState=function(b){var h=n(b),o=this.fragments[h];return o?o.buffered?K(o)?M.PARTIAL:M.OK:o.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},x.backtrack=function(b,h){var o=n(b),p=this.fragments[o];if(!p||p.backtrack)return null;var l=p.backtrack=h||p.loaded;return p.loaded=null,l},x.getBacktrackData=function(b){var h=n(b),o=this.fragments[h];if(o){var p,l=o.backtrack;if(l!=null&&(p=l.payload)!==null&&p!==void 0&&p.byteLength)return l;this.removeFragment(b)}return null},x.isTimeBuffered=function(b,h,o){for(var p,l,u=0;u=p&&h<=l)return!0;if(h<=p)return!1}return!1},x.onFragLoaded=function(b,h){var o=h.frag,p=h.part;if(o.sn==="initSegment"||o.bitrateTest||p)return;var l=n(o);this.fragments[l]={body:o,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},x.onBufferAppended=function(b,h){var o=this,p=h.frag,l=h.part,u=h.timeRanges;if(p.type===I.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(o.detectEvictedFragments(i,D),!l)for(var A=0;Ab&&p.removeFragment(s)}})},x.removeFragment=function(b){var h=n(b);b.stats.loaded=0,b.clearElementaryStreamInfo(),delete this.fragments[h]},x.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},L}();function K(L){var x,f;return L.buffered&&(((x=L.range.video)===null||x===void 0?void 0:x.partial)||((f=L.range.audio)===null||f===void 0?void 0:f.partial))}function n(L){return L.type+"_"+L.level+"_"+L.urlId+"_"+L.sn}},"./src/controller/gap-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"STALL_MINIMUM_DURATION_MS",function(){return K}),N.d(Y,"MAX_START_GAP_JUMP",function(){return n}),N.d(Y,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return L}),N.d(Y,"SKIP_BUFFER_RANGE_START",function(){return x}),N.d(Y,"default",function(){return f});var z=N("./src/utils/buffer-helper.ts"),I=N("./src/errors.ts"),M=N("./src/events.ts"),G=N("./src/utils/logger.ts"),K=250,n=2,L=.1,x=.05,f=function(){function b(o,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=o,this.media=p,this.fragmentTracker=l,this.hls=u}var h=b.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.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),g=O.len>0,_=O.nextStart||0;if(!g&&!_)return;if(D){var d=O.len>n,c=!_||_-i>n&&!this.fragmentTracker.getPartialFragment(i);if(d||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(_,O.start||0)-i,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=w==null||((C=w.details)===null||C===void 0)?void 0:C.live,W=B?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 k=T-s;!D&&k>=K&&this._reportStall(O.len);var m=z.BufferHelper.bufferInfo(u,i,l.maxBufferHole);this._tryFixBufferStall(m,k)},h._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())},h._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(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p}))},h._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=D&&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;b.playbackRate=Math.min(S,Math.max(1,R))}else b.playbackRate!==1&&b.playbackRate!==0&&(b.playbackRate=1)},x.estimateLiveEdge=function(){var b=this.levelDetails;return b===null?null:b.edge+b.age},x.computeLatency=function(){var b=this.estimateLiveEdge();return b===null?null:b-this.currentTime},K(L,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var b=this.config,h=this.levelDetails;return b.liveMaxLatencyDuration!==void 0?b.liveMaxLatencyDuration:h?b.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var b=this.levelDetails;if(b===null)return null;var h=b.holdBack,o=b.partHoldBack,p=b.targetduration,l=this.config,u=l.liveSyncDuration,s=l.liveSyncDurationCount,i=l.lowLatencyMode,D=this.hls.userConfig,A=i&&o||h;(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 b=this.estimateLiveEdge(),h=this.targetLatency,o=this.levelDetails;if(b===null||h===null||o===null)return null;var p=o.edge,l=b-h-this.edgeStalled,u=p-o.totalduration,s=p-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(u,l),s)}},{key:"drift",get:function(){var b=this.levelDetails;return b===null?1:b.drift}},{key:"edgeStalled",get:function(){var b=this.levelDetails;if(b===null)return 0;var h=(this.config.lowLatencyMode&&b.partTarget||b.targetduration)*3;return Math.max(b.age-h,0)}},{key:"forwardBufferLength",get:function(){var b=this.media,h=this.levelDetails;if(!b||!h)return 0;var o=b.buffered.length;return o?b.buffered.end(o-1):h.edge-this.currentTime}}]),L}()},"./src/controller/level-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return l});var z=N("./src/types/level.ts"),I=N("./src/events.ts"),M=N("./src/errors.ts"),G=N("./src/utils/codecs.ts"),K=N("./src/controller/level-helper.ts"),n=N("./src/controller/base-playlist-controller.ts"),L=N("./src/types/loader.ts");function x(){return x=Object.assign||function(u){for(var s=1;s0){_=R[0].bitrate,R.sort(function(k,m){return k.bitrate-m.bitrate}),this._levels=R;for(var B=0;Bthis.hls.config.fragLoadingMaxRetry&&(d=S.frag.level)):d=S.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:R&&(R.deliveryDirectives&&(_=!1),d=R.level),g=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:d=S.level,g=!0;break}d!==void 0&&this.recoverLevel(S,d,g,_)},i.recoverLevel=function(A,S,R,O){var g=A.details,_=this._levels[S];if(_.loadError++,R){var d=this.retryLoadingOrFail(A);if(d)A.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var c=_.url.length;if(c>1&&_.loadError1){var O=(S.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(g){g.urlId=O}),this.level=A}},i.onFragLoaded=function(A,S){var R=S.frag;if(R!==void 0&&R.type===L.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,g=S.details,_=this._levels[O];if(!_){var d;this.warn("Invalid level index "+O),(d=S.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(g.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,_.details)):(R=S.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(g.deltaUpdateFailed=!0)},i.onAudioTrackSwitched=function(A,S){var R=this.hls.levels[this.currentLevelIndex];if(!R)return;if(R.audioGroupIds){for(var O=-1,g=this.hls.audioTracks[S.id].groupId,_=0;_0){var O=R.urlId,g=R.url[O];if(A)try{g=A.addDirectives(g)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+S+(A?" at sn "+A.msn+" part "+A.part:"")+" with URL-id "+O+" "+g),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:g,level:S,id:O,deliveryDirectives:A||null})}},i.removeLevel=function(A,S){var R=function(_,d){return d!==S},O=this._levels.filter(function(g,_){return _!==A?!0:g.url.length>1&&S!==void 0?(g.url=g.url.filter(R),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(R)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(R)),g.urlId=0,!0):!1}).map(function(g,_){var d=g.details;return d!=null&&d.fragments&&d.fragments.forEach(function(c){c.level=_}),g});this._levels=O,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:O})},b(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(I.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:A,fatal:O,reason:"invalid level idx"}),O)return;A=Math.min(A,R.length-1)}this.clearTimer();var g=this.currentLevelIndex,_=R[g],d=R[A];this.log("switching to level "+A+" from "+g),this.currentLevelIndex=A;var c=x({},d,{level:A,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete c._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,c);var C=d.details;if(!C||C.live){var E=this.switchParams(d.uri,_==null?void 0:_.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(ie,Y,N){"use strict";N.r(Y),N.d(Y,"addGroupId",function(){return M}),N.d(Y,"assignTrackIdsByGroup",function(){return G}),N.d(Y,"updatePTS",function(){return K}),N.d(Y,"updateFragPTSDTS",function(){return L}),N.d(Y,"mergeDetails",function(){return x}),N.d(Y,"mapPartIntersection",function(){return f}),N.d(Y,"mapFragmentIntersection",function(){return b}),N.d(Y,"adjustSliding",function(){return h}),N.d(Y,"addSliding",function(){return o}),N.d(Y,"computeReloadInterval",function(){return p}),N.d(Y,"getFragmentWithSN",function(){return l}),N.d(Y,"getPartWith",function(){return u});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/logger.ts");function M(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 L(s,i,D,A,S,R){var O=A-D;O<=0&&(I.logger.warn("Fragment should have a positive duration",i),A=D+i.duration,R=S+i.duration);var g=D,_=A,d=i.startPTS,c=i.endPTS;if(Object(z.isFiniteNumber)(d)){var C=Math.abs(d-D);Object(z.isFiniteNumber)(i.deltaPTS)?i.deltaPTS=Math.max(C,i.deltaPTS):i.deltaPTS=C,g=Math.max(D,d),D=Math.min(D,d),S=Math.min(S,i.startDTS),_=Math.min(A,c),A=Math.max(A,c),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=g,i.startDTS=S,i.endPTS=A,i.minEndPTS=_,i.endDTS=R;var w=i.sn;if(!s||ws.endSN)return 0;var B,W=w-s.startSN,T=s.fragments;for(T[W]=i,B=W;B>0;B--)n(T[B],T[B-1]);for(B=W;B=0;S--){var R=A[S].initSegment;if(R){D=R;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var O=0,g;if(b(s,i,function(B,W){B.relurl&&(O=B.cc-W.cc),Object(z.isFiniteNumber)(B.startPTS)&&Object(z.isFiniteNumber)(B.endPTS)&&(W.start=W.startPTS=B.startPTS,W.startDTS=B.startDTS,W.appendedPTS=B.appendedPTS,W.maxStartPTS=B.maxStartPTS,W.endPTS=B.endPTS,W.endDTS=B.endDTS,W.minEndPTS=B.minEndPTS,W.duration=B.endPTS-B.startPTS,W.duration&&(g=W),i.PTSKnown=i.alignedSliding=!0),W.elementaryStreams=B.elementaryStreams,W.loader=B.loader,W.stats=B.stats,W.urlId=B.urlId,B.initSegment&&(W.initSegment=B.initSegment,D=B.initSegment)}),D){var _=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;_.forEach(function(B){var W;(!B.initSegment||B.initSegment.relurl===((W=D)===null||W===void 0?void 0:W.relurl))&&(B.initSegment=D)})}if(i.skippedSegments&&(i.deltaUpdateFailed=i.fragments.some(function(B){return!B}),i.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var d=i.skippedSegments;d--;)i.fragments.shift();i.startSN=i.fragments[0].sn,i.startCC=i.fragments[0].cc}var c=i.fragments;if(O){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C=A.length)return;o(i,A[D].start)}function o(s,i){if(i){for(var D=s.fragments,A=s.skippedSegments;A0&&S0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),_=d),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var _,d=this.levels,c=this.level,C=d==null||((_=d[c])===null||_===void 0)?void 0:_.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var E,w=self.performance.now(),B=this.retryDate;(!B||w>=B||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var _,d,c=this.hls,C=this.levelLastLoaded,E=this.levels,w=this.media,B=c.config,W=c.nextLoadLevel;if(C===null||!w&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[W])return;var T=E[W];this.level=c.nextLoadLevel=W;var k=T.details;if(!k||this.state===I.State.WAITING_LEVEL||k.live&&this.levelLastLoaded!==W){this.state=I.State.WAITING_LEVEL;return}var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:w,L.PlaylistLevelType.MAIN);if(m===null)return;var y=m.len,H=this.getMaxBufferLength(T.maxBitrate);if(y>=H)return;if(this._streamEnded(m,k)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,Q),this.state=I.State.ENDED;return}var te=m.end,ae=this.getNextFragment(te,k);if(this.couldBacktrack&&!this.fragPrevious&&ae&&ae.sn!=="initSegment"){var Te=ae.sn-k.startSN;Te>1&&(ae=k.fragments[Te-1],this.fragmentTracker.removeFragment(ae))}if(ae&&this.fragmentTracker.getState(ae)===n.FragmentState.OK&&this.nextLoadPosition>te){var _e=this.audioOnly&&!this.altAudio?x.ElementaryStreamTypes.AUDIO:x.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(w,_e,L.PlaylistLevelType.MAIN),ae=this.getNextFragment(this.nextLoadPosition,k)}if(!ae)return;ae.initSegment&&!ae.initSegment.data&&!this.bitrateTest&&(ae=ae.initSegment),((_=ae.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((d=ae.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ae,k):this.loadFragment(ae,k,te)},O.loadFragment=function(_,d,c){var C,E=this.fragmentTracker.getState(_);if(this.fragCurrent=_,E===n.FragmentState.BACKTRACKED){var w=this.fragmentTracker.getBacktrackData(_);if(w){this._handleFragmentLoadProgress(w),this._handleFragmentLoadComplete(w);return}else E=n.FragmentState.NOT_LOADED}E===n.FragmentState.NOT_LOADED||E===n.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,_,d,c)):E===n.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(_){var d=this.fragmentTracker.getAppendedFrag(_,L.PlaylistLevelType.MAIN);return d&&"fragment"in d?d.fragment:d},O.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,L.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var _=this.levels,d=this.media;if(d!=null&&d.readyState){var c,C=this.getAppendedFrag(d.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!d.paused&&_){var E=this.hls.nextLoadLevel,w=_[E],B=this.fragLastKbps;B&&this.fragCurrent?c=this.fragCurrent.duration*w.maxBitrate/(1e3*B)+1:c=0}else c=0;var W=this.getBufferedFrag(d.currentTime+c);if(W){var T=this.followingBufferedFrag(W);if(T){this.abortCurrentFrag();var k=T.maxStartPTS?T.maxStartPTS:T.start,m=T.duration,y=Math.max(W.end,k+Math.min(Math.max(m-this.config.maxFragLookUpTolerance,m*.5),m*.75));this.flushMainBuffer(y,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(_,d){S.prototype.flushMainBuffer.call(this,_,d,this.altAudio?"video":null)},O.onMediaAttached=function(_,d){S.prototype.onMediaAttached.call(this,_,d);var c=d.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),c.addEventListener("playing",this.onvplaying),c.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,c,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.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 _=this.media,d=_?_.currentTime:null;Object(z.isFiniteNumber)(d)&&this.log("Media seeked to "+d.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(_,d){var c=!1,C=!1,E;d.levels.forEach(function(w){E=w.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(c=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=c&&C&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=d.levels,this.startFragRequested=!1},O.onLevelLoading=function(_,d){var c=this.levels;if(!c||this.state!==I.State.IDLE)return;var C=c[d.level];(!C.details||C.details.live&&this.levelLastLoaded!==d.level||this.waitForCdnTuneIn(C.details))&&(this.state=I.State.WAITING_LEVEL)},O.onLevelLoaded=function(_,d){var c,C=this.levels,E=d.level,w=d.details,B=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:"+B);var W=this.fragCurrent;W&&(this.state===I.State.FRAG_LOADING||this.state===I.State.FRAG_LOADING_WAITING_RETRY)&&(W.level!==d.level&&W.loader&&(this.state=I.State.IDLE,W.loader.abort()));var T=C[E],k=0;if(w.live||(c=T.details)!==null&&c!==void 0&&c.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;k=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===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=I.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,k),this.tick()},O._handleFragmentLoadProgress=function(_){var d,c=_.frag,C=_.part,E=_.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var B=w[c.level],W=B.details;if(!W){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var T=B.videoCodec,k=W.PTSKnown||!W.live,m=(d=c.initSegment)===null||d===void 0?void 0:d.data,y=this._getAudioCodec(B),H=this.transmuxer=this.transmuxer||new f.default(this.hls,L.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=C?C.index:-1,te=Q!==-1,ae=new b.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,E.byteLength,Q,te),Te=this.initPTS[c.cc];H.push(E,m,y,T,c,C,W.totalduration,k,ae,Te)},O.onAudioTrackSwitching=function(_,d){var c=this.altAudio,C=!!d.url,E=d.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 B=this.hls;c&&B.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:E})}},O.onAudioTrackSwitched=function(_,d){var c=d.id,C=!!this.hls.audioTracks[c].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(_,d){var c=d.tracks,C,E,w=!1;for(var B in c){var W=c[B];if(W.id==="main"){if(E=B,C=W,B==="video"){var T=c[B];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(_,d){var c=d.frag,C=d.part;if(c&&c.type!==L.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(c)){this.warn("Fragment "+c.sn+(C?" p: "+C.index:"")+" of level "+c.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var E=C?C.stats:c.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,C)},O.onError=function(_,d){switch(d.details){case o.ErrorDetails.FRAG_LOAD_ERROR:case o.ErrorDetails.FRAG_LOAD_TIMEOUT:case o.ErrorDetails.KEY_LOAD_ERROR:case o.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(L.PlaylistLevelType.MAIN,d);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==I.State.ERROR&&(d.fatal?(this.warn(""+d.details),this.state=I.State.ERROR):!d.levelRetry&&this.state===I.State.WAITING_LEVEL&&(this.state=I.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var c=!0,C=this.getFwdBufferInfo(this.media,L.PlaylistLevelType.MAIN);C&&C.len>.5&&(c=!this.reduceMaxBufferLength(C.len)),c&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},O.checkBuffer=function(){var _=this.media,d=this.gapController;if(!_||!d||!_.readyState)return;var c=K.BufferHelper.getBuffered(_);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):d.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(_,d){var c=d.type;if(c!==x.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(c===x.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,c,L.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(_,d){this.levels=d.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var _=this.media,d=_.currentTime,c=this.startPosition;if(c>=0&&d0&&(w1&&_.seeking===!1){var c=_.currentTime;if(K.BufferHelper.isBuffered(_,c)?d=this.getAppendedFrag(c):K.BufferHelper.isBuffered(_,c+.1)&&(d=this.getAppendedFrag(c+.1)),d){var C=this.fragPlaying,E=d.level;(!C||d.sn!==C.sn||C.level!==E||d.urlId!==C.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:d}),(!C||C.level!==E)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=d)}}},u(R,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var d=this.getAppendedFrag(_.currentTime);if(d)return d.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var d=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(d)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),R}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"SubtitleStreamController",function(){return s});var z=N("./src/events.ts"),I=N("./src/utils/logger.ts"),M=N("./src/utils/buffer-helper.ts"),G=N("./src/controller/fragment-finders.ts"),K=N("./src/utils/discontinuities.ts"),n=N("./src/controller/level-helper.ts"),L=N("./src/controller/fragment-tracker.ts"),x=N("./src/controller/base-stream-controller.ts"),f=N("./src/types/loader.ts"),b=N("./src/types/level.ts");function h(i,D){for(var A=0;A=d[E].start&&C<=d[E].end){c=d[E];break}var w=g.start+g.duration;c?c.end=w:(c={start:C,end:w},d.push(c)),this.fragmentTracker.fragBuffered(g)},A.onBufferFlushing=function(R,O){var g=O.startOffset,_=O.endOffset;if(g===0&&_!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,c=this.levels;if(!c.length||!c[d]||!c[d].details)return;var C=c[d].details,E=C.targetduration,w=_-E;if(w<=0)return;O.endOffsetSubtitles=Math.max(0,w),this.tracksBuffered.forEach(function(B){for(var W=0;W=C.length||d!==c||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(g=E.details)!==null&&g!==void 0&&g.live){var w=this.mainDetails;if(_.deltaUpdateFailed||!w)return;var B=w.fragments[0];if(!E.details)_.hasProgramDateTime&&w.hasProgramDateTime?Object(K.alignMediaPlaylistByPDT)(_,w):B&&Object(n.addSliding)(_,B.start);else{var W=this.alignPlaylists(_,E.details);W===0&&B&&Object(n.addSliding)(_,B.start)}}if(E.details=_,this.levelLastLoaded=d,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===x.State.IDLE){var T=Object(G.findFragmentByPTS)(null,_.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,g=R.payload,_=O.decryptdata,d=this.hls;if(this.fragContextChanged(O))return;if(g&&g.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(g),_.key.buffer,_.iv.buffer).then(function(C){var E=performance.now();d.trigger(z.Events.FRAG_DECRYPTED,{frag:O,payload:C,stats:{tstart:c,tdecrypt:E}})})}},A.doTick=function(){if(!this.media){this.state=x.State.IDLE;return}if(this.state===x.State.IDLE){var R,O=this.currentTrackId,g=this.levels;if(!g.length||!g[O]||!g[O].details)return;var _=g[O].details,d=_.targetduration,c=this.config,C=this.media,E=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-d,c.maxBufferHole),w=E.end,B=E.len,W=this.getMaxBufferLength()+d;if(B>W)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var T=_.fragments,k=T.length,m=_.edge,y,H=this.fragPrevious;if(w-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=b(this.media.textTracks);u.forEach(function(s){Object(I.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=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,g=A.name,_=A.type,d=A.url;this.hls.trigger(z.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:g,type:_,url:d});var c=this.switchParams(A.url,s==null?void 0:s.details);this.loadPlaylist(c)}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=b(this.media.textTracks),i=0;i=0&&(_[0]=Math.min(_[0],D),_[1]=Math.max(_[1],A),O=!0,d/(A-D)>.5))return}if(O||R.push([D,A]),this.config.renderTextTracksNatively){var c=this.captionsTracks[i];this.Cues.newCue(c,D,A,S)}else{var C=this.Cues.newCue(null,D,A,S);this.hls.trigger(I.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,g=D.timescale,_=this.unparsedVttFrags;R==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=g),_.length&&(this.unparsedVttFrags=[],_.forEach(function(d){A.onFragLoaded(I.Events.FRAG_LOADED,d)}))},u.getExistingTrack=function(i){var D=this.media;if(D)for(var A=0;A>>8^g&255^99,L[S]=g,x[g]=S;var _=A[S],d=A[_],c=A[d],C=A[g]*257^g*16843008;b[S]=C<<24|C>>>8,h[S]=C<<16|C>>>16,o[S]=C<<8|C>>>24,p[S]=C,C=c*16843009^d*65537^_*257^S*16843008,u[g]=C<<24|C>>>8,s[g]=C<<16|C>>>16,i[g]=C<<8|C>>>24,D[g]=C,S?(S=_^A[A[A[c^_]]],R^=A[A[R]]):S=R=1}},K.expandKey=function(L){for(var x=this.uint8ArrayToUint32Array_(L),f=!0,b=0;b>>6)+1;var C=(i[D+2]&60)>>>2;if(C>c.length-1){s.trigger(M.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.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(_)?C>=6?(S=5,g=new Array(4),R=C-3):(S=2,g=new Array(2),R=C):_.indexOf("android")!==-1?(S=2,g=new Array(2),R=C):(S=5,g=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(_))||!A&&O===1)&&(S=2,g=new Array(2)),R=C)),g[0]=S<<3,g[0]|=(C&14)>>1,g[1]|=(C&1)<<7,g[1]|=O<<3,S===5&&(g[1]|=(R&14)>>1,g[2]=(R&1)<<7,g[2]|=2<<2,g[3]=0),{config:g,samplerate:c[C],channelCount:O,codec:"mp4a.40."+S,manifestCodec:d}}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 L(s,i){return(s[i+3]&3)<<11|s[i+4]<<3|(s[i+5]&224)>>>5}function x(s,i){return i+5=s.length)return!1;var A=L(s,i);if(A<=D)return!1;var S=i+A;return S===s.length||f(s,S)}return!1}function o(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=L(s,i);if(O-=R,O>0){var g=D+A*S;return{headerLength:R,frameLength:O,stamp:g}}}function u(s,i,D,A,S){var R=p(s.samplerate),O=l(i,D,A,S,R);if(O){var g=O.frameLength,_=O.headerLength,d=O.stamp,c=_+g,C=Math.max(0,D+c-i.length),E;C?(E=new Uint8Array(c-_),E.set(i.subarray(D+_,i.length),0)):E=i.subarray(D+_,D+c);var w={unit:E,pts:d};return C||s.samples.push(w),{sample:w,length:c,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"initPTSFn",function(){return L});var z=N("./src/polyfills/number.ts"),I=N("./src/demux/id3.ts"),M=N("./src/demux/dummy-demuxed-track.ts"),G=N("./src/utils/mp4-tools.ts"),K=N("./src/utils/typed-array.ts"),n=function(){function x(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=x.prototype;return f.resetInitSegment=function(h,o,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(h,o){return!1},f.appendFrame=function(h,o,p){},f.demux=function(h,o){this.cachedData&&(h=Object(G.appendUint8Array)(this.cachedData,h),this.cachedData=null);var p=I.getID3Data(h,0),l=p?p.length:0,u,s,i=this._audioTrack,D=this._id3Track,A=p?I.getTimeStamp(p):void 0,S=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=L(A,o)),p&&p.length>0&&D.samples.push({pts:this.initPTS,dts:this.initPTS,data:p}),s=this.initPTS;ln?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,L=n>>3,n-=L>>3,this.bytesAvailable-=L,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},G.readBits=function(n){var L=Math.min(this.bitsAvailable,n),x=this.word>>>32-L;return n>32&&z.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=L,this.bitsAvailable>0?this.word<<=L:this.bytesAvailable>0&&this.loadWord(),L=n-L,L>0&&this.bitsAvailable?x<>>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 L=8,x=8,f,b=0;b0?S.subarray(O,O+g):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>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:w+=String.fromCharCode(c);break;case 12:case 13:C=S[B++],w+=String.fromCharCode((c&31)<<6|C&63);break;case 14:C=S[B++],E=S[B++],w+=String.fromCharCode((c&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return w},s={decodeTextFrame:o},i;function D(){return!i&&typeof self.TextDecoder!="undefined"&&(i=new self.TextDecoder("utf-8")),i}},"./src/demux/mp3demuxer.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/demux/base-audio-demuxer.ts"),I=N("./src/demux/id3.ts"),M=N("./src/utils/logger.ts"),G=N("./src/demux/mpegaudio.ts");function K(x,f){x.prototype=Object.create(f.prototype),x.prototype.constructor=x,n(x,f)}function n(x,f){return n=Object.setPrototypeOf||function(h,o){return h.__proto__=o,h},n(x,f)}var L=function(x){K(f,x);function f(){return x.apply(this,arguments)||this}var b=f.prototype;return b.resetInitSegment=function(o,p,l){x.prototype.resetInitSegment.call(this,o,p,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},f.probe=function(o){if(!o)return!1;for(var p=I.getID3Data(o,0)||[],l=p.length,u=o.length;l0},K.demux=function(L){var x=L,f=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(x=Object(z.appendUint8Array)(this.remainderData,L));var b=Object(z.segmentValidRange)(x);this.remainderData=b.remainder,f.samples=b.valid||new Uint8Array}else f.samples=x;return{audioTrack:Object(I.dummyTrack)(),avcTrack:f,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},K.flush=function(){var L=Object(I.dummyTrack)();return L.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:L,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},K.demuxSampleAes=function(L,x,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},K.destroy=function(){},G}();M.minProbeByteLength=1024,Y.default=M},"./src/demux/mpegaudio.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"appendFrame",function(){return n}),N.d(Y,"parseHeader",function(){return L}),N.d(Y,"isHeaderPattern",function(){return x}),N.d(Y,"isHeader",function(){return f}),N.d(Y,"canParse",function(){return b}),N.d(Y,"probe",function(){return h});var z=null,I=[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],M=[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(o,p,l,u,s){if(l+24>p.length)return;var i=L(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 o.config=[],o.channelCount=i.channelCount,o.samplerate=i.sampleRate,o.samples.push(S),{sample:S,length:i.frameLength,missing:0}}}function L(o,p){var l=o[p+1]>>3&3,u=o[p+1]>>1&3,s=o[p+2]>>4&15,i=o[p+2]>>2&3;if(l!==1&&s!==0&&s!==15&&i!==3){var D=o[p+2]>>1&1,A=o[p+3]>>6,S=l===3?3-u:u===3?3:4,R=I[S*14+s-1]*1e3,O=l===3?0:l===2?1:2,g=M[O*3+i],_=A===3?1:2,d=G[l][u],c=K[u],C=d*8*c,E=Math.floor(d*R/g+D)*c;if(z===null){var w=navigator.userAgent||"",B=w.match(/Chrome\/(\d+)/i);z=B?parseInt(B[1]):0}var W=!!z&&z<=87;return W&&u===2&&R>=224e3&&A===0&&(o[p+3]=o[p+3]|128),{sampleRate:g,channelCount:_,frameLength:E,samplesPerFrame:C}}}function x(o,p){return o[p]===255&&(o[p+1]&224)===224&&(o[p+1]&6)!==0}function f(o,p){return p+1=L.length){f();return}if(L[x].unit.length<32)continue;var b=this.decrypter.isSync();if(this.decryptAacSample(L,x,f,b),!b)return}},K.getAvcEncryptedData=function(L){for(var x=Math.floor((L.length-48)/160)*16+16,f=new Int8Array(x),b=0,h=32;h<=L.length-16;h+=160,b+=16)f.set(L.subarray(h,h+16),b);return f},K.getAvcDecryptedUnit=function(L,x){for(var f=new Uint8Array(x),b=0,h=32;h<=L.length-16;h+=160,b+=16)L.set(f.subarray(b,b+16),h);return L},K.decryptAvcSample=function(L,x,f,b,h,o){var p=Object(I.discardEPB)(h.data),l=this.getAvcEncryptedData(p),u=this;this.decryptBuffer(l.buffer,function(s){h.data=u.getAvcDecryptedUnit(p,s),o||u.decryptAvcSamples(L,x,f+1,b)})},K.decryptAvcSamples=function(L,x,f,b){if(L instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;x++,f=0){if(x>=L.length){b();return}for(var h=L[x].units;!(f>=h.length);f++){var o=h[f];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var p=this.decrypter.isSync();if(this.decryptAvcSample(L,x,f,b,o,p),!p)return}}},G}();Y.default=M},"./src/demux/transmuxer-interface.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h});var z=N("./node_modules/webworkify-webpack/index.js"),I=N.n(z),M=N("./src/events.ts"),G=N("./src/demux/transmuxer.ts"),K=N("./src/utils/logger.ts"),n=N("./src/errors.ts"),L=N("./src/utils/mediasource-helper.ts"),x=N("./node_modules/eventemitter3/index.js"),f=N.n(x),b=Object(L.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function o(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(d,c){c=c||{},c.frag=D.frag,c.id=D.id,l.trigger(d,c)};this.observer=new x.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,S),this.observer.on(M.Events.ERROR,S);var R={mp4:b.isTypeSupported("video/mp4"),mpeg:b.isTypeSupported("audio/mpeg"),mp3:b.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(A.enableWorker&&typeof Worker!="undefined"){K.logger.log("demuxing in webworker");var g;try{g=this.worker=z("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(_){l.trigger(M.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},g.postMessage({cmd:"init",typeSupported:R,vendor:O,id:u,config:JSON.stringify(A)})}catch(_){K.logger.warn("Error in worker:",_),K.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.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=o.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,g,_){var d=this;g.transmuxing.start=self.performance.now();var c=this.transmuxer,C=this.worker,E=S?S.start:A.start,w=A.decryptdata,B=this.frag,W=!(B&&A.cc===B.cc),T=!(B&&g.level===B.level),k=B?g.sn-B.sn:-1,m=this.part?g.part-this.part.index:1,y=!T&&(k===1||k===0&&m===1),H=self.performance.now();(T||k||A.stats.parsing.start===0)&&(A.stats.parsing.start=H),S&&(m||!y)&&(S.stats.parsing.start=H);var Q=new G.TransmuxState(W,y,O,T,E);if(!y||W){K.logger.log("[transmuxer-interface, "+A.type+"]: Starting new transmux session for sn: "+g.sn+" p: "+g.part+" level: "+g.level+" id: "+g.id+` discontinuity: `+W+` trackSwitch: `+T+` contiguous: `+y+` accurateTimeOffset: `+O+` timeOffset: `+E);var te=new G.TransmuxConfig(i,D,s,R,_);this.configureTransmuxer(te)}if(this.frag=A,this.part=S,C)C.postMessage({cmd:"demux",data:u,decryptdata:w,chunkMeta:g,state:Q},u instanceof ArrayBuffer?[u]:[]);else if(c){var ae=c.push(u,w,g,Q);Object(G.isPromise)(ae)?ae.then(function(Te){d.handleTransmuxComplete(Te)}):this.handleTransmuxComplete(ae)}},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)},o}()},"./src/demux/transmuxer-worker.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return n});var z=N("./src/demux/transmuxer.ts"),I=N("./src/events.ts"),M=N("./src/utils/logger.ts"),G=N("./node_modules/eventemitter3/index.js"),K=N.n(G);function n(h){var o=new G.EventEmitter,p=function(u,s){h.postMessage({event:u,data:s})};o.on(I.Events.FRAG_DECRYPTED,p),o.on(I.Events.ERROR,p),h.addEventListener("message",function(l){var u=l.data;switch(u.cmd){case"init":{var s=JSON.parse(u.config);h.transmuxer=new z.default(o,u.typeSupported,s,u.vendor,u.id),Object(M.enableLogs)(s.debug),p("init",null);break}case"configure":{h.transmuxer.configure(u.config);break}case"demux":{var i=h.transmuxer.push(u.data,u.decryptdata,u.chunkMeta,u.state);Object(z.isPromise)(i)?i.then(function(S){L(h,S)}):L(h,i);break}case"flush":{var D=u.chunkMeta,A=h.transmuxer.flush(D);Object(z.isPromise)(A)?A.then(function(S){f(h,S,D)}):f(h,A,D);break}default:break}})}function L(h,o){if(b(o.remuxResult))return;var p=[],l=o.remuxResult,u=l.audio,s=l.video;u&&x(p,u),s&&x(p,s),h.postMessage({event:"transmuxComplete",data:o},p)}function x(h,o){o.data1&&h.push(o.data1.buffer),o.data2&&h.push(o.data2.buffer)}function f(h,o,p){o.forEach(function(l){L(h,l)}),h.postMessage({event:"flush",data:p})}function b(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"isPromise",function(){return A}),N.d(Y,"TransmuxConfig",function(){return S}),N.d(Y,"TransmuxState",function(){return R});var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/crypt/decrypter.ts"),G=N("./src/demux/aacdemuxer.ts"),K=N("./src/demux/mp4demuxer.ts"),n=N("./src/demux/tsdemuxer.ts"),L=N("./src/demux/mp3demuxer.ts"),x=N("./src/remux/mp4-remuxer.ts"),f=N("./src/remux/passthrough-remuxer.ts"),b=N("./src/demux/chunk-cache.ts"),h=N("./src/utils/mp4-tools.ts"),o=N("./src/utils/logger.ts"),p;try{p=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),p=self.Date.now}var l=[{demux:n.default,remux:x.default},{demux:K.default,remux:f.default},{demux:G.default,remux:x.default},{demux:L.default,remux:x.default}],u=1024;l.forEach(function(O){var g=O.demux;u=Math.max(u,g.minProbeByteLength)});var s=function(){function O(_,d,c,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 b.default,this.observer=_,this.typeSupported=d,this.config=c,this.vendor=C,this.id=E}var g=O.prototype;return g.configure=function(d){this.transmuxConfig=d,this.decrypter&&this.decrypter.reset()},g.push=function(d,c,C,E){var w=this,B=C.transmuxing;B.executeStart=p();var W=new Uint8Array(d),T=this.cache,k=this.config,m=this.currentTransmuxState,y=this.transmuxConfig;E&&(this.currentTransmuxState=E);var H=i(W,c);if(H&&H.method==="AES-128"){var Q=this.getDecrypter();if(k.enableSoftwareAES){var te=Q.softwareDecrypt(W,H.key.buffer,H.iv.buffer);if(!te)return B.executeEnd=p(),D(C);W=new Uint8Array(te)}else return this.decryptionPromise=Q.webCryptoDecrypt(W,H.key.buffer,H.iv.buffer).then(function(Re){var Ke=w.push(Re,null,C);return w.decryptionPromise=null,Ke}),this.decryptionPromise}var ae=E||m,Te=ae.contiguous,_e=ae.discontinuity,ge=ae.trackSwitch,ve=ae.accurateTimeOffset,Oe=ae.timeOffset,he=y.audioCodec,V=y.videoCodec,P=y.defaultInitPts,j=y.duration,$=y.initSegmentData;if((_e||ge)&&this.resetInitSegment($,he,V,j),_e&&this.resetInitialTimestamp(P),Te||this.resetContiguity(),this.needsProbing(W,_e,ge)){if(T.dataLength){var J=T.flush();W=Object(h.appendUint8Array)(J,W)}this.configureTransmuxer(W,y)}var X=this.transmux(W,H,Oe,ve,C),ye=this.currentTransmuxState;return ye.contiguous=!0,ye.discontinuity=!1,ye.trackSwitch=!1,B.executeEnd=p(),X},g.flush=function(d){var c=this,C=d.transmuxing;C.executeStart=p();var E=this.decrypter,w=this.cache,B=this.currentTransmuxState,W=this.decryptionPromise;if(W)return W.then(function(){return c.flush(d)});var T=[],k=B.timeOffset;if(E){var m=E.flush();m&&T.push(this.push(m,null,d))}var y=w.dataLength;w.reset();var H=this.demuxer,Q=this.remuxer;if(!H||!Q)return y>=u&&this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=p(),[D(d)];var te=H.flush(k);return A(te)?te.then(function(ae){return c.flushRemux(T,ae,d),T}):(this.flushRemux(T,te,d),T)},g.flushRemux=function(d,c,C){var E=c.audioTrack,w=c.avcTrack,B=c.id3Track,W=c.textTrack,T=this.currentTransmuxState,k=T.accurateTimeOffset,m=T.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var y=this.remuxer.remux(E,w,B,W,m,k,!0,this.id);d.push({remuxResult:y,chunkMeta:C}),C.transmuxing.executeEnd=p()},g.resetInitialTimestamp=function(d){var c=this.demuxer,C=this.remuxer;if(!c||!C)return;c.resetTimeStamp(d),C.resetTimeStamp(d)},g.resetContiguity=function(){var d=this.demuxer,c=this.remuxer;if(!d||!c)return;d.resetContiguity(),c.resetNextTimestamp()},g.resetInitSegment=function(d,c,C,E){var w=this.demuxer,B=this.remuxer;if(!w||!B)return;w.resetInitSegment(c,C,E),B.resetInitSegment(d,c,C)},g.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},g.transmux=function(d,c,C,E,w){var B;return c&&c.method==="SAMPLE-AES"?B=this.transmuxSampleAes(d,c,C,E,w):B=this.transmuxUnencrypted(d,C,E,w),B},g.transmuxUnencrypted=function(d,c,C,E){var w=this.demuxer.demux(d,c,!1,!this.config.progressive),B=w.audioTrack,W=w.avcTrack,T=w.id3Track,k=w.textTrack,m=this.remuxer.remux(B,W,T,k,c,C,!1,this.id);return{remuxResult:m,chunkMeta:E}},g.transmuxSampleAes=function(d,c,C,E,w){var B=this;return this.demuxer.demuxSampleAes(d,c,C).then(function(W){var T=B.remuxer.remux(W.audioTrack,W.avcTrack,W.id3Track,W.textTrack,C,E,!1,B.id);return{remuxResult:T,chunkMeta:w}})},g.configureTransmuxer=function(d,c){for(var C=this.config,E=this.observer,w=this.typeSupported,B=this.vendor,W=c.audioCodec,T=c.defaultInitPts,k=c.duration,m=c.initSegmentData,y=c.videoCodec,H,Q=0,te=l.length;Q0&&g!=null&&g.key!=null&&g.iv!==null&&g.method!=null&&(_=g),_}var D=function(g){return{remuxResult:{},chunkMeta:g}};function A(O){return"then"in O&&O.then instanceof Function}var S=function(g,_,d,c,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=g,this.videoCodec=_,this.initSegmentData=d,this.duration=c,this.defaultInitPts=C},R=function(g,_,d,c,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=g,this.contiguous=_,this.accurateTimeOffset=d,this.trackSwitch=c,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"discardEPB",function(){return D});var z=N("./src/demux/adts.ts"),I=N("./src/demux/mpegaudio.ts"),M=N("./src/demux/exp-golomb.ts"),G=N("./src/demux/id3.ts"),K=N("./src/demux/sample-aes.ts"),n=N("./src/events.ts"),L=N("./src/utils/mp4-tools.ts"),x=N("./src/utils/logger.ts"),f=N("./src/errors.ts"),b={video:1,audio:2,id3:3,text:4},h=function(){function A(R,O,g){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=g}A.probe=function(O){var g=A.syncOffset(O);return g<0?!1:(g&&x.logger.warn("MPEG2-TS detected but first sync word found @ offset "+g+", junk ahead ?"),!0)},A.syncOffset=function(O){for(var g=Math.min(1e3,O.length-3*188),_=0;_>4,he=void 0;if(Oe>1){if(he=_e+5+O[_e+4],he===_e+188)continue}else he=_e+4;switch(ve){case B:ge&&(W&&(c=u(W))&&this.parseAVCPES(c,!1),W={data:[],size:0}),W&&(W.data.push(O.subarray(he,_e+188)),W.size+=_e+188-he);break;case T:ge&&(m&&(c=u(m))&&(E.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),m={data:[],size:0}),m&&(m.data.push(O.subarray(he,_e+188)),m.size+=_e+188-he);break;case k:ge&&(y&&(c=u(y))&&this.parseID3PES(c),y={data:[],size:0}),y&&(y.data.push(O.subarray(he,_e+188)),y.size+=_e+188-he);break;case 0:ge&&(he+=O[he]+1),te=this._pmtId=p(O,he);break;case te:{ge&&(he+=O[he]+1);var V=l(O,he,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);B=V.avc,B>0&&(C.pid=B),T=V.audio,T>0&&(E.pid=T,E.isAAC=V.isAAC),k=V.id3,k>0&&(w.pid=k),H&&!Q&&(x.logger.log("reparse from beginning"),H=!1,_e=Te-188),Q=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=m,w.pesData=y;var P={audioTrack:E,avcTrack:C,id3Track:w,textTrack:this._txtTrack};return d&&this.extractRemainingSamples(P),P},S.flush=function(){var O=this.remainderData;this.remainderData=null;var g;return O?g=this.demux(O,-1,!1,!0):g={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(g),this.sampleAes?this.decrypt(g,this.sampleAes):g},S.extractRemainingSamples=function(O){var g=O.audioTrack,_=O.avcTrack,d=O.id3Track,c=_.pesData,C=g.pesData,E=d.pesData,w;c&&(w=u(c))?(this.parseAVCPES(w,!0),_.pesData=null):_.pesData=c,C&&(w=u(C))?(g.isAAC?this.parseAACPES(w):this.parseMPEGPES(w),g.pesData=null):(C!=null&&C.size&&x.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=C),E&&(w=u(E))?(this.parseID3PES(w),d.pesData=null):d.pesData=E},S.demuxSampleAes=function(O,g,_){var d=this.demux(O,_,!0,!this.config.progressive),c=this.sampleAes=new K.default(this.observer,this.config,g);return this.decrypt(d,c)},S.decrypt=function(O,g){return new Promise(function(_){var d=O.audioTrack,c=O.avcTrack;d.samples&&d.isAAC?g.decryptAacSamples(d.samples,0,function(){c.samples?g.decryptAvcSamples(c.samples,0,0,function(){_(O)}):_(O)}):c.samples&&g.decryptAvcSamples(c.samples,0,0,function(){_(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,g){var _=this,d=this._avcTrack,c=this.parseAVCNALu(O.data),C=!1,E=this.avcSample,w,B=!1;O.data=null,E&&c.length&&!d.audFound&&(s(E,d),E=this.avcSample=o(!1,O.pts,O.dts,"")),c.forEach(function(W){switch(W.type){case 1:{w=!0,E||(E=_.avcSample=o(!0,O.pts,O.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var T=W.data;if(B&&T.length>4){var k=new M.default(T).readSliceType();(k===2||k===4||k===7||k===9)&&(E.key=!0)}break}case 5:w=!0,E||(E=_.avcSample=o(!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 m=new M.default(D(W.data));m.readUByte();for(var y=0,H=0,Q=!1,te=0;!Q&&m.bytesAvailable>1;){y=0;do te=m.readUByte(),y+=te;while(te===255);H=0;do te=m.readUByte(),H+=te;while(te===255);if(y===4&&m.bytesAvailable!==0){Q=!0;var ae=m.readUByte();if(ae===181){var Te=m.readUShort();if(Te===49){var _e=m.readUInt();if(_e===1195456820){var ge=m.readUByte();if(ge===3){for(var ve=m.readUByte(),Oe=m.readUByte(),he=31&ve,V=[ve,Oe],P=0;P16){for(var j=[],$=0;$<16;$++)j.push(m.readUByte().toString(16)),($===3||$===5||$===7||$===9)&&j.push("-");for(var J=H-16,X=new Uint8Array(J),ye=0;ye=0){var m={data:O.subarray(T,E-d-1),type:k};C.push(m)}else{var y=this.getLastNalUnit();if(y&&(c&&E<=4-c&&(y.state&&(y.data=y.data.subarray(0,y.data.byteLength-c))),B=E-d-1,B>0)){var H=new Uint8Array(y.data.byteLength+B);H.set(y.data,0),H.set(O.subarray(0,B),y.data.byteLength),y.data=H,y.state=0}}E=0&&d>=0){var Q={data:O.subarray(T,g),type:k,state:d};C.push(Q)}if(C.length===0){var te=this.getLastNalUnit();if(te){var ae=new Uint8Array(te.data.byteLength+O.byteLength);ae.set(te.data,0),ae.set(O,te.data.byteLength),te.data=ae}}return _.naluState=d,C},S.parseAACPES=function(O){var g=0,_=this._audioTrack,d=this.aacOverFlow,c=O.data;if(d){this.aacOverFlow=null;var C=d.sample.unit.byteLength,E=Math.min(d.missing,C),w=C-E;d.sample.unit.set(c.subarray(0,E),w),_.samples.push(d.sample),g=d.missing}var B,W;for(B=g,W=c.length;B1;){var C=new Uint8Array(c[0].length+c[1].length);C.set(c[0]),C.set(c[1],c[0].length),c[0]=C,c.splice(1,1)}R=c[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&&(_=(R[9]&14)*536870912+(R[10]&255)*4194304+(R[11]&254)*16384+(R[12]&255)*128+(R[13]&254)/2,w&64?(d=(R[14]&14)*536870912+(R[15]&255)*4194304+(R[16]&254)*16384+(R[17]&255)*128+(R[18]&254)/2,_-d>60*9e4&&(x.logger.warn(Math.round((_-d)/9e4)+"s delta between PTS and DTS, align them"),_=d)):d=_),g=R[8];var B=g+9;if(A.size<=B)return null;A.size-=B;for(var W=new Uint8Array(A.size),T=0,k=c.length;Tm){B-=m;continue}else R=R.subarray(B),m-=B,B=0;W.set(R,S),S+=m}return O&&(O-=g+3),{data:W,pts:_,dts:d,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 g=R[O-1];A.pts=g.pts,A.dts=g.dts}else{S.dropped++;return}}S.samples.push(A)}A.debug.length&&x.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_)return c;return 0}},{key:"maxAutoLevel",get:function(){var g=this.levels,_=this.autoLevelCapping,d;return _===-1&&g&&g.length?d=g.length-1:d=_,d}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(g){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,g)}},{key:"audioTracks",get:function(){var g=this.audioTrackController;return g?g.audioTracks:[]}},{key:"audioTrack",get:function(){var g=this.audioTrackController;return g?g.audioTrack:-1},set:function(g){var _=this.audioTrackController;_&&(_.audioTrack=g)}},{key:"subtitleTracks",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var g=this.subtitleTrackController;return g?g.subtitleTrack:-1},set:function(g){var _=this.subtitleTrackController;_&&(_.subtitleTrack=g)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var g=this.subtitleTrackController;return g?g.subtitleDisplay:!1},set:function(g){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=g)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(g){this.config.lowLatencyMode=g}},{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:o.hlsDefaultConfig},set:function(g){S.defaultConfig=g}}]),S}();A.defaultConfig=void 0},"./src/is-supported.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"isSupported",function(){return M}),N.d(Y,"changeTypeSupported",function(){return G});var z=N("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var K=Object(z.getMediaSource)();if(!K)return!1;var n=I(),L=K&&typeof K.isTypeSupported=="function"&&K.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),x=!n||n.prototype&&typeof n.prototype.appendBuffer=="function"&&typeof n.prototype.remove=="function";return!!L&&!!x}function G(){var K,n=I();return typeof(n==null||((K=n.prototype)===null||K===void 0)?void 0:K.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return h}),N.d(Y,"LoadError",function(){return p});var z=N("./src/polyfills/number.ts"),I=N("./src/errors.ts");function M(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,x(l,u)}function G(l){var u=typeof Map=="function"?new Map:void 0;return G=function(i){if(i===null||!L(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}}),x(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),g=new O;return S&&x(g,S.prototype),g},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 L(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function x(l,u){return x=Object.setPrototypeOf||function(i,D){return i.__proto__=D,i},x(l,u)}function f(l){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},f(l)}var b=Math.pow(2,17),h=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:I.ErrorTypes.NETWORK_ERROR,details:I.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,g=R.loader;return new Promise(function(_,d){A.loader&&A.loader.destroy();var c=A.loader=i.loader=O?new O(R):new g(R),C=o(i),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:b};i.stats=c.stats,c.load(C,E,{onSuccess:function(B,W,T,k){A.resetLoader(i,c),_({frag:i,part:null,payload:B.data,networkDetails:k})},onError:function(B,W,T){A.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,response:B,networkDetails:T}))},onAbort:function(B,W,T){A.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,networkDetails:T}))},onTimeout:function(B,W,T){A.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:i,networkDetails:T}))},onProgress:function(B,W,T,k){D&&D({frag:i,part:null,payload:T,networkDetails:k})}})})},u.loadPart=function(i,D,A){var S=this;this.abort();var R=this.config,O=R.fLoader,g=R.loader;return new Promise(function(_,d){S.loader&&S.loader.destroy();var c=S.loader=i.loader=O?new O(R):new g(R),C=o(i,D),E={timeout:R.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:R.fragLoadingMaxRetryTimeout,highWaterMark:b};D.stats=c.stats,c.load(C,E,{onSuccess:function(B,W,T,k){S.resetLoader(i,c),S.updateStatsFromPart(i,D);var m={frag:i,part:D,payload:B.data,networkDetails:k};A(m),_(m)},onError:function(B,W,T){S.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:i,part:D,response:B,networkDetails:T}))},onAbort:function(B,W,T){i.stats.aborted=D.stats.aborted,S.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:i,part:D,networkDetails:T}))},onTimeout:function(B,W,T){S.resetLoader(i,c),d(new p({type:I.ErrorTypes.NETWORK_ERROR,details:I.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),g=Math.min(Math.round(A.loaded/R),O),_=O-g,d=_*Math.round(A.loaded/g);A.total=A.loaded+d}else A.total=Math.max(A.loaded,A.total);var c=A.loading,C=S.loading;c.start?c.first+=C.first-C.start:(c.start=C.start,c.first=C.first),c.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 o(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){M(u,l);function u(s){for(var i,D=arguments.length,A=new Array(D>1?D-1:0),S=1;S>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,g,_){_===void 0&&(_=!1);var d=this.elementaryStreams,c=d[A];if(!c){d[A]={startPTS:S,endPTS:R,startDTS:O,endDTS:g,partial:_};return}c.startPTS=Math.min(c.startPTS,S),c.endPTS=Math.max(c.endPTS,R),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,g)},i.clearElementaryStreamInfo=function(){var A=this.elementaryStreams;A[h.AUDIO]=null,A[h.VIDEO]=null,A[h.AUDIOVIDEO]=null},b(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}(o),l=function(u){L(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 g=i.enumeratedString("BYTERANGE");return g&&O.setByteRange(g,R),R&&(O.fragOffset=R.fragOffset+R.duration),O}return b(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}(o)},"./src/loader/key-loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return G});var z=N("./src/events.ts"),I=N("./src/errors.ts"),M=N("./src/utils/logger.ts"),G=function(){function K(L){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=L,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 x in this.loaders){var f=this.loaders[x];f&&f.destroy()}this.loaders={}},n.onKeyLoading=function(x,f){var b=f.frag,h=b.type,o=this.loaders[h];if(!b.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var p=b.decryptdata.uri;if(p!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(M.logger.warn("abort previous key loader for type:"+h),o.abort()),!p){M.logger.warn("key uri is falsy");return}var u=l.loader,s=b.loader=this.loaders[h]=new u(l);this.decrypturl=p,this.decryptkey=null;var i={url:p,frag:b,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&&(b.decryptdata.key=this.decryptkey,this.hls.trigger(z.Events.KEY_LOADED,{frag:b}))},n.loadsuccess=function(x,f,b){var h=b.frag;if(!h.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(x.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(z.Events.KEY_LOADED,{frag:h})},n.loaderror=function(x,f){var b=f.frag,h=b.loader;h&&h.abort(),delete this.loaders[b.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:b,response:x})},n.loadtimeout=function(x,f){var b=f.frag,h=b.loader;h&&h.abort(),delete this.loaders[b.type],this.hls.trigger(z.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:b})},K}()},"./src/loader/level-details.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"LevelDetails",function(){return K});var z=N("./src/polyfills/number.ts");function I(n,L){for(var x=0;xf.endSN||b>0||b===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},M(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 b=this.driftEnd-this.driftStart;return b*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(ie,Y,N){"use strict";N.r(Y),N.d(Y,"LevelKey",function(){return K});var z=N("./node_modules/url-toolkit/src/url-toolkit.js"),I=N.n(z);function M(n,L){for(var x=0;x2){var d=_.shift()+".";return d+=parseInt(_.shift()).toString(16),d+=("000"+parseInt(_.shift()).toString(16)).substr(-4),d}return g},R.resolve=function(g,_){return I.buildAbsoluteURL(_,g,{alwaysNormalize:!0})},R.parseMasterPlaylist=function(g,_){var d=[],c={},C=!1;b.lastIndex=0;for(var E;(E=b.exec(g))!=null;)if(E[1]){var w=new L.AttrList(E[1]),B={attrs:w,bitrate:w.decimalInteger("AVERAGE-BANDWIDTH")||w.decimalInteger("BANDWIDTH"),name:w.NAME,url:R.resolve(E[2],_)},W=w.decimalResolution("RESOLUTION");W&&(B.width=W.width,B.height=W.height),i((w.CODECS||"").split(/[ ,]+/).filter(function(k){return k}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=R.convertAVC1ToAVCOTI(B.videoCodec)),d.push(B)}else if(E[3]){var T=new L.AttrList(E[3]);T["DATA-ID"]&&(C=!0,c[T["DATA-ID"]]=T)}return{levels:d,sessionData:C?c:null}},R.parseMasterPlaylistMedia=function(g,_,d,c){c===void 0&&(c=[]);var C,E=[],w=0;for(h.lastIndex=0;(C=h.exec(g))!==null;){var B=new L.AttrList(C[1]);if(B.TYPE===d){var W={attrs:B,bitrate:0,id:w++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:d,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?R.resolve(B.URI,_):""};if(c.length){var T=R.findGroup(c,W.groupId)||c[0];D(W,T,"audioCodec"),D(W,T,"textCodec")}E.push(W)}}return E},R.parseLevelPlaylist=function(g,_,d,c,C){var E=new K.LevelDetails(_),w=E.fragments,B=null,W=0,T=0,k=0,m=0,y=null,H=new G.Fragment(c,_),Q,te,ae,Te=-1,_e=!1;for(o.lastIndex=0,E.m3u8=g;(Q=o.exec(g))!==null;){_e&&(_e=!1,H=new G.Fragment(c,_),H.start=k,H.sn=W,H.cc=m,H.level=d,B&&(H.initSegment=B,H.rawProgramDateTime=B.rawProgramDateTime));var ge=Q[1];if(ge){H.duration=parseFloat(ge);var ve=(" "+Q[2]).slice(1);H.title=ve||null,H.tagList.push(ve?["INF",ge,ve]:["INF",ge])}else if(Q[3])Object(z.isFiniteNumber)(H.duration)&&(H.start=k,ae&&(H.levelkey=ae),H.sn=W,H.level=d,H.cc=m,H.urlId=C,w.push(H),H.relurl=(" "+Q[3]).slice(1),S(H,y),y=H,k+=H.duration,W++,T=0,_e=!0);else if(Q[4]){var Oe=(" "+Q[4]).slice(1);y?H.setByteRange(Oe,y):H.setByteRange(Oe)}else if(Q[5])H.rawProgramDateTime=(" "+Q[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),Te===-1&&(Te=w.length);else{if(Q=Q[0].match(p),!Q){x.logger.warn("No matches on slow regex match for level playlist!");continue}for(te=1;te-1){x.logger.warn("Keyformat "+Qe+" is not supported from the manifest");continue}else if(Qe!=="identity")continue;Ke&&(ae=n.LevelKey.fromURL(_,pe),pe&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ke)>=0&&(ae.method=Ke,ae.keyFormat=Qe,Ue&&(ae.keyID=Ue),ke&&(ae.keyFormatVersions=ke),ae.iv=we));break}case"START":{var ot=new L.AttrList(V),qe=ot.decimalFloatingPoint("TIME-OFFSET");Object(z.isFiniteNumber)(qe)&&(E.startTimeOffset=qe);break}case"MAP":{var ft=new L.AttrList(V);H.relurl=ft.URI,ft.BYTERANGE&&H.setByteRange(ft.BYTERANGE),H.level=d,H.sn="initSegment",ae&&(H.levelkey=ae),H.initSegment=null,B=H,_e=!0;break}case"SERVER-CONTROL":{var lt=new L.AttrList(V);E.canBlockReload=lt.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=lt.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&<.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=lt.optionalFloat("PART-HOLD-BACK",0),E.holdBack=lt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var pt=new L.AttrList(V);E.partTarget=pt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ye=E.partList;Ye||(Ye=E.partList=[]);var Tt=T>0?Ye[Ye.length-1]:void 0,bt=T++,me=new G.Part(new L.AttrList(V),H,_,bt,Tt);Ye.push(me),H.duration+=me.duration;break}case"PRELOAD-HINT":{var ne=new L.AttrList(V);E.preloadHint=ne;break}case"RENDITION-REPORT":{var q=new L.AttrList(V);E.renditionReports=E.renditionReports||[],E.renditionReports.push(q);break}default:x.logger.warn("line parsed but not handled: "+Q);break}}}y&&!y.relurl?(w.pop(),k-=y.duration,E.partList&&(E.fragmentHint=y)):E.partList&&(S(H,y),H.cc=m,E.fragmentHint=H);var se=w.length,ue=w[0],oe=w[se-1];if(k+=E.skippedSegments*E.targetduration,k>0&&se&&oe){E.averagetargetduration=k/se;var ce=oe.sn;E.endSN=ce!=="initSegment"?ce:0,ue&&(E.startCC=ue.cc,ue.initSegment||E.fragments.every(function(be){return be.relurl&&u(be.relurl)})&&(x.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new G.Fragment(c,_),H.relurl=oe.relurl,H.level=d,H.sn="initSegment",ue.initSegment=H,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(k+=E.fragmentHint.duration),E.totalduration=k,E.endCC=m,Te>0&&A(w,Te),E},R}();function i(R,O){["video","audio","text"].forEach(function(g){var _=R.filter(function(c){return Object(f.isCodecType)(c,g)});if(_.length){var d=_.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[g+"Codec"]=d.length>0?d[0]:_[0],R=R.filter(function(c){return _.indexOf(c)===-1})}}),O.unknownCodecs=R}function D(R,O,g){var _=O[g];_&&(R[g]=_)}function A(R,O){for(var g=R[O],_=O;_--;){var d=R[_];if(!d)return;d.programDateTime=g.programDateTime-d.duration*1e3,g=d}}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(ie,Y,N){"use strict";N.r(Y);var z=N("./src/polyfills/number.ts"),I=N("./src/events.ts"),M=N("./src/errors.ts"),G=N("./src/utils/logger.ts"),K=N("./src/utils/mp4-tools.ts"),n=N("./src/loader/m3u8-parser.ts"),L=N("./src/types/loader.ts"),x=N("./src/utils/attr-list.ts");function f(o){var p=o.type;switch(p){case L.PlaylistContextType.AUDIO_TRACK:return L.PlaylistLevelType.AUDIO;case L.PlaylistContextType.SUBTITLE_TRACK:return L.PlaylistLevelType.SUBTITLE;default:return L.PlaylistLevelType.MAIN}}function b(o,p){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var h=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=o.prototype;return p.registerListeners=function(){var u=this.hls;u.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),u.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var u=this.hls;u.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),u.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),u.off(I.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:L.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:L.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:L.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:L.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,g;switch(u.type){case L.PlaylistContextType.MANIFEST:S=i.manifestLoadingMaxRetry,R=i.manifestLoadingTimeOut,O=i.manifestLoadingRetryDelay,g=i.manifestLoadingMaxRetryTimeout;break;case L.PlaylistContextType.LEVEL:case L.PlaylistContextType.AUDIO_TRACK:case L.PlaylistContextType.SUBTITLE_TRACK:S=0,R=i.levelLoadingTimeOut;break;default:S=i.levelLoadingMaxRetry,R=i.levelLoadingTimeOut,O=i.levelLoadingRetryDelay,g=i.levelLoadingMaxRetryTimeout;break}if(D=this.createInternalLoader(u),(s=u.deliveryDirectives)!==null&&s!==void 0&&s.part){var _;if(u.type===L.PlaylistContextType.LEVEL&&u.level!==null?_=this.hls.levels[u.level].details:u.type===L.PlaylistContextType.AUDIO_TRACK&&u.id!==null?_=this.hls.audioTracks[u.id].details:u.type===L.PlaylistContextType.SUBTITLE_TRACK&&u.id!==null&&(_=this.hls.subtitleTracks[u.id].details),_){var d=_.partTarget,c=_.targetduration;d&&c&&(R=Math.min(Math.max(d*3,c*.8)*1e3,R))}}var C={timeout:R,maxRetry:S,retryDelay:O,maxRetryDelay:g,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=b(u,i),O=n.default.parseMasterPlaylist(S,R),g=O.levels,_=O.sessionData;if(!g.length){this.handleManifestParsingError(u,i,"no level found in manifest",D);return}var d=g.map(function(W){return{id:W.attrs.AUDIO,audioCodec:W.audioCodec}}),c=g.map(function(W){return{id:W.attrs.SUBTITLES,textCodec:W.textCodec}}),C=n.default.parseMasterPlaylistMedia(S,R,"AUDIO",d),E=n.default.parseMasterPlaylistMedia(S,R,"SUBTITLES",c),w=n.default.parseMasterPlaylistMedia(S,R,"CLOSED-CAPTIONS");if(C.length){var B=C.some(function(W){return!W.url});!B&&g[0].audioCodec&&!g[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 x.AttrList({}),bitrate:0,url:""}))}A.trigger(I.Events.MANIFEST_LOADED,{levels:g,audioTracks:C,subtitles:E,captions:w,url:R,stats:s,networkDetails:D,sessionData:_})},p.handleTrackOrLevelPlaylist=function(u,s,i,D){var A=this.hls,S=i.id,R=i.level,O=i.type,g=b(u,i),_=Object(z.isFiniteNumber)(S)?S:0,d=Object(z.isFiniteNumber)(R)?R:_,c=f(i),C=n.default.parseLevelPlaylist(u.data,g,d,c,_);if(!C.fragments.length){A.trigger(I.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:typeof i.level=="number"?i.level:void 0});return}if(O===L.PlaylistContextType.MANIFEST){var E={attrs:new x.AttrList({}),bitrate:0,details:C,name:"",url:g};A.trigger(I.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:g,stats:s,networkDetails:D,sessionData:null})}if(s.parsing.end=performance.now(),C.needSidxRanges){var w,B=(w=C.fragments[0].initSegment)===null||w===void 0?void 0:w.url;this.load({url:B,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,g=A.fragments[R];g.byteRange.length===0&&g.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),g.initSegment&&g.initSegment.setByteRange(String(i.moovEndOffset)+"@0")})},p.handleManifestParsingError=function(u,s,i,D){this.hls.trigger(I.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:s.type===L.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=M.ErrorDetails.UNKNOWN,S=!1,R=this.getInternalLoader(u);switch(u.type){case L.PlaylistContextType.MANIFEST:A=i?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case L.PlaylistContextType.LEVEL:A=i?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.AUDIO_TRACK:A=i?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case L.PlaylistContextType.SUBTITLE_TRACK:A=i?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}R&&this.resetInternalLoader(u.type);var O={type:M.ErrorTypes.NETWORK_ERROR,details:A,fatal:S,url:u.url,loader:R,context:u,networkDetails:s};D&&(O.response=D),this.hls.trigger(I.Events.ERROR,O)},p.handlePlaylistLoaded=function(u,s,i,D){var A=i.type,S=i.level,R=i.id,O=i.groupId,g=i.loader,_=i.levelDetails,d=i.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(u,i,"invalid target duration",D);return}if(!g)return;_.live&&(g.getCacheAge&&(_.ageHeader=g.getCacheAge()||0),(!g.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(A){case L.PlaylistContextType.MANIFEST:case L.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:_,level:S||0,id:R||0,stats:s,networkDetails:D,deliveryDirectives:d});break;case L.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:_,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:d});break;case L.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:_,id:R||0,groupId:O||"",stats:s,networkDetails:D,deliveryDirectives:d});break}},o}();Y.default=h},"./src/polyfills/number.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"isFiniteNumber",function(){return z}),N.d(Y,"MAX_SAFE_INTEGER",function(){return I});var z=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ie,Y,N){"use strict";N.r(Y);var z=function(){function I(){}return I.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},I}();Y.default=z},"./src/remux/mp4-generator.ts":function(ie,Y,N){"use strict";N.r(Y);var z=Math.pow(2,32)-1,I=function(){function M(){}return M.init=function(){M.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 M.types)M.types.hasOwnProperty(K)&&(M.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]),L=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:n,audio:L};var x=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]);M.STTS=M.STSC=M.STCO=f,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var b=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,b,o,b,h),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,x))},M.box=function(K){for(var n=8,L=arguments.length,x=new Array(L>1?L-1:0),f=1;f>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(K,4),b=0,n=8;b>24&255,K>>16&255,K>>8&255,K&255,L>>24,L>>16&255,L>>8&255,L&255,x>>24,x>>16&255,x>>8&255,x&255,85,196,0,0]))},M.mdia=function(K){return M.box(M.types.mdia,M.mdhd(K.timescale,K.duration),M.hdlr(K.type),M.minf(K))},M.mfhd=function(K){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,K>>24,K>>16&255,K>>8&255,K&255]))},M.minf=function(K){return K.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(K)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(K))},M.moof=function(K,n,L){return M.box(M.types.moof,M.mfhd(K),M.traf(L,n))},M.moov=function(K){for(var n=K.length,L=[];n--;)L[n]=M.trak(K[n]);return M.box.apply(null,[M.types.moov,M.mvhd(K[0].timescale,K[0].duration)].concat(L).concat(M.mvex(K)))},M.mvex=function(K){for(var n=K.length,L=[];n--;)L[n]=M.trex(K[n]);return M.box.apply(null,[M.types.mvex].concat(L))},M.mvhd=function(K,n){n*=K;var L=Math.floor(n/(z+1)),x=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,L>>24,L>>16&255,L>>8&255,L&255,x>>24,x>>16&255,x>>8&255,x&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 M.box(M.types.mvhd,f)},M.sdtp=function(K){var n=K.samples||[],L=new Uint8Array(4+n.length),x,f;for(x=0;x>>8&255),n.push(b&255),n=n.concat(Array.prototype.slice.call(f));for(x=0;x>>8&255),L.push(b&255),L=L.concat(Array.prototype.slice.call(f));var h=M.box(M.types.avcC,new Uint8Array([1,n[3],n[4],n[5],252|3,224|K.sps.length].concat(n).concat([K.pps.length]).concat(L))),o=K.width,p=K.height,l=K.pixelRatio[0],u=K.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,o&255,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]),h,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,u>>24,u>>16&255,u>>8&255,u&255])))},M.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]))},M.mp4a=function(K){var n=K.samplerate;return M.box(M.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]),M.box(M.types.esds,M.esds(K)))},M.mp3=function(K){var n=K.samplerate;return M.box(M.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]))},M.stsd=function(K){return K.type==="audio"?!K.isAAC&&K.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(K)):M.box(M.types.stsd,M.STSD,M.mp4a(K)):M.box(M.types.stsd,M.STSD,M.avc1(K))},M.tkhd=function(K){var n=K.id,L=K.duration*K.timescale,x=K.width,f=K.height,b=Math.floor(L/(z+1)),h=Math.floor(L%(z+1));return M.box(M.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,b>>24,b>>16&255,b>>8&255,b&255,h>>24,h>>16&255,h>>8&255,h&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,x>>8&255,x&255,0,0,f>>8&255,f&255,0,0]))},M.traf=function(K,n){var L=M.sdtp(K),x=K.id,f=Math.floor(n/(z+1)),b=Math.floor(n%(z+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,x>>24,x>>16&255,x>>8&255,x&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,b>>24,b>>16&255,b>>8&255,b&255])),M.trun(K,L.length+16+20+8+16+8+8),L)},M.trak=function(K){return K.duration=K.duration||4294967295,M.box(M.types.trak,M.tkhd(K),M.mdia(K))},M.trex=function(K){var n=K.id;return M.box(M.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]))},M.trun=function(K,n){var L=K.samples||[],x=L.length,f=12+16*x,b=new Uint8Array(f),h,o,p,l,u,s;for(n+=8+f,b.set([0,0,15,1,x>>>24&255,x>>>16&255,x>>>8&255,x&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),h=0;h>>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*h);return M.box(M.types.trun,b)},M.initSegment=function(K){M.types||M.init();var n=M.moov(K),L=new Uint8Array(M.FTYP.byteLength+n.byteLength);return L.set(M.FTYP),L.set(n,M.FTYP.byteLength),L},M}();I.types=void 0,I.HDLR_TYPES=void 0,I.STTS=void 0,I.STSC=void 0,I.STCO=void 0,I.STSZ=void 0,I.VMHD=void 0,I.SMHD=void 0,I.STSD=void 0,I.FTYP=void 0,I.DINF=void 0,Y.default=I},"./src/remux/mp4-remuxer.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return s}),N.d(Y,"normalizePts",function(){return i});var z=N("./src/polyfills/number.ts"),I=N("./src/remux/aac-helper.ts"),M=N("./src/remux/mp4-generator.ts"),G=N("./src/events.ts"),K=N("./src/errors.ts"),n=N("./src/utils/logger.ts"),L=N("./src/types/loader.ts"),x=N("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(R){for(var O=1;O0?C:E.pts},_[0].pts);return d&&n.logger.debug("PTS rollover detected"),c},O.remux=function(_,d,c,C,E,w,B,W){var T,k,m,y,H,Q,te=E,ae=E,Te=_.pid>-1,_e=d.pid>-1,ge=d.samples.length,ve=_.samples.length>0,Oe=ge>1,he=(!Te||ve)&&(!_e||Oe)||this.ISGenerated||B;if(he){this.ISGenerated||(m=this.generateIS(_,d,E));var V=this.isVideoContiguous,P=-1;if(Oe&&(P=D(d.samples),!V&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,P>0){n.logger.warn("[mp4-remuxer]: Dropped "+P+" out of "+ge+" video samples due to a missing keyframe");var j=this.getVideoStartPts(d.samples);d.samples=d.samples.slice(P),d.dropped+=P,ae+=(d.samples[0].pts-j)/(d.timescale||9e4)}else P===-1&&(n.logger.warn("[mp4-remuxer]: No keyframe found out of "+ge+" video samples"),Q=!1);if(this.ISGenerated){if(ve&&Oe){var $=this.getVideoStartPts(d.samples),J=i(_.samples[0].pts,$)-$,X=J/d.inputTimeScale;te+=Math.max(0,X),ae+=Math.max(0,-X)}if(ve){if(_.samplerate||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),m=this.generateIS(_,d,E)),k=this.remuxAudio(_,te,this.isAudioContiguous,w,_e||Oe||W===L.PlaylistLevelType.AUDIO?ae:void 0),Oe){var ye=k?k.endPTS-k.startPTS:0;d.inputTimeScale||(n.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),m=this.generateIS(_,d,E)),T=this.remuxVideo(d,ae,V,ye)}}else Oe&&(T=this.remuxVideo(d,ae,V,0));T&&(T.firstKeyFrame=P,T.independent=P!==-1)}}return this.ISGenerated&&(c.samples.length&&(H=this.remuxID3(c,E)),C.samples.length&&(y=this.remuxText(C,E))),{audio:k,video:T,initSegment:m,independent:Q,text:y,id3:H}},O.generateIS=function(_,d,c){var C=_.samples,E=d.samples,w=this.typeSupported,B={},W=!Object(z.isFiniteNumber)(this._initPTS),T="audio/mp4",k,m,y;if(W&&(k=m=Infinity),_.config&&C.length&&(_.timescale=_.samplerate,_.isAAC||(w.mpeg?(T="audio/mpeg",_.codec=""):w.mp3&&(_.codec="mp3")),B.audio={id:"audio",container:T,codec:_.codec,initSegment:!_.isAAC&&w.mpeg?new Uint8Array(0):M.default.initSegment([_]),metadata:{channelCount:_.channelCount}},W&&(y=_.inputTimeScale,k=m=C[0].pts-Math.round(y*c))),d.sps&&d.pps&&E.length&&(d.timescale=d.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:d.codec,initSegment:M.default.initSegment([d]),metadata:{width:d.width,height:d.height}},W)){y=d.inputTimeScale;var H=this.getVideoStartPts(E),Q=Math.round(y*c);m=Math.min(m,i(E[0].dts,H)-Q),k=Math.min(k,H-Q)}if(Object.keys(B).length)return this.ISGenerated=!0,W&&(this._initPTS=k,this._initDTS=m),{tracks:B,initPTS:k,timescale:y}},O.remuxVideo=function(_,d,c,C){var E=_.inputTimeScale,w=_.samples,B=[],W=w.length,T=this._initPTS,k=this.nextAvcDts,m=8,y,H,Q,te=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,Te=0,_e=!1;if(!c||k===null){var ge=d*E,ve=w[0].pts-i(w[0].dts,w[0].pts);k=ge-ve}for(var Oe=0;Oehe.pts){var V=9e4*.2;Te=Math.max(Math.min(Te,he.pts-he.dts),-1*V)}he.dts0?Oe-1:Oe].dts&&(_e=!0)}_e&&w.sort(function(mn,zt){var Mt=mn.dts-zt.dts,Qn=mn.pts-zt.pts;return Mt||Qn}),H=w[0].dts,Q=w[w.length-1].dts;var P=Math.round((Q-H)/(W-1));if(Te<0){if(TeP,Re=X<-1;if(ye||Re){ye?n.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(X,!0)+" ms ("+X+"dts) hole between fragments detected, filling it"):n.logger.warn("AVC: "+Object(x.toMsFromMpegTsClock)(-X,!0)+" ms ("+X+"dts) overlapping between fragments detected"),H=k;var Ke=w[0].pts-X;w[0].dts=H,w[0].pts=Ke,n.logger.log("Video: First PTS/DTS adjusted: "+Object(x.toMsFromMpegTsClock)(Ke,!0)+"/"+Object(x.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(x.toMsFromMpegTsClock)(X,!0)+" ms")}}u&&(H=Math.max(0,H));for(var pe=0,we=0,ke=0;ke0?Ye-1:Ye].dts;if(ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Se=Math.floor(ce.maxBufferHole*E),Pe=(C?te+C*E:this.nextAudioPts)-Tt.pts;Pe>Se?(y=Pe-be,y<0&&(y=be),n.logger.log("[mp4-remuxer]: It is approximately "+Pe/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=be}else y=be}var We=Math.round(Tt.pts-Tt.dts);B.push(new A(Tt.key,y,me,We))}if(B.length&&p&&p<70){var et=B[0].flags;et.dependsOn=2,et.isNonSync=0}console.assert(y!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=k=Q+y,this.isVideoContiguous=!0;var yt=M.default.moof(_.sequenceNumber++,H,f({},_,{samples:B})),Rt="video",kt={data1:yt,data2:lt,startPTS:te/E,endPTS:(ae+y)/E,startDTS:H/E,endDTS:k/E,type:Rt,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(lt.length,"MDAT length must not be zero"),kt},O.remuxAudio=function(_,d,c,C,E){var w=_.inputTimeScale,B=_.samplerate?_.samplerate:w,W=w/B,T=_.isAAC?h:o,k=T*W,m=this._initPTS,y=!_.isAAC&&this.typeSupported.mpeg,H=[],Q=_.samples,te=y?0:8,ae=this.nextAudioPts||-1,Te=d*w;if(this.isAudioContiguous=c=c||Q.length&&ae>0&&(C&&Math.abs(Te-ae)<9e3||Math.abs(i(Q[0].pts-m,Te)-ae)<20*k),Q.forEach(function(ue){ue.pts=i(ue.pts-m,Te)}),!c||ae<0){if(Q=Q.filter(function(ue){return ue.pts>=0}),!Q.length)return;E===0?ae=0:C?ae=Math.max(0,Te):ae=Q[0].pts}if(_.isAAC)for(var _e=E!==void 0,ge=this.config.maxAudioFramesDrift,ve=0,Oe=ae;ve=ge*k&&j0){we+=te;try{pe=new Uint8Array(we)}catch(ue){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:K.ErrorTypes.MUX_ERROR,details:K.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:we,reason:"fail allocating audio mdat "+we});return}if(!y){var lt=new DataView(pe.buffer);lt.setUint32(0,we),pe.set(M.default.types.mdat,4)}}else return;pe.set(ot,te);var pt=ot.byteLength;te+=pt,H.push(new A(!0,T,pt,0)),Ke=qe}var Ye=H.length;if(!Ye)return;var Tt=H[H.length-1];this.nextAudioPts=ae=Ke+W*Tt.duration;var bt=y?new Uint8Array(0):M.default.moof(_.sequenceNumber++,Re/W,f({},_,{samples:H}));_.samples=[];var me=Re/w,ne=ae/w,q="audio",se={data1:bt,data2:pe,startPTS:me,endPTS:ne,startDTS:me,endDTS:ne,type:q,hasAudio:!0,hasVideo:!1,nb:Ye};return this.isAudioContiguous=!0,console.assert(pe.length,"MDAT length must not be zero"),se},O.remuxEmptyAudio=function(_,d,c,C){var E=_.inputTimeScale,w=_.samplerate?_.samplerate:E,B=E/w,W=this.nextAudioPts,T=(W!==null?W:C.startDTS*E)+this._initDTS,k=C.endDTS*E+this._initDTS,m=B*h,y=Math.ceil((k-T)/m),H=I.default.getSilentFrame(_.manifestCodec||_.codec,_.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 Q=[],te=0;te4294967296;)R+=g;return R}function D(R){for(var O=0;O0?this.lastEndDTS=_:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var d=!!R.audio,c=!!R.video,C="";d&&(C+="audio"),c&&(C+="video");var E={data1:A,startPTS:g,startDTS:g,endPTS:_,endDTS:_,type:C,hasAudio:d,hasVideo:c,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},x}(),n=function(f,b,h){return Object(I.getStartDTS)(f,b)-h};function L(x,f){var b=x==null?void 0:x.codec;return b&&b.length>4?b:b==="hvc1"?"hvc1.1.c.L120.90":b==="av01"?"av01.0.04M.08":b==="avc1"||f===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Y.default=K},"./src/task-loop.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"default",function(){return z});var z=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=I.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(K){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,K),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},I}()},"./src/types/cmcd.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"CMCDVersion",function(){return z}),N.d(Y,"CMCDObjectType",function(){return I}),N.d(Y,"CMCDStreamingFormat",function(){return M}),N.d(Y,"CMCDStreamType",function(){return G});var z=1,I;(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"})(I||(I={}));var M;(function(K){K.DASH="d",K.HLS="h",K.SMOOTH="s",K.OTHER="o"})(M||(M={}));var G;(function(K){K.VOD="v",K.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"HlsSkip",function(){return M}),N.d(Y,"getSkipValue",function(){return G}),N.d(Y,"HlsUrlParameters",function(){return K}),N.d(Y,"Level",function(){return n});function z(L,x){for(var f=0;fNumber.MAX_SAFE_INTEGER?Infinity:x},K.hexadecimalInteger=function(L){if(this[L]){var x=(this[L]||"0x").slice(2);x=(x.length&1?"0":"")+x;for(var f=new Uint8Array(x.length/2),b=0;bNumber.MAX_SAFE_INTEGER?Infinity:x},K.decimalFloatingPoint=function(L){return parseFloat(this[L])},K.optionalFloat=function(L,x){var f=this[L];return f?parseFloat(f):x},K.enumeratedString=function(L){return this[L]},K.bool=function(L){return this[L]==="YES"},K.decimalResolution=function(L){var x=z.exec(this[L]);return x===null?void 0:{width:parseInt(x[1],10),height:parseInt(x[2],10)}},G.parseAttrList=function(L){var x,f={},b='"';for(I.lastIndex=0;(x=I.exec(L))!==null;){var h=x[2];h.indexOf(b)===0&&h.lastIndexOf(b)===h.length-1&&(h=h.slice(1,-1)),f[x[1]]=h}return f},G}()},"./src/utils/binary-search.ts":function(ie,Y,N){"use strict";N.r(Y);var z={search:function(M,G){for(var K=0,n=M.length-1,L=null,x=null;K<=n;){L=(K+n)/2|0,x=M[L];var f=G(x);if(f>0)K=L+1;else if(f<0)n=L-1;else return x}return null}};Y.default=z},"./src/utils/buffer-helper.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"BufferHelper",function(){return M});var z=N("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function G(){}return G.isBuffered=function(n,L){try{if(n){for(var x=G.getBuffered(n),f=0;f=x.start(f)&&L<=x.end(f))return!0}}catch(b){}return!1},G.bufferInfo=function(n,L,x){try{if(n){var f=G.getBuffered(n),b=[],h;for(h=0;ho&&(f[h-1].end=n[b].end):f.push(n[b])}else f.push(n[b])}else f=n;for(var p=0,l,u=L,s=L,i=0;i=D&&L=c&&z.logger.log(this.time+" ["+c+"] "+C)},g}(),p=function(_){for(var d=[],c=0;c<_.length;c++)d.push(_[c].toString(16));return d},l=function(){function g(d,c,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=d||"white",this.underline=c||!1,this.italics=C||!1,this.background=E||"black",this.flash=w||!1}var _=g.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(c){for(var C=["foreground","underline","italics","background","flash"],E=0;EK&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=K)},_.moveCursor=function(c){var C=this.pos+c;if(c>1)for(var E=this.pos+1;E=144&&this.backSpace();var C=M(c);if(this.pos>=K){this.logger.log(h.ERROR,"Cannot insert "+c.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(c){var C;for(C=c;C0&&(c?E="["+C.join(" | ")+"]":E=C.join(` `)),E},_.getTextAndFormat=function(){return this.rows},g}(),D=function(){function g(d,c,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=d,this.outputFilter=c,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 _=g.prototype;return _.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},_.getHandler=function(){return this.outputFilter},_.setHandler=function(c){this.outputFilter=c},_.setPAC=function(c){this.writeScreen.setPAC(c)},_.setBkgData=function(c){this.writeScreen.setBkgData(c)},_.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(h.INFO,"MODE="+c),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=c},_.insertChars=function(c){for(var C=0;C=46,C.italics)C.foreground="white";else{var E=Math.floor(c/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=w[E]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},_.outputDataUpdate=function(c){c===void 0&&(c=!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),c&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},g}(),A=function(){function g(d,c,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new o;this.channels=[null,new D(d,c,E),new D(d+1,C,E)],this.cmdHistory=O(),this.logger=E}var _=g.prototype;return _.getHandler=function(c){return this.channels[c].getHandler()},_.setHandler=function(c,C){this.channels[c].setHandler(C)},_.addData=function(c,C){var E,w,B,W=!1;this.logger.time=c;for(var T=0;T ("+p([w,B])+")"),E=this.parseCmd(w,B),E||(E=this.parseMidrow(w,B)),E||(E=this.parsePAC(w,B)),E||(E=this.parseBackgroundAttributes(w,B)),!E&&(W=this.parseChars(w,B),W)){var k=this.currentChannel;if(k&&k>0){var m=this.channels[k];m.insertChars(W)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!W&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+p([w,B])+" orig: "+p([C[T],C[T+1]]))}},_.parseCmd=function(c,C){var E=this.cmdHistory,w=(c===20||c===28||c===21||c===29)&&C>=32&&C<=47,B=(c===23||c===31)&&C>=33&&C<=35;if(!(w||B))return!1;if(R(c,C,E))return S(null,null,E),this.logger.log(h.DEBUG,"Repeated command ("+p([c,C])+") is dropped"),!0;var W=c===20||c===21||c===23?1:2,T=this.channels[W];return c===20||c===21||c===28||c===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(c,C,E),this.currentChannel=W,!0},_.parseMidrow=function(c,C){var E=0;if((c===17||c===25)&&C>=32&&C<=47){if(c===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[E];return w?(w.ccMIDROW(C),this.logger.log(h.DEBUG,"MIDROW ("+p([c,C])+")"),!0):!1}return!1},_.parsePAC=function(c,C){var E,w=this.cmdHistory,B=(c>=17&&c<=23||c>=25&&c<=31)&&C>=64&&C<=127,W=(c===16||c===24)&&C>=64&&C<=95;if(!(B||W))return!1;if(R(c,C,w))return S(null,null,w),!0;var T=c<=23?1:2;C>=64&&C<=95?E=T===1?n[c]:x[c]:E=T===1?L[c]:f[c];var k=this.channels[T];return k?(k.setPAC(this.interpretPAC(E,C)),S(c,C,w),this.currentChannel=T,!0):!1},_.interpretPAC=function(c,C){var E,w={color:null,italics:!1,indent:null,underline:!1,row:c};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},_.parseChars=function(c,C){var E,w=null,B=null;if(c>=25?(E=2,B=c-8):(E=1,B=c),B>=17&&B<=19){var W;B===17?W=C+80:B===18?W=C+112:W=C+144,this.logger.log(h.INFO,"Special char '"+M(W)+"' in channel "+E),w=[W]}else c>=32&&c<=127&&(w=C===0?[c]:[c,C]);if(w){var T=p(w);this.logger.log(h.DEBUG,"Char codes = "+T.join(",")),S(c,C,this.cmdHistory)}return w},_.parseBackgroundAttributes=function(c,C){var E=(c===16||c===24)&&C>=32&&C<=47,w=(c===23||c===31)&&C>=45&&C<=47;if(!(E||w))return!1;var B,W={};c===16||c===24?(B=Math.floor((C-32)/2),W.background=b[B],C%2===1&&(W.background=W.background+"_semi")):C===45?W.background="transparent":(W.foreground="black",C===47&&(W.underline=!0));var T=c<=23?1:2,k=this.channels[T];return k.setBkgData(W),S(c,C,this.cmdHistory),!0},_.reset=function(){for(var c=0;c=16?u--:u++;var S=Object(z.fixLineBreaks)(s.trim()),R=Object(I.generateCueId)(x,f,S);(!L||!L.cues||!L.cues.getCueById(R))&&(p=new i(x,f,S),p.id=R,p.line=D+1,p.align="left",p.position=10+Math.min(80,Math.floor(u*8/32)*10),h.push(p))}return L&&h.length&&(h.sort(function(O,g){return O.line==="auto"||g.line==="auto"?0:O.line>8&&g.line>8?g.line-O.line:O.line-g.line}),h.forEach(function(O){return Object(M.addCueToTrack)(L,O)})),h}};Y.default=K},"./src/utils/discontinuities.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"findFirstFragWithCC",function(){return G}),N.d(Y,"shouldAlignOnDiscontinuities",function(){return K}),N.d(Y,"findDiscontinuousReferenceFrag",function(){return n}),N.d(Y,"adjustSlidingStart",function(){return x}),N.d(Y,"alignStream",function(){return f}),N.d(Y,"alignPDT",function(){return h}),N.d(Y,"alignFragmentByPDTDelta",function(){return o}),N.d(Y,"alignMediaPlaylistByPDT",function(){return p});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/logger.ts"),M=N("./src/controller/level-helper.ts");function G(l,u){for(var s=null,i=0,D=l.length;is.startCC||l&&l.cc=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},M}();Y.default=I},"./src/utils/ewma.ts":function(ie,Y,N){"use strict";N.r(Y);var z=function(){function I(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 M=I.prototype;return M.sample=function(K,n){var L=Math.pow(this.alpha_,K);this.estimate_=n*(1-L)+L*this.estimate_,this.totalWeight_+=K},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var K=1-Math.pow(this.alpha_,this.totalWeight_);if(K)return this.estimate_/K}return this.estimate_},I}();Y.default=z},"./src/utils/fetch-loader.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"fetchSupported",function(){return o});var z=N("./src/polyfills/number.ts"),I=N("./src/loader/load-stats.ts"),M=N("./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||!x(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,b(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 L()?n=Reflect.construct:n=function(R,O,g){var _=[null];_.push.apply(_,O);var d=Function.bind.apply(R,_),c=new d;return g&&f(c,g.prototype),c},n.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function x(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 b(i){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},b(i)}function h(){return h=Object.assign||function(i){for(var D=1;D=g&&_(R,O,d.flush(),S)):_(R,O,B,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(h({},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(ie,Y,N){"use strict";N.r(Y),N.d(Y,"IMSC1_CODEC",function(){return x}),N.d(Y,"parseIMSC1",function(){return o});var z=N("./src/utils/mp4-tools.ts"),I=N("./src/utils/vttparser.ts"),M=N("./src/utils/vttcue.ts"),G=N("./src/demux/id3.ts"),K=N("./src/utils/timescale-conversion.ts"),n=N("./src/utils/webvtt-parser.ts");function L(){return L=Object.assign||function(g){for(var _=1;_"):z}function K(x){for(var f=arguments.length,b=new Array(f>1?f-1:0),h=1;h>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,g;"data"in D?(R=D.data,O=D.start,g=D.end):(R=D,O=0,g=R.byteLength);for(var _=O;_1?_+d:g;if(c===A[0])if(A.length===1)S.push({data:R,start:_+8,end:C});else{var E=f({data:R,start:_+8,end:C},A.slice(1));E.length&&G.apply(S,E)}_=C}return S}function b(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 g=[],_=O[0],d=_.data[0],c=d===0?8:16,C=L(_,c);c+=4;var E=0,w=0;d===0?c+=8:c+=16,c+=2;var B=_.end+w,W=n(_,c);c+=2;for(var T=0;T>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=L(_,k);k+=4,g.push({referenceSize:y,subsegmentDuration:Q,info:{duration:Q/C,start:B,end:B+y-1}}),B+=y,k+=4,c=k}return{earliestPresentationTime:E,timescale:C,version:d,referencesCount:W,references:g,moovEndOffset:R}}function h(D){for(var A=[],S=f(D,["moov","trak"]),R=0;RK)&&(this.startTime=K),this.endTime=n,this.screen=L,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"sendAddTrackEvent",function(){return I}),N.d(Y,"addCueToTrack",function(){return M}),N.d(Y,"clearCurrentCues",function(){return G}),N.d(Y,"removeCuesInRange",function(){return K}),N.d(Y,"getCuesInRange",function(){return L});var z=N("./src/utils/logger.ts");function I(x,f){var b;try{b=new Event("addtrack")}catch(h){b=document.createEvent("Event"),b.initEvent("addtrack",!1,!1)}b.track=x,f.dispatchEvent(b)}function M(x,f){var b=x.mode;if(b==="disabled"&&(x.mode="hidden"),x.cues&&!x.cues.getCueById(f.id))try{if(x.addCue(f),!x.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(o){z.logger.debug("[texttrack-utils]: "+o);var h=new self.TextTrackCue(f.startTime,f.endTime,f.text);h.id=f.id,x.addCue(h)}b==="disabled"&&(x.mode=b)}function G(x){var f=x.mode;if(f==="disabled"&&(x.mode="hidden"),x.cues)for(var b=x.cues.length;b--;)x.removeCue(x.cues[b]);f==="disabled"&&(x.mode=f)}function K(x,f,b){var h=x.mode;if(h==="disabled"&&(x.mode="hidden"),x.cues&&x.cues.length>0)for(var o=L(x.cues,f,b),p=0;px[b].endTime)return-1;for(var h=0,o=b;h<=o;){var p=Math.floor((o+h)/2);if(fx[p].startTime&&h-1)for(var p=o,l=x.length;p=f&&u.endTime<=b)h.push(u);else if(u.startTime>b)return h}return h}},"./src/utils/time-ranges.ts":function(ie,Y,N){"use strict";N.r(Y);var z={toString:function(M){for(var G="",K=M.length,n=0;n1?f-1:0),h=1;h100)throw new Error("Position must be between 0 and 100.");g=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",n({},o,{get:function(){return _},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");_=w,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",n({},o,{get:function(){return d},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");d=E,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",n({},o,{get:function(){return c},set:function(E){var w=K(E);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");c=w,this.hasBeenReset=!0}})),h.displayState=void 0}return L.prototype.getCueAsHTML=function(){var x=self.WebVTT;return x.convertCueToDOMTree(self,this.text)},L}()},"./src/utils/vttparser.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"parseTimeStamp",function(){return M}),N.d(Y,"fixLineBreaks",function(){return f}),N.d(Y,"VTTParser",function(){return b});var z=N("./src/utils/vttcue.ts"),I=function(){function h(){}var o=h.prototype;return o.decode=function(l,u){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function M(h){function o(l,u,s,i){return(l|0)*3600+(u|0)*60+(s|0)+parseFloat(i||0)}var p=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?o(p[2],p[3],0,p[4]):o(p[1],p[2],p[3],p[4]):null}var G=function(){function h(){this.values=Object.create(null)}var o=h.prototype;return o.set=function(l,u){!this.get(l)&&u!==""&&(this.values[l]=u)},o.get=function(l,u,s){return s?this.has(l)?this.values[l]:u[s]:this.has(l)?this.values[l]:u},o.has=function(l){return l in this.values},o.alt=function(l,u,s){for(var i=0;i=0&&s<=100)return this.set(l,s),!0}return!1},h}();function K(h,o,p,l){var u=l?h.split(l):[h];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];o(D,A)}}var n=new z.default(0,0,""),L=n.align==="middle"?"middle":"center";function x(h,o,p){var l=h;function u(){var D=M(h);if(D===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),D}function s(D,A){var S=new G;K(D,function(g,_){var d;switch(g){case"region":for(var c=p.length-1;c>=0;c--)if(p[c].id===_){S.set(g,p[c].region);break}break;case"vertical":S.alt(g,_,["rl","lr"]);break;case"line":d=_.split(","),S.integer(g,d[0]),S.percent(g,d[0])&&S.set("snapToLines",!1),S.alt(g,d[0],["auto"]),d.length===2&&S.alt("lineAlign",d[1],["start",L,"end"]);break;case"position":d=_.split(","),S.percent(g,d[0]),d.length===2&&S.alt("positionAlign",d[1],["start",L,"end","line-left","line-right","auto"]);break;case"size":S.percent(g,_);break;case"align":S.alt(g,_,["start",L,"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",L);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(){h=h.replace(/^\s+/,"")}if(i(),o.startTime=u(),i(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),i(),o.endTime=u(),i(),s(h,o)}function f(h){return h.replace(//gi,` `)}var b=function(){function h(){this.state="INITIAL",this.buffer="",this.decoder=new I,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=h.prototype;return o.parse=function(l){var u=this;l&&(u.buffer+=u.decoder.decode(l,{stream:!0}));function s(){var O=u.buffer,g=0;for(O=f(O);g")===-1){u.cue.id=D;continue}case"CUE":if(!u.cue){u.state="BADCUE";continue}try{x(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},o.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},h}()},"./src/utils/webvtt-parser.ts":function(ie,Y,N){"use strict";N.r(Y),N.d(Y,"generateCueId",function(){return b}),N.d(Y,"parseWebVTT",function(){return o});var z=N("./src/polyfills/number.ts"),I=N("./src/utils/vttparser.ts"),M=N("./src/demux/id3.ts"),G=N("./src/utils/timescale-conversion.ts"),K=N("./src/remux/mp4-remuxer.ts"),n=/\r\n|\n\r|\n|\r/g,L=function(l,u,s){return s===void 0&&(s=0),l.substr(s,u.length)===u},x=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 b(p,l,u){return f(p.toString())+f(l.toString())+f(u)}var h=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 o(p,l,u,s,i,D,A,S){var R=new I.VTTParser,O=Object(M.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(n,` `).split(` `),g=[],_=Object(G.toMpegTsClockFromTimescale)(l,u),d="00:00.000",c=0,C=0,E,w=!0,B=!1;R.oncue=function(W){var T=s[i],k=s.ccOffset,m=(c-_)/9e4;if(T!=null&&T.new&&(C!==void 0?k=s.ccOffset=T.start:h(s,i,m)),m&&(k=m-s.presentationOffset),B){var y=W.endTime-W.startTime,H=Object(K.normalizePts)((W.startTime+k-C)*9e4,D*9e4)/9e4;W.startTime=H,W.endTime=H+y}var Q=W.text.trim();W.text=decodeURIComponent(encodeURIComponent(Q)),W.id||(W.id=b(W.startTime,W.endTime,Q)),W.endTime>0&&g.push(W)},R.onparsingerror=function(W){E=W},R.onflush=function(){if(E){S(E);return}A(g)},O.forEach(function(W){if(w)if(L(W,"X-TIMESTAMP-MAP=")){w=!1,B=!0,W.substr(16).split(",").forEach(function(T){L(T,"LOCAL:")?d=T.substr(6):L(T,"MPEGTS:")&&(c=parseInt(T.substr(7)))});try{C=x(d)/1e3}catch(T){B=!1,E=T}return}else W===""&&(w=!1);R.parse(W+` `)}),R.flush()}},"./src/utils/xhr-loader.ts":function(ie,Y,N){"use strict";N.r(Y);var z=N("./src/utils/logger.ts"),I=N("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,G=function(){function K(L){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=L?L.xhrSetup:null,this.stats=new I.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 x=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),x&&(x.onreadystatechange=null,x.onprogress=null,x.readyState!==4&&(this.stats.aborted=!0,x.abort()))},n.abort=function(){var x;this.abortInternal(),(x=this.callbacks)!==null&&x!==void 0&&x.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(x,f,b){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=x,this.config=f,this.callbacks=b,this.retryDelay=f.retryDelay,this.loadInternal()},n.loadInternal=function(){var x=this.config,f=this.context;if(!x)return;var b=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var o=this.xhrSetup;try{if(o)try{o(b,f.url)}catch(u){b.open("GET",f.url,!0),o(b,f.url)}b.readyState||b.open("GET",f.url,!0);var p=this.context.headers;if(p)for(var l in p)b.setRequestHeader(l,p[l])}catch(u){this.callbacks.onError({code:b.status,text:u.message},f,b);return}f.rangeEnd&&b.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),b.onreadystatechange=this.readystatechange.bind(this),b.onprogress=this.loadprogress.bind(this),b.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),x.timeout),b.send()},n.readystatechange=function(){var x=this.context,f=this.loader,b=this.stats;if(!x||!f)return;var h=f.readyState,o=this.config;if(b.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),b.loading.first===0&&(b.loading.first=Math.max(self.performance.now(),b.loading.start)),h===4){f.onreadystatechange=null,f.onprogress=null;var p=f.status;if(p>=200&&p<300){b.loading.end=Math.max(self.performance.now(),b.loading.first);var l,u;if(x.responseType==="arraybuffer"?(l=f.response,u=l.byteLength):(l=f.responseText,u=l.length),b.loaded=b.total=u,!this.callbacks)return;var s=this.callbacks.onProgress;if(s&&s(b,x,l,f),!this.callbacks)return;var i={url:f.responseURL,data:l};this.callbacks.onSuccess(i,b,x,f)}else b.retry>=o.maxRetry||p>=400&&p<499?(z.logger.error(p+" while loading "+x.url),this.callbacks.onError({code:p,text:f.statusText},x,f)):(z.logger.warn(p+" while loading "+x.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),b.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},n.loadtimeout=function(){z.logger.warn("timeout while loading "+this.context.url);var x=this.callbacks;x&&(this.abortInternal(),x.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(x){var f=this.stats;f.loaded=x.loaded,x.lengthComputable&&(f.total=x.total)},n.getCacheAge=function(){var x=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");x=f?parseFloat(f):null}return x},K}();Y.default=G}}).default})},vHTk:function(it,Ee,U){it.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(it,Ee,U){"use strict";var ie=U("+L6B"),Y=U("2/Rp"),N=U("5NDa"),z=U("5rEg"),I=U("y8nQ"),M=U("Vl3Y"),G=U("tJVT"),K=U("q1tI"),n=U.n(K),L=U("a+yL"),x=U.n(L),f=function(h){var o=h.value,p=h.onChange,l=M.a.useForm(),u=Object(G.a)(l,1),s=u[0];Object(K.useEffect)(function(){o&&s.setFieldsValue(o)},o);var i=function(A){p(A)};return n.a.createElement("div",{className:x.a.search},n.a.createElement(M.a,{className:x.a.formWrap,colon:!1,form:s,size:"large",layout:"inline",onFinish:i},n.a.createElement(M.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},n.a.createElement(z.a,{style:{width:280,height:40}})),n.a.createElement(M.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(M.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:x.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};Ee.a=f},wNkr:function(it,Ee){it.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(it,Ee){it.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(it,Ee,U){it.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(it,Ee,U){it.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);