(window.webpackJsonp=window.webpackJsonp||[]).push([[210,5,7,8,13],{"+NIl":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";de.defineMode("stex",function(Z,M){"use strict";function V(h,r){h.cmdState.push(r)}function I(h){return h.cmdState.length>0?h.cmdState[h.cmdState.length-1]:null}function B(h){var r=h.cmdState.pop();r&&r.closeBracket()}function K(h){for(var r=h.cmdState,d=r.length-1;d>=0;d--){var l=r[d];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function W(h,r,d){return function(){this.name=h,this.bracketNo=0,this.style=r,this.styles=d,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var L={};L.importmodule=W("importmodule","tag",["string","builtin"]),L.documentclass=W("documentclass","tag",["","atom"]),L.usepackage=W("usepackage","tag",["atom"]),L.begin=W("begin","tag",["atom"]),L.end=W("end","tag",["atom"]),L.label=W("label","tag",["atom"]),L.ref=W("ref","tag",["atom"]),L.eqref=W("eqref","tag",["atom"]),L.cite=W("cite","tag",["atom"]),L.bibitem=W("bibitem","tag",["atom"]),L.Bibitem=W("Bibitem","tag",["atom"]),L.RBibitem=W("RBibitem","tag",["atom"]),L.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(h,r){h.f=r}function b(h,r){var d;if(h.match(/^\\[a-zA-Z@]+/)){var l=h.current().slice(1);return d=L.hasOwnProperty(l)?L[l]:L.DEFAULT,d=new d,V(r,d),P(r,_),d.style}if(h.match(/^\\[$&%#{}_]/))return"tag";if(h.match(/^\\[,;!\/\\]/))return"tag";if(h.match("\\["))return P(r,function(u,c){return p(u,c,"\\]")}),"keyword";if(h.match("\\("))return P(r,function(u,c){return p(u,c,"\\)")}),"keyword";if(h.match("$$"))return P(r,function(u,c){return p(u,c,"$$")}),"keyword";if(h.match("$"))return P(r,function(u,c){return p(u,c,"$")}),"keyword";var a=h.next();if(a=="%")return h.skipToEnd(),"comment";if(a=="}"||a=="]"){if(d=I(r),d)d.closeBracket(a),P(r,_);else return"error";return"bracket"}else return a=="{"||a=="["?(d=L.DEFAULT,d=new d,V(r,d),"bracket"):/\d/.test(a)?(h.eatWhile(/[\w.%]/),"atom"):(h.eatWhile(/[\w\-_]/),d=K(r),d.name=="begin"&&(d.argument=h.current()),d.styleIdentifier())}function p(h,r,d){if(h.eatSpace())return null;if(d&&h.match(d))return P(r,b),"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 _(h,r){var d=h.peek(),l;return d=="{"||d=="["?(l=I(r),l.openBracket(d),h.eat(d),P(r,b),"bracket"):/[ \t\r]/.test(d)?(h.eat(d),null):(P(r,b),B(r),b(h,r))}return{startState:function(){var h=M.inMathMode?function(r,d){return p(r,d)}:b;return{cmdState:[],f:h}},copyState:function(h){return{cmdState:h.cmdState.slice(),f:h.f}},token:function(h,r){return r.f(h,r)},blankLine:function(h){h.f=b,h.cmdState.length=0},lineComment:"%"}}),de.defineMIME("text/x-stex","stex"),de.defineMIME("text/x-latex","stex")})},"+ua5":function(ft,Xe,G){},"+vTd":function(ft,Xe,G){ft.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(ft,Xe,G){ft.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"}},"19Vz":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){de.defineOption("placeholder","",function(W,L,P){var b=P&&P!=de.Init;if(L&&!b)W.on("blur",I),W.on("change",B),W.on("swapDoc",B),de.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){V(W)}),B(W);else if(!L&&b){W.off("blur",I),W.off("change",B),W.off("swapDoc",B),de.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Z(W);var p=W.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}L&&!W.hasFocus()&&I(W)});function Z(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function M(W){Z(W);var L=W.state.placeholder=document.createElement("pre");L.style.cssText="height: 0; overflow: visible",L.style.direction=W.getOption("direction"),L.className="CodeMirror-placeholder CodeMirror-line-like";var P=W.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),L.appendChild(P),W.display.lineSpace.insertBefore(L,W.display.lineSpace.firstChild)}function V(W){setTimeout(function(){var L=!1,P=W.getInputField();P.nodeName=="TEXTAREA"?L=!P.value:W.lineCount()==1&&(L=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),L?M(W):Z(W)},20)}function I(W){K(W)&&M(W)}function B(W){var L=W.getWrapperElement(),P=K(W);L.className=L.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?M(W):Z(W)}function K(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1ZF9":function(ft,Xe,G){ft.exports=G.p+"static/Authorize.cc9c212f.png"},"1eCo":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";var Z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};de.defineMode("xml",function(V,I){var B=V.indentUnit,K={},W=I.htmlMode?Z:M;for(var L in W)K[L]=W[L];for(var L in I)K[L]=I[L];var P,b;function p(o,E){function g(U){return E.tokenize=U,U(o,E)}var C=o.next();if(C=="<")return o.eat("!")?o.eat("[")?o.match("CDATA[")?g(r("atom","]]>")):null:o.match("--")?g(r("comment","-->")):o.match("DOCTYPE",!0,!0)?(o.eatWhile(/[\w\._\-]/),g(d(1))):null:o.eat("?")?(o.eatWhile(/[\w\._\-]/),E.tokenize=r("meta","?>"),"meta"):(P=o.eat("/")?"closeTag":"openTag",E.tokenize=_,"tag bracket");if(C=="&"){var N;return o.eat("#")?o.eat("x")?N=o.eatWhile(/[a-fA-F\d]/)&&o.eat(";"):N=o.eatWhile(/[\d]/)&&o.eat(";"):N=o.eatWhile(/[\w\.\-:]/)&&o.eat(";"),N?"atom":"error"}else return o.eatWhile(/[^&<]/),null}p.isInText=!0;function _(o,E){var g=o.next();if(g==">"||g=="/"&&o.eat(">"))return E.tokenize=p,P=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return P="equals",null;if(g=="<"){E.tokenize=p,E.state=c,E.tagName=E.tagStart=null;var C=E.tokenize(o,E);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(g)?(E.tokenize=h(g),E.stringStartCol=o.column(),E.tokenize(o,E)):(o.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(o){var E=function(g,C){for(;!g.eol();)if(g.next()==o){C.tokenize=_;break}return"string"};return E.isInAttribute=!0,E}function r(o,E){return function(g,C){for(;!g.eol();){if(g.match(E)){C.tokenize=p;break}g.next()}return o}}function d(o){return function(E,g){for(var C;(C=E.next())!=null;){if(C=="<")return g.tokenize=d(o+1),g.tokenize(E,g);if(C==">")if(o==1){g.tokenize=p;break}else return g.tokenize=d(o-1),g.tokenize(E,g)}return"meta"}}function l(o,E,g){this.prev=o.context,this.tagName=E,this.indent=o.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(E)||o.context&&o.context.noIndent)&&(this.noIndent=!0)}function a(o){o.context&&(o.context=o.context.prev)}function u(o,E){for(var g;;){if(!o.context)return;if(g=o.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(E))return;a(o)}}function c(o,E,g){return o=="openTag"?(g.tagStart=E.column(),R):o=="closeTag"?O:c}function R(o,E,g){return o=="word"?(g.tagName=E.current(),b="tag",w):K.allowMissingTagName&&o=="endTag"?(b="tag bracket",w(o,E,g)):(b="error",R)}function O(o,E,g){if(o=="word"){var C=E.current();return g.context&&g.context.tagName!=C&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&a(g),g.context&&g.context.tagName==C||K.matchClosing===!1?(b="tag",T):(b="tag error",A)}else return K.allowMissingTagName&&o=="endTag"?(b="tag bracket",T(o,E,g)):(b="error",A)}function T(o,E,g){return o!="endTag"?(b="error",T):(a(g),c)}function A(o,E,g){return b="error",T(o,E,g)}function w(o,E,g){if(o=="word")return b="attribute",m;if(o=="endTag"||o=="selfcloseTag"){var C=g.tagName,N=g.tagStart;return g.tagName=g.tagStart=null,o=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(C)?u(g,C):(u(g,C),g.context=new l(g,C,N==g.indented)),c}return b="error",w}function m(o,E,g){return o=="equals"?v:(K.allowMissing||(b="error"),w(o,E,g))}function v(o,E,g){return o=="string"?s:o=="word"&&K.allowUnquoted?(b="string",w):(b="error",w(o,E,g))}function s(o,E,g){return o=="string"?s:w(o,E,g)}return{startState:function(o){var E={tokenize:p,state:c,indented:o||0,tagName:null,tagStart:null,context:null};return o!=null&&(E.baseIndent=o),E},token:function(o,E){if(!E.tagName&&o.sol()&&(E.indented=o.indentation()),o.eatSpace())return null;P=null;var g=E.tokenize(o,E);return(g||P)&&g!="comment"&&(b=null,E.state=E.state(P||g,o,E),b&&(g=b=="error"?g+" error":b)),g},indent:function(o,E,g){var C=o.context;if(o.tokenize.isInAttribute)return o.tagStart==o.indented?o.stringStartCol+1:o.indented+B;if(C&&C.noIndent)return de.Pass;if(o.tokenize!=_&&o.tokenize!=p)return g?g.match(/^(\s*)/)[0].length:0;if(o.tagName)return K.multilineTagIndentPastTag!==!1?o.tagStart+o.tagName.length+2:o.tagStart+B*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(o){o.state==v&&(o.state=w)},xmlCurrentTag:function(o){return o.tagName?{name:o.tagName,close:o.type=="closeTag"}:null},xmlCurrentContext:function(o){for(var E=[],g=o.context;g;g=g.prev)g.tagName&&E.push(g.tagName);return E.reverse()}}}),de.defineMIME("text/xml","xml"),de.defineMIME("application/xml","xml"),de.mimeModes.hasOwnProperty("text/html")||de.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1vnw":function(ft,Xe,G){ft.exports={list:"list___1dAFk",btns:"btns___1YCLO",name:"name___2XX_F",folderWrapper:"folderWrapper___3sKHr",folderIcon:"folderIcon___Rov4k"}},"55Ip":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return u});var de=G("Ty5D"),Z=G("dI71"),M=G("q1tI"),V=G.n(M),I=G("YS25"),B=G("17x9"),K=G.n(B),W=G("wx14"),L=G("zLVn"),P=G("9R94"),b=function(v){Object(Z.a)(s,v);function s(){for(var E,g=arguments.length,C=new Array(g),N=0;N=0||g.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;v.setState({goInputText:""}),U(v.getValidValue())},v.go=function(g){var C=v.state.goInputText;if(C==="")return;(g.keyCode===h.ENTER||g.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(I.a)(m,[{key:"getValidValue",value:function(){var s=this.state,o=s.goInputText,E=s.current;return!o||isNaN(o)?E:Number(o)}},{key:"getPageSizeOptions",value:function(){var s=this.props,o=s.pageSize,E=s.pageSizeOptions;return E.some(function(g){return g.toString()===o.toString()})?E:E.concat([o.toString()]).sort(function(g,C){var N=isNaN(Number(g))?0:Number(g),U=isNaN(Number(C))?0:Number(C);return N-U})}},{key:"render",value:function(){var s=this,o=this.props,E=o.pageSize,g=o.locale,C=o.rootPrefixCls,N=o.changeSize,U=o.quickGo,j=o.goButton,H=o.selectComponentClass,y=o.buildOptionText,x=o.selectPrefixCls,F=o.disabled,Q=this.state.goInputText,q="".concat(C,"-options"),ie=H,ge=null,fe=null,ue=null;if(!N&&!U)return null;var he=this.getPageSizeOptions();if(N&&ie){var _e=he.map(function(le,ne){return L.a.createElement(ie.Option,{key:ne,value:le.toString()},(y||s.buildOptionText)(le))});ge=L.a.createElement(ie,{disabled:F,prefixCls:x,showSearch:!1,className:"".concat(q,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||he[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ne){return ne.parentNode}},_e)}return U&&(j&&(ue=typeof j=="boolean"?L.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:F,className:"".concat(q,"-quick-jumper-button")},g.jump_to_confirm):L.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),fe=L.a.createElement("div",{className:"".concat(q,"-quick-jumper")},g.jump_to,L.a.createElement("input",{disabled:F,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,ue)),L.a.createElement("li",{className:"".concat(q)},ge,fe)}}]),m}(L.a.Component);r.defaultProps={pageSizeOptions:["10","20","50","100"]};var d=r,l=G("N2Kk");function a(){}function u(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function c(A,w,m){return m}function R(A,w,m){var v=typeof A=="undefined"?w.pageSize:A;return Math.floor((m.total-1)/v)+1}var O=function(A){Object(B.a)(m,A);var w=Object(K.a)(m);function m(v){var s;Object(V.a)(this,m),s=w.call(this,v),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(R(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(N,U){var j=s.props.prefixCls,H=N||L.a.createElement("button",{type:"button","aria-label":U,className:"".concat(j,"-item-link")});return typeof N=="function"&&(H=L.a.createElement(N,Object(M.a)({},s.props))),H},s.savePaginationNode=function(N){s.paginationNode=N},s.isValid=function(N){return u(N)&&N!==s.state.current},s.shouldDisplayQuickJumper=function(){var N=s.props,U=N.showQuickJumper,j=N.pageSize,H=N.total;return H<=j?!1:U},s.handleKeyDown=function(N){(N.keyCode===h.ARROW_UP||N.keyCode===h.ARROW_DOWN)&&N.preventDefault()},s.handleKeyUp=function(N){var U=s.getValidValue(N),j=s.state.currentInputValue;U!==j&&s.setState({currentInputValue:U}),N.keyCode===h.ENTER?s.handleChange(U):N.keyCode===h.ARROW_UP?s.handleChange(U-1):N.keyCode===h.ARROW_DOWN&&s.handleChange(U+1)},s.changePageSize=function(N){var U=s.state.current,j=R(N,s.state,s.props);U=U>j?j:U,j===0&&(U=s.state.current),typeof N=="number"&&("pageSize"in s.props||s.setState({pageSize:N}),"current"in s.props||s.setState({current:U,currentInputValue:U})),s.props.onShowSizeChange(U,N),"onChange"in s.props&&s.props.onChange&&s.props.onChange(U,N)},s.handleChange=function(N){var U=s.props.disabled,j=N;if(s.isValid(j)&&!U){var H=R(void 0,s.state,s.props);j>H?j=H:j<1&&(j=1),"current"in s.props||s.setState({current:j,currentInputValue:j});var y=s.state.pageSize;return s.props.onChange(j,y),j}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current2?j-2:0),y=2;y=E?C=E:C=Number(o),C}},{key:"getShowSizeChanger",value:function(){var s=this.props,o=s.showSizeChanger,E=s.total,g=s.totalBoundaryShowSizeChanger;return typeof o!="undefined"?o:E>g}},{key:"renderPrev",value:function(s){var o=this.props,E=o.prevIcon,g=o.itemRender,C=g(s,"prev",this.getItemIcon(E,"prev page")),N=!this.hasPrev();return Object(W.isValidElement)(C)?Object(W.cloneElement)(C,{disabled:N}):C}},{key:"renderNext",value:function(s){var o=this.props,E=o.nextIcon,g=o.itemRender,C=g(s,"next",this.getItemIcon(E,"next page")),N=!this.hasNext();return Object(W.isValidElement)(C)?Object(W.cloneElement)(C,{disabled:N}):C}},{key:"render",value:function(){var s=this,o=this.props,E=o.prefixCls,g=o.className,C=o.style,N=o.disabled,U=o.hideOnSinglePage,j=o.total,H=o.locale,y=o.showQuickJumper,x=o.showLessItems,F=o.showTitle,Q=o.showTotal,q=o.simple,ie=o.itemRender,ge=o.showPrevNextJumpers,fe=o.jumpPrevIcon,ue=o.jumpNextIcon,he=o.selectComponentClass,_e=o.selectPrefixCls,le=o.pageSizeOptions,ne=this.state,Te=ne.current,Fe=ne.pageSize,Ke=ne.currentInputValue;if(U===!0&&j<=Fe)return null;var Ue=R(void 0,this.state,this.props),He=[],Ne=null,Be=null,Je=null,tt=null,it=null,rt=y&&y.goButton,qe=x?1:2,gt=Te-1>0?Te-1:0,pt=Te+1=qe*2&&Te!==1+2&&(He[0]=Object(W.cloneElement)(He[0],{className:"".concat(E,"-item-after-jump-prev")}),He.unshift(Ne)),Ue-Te>=qe*2&&Te!==Ue-2&&(He[He.length-1]=Object(W.cloneElement)(He[He.length-1],{className:"".concat(E,"-item-before-jump-next")}),He.push(Be)),Mt!==1&&He.unshift(Je),St!==Ue&&He.push(tt)}var be=null;Q&&(be=L.a.createElement("li",{className:"".concat(E,"-total-text")},Q(j,[j===0?0:(Te-1)*Fe+1,Te*Fe>j?j:Te*Fe])));var xe=!this.hasPrev()||!Ue,pe=!this.hasNext()||!Ue;return L.a.createElement("ul",Object(de.a)({className:b()(E,g,Object(Z.a)({},"".concat(E,"-disabled"),N)),style:C,unselectable:"unselectable",ref:this.savePaginationNode},vt),be,L.a.createElement("li",{title:F?H.prev_page:null,onClick:this.prev,tabIndex:xe?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(E,"-prev"),Object(Z.a)({},"".concat(E,"-disabled"),xe)),"aria-disabled":xe},this.renderPrev(gt)),He,L.a.createElement("li",{title:F?H.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(E,"-next"),Object(Z.a)({},"".concat(E,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(pt)),L.a.createElement(d,{disabled:N,locale:H,rootPrefixCls:E,selectComponentClass:he,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Te,pageSize:Fe,pageSizeOptions:le,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:rt}))}}],[{key:"getDerivedStateFromProps",value:function(s,o){var E={};if("current"in s&&(E.current=s.current,s.current!==o.current&&(E.currentInputValue=E.current)),"pageSize"in s&&s.pageSize!==o.pageSize){var g=o.current,C=R(s.pageSize,o,s);g=g>C?C:g,"current"in s||(E.current=g,E.currentInputValue=g),E.pageSize=s.pageSize}return E}}]),m}(L.a.Component);O.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:l.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var T=O},"6UM0":function(ft,Xe,G){var de,Z;(function(){var M;(function(){"use strict";var I=[function(L,P,b){var p=b(1).Beautifier,_=b(5).Options;function h(r,d){var l=new p(r,d);return l.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new _}},function(L,P,b){var p=b(2).Output,_=b(3).Token,h=b(4),r=b(5).Options,d=b(7).Tokenizer,l=b(7).line_starters,a=b(7).positionable_operators,u=b(7).TOKEN;function c(x,F){return F.indexOf(x)!==-1}function R(x){return x.replace(/^\s+/g,"")}function O(x){for(var F={},Q=0;QQ&&(Q=x.line_indent_level));var q={mode:F,parent:x,last_token:x?x.last_token:new _(u.START_BLOCK,""),last_word:x?x.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Q,alignment:0,line_indent_level:x?x.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return q},H.prototype._reset=function(x){var F=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,F),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(o.BlockStatement);var Q=new d(x,this._options);return this._tokens=Q.tokenize(),x},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,F=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=` `,F&&h.lineBreak.test(F||"")&&(Q=F.match(h.lineBreak)[0]));for(var q=this._tokens.next();q;)this.handle_token(q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=q,q=this._tokens.next();return x=this._output.get_code(Q),x},H.prototype.handle_token=function(x,F){x.type===u.START_EXPR?this.handle_start_expr(x):x.type===u.END_EXPR?this.handle_end_expr(x):x.type===u.START_BLOCK?this.handle_start_block(x):x.type===u.END_BLOCK?this.handle_end_block(x):x.type===u.WORD?this.handle_word(x):x.type===u.RESERVED?this.handle_word(x):x.type===u.SEMICOLON?this.handle_semicolon(x):x.type===u.STRING?this.handle_string(x):x.type===u.EQUALS?this.handle_equals(x):x.type===u.OPERATOR?this.handle_operator(x):x.type===u.COMMA?this.handle_comma(x):x.type===u.BLOCK_COMMENT?this.handle_block_comment(x,F):x.type===u.COMMENT?this.handle_comment(x,F):x.type===u.DOT?this.handle_dot(x):x.type===u.EOF?this.handle_eof(x):x.type===u.UNKNOWN?this.handle_unknown(x,F):this.handle_unknown(x,F)},H.prototype.handle_whitespace_and_comments=function(x,F){var Q=x.newlines,q=this._options.keep_array_indentation&&C(this._flags.mode);if(x.comments_before)for(var ie=x.comments_before.next();ie;)this.handle_whitespace_and_comments(ie,F),this.handle_token(ie,F),ie=x.comments_before.next();if(q)for(var ge=0;ge0,F);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,F);for(var fe=1;fe0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===o.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(x){var F=!1;return F=F||A(this._flags.last_token,["var","let","const"])&&x.type===u.WORD,F=F||T(this._flags.last_token,"do"),F=F||!(this._flags.parent.mode===o.ObjectLiteral&&this._flags.mode===o.Statement)&&A(this._flags.last_token,y)&&!x.newlines,F=F||T(this._flags.last_token,"else")&&!(T(x,"if")&&!x.comments_before),F=F||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===o.ForInitializer||this._previous_flags.mode===o.Conditional),F=F||this._flags.last_token.type===u.WORD&&this._flags.mode===o.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==u.WORD&&x.type!==u.RESERVED,F=F||this._flags.mode===o.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),F?(this.set_mode(o.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,A(x,["do","for","if","while"])),!0):!1},H.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var F=o.Expression;if(x.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(F),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}F=o.ArrayLiteral,C(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())),c(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,F=o.ForInitializer):c(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,F=o.Conditional):c(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(c(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===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var q=this._tokens.peek(-4);A(Q,["async","function"])||Q.text==="*"&&A(q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===o.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(q.text==="{"||q.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(x);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&c(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===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(x,x.newlines),this.print_token(x),this.set_mode(F),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.prototype.handle_end_expr=function(x){for(;this._flags.mode===o.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&C(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(x),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===o.Conditional&&(this._previous_flags.mode=o.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},H.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var F=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(o.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(o.BlockStatement):Q&&(c(Q.text,[":",","])&&c(F.type,[u.STRING,u.WORD,u.RESERVED])||c(F.text,["get","set","..."])&&c(Q.type,[u.WORD,u.RESERVED]))?c(this._last_last_text,["class","interface"])&&!c(Q.text,[":",","])?this.set_mode(o.BlockStatement):this.set_mode(o.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(o.BlockStatement):c(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(o.ObjectLiteral):this.set_mode(o.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var q=!F.comments_before&&F.text==="}",ie=q&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ge=0,fe=null;this._flags.inline_frame=!0;do if(ge+=1,fe=this._tokens.peek(ge-1),fe.newlines){this._flags.inline_frame=!1;break}while(fe.type!==u.EOF&&!(fe.type===u.END_BLOCK&&fe.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(ie||this._flags.last_token.type===u.EQUALS||A(this._flags.last_token,w)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(C(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(x),this.indent(),!q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===o.Statement;)this.restore_mode();var F=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!F?this._output.space_before_token=!0:this._options.brace_style==="expand"?F||this.print_newline():F||(C(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},H.prototype.handle_word=function(x){if(x.type===u.RESERVED){if(c(x.text,["set","get"])&&this._flags.mode!==o.ObjectLiteral)x.type=u.WORD;else if(x.text==="import"&&c(this._tokens.peek().text,["(","."]))x.type=u.WORD;else if(c(x.text,["as","from"])&&!this._flags.import_block)x.type=u.WORD;else if(this._flags.mode===o.ObjectLiteral){var F=this._tokens.peek();F.text===":"&&(x.type=u.WORD)}}if(this.start_of_statement(x)?A(this._flags.last_token,["var","let","const"])&&x.type===u.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(T(x,"while")){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&T(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===o.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(x,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x)),T(x,"function")){(c(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(c(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,y)?this._output.space_before_token=!0:T(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||C(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var Q="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":A(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===o.BlockStatement?Q="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&N(this._flags.mode)?Q="SPACE":this._flags.last_token.type===u.STRING?Q="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(c(this._last_last_text,["function","yield"])||this._flags.mode===o.ObjectLiteral&&c(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),A(x,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"),A(x,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===o.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var q=this._output.current_line;q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?A(this._flags.last_token,w)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!A(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(T(x,"if")&&T(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(x,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&C(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===u.WORD||x.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===u.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&T(x,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var F=this._tokens.peek();this._flags.mode===o.Statement&&!(this._flags.if_block&&T(F,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},H.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x):x.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},H.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},H.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)):this._flags.mode===o.ObjectLiteral||this._flags.mode===o.Statement&&this._flags.parent.mode===o.ObjectLiteral?(this._flags.mode===o.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},H.prototype.handle_operator=function(x){var F=x.text==="*"&&(A(this._flags.last_token,["function","yield"])||c(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),Q=c(x.text,["-","+"])&&(c(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||c(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var q=!F;this.handle_whitespace_and_comments(x,q)}if(x.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(this._flags.last_token.type===u.OPERATOR&&c(this._options.operator_position,s)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.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 ie=!0,ge=!0,fe=!1;if(x.text===":"?this._flags.ternary_depth===0?ie=!1:(this._flags.ternary_depth-=1,fe=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!F&&this._options.preserve_newlines&&c(x.text,a)){var ue=x.text===":",he=ue&&fe,_e=ue&&!fe;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!_e,this.print_token(x),(!ue||he)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!ue||he?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case v.preserve_newline:_e||this.allow_wrap_or_preserved_newline(x),ie=!(this._output.just_added_newline()||_e),this._output.space_before_token=ie,this.print_token(x),this._output.space_before_token=!0;return}}if(F){this.allow_wrap_or_preserved_newline(x),ie=!1;var le=this._tokens.peek();ge=le&&c(le.type,[u.WORD,u.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),ie=this._flags.last_token.type===u.START_BLOCK,ge=!1;else if(c(x.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),ie=!1,ge=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var ne=A(this._flags.last_token,w)&&x.newlines;ne&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ne,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(ie=!0),this._flags.last_token.type===u.RESERVED?ie=!0:this._flags.last_token.type===u.END_EXPR?ie=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===u.OPERATOR&&(ie=c(x.text,["--","-","++","+"])&&c(this._flags.last_token.text,["--","-","++","+"]),c(x.text,["+","-"])&&c(this._flags.last_token.text,["--","++"])&&(ge=!0)),(this._flags.mode===o.BlockStatement&&!this._flags.inline_frame||this._flags.mode===o.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||ie,this.print_token(x),this._output.space_before_token=ge},H.prototype.handle_block_comment=function(x,F){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,F),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!h.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,F)},H.prototype.print_block_commment=function(x,F){var Q=g(x.text),q,ie=!1,ge=!1,fe=x.whitespace_before,ue=fe.length;if(this.print_newline(!1,F),this.print_token_line_indentation(x),this._output.add_token(Q[0]),this.print_newline(!1,F),Q.length>1){for(Q=Q.slice(1),ie=U(Q,"*"),ge=j(Q,fe),ie&&(this._flags.alignment=1),q=0;q=0;h--)if(this.__items[h].match(_))return!0;return!1},P.prototype.set_indent=function(_,h){this.is_empty()&&(this.__indent_count=_||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},P.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},P.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},P.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var _=this.__parent.current_line;return _.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),_.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),_.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,_.__items[0]===" "&&(_.__items.splice(0,1),_.__character_count-=1),!0}return!1},P.prototype.is_empty=function(){return this.__items.length===0},P.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},P.prototype.push=function(_){this.__items.push(_);var h=_.lastIndexOf(` `);h!==-1?this.__character_count=_.length-h:this.__character_count+=_.length},P.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},P.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},P.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},P.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},P.prototype.toString=function(){var _="";return this.is_empty()?this.__parent.indent_empty_lines&&(_=this.__parent.get_indent_string(this.__indent_count)):(_=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),_+=this.__items.join("")),_};function b(_,h){this.__cache=[""],this.__indent_size=_.indent_size,this.__indent_string=_.indent_char,_.indent_with_tabs||(this.__indent_string=new Array(_.indent_size+1).join(_.indent_char)),h=h||"",_.indent_level>0&&(h=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}b.prototype.get_indent_size=function(_,h){var r=this.__base_string_length;return h=h||0,_<0&&(r=0),r+=_*this.__indent_size,r+=h,r},b.prototype.get_indent_string=function(_,h){var r=this.__base_string;return h=h||0,_<0&&(_=0,r=""),h+=_*this.__indent_size,this.__ensure_cache(h),r+=this.__cache[h],r},b.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var _=this.__cache.length,h=0,r="";this.__indent_size&&_>=this.__indent_size&&(h=Math.floor(_/this.__indent_size),_-=h*this.__indent_size,r=new Array(h+1).join(this.__indent_string)),_&&(r+=new Array(_+1).join(" ")),this.__cache.push(r)};function p(_,h){this.__indent_cache=new b(_,h),this.raw=!1,this._end_with_newline=_.end_with_newline,this.indent_size=_.indent_size,this.wrap_line_length=_.wrap_line_length,this.indent_empty_lines=_.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new P(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(_,h){return this.__indent_cache.get_indent_string(_,h)},p.prototype.get_indent_size=function(_,h){return this.__indent_cache.get_indent_size(_,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(_){return this.is_empty()||!_&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(_){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 r=this.__lines.join(` `);return _!==` `&&(r=r.replace(/[\n]/g,_)),r},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,h){return _=_||0,h=h||0,this.next_line.set_indent(_,h),this.__lines.length>1?(this.current_line.set_indent(_,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var h=0;h<_.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(_.whitespace_before),this.current_line.push(_.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(_){this.__add_space_before_token(),this.current_line.push(_),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(_){for(var h=this.__lines.length;_1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(_,h){for(var r=this.__lines.length-2;r>=0;){var d=this.__lines[r];if(d.is_empty())break;if(d.item(0).indexOf(_)!==0&&d.item(-1)!==h){this.__lines.splice(r+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},L.exports.Output=p},function(L){function P(b,p,_,h){this.type=b,this.text=p,this.comments_before=null,this.newlines=_||0,this.whitespace_before=h||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=P},function(L,P){var b="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",_="\\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",r="(?:\\\\u[0-9a-fA-F]{4}|["+b+_+"])",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+_+h+"])*";P.identifier=new RegExp(r+d,"g"),P.identifierStart=new RegExp(r),P.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+_+h+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;P.newline=/[\n\r\u2028\u2029]/,P.lineBreak=new RegExp(`\r |`+P.newline.source),P.allLineBreaks=new RegExp(P.lineBreak.source,"g")},function(L,P,b){var p=b(6).Options,_=["before-newline","after-newline","preserve-newline"];function h(r){p.call(this,r,"js");var d=this.raw_options.brace_style||null;d==="expand-strict"?this.raw_options.brace_style="expand":d==="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 a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),m=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";m=m.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),m="\\?\\.(?!\\d) "+m,m=m.replace(/ /g,"|");var v=new RegExp(m),s="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),o=s.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+o.join("|")+")$"),g,C=function(U,j){_.call(this,U,j),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new l(this._input),y=new a(this._input).read_options(this._options);this.__patterns={template:y,identifier:y.starting_with(d.identifier).matching(d.identifierMatch),number:H.matching(O),punct:H.matching(v),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(//),include:H.starting_with(/#include/).until_after(d.lineBreak),shebang:H.starting_with(/#!/).until_after(d.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:y.until(/['\\\n\r\u2028\u2029]/),double_quote:y.until(/["\\\n\r\u2028\u2029]/),template_text:y.until(/[`\\$]/),template_expression:y.until(/[`}\\]/)}};C.prototype=new _,C.prototype._is_comment=function(U){return U.type===c.COMMENT||U.type===c.BLOCK_COMMENT||U.type===c.UNKNOWN},C.prototype._is_opening=function(U){return U.type===c.START_BLOCK||U.type===c.START_EXPR},C.prototype._is_closing=function(U,j){return(U.type===c.END_BLOCK||U.type===c.END_EXPR)&&j&&(U.text==="]"&&j.text==="["||U.text===")"&&j.text==="("||U.text==="}"&&j.text==="{")},C.prototype._reset=function(){g=!1},C.prototype._get_next_token=function(U,j){var H=null;this._readWhitespace();var y=this._input.peek();return y===null?this._create_token(c.EOF,""):(H=H||this._read_non_javascript(y),H=H||this._read_string(y),H=H||this._read_word(U),H=H||this._read_singles(y),H=H||this._read_comment(y),H=H||this._read_regexp(y,U),H=H||this._read_xml(y,U),H=H||this._read_punctuation(),H=H||this._create_token(c.UNKNOWN,this._input.next()),H)},C.prototype._read_word=function(U){var j;if(j=this.__patterns.identifier.read(),j!=="")return j=j.replace(d.allLineBreaks,` `),!(U.type===c.DOT||U.type===c.RESERVED&&(U.text==="set"||U.text==="get"))&&E.test(j)?(j==="in"||j==="of")&&(U.type===c.WORD||U.type===c.STRING)?this._create_token(c.OPERATOR,j):this._create_token(c.RESERVED,j):this._create_token(c.WORD,j);if(j=this.__patterns.number.read(),j!=="")return this._create_token(c.WORD,j)},C.prototype._read_singles=function(U){var j=null;return U==="("||U==="["?j=this._create_token(c.START_EXPR,U):U===")"||U==="]"?j=this._create_token(c.END_EXPR,U):U==="{"?j=this._create_token(c.START_BLOCK,U):U==="}"?j=this._create_token(c.END_BLOCK,U):U===";"?j=this._create_token(c.SEMICOLON,U):U==="."&&A.test(this._input.peek(1))?j=this._create_token(c.DOT,U):U===","&&(j=this._create_token(c.COMMA,U)),j&&this._input.next(),j},C.prototype._read_punctuation=function(){var U=this.__patterns.punct.read();if(U!=="")return U==="="?this._create_token(c.EQUALS,U):U==="?."?this._create_token(c.DOT,U):this._create_token(c.OPERATOR,U)},C.prototype._read_non_javascript=function(U){var j="";if(U==="#"){if(this._is_first_token()&&(j=this.__patterns.shebang.read(),j))return this._create_token(c.UNKNOWN,j.trim()+` `);if(j=this.__patterns.include.read(),j)return this._create_token(c.UNKNOWN,j.trim()+` `);U=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(T)){do U=this._input.next(),H+=U;while(this._input.hasNext()&&U!=="#"&&U!=="=");return U==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(c.WORD,H)}this._input.back()}else if(U==="<"&&this._is_first_token()){if(j=this.__patterns.html_comment_start.read(),j){for(;this._input.hasNext()&&!this._input.testChar(d.newline);)j+=this._input.next();return g=!0,this._create_token(c.COMMENT,j)}}else if(g&&U==="-"&&(j=this.__patterns.html_comment_end.read(),j))return g=!1,this._create_token(c.COMMENT,j);return null},C.prototype._read_comment=function(U){var j=null;if(U==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var y=R.get_directives(H);y&&y.ignore==="start"&&(H+=R.readIgnored(this._input)),H=H.replace(d.allLineBreaks,` `),j=this._create_token(c.BLOCK_COMMENT,H),j.directives=y}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),j=this._create_token(c.COMMENT,H))}return j},C.prototype._read_string=function(U){if(U==="`"||U==="'"||U==='"'){var j=this._input.next();return this.has_char_escapes=!1,U==="`"?j+=this._read_string_recursive("`",!0,"${"):j+=this._read_string_recursive(U),this.has_char_escapes&&this._options.unescape_strings&&(j=N(j)),this._input.peek()===U&&(j+=this._input.next()),j=j.replace(d.allLineBreaks,` `),this._create_token(c.STRING,j)}return null},C.prototype._allow_regexp_or_xml=function(U){return U.type===c.RESERVED&&u(U.text,["return","case","throw","else","do","typeof","yield"])||U.type===c.END_EXPR&&U.text===")"&&U.opened.previous.type===c.RESERVED&&u(U.opened.previous.text,["if","while","for"])||u(U.type,[c.COMMENT,c.START_EXPR,c.START_BLOCK,c.START,c.END_BLOCK,c.OPERATOR,c.EQUALS,c.EOF,c.SEMICOLON,c.COMMA])},C.prototype._read_regexp=function(U,j){if(U==="/"&&this._allow_regexp_or_xml(j)){for(var H=this._input.next(),y=!1,x=!1;this._input.hasNext()&&(y||x||this._input.peek()!==U)&&!this._input.testChar(d.newline);)H+=this._input.peek(),y?y=!1:(y=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===U&&(H+=this._input.next(),H+=this._input.read(d.identifier)),this._create_token(c.STRING,H)}return null},C.prototype._read_xml=function(U,j){if(this._options.e4x&&U==="<"&&this._allow_regexp_or_xml(j)){var H="",y=this.__patterns.xml.read_match();if(y){for(var x=y[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),F=x.indexOf("{")===0,Q=0;y;){var q=!!y[1],ie=y[2],ge=!!y[y.length-1]||ie.slice(0,8)==="![CDATA[";if(!ge&&(ie===x||F&&ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(q?--Q:++Q),H+=y[0],Q<=0)break;y=this.__patterns.xml.read_match()}return y||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(d.allLineBreaks,` `),this._create_token(c.STRING,H)}}return null};function N(U){for(var j="",H=0,y=new p(U),x=null;y.hasNext();)if(x=y.match(/([\s]|[^\\]|\\\\)+/g),x&&(j+=x[0]),y.peek()==="\\"){if(y.next(),y.peek()==="x")x=y.match(/x([0-9A-Fa-f]{2})/g);else if(y.peek()==="u")x=y.match(/u([0-9A-Fa-f]{4})/g);else{j+="\\",y.hasNext()&&(j+=y.next());continue}if(!x)return U;if(H=parseInt(x[1],16),H>126&&H<=255&&x[0].indexOf("x")===0)return U;if(H>=0&&H<32){j+="\\"+x[0];continue}else H===34||H===39||H===92?j+="\\"+String.fromCharCode(H):j+=String.fromCharCode(H)}return j}C.prototype._read_string_recursive=function(U,j,H){var y,x;U==="'"?x=this.__patterns.single_quote:U==='"'?x=this.__patterns.double_quote:U==="`"?x=this.__patterns.template_text:U==="}"&&(x=this.__patterns.template_expression);for(var F=x.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===U||!j&&d.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(y=this._input.peek(),y==="x"||y==="u"?this.has_char_escapes=!0:y==="\r"&&this._input.peek(1)===` `&&this._input.next(),Q+=this._input.next()):H&&(H==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),H===Q&&(U==="`"?Q+=this._read_string_recursive("}",j,"`"):Q+=this._read_string_recursive("`",j,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=x.read(),F+=Q}return F},L.exports.Tokenizer=C,L.exports.TOKEN=c,L.exports.positionable_operators=w.slice(),L.exports.line_starters=s.slice()},function(L){var P=RegExp.prototype.hasOwnProperty("sticky");function b(p){this.__input=p||"",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&&p=0&&_=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},L.exports.InputScanner=b},function(L,P,b){var p=b(8).InputScanner,_=b(3).Token,h=b(10).TokenStream,r=b(11).WhitespacePattern,d={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(a,u){this._input=new p(a),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new h,this._reset();for(var a,u=new _(d.START,""),c=null,R=[],O=new h;u.type!==d.EOF;){for(a=this._get_next_token(u,c);this._is_comment(a);)O.add(a),a=this._get_next_token(u,c);O.isEmpty()||(a.comments_before=O,O=new h),a.parent=c,this._is_opening(a)?(R.push(c),c=a):c&&this._is_closing(a,c)&&(a.opened=c,c.closed=a,c=R.pop(),a.parent=c),a.previous=u,u.next=a,this.__tokens.add(a),u=a}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(a,u){this._readWhitespace();var c=this._input.read(/.+/g);return c?this._create_token(d.RAW,c):this._create_token(d.EOF,"")},l.prototype._is_comment=function(a){return!1},l.prototype._is_opening=function(a){return!1},l.prototype._is_closing=function(a,u){return!1},l.prototype._create_token=function(a,u){var c=new _(a,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=l,L.exports.TOKEN=d},function(L){function P(b){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=b}P.prototype.restart=function(){this.__position=0},P.prototype.isEmpty=function(){return this.__tokens_length===0},P.prototype.hasNext=function(){return this.__position=0&&b/),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 p,h.prototype._create=function(){return new h(this._input,this)},h.prototype._update=function(){this.__set_templated_pattern()},h.prototype.disable=function(r){var d=this._create();return d._disabled[r]=!0,d._update(),d},h.prototype.read_options=function(r){var d=this._create();for(var l in _)d._disabled[l]=r.templating.indexOf(l)===-1;return d._update(),d},h.prototype.exclude=function(r){var d=this._create();return d._excluded[r]=!0,d._update(),d},h.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var d=this._read_template();d;)this._match_pattern?d+=this._input.read(this._match_pattern):d+=this._input.readUntil(this.__template_pattern),r+=d,d=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},h.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},h.prototype._read_template=function(){var r="",d=this._input.peek();if(d==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(r=r||this.__patterns.erb.read())}else d==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},L.exports.TemplatablePattern=h}],B={};function K(L){var P=B[L];if(P!==void 0)return P.exports;var b=B[L]={exports:{}};return I[L](b,b.exports,K),b.exports}var W=K(0);M=W})();var V=M;!(de=[],Z=function(){return{js_beautify:V}}.apply(Xe,de),Z!==void 0&&(ft.exports=Z))})()},"7Cbv":function(ft,Xe,G){"use strict";var de=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function M(){if(!de)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return de(Z)}var V=/^(?:[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(_){return typeof _=="string"&&V.test(_)}for(var B=I,K=[],W=0;W<256;++W)K.push((W+256).toString(16).substr(1));function L(_){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(K[_[h+0]]+K[_[h+1]]+K[_[h+2]]+K[_[h+3]]+"-"+K[_[h+4]]+K[_[h+5]]+"-"+K[_[h+6]]+K[_[h+7]]+"-"+K[_[h+8]]+K[_[h+9]]+"-"+K[_[h+10]]+K[_[h+11]]+K[_[h+12]]+K[_[h+13]]+K[_[h+14]]+K[_[h+15]]).toLowerCase();if(!B(r))throw TypeError("Stringified UUID is invalid");return r}var P=L;function b(_,h,r){_=_||{};var d=_.random||(_.rng||M)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,h){r=r||0;for(var l=0;l<16;++l)h[r+l]=d[l];return h}return P(d)}var p=Xe.a=b},"7ahc":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return R});var de=G("k1fw"),Z=G("0Owb"),M=G("+L6B"),V=G("2/Rp"),I=G("y8nQ"),B=G("Vl3Y"),K=G("tJVT"),W=G("OaEy"),L=G("2fM7"),P=G("q1tI"),b=G.n(P),p=G("VrN/"),_=G.n(p),h=G("p77/"),r=G.n(h),d=G("c5Ni"),l=G.n(d),a=L.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},c={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"]};Xe.b=function(O){var T=O.callback,A=O.onCancel,w=Object(P.useState)("python"),m=Object(K.a)(w,2),v=m[0],s=m[1];function o(g){s(c[g][1])}function E(g){T(g)}return b.a.createElement(B.a,Object(Z.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),b.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},b.a.createElement(L.a,{onChange:o},Object.keys(c).map(function(g){return b.a.createElement(a,{key:g,value:g},c[g][0])}))),b.a.createElement(B.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},b.a.createElement(R,{mode:v})),b.a.createElement("div",{className:"flex-container flex-end"},b.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),b.a.createElement(V.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function R(O){var T=O.value,A=O.onChange,w=O.mode,m=O.options,v=m===void 0?{}:m,s=Object(P.useRef)(),o=Object(P.useState)(),E=Object(K.a)(o,2),g=E[0],C=E[1];return Object(P.useEffect)(function(){if(g){function N(U){var j=U.getValue();A&&A(j)}return g.on("change",N),function(){g.off("change",N)}}},[g,A]),Object(P.useEffect)(function(){g&&g.setOption("mode",w)},[g,w]),Object(P.useEffect)(function(){g&&((T!==g.getValue()||T==="")&&setTimeout(function(){g.setValue(T||" ")},300))},[g,T]),Object(P.useEffect)(function(){if(s.current&&!g){var N=_.a.fromTextArea(s.current,Object(de.a)({mode:w,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));C(N)}},[s.current,g]),b.a.createElement("div",{className:"my-codemirror-container"},b.a.createElement("textarea",{ref:s}))}},"815F":function(ft,Xe,G){"use strict";G.d(Xe,"e",function(){return K}),G.d(Xe,"c",function(){return L}),G.d(Xe,"d",function(){return P}),G.d(Xe,"a",function(){return p}),G.d(Xe,"f",function(){return _}),G.d(Xe,"b",function(){return h});var de=G("KQm4"),Z=G("VTBJ"),M=G("Ff2n"),V=G("Zm9Q"),I=G("Kwbf"),B=G("OZM5");function K(r,d){return r!=null?r:d}function W(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=new Map;function l(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(c){var R=c.key,O=c.children;Object(I.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var T=String(R);Object(I.a)(!d.has(T)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(T)),d.set(T,!0),l(O,"".concat(u).concat(T," > "))})}l(r)}function L(r){function d(l){var a=Object(V.a)(l);return a.map(function(u){if(!Object(B.i)(u))return Object(I.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var c=u.key,R=u.props,O=R.children,T=Object(M.a)(R,["children"]),A=Object(Z.a)({key:c},T),w=d(O);return w.length&&(A.children=w),A}).filter(function(u){return u})}return d(r)}function P(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],l=new Set(d===!0?[]:d),a=[];function u(c){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(O,T){var A=Object(B.h)(R?R.pos:"0",T),w=K(O.key,A),m=Object(Z.a)(Object(Z.a)({},O),{},{parent:R,pos:A,children:null,data:O,isStart:[].concat(Object(de.a)(R?R.isStart:[]),[T===0]),isEnd:[].concat(Object(de.a)(R?R.isEnd:[]),[T===c.length-1])});return a.push(m),d===!0||l.has(w)?m.children=u(O.children||[],m):m.children=[],m})}return u(r),a}function b(r,d,l){var a;l?typeof l=="string"?a=function(R){return R[l]}:typeof l=="function"&&(a=function(R){return l(R)}):a=function(R,O){return K(R.key,O)};function u(c,R,O){var T=c?c.children:r,A=c?Object(B.h)(O.pos,R):"0";if(c){var w=a(c,A),m={node:c,index:R,pos:A,key:w,parentPos:O.node?O.pos:null,level:O.level+1};d(m)}T&&T.forEach(function(v,s){u(v,s,{node:c,pos:A,level:O?O.level+1:-1})})}u(null)}function p(r){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=d.initWrapper,a=d.processEntity,u=d.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,R={},O={},T={posEntities:R,keyEntities:O};return l&&(T=l(T)||T),b(r,function(A){var w=A.node,m=A.index,v=A.pos,s=A.key,o=A.parentPos,E=A.level,g={node:w,index:m,key:s,pos:v,level:E},C=K(s,v);R[v]=g,O[C]=g,g.parent=R[o],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),a&&a(g,T)},c),u&&u(T),T}function _(r,d){var l=d.expandedKeys,a=d.selectedKeys,u=d.loadedKeys,c=d.loadingKeys,R=d.checkedKeys,O=d.halfCheckedKeys,T=d.dragOverNodeKey,A=d.dropPosition,w=d.keyEntities,m=w[r],v={eventKey:r,expanded:l.indexOf(r)!==-1,selected:a.indexOf(r)!==-1,loaded:u.indexOf(r)!==-1,loading:c.indexOf(r)!==-1,checked:R.indexOf(r)!==-1,halfChecked:O.indexOf(r)!==-1,pos:String(m?m.pos:""),dragOver:T===r&&A===0,dragOverGapTop:T===r&&A===-1,dragOverGapBottom:T===r&&A===1};return v}function h(r){var d=r.data,l=r.expanded,a=r.selected,u=r.checked,c=r.loaded,R=r.loading,O=r.halfChecked,T=r.dragOver,A=r.dragOverGapTop,w=r.dragOverGapBottom,m=r.pos,v=r.active,s=Object(Z.a)(Object(Z.a)({},d),{},{expanded:l,selected:a,checked:u,loaded:c,loading:R,halfChecked:O,dragOver:T,dragOverGapTop:A,dragOverGapBottom:w,pos:m,active:v});return"props"in s||Object.defineProperty(s,"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`."),r}}),s}},"8EBN":function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";de.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 Z=0;Z-1&&V.substring(K+1,V.length);if(W)return de.findModeByExtension(W)},de.findModeByName=function(V){V=V.toLowerCase();for(var I=0;I=z.length?te.slice(z.length):te}).join(` `)}var l=[],a=["
    "],u=new h.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){l.length=0,a=["
      "]}var O={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T($,S,D,z){if(S>=$.length||$[S].level<=D)return S;var te=$[S];z.push("
    • "+te.text+""),S++;var Y=[];return S=T($,S,te.level,Y),Y.length>0&&(z.push("
        "),Y.forEach(function(Le){z.push(Le)}),z.push("
      ")),z.push("
    • "),S=T($,S,D,z),S}function A(){return T(l,0,0,a),a.push("
    "),a.join("")}var w={heading:function(S){var D=c.exec(S);if(D)return{type:"heading",raw:D[0],depth:D[1].length,text:D[2]}},fences:function(S){var D=this.rules.block.fences.exec(S);if(D){var z=D[0],te=d(z,D[3]||""),Y=D[2]?D[2].trim():D[2];if(["latex","katex","math"].indexOf(Y)>=0){var Le=s(),ct=te;te=Le,o[Le]={type:"block",expression:ct}}return{type:"code",raw:z,lang:Y,text:te}}}},m=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,s=function(){return"__special_katext_id_".concat(v++,"__")},o={};function E(){return o}function g(){v=0,o={}}function C($){return $=$.replace(m,function(S,D){var z=s();return o[z]={type:"inline",expression:D},z}),$}var N=u.listitem;u.listitem=function($){return N(C($))};var U=u.paragraph;u.paragraph=function($){return U(C($))};var j=u.tablecell;u.tablecell=function($,S){return j(C($),S)},u.code=function($,S,D){var z=(S||"").match(/\S*/)[0];return z?["latex","katex","math"].indexOf(z)>=0?"

    ".concat($,"

    "):'
    ').concat(D?$:Object(r.escape)($,!0),`
    `):'
    '+(D?$:Object(r.escape)($,!0))+"
    "},u.heading=function($,S,D){var z=this.options.headerPrefix+D.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:z,level:S,text:$}),"'+$+""},h.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),h.a.use({tokenizer:w,renderer:u});var H=h.a,y=G("SJMd"),x=G("ulZh"),F=G.n(x),Q=G("m3rI"),q=G("Oy/b"),ie=G("p5ED"),ge=G("ErOA");/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var fe=function($,S){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,z){D.__proto__=z}||function(D,z){for(var te in z)Object.prototype.hasOwnProperty.call(z,te)&&(D[te]=z[te])})($,S)};function ue($,S){function D(){this.constructor=$}fe($,S),$.prototype=S===null?Object.create(S):(D.prototype=S.prototype,new D)}function he($,S,D,z){return new(D||(D=Promise))(function(te,Y){function Le(rn){try{Pt(z.next(rn))}catch(ht){Y(ht)}}function ct(rn){try{Pt(z.throw(rn))}catch(ht){Y(ht)}}function Pt(rn){var ht;rn.done?te(rn.value):(ht=rn.value,ht instanceof D?ht:new D(function(Vt){Vt(ht)})).then(Le,ct)}Pt((z=z.apply($,S||[])).next())})}function _e($,S){var D,z,te,Y,Le={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return Y={next:ct(0),throw:ct(1),return:ct(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function ct(Pt){return function(rn){return function(ht){if(D)throw new TypeError("Generator is already executing.");for(;Le;)try{if(D=1,z&&(te=2&ht[0]?z.return:ht[0]?z.throw||((te=z.return)&&te.call(z),0):z.next)&&!(te=te.call(z,ht[1])).done)return te;switch(z=0,te&&(ht=[2&ht[0],te.value]),ht[0]){case 0:case 1:te=ht;break;case 4:return Le.label++,{value:ht[1],done:!1};case 5:Le.label++,z=ht[1],ht=[0];continue;case 7:ht=Le.ops.pop(),Le.trys.pop();continue;default:if(!(te=Le.trys,(te=te.length>0&&te[te.length-1])||ht[0]!==6&&ht[0]!==2)){Le=0;continue}if(ht[0]===3&&(!te||ht[1]>te[0]&&ht[1]',"select"),this.addActionButton(z,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(z,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(z,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(z,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(z,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(z,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(z,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Y){var Le=document.createElement("div");Le.className=""+D.toolbarButtonStyleClass.name,Le.setAttribute("data-type-name",Y.typeName),Le.innerHTML=Y.icon,Le.addEventListener("click",function(){D.markerToolbarButtonClicked(Le,Y)}),D.buttons.push(Le),D.markerButtons.push(Le)}),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 te=document.createElement("div");te.className=this.toolbarBlockStyleClass.name,te.style.whiteSpace="nowrap",te.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(te),this.addActionButton(te,'',"render"),this.addActionButton(te,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},$.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},$.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},$.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},$.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var D=0;D0&&this.buttonClickListeners.forEach(function(z){return z("marker",D)}),this.markerButtonOverflowBlock.style.display="none"},$.prototype.actionToolbarButtonClicked=function(S,D){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(z){return z("action",D)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},$.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},$.prototype.setActiveMarkerButton=function(S){var D=this.markerButtons.find(function(z){return z.getAttribute("data-type-name")===S});D&&this.setActiveButton(D)},$.prototype.setCurrentMarker=function(S){var D=this;this.currentMarker=S,this.buttons.filter(function(z){return/delete|notes/.test(z.getAttribute("data-action"))}).forEach(function(z){D.currentMarker===void 0?(z.style.fillOpacity="0.4",z.style.pointerEvents="none"):(z.style.fillOpacity="1",z.style.pointerEvents="all")})},$}(),Je=function(){function $(S,D,z,te){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=D,this.uiStyleSettings=z,this.styles=te,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return $.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new Ne("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 Ne("toolbox_colors",` color: `+this.uiStyleSettings.toolboxColor+`; `));var D=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ne("toolbox-button-row",` display: flex; cursor: default; box-sizing: content-box; `)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ne("toolbox-button-row_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`; `)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ne("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 Ne("toolbox-panel-row_colors",` background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`; `)),this.toolboxButtonStyleClass=this.styles.addClass(new Ne("toolbox_button",` display: inline-block; width: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px; height: `+(this.uiStyleSettings.toolbarHeight-2*D)+`px; padding: `+D+`px; box-sizing: content-box; `)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ne("toolbox-button_colors",` fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ne("toolbox-active-button_colors",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`; fill: `+this.uiStyleSettings.toolbarColor+`; `)),this.styles.addRule(new He("."+this.toolboxButtonStyleColorsClass.name+":hover",` background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+` `)),this.styles.addRule(new He("."+this.toolboxButtonStyleClass.name+" svg",` height: `+this.uiStyleSettings.toolbarHeight/2+`px; `))},$.prototype.show=function(S){var D;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((D=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},$.prototype.setPanelButtons=function(S){var D,z,te=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Y){var Le;Y.uiStyleSettings=te.uiStyleSettings;var ct=document.createElement("div");ct.className=te.toolboxButtonStyleClass.name+" "+((Le=te.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Le!==void 0?Le:te.toolboxButtonStyleColorsClass.name),ct.innerHTML=Y.icon,ct.title=Y.title,ct.addEventListener("click",function(){te.panelButtonClick(Y)}),te.panelButtons.push(ct),te.buttonRow.appendChild(ct)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},$.prototype.panelButtonClick=function(S){var D=this,z=-1;if(S!==this.activePanel){z=this.panels.indexOf(S),this.panelRow.innerHTML="";var te=S.getUi();te.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(te),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){D.displayMode==="inline"?D.panelRow.style.display="none":D.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Y,Le){var ct,Pt;Y.className=D.toolboxButtonStyleClass.name+" "+(Le===z?""+((ct=D.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ct!==void 0?ct:D.toolboxActiveButtonStyleColorsClass.name):""+((Pt=D.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pt!==void 0?Pt:D.toolboxButtonStyleColorsClass.name))})},$}(),tt=function($,S){this.title=$,this.icon=S},it=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'')||this;return Le.colors=[],Le.addTransparent=!1,Le.colorBoxes=[],Le.colors=z,Le.currentColor=te,Le.setCurrentColor=Le.setCurrentColor.bind(Le),Le.getColorBox=Le.getColorBox.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.whiteSpace="nowrap",this.colors.forEach(function(te){var Y=D.getColorBox(te);z.appendChild(Y),D.colorBoxes.push(Y)}),z},S.prototype.getColorBox=function(D){var z=this,te=this.uiStyleSettings.toolbarHeight/4,Y=this.uiStyleSettings.toolbarHeight-te,Le=document.createElement("div");Le.style.display="inline-block",Le.style.boxSizing="content-box",Le.style.width=Y-2+"px",Le.style.height=Y-2+"px",Le.style.padding="1px",Le.style.marginRight="2px",Le.style.marginBottom="2px",Le.style.borderWidth="2px",Le.style.borderStyle="solid",Le.style.borderRadius=(Y+2)/2+"px",Le.style.borderColor=D===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Le.addEventListener("click",function(){z.setCurrentColor(D,Le)});var ct=document.createElement("div");return ct.style.display="inline-block",ct.style.width=Y-2+"px",ct.style.height=Y-2+"px",ct.style.backgroundColor=D,ct.style.borderRadius=Y/2+"px",D==="transparent"&&(ct.style.fill=this.uiStyleSettings.toolboxAccentColor,ct.innerHTML=` `),Le.appendChild(ct),Le},S.prototype.setCurrentColor=function(D,z){var te=this;this.currentColor=D,this.colorBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(D)},S}(tt),rt=function(){function $(S,D,z){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=D,this.globalSettings=z,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty($.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),$.prototype.ownsTarget=function(S){return!1},Object.defineProperty($.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),$.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},$.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},$.prototype.pointerDown=function(S,D){},$.prototype.dblClick=function(S,D){},$.prototype.manipulate=function(S){},$.prototype.pointerUp=function(S){this.stateChanged()},$.prototype.dispose=function(){},$.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},$.prototype.getState=function(){return{typeName:$.typeName,state:this.state,notes:this.notes}},$.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},$.prototype.scale=function(S,D){},$.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},$.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},$.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},$.typeName="MarkerBase",$}(),qe=function(){function $(){this.findGripByVisual=this.findGripByVisual.bind(this)}return $.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},$}(),gt=function(){function $(){this.GRIP_SIZE=10,this.visual=ne.createGroup(),this.visual.appendChild(ne.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ne.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},$}(),pt=function(){function $(){}return $.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},$.toSVGMatrix=function(S,D){return S.a=D.a,S.b=D.b,S.c=D.c,S.d=D.d,S.e=D.e,S.f=D.f,S},$}(),vt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.left=0,Y.top=0,Y.width=0,Y.height=0,Y.defaultSize={x:50,y:20},Y.offsetX=0,Y.offsetY=0,Y.rotationAngle=0,Y.CB_DISTANCE=10,Y._suppressMarkerCreateEvent=!1,Y.container.transform.baseVal.appendItem(ne.createTransform()),Y.setupControlBox(),Y}return ue(S,$),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(D){this._visual=D;var z=ne.createTransform();this._visual.transform.baseVal.appendItem(z)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!!(this.controlGrips.findGripByVisual(D)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D))},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.left=D.x,this.top=D.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var te=this.unrotatePoint(D);if(this.manipulationStartX=te.x,this.manipulationStartY=te.y,this.offsetX=te.x-this.left,this.offsetY=te.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(z),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z)){this.activeGrip=this.rotatorGrip;var Y=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Y.x-this.width/2,this.top=Y.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Le=this.container.transform.baseVal.getItem(0);Le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Le,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},S.prototype.pointerUp=function(D){var z=this.state;$.prototype.pointerUp.call(this,D),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(D),this._state="select",z==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(D){this.visual.style.transform="translate("+D.x+"px, "+D.y+"px)"},S.prototype.manipulate=function(D){var z=this.unrotatePoint(D);this.state==="creating"?this.resize(D):this.state==="move"?(this.left=this.manipulationStartLeft+(z.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(z.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(z):this.state==="rotate"&&this.rotate(D)},S.prototype.resize=function(D){var z=this.manipulationStartLeft,te=this.manipulationStartWidth,Y=this.manipulationStartTop,Le=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:z=this.manipulationStartLeft+D.x-this.manipulationStartX,te=this.manipulationStartWidth+this.manipulationStartLeft-z;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:te=this.manipulationStartWidth+D.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Y=this.manipulationStartTop+D.y-this.manipulationStartY,Le=this.manipulationStartHeight+this.manipulationStartTop-Y;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Le=this.manipulationStartHeight+D.y-this.manipulationStartY}te>=0?(this.left=z,this.width=te):(this.left=z+te,this.width=-te),Le>=0?(this.top=Y,this.height=Le):(this.top=Y+Le,this.height=-Le),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(D){if(Math.abs(D.x-this.centerX)>.1){var z=Math.sign(D.x-this.centerX);this.rotationAngle=180*Math.atan((D.y-this.centerY)/(D.x-this.centerX))/Math.PI+90*z,this.applyRotation()}},S.prototype.applyRotation=function(){var D=this.container.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(D,0)},S.prototype.rotatePoint=function(D){if(this.rotationAngle===0)return D;var z=this.container.getCTM(),te=ne.createPoint(D.x,D.y);return{x:(te=te.matrixTransform(z)).x,y:te.y}},S.prototype.unrotatePoint=function(D){if(this.rotationAngle===0)return D;var z=this.container.getCTM();z=z.inverse();var te=ne.createPoint(D.x,D.y);return{x:(te=te.matrixTransform(z)).x,y:te.y}},S.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=ne.createGroup();var D=ne.createTransform();D.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(D),this.container.appendChild(this.controlBox),this.controlRect=ne.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=ne.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 qe,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var D=this.controlBox.transform.baseVal.getItem(0);D.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(D,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},S.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},S.prototype.createGrip=function(){var D=new gt;return D.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(D.visual),D},S.prototype.positionGrips=function(){var D=this.controlGrips.topLeft.GRIP_SIZE,z=-D/2,te=z,Y=(this.width+this.CB_DISTANCE)/2-D/2,Le=(this.height+this.CB_DISTANCE)/2-D/2,ct=this.height+this.CB_DISTANCE-D/2,Pt=this.width+this.CB_DISTANCE-D/2;this.positionGrip(this.controlGrips.topLeft.visual,z,te),this.positionGrip(this.controlGrips.topCenter.visual,Y,te),this.positionGrip(this.controlGrips.topRight.visual,Pt,te),this.positionGrip(this.controlGrips.centerLeft.visual,z,Le),this.positionGrip(this.controlGrips.centerRight.visual,Pt,Le),this.positionGrip(this.controlGrips.bottomLeft.visual,z,ct),this.positionGrip(this.controlGrips.bottomCenter.visual,Y,ct),this.positionGrip(this.controlGrips.bottomRight.visual,Pt,ct),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Y,te-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(D,z,te){var Y=D.transform.baseVal.getItem(0);Y.setTranslate(z,te),D.transform.baseVal.replaceItem(Y,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},$.prototype.getState.call(this))},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.left=z.left,this.top=z.top,this.width=z.width,this.height=z.height,this.rotationAngle=z.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,z.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,z.containerTransformMatrix))},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z);var te=this.rotatePoint({x:this.left,y:this.top}),Y=this.unrotatePoint({x:te.x*D,y:te.y*z});this.left=Y.x,this.top=Y.y,this.width=this.width*D,this.height=this.height*z,this.adjustControlBox()},S}(rt),at=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.fillColor="transparent",Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.opacity=1,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setFillColor=Y.setFillColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.createVisual=Y.createVisual.bind(Y),Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual)},S.prototype.createVisual=function(){this.visual=ne.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},S.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),this.setSize()},S.prototype.setSize=function(){$.prototype.setSize.call(this),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(D){$.prototype.pointerUp.call(this,D),this.setSize()},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(D),this.stateChanged()},S.prototype.setFillColor=function(D){this.fillColor=D,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},$.prototype.getState.call(this))},S.prototype.restoreState=function(D){var z=D;this.fillColor=z.fillColor,this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.opacity=z.opacity,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setSize()},S.title="Rectangle marker",S}(vt),Rt=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'')||this;return Le.widths=[],Le.widthBoxes=[],Le.widths=z,Le.currentWidth=te,Le.setCurrentWidth=Le.setCurrentWidth.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.widths.forEach(function(te){var Y=document.createElement("div");Y.style.display="flex",Y.style.flexGrow="2",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=te===D.currentWidth?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentWidth(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.innerText=te.toString(),Le.style.marginRight="5px",Y.appendChild(Le);var ct=document.createElement("div");ct.style.minHeight="20px",ct.style.flexGrow="2",ct.style.display="flex",ct.style.alignItems="center";var Pt=document.createElement("hr");Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop=te+"px solid "+D.uiStyleSettings.toolboxColor,Pt.style.flexGrow="2",ct.appendChild(Pt),Y.appendChild(ct),D.widthBoxes.push(Y)}),z},S.prototype.setCurrentWidth=function(D,z){var te=this;this.currentWidth=D,this.widthBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(tt),xt=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'')||this;return Le.styles=[],Le.styleBoxes=[],Le.styles=z,Le.currentStyle=te,Le.setCurrentStyle=Le.setCurrentStyle.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",this.styles.forEach(function(te){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/D.styles.length-5+"%",Y.style.borderColor=te===D.currentStyle?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentStyle(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.overflow="hidden";var ct=` `;Le.innerHTML=ct,Y.appendChild(Le),D.styleBoxes.push(Y)}),z},S.prototype.setCurrentStyle=function(D,z){var te=this;this.currentStyle=D,this.styleBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(tt),Tt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.strokePanel=new it("Line color",te.defaultColorSet,te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ue(S,$),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="FrameMarker",S.title="Frame marker",S.icon='',S}(at),Ye=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},Mt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.x1=0,Y.y1=0,Y.x2=0,Y.y2=0,Y.defaultLength=50,Y.manipulationStartX=0,Y.manipulationStartY=0,Y.manipulationStartX1=0,Y.manipulationStartY1=0,Y.manipulationStartX2=0,Y.manipulationStartY2=0,Y.setupControlBox(),Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!!$.prototype.ownsTarget.call(this,D)||!(!this.grip1.ownsTarget(D)&&!this.grip2.ownsTarget(D))},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.manipulationStartX=D.x,this.manipulationStartY=D.y,this.state==="new"&&(this.x1=D.x,this.y1=D.y,this.x2=D.x,this.y2=D.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(z)?this.activeGrip=this.grip1:this.grip2.ownsTarget(z)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(D){var z=this.state;$.prototype.pointerUp.call(this,D),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(D),this._state="select",z==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(D){this.state==="creating"?this.resize(D):this.state==="move"?(this.x1=this.manipulationStartX1+D.x-this.manipulationStartX,this.y1=this.manipulationStartY1+D.y-this.manipulationStartY,this.x2=this.manipulationStartX2+D.x-this.manipulationStartX,this.y2=this.manipulationStartY2+D.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(D)},S.prototype.resize=function(D){switch(this.activeGrip){case this.grip1:this.x1=D.x,this.y1=D.y;break;case this.grip2:case void 0:this.x2=D.x,this.y2=D.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){$.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){$.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=ne.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var D=new gt;return D.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(D.visual),D},S.prototype.positionGrips=function(){var D=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-D/2,this.y1-D/2),this.positionGrip(this.grip2.visual,this.x2-D/2,this.y2-D/2)},S.prototype.positionGrip=function(D,z,te){var Y=D.transform.baseVal.getItem(0);Y.setTranslate(z,te),D.transform.baseVal.replaceItem(Y,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},$.prototype.getState.call(this))},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.x1=z.x1,this.y1=z.y1,this.x2=z.x2,this.y2=z.y2},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.x1=this.x1*D,this.y1=this.y1*z,this.x2=this.x2*D,this.y2=this.y2*z,this.adjustVisual(),this.adjustControlBox()},S}(rt),St=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.strokePanel=new it("Line color",te.defaultColorSet,te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorLine&&D!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorLine=ne.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ne.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),ne.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='',S}(Mt),ze=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'')||this;return Le.fonts=[],Le.fontBoxes=[],Le.fonts=z,Le.currentFont=te,Le.setCurrentFont=Le.setCurrentFont.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.overflow="hidden",z.style.flexGrow="2",this.fonts.forEach(function(te){var Y=document.createElement("div");Y.style.display="inline-block",Y.style.alignItems="center",Y.style.justifyContent="space-between",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.overflow="hidden",Y.style.maxWidth=100/D.fonts.length-5+"%",Y.style.borderColor=te===D.currentFont?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentFont(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.style.display="flex",Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.fontFamily=te,Le.style.overflow="hidden";var ct=document.createElement("div");ct.style.whiteSpace="nowrap",ct.style.overflow="hidden",ct.style.textOverflow="ellipsis",ct.innerHTML="The quick brown fox jumps over the lazy dog",Le.appendChild(ct),Y.appendChild(Le),D.fontBoxes.push(Y)}),z},S.prototype.setCurrentFont=function(D,z){var te=this;this.currentFont=D,this.fontBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(tt),ut=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.color="transparent",Y.padding=5,Y.DEFAULT_TEXT="your text here",Y.text=Y.DEFAULT_TEXT,Y.isMoved=!1,Y.color=te.defaultColor,Y.fontFamily=te.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setColor=Y.setColor.bind(Y),Y.setFont=Y.setFont.bind(Y),Y.renderText=Y.renderText.bind(Y),Y.sizeText=Y.sizeText.bind(Y),Y.textEditDivClicked=Y.textEditDivClicked.bind(Y),Y.showTextEditor=Y.showTextEditor.bind(Y),Y.setSize=Y.setSize.bind(Y),Y.positionTextEditor=Y.positionTextEditor.bind(Y),Y.colorPanel=new it("Color",te.defaultColorSet,te.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.fontFamilyPanel=new ze("Font",te.defaultFontFamilies,te.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y}return ue(S,$),S.prototype.ownsTarget=function(D){if($.prototype.ownsTarget.call(this,D)||D===this.visual||D===this.textElement||D===this.bgRectangle)return!0;var z=!1;return this.textElement.childNodes.forEach(function(te){te===D&&(z=!0)}),z},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.bgRectangle=ne.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ne.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.isMoved=!1,this.pointerDownPoint=D,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(D),this._state="creating")},S.prototype.renderText=function(){var D=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(z){D.textElement.appendChild(ne.createTSpan(z.trim()===""?" ":z.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var D=this.textElement.getBBox(),z=1;if(D.width>0&&D.height>0){var te=(1*this.width-this.width*this.padding*2/100)/D.width,Y=(1*this.height-this.height*this.padding*2/100)/D.height;z=Math.min(te,Y)}return z},S.prototype.getTextPosition=function(D){var z=this.textElement.getBBox(),te=0,Y=0;return z.width>0&&z.height>0&&(te=(this.width-z.width*D)/2,Y=this.height/2-z.height*D/2),{x:te,y:Y}},S.prototype.sizeText=function(){var D=this.textElement.getBBox(),z=this.getTextScale(),te=this.getTextPosition(z);te.y-=D.y*z,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+te.x+"px, "+te.y+"px) scale("+z+", "+z+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(te.x,te.y),this.textElement.transform.baseVal.getItem(1).setScale(z,z))},S.prototype.manipulate=function(D){$.prototype.manipulate.call(this,D),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(D.x-this.pointerDownPoint.x)>5||Math.abs(D.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),this.isMoved=!0,this.setSize(),this.sizeText()},S.prototype.setSize=function(){$.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(D){var z=this.state;z==="creating"&&(this._suppressMarkerCreateEvent=!0),$.prototype.pointerUp.call(this,D),this.setSize(),(z==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var D=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(z){z.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var z=Number.parseFloat(D.textEditor.style.fontSize);D.textEditor.clientWidth>=Number.parseInt(D.textEditor.style.maxWidth)&&z>.9;)z-=.1,D.textEditor.style.fontSize=Math.max(z,.9)+"em"}),this.textEditor.addEventListener("keyup",function(z){z.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(z){if(z.clipboardData){var te=z.clipboardData.getData("text"),Y=window.getSelection();if(!Y.rangeCount)return!1;Y.deleteFromDocument(),Y.getRangeAt(0).insertNode(document.createTextNode(te)),z.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){D.textEditDivClicked(D.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var D=this.getTextScale(),z=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),te=this.textElement.getBBox(),Y={x:te.width*D,y:te.height*D};z.x-=Y.x/2,z.y-=Y.y/2,this.textEditor.style.top=z.y+"px",this.textEditor.style.left=z.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-z.x+"px",this.textEditor.style.fontSize=Math.max(16*D,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(D){this.text=D.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){$.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),$.prototype.deselect.call(this)},S.prototype.dblClick=function(D,z){$.prototype.dblClick.call(this,D,z),this.showTextEditor()},S.prototype.setColor=function(D){this.textElement&&ne.setAttributes(this.textElement,[["fill",D]]),this.color=D,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(D)},S.prototype.setFont=function(D){this.textElement&&ne.setAttributes(this.textElement,[["font-family",D]]),this.fontFamily=D,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){var z=D;this.color=z.color,this.fontFamily=z.fontFamily,this.padding=z.padding,this.text=z.text,this.createVisual(),$.prototype.restoreState.call(this,D),this.setSize()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.icon='',S}(vt),be=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.color="transparent",Y.lineWidth=3,Y.drawing=!1,Y.pixelRatio=1,Y.color=te.defaultColor,Y.lineWidth=te.defaultStrokeWidth,Y.pixelRatio=te.freehandPixelRatio,Y.setColor=Y.setColor.bind(Y),Y.addCanvas=Y.addCanvas.bind(Y),Y.finishCreation=Y.finishCreation.bind(Y),Y.setLineWidth=Y.setLineWidth.bind(Y),Y.colorPanel=new it("Color",te.defaultColorSet,te.defaultColor),Y.colorPanel.onColorChanged=Y.setColor,Y.lineWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.lineWidthPanel.onWidthChanged=Y.setLineWidth,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.drawingImage=ne.createImage(),this.visual.appendChild(this.drawingImage);var D=ne.createTransform();this.visual.transform.baseVal.appendItem(D),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(D.x,D.y),this.drawing=!0):$.prototype.pointerDown.call(this,D,z)},S.prototype.manipulate=function(D){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(D.x,D.y),this.canvasContext.stroke()):$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){$.prototype.resize.call(this,D),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(D){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):$.prototype.pointerUp.call(this,D)},S.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),$.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),$.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var D=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),z=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],te=z[0],Y=z[1],Le=z[2],ct=z[3],Pt=!1,rn=0;rn0&&(Pt=!0,rnct&&(ct=rn),ht>Le&&(Le=ht));if(Pt){this.left=te/this.pixelRatio,this.top=Y/this.pixelRatio,this.width=(Le-te)/this.pixelRatio,this.height=(ct-Y)/this.pixelRatio;var Vt=document.createElement("canvas");Vt.width=Le-te,Vt.height=ct-Y,Vt.getContext("2d").putImageData(this.canvasContext.getImageData(te,Y,Le-te,ct-Y),0,0),this.drawingImgUrl=Vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(D){this.color=D,this.colorChanged(D)},S.prototype.setLineWidth=function(D){this.lineWidth=D},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({drawingImgUrl:this.drawingImgUrl},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){this.createVisual(),$.prototype.restoreState.call(this,D),this.drawingImgUrl=D.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(D,z){$.prototype.scale.call(this,D,z),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.icon='',S}(vt),xe=function($){function S(D,z,te){var Y=$.call(this,D,te||'')||this;return Y.typeBoxes=[],Y.currentType=z,Y.setCurrentType=Y.setCurrentType.bind(Y),Y}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2";for(var te=function(ct){var Pt="both";switch(ct){case 0:Pt="both";break;case 1:Pt="start";break;case 2:Pt="end";break;case 3:Pt="none"}var rn=document.createElement("div");if(rn.style.display="flex",rn.style.flexGrow="2",rn.style.alignItems="center",rn.style.justifyContent="space-between",rn.style.padding="5px",rn.style.borderWidth="2px",rn.style.borderStyle="solid",rn.style.borderColor=Pt===Y.currentType?Y.uiStyleSettings.toolboxAccentColor:"transparent",rn.addEventListener("click",function(){D.setCurrentType(Pt,rn)}),z.appendChild(rn),Pt==="both"||Pt==="start"){var ht=document.createElement("div");ht.style.display="flex",ht.style.alignItems="center",ht.style.minHeight="20px",ht.innerHTML=` `,ht.style.marginLeft="5px",rn.appendChild(ht)}var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.style.flexGrow="2";var hi=document.createElement("hr");if(hi.style.minWidth="20px",hi.style.border="0px",hi.style.borderTop="3px solid "+(Y.uiStyleSettings!==void 0?Y.uiStyleSettings.toolboxColor:"#eeeeee"),hi.style.flexGrow="2",Vt.appendChild(hi),rn.appendChild(Vt),Pt==="both"||Pt==="end"){var Li=document.createElement("div");Li.style.display="flex",Li.style.alignItems="center",Li.style.minHeight="20px",Li.innerHTML=` `,Li.style.marginRight="5px",rn.appendChild(Li)}Y.typeBoxes.push(rn)},Y=this,Le=0;Le<4;Le++)te(Le);return z},S.prototype.setCurrentType=function(D,z){var te=this;this.currentType=D,this.typeBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings!==void 0?te.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(tt),pe=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.arrowType="end",Y.arrowBaseHeight=10,Y.arrowBaseWidth=10,Y.getArrowPoints=Y.getArrowPoints.bind(Y),Y.setArrowType=Y.setArrowType.bind(Y),Y.arrowTypePanel=new xe("Arrow type","end"),Y.arrowTypePanel.onArrowTypeChanged=Y.setArrowType,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.arrow1&&D!==this.arrow2)},S.prototype.getArrowPoints=function(D,z){var te=this.arrowBaseWidth+2*this.strokeWidth,Y=this.arrowBaseHeight+2*this.strokeWidth;return D-te/2+","+(z+Y/2)+" "+D+","+(z-Y/2)+" "+(D+te/2)+","+(z+Y/2)},S.prototype.createTips=function(){this.arrow1=ne.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ne.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if($.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",ne.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ne.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.arrow1.transform.baseVal.getItem(0);z.setRotate(D,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(z,0);var te=this.arrow2.transform.baseVal.getItem(0);te.setRotate(D+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(te,0)}},S.prototype.setArrowType=function(D){this.arrowType=D,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({arrowType:this.arrowType},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.arrowType=z.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='',S}(St),se=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.fillColor=te.defaultFillColor,Y.strokeWidth=0,Y.fillPanel=new it("Color",te.defaultColorSet,te.defaultFillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y}return ue(S,$),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="CoverMarker",S.title="Cover marker",S.icon='',S}(at),ce=function($){function S(D,z,te,Y){var Le=$.call(this,D,Y||'')||this;return Le.opacities=[],Le.opacityBoxes=[],Le.opacities=z,Le.currentOpacity=te,Le.setCurrentOpacity=Le.setCurrentOpacity.bind(Le),Le}return ue(S,$),S.prototype.getUi=function(){var D=this,z=document.createElement("div");return z.style.display="flex",z.style.overflow="hidden",z.style.flexGrow="2",z.style.justifyContent="space-between",this.opacities.forEach(function(te){var Y=document.createElement("div");Y.style.display="flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.padding="5px",Y.style.borderWidth="2px",Y.style.borderStyle="solid",Y.style.borderColor=te===D.currentOpacity?D.uiStyleSettings.toolboxAccentColor:"transparent",Y.addEventListener("click",function(){D.setCurrentOpacity(te,Y)}),z.appendChild(Y);var Le=document.createElement("div");Le.innerText=100*te+"%",Y.appendChild(Le),D.opacityBoxes.push(Y)}),z},S.prototype.setCurrentOpacity=function(D,z){var te=this;this.currentOpacity=D,this.opacityBoxes.forEach(function(Y){Y.style.borderColor=Y===z?te.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(tt),Ee=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.setOpacity=Y.setOpacity.bind(Y),Y.fillColor=te.defaultHighlightColor,Y.strokeWidth=0,Y.opacity=te.defaultHighlightOpacity,Y.fillPanel=new it("Color",te.defaultColorSet,Y.fillColor),Y.fillPanel.onColorChanged=Y.setFillColor,Y.opacityPanel=new ce("Opacity",te.defaultOpacitySteps,Y.opacity),Y.opacityPanel.onOpacityChanged=Y.setOpacity,Y}return ue(S,$),S.prototype.setOpacity=function(D){this.opacity=D,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="HighlightMarker",S.title="Highlight marker",S.icon='',S}(se),Ae='',De=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.bgColor="transparent",Y.tipPosition={x:0,y:0},Y.tipBase1Position={x:0,y:0},Y.tipBase2Position={x:0,y:0},Y.tipMoving=!1,Y.color=te.defaultStrokeColor,Y.bgColor=te.defaultFillColor,Y.fontFamily=te.defaultFontFamily,Y.defaultSize={x:100,y:30},Y.setBgColor=Y.setBgColor.bind(Y),Y.getTipPoints=Y.getTipPoints.bind(Y),Y.positionTip=Y.positionTip.bind(Y),Y.setTipPoints=Y.setTipPoints.bind(Y),Y.colorPanel=new it("Text color",te.defaultColorSet,Y.color,''),Y.colorPanel.onColorChanged=Y.setColor,Y.bgColorPanel=new it("Fill color",te.defaultColorSet,Y.bgColor,Ae),Y.bgColorPanel.onColorChanged=Y.setBgColor,Y.fontFamilyPanel=new ze("Font",te.defaultFontFamilies,te.defaultFontFamily),Y.fontFamilyPanel.onFontChanged=Y.setFont,Y.tipGrip=new gt,Y.tipGrip.visual.transform.baseVal.appendItem(ne.createTransform()),Y.controlBox.appendChild(Y.tipGrip.visual),Y}return ue(S,$),S.prototype.ownsTarget=function(D){return $.prototype.ownsTarget.call(this,D)||this.tipGrip.ownsTarget(D)||this.tip===D},S.prototype.createTip=function(){ne.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ne.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(D,z){this.state==="new"&&$.prototype.pointerDown.call(this,D,z),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(z)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):$.prototype.pointerDown.call(this,D,z)},S.prototype.pointerUp=function(D){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,$.prototype.pointerUp.call(this,D);else{var z=this.state==="creating";$.prototype.pointerUp.call(this,D),this.setTipPoints(z),this.positionTip()}},S.prototype.manipulate=function(D){if(this.tipMoving){var z=this.unrotatePoint(D);this.tipPosition={x:z.x-this.manipulationStartLeft,y:z.y-this.manipulationStartTop},this.positionTip()}else $.prototype.manipulate.call(this,D)},S.prototype.setBgColor=function(D){this.bgRectangle&&this.tip&&(ne.setAttributes(this.bgRectangle,[["fill",D]]),ne.setAttributes(this.tip,[["fill",D]])),this.bgColor=D,this.fillColorChanged(D)},S.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},S.prototype.setTipPoints=function(D){D===void 0&&(D=!1);var z=Math.min(this.height/2,15),te=this.height/5;D&&(this.tipPosition={x:z+te/2,y:this.height+20});var Y=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?Y.1)){var D=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),z=this.tip1.transform.baseVal.getItem(0);z.setRotate(D,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(z,0);var te=this.tip2.transform.baseVal.getItem(0);te.setRotate(D+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(te,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.icon='',S}(St),Bt=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokePanel.colors=te.defaultColorSet,Y.fillColor="transparent",Y}return ue(S,$),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=$.prototype.getState.call(this);return D.typeName=S.typeName,D},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.icon='',S}($e),tn=function(){function $(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),$.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},$.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},$.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},$.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},$.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},$}(),nn=function($){function S(D,z,te){var Y=$.call(this,D,z,te)||this;return Y.strokeColor="transparent",Y.strokeWidth=0,Y.strokeDasharray="",Y.curveX=0,Y.curveY=0,Y.manipulationStartCurveX=0,Y.manipulationStartCurveY=0,Y.setStrokeColor=Y.setStrokeColor.bind(Y),Y.setStrokeWidth=Y.setStrokeWidth.bind(Y),Y.setStrokeDasharray=Y.setStrokeDasharray.bind(Y),Y.positionGrips=Y.positionGrips.bind(Y),Y.addControlGrips=Y.addControlGrips.bind(Y),Y.adjustVisual=Y.adjustVisual.bind(Y),Y.setupControlBox=Y.setupControlBox.bind(Y),Y.resize=Y.resize.bind(Y),Y.strokeColor=te.defaultColor,Y.strokeWidth=te.defaultStrokeWidth,Y.strokeDasharray=te.defaultStrokeDasharray,Y.strokePanel=new it("Line color",te.defaultColorSet,te.defaultColor),Y.strokePanel.onColorChanged=Y.setStrokeColor,Y.strokeWidthPanel=new Rt("Line width",te.defaultStrokeWidths,te.defaultStrokeWidth),Y.strokeWidthPanel.onWidthChanged=Y.setStrokeWidth,Y.strokeStylePanel=new xt("Line style",te.defaultStrokeDasharrays,te.defaultStrokeDasharray),Y.strokeStylePanel.onStyleChanged=Y.setStrokeDasharray,Y}return ue(S,$),S.prototype.ownsTarget=function(D){return!(!$.prototype.ownsTarget.call(this,D)&&D!==this.visual&&D!==this.selectorCurve&&D!==this.visibleCurve&&!this.curveGrip.ownsTarget(D))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorCurve=ne.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ne.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(D,z){$.prototype.pointerDown.call(this,D,z),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=D.x,this.curveY=D.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(z)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ne.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){$.prototype.setupControlBox.call(this),this.curveControlLine1=ne.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ne.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,$.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){$.prototype.positionGrips.call(this);var D=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-D/2,this.curveY-D/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},S.prototype.manipulate=function(D){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+D.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+D.y-this.manipulationStartY),$.prototype.manipulate.call(this,D)},S.prototype.resize=function(D){this.activeGrip===this.curveGrip&&(this.curveX=D.x,this.curveY=D.y),$.prototype.resize.call(this,D),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(D){this.strokeColor=D,this.adjustVisual(),this.colorChanged(D)},S.prototype.setStrokeWidth=function(D){this.strokeWidth=D,this.adjustVisual()},S.prototype.setStrokeDasharray=function(D){this.strokeDasharray=D,this.adjustVisual()},S.prototype.scale=function(D,z){this.curveX=this.curveX*D,this.curveY=this.curveY*z,$.prototype.scale.call(this,D,z)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var D=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},$.prototype.getState.call(this));return D.typeName=S.typeName,D},S.prototype.restoreState=function(D){$.prototype.restoreState.call(this,D);var z=D;this.strokeColor=z.strokeColor,this.strokeWidth=z.strokeWidth,this.strokeDasharray=z.strokeDasharray,this.curveX=z.curveX,this.curveY=z.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.icon='',S}(Mt),_n=function(){function $(S,D){D===void 0&&(D=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=D}return Object.defineProperty($.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),$.prototype.preventDefault=function(){this._defaultPrevented=!0},$}(),yn=function($){function S(D,z,te){var Y=$.call(this,D,!1)||this;return Y.dataUrl=z,Y.state=te,Y}return ue(S,$),S}(_n),Gt=function($){function S(D,z,te){te===void 0&&(te=!1);var Y=$.call(this,D,te)||this;return Y.marker=z,Y}return ue(S,$),S}(_n),ii=function(){function $(){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 $.prototype.addEventListener=function(S,D){this[S].push(D)},$.prototype.removeEventListener=function(S,D){var z=this[S].indexOf(D);z>-1&&this[S].splice(z,1)},$}(),Dn=function(){function $(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ye,this._isOpen=!1,this.undoRedoManager=new tn,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 ii,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=$.instanceCounter++,this.styles=new Ue(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty($.prototype,"ALL_MARKER_TYPES",{get:function(){return[Tt,be,pe,ut,Bt,$e,Ee,De,lt,se,St,nn]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Tt,be,pe,ut,$e,Ee,De]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Tt,be,pe,ut,Ee]},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var D=this;this._availableMarkerTypes.splice(0),S.forEach(function(z){if(typeof z=="string"){var te=D.ALL_MARKER_TYPES.find(function(Y){return Y.typeName===z});te!==void 0&&D._availableMarkerTypes.push(te)}else D._availableMarkerTypes.push(z)})},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),$.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},$.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&Ke.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ke.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(D){return D(new _n(S))})},$.prototype.render=function(){return he(this,void 0,void 0,function(){var S;return _e(this,function(D){switch(D.label){case 0:return this.setCurrentMarker(),(S=new Fe).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return D.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,D.sent()]}})})},$.prototype.close=function(S){var D=this;if(S===void 0&&(S=!1),this.isOpen){var z=!1;S||this.eventListeners.beforeclose.forEach(function(te){var Y=new _n(D,!0);te(Y),Y.defaultPrevented&&(z=!0)}),z||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(te){return te(new _n(D))}),this.detachEvents(),this._isOpen=!1)}},$.prototype.addMarkersToToolbar=function(){for(var S,D=[],z=0;zthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,z=D',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},$.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")},$.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"},$.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},$.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Be(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(S),1),S.dispose()},$.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())},$.prototype.toolbarButtonClicked=function(S,D){if(S==="marker"&&D!==void 0)this.createNewMarker(D);else if(S==="action")switch(D){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()}},$.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0){var D=!1;if(this.eventListeners.markerbeforedelete.forEach(function(te){var Y=new Gt(S,S._currentMarker,!0);te(Y),Y.defaultPrevented&&(D=!0)}),!D){var z=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(te){return te(new Gt(S,z))})}}},$.prototype.clear=function(){var S=this,D=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Le){var ct=new Gt(S,void 0,!0);Le(ct),ct.defaultPrevented&&(D=!0)}),!D)){this.setCurrentMarker();for(var z=function(Le){var ct=te.markers[Le];te.setCurrentMarker(te.markers[Le]),te._currentMarker.dispose(),te.markerImage.removeChild(te._currentMarker.container),te.markers.splice(te.markers.indexOf(te._currentMarker),1),te.eventListeners.markerdelete.forEach(function(Pt){return Pt(new Gt(S,ct))})},te=this,Y=this.markers.length-1;Y>=0;Y--)z(Y);this.addUndoStep()}},Object.defineProperty($.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),$.prototype.showNotesEditor=function(){var S;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},$.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)},$.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},$.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var D=this.getState(),z=this.undoRedoManager.getLastUndoStep();if(!z||z.width===D.width&&z.height===D.height){var te=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(D),te1&&this.panTo({x:S.clientX,y:S.clientY}))},$.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},$.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},$.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},$.prototype.clientToLocalCoordinates=function(S,D){var z=this.markerImage.getBoundingClientRect();return{x:(S-z.left)/this.zoomLevel,y:(D-z.top)/this.zoomLevel}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},$.prototype.addLicenseKey=function(S){Te.addKey(S)},$.prototype.addEventListener=function(S,D){this.eventListeners.addEventListener(S,D)},$.prototype.removeEventListener=function(S,D){this.eventListeners.removeEventListener(S,D)},$.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty($.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),$.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(D){return D(new _n(S))}))},$.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(D){return D(new _n(S))}))},$.instanceCounter=0,$}();/* ********************************** 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 Ci=function($,S){return(Ci=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,z){D.__proto__=z}||function(D,z){for(var te in z)Object.prototype.hasOwnProperty.call(z,te)&&(D[te]=z[te])})($,S)};function fi($,S){if(typeof S!="function"&&S!==null)throw new TypeError("Class extends value "+String(S)+" is not a constructor or null");function D(){this.constructor=$}Ci($,S),$.prototype=S===null?Object.create(S):(D.prototype=S.prototype,new D)}function In($,S,D,z){return new(D||(D=Promise))(function(te,Y){function Le(rn){try{Pt(z.next(rn))}catch(ht){Y(ht)}}function ct(rn){try{Pt(z.throw(rn))}catch(ht){Y(ht)}}function Pt(rn){var ht;rn.done?te(rn.value):(ht=rn.value,ht instanceof D?ht:new D(function(Vt){Vt(ht)})).then(Le,ct)}Pt((z=z.apply($,S||[])).next())})}function Ri($,S){var D,z,te,Y,Le={label:0,sent:function(){if(1&te[0])throw te[1];return te[1]},trys:[],ops:[]};return Y={next:ct(0),throw:ct(1),return:ct(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function ct(Pt){return function(rn){return function(ht){if(D)throw new TypeError("Generator is already executing.");for(;Le;)try{if(D=1,z&&(te=2&ht[0]?z.return:ht[0]?z.throw||((te=z.return)&&te.call(z),0):z.next)&&!(te=te.call(z,ht[1])).done)return te;switch(z=0,te&&(ht=[2&ht[0],te.value]),ht[0]){case 0:case 1:te=ht;break;case 4:return Le.label++,{value:ht[1],done:!1};case 5:Le.label++,z=ht[1],ht=[0];continue;case 7:ht=Le.ops.pop(),Le.trys.pop();continue;default:if(!(te=Le.trys,(te=te.length>0&&te[te.length-1])||ht[0]!==6&&ht[0]!==2)){Le=0;continue}if(ht[0]===3&&(!te||ht[1]>te[0]&&ht[1]0&&D>0){var z=new qi(S,D),te=z.ratio>=1?20:z.getHorizontalLength(20),Y=z.ratio<1?20:z.getVerticalLength(20),Le=document.createElementNS("http://www.w3.org/2000/svg","svg");Le.setAttribute("xmlns","http://www.w3.org/2000/svg"),Le.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Le);var ct=Ot.createDefs();Le.appendChild(ct);var Pt=Ot.createElement("clipPath",[["id","text-bg-clip"]]);ct.appendChild(Pt);var rn=Ot.createPath(Ot.getHollowRectanglePath((24-te)/2,(24-Y)/2,te,Y,(24-te)/2+2,(24-Y)/2+2,te-4,Y-4));Le.appendChild(rn);var ht=Ot.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ht.appendChild(Ot.createTSpan(S+":"+D)),Le.appendChild(ht);var Vt=ht.getBBox();Ot.setAttributes(ht,[["x",((24-Vt.width)/2).toString()],["y",((24-Vt.height)/2-Vt.y).toString()]]);var hi=Ot.createPath(Ot.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Vt.width))/2,(24-Math.ceil(Vt.height))/2,Math.ceil(Vt.width),Math.ceil(Vt.height)));return Pt.appendChild(hi),Ot.setAttributes(rn,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Le),Le.outerHTML}return''},$}(),sr=function($){function S(D,z,te){var Y=$.call(this,D,z)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=te,Y}return fi(S,$),S.prototype.setupDropdown=function(){var D=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(z){z.className=D.className,z.colorsClassName=D.colorsClassName,D.dropdownBlock.appendChild(z.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},S.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},S.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},S.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},S.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},S.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},S}(mn),Fn=function(){function $(S,D){this.GRIP_SIZE=10,this.color=S,this.fillColor=D,this.visual=Ot.createGroup(),this.visual.appendChild(Ot.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ot.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return $.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},$.prototype.setCenter=function(S,D){this.visual.childNodes.forEach(function(z){return Ot.setAttributes(z,[["cx",S.toString()],["cy",D.toString()]])})},$}(),er=function(){function $(S,D,z,te){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=S,this.canvasHeight=D,this.margin=z,this.container=te,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($.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(S){this._aspectRatio=S,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.gridContainer&&Ot.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(S){this._zoomFactor=S,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),$.prototype.open=function(){var S=this;this.cropShadeElement=Ot.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ot.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var D=0;Dthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-D.height/2),Ot.setAttributes(this.cropRectElement,[["x",D.x.toString()],["y",D.y.toString()],["width",D.width.toString()],["height",D.height.toString()]]);var z=D.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,Le){var ct=D.y+z*(Le+1);Ot.setAttributes(Y,[["x1",""+D.x],["y1",""+ct],["x2",""+(D.x+D.width)],["y2",""+ct]])});var te=D.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,Le){var ct=D.x+te*(Le+1);Ot.setAttributes(Y,[["x1",""+ct],["y1",""+D.y],["x2",""+ct],["y2",""+(D.y+D.height)]])}),Ot.setAttributes(this.cropShadeElement,[["d",Ot.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,D.x,D.y,D.width,D.height)]]),this.topLeftGrip.setCenter(D.x,D.y),this.topRightGrip.setCenter(D.x+D.width,D.y),this.bottomLeftGrip.setCenter(D.x,D.y+D.height),this.bottomRightGrip.setCenter(D.x+D.width,D.y+D.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},$.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)},$.prototype.clientToLocalCoordinates=function(S,D){var z=this.container.getBoundingClientRect();return{x:S-z.left+this.margin,y:D-z.top+this.margin}},$.prototype.onPointerDown=function(S){this.container.setPointerCapture(S.pointerId),this.previousPoint=this.clientToLocalCoordinates(S.clientX,S.clientY),this.cropRectElement===S.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(S.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(S.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(S.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(S.target)&&(this.activeGrip=this.bottomRightGrip)},$.prototype.onPointerMove=function(S){if(this.isMoving)this.move(this.clientToLocalCoordinates(S.clientX,S.clientY));else if(this.activeGrip){var D=this.clientToLocalCoordinates(S.clientX,S.clientY);this.resize(D)}S.preventDefault()},$.prototype.onPointerUp=function(S){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(S.pointerId)},$.prototype.move=function(S){var D=S.x-this.previousPoint.x,z=S.y-this.previousPoint.y;this.zoomFactor!==1&&(D=-D/this.zoomFactor,z=-z/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+D),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+z),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=S},$.prototype.resize=function(S){var D=Object.assign({},this.cropRect),z=S.x-this.previousPoint.x,te=S.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:D.x+zthis.canvasWidth*this.zoomFactor&&(z=this.canvasWidth*this.zoomFactor-D.width),D.width+=z}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(D.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(z),D.height=this.aspectRatio.getVerticalLength(D.width)):(D.y+=te,D.height=this.cropRect.y+this.cropRect.height-D.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?D.height=this.aspectRatio.getVerticalLength(D.width):D.height+=te}D.width<10&&(D.x=this.cropRect.x,D.width=10),D.height<10&&(D.y=this.cropRect.y,D.height=10),this.previousPoint=S,D.x>=this.margin&&D.y>=this.margin&&D.x-this.margin+D.width<=this.canvasWidth&&D.y-this.margin+D.height<=this.canvasHeight&&(this.cropRect=D,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},$.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var S=this.cropRect.x+this.cropRect.width/2,D=this.cropRect.y+this.cropRect.height/2,z=this.aspectRatio.getHorizontalLength(this.cropRect.height),te=this.aspectRatio.getVerticalLength(this.cropRect.width);z/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=S-this.cropRect.width/2,this.cropRect.y=D-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)}},$.prototype.getRescaledRect=function(S,D,z,te,Y,Le){var ct=z/S,Pt=te/D;return{x:(Y.x-Le)*ct+Le,y:(Y.y-Le)*Pt+Le,width:Y.width*ct,height:Y.height*Pt}},$.prototype.scaleCanvas=function(S,D){var z=this.getRescaledRect(this.canvasWidth,this.canvasHeight,S,D,this.cropRect,this.margin);this.canvasWidth=S,this.canvasHeight=D,this.onCropChange&&this.onCropChange(z),this.setCropRectangle(z)},$}(),kr=function(){function $(S){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=S,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty($.prototype,"angle",{get:function(){return this._angle},set:function(S){this._angle=S,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),$.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},$.prototype.onPointerDown=function(S){this.controlContainer.setPointerCapture(S.pointerId),this.isDragging=!0,this.previousPoint={x:S.clientX,y:S.clientY}},$.prototype.onPointerMove=function(S){this.isDragging&&(this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.previousPoint.x=S.clientX)},$.prototype.onPointerUp=function(S){this.isDragging&&this.onAngleChange&&this.onAngleChange((S.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(S.pointerId)},$.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var S=this.angleLabelText.getBBox();Ot.setAttributes(this.angleLabelElement,[["x",((this.width-S.width)/2).toString()],["y",(this.height/2).toString()]])}},$.prototype.positionScaleShape=function(){if(this.scaleShape){var S=this.scaleShape.transform.baseVal.getItem(0);S.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(S,0)}},$.prototype.getVisual=function(){var S=document.createElementNS("http://www.w3.org/2000/svg","svg");S.setAttribute("xmlns","http://www.w3.org/2000/svg"),S.setAttribute("width",this.width+"px"),S.setAttribute("height",this.height+"px"),S.setAttribute("viewBox","0 0 "+this.width+" "+this.height),S.style.flexShrink="0",document.body.appendChild(S);for(var D="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,z=1;z<=this.width/5+10;z++){var te=z%5==0?this.height/3:this.height/6;D+="h4v"+-te+"h1v"+te}D+="v1H0Z",this.scaleShape=Ot.createPath(D);var Y=Ot.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),S.appendChild(this.scaleShape),this.angleLabelElement=Ot.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ot.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Le=Ot.createTSpan("");return Le.innerHTML="°",this.angleLabelElement.appendChild(Le),S.appendChild(this.angleLabelElement),document.body.removeChild(S),S},$}(),Qr=function(){function $(){this.naturalSize=!1,this.imageType="image/png"}return $.prototype.rasterize=function(S,D,z,te,Y,Le,ct){var Pt=this;return new Promise(function(rn){var ht=document.createElement("canvas");ht.width=S.width.baseVal.value-2*te,ht.height=S.height.baseVal.value-2*te;var Vt=1,hi=1;Pt.naturalSize===!0?(Vt=D.naturalWidth/(S.width.baseVal.value-2*te)/Le,hi=D.naturalHeight/(S.height.baseVal.value-2*te)/ct,ht.width=D.naturalWidth/Le,ht.height=D.naturalHeight/ct):Pt.width!==void 0&&Pt.height!==void 0&&(Vt=Pt.width/z.width,hi=Pt.height/z.height,ht.width*=Vt,ht.height*=hi);var Li=ht.getContext("2d");Li.translate(ht.width/2,ht.height/2),Li.rotate(Y*Math.PI/180),Li.scale(Le,ct),Li.translate(-ht.width/2,-ht.height/2),Li.drawImage(D,0,0,ht.width,ht.height);var Zt=document.createElement("canvas");Zt.width=z.width*Vt,Zt.height=z.height*hi,Zt.getContext("2d").putImageData(Li.getImageData((z.x-te)*Vt,(z.y-te)*hi,z.width*Vt,z.height*hi),0,0),rn(Zt.toDataURL(Pt.imageType,Pt.imageQuality))})},$}(),yt=function(){function $(S){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=$.instanceCounter++,this.styles=new bn(this.instanceNo),this.target=S,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty($.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(S){this._zoomToCropEnabled=S,S?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(S){this._isGridVisible=S,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"gridLines",{get:function(){return this._gridLines},set:function(S){this._gridLines=S,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(S){this._rotationAngle=S,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,"aspectRatio",{get:function(){var S;return(S=this._aspectRatio)!==null&&S!==void 0?S:this.aspectRatios[0]},set:function(S){this._aspectRatio=S},enumerable:!1,configurable:!0}),$.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},$.prototype.show=function(){this.showUI(),this.open()},$.prototype.close=function(S){S===void 0&&(S=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),S||this.closeEventListeners.forEach(function(D){return D()}),this._isOpen=!1)},$.prototype.addRenderEventListener=function(S){this.renderEventListeners.push(S)},$.prototype.removeRenderEventListener=function(S){this.renderEventListeners.indexOf(S)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(S),1)},$.prototype.addCloseEventListener=function(S){this.closeEventListeners.push(S)},$.prototype.removeCloseEventListener=function(S){this.closeEventListeners.indexOf(S)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(S),1)},$.prototype.setupResizeObserver=function(){var S=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},$.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var S=1*this.target.clientWidth/this.target.clientHeight,D=this.contentDiv.clientWidth/S>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*S:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,z=D+2*this.CANVAS_MARGINS+this.CANVAS_MARGIN?this.target.offsetTop-(S+this.CANVAS_MARGIN):0;this.coverDiv.style.top=D+"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},$.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},$.prototype.addTopToolbar=function(){var S=this;this.topToolbar=new Ai,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 D=new dr;D.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(D);var z=[];this.aspectRatios.forEach(function(hi){var Li=new mn(hr.getIcon(hi.horizontal,hi.vertical),hi.horizontal===0&&hi.vertical===0?"FREE":hi.horizontal+":"+hi.vertical);Li.onClick=function(){return S.ratioButtonClicked(hi)},z.push(Li)}),this.aspectRatioButton=new sr(hr.getIcon(0,0),"Aspect ratio",z),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,D.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var te=new mn('',"Toggle grid");te.isActive=this.isGridVisible,te.onClick=function(){S.isGridVisible=!S.isGridVisible,te.isActive=S.isGridVisible},D.addButton(te);var Y=new mn('',"Zoom to selection");if(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){S.zoomToCropEnabled=!S.zoomToCropEnabled,Y.isActive=S.zoomToCropEnabled},D.addButton(Y),!Si.isLicensed){var Le=new Jt;this.topToolbar.addElementBlock(Le);var ct=document.createElement("div");ct.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Pt=document.createElement("a");Pt.style.color="currentColor",Pt.href="https://markerjs.com/products/cropro",Pt.target="_blank",Pt.innerHTML='',ct.appendChild(Pt),Le.addElement(ct)}var rn=new dr;rn.minWidth=3*this.toolbarHeight+"px",rn.contentAlign="end",this.topToolbar.addButtonBlock(rn);var ht=new mn('',"OK");ht.onClick=this.startRenderAndClose,rn.addButton(ht),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ht.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Vt=new mn('',"Close");Vt.onClick=this.close,rn.addButton(Vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},$.prototype.addBottomToolbar=function(){var S=this;this.bottomToolbar=new Ai,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 D=new dr;D.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(D);var z=new mn('',"Rotate left");z.onClick=this.rotateLeftButtonClicked,D.addButton(z);var te=new mn('',"Rotate right");te.onClick=this.rotateRightButtonClicked,D.addButton(te);var Y=new Jt;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new kr("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(rn){S.rotateBy(rn),S.straightener.angle=S.rotationAngle},Y.addElement(this.straightener.getUI());var Le=new dr;Le.minWidth=2*this.toolbarHeight+"px",Le.contentAlign="end",this.bottomToolbar.addButtonBlock(Le);var ct=new mn('',"Flip horizontal");ct.onClick=this.flipHorizontallyButtonClicked,Le.addButton(ct);var Pt=new mn('',"Flip vertical");Pt.onClick=this.flipVerticallyButtonClicked,Le.addButton(Pt)},$.prototype.ratioButtonClicked=function(S){this.aspectRatio=S,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},$.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=hr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},$.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new qi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},$.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},$.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},$.prototype.restoreState=function(S){if(S){var D=this.cropLayer.getRescaledRect(S.width,S.height,this.imageWidth,this.imageHeight,S.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(D),this.cropRectChanged(D),this.flippedHorizontally=S.flippedHorizontally,this.flippedVertically=S.flippedVertically,this.applyFlip(),this.rotationAngle=S.rotationAngle,this.applyRotation()}},$.prototype.clientToLocalCoordinates=function(S,D){var z=this.cropImage.getBoundingClientRect();return{x:S-z.left,y:D-z.top}},$.prototype.onWindowResize=function(){this.positionUI()},$.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var S=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=S+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},$.prototype.rotateLeftButtonClicked=function(){var S=this.rotationAngle-90;this.rotationAngle%90!=0&&(S+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(S)},$.prototype.rotateRightButtonClicked=function(){var S=this.rotationAngle+90;this.rotationAngle%90!=0&&(S-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(S)},$.prototype.rotateTo=function(S){S=(S=S>180?S-360:S)<=-180?S+360:S,this.rotationAngle=S,this.applyRotation()},$.prototype.rotateBy=function(S){this.rotateTo((this.rotationAngle+S)%360)},$.prototype.applyRotation=function(){var S=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var D=this.editingTargetRotationContainer.transform.baseVal.getItem(0);D.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(D,0);var z=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/z.width,this.imageHeight/z.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=S},$.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},$.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},$.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},$.prototype.startRenderAndClose=function(){return In(this,void 0,void 0,function(){var S,D;return Ri(this,function(z){switch(z.label){case 0:return[4,this.render()];case 1:return S=z.sent(),D=this.getState(),this.renderEventListeners.forEach(function(te){return te(S,D)}),this.close(!0),[2]}})})},$.prototype.render=function(){return In(this,void 0,void 0,function(){var S;return Ri(this,function(D){switch(D.label){case 0:return(S=new Qr).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.width=this.renderWidth,S.height=this.renderHeight,this.unzoomFromCrop(),Ot.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return D.sent(),[4,S.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,D.sent()]}})})},$.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new kn("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 kn("toolbar_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarBlockStyleClass=this.styles.addClass(new kn("toolbar-block",` display: flex; align-items: center; box-sizing: content-box; `));var S=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new kn("toolbar_button",` display: inline-block; width: `+(this.toolbarHeight-2*S)+`px; height: `+(this.toolbarHeight-2*S)+`px; padding: `+S+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new kn("toolbar_button_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new kn("toolbar_active_button",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; background-color: `+this.styles.settings.toolbarBackgroundActiveColor+` `)),this.styles.addRule(new Cn("."+this.toolbarButtonStyleClass.name+" svg",` height: `+this.toolbarHeight/2+`px; `)),this.styles.addRule(new Cn("."+this.toolbarButtonStyleColorsClass.name+":hover",` background-color: `+this.styles.settings.toolbarBackgroundHoverColor+` `)),this.toolbarDropdownStyleClass=this.styles.addClass(new kn("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 kn("toolbar_dropdown_colors",` background-color: `+this.styles.settings.toolbarBackgroundColor+`; `)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new kn("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 kn("toolbar_straightener",` display: flex; overflow: hidden; justify-content: center; height: `+(this.toolbarHeight-2*S)+`px; padding: `+S+`px; cursor: default; user-select: none; box-sizing: content-box; `)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new kn("toolbar_straightener_colors",` color: `+this.styles.settings.toolbarColor+`; fill: currentColor; `))},$.instanceCounter=0,$}(),cn=G("8hTe"),Kr=G.n(cn),zr=/]*>/g;function na($){var S=document.createElement("div");return S.innerHTML=$,S.childNodes.length===0?"":S.childNodes[0].nodeValue}var Gr=Xe.a=function($){var S=$.value,D=S===void 0?"":S,z=$.edit,te=z===void 0?!1:z,Y=$.className,Le=$.showTextOnly,ct=$.showLines,Pt=$.replaces,rn=$.zoomImg,ht=$.hasMask,Vt=$.style,hi=Vt===void 0?{}:Vt,Li=$.stylesPrev,Zt=Li===void 0?{}:Li,dt=String(D),kt=Object(P.useRef)(),Lt=Object(P.useRef)(),Kt=Object(P.useState)(""),sn=Object(K.a)(Kt,2),En=sn[0],wn=sn[1],hn=Object(P.useState)("office"),Ln=Object(K.a)(hn,2),zn=Ln[0],un=Ln[1],Sn=function(){var jt=new yt(Lt.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var pn=Object(B.a)(L.a.mark(function Ct(Nt){var Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return kt.current.style.display="none",Yt.next=3,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Nt}});case 3:Dt=Yt.sent,Dt!=null&&Dt.id&&Pt(Lt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 5:case"end":return Yt.stop()}},Ct)}));return function(Ct){return pn.apply(this,arguments)}}()),jt.show()},di=function(){var jt=new Dn(Lt.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var pn=Object(B.a)(L.a.mark(function Ct(Nt){var Dt;return L.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(kt.current.style.display="none",!Lt.current){Yt.next=6;break}return Yt.next=4,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Nt.dataUrl}});case 4:Dt=Yt.sent,Dt!=null&&Dt.id&&Pt(Lt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Dt==null?void 0:Dt.id,"?type=").concat(Dt.content_type));case 6:case"end":return Yt.stop()}},Ct)}));return function(Ct){return pn.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},Nn=Object(P.useMemo)(function(){kt.current&&(kt.current.style.zIndex=-1);try{var Xt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;dt=dt.replace(Xt,"("+Q.a.API_SERVER+"/api/attachments/").replace(jt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(pn,'"'+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(Pe){}var Ct=H(dt),Nt=E();if(dt.match(/\[TOC\]/)&&(Ct=Ct.replace("

    [TOC]

    ",A()),R()),Ct=Ct.replace(/(__special_katext_id_\d+__)/g,function(Pe,Yt){var xn=Nt[Yt],pi=xn.type,On=xn.expression;return Object(q.renderToString)(na(On)||"",{displayMode:pi==="block",throwOnError:!1,output:"html"})}),Ct=Ct.replace(/▁/g,"\u2581\u2581\u2581"),g(),Le){var Dt=document.createElement("div");return Dt.innerHTML=Ct,Dt.innerText}return setTimeout(function(){return si()},500),Ct},[dt]),zt=Object(P.useRef)();O.WebkitLineClamp=ct,ct&&(hi=Object(I.a)(Object(I.a)({},hi),O));function An(Xt){var jt=Xt.target;if(jt.tagName.toUpperCase()==="IMG"){if(rn){var pn=jt.getAttribute("src");wn(pn),un("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ct=jt.getAttribute("href");if(Ct.indexOf("office")>-1)Xt.preventDefault(),wn(Ct),un("office");else if(Ct.indexOf("application/pdf")>-1)Xt.preventDefault(),wn(Ct),un("pdf");else if(Ct.indexOf("text/html")>-1)Xt.preventDefault(),wn(Ct),un("html");else if(Ct.startsWith("#")){Xt.preventDefault();var Nt=document.getElementById(Ct.replace("#",""));Nt&&Nt.scrollIntoView(!0)}}}var si=function(){var jt,pn=(jt=zt.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");pn==null||pn.forEach(function(Ct){if(Ct.oncontextmenu=function(){return!1},Ct.src.indexOf(".m3u8")>-1&&!Ct.canPlayType("application/vnd.apple.mpegurl")){if(F.a.isSupported()){var Nt=new F.a;Nt.loadSource(Ct.src),Nt.attachMedia(Ct)}}})};Object(P.useEffect)(function(){if(zt.current&&Nn&&(Nn.match(zr)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",An),function(){zt.current.removeEventListener("click",An),g(),R()}},[Nn,zt.current,An]);var Un=function(jt){if(!te)return;jt.target.nodeName==="IMG"?(kt.current.style.zIndex=1,kt.current.style.display="flex",kt.current.style.width=jt.target.clientWidth+"px",kt.current.style.height=jt.target.clientHeight+"px",kt.current.style.top=jt.target.offsetTop+"px",kt.current.style.left=jt.target.offsetLeft+"px",Lt.current.src=jt.target.getAttribute("src")):kt.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:zt,style:Object(I.a)({},hi),className:"".concat(Y||""," markdown-body ").concat(Kr.a.mdBody),onMouseOver:Un,dangerouslySetInnerHTML:{__html:Nn}}),b.a.createElement("div",{ref:kt,className:Kr.a.button},b.a.createElement(Z.a,null,b.a.createElement(V.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),b.a.createElement(V.a,{onClick:function(){return di()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Lt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(ie.a,{close:!0,data:En,type:En!=null&&En.length?zn:"",style:Object(I.a)({},Zt),onClose:function(){return wn("")}}))}},"9VGf":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return M});var de=G("q1tI"),Z=G.n(de);function M(V,I){var B=Object(de.useRef)();Object(de.useEffect)(function(){B.current=V}),Object(de.useEffect)(function(){function K(){B.current()}if(I!==null){var W=setInterval(K,I);return function(){return clearInterval(W)}}},[I])}},"A60/":function(ft,Xe,G){ft.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(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return B});var de=G("MNnm"),Z="rc-util-key";function M(K){if(K.attachTo)return K.attachTo;var W=document.querySelector("head");return W||document.body}function V(K){var W,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(de.a)())return null;var P=document.createElement("style");if((W=L.csp)===null||W===void 0?void 0:W.nonce){var b;P.nonce=(b=L.csp)===null||b===void 0?void 0:b.nonce}P.innerHTML=K;var p=M(L),_=p.firstChild;return L.prepend&&p.prepend?p.prepend(P):L.prepend&&_?p.insertBefore(P,_):p.appendChild(P),P}var I=new Map;function B(K,W){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},P=M(L);if(!I.has(P)){var b=V("",L),p=b.parentNode;I.set(P,p),p.removeChild(b)}var _=Array.from(I.get(P).children).find(function(a){return a.tagName==="STYLE"&&a[Z]===W});if(_){var h,r;if(((h=L.csp)===null||h===void 0?void 0:h.nonce)&&_.nonce!==((r=L.csp)===null||r===void 0?void 0:r.nonce)){var d;_.nonce=(d=L.csp)===null||d===void 0?void 0:d.nonce}return _.innerHTML!==K&&(_.innerHTML=K),_}var l=V(K,L);return l[Z]=W,l}},Bd2K:function(ft,Xe,G){(function(de){de(G("VrN/"),G("osHv"))})(function(de){de.defineOption("autoCloseTags",!1,function(L,P,b){if(b!=de.Init&&b&&L.removeKeyMap("autoCloseTags"),!P)return;var p={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(p["'/'"]=function(_){return B(_)}),(typeof P!="object"||P.whenOpening!==!1)&&(p["'>'"]=function(_){return V(_)}),L.addKeyMap(p)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function V(L){if(L.getOption("disableInput"))return de.Pass;for(var P=L.listSelections(),b=[],p=L.getOption("autoCloseTags"),_=0;_h.ch&&(u=u.slice(0,u.length-r.end+h.ch));var T=u.toLowerCase();if(!u||r.type=="string"&&(r.end!=h.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&a.close||r.string.indexOf("/")==h.ch-r.start-1||R&&K(R,T)>-1||W(L,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(l)||[],u,h,!0))return de.Pass;var A=typeof p=="object"&&p.emptyTags;if(A&&K(A,u)>-1){b[_]={text:"/>",newPos:de.Pos(h.line,h.ch+2)};continue}var w=O&&K(O,T)>-1;b[_]={indent:w,text:">"+(w?` `:"")+"",newPos:w?de.Pos(h.line+1,0):de.Pos(h.line,h.ch+1)}}for(var m=typeof p=="object"&&p.dontIndentOnAutoClose,_=P.length-1;_>=0;_--){var v=b[_];L.replaceRange(v.text,P[_].head,P[_].anchor,"+insert");var s=L.listSelections().slice(0);s[_]={head:v.newPos,anchor:v.newPos},L.setSelections(s),!m&&v.indent&&(L.indentLine(v.newPos.line,null,!0),L.indentLine(v.newPos.line+1,null,!0))}}function I(L,P){for(var b=L.listSelections(),p=[],_=P?"/":""&&(R+=">"),p[d]=R}if(L.replaceSelections(p),b=L.listSelections(),!r)for(var d=0;d=0&&P[l]==b;l--)++d;p=r.to;for(var l=1;l0){for(var P=0;P1&&arguments[1]!==void 0?arguments[1]:"",P=[],b=0;bbe.length)&&(xe=be.length);for(var pe=0,se=new Array(xe);pe=be.length?{done:!0}:{done:!1,value:be[se++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return pe=be[Symbol.iterator](),pe.next.bind(pe)}function B(be,xe){return xe={exports:{}},be(xe,xe.exports),xe.exports}var K=B(function(be){function xe(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function pe(se){be.exports.defaults=se}be.exports={defaults:xe(),getDefaults:xe,changeDefaults:pe}}),W=K.defaults,L=K.getDefaults,P=K.changeDefaults,b=/[&<>"']/,p=/[&<>"']/g,_=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(xe){return r[xe]};function l(be,xe){if(xe){if(b.test(be))return be.replace(p,d)}else if(_.test(be))return be.replace(h,d);return be}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(be){return be.replace(a,function(xe,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var c=/(^|[^\[])\^/g;function R(be,xe){be=be.source||be,xe=xe||"";var pe={replace:function(ce,Ee){return Ee=Ee.source||Ee,Ee=Ee.replace(c,"$1"),be=be.replace(ce,Ee),pe},getRegex:function(){return new RegExp(be,xe)}};return pe}var O=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(be,xe,pe){if(be){var se;try{se=decodeURIComponent(u(pe)).replace(O,"").toLowerCase()}catch(ce){return null}if(se.indexOf("javascript:")===0||se.indexOf("vbscript:")===0||se.indexOf("data:")===0)return null}xe&&!T.test(pe)&&(pe=o(xe,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(ce){return null}return pe}var w={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function o(be,xe){w[" "+be]||(m.test(be)?w[" "+be]=be+"/":w[" "+be]=N(be,"/",!0)),be=w[" "+be];var pe=be.indexOf(":")===-1;return xe.substring(0,2)==="//"?pe?xe:be.replace(v,"$1")+xe:xe.charAt(0)==="/"?pe?xe:be.replace(s,"$1")+xe:be+xe}var E={exec:function(){}};function g(be){for(var xe=1,pe,se;xe=0&&De[lt]==="\\";)$e=!$e;return $e?"|":" |"}),se=pe.split(/ \|/),ce=0;if(se.length>xe)se.splice(xe);else for(;se.length=se.length?ce.slice(se.length):ce}).join(` `)}var fe=function(){function be(pe){this.options=pe||y}var xe=be.prototype;return xe.space=function(se){var ce=this.rules.block.newline.exec(se);if(ce)return ce[0].length>1?{type:"space",raw:ce[0]}:{raw:` `}},xe.code=function(se,ce){var Ee=this.rules.block.code.exec(se);if(Ee){var Ae=ce[ce.length-1];if(Ae&&Ae.type==="paragraph")return{raw:Ee[0],text:Ee[0].trimRight()};var De=Ee[0].replace(/^ {4}/gm,"");return{type:"code",raw:Ee[0],codeBlockStyle:"indented",text:this.options.pedantic?De:x(De,` `)}}},xe.fences=function(se){var ce=this.rules.block.fences.exec(se);if(ce){var Ee=ce[0],Ae=ge(Ee,ce[3]||"");return{type:"code",raw:Ee,lang:ce[2]?ce[2].trim():ce[2],text:Ae}}},xe.heading=function(se){var ce=this.rules.block.heading.exec(se);if(ce)return{type:"heading",raw:ce[0],depth:ce[1].length,text:ce[2]}},xe.nptable=function(se){var ce=this.rules.block.nptable.exec(se);if(ce){var Ee={type:"table",header:F(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(` `):[],raw:ce[0]};if(Ee.header.length===Ee.align.length){var Ae=Ee.align.length,De;for(De=0;De ?/gm,"");return{type:"blockquote",raw:ce[0],text:Ee}}},xe.list=function(se){var ce=this.rules.block.list.exec(se);if(ce){for(var Ee=ce[0],Ae=ce[2],De=Ae.length>1,$e=Ae[Ae.length-1]===")",lt={type:"list",raw:Ee,ordered:De,start:De?+Ae.slice(0,-1):"",loose:!1,items:[]},Bt=ce[0].match(this.rules.block.item),tn=!1,nn,_n,yn,Gt,ii,Dn,Ci,fi=Bt.length,In=0;In1||this.options.smartLists&&yn!==Ae)&&(Gt=Bt.slice(In+1).join(` `),lt.raw=lt.raw.substring(0,lt.raw.length-Gt.length),In=fi-1)),ii=tn||/\n\n(?!\s*$)/.test(nn),In!==fi-1&&(tn=nn.charAt(nn.length-1)===` `,ii||(ii=tn)),ii&&(lt.loose=!0),Dn=/^\[[ xX]\] /.test(nn),Ci=void 0,Dn&&(Ci=nn[1]!==" ",nn=nn.replace(/^\[[ xX]\] +/,"")),lt.items.push({type:"list_item",raw:Ee,task:Dn,checked:Ci,loose:ii,text:nn});return lt}},xe.html=function(se){var ce=this.rules.block.html.exec(se);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]}},xe.def=function(se){var ce=this.rules.block.def.exec(se);if(ce){ce[3]&&(ce[3]=ce[3].substring(1,ce[3].length-1));var Ee=ce[1].toLowerCase().replace(/\s+/g," ");return{tag:Ee,raw:ce[0],href:ce[2],title:ce[3]}}},xe.table=function(se){var ce=this.rules.block.table.exec(se);if(ce){var Ee={type:"table",header:F(ce[1].replace(/^ *| *\| *$/g,"")),align:ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ce[3]?ce[3].replace(/\n$/,"").split(` `):[]};if(Ee.header.length===Ee.align.length){Ee.raw=ce[0];var Ae=Ee.align.length,De;for(De=0;De/i.test(Ae[0])&&(ce=!1),!Ee&&/^<(pre|code|kbd|script)(\s|>)/i.test(Ae[0])?Ee=!0:Ee&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Ae[0])&&(Ee=!1),{type:this.options.sanitize?"text":"html",raw:Ae[0],inLink:ce,inRawBlock:Ee,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):Q(Ae[0]):Ae[0]}},xe.link=function(se){var ce=this.rules.inline.link.exec(se);if(ce){var Ee=q(ce[2],"()");if(Ee>-1){var Ae=ce[0].indexOf("!")===0?5:4,De=Ae+ce[1].length+Ee;ce[2]=ce[2].substring(0,Ee),ce[0]=ce[0].substring(0,De).trim(),ce[3]=""}var $e=ce[2],lt="";if(this.options.pedantic){var Bt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec($e);Bt?($e=Bt[1],lt=Bt[3]):lt=""}else lt=ce[3]?ce[3].slice(1,-1):"";$e=$e.trim().replace(/^<([\s\S]*)>$/,"$1");var tn=ie(ce,{href:$e&&$e.replace(this.rules.inline._escapes,"$1"),title:lt&<.replace(this.rules.inline._escapes,"$1")},ce[0]);return tn}},xe.reflink=function(se,ce){var Ee;if((Ee=this.rules.inline.reflink.exec(se))||(Ee=this.rules.inline.nolink.exec(se))){var Ae=(Ee[2]||Ee[1]).replace(/\s+/g," ");if(Ae=ce[Ae.toLowerCase()],!Ae||!Ae.href){var De=Ee[0].charAt(0);return{type:"text",raw:De,text:De}}var $e=ie(Ee,Ae,Ee[0]);return $e}},xe.strong=function(se,ce,Ee){Ee===void 0&&(Ee="");var Ae=this.rules.inline.strong.start.exec(se);if(Ae&&(!Ae[1]||Ae[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){ce=ce.slice(-1*se.length);var De=Ae[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;De.lastIndex=0;for(var $e;(Ae=De.exec(ce))!=null;)if($e=this.rules.inline.strong.middle.exec(ce.slice(0,Ae.index+3)),$e)return{type:"strong",raw:se.slice(0,$e[0].length),text:se.slice(2,$e[0].length-2)}}},xe.em=function(se,ce,Ee){Ee===void 0&&(Ee="");var Ae=this.rules.inline.em.start.exec(se);if(Ae&&(!Ae[1]||Ae[1]&&(Ee===""||this.rules.inline.punctuation.exec(Ee)))){ce=ce.slice(-1*se.length);var De=Ae[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;De.lastIndex=0;for(var $e;(Ae=De.exec(ce))!=null;)if($e=this.rules.inline.em.middle.exec(ce.slice(0,Ae.index+2)),$e)return{type:"em",raw:se.slice(0,$e[0].length),text:se.slice(1,$e[0].length-1)}}},xe.codespan=function(se){var ce=this.rules.inline.code.exec(se);if(ce){var Ee=ce[2].replace(/\n/g," "),Ae=/[^ ]/.test(Ee),De=Ee.startsWith(" ")&&Ee.endsWith(" ");return Ae&&De&&(Ee=Ee.substring(1,Ee.length-1)),Ee=Q(Ee,!0),{type:"codespan",raw:ce[0],text:Ee}}},xe.br=function(se){var ce=this.rules.inline.br.exec(se);if(ce)return{type:"br",raw:ce[0]}},xe.del=function(se){var ce=this.rules.inline.del.exec(se);if(ce)return{type:"del",raw:ce[0],text:ce[1]}},xe.autolink=function(se,ce){var Ee=this.rules.inline.autolink.exec(se);if(Ee){var Ae,De;return Ee[2]==="@"?(Ae=Q(this.options.mangle?ce(Ee[1]):Ee[1]),De="mailto:"+Ae):(Ae=Q(Ee[1]),De=Ae),{type:"link",raw:Ee[0],text:Ae,href:De,tokens:[{type:"text",raw:Ae,text:Ae}]}}},xe.url=function(se,ce){var Ee;if(Ee=this.rules.inline.url.exec(se)){var Ae,De;if(Ee[2]==="@")Ae=Q(this.options.mangle?ce(Ee[0]):Ee[0]),De="mailto:"+Ae;else{var $e;do $e=Ee[0],Ee[0]=this.rules.inline._backpedal.exec(Ee[0])[0];while($e!==Ee[0]);Ae=Q(Ee[0]),Ee[1]==="www."?De="http://"+Ae:De=Ae}return{type:"link",raw:Ee[0],text:Ae,href:De,tokens:[{type:"text",raw:Ae,text:Ae}]}}},xe.inlineText=function(se,ce,Ee){var Ae=this.rules.inline.text.exec(se);if(Ae){var De;return ce?De=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ae[0]):Q(Ae[0]):Ae[0]:De=Q(this.options.smartypants?Ee(Ae[0]):Ae[0]),{type:"text",raw:Ae[0],text:De}}},be}(),ue=H.noopTest,he=H.edit,_e=H.merge,le={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:ue,table:ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};le._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,le._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,le.def=he(le.def).replace("label",le._label).replace("title",le._title).getRegex(),le.bullet=/(?:[*+-]|\d{1,9}[.)])/,le.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,le.item=he(le.item,"gm").replace(/bull/g,le.bullet).getRegex(),le.list=he(le.list).replace(/bull/g,le.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+le.def.source+")").getRegex(),le._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",le._comment=//,le.html=he(le.html,"i").replace("comment",le._comment).replace("tag",le._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),le.paragraph=he(le._paragraph).replace("hr",le.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",le._tag).getRegex(),le.blockquote=he(le.blockquote).replace("paragraph",le.paragraph).getRegex(),le.normal=_e({},le),le.gfm=_e({},le.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*|$)"}),le.gfm.nptable=he(le.gfm.nptable).replace("hr",le.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",le._tag).getRegex(),le.gfm.table=he(le.gfm.table).replace("hr",le.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",le._tag).getRegex(),le.pedantic=_e({},le.normal,{html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",le._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:ue,paragraph:he(le.normal._paragraph).replace("hr",le.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ue,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:ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ne.punctuation=he(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ne._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ne.em.start=he(ne.em.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.middle=he(ne.em.middle).replace(/punctuation/g,ne._punctuation).replace(/overlapSkip/g,ne._overlapSkip).getRegex(),ne.em.endAst=he(ne.em.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.endUnd=he(ne.em.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.start=he(ne.strong.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.middle=he(ne.strong.middle).replace(/punctuation/g,ne._punctuation).replace(/blockSkip/g,ne._blockSkip).getRegex(),ne.strong.endAst=he(ne.strong.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.endUnd=he(ne.strong.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=he(ne._blockSkip,"g").getRegex(),ne.overlapSkip=he(ne._overlapSkip,"g").getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=he(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=he(ne.tag).replace("comment",le._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=he(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=he(ne.reflink).replace("label",ne._label).getRegex(),ne.reflinkSearch=he(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=_e({},ne),ne.pedantic=_e({},ne.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:he(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=_e({},ne.normal,{escape:he(ne.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&&(se="x"+se.toString(16)),xe+="&#"+se+";";return xe}var Be=function(){function be(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||Fe,this.options.tokenizer=this.options.tokenizer||new fe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var se={block:Ke.normal,inline:Ue.normal};this.options.pedantic?(se.block=Ke.pedantic,se.inline=Ue.pedantic):this.options.gfm&&(se.block=Ke.gfm,this.options.breaks?se.inline=Ue.breaks:se.inline=Ue.gfm),this.tokenizer.rules=se}be.lex=function(se,ce){var Ee=new be(ce);return Ee.lex(se)};var xe=be.prototype;return xe.lex=function(se){return se=se.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(se,this.tokens,!0),this.inline(this.tokens),this.tokens},xe.blockTokens=function(se,ce,Ee){ce===void 0&&(ce=[]),Ee===void 0&&(Ee=!0),se=se.replace(/^ +$/gm,"");for(var Ae,De,$e,lt;se;){if(Ae=this.tokenizer.space(se)){se=se.substring(Ae.raw.length),Ae.type&&ce.push(Ae);continue}if(Ae=this.tokenizer.code(se,ce)){se=se.substring(Ae.raw.length),Ae.type?ce.push(Ae):(lt=ce[ce.length-1],lt.raw+=` `+Ae.raw,lt.text+=` `+Ae.text);continue}if(Ae=this.tokenizer.fences(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.heading(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.nptable(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.hr(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.blockquote(se)){se=se.substring(Ae.raw.length),Ae.tokens=this.blockTokens(Ae.text,[],Ee),ce.push(Ae);continue}if(Ae=this.tokenizer.list(se)){for(se=se.substring(Ae.raw.length),$e=Ae.items.length,De=0;De<$e;De++)Ae.items[De].tokens=this.blockTokens(Ae.items[De].text,[],!1);ce.push(Ae);continue}if(Ae=this.tokenizer.html(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ee&&(Ae=this.tokenizer.def(se))){se=se.substring(Ae.raw.length),this.tokens.links[Ae.tag]||(this.tokens.links[Ae.tag]={href:Ae.href,title:Ae.title});continue}if(Ae=this.tokenizer.table(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.lheading(se)){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ee&&(Ae=this.tokenizer.paragraph(se))){se=se.substring(Ae.raw.length),ce.push(Ae);continue}if(Ae=this.tokenizer.text(se,ce)){se=se.substring(Ae.raw.length),Ae.type?ce.push(Ae):(lt=ce[ce.length-1],lt.raw+=` `+Ae.raw,lt.text+=` `+Ae.text);continue}if(se){var Bt="Infinite loop on byte: "+se.charCodeAt(0);if(this.options.silent){console.error(Bt);break}else throw new Error(Bt)}}return ce},xe.inline=function(se){var ce,Ee,Ae,De,$e,lt,Bt=se.length;for(ce=0;ce0)for(;(Bt=this.tokenizer.rules.inline.reflinkSearch.exec(lt))!=null;)tn.includes(Bt[0].slice(Bt[0].lastIndexOf("[")+1,-1))&&(lt=lt.slice(0,Bt.index)+"["+"a".repeat(Bt[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Bt=this.tokenizer.rules.inline.blockSkip.exec(lt))!=null;)lt=lt.slice(0,Bt.index)+"["+"a".repeat(Bt[0].length-2)+"]"+lt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;se;){if($e=this.tokenizer.escape(se)){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.tag(se,Ee,Ae)){se=se.substring($e.raw.length),Ee=$e.inLink,Ae=$e.inRawBlock,ce.push($e);continue}if($e=this.tokenizer.link(se)){se=se.substring($e.raw.length),$e.type==="link"&&($e.tokens=this.inlineTokens($e.text,[],!0,Ae)),ce.push($e);continue}if($e=this.tokenizer.reflink(se,this.tokens.links)){se=se.substring($e.raw.length),$e.type==="link"&&($e.tokens=this.inlineTokens($e.text,[],!0,Ae)),ce.push($e);continue}if($e=this.tokenizer.strong(se,lt,De)){se=se.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],Ee,Ae),ce.push($e);continue}if($e=this.tokenizer.em(se,lt,De)){se=se.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],Ee,Ae),ce.push($e);continue}if($e=this.tokenizer.codespan(se)){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.br(se)){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.del(se)){se=se.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],Ee,Ae),ce.push($e);continue}if($e=this.tokenizer.autolink(se,Ne)){se=se.substring($e.raw.length),ce.push($e);continue}if(!Ee&&($e=this.tokenizer.url(se,Ne))){se=se.substring($e.raw.length),ce.push($e);continue}if($e=this.tokenizer.inlineText(se,Ae,He)){se=se.substring($e.raw.length),De=$e.raw.slice(-1),ce.push($e);continue}if(se){var nn="Infinite loop on byte: "+se.charCodeAt(0);if(this.options.silent){console.error(nn);break}else throw new Error(nn)}}return ce},Z(be,null,[{key:"rules",get:function(){return{block:Ke,inline:Ue}}}]),be}(),Je=K.defaults,tt=H.cleanUrl,it=H.escape,rt=function(){function be(pe){this.options=pe||Je}var xe=be.prototype;return xe.code=function(se,ce,Ee){var Ae=(ce||"").match(/\S*/)[0];if(this.options.highlight){var De=this.options.highlight(se,Ae);De!=null&&De!==se&&(Ee=!0,se=De)}return Ae?'
    '+(Ee?se:it(se,!0))+`
    `:"
    "+(Ee?se:it(se,!0))+`
    `},xe.blockquote=function(se){return`
    `+se+`
    `},xe.html=function(se){return se},xe.heading=function(se,ce,Ee,Ae){return this.options.headerIds?"'+se+" `:""+se+" `},xe.hr=function(){return this.options.xhtml?`
    `:`
    `},xe.list=function(se,ce,Ee){var Ae=ce?"ol":"ul",De=ce&&Ee!==1?' start="'+Ee+'"':"";return"<"+Ae+De+`> `+se+" `},xe.listitem=function(se){return"
  • "+se+`
  • `},xe.checkbox=function(se){return" "},xe.paragraph=function(se){return"

    "+se+`

    `},xe.table=function(se,ce){return ce&&(ce=""+ce+""),` `+se+` `+ce+`
    `},xe.tablerow=function(se){return` `+se+` `},xe.tablecell=function(se,ce){var Ee=ce.header?"th":"td",Ae=ce.align?"<"+Ee+' align="'+ce.align+'">':"<"+Ee+">";return Ae+se+" `},xe.strong=function(se){return""+se+""},xe.em=function(se){return""+se+""},xe.codespan=function(se){return""+se+""},xe.br=function(){return this.options.xhtml?"
    ":"
    "},xe.del=function(se){return""+se+""},xe.link=function(se,ce,Ee){if(se=tt(this.options.sanitize,this.options.baseUrl,se),se===null)return Ee;var Ae='",Ae},xe.image=function(se,ce,Ee){if(se=tt(this.options.sanitize,this.options.baseUrl,se),se===null)return Ee;var Ae=''+Ee+'":">",Ae},xe.text=function(se){return se},be}(),qe=function(){function be(){}var xe=be.prototype;return xe.strong=function(se){return se},xe.em=function(se){return se},xe.codespan=function(se){return se},xe.del=function(se){return se},xe.html=function(se){return se},xe.text=function(se){return se},xe.link=function(se,ce,Ee){return""+Ee},xe.image=function(se,ce,Ee){return""+Ee},xe.br=function(){return""},be}(),gt=function(){function be(){this.seen={}}var xe=be.prototype;return xe.slug=function(se){var ce=se.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ce)){var Ee=ce;do this.seen[Ee]++,ce=Ee+"-"+this.seen[Ee];while(this.seen.hasOwnProperty(ce))}return this.seen[ce]=0,ce},be}(),pt=K.defaults,vt=H.unescape,at=function(){function be(pe){this.options=pe||pt,this.options.renderer=this.options.renderer||new rt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe,this.slugger=new gt}be.parse=function(se,ce){var Ee=new be(ce);return Ee.parse(se)};var xe=be.prototype;return xe.parse=function(se,ce){ce===void 0&&(ce=!0);var Ee="",Ae,De,$e,lt,Bt,tn,nn,_n,yn,Gt,ii,Dn,Ci,fi,In,Ri,Si,Ot,bn=se.length;for(Ae=0;Ae0&&In.tokens[0].type==="text"?(In.tokens[0].text=Ot+" "+In.tokens[0].text,In.tokens[0].tokens&&In.tokens[0].tokens.length>0&&In.tokens[0].tokens[0].type==="text"&&(In.tokens[0].tokens[0].text=Ot+" "+In.tokens[0].tokens[0].text)):In.tokens.unshift({type:"text",text:Ot}):fi+=Ot),fi+=this.parse(In.tokens,Ci),yn+=this.renderer.listitem(fi,Si,Ri);Ee+=this.renderer.list(yn,ii,Dn);continue}case"html":{Ee+=this.renderer.html(Gt.text);continue}case"paragraph":{Ee+=this.renderer.paragraph(this.parseInline(Gt.tokens));continue}case"text":{for(yn=Gt.tokens?this.parseInline(Gt.tokens):Gt.text;Ae+1An error occurred:

    "+Tt($e.message+"",!0)+"
    ";throw $e}}ze.options=ze.setOptions=function(be){return Rt(ze.defaults,be),Mt(ze.defaults),ze},ze.getDefaults=Ye,ze.defaults=St,ze.use=function(be){var xe=Rt({},be);if(be.renderer&&function(){var se=ze.defaults.renderer||new rt,ce=function(De){var $e=se[De];se[De]=function(){for(var lt=arguments.length,Bt=new Array(lt),tn=0;tn-1?c[ue]:"",_e="";m.choices.map(function(Fe,Ke){Fe.is_answer&&(_e+=c[Ke])});var le=fe[m.item_type],ne={SINGLE:p.a.createElement(_.a,{className:r.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(he||"\u65E0")}),MULTIPLE:p.a.createElement(_.a,{className:r.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(_e||"\u65E0")}),COMPLETION:y()},Te=p.a.createElement(_.a,{className:r.a.answerHtml,value:"\u7B54\u6848\uFF1A".concat(le||"\u65E0")});return ne[m.item_type]||Te},F=function(q){var ie=Object(K.a)(v);q.target.checked?ie.push(m.id):ie=ie.filter(function(ge){return ge!==m.id}),o(ie)};return p.a.createElement("div",{className:r.a.itemWrap},p.a.createElement("div",{className:r.a.list},g&&p.a.createElement(B.a,{className:"mr10",onChange:F,checked:v.includes(m.id)}),p.a.createElement("div",{className:r.a.title},p.a.createElement(_.a,{key:1,showLines:1,showTextOnly:!0,className:r.a.topicTitleContent,value:m.name})),p.a.createElement("div",{className:r.a.line},p.a.createElement("b",{className:r.a.b1}),p.a.createElement("b",{className:r.a.b2})),p.a.createElement("div",{onClick:function(){return j(!U)},className:r.a.tr},U?"\u6536\u8D77":"\u5C55\u5F00",p.a.createElement("i",{style:{transform:U?"scale(0.5) rotate(-180deg)":"scale(0.5) rotate(0deg)"},className:"iconfont icon-zhankai4"}))),p.a.createElement("aside",{style:U?{display:"block"}:{display:"none"},className:r.a.itemDetail},p.a.createElement("div",{style:{marginBottom:44}},p.a.createElement(_.a,{key:2,className:r.a.topicTitleContent,value:m.name}),p.a.createElement("div",{className:"".concat(r.a.row," mt15")},H()),p.a.createElement("div",{className:r.a.row},p.a.createElement("div",{className:r.a.updateTimeRow},p.a.createElement("div",{className:r.a.updateTimeWrap},m.item_type==="PROGRAM"&&p.a.createElement("p",{className:r.a.programLanguage},"\u7F16\u7A0B\u8BED\u8A00\uFF1A",(w=m.program_attr)===null||w===void 0?void 0:w.language))))),m.item_type!=="PROGRAM"&&m.item_type!=="COMBINATION"&&p.a.createElement("div",{className:r.a.answerWrapper},p.a.createElement("img",{src:a.a,alt:"",className:r.a.decoration}),p.a.createElement("div",{className:r.a.answer},x()),p.a.createElement("div",{className:r.a.parse},p.a.createElement("div",{className:r.a.parseText},"\u89E3\u6790\uFF1A"),p.a.createElement("div",{className:r.a.parseAnswer},m.analysis?p.a.createElement(_.a,{className:r.a.parseAnswerHtml,value:m.analysis}):"\u6682\u65E0\u89E3\u6790")))))},O=function(A){var w,m,v,s,o,E,g,C,N,U,j,H,y,x,F,Q,q=A.isProblemset,ie=A.data,ge=A.user,fe=A.activeTabsKey,ue=A.onPublicReview,he=ue===void 0?function(){}:ue,_e=A.onStartExperience,le=_e===void 0?function(){}:_e,ne=A.onSetPrivate,Te=ne===void 0?function(){}:ne,Fe=A.onCorrection,Ke=Fe===void 0?function(){}:Fe,Ue=A.onCollect,He=Ue===void 0?function(){}:Ue,Ne=A.onSetPublic,Be=Ne===void 0?function(){}:Ne,Je=A.onDelete,tt=Je===void 0?function(){}:Je,it=A.onCancel,rt=it===void 0?function(){}:it,qe=A.onSelect,gt=qe===void 0?function(){}:qe,pt=A.onMoveTo,vt=pt===void 0?function(){}:pt,at=A.onSetShare,Rt=at===void 0?function(){}:at,xt=A.onCancelShare,Tt=xt===void 0?function(){}:xt,Ye=A.onPublish,Mt=Ye===void 0?function(){}:Ye,St=A.onCancelPublish,ze=St===void 0?function(){}:St,ut=ie.item_type==="PROGRAM"?"/problems/".concat((w=ie.program_attr)===null||w===void 0?void 0:w.identifier,"/edit"):"/problemset/edit/".concat(ie.id),be=fe==="0"&&!ie.public&&!ie.apply&&(ie.item_type==="PROGRAM"&&((m=ie.program_attr)===null||m===void 0?void 0:m.status)!==0||ie.item_type!=="PROGRAM"),xe=p.a.createElement(V.a,{forceSubMenuRender:!0,className:r.a.menu},fe==="0"&&!ie.public&&p.a.createElement(V.a.Item,{key:"-1"},p.a.createElement("a",{className:r.a.actionLink,target:"_blank",href:ut},"\u7F16\u8F91")),(fe==="0"||fe==="3")&&ie.item_type==="PROGRAM"&&((v=ie.program_attr)===null||v===void 0?void 0:v.status)!==0&&!ie.public&&((s=ie.author)===null||s===void 0?void 0:s.login)===((o=ge.userInfo)===null||o===void 0?void 0:o.login)&&p.a.createElement(V.a.Item,{key:"0"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){var Ee;return ze(ie==null||((Ee=ie.program_attr)===null||Ee===void 0)?void 0:Ee.identifier)}},"\u64A4\u9500\u53D1\u5E03")),fe==="0"&&p.a.createElement(V.a.Item,{key:"1"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return vt(ie.id)}},"\u79FB\u52A8\u5230")),fe==="0"&&!(ie!=null&&ie.is_share)&&p.a.createElement(V.a.Item,{key:"3"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Rt(ie.id)}},"\u5171\u4EAB")),(fe==="0"&&(ie==null?void 0:ie.is_share)||fe==="3"&&((E=ie.author)===null||E===void 0?void 0:E.login)===((g=ge.userInfo)===null||g===void 0?void 0:g.login))&&p.a.createElement(V.a.Item,{key:"3"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Tt(ie.id)}},"\u64A4\u9500\u5171\u4EAB")),be&&p.a.createElement(V.a.Item,{key:"4"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Be(ie.id)}},"\u516C\u5F00")),fe==="0"&&!ie.public&&ie.apply&&(ie.item_type==="PROGRAM"&&ie.program_attr.status!==0||ie.item_type!=="PROGRAM")&&p.a.createElement(V.a.Item,{key:"5"},p.a.createElement("a",{className:r.a.reviewFlag,onClick:he},"\u5BA1\u6838\u4E2D")),(fe==="0"||fe==="1")&&ie.public&&((C=ie.author)===null||C===void 0?void 0:C.login)===((N=ge.userInfo)===null||N===void 0?void 0:N.login)&&p.a.createElement(V.a.Item,{key:"6"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Te(ie.id)}},"\u64A4\u9500\u516C\u5F00")),fe==="2"&&p.a.createElement(V.a.Item,{key:"7"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return He(ie.id,ie.is_collected)}},"\u53D6\u6D88\u6536\u85CF")),(fe==="0"||fe==="3")&&ie.item_type==="PROGRAM"&&((U=ie.program_attr)===null||U===void 0?void 0:U.status)===0&&!ie.public&&((j=ie.author)===null||j===void 0?void 0:j.login)===((H=ge.userInfo)===null||H===void 0?void 0:H.login)&&p.a.createElement(V.a.Item,{key:"8"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){var Ee;return Mt(ie==null||((Ee=ie.program_attr)===null||Ee===void 0)?void 0:Ee.identifier)}},"\u53D1\u5E03")),(fe==="1"||fe==="3")&&!Object(d.o)()&&!Object(d.m)()&&((y=ie.author)===null||y===void 0?void 0:y.login)!==((x=ge.userInfo)===null||x===void 0?void 0:x.login)&&p.a.createElement(V.a.Item,{key:"9"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return He(ie.id,ie.is_collected)}},ie.is_collected?"\u53D6\u6D88\u6536\u85CF":"\u6536\u85CF")),fe!=="0"&&!Object(d.o)()&&!Object(d.m)()&&p.a.createElement(V.a.Item,{key:"10"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Ke(ie.id)}},"\u7EA0\u9519")),(fe==="0"&&!ie.public||fe==="1"&&Object(d.o)()&&((F=ie.author)===null||F===void 0?void 0:F.login)!==((Q=ge.userInfo)===null||Q===void 0?void 0:Q.login))&&p.a.createElement(V.a.Item,{key:"11"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return tt(ie.id)}},"\u5220\u9664"))),pe=p.a.createElement(V.a,{forceSubMenuRender:!0,className:r.a.menu},p.a.createElement(V.a.Item,{key:"10"},p.a.createElement("a",{className:r.a.actionLink,onClick:function(){return Ke(ie.id)}},"\u7EA0\u9519"))),se=fe!=="0"&&!Object(d.o)()&&!Object(d.m)();return p.a.createElement(p.a.Fragment,null,q?p.a.createElement(p.a.Fragment,null,ie.item_type!=="SUBJECTIVE"&&ie.item_type!=="COMBINATION"&&p.a.createElement("span",{className:r.a.textBtn,style:{cursor:"pointer"},onClick:function(){return le(ie)}},"\u4F53\u9A8C"),p.a.createElement(Z.a,{overlay:xe},p.a.createElement("span",{style:{cursor:"default"},onClick:function(Ee){return Ee.preventDefault()}},p.a.createElement("span",{className:r.a.textBtn},"\u66F4\u591A")))):se?p.a.createElement(Z.a,{className:"ml40",overlay:pe},p.a.createElement("span",{style:{cursor:"default"},onClick:function(Ee){return Ee.preventDefault()}},p.a.createElement("span",null,"\u66F4\u591A"))):p.a.createElement("span",null))};Xe.b=R},ELLl:function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){var Z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=de.Pos;de.defineOption("autoCloseBrackets",!1,function(r,d,l){l&&l!=de.Init&&(r.removeKeyMap(I),r.state.closeBrackets=null),d&&(B(V(d,"pairs")),r.state.closeBrackets=d,r.addKeyMap(I))});function V(r,d){return d=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[d]!=null?r[d]:Z[d]}var I={Backspace:L,Enter:P};function B(r){for(var d=0;d=0;u--){var R=a[u].head;r.replaceRange("",M(R.line,R.ch-1),M(R.line,R.ch+1),"+delete")}}function P(r){var d=W(r),l=d&&V(d,"explode");if(!l||r.getOption("disableInput"))return de.Pass;for(var a=r.listSelections(),u=0;u0;return{anchor:new M(r.anchor.line,r.anchor.ch+(d?-1:1)),head:new M(r.head.line,r.head.ch+(d?1:-1))}}function p(r,d){var l=W(r);if(!l||r.getOption("disableInput"))return de.Pass;var a=V(l,"pairs"),u=a.indexOf(d);if(u==-1)return de.Pass;for(var c=V(l,"closeBefore"),R=V(l,"triples"),O=a.charAt(u+1)==d,T=r.listSelections(),A=u%2==0,w,m=0;m=0&&r.getRange(s,M(s.line,s.ch+3))==d+d+d?o="skipThree":o="skip";else if(O&&s.ch>1&&R.indexOf(d)>=0&&r.getRange(M(s.line,s.ch-2),s)==d+d){if(s.ch>2&&/\bstring/.test(r.getTokenTypeAt(M(s.line,s.ch-2))))return de.Pass;o="addFour"}else if(O){var g=s.ch==0?" ":r.getRange(M(s.line,s.ch-1),s);if(!de.isWordChar(E)&&g!=d&&!de.isWordChar(g))o="both";else return de.Pass}else if(A&&(E.length===0||/\s/.test(E)||c.indexOf(E)>-1))o="both";else return de.Pass;if(!w)w=o;else if(w!=o)return de.Pass}var C=u%2?a.charAt(u-1):d,N=u%2?d:a.charAt(u+1);r.operation(function(){if(w=="skip")r.execCommand("goCharRight");else if(w=="skipThree")for(var U=0;U<3;U++)r.execCommand("goCharRight");else if(w=="surround"){for(var j=r.getSelections(),U=0;U0?Lt[0].callbacks.push(kt):De.push({element:dt,callbacks:[kt]}),{clear:function(){De=De.filter(function(sn){return sn.element!==dt})}}}},Bt=lt,tn=[{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"}],nn=function(dt){var kt=dt.visible,Lt=dt.basketData,Kt=dt.basketTotal,sn=dt.onClose,En=sn===void 0?function(){}:sn,wn=dt.onDelete,hn=wn===void 0?function(){}:wn,Ln=Object(H.useRef)(),zn=Object(H.useRef)();return Object(H.useEffect)(function(){return zn.current?(Kt>=0&&!Ln.current&&(Ln.current=Bt.init(zn.current,function(){En()})),function(){Ln.current&&Ln.current.clear()}):void 0},[zn.current]),y.a.createElement(ce.a,{className:Ae.a.drawerWrap,placement:"right",closable:!1,mask:!1,visible:kt,forceRender:!0,onClose:En},Kt>0?y.a.createElement("div",{style:{height:"100%"},ref:zn},y.a.createElement("div",{className:Ae.a.title},"\u8BD5\u9898\u7BEE"),tn.map(function(un){return Lt[un.stateName]>0&&y.a.createElement("div",{className:Ae.a.problemset,key:un.type},y.a.createElement("div",{className:Ae.a.content},un.typeName,"(",Lt[un.stateName],")"),y.a.createElement("div",{className:Ae.a.delete,onClick:function(){return hn(un.type)}},y.a.createElement("i",{className:"iconfont icon-shanchu1 ".concat(Ae.a.deleteIcon)})))}),y.a.createElement("div",{className:Ae.a.previewWrap},y.a.createElement("div",{className:Ae.a.preview,onClick:function(){return x.d.push("/problemset/preview")}},"\u8BD5\u5377\u9884\u89C8"))):y.a.createElement("div",{ref:zn},y.a.createElement(ie.a,{customText:"\u8BF7\u9009\u62E9\u8BD5\u9898\u8FDB\u884C\u7EC4\u5377"})))},_n={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PROGRAM:"\u7F16\u7A0B\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",COMBINATION:"\u7EC4\u5408\u9898"},yn=function(dt){var kt,Lt,Kt=dt.problemset,sn=dt.globalSetting,En=dt.loading,wn=dt.dispatch,hn=dt.onReloadData,Ln=hn===void 0?function(){}:hn,zn=dt.onReloadBasketData,un=zn===void 0?function(){}:zn,Sn=Object(o.a)(dt,["problemset","globalSetting","loading","dispatch","onReloadData","onReloadBasketData"]),di=function(){var Nn=Object(v.a)(j.a.mark(function zt(){var An;return j.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return Un.next=2,wn({type:"problemset/basketDelete",payload:Kt.actionTabs.params});case 2:An=Un.sent,wn({type:"problemset/setActionTabs",payload:{}}),An.status===0&&(Ln(),un());case 5:case"end":return Un.stop()}},zt)}));return function(){return Nn.apply(this,arguments)}}();return y.a.createElement(A.a,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,visible:Kt.actionTabs.key==="Problemset-BasketDelete",title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:En["problemset/handleDelete"],width:"442px",onOk:di,onCancel:function(){wn({type:"problemset/setActionTabs",payload:{}})}},y.a.createElement("div",{className:fe.a.modalContent},"\u662F\u5426\u5220\u9664\u8BD5\u9898\u7BEE\u4E2D",_n[(kt=Kt.actionTabs)===null||kt===void 0||((Lt=kt.params)===null||Lt===void 0)?void 0:Lt.type]))},Gt=Object(x.a)(function(Zt){var dt=Zt.problemset,kt=Zt.loading,Lt=Zt.globalSetting;return{problemset:dt,globalSetting:Lt,loading:kt.effects}})(yn),ii=G("A60/"),Dn=G.n(ii),Ci=function(dt){var kt=dt.count,Lt=dt.visibleBasket,Kt=dt.onToggleVisible,sn=Kt===void 0?function(){}:Kt;return y.a.createElement("div",{className:"".concat(Lt?Dn.a.right180:Dn.a.right20," ").concat(Dn.a.wrap)},y.a.createElement(h.a,{title:"\u8BD5\u9898\u7BEE",placement:"left"},y.a.createElement("div",{className:Dn.a.basket,onClick:sn},kt>0&&y.a.createElement("div",{className:Dn.a.count},kt),y.a.createElement("span",{className:Dn.a.iconWrap},y.a.createElement("i",{className:"".concat(Dn.a.icon," iconfont icon-shitilan")})),y.a.createElement("p",{className:Dn.a.name},"\u8BD5\u9898\u7BEE"))))},fi=G("EJTS"),In=G("LE3n"),Ri=G("1vsH"),Si=G("xKgJ"),Ot=G("/zsF"),bn=G("PArb"),Cn=G("jCWc"),kn=G("kPKH"),Ai=G("y8nQ"),Ui=G("Vl3Y"),dr=G("nSDg"),mn=G.n(dr),Jt=G("HBuW"),qi=G("NLgs"),hr=G("vkP9"),sr=g.a.Search,Fn={id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]},er={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"}]},kr=function(dt){var kt,Lt,Kt,sn,En=dt.classroomList,wn=dt.loading,hn=dt.dispatch,Ln=dt.cb,zn=dt.shixunIds,un=zn===void 0?[]:zn,Sn=Object(Je.i)(),di=Object(Je.h)(),Nn=En.actionTabs,zt=Ui.a.useForm(),An=Object(s.a)(zt,1),si=An[0],Un=En.shixunLists,Xt=Object(H.useState)([]),jt=Object(s.a)(Xt,2),pn=jt[0],Ct=jt[1],Nt=Object(H.useState)([]),Dt=Object(s.a)(Nt,2),Pe=Dt[0],Yt=Dt[1],xn=Object(H.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}),pi=Object(s.a)(xn,2),On=pi[0],tr=pi[1];Object(H.useEffect)(function(){En.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"&&hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})},[En.actionTabs.key]),Object(H.useEffect)(function(){return document.body.setAttribute("data-custom","height"),function(){document.body.removeAttribute("data-custom")}},[]),Object(H.useEffect)(function(){nr()},[Sn]);var nr=function(){var Ft=Object(v.a)(j.a.mark(function yi(){var li;return j.a.wrap(function(ir){for(;;)switch(ir.prev=ir.next){case 0:return ir.next=2,Object(Jt.pb)({});case 2:li=ir.sent,Yt((li==null?void 0:li.disciplines)||[]);case 4:case"end":return ir.stop()}},yi)}));return function(){return Ft.apply(this,arguments)}}(),Fi=function(yi,li,$n){On.tag_level=yi,On.sub_discipline_id=li,On.discipline_id=$n,tr(Object(m.a)({},On)),hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})},Bn=function(){hn({type:"classroomList/setActionTabs",payload:{}}),tr({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 En.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:y.a.createElement(ce.a,{placement:"bottom",height:"100%",closable:!0,onClose:Bn,visible:En.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",key:"bottom",className:mn.a.drawer,footer:y.a.createElement("div",{className:"tc"},y.a.createElement(P.a,{size:"large",onClick:function(){Bn(),Ct([])},style:{marginRight:8}},"\u53D6\u6D88"),y.a.createElement(P.a,{size:"large",onClick:Object(v.a)(j.a.mark(function Ft(){var yi,li,$n;return j.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:yi=function($t){var dn=pn[$t];if(un.includes(dn)){var Gn,Mn;return c.b.info("\u8BF7\u52FF\u91CD\u590D\u9009\u62E9\uFF1A".concat(Un==null||((Gn=Un.shixun_list)===null||Gn===void 0||((Mn=Gn.find(function(qn){return qn.id===dn}))===null||Mn===void 0))?void 0:Mn.title)),{v:void 0}}},li=0;case 2:if(!(li<(pn==null?void 0:pn.length))){Qt.next=9;break}if($n=yi(li),!(typeof $n=="object")){Qt.next=6;break}return Qt.abrupt("return",$n.v);case 6:li++,Qt.next=2;break;case 9:Bn(),Ln(pn),Ct([]);case 12:case"end":return Qt.stop()}},Ft)})),type:"primary"},"\u786E\u5B9A"))},y.a.createElement("section",{className:"tc"},y.a.createElement(hr.a,{onChange:function(yi){tr(Object(m.a)(Object(m.a)(Object(m.a)({},On),yi),{},{page:1})),hn({type:"classroomList/getShixunLists",payload:Object(m.a)(Object(m.a)(Object(m.a)({},On),yi),{},{page:1})})}})),y.a.createElement("section",{className:"edu-container"},y.a.createElement("ul",{className:mn.a.menu},y.a.createElement("li",null,Fn.name),Fn==null||((kt=Fn.children)===null||kt===void 0)?void 0:kt.map(function(Ft,yi){return y.a.createElement("li",{className:On[Fn.id]==Ft.id?mn.a.actived:"",key:Ft.id,onClick:function(){On[Fn.id]=Ft.id,tr(Object(m.a)({},On)),hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})}},y.a.createElement("strong",null,Ft.name))})),y.a.createElement("ul",{className:mn.a.menuDirection},y.a.createElement("li",{className:mn.a.directionName},"\u65B9\u5411"),y.a.createElement("li",{className:On.discipline_id?"":mn.a.actived,onClick:function(){Fi(null,null,null)}},y.a.createElement("strong",null,"\u5168\u90E8")),Pe==null?void 0:Pe.map(function(Ft,yi){return y.a.createElement("li",{key:yi,className:On.discipline_id==Ft.id?mn.a.actived:""},y.a.createElement("strong",{onClick:function(){Fi(1,null,Ft.id)}},Ft.name),y.a.createElement("div",null,Ft.sub_disciplines.map(function(li,$n){return y.a.createElement("div",{key:$n,className:"mt5"},y.a.createElement("div",{className:On.sub_discipline_id==li.id?"".concat(mn.a.actived2," ").concat(mn.a.subTag):mn.a.subTag,onClick:function(){Fi(2,li.id,Ft.id)}},li.name),y.a.createElement("ul",{className:"mt5"},li.tags&&li.tags.map(function(ir,Qt){return y.a.createElement("li",{key:Qt,className:On.sub_discipline_id==ir.id&&On.tag_level===3?mn.a.actived2:"",onClick:function(){Fi(3,ir.id,Ft.id)}},ir.name)})))})))})),y.a.createElement("ul",{className:mn.a.menu},y.a.createElement("li",null,er.name),er==null||((Lt=er.children)===null||Lt===void 0)?void 0:Lt.map(function(Ft,yi){return y.a.createElement("li",{className:On[er.id]==Ft.id?mn.a.actived:"",key:Ft.name,onClick:function(){On[er.id]=Ft.id,tr(Object(m.a)({},On)),hn({type:"classroomList/getShixunLists",payload:Object(m.a)({},On)})}},y.a.createElement("strong",null,Ft.name))})),y.a.createElement(Z.a,null,y.a.createElement(kn.a,{flex:"1"},y.a.createElement("div",{className:mn.a.menuCourse,style:{margin:"0px 15px"}},y.a.createElement("ul",null,y.a.createElement("li",null,"\u5DF2\u9009",y.a.createElement("span",{className:"c-blue"},pn.length),"\u4E2A\u5B9E\u8BAD"),y.a.createElement("li",null,"\u5171",y.a.createElement("span",{className:"c-blue"},Un.shixuns_count),"\u4E2A\u8BFE\u7A0B"),y.a.createElement("li",{className:"current",onClick:function(){var yi=Object(m.a)(Object(m.a)({},On),{},{order:On.order==="asc"?"desc":"asc"});tr(yi),hn({type:"classroomList/getShixunLists",payload:yi})}},"\u5B66\u4E60\u4EBA\u6570",y.a.createElement("p",{className:"edu-sorter current ".concat(On.order)},On.order==="asc"?y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):y.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"})))))),y.a.createElement(kn.a,{className:"c-grey-999"},"\u4EC5\u5DF2\u53D1\u5E03\u7684\u5B9E\u8BAD\u8FDB\u5165\u672C\u5217\u8868\u5907\u9009")),Un==null||((Kt=Un.shixun_list)===null||Kt===void 0)?void 0:Kt.map(function(Ft,yi){return y.a.createElement("div",{className:mn.a.listItem,key:yi},y.a.createElement(a.a,{checked:pn.includes(Ft.id),value:Ft.id,disabled:Ft==null?void 0:Ft.need_authorize,onChange:function($n){var ir=pn.indexOf(Ft.id);pn.indexOf(Ft.id)>-1?Ct(pn.filter(function(Qt){return Qt!==Ft.id})):Ct(pn.concat(Ft.id))}}),y.a.createElement("div",{className:mn.a.info},y.a.createElement("div",{className:mn.a.title},y.a.createElement("div",{className:mn.a.titleLeft},y.a.createElement("a",{className:"c-black",href:"/shixuns/".concat(Ft==null?void 0:Ft.identifier,"/challenges"),target:"_blank"},y.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Ft.title}})),(Ft==null?void 0:Ft.need_authorize)&&y.a.createElement("span",{onClick:function(){Object(qi.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(Si.v)()&&(Ft==null?void 0:Ft.mark_status)===1&&y.a.createElement(h.a,{title:Ft==null?void 0:Ft.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(Si.v)()&&(Ft==null?void 0:Ft.mark_status)===2&&y.a.createElement(h.a,{title:Ft==null?void 0:Ft.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(Si.v)()&&(Ft==null?void 0:Ft.mark_status)===3&&y.a.createElement(h.a,{title:Ft==null?void 0:Ft.mark_content},y.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),y.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},y.a.createElement("span",{className:mn.a.description,dangerouslySetInnerHTML:{__html:Ft.description}})),y.a.createElement("div",{className:" mt15"},Ft.challenge_names.map(function(li,$n){return y.a.createElement("span",{key:$n,className:"mr30 font12"},"\u7B2C",$n+1,"\u5173 ",li," ")})),y.a.createElement(bn.a,{dashed:!0}),y.a.createElement("div",{className:"c-light-black mt20 font12"},y.a.createElement("span",null,Ft.author_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,Ft.author_school_name),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",Ft.level),y.a.createElement("span",{className:"ml15 mr15"},"|"),y.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),y.a.createElement("span",null,Ft.study_count))))}),(Un==null||((sn=Un.shixun_list)===null||sn===void 0)?void 0:sn.length)===0&&y.a.createElement(ie.a,null),y.a.createElement("p",null)),y.a.createElement("div",{className:"tc mt20"},y.a.createElement(V.a,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:10,showSizeChanger:!1,current:On.page||1,showQuickJumper:!0,total:Un==null?void 0:Un.shixuns_count,onChange:function(yi){var li=Object(m.a)(Object(m.a)({},On),{},{page:yi});tr(li),hn({type:"classroomList/getShixunLists",payload:li})}})))},Qr=Object(x.a)(function(Zt){var dt=Zt.classroomList,kt=Zt.loading;return{classroomList:dt,loading:kt}})(kr),yt=G("mgmH"),cn=G("ErOA"),Kr=G("ORt/"),zr=G.n(Kr),na=G("Ot1p"),Gr=function(dt,kt){var Lt,Kt=dt.data,sn=Ui.a.useForm(),En=Object(s.a)(sn,1),wn=En[0],hn=Object(H.useState)({}),Ln=Object(s.a)(hn,2),zn=Ln[0],un=Ln[1];return Object(H.useEffect)(function(){Kt&&(un(Kt),wn.setFieldsValue(Object(m.a)({},Kt)))},[Kt]),Object(H.useImperativeHandle)(kt,function(){return{form:wn}}),y.a.createElement("div",{className:zr.a.operating},y.a.createElement(Ui.a,{form:wn,scrollToFirstError:!0,onValuesChange:function(){un(Object(m.a)({},wn.getFieldsValue()))}},y.a.createElement(Ui.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"}]},y.a.createElement(g.a,{placeholder:"\u8BF7\u8F93\u5165\u6807\u9898\uFF0C\u6700\u5927\u9650\u523630\u4E2A\u5B57\u7B26",suffix:"".concat(((Lt=zn.name)===null||Lt===void 0?void 0:Lt.length)||0,"/30")})),y.a.createElement(Ui.a.Item,{name:"languages",label:"\u7F16\u7A0B\u8BED\u8A00",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},y.a.createElement(a.a.Group,null,y.a.createElement(a.a,{value:"c"},"C"),y.a.createElement(a.a,{value:"c++"},"C++"),y.a.createElement(a.a,{value:"java"},"Java"),y.a.createElement(a.a,{value:"python"},"Python"))),y.a.createElement("div",{className:zr.a.tip},"\u9009\u62E9\u652F\u6301\u4EE5\u4E0B\u7F16\u7A0B\u8BD5\u9898\u8FDB\u884C\u7F16\u8BD1\u7684\u8BED\u8A00"),y.a.createElement("div",{style:{margin:"20px 0 12px 0px"}},"\u8BF4\u660E"),y.a.createElement(Ui.a.Item,{name:"description"},y.a.createElement(na.a,{defaultValue:zn.description||"",watch:!0}))))},$=Object(H.forwardRef)(Gr),S=G("SVaM"),D=G("sesT"),z=G.n(D),te=G("wNkr"),Y=G.n(te),Le=G("xTzM"),ct=G.n(Le),Pt=N.a.TabPane,rn=g.a.Search,ht=g.a.TextArea,Vt;(function(Zt){Zt.Mine="0",Zt.Public="1",Zt.Collection="2",Zt.TeachGroupShare="3"})(Vt||(Vt={}));var hi=function(dt){var kt,Lt,Kt,sn,En,wn,hn,Ln,zn,un,Sn,di,Nn=dt.classroomList,zt=dt.problemset,An=dt.user,si=dt.globalSetting,Un=dt.loading,Xt=dt.dispatch,jt=dt.match,pn=dt.shixunHomeworks,Ct=Object(o.a)(dt,["classroomList","problemset","user","globalSetting","loading","dispatch","match","shixunHomeworks"]),Nt=Object(H.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:((kt=Ct.location)===null||kt===void 0||((Lt=kt.query)===null||Lt===void 0)?void 0:Lt.id)||null,exam_id:(jt==null||((Kt=jt.params)===null||Kt===void 0)?void 0:Kt.id)||null,exercise_id:(jt==null||((sn=jt.params)===null||sn===void 0)?void 0:sn.categoryId)||null}),Dt=Object(s.a)(Nt,2),Pe=Dt[0],Yt=Dt[1],xn=Object(H.useState)(0),pi=Object(s.a)(xn,2),On=pi[0],tr=pi[1],nr=Object(H.useState)([]),Fi=Object(s.a)(nr,2),Bn=Fi[0],Ft=Fi[1],yi=Object(H.useState)(Vt.Mine),li=Object(s.a)(yi,2),$n=li[0],ir=li[1],Qt=Object(H.useState)(0),qt=Object(s.a)(Qt,2),$t=qt[0],dn=qt[1],Gn=Object(H.useState)(-1),Mn=Object(s.a)(Gn,2),qn=Mn[0],mi=Mn[1],Tr=Object(H.useState)([]),Zn=Object(s.a)(Tr,2),$r=Zn[0],gi=Zn[1],fr=Object(H.useState)(!1),rr=Object(s.a)(fr,2),Mr=rr[0],ka=rr[1],Do=Object(H.useState)([]),ua=Object(s.a)(Do,2),Wi=ua[0],lo=ua[1],uo=Object(H.useState)(0),va=Object(s.a)(uo,2),_a=va[0],Qa=va[1],co=Object(H.useState)(!1),Ma=Object(s.a)(co,2),wa=Ma[0],ho=Ma[1],fo=Object(H.useState)(!1),Na=Object(s.a)(fo,2),po=Na[0],$a=Na[1],ya=Object(H.useRef)(!1),ia=Object(H.useRef)(""),ba=Object(H.useRef)(),ye=Object(H.useRef)(),Oe=Object(H.useRef)(),Me=Object(H.useState)(),Ce=Object(s.a)(Me,2),re=Ce[0],me=Ce[1],oe=Object(H.useState)([]),we=Object(s.a)(oe,2),ve=we[0],ke=we[1],Ie=Object(H.useRef)(!1),je=(jt==null?void 0:jt.url)==="/problemset",Ze=jt==null||((En=jt.url)===null||En===void 0)?void 0:En.includes("program_homework"),mt=Ze&&jt!==null&&jt!==void 0&&(wn=jt.params)!==null&&wn!==void 0&&wn.categoryId&&jt!==null&&jt!==void 0&&(hn=jt.url)!==null&&hn!==void 0&&hn.includes("edit")?jt==null||((Ln=jt.params)===null||Ln===void 0)?void 0:Ln.categoryId:"",bt=mt?"\u7F16\u8F91\u7F16\u7A0B\u4F5C\u4E1A":"\u65B0\u5EFA\u7F16\u7A0B\u4F5C\u4E1A",Ut=Object(H.useState)({}),Rn=Object(s.a)(Ut,2),Qn=Rn[0],jn=Rn[1],Vn=Object(H.useState)(!1),Yn=Object(s.a)(Vn,2),Xn=Yn[0],Wn=Yn[1],Jn=An.userInfo||{},ei=Jn.admin,ki=Jn.business,ti=Jn.is_shixun_marker,gn=Jn.is_teacher,fn=Jn.user_identity,Hn=ei||ki||ti||gn||fn!=="\u5B66\u751F",ui=Object(H.useState)("\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F"),an=Object(s.a)(ui,2),ci=an[0],Mi=an[1],ri=pn.commonHomeWorkAddDefaultData,wi=Object(H.useState)([]),bi=Object(s.a)(wi,2),Hi=bi[0],Gi=bi[1],Bi=Object(H.useRef)(null),vr=Object(H.useState)(!1),Lr=Object(s.a)(vr,2),Cr=Lr[0],Vi=Lr[1],Di=Object(H.useState)([]),Ei=Object(s.a)(Di,2),Tn=Ei[0],xi=Ei[1],Nr=Object(H.useState)(""),Zr=Object(s.a)(Nr,2),ra=Zr[0],Ti=Zr[1],Vr=Object(H.useState)(!1),Jr=Object(s.a)(Vr,2),Oi=Jr[0],vi=Jr[1],ji=Object(H.useRef)(null),Ua=[{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u5347\u5E8F",type:"updated_at",direction:"asc"},{name:"\u6309\u66F4\u65B0\u65F6\u95F4\u964D\u5E8F",type:"updated_at",direction:"desc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u5347\u5E8F",type:"quotes",direction:"asc"},{name:"\u6309\u4F7F\u7528\u6B21\u6570\u964D\u5E8F",type:"quotes",direction:"desc"}];Object(H.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var Za=function(){var et=Object(v.a)(j.a.mark(function Qe(){var Ge,nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Be.q)({id:mt});case 2:Ge=wt.sent,Ge!=null&&Ge.name&&(ot={description:Ge.description,languages:Ge.languages,name:Ge.name},ji.current.form.setFieldsValue(ot),jn(Object(m.a)({},ot)),xi(Object(w.a)(Ge.data)),ke((nt=Ge.data)===null||nt===void 0?void 0:nt.map(function(Et){return Et.id})));case 4:case"end":return wt.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}();Object(H.useEffect)(function(){mt&&Za()},[mt]),Object(H.useEffect)(function(){var et;Xt({type:"problemset/getDisciplines",payload:{source:"question"}});var Qe=((et=Ct.location.query)===null||et===void 0?void 0:et.group_id)||0;Pe.group_id=Number(Qe),Yt(Pe),$i(Pe).then(function(Ge){Ge!=null&&Ge.status||Gi(Ge==null?void 0:Ge.item_banks_group),Vi(!1)}),Xr(),Ea()},[]),Object(H.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(H.useEffect)(function(){return Xt({type:"globalSetting/headerFixedToggle",payload:!0}),function(){Xt({type:"globalSetting/headerFixedToggle",payload:!1})}},[]),Object(H.useEffect)(function(){return Xt({type:"globalSetting/headerFooterToggle",payload:je}),function(){Xt({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(H.useEffect)(function(){Object(Ri.X)(Ze?bt:"\u8BD5\u9898\u5E93")},[Ze,bt]);var ca=function(Qe,Ge){var nt=[];if(!Qe){var ot,At;zt==null||((ot=zt.disciplinesData)===null||ot===void 0||((At=ot.disciplines)===null||At===void 0))||At.forEach(function(Ki){var Ur;Ki==null||((Ur=Ki.sub_disciplines)===null||Ur===void 0)||Ur.forEach(function(ta){var Da;ta==null||((Da=ta.tag_disciplines)===null||Da===void 0)||Da.forEach(function(Br){Br.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&nt.push(Br)})})})}if(Qe&&!Ge){var wt,Et,ln,ni=zt==null||((wt=zt.disciplinesData)===null||wt===void 0||((Et=wt.disciplines)===null||Et===void 0))?void 0:Et.find(function(Ki){return Ki.id===Qe});ni==null||((ln=ni.sub_disciplines)===null||ln===void 0)||ln.forEach(function(Ki){var Ur;Ki==null||((Ur=Ki.tag_disciplines)===null||Ur===void 0)||Ur.forEach(function(ta){ta.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&nt.push(ta)})})}if(Qe&&Ge){var Sr,Kn,yr,br,mr=zt==null||((Sr=zt.disciplinesData)===null||Sr===void 0||((Kn=Sr.disciplines)===null||Kn===void 0))?void 0:Kn.find(function(Ki){return Ki.id===Qe}),Ar=mr==null||((yr=mr.sub_disciplines)===null||yr===void 0)?void 0:yr.find(function(Ki){return Ki.id===Ge});Ar==null||((br=Ar.tag_disciplines)===null||br===void 0)||br.forEach(function(Ki){Ki.name!=="\u672A\u5339\u914D\u77E5\u8BC6\u70B9"&&nt.push(Ki)})}return nt},Ea=function(){var et=Object(v.a)(j.a.mark(function Qe(){return j.a.wrap(function(nt){for(;;)switch(nt.prev=nt.next){case 0:Xt({type:"problemset/getTeachGroupData"});case 1:case"end":return nt.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}();Object(H.useEffect)(function(){var et=zt.basketData||{},Qe=et.completion_questions_count,Ge=Qe===void 0?0:Qe,nt=et.judgement_questions_count,ot=nt===void 0?0:nt,At=et.multiple_questions_count,wt=At===void 0?0:At,Et=et.practical_questions_count,ln=Et===void 0?0:Et,ni=et.program_questions_count,Sr=ni===void 0?0:ni,Kn=et.single_questions_count,yr=Kn===void 0?0:Kn,br=et.subjective_questions_count,mr=br===void 0?0:br,Ar=et.combination_questions_count,Ki=Ar===void 0?0:Ar,Ur=Ge+ot+wt+ln+Sr+yr+mr+Ki;Qa(Ur)},[zt.basketData]);var $i=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return nt=Object(m.a)({},Ge),nt.item_type=Ze?"PROGRAM":Ge.item_type,Vi(!0),nt.keyword=encodeURIComponent(Ge.keyword||""),wt.next=6,Xt({type:"problemset/getItemBanks",payload:nt});case 6:if(ot=wt.sent,!(ot&&ot.status!==403&&ot.status!==401&&ot.status!==500)){wt.next=18;break}return tr(ot.items_count||0),Ft(ot.items||[]),gi(ot.tag_disciplines||[]),me(ot.used_shixun_ids||[]),Ba(ot.items||[]),Ze||ke([]),lo((ot==null?void 0:ot.navigation)||[]),dn((ot==null?void 0:ot.added_num)||0),Vi(!1),wt.abrupt("return",ot);case 18:case"end":return wt.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Xr=function(){Xt({type:"problemset/getBasketList",payload:{}})},Ba=function(Qe){var Ge=Qe.every(function(nt){var ot;return((ot=nt.program_attr)===null||ot===void 0?void 0:ot.status)===0});ya.current=Ge},Po=function(Qe,Ge){if(Pe.discipline_id=Qe||"",Pe.sub_discipline_id=Ge||"",Pe.tag_discipline_id="",Pe.page=1,Pe.per_page=20,delete Pe.id,mi(Qe===null?-1:null),Yt(Pe),$i(Pe),Qe===null)return},Io=function(Qe){Pe.item_type=Qe||"",Pe.page=1,Pe.per_page=20,Yt(Pe),$i(Pe)},mo=function(Qe){Pe.difficulty=Qe||"",Pe.page=1,Pe.per_page=20,delete Pe.id,Yt(Pe),$i(Pe)},Ja=function(Qe){Pe.tag_discipline_id=Qe,Pe.page=1,Pe.per_page=20,delete Pe.id,Qe===-1&&(Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id=""),mi(Qe),Yt(Pe),$i(Pe)},qa=Object(H.useState)(!1),da=Object(s.a)(qa,2),xa=da[0],go=da[1],ja=function(Qe){Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:0,group_type:Qe}}),Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.item_type=null,Pe.difficulty=null,Pe.type=Qe,Qe==="0"?Pe.group_id=0:Pe.group_id=null,Qe==="3"&&Ze?Pe.only_published=!0:Pe.only_published=null,Qe==="3"?go(!0):go(!1),Pe.page=1,Pe.per_page=20,delete Pe.id,mi(-1),ir(Qe),Yt(Pe),$i(Pe)},Ta=function(Qe,Ge){Pe.page=Qe,Pe.per_page=Ge,Yt(Pe),$i(Pe)},ha=function(Qe){Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.item_type=null,Pe.difficulty=null,Pe.page=1,Pe.keyword=Qe,delete Pe.id,Qe?($a(!0),Object(S.a)({name:Qe,copywriting:Qe,position:Ze?"Practice":"ItemBank"})):$a(!1),mi(-1),Yt(Pe),$i(Pe)},Pi=function(){Pe.per_page=20,Yt(Pe),$i(Pe)},Dr=function(Qe){var Ge=Qe.length===Bn.length&&Pe.page>1?Pe.page-1:Pe.page;Pe.page=Ge,Pe.per_page=20,Xr(),Yt(Pe),$i(Pe)},fa=function(){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-PublicReview"}})},aa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge,nt){var ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!nt){wt.next=6;break}return wt.next=3,Object(Be.n)({id:Ge});case 3:wt.t0=wt.sent,wt.next=9;break;case 6:return wt.next=8,Object(Be.G)({id:Ge});case 8:wt.t0=wt.sent;case 9:ot=wt.t0,(ot==null?void 0:ot.status)===0&&Pi();case 11:case"end":return wt.stop()}},Qe)}));return function(Ge,nt){return et.apply(this,arguments)}}(),Sa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Ka(Ge);case 1:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),pa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Ha([Ge]);case 1:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Fa=function(Qe){ye.current="",ba.current="",A.a.confirm({centered:!0,width:530,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u8BD5\u9898\u7EA0\u9519",content:y.a.createElement("div",{className:"font14"},y.a.createElement("div",null,"\u9519\u8BEF\u7C7B\u578B\uFF1A"),y.a.createElement(O.a.Group,{className:"mt10",onChange:function(nt){return ba.current=nt.target.value}},y.a.createElement(O.a,{value:"\u9898\u5E72"},"\u9898\u5E72"),y.a.createElement(O.a,{value:"\u7B54\u6848"},"\u7B54\u6848"),y.a.createElement(O.a,{value:"\u89E3\u6790"},"\u89E3\u6790"),y.a.createElement(O.a,{value:"\u5C5E\u6027"},"\u5C5E\u6027"),y.a.createElement(O.a,{value:"\u5176\u5B83"},"\u5176\u5B83")),y.a.createElement("div",{className:"mt10"},"\u9519\u8BEF\u63CF\u8FF0\uFF1A"),y.a.createElement(ht,{className:"mt10",rows:4,defaultValue:ye.current,onChange:function(nt){return ye.current=nt.target.value}})),onOk:function(){return new Promise(function(){var nt=Object(v.a)(j.a.mark(function ot(At,wt){var Et;return j.a.wrap(function(ni){for(;;)switch(ni.prev=ni.next){case 0:if(ba.current&&ye.current){ni.next=3;break}return c.b.info("\u8BF7\u586B\u5199\u9519\u8BEF\u7C7B\u578B\u548C\u9519\u8BEF\u63CF\u8FF0\uFF01"),ni.abrupt("return",wt());case 3:return ni.next=5,Object(Be.o)({id:Qe,clazz:ba.current,description:ye.current});case 5:Et=ni.sent,Et.status===0&&c.b.info("\u6DFB\u52A0\u6210\u529F\uFF01"),At();case 8:case"end":return ni.stop()}},ot)}));return function(ot,At){return nt.apply(this,arguments)}}())}})},eo=function(Qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-SetPrivate",params:{id:Qe}}})},Wa=function(Qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-Delete",params:{id:Qe}}})},to=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot,At,wt;return j.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:if(nt=Ge.item_type,!(nt==="PROGRAM")){ln.next=12;break}return ot=Ge.program_attr.identifier,ln.next=5,Xt({type:"problemset/startExperience",payload:{id:ot}});case 5:if(At=ln.sent,!(At.status===0)){ln.next=10;break}return wt=At.identifier,Object(Ri.S)("/myproblems/".concat(wt)),ln.abrupt("return");case 10:return c.b.warn(At.message),ln.abrupt("return");case 12:Xt({type:"problemset/setActionTabs",payload:{key:nt,params:Ge}});case 13:case"end":return ln.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),qr=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot,At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!Pe.exam_id){Et.next=6;break}return Et.next=3,Object(Be.M)({item_id:Ge,id:Pe.exam_id});case 3:return nt=Et.sent,nt.status===0&&Pi(),Et.abrupt("return");case 6:if(!(Pe!=null&&Pe.exercise_id)){Et.next=12;break}return Et.next=9,Object(cn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Pe==null?void 0:Pe.exercise_id,item_bank_ids:[Ge]}});case 9:return ot=Et.sent,ot.status===0&&Pi(),Et.abrupt("return");case 12:return Et.next=14,Xt({type:"problemset/cancel",payload:{id:Ge,item_bank:1}});case 14:At=Et.sent,At.status===0&&(Pi(),Xr());case 16:case"end":return Et.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),oa=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Math.abs(Ge),group_type:Vt.Mine}}),Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.page=1,Pe.per_page=20,Pe.group_id=Math.abs(Ge),mi(-1),Yt(Pe),$i(Pe).then(function(At){return Gi(At==null?void 0:At.item_banks_group)});case 10:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),no=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot,At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!Pe.exam_id){Et.next=6;break}return Et.next=3,Object(Be.t)({exam_id:Pe.exam_id,item_bank_ids:[Ge]});case 3:return nt=Et.sent,nt.status===0&&Pi(),Et.abrupt("return");case 6:if(!(Pe!=null&&Pe.exercise_id)){Et.next=12;break}return Et.next=9,Object(cn.a)("/api/exercises/".concat(Pe==null?void 0:Pe.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:[Ge]}});case 9:return ot=Et.sent,ot.status===0&&Pi(),Et.abrupt("return");case 12:if(!(_a===200)){Et.next=15;break}return c.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),Et.abrupt("return");case 15:return Et.next=17,Xt({type:"problemset/select",payload:{item_bank_ids:[Ge]}});case 17:At=Et.sent,At.status===0&&(Pi(),Xr());case 19:case"end":return Et.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),io=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:if(Ge){ot.next=3;break}if(ve!=null&&ve.length){ot.next=3;break}return ot.abrupt("return",c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898"));case 3:Oe.current=[0],A.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:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow),style:{maxHeight:500,overflow:"auto"}},y.a.createElement("p",{className:"c-grey-333"},"\u8BF7\u9009\u62E9\u9700\u8981\u79FB\u52A8\u5230\u7684\u6587\u4EF6\u5939"),y.a.createElement(ne.a,{defaultValue:!0,value:Oe.current,onChange:function(wt){return Oe.current=wt}})),onOk:function(){var At=Object(v.a)(j.a.mark(function Et(){var ln,ni;return j.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.next=2,Object(Be.f)({ids:Ge?[Ge]:ve,groups_ids:(ln=Oe.current)===null||ln===void 0?void 0:ln[0]});case 2:ni=Kn.sent,Oe.current=[],(ni==null?void 0:ni.status)===0&&Pi();case 5:case"end":return Kn.stop()}},Et)}));function wt(){return At.apply(this,arguments)}return wt}()});case 5:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),ko=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(Be.D)({clazz:"ItemBank",id:Ge});case 2:nt=wt.sent,ot=(nt==null?void 0:nt.groups)||[],Oe.current=[],A.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:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow)},y.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"),y.a.createElement(a.a.Group,{className:pe.a.checkbox,defaultValue:Oe.current,onChange:function(ln){return Oe.current=ln}},ot==null?void 0:ot.map(function(Et){return y.a.createElement(a.a,{key:Et.group_id,value:Et.group_id},Et.name)}))),onOk:function(){var Et=Object(v.a)(j.a.mark(function ni(){return j.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:return Kn.abrupt("return",new Promise(function(){var yr=Object(v.a)(j.a.mark(function br(mr,Ar){var Ki,Ur,ta;return j.a.wrap(function(Br){for(;;)switch(Br.prev=Br.next){case 0:if(Oe.current.length){Br.next=3;break}return c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u64A4\u9500\u5171\u4EAB\u7684\u6559\u7814\u56E2\u961F"),Br.abrupt("return",Ar());case 3:return Ur=ot==null||((Ki=ot.map(function(yo){return yo.group_id}))===null||Ki===void 0)?void 0:Ki.filter(function(yo){return!Oe.current.includes(yo)}),Br.next=6,Object(Be.l)({ids:[Ge],clazz:"ItemBank",group_ids:Ur});case 6:return ta=Br.sent,Oe.current=[],(ta==null?void 0:ta.status)===0&&(c.b.info("\u64A4\u9500\u5171\u4EAB\u6210\u529F"),Pi()),Br.abrupt("return",mr());case 10:case"end":return Br.stop()}},br)}));return function(br,mr){return yr.apply(this,arguments)}}()));case 1:case"end":return Kn.stop()}},ni)}));function ln(){return Et.apply(this,arguments)}return ln}()});case 6:case"end":return wt.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Mo=function(Qe){Xt({type:"problemset/setActionTabs",payload:{key:"Problemset-BasketDelete",params:{type:Qe}}})},ro=function(){Xt({type:"problemset/setActionTabs",payload:{key:"\u65B0\u5EFA\u6587\u4EF6\u5939",params:Pe}});return},No=function(){var Qe={discipline_id:"&discipline_id=".concat(Pe.discipline_id),sub_discipline_id:"&sub_discipline_id=".concat(Pe.sub_discipline_id),tag_discipline_id:"&sub_discipline_id=".concat(Pe.tag_discipline_id),difficulty:"&difficulty=".concat(Pe.difficulty),item_type:"&item_type=".concat(Pe.item_type),group_id:"&group_id=".concat(Pe.group_id||0)},Ge="/problemset/newitem?pages=".concat(Pe.page);Object.keys(Qe).forEach(function(nt){Pe[nt]&&(Ge=Ge+Qe[nt])}),x.d===null||x.d===void 0||x.d.push(Ge)},Zi=function(Qe){var Ge=ve;if(!(Ge!=null&&Ge.length))return c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(_a+Ge.length>200&&Qe&&je){c.b.info("\u8BD5\u9898\u7BEE\u4E2D\u6700\u591A\u53EF\u518D\u52A0\u5165".concat(200-_a,"\u9898\uFF0C\u5F53\u524D\u9009\u4E2D").concat(Ge.length,"\u9898\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9"));return}Qe?Xi(Ge):pr(Ge)},Xi=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt;return j.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:nt=Object(w.a)(Ge),Bn.forEach(function(wt){if(nt.includes(wt.id)){var Et;wt.item_type==="PROGRAM"&&((Et=wt.program_attr)===null||Et===void 0?void 0:Et.status)===0&&Object(vt.remove)(nt,function(ln){return ln===wt.id})}}),A.a.confirm({width:530,title:"\u63D0\u793A",className:"custom-modal-divider ",icon:null,centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:y.a.createElement("div",null,"\u5F53\u524D\u5DF2\u9009\u62E9",Ge.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 wt=Object(v.a)(j.a.mark(function ln(){var ni;return j.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if(!Pe.exam_id){Kn.next=6;break}return Kn.next=3,Object(Be.t)({exam_id:Pe.exam_id,item_bank_ids:nt});case 3:ni=Kn.sent,Kn.next=15;break;case 6:if(!(Pe!=null&&Pe.exercise_id)){Kn.next=12;break}return Kn.next=9,Object(cn.a)("/api/exercises/".concat(Pe==null?void 0:Pe.exercise_id,"/select_questions.json"),{method:"post",body:{item_bank_ids:nt}});case 9:ni=Kn.sent,Kn.next=15;break;case 12:return Kn.next=14,Xt({type:"problemset/select",payload:{item_bank_ids:nt}});case 14:ni=Kn.sent;case 15:ni.status===0&&(Pi(),Xr());case 16:case"end":return Kn.stop()}},ln)}));function Et(){return wt.apply(this,arguments)}return Et}()});case 3:case"end":return At.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),pr=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt;return j.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!Pe.exam_id){At.next=6;break}return At.next=3,Object(cn.a)("/api/examination_banks/".concat(Pe.exam_id,"/batch_revoke_item.json"),{method:"post",body:{item_ids:Ge}});case 3:nt=At.sent,At.next=15;break;case 6:if(!(Pe!=null&&Pe.exercise_id)){At.next=12;break}return At.next=9,Object(cn.a)("/api/exercise_questions/delete_by_item_bank.json ",{method:"post",body:{exercise_id:Pe==null?void 0:Pe.exercise_id,item_bank_ids:Ge}});case 9:nt=At.sent,At.next=15;break;case 12:return At.next=14,Xt({type:"problemset/unselectAll",payload:{item_ids:Ge}});case 14:nt=At.sent;case 15:nt.status===0&&(Pi(),Xr());case 16:case"end":return At.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Yi=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt;return j.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(!(je&&_a===200)){At.next=3;break}return c.b.info("\u5DF2\u9009200\u4E2A\u8BD5\u9898\uFF08\u4E0D\u80FD\u5728\u9009\u7528\u66F4\u591A\u8BD5\u9898\uFF09"),At.abrupt("return");case 3:if(!Pe.exam_id){At.next=10;break}return At.next=6,Object(Be.t)({exam_id:Pe.exam_id,shixun_ids:Ge});case 6:nt=At.sent,nt.status===0&&Pi(),At.next=14;break;case 10:return At.next=12,Xt({type:"problemset/select",payload:{shixun_ids:Ge}});case 12:nt=At.sent,nt.status===0&&(Xr(),Pi());case 14:case"end":return At.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Aa=function(){Xt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}})},Ha=function(Qe){var Ge,nt,ot,At;if(!((Ge=zt.teachGroupData)!==null&&Ge!==void 0&&(nt=Ge.groups)!==null&&nt!==void 0&&nt.length))return c.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");A.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:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow)},y.a.createElement(a.a.Group,{className:pe.a.checkbox,defaultValue:Oe.current,onChange:function(Et){return Oe.current=Et}},(ot=zt.teachGroupData)===null||ot===void 0||((At=ot.groups)===null||At===void 0)?void 0:At.map(function(wt){return y.a.createElement(a.a,{key:wt.group_id,value:wt.group_id},wt.name)}))),onOk:function(){return new Promise(function(){var Et=Object(v.a)(j.a.mark(function ln(ni,Sr){var Kn,yr;return j.a.wrap(function(mr){for(;;)switch(mr.prev=mr.next){case 0:if((Kn=Oe.current)!==null&&Kn!==void 0&&Kn.length){mr.next=3;break}return c.b.info("\u8BF7\u5148\u9009\u62E9\u6559\u7814\u56E2\u961F"),mr.abrupt("return",Sr());case 3:return mr.next=5,Object(Be.l)({ids:Qe||ve,clazz:"ItemBank",group_ids:Oe.current});case 5:yr=mr.sent,(yr==null?void 0:yr.status)===0&&(c.b.info("\u6240\u9009\u8BD5\u9898\u6210\u529F\u5206\u4EAB\u81F3\u6559\u7814\u56E2\u961F"),Oe.current=[],ke([]),Pi(),ni());case 7:case"end":return mr.stop()}},ln)}));return function(ln,ni){return Et.apply(this,arguments)}}())}})},Pr=function(){var Qe=function(){var Ge=Object(v.a)(j.a.mark(function nt(){var ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return ka(!0),wt.next=3,Object(Be.j)({ids:ve});case 3:ot=wt.sent,ka(!1),(ot==null?void 0:ot.status)===0&&A.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(ot.success,"\u6761\u8BD5\u9898\uFF0C\u6709").concat(ot.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(){Dr(new Array(ot.success))}});case 6:case"end":return wt.stop()}},nt)}));return function(){return Ge.apply(this,arguments)}}();if(ve!=null&&ve.length){A.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(ve==null?void 0:ve.length,"\u6761\u8BD5\u9898\u8FDB\u884C\u5220\u9664\u64CD\u4F5C\uFF0C\u5220\u9664\u540E\u5C06\u65E0\u6CD5\u6062\u590D\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\uFF1F"),onOk:Qe});return}c.b.warn("\u8BF7\u9009\u62E9\u9700\u8981\u5220\u9664\u7684\u8BD5\u9898")},ao=function(){var Qe,Ge;if(!(ve!=null&&ve.length))return c.b.info("\u8BF7\u5148\u9009\u62E9\u8BD5\u9898");if(Bn!=null&&(Qe=Bn.filter(function(nt){return ve.includes(nt.id)}))!==null&&Qe!==void 0&&Qe.every(function(nt){return nt.public}))return c.b.info("\u6240\u9009\u8BD5\u9898\u5DF2\u516C\u5F00\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9");if(Bn!=null&&(Ge=Bn.filter(function(nt){return ve.includes(nt.id)}))!==null&&Ge!==void 0&&Ge.find(function(nt){var ot;return nt.item_type==="PROGRAM"&&((ot=nt.program_attr)===null||ot===void 0?void 0:ot.status)===0}))return c.b.info("\u5DF2\u9009\u9898\u4E2D\u5B58\u5728\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898");window.localStorage.getItem("problemset-set-public-hint-flag")==="1"||An.userInfo.professional_certification?Ka():A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u516C\u5F00\u89C4\u5219\u544A\u77E5",maskClosable:!0,icon:null,content:y.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",y.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",y.a.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u7533\u8BF7\u516C\u5F00\uFF1F",y.a.createElement("br",null),y.a.createElement(a.a,{className:"mt10",defaultChecked:!1,onChange:function(ot){return Ie.current=ot.target.checked}},"\u4E0D\u518D\u63D0\u793A")),onOk:function(){Ka()}})},Ka=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){var nt,ot;return j.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return nt=$n===Vt.TeachGroupShare?1:2,wt.next=3,Object(Be.g)({ids:Ge?[Ge]:ve,source:nt});case 3:ot=wt.sent,ot.status===0&&(Ie.current&&window.localStorage.setItem("problemset-set-public-hint-flag","1"),Ie.current=!1,ke([]),Pi());case 5:case"end":return wt.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),vo=function(Qe){A.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{className:pe.a.modalContent},"\u53D1\u5E03\u540E\u5373\u53EF\u5E94\u7528\u5230\u81EA\u5DF1\u7BA1\u7406\u7684\u8BFE\u5802"),y.a.createElement("div",{className:pe.a.modalContent}," \u662F\u5426\u786E\u8BA4\u53D1\u5E03?")),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ge=Object(v.a)(j.a.mark(function ot(){var At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(Be.L)({identifier:Qe});case 2:At=Et.sent,(At==null?void 0:At.status)===0&&(c.b.success("\u53D1\u5E03\u6210\u529F"),Pi());case 4:case"end":return Et.stop()}},ot)}));function nt(){return Ge.apply(this,arguments)}return nt}()})},ma=function(Qe){A.a.confirm({centered:!0,icon:null,title:"\u63D0\u793A",className:"custom-modal-divider",content:y.a.createElement("p",{className:pe.a.modalContent},"\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F"),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:function(){var Ge=Object(v.a)(j.a.mark(function ot(){var At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(Be.K)({identifier:Qe});case 2:At=Et.sent,(At==null?void 0:At.status)===0&&(c.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F"),Pi());case 4:case"end":return Et.stop()}},ot)}));function nt(){return Ge.apply(this,arguments)}return nt}()})},za=function(){var et=Object(v.a)(j.a.mark(function Qe(Ge){return j.a.wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Xt({type:"problemset/getDisciplines",payload:{source:"question",group_id:Ge,group_type:Vt.TeachGroupShare}}),Pe.page=1,Pe.group_id=Ge||null,delete Pe.id,Yt(Object(m.a)({},Pe)),$i(Pe);case 6:case"end":return ot.stop()}},Qe)}));return function(Ge){return et.apply(this,arguments)}}(),Oa=function(Qe){Pe.sort_by=Qe.type,Pe.sort_direction=Qe.direction,Pe.page=1,Pe.per_page=20,Mi(Qe.name),Yt(Pe),$i(Pe)},_o=function(){Pe.page=1,Yt(Pe),$i(Pe)},Ga=function(Qe){Pe.discipline_id="",Pe.sub_discipline_id="",Pe.tag_discipline_id="",Pe.item_type=null,Pe.difficulty=null,Pe.page=1,Pe.per_page=20,Pe.group_id=Qe,mi(-1),Yt(Pe),$i(Pe).then(function(Ge){return Gi(Ge==null?void 0:Ge.item_banks_group)})},_i=function(){if(!(ve!=null&&ve.length)){Xt({type:"problemset/setActionTabs",payload:{key:"\u5BFC\u51FA\u8BD5\u9898",params:Pe}});return}A.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5BFC\u51FA\u63D0\u793A",maskClosable:!0,icon:null,content:y.a.createElement("div",{className:"font14 ".concat(pe.a.overflow)},"\u5DF2\u9009\u4E2D",ve==null?void 0:ve.length,"\u9053\u9898\uFF0C\u5176\u4E2D\u7F16\u7A0B\u9898\u4E0E\u5B9E\u8BAD\u9898\u6682\u4E0D\u652F\u6301\u5BFC\u51FA\u3002"),onOk:function(){Object(yt.k)({ids:ve})}})},oi=function(){var et=Object(v.a)(j.a.mark(function Qe(){var Ge,nt,ot,At;return j.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(Be.i)({ids:ve});case 2:Ge=Et.sent,nt=Ge.data||{},ot=nt.unpublish_program_question_count,At=nt.total_item_banks,ot===0?A.a.error({title:"\u9519\u8BEF",content:y.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"}):A.a.confirm({title:"\u63D0\u793A",content:y.a.createElement("span",null,"\u5F53\u524D\u9009\u4E2D",At,"\u9898\uFF0C\u5176\u4E2D\u5305\u542B",ot,"\u9053\u672A\u53D1\u5E03\u7684\u7F16\u7A0B\u9898\uFF0C \u8BF7\u786E\u8BA4\u662F\u5426\u53D1\u5E03\uFF1F"),centered:!0,onOk:function(){var ln=Object(v.a)(j.a.mark(function Sr(){var Kn;return j.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,Object(Be.h)({ids:ve});case 2:Kn=br.sent,Kn.status===0&&(c.b.success("\u53D1\u5E03\u6210\u529F"),Pi());case 4:case"end":return br.stop()}},Sr)}));function ni(){return ln.apply(this,arguments)}return ni}()});case 5:case"end":return Et.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}(),lr=y.a.createElement(d.a,null,Hn&&y.a.createElement(d.a.Item,{onClick:function(){return Zi(!0)}},"\u6279\u91CF\u52A0\u5165"),Hn&&y.a.createElement(d.a.Item,{onClick:function(){return Zi(!1)}},"\u6279\u91CF\u79FB\u51FA"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:function(){return io()}},"\u79FB\u52A8\u5230"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:ao},"\u6279\u91CF\u516C\u5F00"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:function(){return Ha()}},"\u6279\u91CF\u5171\u4EAB"),$n===Vt.Mine&&je&&y.a.createElement(d.a.Item,{onClick:Pr},"\u6279\u91CF\u5220\u9664")),_r=function(Qe){if(Ze)if((Tn==null?void 0:Tn.length)<=0){var Ge=Bn.filter(function(ln){return Qe.includes(ln.id)});xi(Object(w.a)(Ge)),ke(Ge==null?void 0:Ge.map(function(ln){return ln.id}))}else if(Qe.length>Tn.length){var nt,ot=Bn.filter(function(ln){return Qe.includes(ln.id)}),At=Tn.map(function(ln){return ln.id}),wt=ot.filter(function(ln){return!At.includes(ln.id)});xi([].concat(Object(w.a)(Tn),Object(w.a)(wt))),ke((nt=[].concat(Object(w.a)(Tn),Object(w.a)(wt)))===null||nt===void 0?void 0:nt.map(function(ln){return ln.id}))}else{var Et=Tn.filter(function(ln){return Qe.includes(ln.id)});xi(Object(w.a)(Et)),ke(Et==null?void 0:Et.map(function(ln){return ln.id}))}else ke(Qe)},sa=function(Qe){if(Ze)if(Qe){var Ge,nt=Tn==null?void 0:Tn.map(function(Et){return Et.id}),ot=Bn.filter(function(Et){return!nt.includes(Et.id)});xi([].concat(Object(w.a)(Tn),Object(w.a)(ot))),ke((Ge=[].concat(Object(w.a)(Tn),Object(w.a)(ot)))===null||Ge===void 0?void 0:Ge.map(function(Et){return Et.id}))}else{var At=Bn==null?void 0:Bn.map(function(Et){return Et.id}),wt=Tn.filter(function(Et){return!At.includes(Et.id)});xi(Object(w.a)(wt)),ke(wt==null?void 0:wt.map(function(Et){return Et.id}))}else ke(Qe?Bn==null?void 0:Bn.map(function(Et){return Et.id}):[])},ea=function(){var Qe="/problemset/preview";if(Pe.exam_id&&(Qe="/paperlibrary/edit/".concat(Pe.exam_id)),Pe!=null&&Pe.exercise_id){var Ge;Qe="/classrooms/".concat(jt==null||((Ge=jt.params)===null||Ge===void 0)?void 0:Ge.coursesId,"/exercise/").concat(Pe==null?void 0:Pe.exercise_id,"/edit")}x.d.push(Qe)},Ra=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],la={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},ar=function(Qe,Ge){var nt,ot=Ge.id<0?"--":Hn?Ge[Pe.exercise_id?"added":"choosed"]?y.a.createElement("span",{key:1,className:pe.a.btnAdd,onClick:function(Et){Et.target.style.pointerEvents="none",qr(Ge.id)}},je?"\u79FB\u51FA\u8BD5\u9898\u7BEE":y.a.createElement("span",null,y.a.createElement("b",{className:"iconfont icon-yichu ".concat(pe.a.cancelC)}),"\u79FB\u51FA")):Ge.item_type==="PROGRAM"&&((nt=Ge.program_attr)===null||nt===void 0?void 0:nt.status)===0?y.a.createElement(h.a,{placement:"top",title:"\u7F16\u7A0B\u9898\u672A\u53D1\u5E03\uFF0C\u4E0D\u80FD\u52A0\u5165\uFF01"},y.a.createElement("span",{className:pe.a.btnAdd,style:{cursor:"not-allowed",background:"#E3E6EC",color:"#B1BACD"}}," ",je?"\u52A0\u5165\u8BD5\u9898\u7BEE":y.a.createElement("span",{style:{padding:"0 3px"}},y.a.createElement("b",{className:"iconfont icon-jiaru ".concat(pe.a.addC)}),"\u52A0\u5165")," ")):y.a.createElement("span",{className:pe.a.btnAdd,onClick:function(){return no(Ge.id)}},je?"\u52A0\u5165\u8BD5\u9898\u7BEE":y.a.createElement("span",{style:{padding:"0 3px"}},y.a.createElement("b",{className:"iconfont icon-jiaru ".concat(pe.a.addC)}),"\u52A0\u5165")):y.a.createElement(y.a.Fragment,null),At=y.a.createElement("span",{className:pe.a.actonBtn},Ge.id>0&&y.a.createElement(fi.a,{isProblemset:je,user:An,key:Ge.id,data:Ge,activeTabsKey:$n,selectIds:ve,onCollect:aa,onSetPublic:Sa,onStartExperience:to,onCorrection:Fa,onPublicReview:fa,onSetPrivate:eo,onDelete:Wa,onCancel:qr,onSelect:no,onMoveTo:io,onSetShare:pa,onCancelShare:ko,onPublish:vo,onCancelPublish:ma}),ot);return At};Object(H.useEffect)(function(){if(Ze){var et=jt.params,Qe=et.coursesId,Ge=et.categoryId;Xt({type:"shixunHomeworks/addCommonHomeWorkDefaultData",payload:{category:Ge,coursesId:Qe,type:5}})}},[Ze]);var La=function(){var et=Object(v.a)(j.a.mark(function Qe(){var Ge,nt,ot,At,wt;return j.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return ji.current.form.validateFields().catch(function(ni){document.body.scrollIntoView()}),ln.next=3,ji.current.form.validateFields();case 3:if(Ge=ji.current.form.getFieldsValue(),console.log(Ge,"value"),!((Tn==null?void 0:Tn.length)<=0)){ln.next=8;break}return c.b.info("\u8BF7\u9009\u62E9\u7F16\u7A0B\u9898"),ln.abrupt("return");case 8:return Wn(!0),nt=jt.params,ot=nt.coursesId,At=nt.categoryId,ln.next=12,Object(cn.a)(mt?"/api/homework_commons/".concat(At,"/update_hack.json"):"/api/courses/".concat(ot,"/homework_commons.json"),{method:mt?"put":"post",body:Object(m.a)(Object(m.a)({},Ge),{},{coursesId:ot,category:At,type:5,hack_ids:Tn==null?void 0:Tn.map(function(ni){return ni.id})})});case 12:wt=ln.sent,(wt==null?void 0:wt.status)===0&&x.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework/").concat(mt?At:wt.homework_id,"/detail?tabs=1")),Wn(!1);case 15:case"end":return ln.stop()}},Qe)}));return function(){return et.apply(this,arguments)}}();return y.a.createElement("div",{className:pe.a.page},y.a.createElement("section",null,y.a.createElement("div",{className:pe.a.wrap},ri.course_name&&Ze&&y.a.createElement("section",{className:"animated fadeIn"},y.a.createElement("aside",{className:"mt10"},ri.category&&y.a.createElement(p.a,{separator:">"},y.a.createElement(p.a.Item,null,y.a.createElement(F.a,{to:"/classrooms/".concat(ri.course_id,"/program_homework")},ri.course_name)),y.a.createElement(p.a.Item,null,y.a.createElement(F.a,{to:"/classrooms/".concat(ri.course_id,"/program_homework")},ri.category.category_name)),y.a.createElement(p.a.Item,null,bt)))),y.a.createElement("div",{className:pe.a.title},Ze?bt:"\u8BD5\u9898\u5E93"),Ze&&y.a.createElement($,{data:Qn,ref:ji}),y.a.createElement("div",{className:pe.a.headerWrapper},y.a.createElement("div",{className:pe.a.tabsWrap},y.a.createElement(N.a,{activeKey:$n,onChange:ja,tabBarExtraContent:y.a.createElement("div",{className:pe.a.searchWrap},$n===Vt.Mine&&je&&y.a.createElement(P.a,{className:pe.a.addQuestionBtn,onClick:No},y.a.createElement("img",{src:z.a,className:pe.a.pngIcon,alt:""}),"\u65B0\u589E\u8BD5\u9898"),y.a.createElement(rn,{allowClear:!0,suffix:y.a.createElement("i",{className:"iconfont icon-sousuo9 font14 ".concat(pe.a.searchIcon),onClick:function(){return ha(Pe.keyword)}}),className:pe.a.search,placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",size:"large",onChange:function(Qe){Pe.keyword=Qe.target.value,Yt(Object(m.a)({},Pe))},onSearch:ha}))},y.a.createElement(Pt,{tab:"\u516C\u5171",key:"1"}),((zn=zt.teachGroupData)===null||zn===void 0||((un=zn.groups)===null||un===void 0)?void 0:un.length)&&y.a.createElement(Pt,{tab:"\u6211\u7684\u7FA4\u7EC4",key:"3"}),!Object(Si.o)()&&!Object(Si.m)()&&!Ze&&y.a.createElement(Pt,{tab:"\u6536\u85CF\u5939",key:"2"}),y.a.createElement(Pt,{tab:"\u6211\u521B\u5EFA\u7684",key:"0"}))),y.a.createElement(Q.a,{showSelectAll:!1,className:pe.a.select,disciplinesData:(Sn=zt.disciplinesData)===null||Sn===void 0?void 0:Sn.disciplines,knowledgeData:$r,directionValue:Pe.discipline_id,subDisciplineValue:Pe.sub_discipline_id,typeValue:Pe.item_type,isprogram_homework:Ze,showKnowledge:!0,name:ra,setname:Ti,difficultyValue:Pe.difficulty,showShixun:!Object(Si.m)()&&!Pe.exercise_id&&$n!==Vt.TeachGroupShare&&$n!==Vt.Public,onShixunChange:Aa,onDirectionChange:Po,onTypeChange:Io,onDifficultyChange:mo,knowledgeValue:qn,onKnowledgeChange:Ja,teachGroupData:(di=zt.teachGroupData)===null||di===void 0?void 0:di.groups,onTeachGroupChange:za,teachGroupValue:Pe.group_id,showTeachGroup:xa})),y.a.createElement("div",{className:pe.a.treeWrapper,style:{display:$n===Vt.Mine?"block":"none"}},y.a.createElement("div",{className:pe.a.treeHeader},y.a.createElement(be.a,{data:Wi,onClick:oa}),y.a.createElement(P.a,{type:"link",onClick:ro,className:pe.a.exportBtn},y.a.createElement("img",{src:ct.a,alt:"",className:pe.a.pngIcon}),"\u65B0\u5EFA\u6587\u4EF6\u5939")),y.a.createElement(W.a,{spinning:Cr},y.a.createElement("div",{ref:Bi,className:pe.a.treeContent},y.a.createElement(In.a,{isProblemset:je,reloadData:Pi,data:Hi,onShare:Ha,onOpen:oa})))),y.a.createElement("div",{className:pe.a.contentWrap},y.a.createElement("div",{className:pe.a.batchWrap},y.a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center"}},!Ze&&y.a.createElement("div",{className:"font14"},y.a.createElement(B.a,{overlay:y.a.createElement(d.a,{selectedKeys:[ci]},Ua==null?void 0:Ua.map(function(et,Qe){return y.a.createElement(d.a.Item,{key:et.name,onClick:function(){return Oa(et)}},et.name)}))},y.a.createElement("span",{style:{color:"#464F66"}},y.a.createElement("i",{className:"iconfont icon-paixu font14 mr5 c-light-primary"}),ci))),Ze&&y.a.createElement("div",null,y.a.createElement(a.a,{checked:(Bn==null?void 0:Bn.filter(function(et){return Tn==null?void 0:Tn.map(function(Qe){return Qe.id}).includes(et.id)}).length)===Bn.length,onChange:function(Qe){return sa(Qe.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",ve==null?void 0:ve.length,")"))),Ze&&y.a.createElement(A.a,{visible:Oi,centered:!0,width:700,okText:"\u786E\u8BA4".concat(mt?"\u7F16\u8F91":"\u65B0\u5EFA"),onCancel:function(){return vi(!1)},cancelText:"\u8FD4\u56DE\u5217\u8868",onOk:La,confirmLoading:Xn,title:"\u67E5\u770B\u5DF2\u9009"},y.a.createElement("div",{className:"font14 c-light-primary mb10"},"\u5DF2\u9009",Tn==null?void 0:Tn.length,"\u4E2A"),y.a.createElement("div",{style:{height:400,overflow:"auto"}},Tn==null?void 0:Tn.map(function(et,Qe){var Ge,nt,ot,At,wt,Et;return y.a.createElement("div",{key:Qe,className:pe.a.sendModal},y.a.createElement("div",{className:pe.a.li},y.a.createElement("p",null,et==null?void 0:et.name),y.a.createElement("div",{className:pe.a.bottom},y.a.createElement("span",{className:"c-grey-333"},"\u7F16\u7A0B\u9898"),y.a.createElement("i",{className:pe.a.line}),y.a.createElement("span",{className:"c-grey-333"},et.difficulty===1&&"\u7B80\u5355",et.difficulty===2&&"\u9002\u4E2D",et.difficulty===3&&"\u56F0\u96BE"),y.a.createElement("i",{className:pe.a.line}),y.a.createElement("span",null,"\u521B\u5EFA\u8005\xA0",y.a.createElement(h.a,{title:et==null||((Ge=et.author)===null||Ge===void 0)?void 0:Ge.name},y.a.createElement("span",{className:"c-grey-333"},(et==null||((nt=et.author)===null||nt===void 0||((ot=nt.name)===null||ot===void 0))?void 0:ot.length)>6?(et==null||((At=et.author)===null||At===void 0||((wt=At.name)===null||wt===void 0))?void 0:wt.substr(0,3))+"...":et==null||((Et=et.author)===null||Et===void 0)?void 0:Et.name))),y.a.createElement("i",{className:pe.a.line}),y.a.createElement("span",{className:pe.a.des},"\u66F4\u65B0\xA0",y.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.updated_at)))),y.a.createElement("div",{className:pe.a.del,onClick:function(){_r(Tn.filter(function(ni){return ni.id!==et.id}).map(function(ni){return ni.id}))}},"\u5220\u9664"))})))),y.a.createElement("div",null,$n===Vt.Mine&&je&&y.a.createElement(P.a,{onClick:_i,type:"link",className:pe.a.exportBtn},y.a.createElement("img",{src:Y.a,className:pe.a.pngIcon}),y.a.createElement("span",null,"\u5BFC\u51FA\u8BD5\u9898")))),po?y.a.createElement("div",null,y.a.createElement(P.a,{style:{paddingLeft:0},onClick:function(){Pe.page=1,Pe.keyword=null,delete Pe.id,Yt(Pe),$a(!1),$i(Pe)},type:"link"}," ",y.a.createElement("i",{className:"iconfont icon-fanhui2 font14"}),"\u8FD4\u56DE"),y.a.createElement("span",{className:"font14 mr20 c-grey-333"},"\u641C\u7D22\u201C",decodeURIComponent(Pe.keyword),"\u201D")):null,y.a.createElement("div",{className:pe.a.contentListWrap},On!==0?y.a.createElement(W.a,{size:"large",spinning:Un["problemset/getItemBanks"]},Bn.map(function(et,Qe){var Ge,nt;return y.a.createElement("div",{className:pe.a.li},y.a.createElement("div",{className:pe.a.top},y.a.createElement(fi.b,{key:et.id,data:et,selectIds:ve,onSelectCheckBox:_r})),y.a.createElement("div",{className:pe.a.bottom},y.a.createElement("p",{className:"".concat(pe.a.actionLeftItem," ").concat(pe.a.questionTypeName)},(Ge=Ra.find(function(ot){return ot.type===et.item_type}))===null||Ge===void 0?void 0:Ge.name),y.a.createElement("p",{className:pe.a.actionLeftItem},la[et.difficulty]),y.a.createElement("p",{className:pe.a.actionLeftItem},"\u521B\u5EFA\u8005",y.a.createElement("span",{className:"c-grey-333"},et==null||((nt=et.author)===null||nt===void 0)?void 0:nt.name)),y.a.createElement("p",{className:pe.a.actionLeftItem},"\u66F4\u65B0",y.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.updated_at)),y.a.createElement("p",{className:pe.a.actionLeftItem},"\u4F7F\u7528\u6B21\u6570",y.a.createElement("span",{className:"c-grey-333"},et==null?void 0:et.quotes)),!Ze&&y.a.createElement("div",{className:pe.a.more},ar({},et))))})):y.a.createElement(W.a,{size:"large",spinning:Un["problemset/getItemBanks"]},y.a.createElement(ie.a,null))),On!==0&&!Ze&&y.a.createElement(V.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:Pe==null?void 0:Pe.per_page,current:Pe.page||1,total:On,showTotal:function(Qe){return y.a.createElement("span",{className:"mr10"},"\u5171",y.a.createElement("span",{className:"c-light-primary"},Qe),"\u6761\u6570\u636E")}}),Ze&&y.a.createElement("div",{style:{height:20}})),je&&y.a.createElement(nn,{basketData:zt.basketData,visible:wa,basketTotal:_a,onClose:function(){return ho(!1)},onDelete:Mo}),!Object(Si.m)()&&je&&y.a.createElement(Ci,{visibleBasket:wa,onToggleVisible:function(){return ho(!wa)},count:_a})),y.a.createElement(he,null),y.a.createElement(qe,{onReloadData:Pi}),y.a.createElement(pt,{onReloadData:function(){return Dr([null])}}),y.a.createElement(Gt,{onReloadData:Pi,onReloadBasketData:Xr}),Nn.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?y.a.createElement(Qr,{shixunIds:re,cb:Yi}):null,y.a.createElement(xt,null),y.a.createElement(Ye,null),y.a.createElement(St,null),y.a.createElement(ut,null),y.a.createElement(Ue,null),y.a.createElement(it,{onOk:_o}),y.a.createElement(q.a,{onOk:Ga})),je?y.a.createElement(H.Fragment,null,!!(ve!=null&&ve.length)&&y.a.createElement("div",{className:pe.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(a.a,{className:"font14",checked:Bn!=null&&Bn.length?ve.length===(Bn==null?void 0:Bn.length):!1,onChange:function(Qe){return sa(Qe.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",ve==null?void 0:ve.length,")"))),y.a.createElement("div",{className:pe.a.btns},Hn&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!0)}},y.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Hn&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!1)}},y.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return io()}},y.a.createElement("i",{className:"iconfont icon-yidongmulu font16"}),"\u6279\u91CF\u79FB\u52A8"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:ao}," ",y.a.createElement("i",{className:"iconfont icon-pilianggongkai"}),"\u6279\u91CF\u516C\u5F00"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Ha()}}," ",y.a.createElement("i",{className:"iconfont icon-pilianggongxiang"}),"\u6279\u91CF\u5171\u4EAB"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:Pr}," ",y.a.createElement("i",{className:"iconfont icon-piliangshanchu3 c-red"}),"\u6279\u91CF\u5220\u9664"),$n===Vt.Mine&&y.a.createElement("div",{className:pe.a.btn,onClick:oi}," ",y.a.createElement("i",{className:"iconfont icon-fabu5"}),"\u6279\u91CF\u53D1\u5E03"),y.a.createElement("div",{onClick:function(){return ke([])},style:{marginLeft:"auto"},className:pe.a.btn}," ",y.a.createElement("i",{className:"iconfont icon-piliangcaozuoicon2"}),"\u53D6\u6D88\u64CD\u4F5C"))))):Ze?"":y.a.createElement("div",{className:pe.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(a.a,{className:"font14",checked:Bn!=null&&Bn.length?ve.length===(Bn==null?void 0:Bn.length):!1,onChange:function(Qe){return sa(Qe.target.checked)}},"\u672C\u9875\u5168\u9009",y.a.createElement("span",{style:{color:"#999",fontSize:12}},"/\u5DF2\u9009(",ve==null?void 0:ve.length,")"))),y.a.createElement("div",{className:pe.a.btns},Hn&&!!(ve!=null&&ve.length)&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!0)}},y.a.createElement("i",{className:"iconfont icon-piliangjiaru"}),"\u6279\u91CF\u52A0\u5165"),Hn&&!!(ve!=null&&ve.length)&&y.a.createElement("div",{className:pe.a.btn,onClick:function(){return Zi(!1)}},y.a.createElement("i",{className:"iconfont icon-piliangyichu"}),"\u6279\u91CF\u79FB\u51FA"),y.a.createElement("div",{className:"c-grey-333 font12 mr40",style:{marginLeft:"auto"}},"\u5DF2\u52A0\u5165:\xA0\xA0",$t,"\u9898"),y.a.createElement("div",{onClick:ea,className:pe.a.btn},"\u8FD4\u56DE\u8BD5\u5377")))),Ze&&y.a.createElement("div",{className:pe.a.batch},y.a.createElement("aside",null,y.a.createElement("div",{style:{flexShrink:0,marginRight:20}},y.a.createElement(V.a,{showQuickJumper:!0,onChange:Ta,defaultCurrent:1,pageSize:Pe==null?void 0:Pe.per_page,current:Pe.page||1,hideOnSinglePage:!0,total:On,showTotal:function(Qe){return y.a.createElement("span",{className:"mr10"},"\u5171",y.a.createElement("span",{className:"c-light-primary"},Qe),"\u6761\u6570\u636E")}})),y.a.createElement("div",{className:pe.a.btns},y.a.createElement(Z.a,{align:"middle",style:{marginLeft:"auto"}},y.a.createElement(Z.a,{onClick:function(){if((Tn==null?void 0:Tn.length)<=0){c.b.info("\u5F53\u524D\u6682\u65E0\u6570\u636E");return}vi(!0)},align:"middle",className:"current"},y.a.createElement("i",{className:"iconfont icon-yixuan mr10 c-light-primary font20"}),y.a.createElement("span",null,"\u5DF2\u9009",y.a.createElement("span",{className:"c-light-primary"},ve.length),"\u4E2A")),y.a.createElement(P.a,{className:"mr20 ml40",onClick:function(){if(mt){var Qe;x.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework/").concat(jt==null||((Qe=jt.params)===null||Qe===void 0)?void 0:Qe.categoryId,"/detail?tabs=1"));return}x.d.push("/classrooms/".concat(jt.params.coursesId,"/program_homework"))}},"\u53D6\u6D88"),y.a.createElement(P.a,{loading:Xn,onClick:La,type:"primary"},"\u786E\u8BA4",mt?"\u7F16\u8F91":"\u65B0\u5EFA"))))))},Li=Xe.default=Object(x.a)(function(Zt){var dt=Zt.classroomList,kt=Zt.problemset,Lt=Zt.user,Kt=Zt.loading,sn=Zt.globalSetting,En=Zt.shixunHomeworks;return{classroomList:dt,problemset:kt,user:Lt,globalSetting:sn,loading:Kt.effects,shixunHomeworks:En}})(hi)},LE3n:function(ft,Xe,G){"use strict";var de=G("ozfa"),Z=G("MJZm"),M=G("k1fw"),V=G("+L6B"),I=G("2/Rp"),B=G("5NDa"),K=G("5rEg"),W=G("2qtc"),L=G("kLXV"),P=G("miYZ"),b=G("tsqr"),p=G("9og8"),_=G("tJVT"),h=G("WmNS"),r=G.n(h),d=G("q1tI"),l=G.n(d),a=G("1vnw"),u=G.n(a),c=G("ErOA"),R=G("Ix/O"),O=G.n(R),T=G("xTzM"),A=G.n(T),w=G("WCUW"),m=G("LvDl"),v=G.n(m),s=function(g){var C=g.isProblemset,N=g.name,U=g.id,j=g.itemBanksCount,H=g.onOpen,y=H===void 0?function(){}:H,x=g.onShare,F=x===void 0?function(){}:x,Q=g.onMove,q=Q===void 0?function(){}:Q,ie=g.onDeleteOk,ge=ie===void 0?function(){}:ie,fe=Object(d.useState)(!1),ue=Object(_.a)(fe,2),he=ue[0],_e=ue[1],le=Object(d.useState)(N),ne=Object(_.a)(le,2),Te=ne[0],Fe=ne[1],Ke=Object(d.useState)(N),Ue=Object(_.a)(Ke,2),He=Ue[0],Ne=Ue[1],Be=function(){var tt=Object(p.a)(r.a.mark(function it(rt){var qe,gt,pt;return r.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:if(qe=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],He.trim()){at.next=4;break}return b.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),at.abrupt("return");case 4:if(!(He.charAt(0)===" ")){at.next=7;break}return b.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),at.abrupt("return");case 7:gt=0;case 8:if(!(gt0?ie(function(rt){return _e(rt,Ue,{children:Be.map(function(qe){return{title:l.a.createElement(s,{isProblemset:C,name:qe.name,id:qe.id,itemBanksCount:qe.item_banks_count,onMove:fe,onOpen:j,onShare:y,onDeleteOk:he}),key:qe.id,icon:l.a.createElement("img",{src:O.a,className:u.a.folderIcon}),isLeaf:!1}})})}):ie(function(rt){return _e(rt,Ue,{isLeaf:!0})});case 6:case"end":return it.stop()}},Fe)}));return function(Ke){return Te.apply(this,arguments)}}(),ne=function(Fe,Ke){var Ue=Ke.node,He=Ke.expanded;ie(function(Ne){return _e(Ne,Ue.key,{icon:He?l.a.createElement("img",{src:A.a,className:u.a.folderIcon}):l.a.createElement("img",{src:O.a,className:u.a.folderIcon})})})};return(q==null?void 0:q.length)>0&&l.a.createElement(Z.a,{showLine:{showLeafIcon:!1},showIcon:!0,treeData:q,loadData:le,onExpand:ne,className:u.a.folderWrapper,selectable:!1})};Xe.a=o},LdHM:function(ft,Xe,G){"use strict";G.d(Xe,"b",function(){return c}),G.d(Xe,"a",function(){return O});var de=G("1OyB"),Z=G("vuIU"),M=G("Ji7U"),V=G("LK+K"),I=G("q1tI"),B=G("rePB"),K=G("Ff2n"),W=G("ODXe"),L=G("4IlW"),P=G("bX4T"),b=G("YrtM"),p=G("TSYQ"),_=G.n(p),h=G("+nKL"),r=G("8OUc"),d=function(F,Q){var q=F.prefixCls,ie=F.id,ge=F.flattenOptions,fe=F.childrenAsData,ue=F.values,he=F.searchValue,_e=F.multiple,le=F.defaultActiveFirstOption,ne=F.height,Te=F.itemHeight,Fe=F.notFoundContent,Ke=F.open,Ue=F.menuItemSelectedIcon,He=F.virtual,Ne=F.onSelect,Be=F.onToggleOpen,Je=F.onActiveValue,tt=F.onScroll,it=F.onMouseEnter,rt="".concat(q,"-item"),qe=Object(b.a)(function(){return ge},[Ke,ge],function(ut,be){return be[0]&&ut[1]!==be[1]}),gt=I.useRef(null),pt=function(be){be.preventDefault()},vt=function(be){gt.current&>.current.scrollTo({index:be})},at=function(be){for(var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,pe=qe.length,se=0;se1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(x).map(function(Q,q){if(!I.isValidElement(Q)||!Q.type)return null;var ie=Q.type.isSelectOptGroup,ge=Q.key,fe=Q.props,ue=fe.children,he=Object(K.a)(fe,["children"]);return F||!ie?w(Q):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(ge===null?q:ge,"__"),label:ge},he),{},{options:m(ue)})}).filter(function(Q){return Q})}var v=G("2Qr1"),s=G("qNPg"),o=G("U8pU"),E=G("Kwbf"),g=G("WKfj");function C(x){var F=x.mode,Q=x.options,q=x.children,ie=x.backfill,ge=x.allowClear,fe=x.placeholder,ue=x.getInputElement,he=x.showSearch,_e=x.onSearch,le=x.defaultOpen,ne=x.autoFocus,Te=x.labelInValue,Fe=x.value,Ke=x.inputValue,Ue=x.optionLabelProp,He=F==="multiple"||F==="tags",Ne=he!==void 0?he:He||F==="combobox",Be=Q||m(q);if(Object(E.a)(F!=="tags"||Be.every(function(rt){return!rt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),F==="tags"||F==="combobox"){var Je=Be.some(function(rt){return rt.options?rt.options.some(function(qe){return typeof("value"in qe?qe.value:qe.key)=="number"}):typeof("value"in rt?rt.value:rt.key)=="number"});Object(E.a)(!Je,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(F!=="combobox"||!Ue,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(F==="combobox"||!ie,"`backfill` only works with `combobox` mode."),Object(E.a)(F==="combobox"||!ue,"`getInputElement` only work with `combobox` mode."),Object(E.b)(F!=="combobox"||!ue||!ge||!fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!Ne&&F!=="combobox"&&F!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!le||ne,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Fe!=null){var tt=Object(g.d)(Fe);Object(E.a)(!Te||tt.every(function(rt){return Object(o.a)(rt)==="object"&&("key"in rt||"value"in rt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!He||Array.isArray(Fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(q){var it=null;Object(A.a)(q).some(function(rt){if(!I.isValidElement(rt)||!rt.type)return!1;var qe=rt.type;if(qe.isSelectOption)return!1;if(qe.isSelectOptGroup){var gt=Object(A.a)(rt.props.children).every(function(pt){return!I.isValidElement(pt)||!rt.type||pt.type.isSelectOption?!0:(it=pt.type,!1)});return!gt}return it=qe,!0}),it&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(it.displayName||it.name||it,"`.")),Object(E.a)(Ke===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=C,U=Object(s.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:m,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:N,fillOptionsWithMissingValue:v.a}),j=function(x){Object(M.a)(Q,x);var F=Object(V.a)(Q);function Q(){var q;return Object(de.a)(this,Q),q=F.apply(this,arguments),q.selectRef=I.createRef(),q.focus=function(){q.selectRef.current.focus()},q.blur=function(){q.selectRef.current.blur()},q}return Object(Z.a)(Q,[{key:"render",value:function(){return I.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),Q}(I.Component);j.Option=c,j.OptGroup=O;var H=j,y=Xe.c=H},M8RZ:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return L});var de=G("fWQN"),Z=G("mtLc"),M=G("yKVA"),V=G("879j"),I=G("q1tI"),B=G.n(I),K=G("i8i4"),W=G.n(K),L=function(P){Object(M.a)(p,P);var b=Object(V.a)(p);function p(_){var h;Object(de.a)(this,p),h=b.call(this,_);var r=window.document;return h.node=r.createElement("div"),r.body.appendChild(h.node),h}return Object(Z.a)(p,[{key:"render",value:function(){var h=this.props.children;return Object(K.createPortal)(h,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(B.a.Component)},NLgs:function(ft,Xe,G){"use strict";G.d(Xe,"e",function(){return c}),G.d(Xe,"f",function(){return R}),G.d(Xe,"d",function(){return T}),G.d(Xe,"c",function(){return A}),G.d(Xe,"a",function(){return w}),G.d(Xe,"b",function(){return m});var de=G("miYZ"),Z=G("tsqr"),M=G("9og8"),V=G("2qtc"),I=G("kLXV"),B=G("WmNS"),K=G.n(B),W=G("q1tI"),L=G.n(W),P=G("9kvl"),b=G("xKgJ"),p=G("1vsH"),_=G("RCxd"),h=G("yTi+"),r=G.n(h),d=G("1ZF9"),l=G.n(d),a=G("NoGO"),u=G.n(a),c=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(R(s)&&O(o))},R=function(s){return Object(b.p)()?!0:(s({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},O=function(){var s,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(P.c)()._store.getState(),g=E.user;return(s=g.userInfo)!==null&&s!==void 0&&s.profile_completed?!0:(I.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:o?"\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(){P.d.push("/account/profile/edit")}}),!1)},T=function(){var s,o=Object(P.c)()._store.getState(),E=o.user;return(s=E.userInfo)!==null&&s!==void 0&&s.professional_certification?!0:(I.a.confirm({title:"\u63D0\u793A",centered:!0,content:L.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(p.S)("/account/certification")}}),!1)},A=function(){return Object(b.a)()?!0:(I.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),L.a.createElement("img",{src:u.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},w=function(s,o){return s?!0:(I.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("p",null,o||"\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"),L.a.createElement("div",{style:{marginLeft:"110px"}},L.a.createElement("img",{src:l.a,width:200}),L.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(p.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},m=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(P.c)()._store.getState(),g=E.shixunsDetail.detail;return(g==null?void 0:g.public)===2||(g==null?void 0:g.public)===1||(g==null?void 0:g.shixun_status)===3?(I.a.info({centered:!0,icon:L.a.createElement(_.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(g==null?void 0:g.public)===2?"\u5DF2\u516C\u5F00":(g==null?void 0:g.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",o,"\u3002"),L.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),L.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:r.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(I.a.confirm({centered:!0,icon:L.a.createElement(_.a,null),title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",o,"\u3002"),L.a.createElement("br",null),L.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:L.a.createElement(_.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 N=Object(M.a)(K.a.mark(function j(){var H;return K.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,s({type:"shixunsDetail/cancelRelease",payload:{id:g==null?void 0:g.identifier}});case 2:H=x.sent,H.status!==401&&(Z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),s({type:"shixunsDetail/getShixunsDetail",payload:{id:g==null?void 0:g.identifier}}),s({type:"practiceSetting/getCommonData",payload:{id:g==null?void 0:g.identifier}}));case 4:case"end":return x.stop()}},j)}));function U(){return N.apply(this,arguments)}return U}()})}}),!0):!1}},NoGO:function(ft,Xe,G){ft.exports=G.p+"static/newqrcode.d852fdfc.png"},NvD2:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return B});var de=G("Kwbf");function Z(K,W){var L=new Set;return K.forEach(function(P){W.has(P)||L.add(P)}),L}function M(K){var W=K||{},L=W.disabled,P=W.disableCheckbox,b=W.checkable;return!!(L||P)||b===!1}function V(K,W,L,P){for(var b=new Set(K),p=new Set,_=0;_<=L;_+=1){var h=W.get(_)||new Set;h.forEach(function(a){var u=a.key,c=a.node,R=a.children,O=R===void 0?[]:R;b.has(u)&&!P(c)&&O.filter(function(T){return!P(T.node)}).forEach(function(T){b.add(T.key)})})}for(var r=new Set,d=L;d>=0;d-=1){var l=W.get(d)||new Set;l.forEach(function(a){var u=a.parent,c=a.node;if(P(c)||!a.parent||r.has(a.parent.key))return;if(P(a.parent.node)){r.add(u.key);return}var R=!0,O=!1;(u.children||[]).filter(function(T){return!P(T.node)}).forEach(function(T){var A=T.key,w=b.has(A);R&&!w&&(R=!1),!O&&(w||p.has(A))&&(O=!0)}),R&&b.add(u.key),O&&p.add(u.key),r.add(u.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(Z(p,b))}}function I(K,W,L,P,b){for(var p=new Set(K),_=new Set(W),h=0;h<=P;h+=1){var r=L.get(h)||new Set;r.forEach(function(u){var c=u.key,R=u.node,O=u.children,T=O===void 0?[]:O;!p.has(c)&&!_.has(c)&&!b(R)&&T.filter(function(A){return!b(A.node)}).forEach(function(A){p.delete(A.key)})})}_=new Set;for(var d=new Set,l=P;l>=0;l-=1){var a=L.get(l)||new Set;a.forEach(function(u){var c=u.parent,R=u.node;if(b(R)||!u.parent||d.has(u.parent.key))return;if(b(u.parent.node)){d.add(c.key);return}var O=!0,T=!1;(c.children||[]).filter(function(A){return!b(A.node)}).forEach(function(A){var w=A.key,m=p.has(w);O&&!m&&(O=!1),!T&&(m||_.has(w))&&(T=!0)}),O||p.delete(c.key),T&&_.add(c.key),d.add(c.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Z(_,p))}}function B(K,W,L,P){var b=[],p;P?p=P:p=M;var _=new Set(K.filter(function(l){var a=!!L[l];return a||b.push(l),a})),h=new Map,r=0;Object.keys(L).forEach(function(l){var a=L[l],u=a.level,c=h.get(u);c||(c=new Set,h.set(u,c)),c.add(a),r=Math.max(r,u)}),Object(de.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(l){return"'".concat(l,"'")}).join(", ")));var d;return W===!0?d=V(_,h,r,p):d=I(_,W.halfCheckedKeys,h,r,p),d}},"ORt/":function(ft,Xe,G){ft.exports={operating:"operating___1LS8K",tip:"tip___3LKV6"}},OZM5:function(ft,Xe,G){"use strict";G.d(Xe,"b",function(){return P}),G.d(Xe,"a",function(){return b}),G.d(Xe,"k",function(){return p}),G.d(Xe,"h",function(){return _}),G.d(Xe,"i",function(){return h}),G.d(Xe,"g",function(){return r}),G.d(Xe,"c",function(){return d}),G.d(Xe,"d",function(){return l}),G.d(Xe,"j",function(){return c}),G.d(Xe,"e",function(){return R}),G.d(Xe,"f",function(){return O});var de=G("KQm4"),Z=G("U8pU"),M=G("Ff2n"),V=G("q1tI"),I=G.n(V),B=G("Kwbf"),K=G("WaYH"),W=.25,L=2;function P(T,A){var w=T.slice(),m=w.indexOf(A);return m>=0&&w.splice(m,1),w}function b(T,A){var w=T.slice();return w.indexOf(A)===-1&&w.push(A),w}function p(T){return T.split("-")}function _(T,A){return"".concat(T,"-").concat(A)}function h(T){return T&&T.type&&T.type.isTreeNode}function r(T,A){var w=[T],m=A[T];function v(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(o){var E=o.key,g=o.children;w.push(E),v(g)})}return v(m.children),w}function d(T,A){var w=T.clientY,m=A.selectHandle.getBoundingClientRect(),v=m.top,s=m.bottom,o=m.height,E=Math.max(o*W,L);return w<=v+E?-1:w>=s-E?1:0}function l(T,A){if(!T)return;var w=A.multiple;return w?T.slice():T.length?[T[0]]:T}var a=function(A){return A};function u(T,A){if(!T)return[];var w=A||{},m=w.processProps,v=m===void 0?a:m,s=Array.isArray(T)?T:[T];return s.map(function(o){var E=o.children,g=Object(M.a)(o,["children"]),C=u(E,A);return I.a.createElement(K.a,Object.assign({},v(g)),C)})}function c(T){if(!T)return null;var A;if(Array.isArray(T))A={checkedKeys:T,halfCheckedKeys:void 0};else if(Object(Z.a)(T)==="object")A={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(B.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function R(T,A){var w=new Set;function m(v){if(w.has(v))return;var s=A[v];if(!s)return;w.add(v);var o=s.parent,E=s.node;if(E.disabled)return;o&&m(o.key)}return(T||[]).forEach(function(v){m(v)}),Object(de.a)(w)}function O(T){var A={};return Object.keys(T).forEach(function(w){(w.startsWith("data-")||w.startsWith("aria-"))&&(A[w]=T[w])}),A}},Ot1p:function(ft,Xe,G){"use strict";var de=G("2qtc"),Z=G("kLXV"),M=G("rAM+"),V=G("miYZ"),I=G("tsqr"),B=G("9og8"),K=G("tJVT"),W=G("jrin"),L=G("WmNS"),P=G.n(L),b=G("q1tI"),p=G.n(b),_=G("VrN/"),h=G.n(_),r=G("bdgK"),d=G("p77/"),l=G("Bd2K"),a=G("ELLl"),u=G("19Vz"),c=G("lZu9"),R=G("+NIl"),O=G("kSUc"),T=G("9Bee"),A=function(De){var $e=De.value,lt=$e===void 0?"":$e,Bt=De.className,tn=De.showTextOnly,nn=De.showLines,_n=De.style,yn=_n===void 0?{}:_n,Gt=Object(b.useMemo)(function(){return""},[lt]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Gt}}))},w=G("0Owb"),m=G("dejd"),v=G("C+DQ"),s=G("1vsH"),o=G("m3rI"),E=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function g(De){var $e=De.onActionCallback,lt=De.title,Bt=De.icon,tn=De.actionName,nn=De.className,_n=nn===void 0?"":nn,yn=De.children;function Gt(){$e(tn)}return p.a.createElement("a",{title:lt,className:_n,onClick:Gt},p.a.createElement("i",{className:"md-iconfont ".concat(Bt)}),yn)}var C=function(De){var $e=De.watch,lt=De.showNullButton,Bt=De.onActionCallback,tn=De.fullScreen,nn=De.insertTemp,_n=De.hidetoolBar,yn=De.uuid,Gt=De.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(yn,"&api=").concat(encodeURIComponent(o.a.PROXY_SERVER)));var ii=[].concat(E,[{title:"".concat($e?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat($e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!_n&&ii.map(function(Dn,Ci){return p.a.createElement("li",{key:Ci},Dn.actionName?p.a.createElement(g,Object(w.a)({},Dn,{onActionCallback:Bt})):p.a.createElement("span",{className:"v-line"}))}),lt?p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Bt},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,nn&&p.a.createElement("li",null,p.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(nn),onActionCallback:Bt},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(g,{icon:"".concat(tn?"icon-shrink":"icon-enlarge"),title:tn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Bt})))},N=G("M8RZ"),U=G("+L6B"),j=G("2/Rp"),H=G("y8nQ"),y=G("Vl3Y"),x=G("5NDa"),F=G("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},q=function(De){var $e=De.callback,lt=De.onCancel;function Bt(tn){$e(tn)}return p.a.createElement(y.a,Object(w.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Bt}),p.a.createElement(y.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(F.a,null)),p.a.createElement(y.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(F.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},ie=G("7ahc"),ge=G("HmJG"),fe=G("BjJ7"),ue=y.a.useForm,he={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}},le=function(De){var $e=De.callback,lt=De.onCancel,Bt=ue(),tn=Object(K.a)(Bt,1),nn=tn[0];function _n(ii){$e(ii)}function yn(ii,Dn){if(ii.status===-1){I.b.error(ii.message);return}nn.setFieldsValue({src:"/api/attachments/".concat(ii.id),type:Dn.type})}function Gt(ii){var Dn=ii.target.files[0];Te(Dn,yn)}return p.a.createElement(y.a,Object(w.a)({form:nn},_e,{className:"upload-image-panel",onFinish:_n}),p.a.createElement(y.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(y.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(F.a,{style:he})),p.a.createElement(ne,{onFileChange:Gt}))),p.a.createElement(y.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(F.a,{style:{width:264}})),p.a.createElement(y.a.Item,{style:{textAlign:"right"}},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))};function ne(De){var $e=De.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:$e}))}function Te(De,$e){if(!De)throw new String("\u6CA1\u6709\u6587\u4EF6");var lt=new FormData;lt.append("editormd-image-file",De),lt.append("file_param_name","editormd-image-file"),lt.append("byxhr","true");var Bt=new window.XMLHttpRequest;Bt.withCredentials=!0,Bt.addEventListener("load",function(tn){$e(JSON.parse(tn.target.responseText),De)},!1),Bt.addEventListener("error",function(tn){console.error(tn)},!1),Bt.open("POST","".concat(fe.a,"/api/attachments.json")),Bt.send(lt)}var Fe=G("giR+"),Ke=G("fyUT"),Ue=G("7Kak"),He=G("9yH6"),Ne=He.a.Group,Be={margin:"0 8px"},Je=function(De){var $e=De.callback,lt=De.onCancel;function Bt(tn){$e(tn)}return p.a.createElement(y.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Bt},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Be},"\u884C\u6570"),p.a.createElement(y.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Ke.a,null)),p.a.createElement("span",{style:Be},"\u5217\u6570"),p.a.createElement(y.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Ke.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(y.a.Item,{name:"align"},p.a.createElement(Ne,null,p.a.createElement(He.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(He.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(He.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(He.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(j.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},tt=G("ErOA"),it=G("7Cbv"),rt="link",qe="upload-image",gt="code-block",pt="add-table",vt="------------",at={default:vt,left:":".concat(vt),center:":".concat(vt,":"),right:"".concat(vt,":")},Rt=G("9VGf"),xt,Tt;function Ye(){}var Mt=0,St=1e4,ze="\u2581",ut=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function be(De){return/^\d+$/.test(De)?"".concat(De,"px"):De}var xe=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=xe?"Cmd":"Ctrl",se=["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=(xt={},Object(W.a)(xt,pe+"-B","bold"),Object(W.a)(xt,pe+"-I","italic"),xt),Ee=(Tt={},Object(W.a)(Tt,rt,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Tt,gt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Tt,qe,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Tt,pt,"\u6DFB\u52A0\u8868\u683C"),Tt),Ae=Xe.a=function(De){var $e=De.defaultValue,lt=$e===void 0?"":$e,Bt=De.onChange,tn=De.width,nn=tn===void 0?"100%":tn,_n=De.height,yn=_n===void 0?400:_n,Gt=De.miniToolbar,ii=Gt===void 0?!1:Gt,Dn=De.isFocus,Ci=Dn===void 0?!1:Dn,fi=De.watch,In=De.insertTemp,Ri=De.mode,Si=Ri===void 0?"markdown":Ri,Ot=De.id,bn=Ot===void 0?"markdown-editor-id":Ot,Cn=De.showResizeBar,kn=Cn===void 0?!1:Cn,Ai=De.noStorage,Ui=Ai===void 0?!1:Ai,dr=De.showNullButton,mn=dr===void 0?!1:dr,Jt=De.hidetoolBar,qi=Jt===void 0?!1:Jt,hr=De.fullScreen,sr=hr===void 0?!1:hr,Fn=De.onBlur,er=De.onCMBeforeChange,kr=De.onFullScreen,Qr=De.className,yt=Qr===void 0?"":Qr,cn=De.disablePaste,Kr=cn===void 0?!1:cn,zr=De.placeholder,na=zr===void 0?"":zr,Gr=De.values,$=Gr===void 0?"":Gr,S=Object(b.useState)(null),D=Object(K.a)(S,2),z=D[0],te=D[1],Y=Object(b.useState)(lt),Le=Object(K.a)(Y,2),ct=Le[0],Pt=Le[1],rn=Object(b.useState)(fi),ht=Object(K.a)(rn,2),Vt=ht[0],hi=ht[1],Li=Object(b.useState)(sr),Zt=Object(K.a)(Li,2),dt=Zt[0],kt=Zt[1],Lt=Object(b.useState)(""),Kt=Object(K.a)(Lt,2),sn=Kt[0],En=Kt[1],wn=Object(b.useState)(0),hn=Object(K.a)(wn,2),Ln=hn[0],zn=hn[1],un=Object(b.useState)(yn),Sn=Object(K.a)(un,2),di=Sn[0],Nn=Sn[1],zt=Object(b.useState)(!1),An=Object(K.a)(zt,2),si=An[0],Un=An[1],Xt=Object(b.useRef)(Object(it.a)()),jt=Object(b.useRef)(!1),pn=Object(b.useRef)(),Ct=Object(b.useRef)(),Nt=Object(b.useRef)(),Dt=Object(b.useRef)(),Pe=Object(b.useRef)(),Yt=function(){var Qt=Object(B.a)(P.a.mark(function qt(){var $t,dn;return P.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return Mn.next=2,Object(tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:dn=Mn.sent,dn!=null&&($t=dn.attachments)!==null&&$t!==void 0&&$t.length&&(console.log("cm:",z,Ct),dn.attachments.map(function(qn){qn.content_type.indexOf("image")>-1?z.replaceSelection("![,](/api/attachments/".concat(qn.id,"?type=").concat(qn.content_type,")")):qn.content_type.indexOf("video")>-1?z.replaceSelection('')):qn.content_type.indexOf("pdf")>-1?z.replaceSelection('
    ').concat(qn.name,"")):z.replaceSelection("[".concat(qn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(qn.id,"?type=").concat(qn.content_type,")"))}));case 4:case"end":return Mn.stop()}},qt)}));return function(){return Qt.apply(this,arguments)}}();Object(b.useEffect)(function(){Pt($),z==null||z.setValue($)},[$]),Object(b.useEffect)(function(){kr==null||kr(dt)},[dt]),Object(b.useEffect)(function(){if(Ct.current){var Qt=h.a.fromTextArea(Ct.current,{mode:Si,lineNumbers:!ii,lineWrapping:!0,value:lt,autoCloseTags:!0,autoCloseBrackets:!0});Ci&&Qt.focus();function qt($t,dn){if(Kr){dn.preventDefault();return}var Gn=dn.clipboardData;if(Gn){var Mn=Gn.types.toString(),qn=Gn.items;if(Mn==="Files"||Gn.types.indexOf("Files")>-1){if(dn.preventDefault(),Si=="stex")return;try{var mi,Tr=qn[1];((mi=qn[0])===null||mi===void 0?void 0:mi.kind)==="file"&&(Tr=qn[0]);var Zn=Tr.getAsFile(),$r=Zn.name.split(".").pop();Te(Zn,function(gi){if(gi.id){var fr,rr,Mr;(Zn==null||((fr=Zn.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?Qt.replaceSelection("![,](/api/attachments/".concat(gi.id,"?type=").concat(gi.content_type,")")):(Zn==null||((rr=Zn.type)===null||rr===void 0)?void 0:rr.indexOf("video"))>-1?Qt.replaceSelection('')):(Zn==null||((Mr=Zn.type)===null||Mr===void 0)?void 0:Mr.indexOf("pdf"))>-1?Qt.replaceSelection('').concat(Zn.name,"")):se.includes($r)?Qt.replaceSelection('').concat(Zn.name,"")):Qt.replaceSelection("[".concat(Zn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,"?type=").concat(gi.content_type,")"))}else(gi==null?void 0:gi.status)===401&&(document.location.href="/user/login")})}catch(gi){I.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Qt.on("paste",qt),Qt.on("dragleave",function($t,dn){Nt.current.classList.remove("mouse-hover-md")}),Qt.on("dragover",function($t,dn){Nt.current.classList.add("mouse-hover-md")}),Qt.on("drop",function($t,dn){Nt.current.classList.add("mouse-hover-md");var Gn;if(Gn=dn.dataTransfer.files,Gn.length>0){dn.preventDefault(),dn.stopPropagation();for(var Mn=function(Tr){var Zn=Gn[Tr],$r=Zn.name.split(".").pop();Te(Zn,function(gi){if(gi.id){var fr,rr,Mr;(Zn==null||((fr=Zn.type)===null||fr===void 0)?void 0:fr.indexOf("image"))>-1?Qt.replaceSelection("![,](/api/attachments/".concat(gi.id,"?type=").concat(gi.content_type,")")):(Zn==null||((rr=Zn.type)===null||rr===void 0)?void 0:rr.indexOf("video"))>-1?Qt.replaceSelection('')):(Zn==null||((Mr=Zn.type)===null||Mr===void 0)?void 0:Mr.indexOf("pdf"))>-1?Qt.replaceSelection('').concat(Zn.name,"")):se.includes($r)?Qt.replaceSelection('').concat(Zn.name,"")):Qt.replaceSelection("[".concat(Zn.name,"](").concat(o.a.API_SERVER,"/api/attachments/").concat(gi.id,"?type=").concat(gi.content_type,")"))}else(gi==null?void 0:gi.status)===401&&(document.location.href="/user/login")})},qn=0;qn0||qn.target.offsetWidth>0)&&(xn(),z.setSize("100%","100%"),z.refresh())}}catch(mi){Gn.e(mi)}finally{Gn.f()}});return $t.observe(Ct.current.parentElement),$t}if(z){var qt=Qt();return function(){qt.unobserve(Ct.current.parentElement)}}},[z,xn]),Object(b.useEffect)(function(){if(z){for(var Qt=[],qt=function(){var qn=dn[$t];Gn=Object(K.a)(qn,2);var mi=Gn[0],Tr=Gn[1],Zn=Object(W.a)({},mi,function(){pi(Tr)});Qt.push(Zn),z.addKeyMap(Zn)},$t=0,dn=Object.entries(ce);$t0){var Qt=new Date().getTime(),qt=window.sessionStorage.getItem(bn);Qt>=Ln+St&&(!qt||qt!==ct)&&(window.sessionStorage.setItem(bn,ct),Un(!0))}},St),Object(b.useEffect)(function(){hi(fi)},[z,fi]),Object(b.useEffect)(function(){z&&(Ci&&z.focus())},[z,Ci]),Object(b.useEffect)(function(){if(Vt&&z){var Qt=z.getScrollerElement();function qt($t){var dn=$t.target;if(Pe.current){var Gn=dn.scrollTop/dn.scrollHeight;Pe.current.scrollTop=Pe.current.scrollHeight*Gn}}return Qt.addEventListener("scroll",qt),function(){Qt.removeEventListener("scroll",qt)}}},[z,Vt]),Object(b.useEffect)(function(){if(z&&er){function Qt(qt,$t){er(qt,$t)}return z.on("beforeChange",Qt),function(){z.off("beforeChange",Qt)}}},[z,er]),Object(b.useEffect)(function(){if(z&&Fn){function Qt(){Fn(z.getValue())}return z.on("blur",Qt),function(){z.off("blur",Qt)}}},[z,Fn]),Object(b.useEffect)(function(){if(z){function Qt(qt){var $t=qt.getValue();Pt($t),zn(new Date().getTime()),qt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Bt&&Bt($t)}return z.on("change",Qt),function(){z.off("change",Qt)}}},[z,Bt]),Object(b.useEffect)(function(){z&&(lt==null?(z.setValue(""),Pt("")):lt!==z.getValue()&&(z.setValue(lt),Pt(lt),z.setCursor(z.lineCount(),0)))},[z,lt]);var pi=Object(b.useCallback)(function(Qt){var qt=z.getCursor(),$t=z.getSelection(),dn=$t.split(` `);switch(Qt){case"bold":return z.replaceSelection("**"+$t+"**"),$t===""&&z.setCursor(qt.line,qt.ch+2),z.focus();case"italic":return z.replaceSelection("*"+$t+"*"),$t===""&&z.setCursor(qt.line,qt.ch+1),z.focus();case"code":return z.replaceSelection("`"+$t+"`"),$t===""&&z.setCursor(qt.line,qt.ch+1),z.focus();case"inline-latex":return z.replaceSelection("`$$"+$t+"$$`"),$t===""&&z.setCursor(qt.line,qt.ch+3),z.focus();case"latex":return z.replaceSelection("```latex\n"+$t+"\n```"),z.setCursor(qt.line+1,$t.length+1),z.focus();case"line-break":return z.replaceSelection(`
    `),z.focus();case"list-ul":return $t===""?z.replaceSelection("- "+$t):z.replaceSelection(dn.map(function(Gn){return Gn===""?"":"- ".concat(Gn)}).join(` `)),z.focus();case"list-ol":return $t===""?z.replaceSelection("1. "+$t):z.replaceSelection(dn.map(function(Gn,Mn){return Gn===""?"":"".concat(Mn+1,". ").concat(Gn)}).join(` `)),z.focus();case"add-null-ch":return $t===""&&z.setCursor(qt.line,qt.ch+1),z.replaceSelection(ze),z.focus();case"inster-template-1":return $t===""&&z.setCursor(qt.line,qt.ch),z.replaceSelection(ut),z.focus();case"eraser":return z.setValue(""),z.focus();case"trigger-watch":return hi(!Vt),z.focus();case"trigger-full-screen":return kt(!dt),z.focus();case rt:En(rt);return;case gt:En(gt);return;case qe:En(qe);return;case pt:En(pt);return;default:throw new Error}},[z,Vt,dt]),On=Object(b.useCallback)(function(Qt){En("");switch(sn){case rt:var qt=Qt.title,$t=Qt.link;return z.replaceSelection("[".concat(qt,"](").concat($t,")")),z.focus();case gt:var dn=Qt.language,Gn=Qt.content;return z.replaceSelection(["```"+dn,Gn,"```"].join(` `)),z.focus();case qe:var Mn=Qt.src,qn=Qt.alt;return qn?z.replaceSelection("![ ".concat(qn," ]( ").concat(Mn,' "').concat(qn,'" )')):z.replaceSelection("![,](".concat(Mn,")")),z.focus();case pt:for(var mi=Qt.row,Tr=Qt.col,Zn=Qt.align,$r=` `,gi=0;gi300&&(mi=300);var Tr=yn+mi+"px";Nn(Tr)}}return Qt.addEventListener("mousedown",dn),document.addEventListener("mousemove",Mn),document.addEventListener("mouseup",Gn),function(){Qt.removeEventListener("mousedown",dn),document.removeEventListener("mousemove",Mn),document.removeEventListener("mouseup",Gn)}}},[z,Dt]),Object(b.useEffect)(function(){Nn(yn)},[yn]);var Fi=be(nn),Bn=be(di),Ft={width:Fi,height:Bn},yi=Object(b.useMemo)(function(){if(Ln){var Qt=new Date(Ln),qt=Qt.getHours(),$t=Qt.getMinutes(),dn=Qt.getSeconds();return qt=qt<10?"0"+qt:qt,$t=$t<10?"0"+$t:$t,dn=dn<10?"0"+dn:dn,"".concat(qt,":").concat($t,":").concat(dn)}return 0},[Ln]);function li(){window.sessionStorage.removeItem(bn),Un(!1),zn(0)}function $n(){Un(!1),zn(0),z.setValue(window.sessionStorage.getItem(bn))}function ir(Qt,qt){var $t=z.getValue();$t=$t.replace(Qt,qt),Pt($t),z==null||z.setValue($t)}return p.a.createElement(b.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Nt},p.a.createElement("div",{className:"markdown-editor-container ".concat(yt," ").concat(Vt?"on-preview":""," ").concat(ii?"mini":""," ").concat(dt?"full-screen":""),style:Ft},p.a.createElement(C,{insertTemp:In,watch:Vt,fullScreen:dt,showNullButton:mn,onActionCallback:pi,hidetoolBar:qi,uuid:Xt.current,setOpenPhones:function(){jt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Ct,placeholder:na})),Vt?p.a.createElement("div",{ref:Pe,className:"preview-container"},Si==="stex"&&p.a.createElement(A,{value:ct}),Si!=="stex"&&p.a.createElement(T.a,{edit:!0,value:ct,replaces:ir})):null))),kn?p.a.createElement("a",{ref:Dt,className:"editor-resize"}):null,p.a.createElement(N.a,null,Ee[sn]?p.a.createElement(Z.a,{centered:!0,title:Ee[sn],visible:!0,onCancel:nr,footer:null,className:"markdown-popup-form"},tr):null))}},"P/tu":function(ft,Xe,G){"use strict";var de=G("ozfa"),Z=G("MJZm"),M=G("0Owb"),V=G("9og8"),I=G("tJVT"),B=G("PpiC"),K=G("WmNS"),W=G.n(K),L=G("q1tI"),P=G.n(L),b=G("WCUW"),p=G("spXi"),_=G.n(p),h=function(d){var l=d.value,a=d.onChange,u=d.defaultValue,c=d.disabled,R=Object(B.a)(d,["value","onChange","defaultValue","disabled"]),O=Object(L.useState)([]),T=Object(I.a)(O,2),A=T[0],w=T[1],m=Object(L.useState)("1"),v=Object(I.a)(m,2),s=v[0],o=v[1];Object(L.useEffect)(function(){E()},[]);var E=function(){var N=Object(V.a)(W.a.mark(function U(){var j,H;return W.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,Object(b.A)({});case 2:j=x.sent,j!=null&&j.data&&(H=[{title:P.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:_.a.name},"\u6839\u76EE\u5F55"),value:0,key:0,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:g(j.data||[])}],w(H),o("2"));case 4:case"end":return x.stop()}},U)}));return function(){return N.apply(this,arguments)}}(),g=function(U){function j(H){var y=H.children,x=Array.isArray(y)&&y.length>0,F=H==null?void 0:H.group_id;return{title:P.a.createElement("div",{title:H==null?void 0:H.name,className:_.a.name},H==null?void 0:H.name),value:F,key:F,icon:P.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:x?y==null?void 0:y.map(function(Q){return j(Q)}):[]}}return U==null?void 0:U.map(function(H){return j(H)})},C=u?{defaultExpandedKeys:[0]}:{selectedKeys:l,defaultExpandedKeys:l};return P.a.createElement("div",{className:_.a.customTree},P.a.createElement(Z.a,Object(M.a)({key:s},C,{showIcon:!0,treeData:A,onSelect:a,disabled:c},R)))};Xe.a=h},Q0Vu:function(ft,Xe,G){ft.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(ft,Xe,G){"use strict";var de=G("Q9mQ"),Z=G("diRs"),M=G("q1tI"),V=G.n(M),I=G("+z73"),B=G.n(I),K=function(L){var P=L.data,b=P===void 0?[]:P,p=L.onClick,_=function(){return b.map(function(d,l){return V.a.createElement("div",{key:l,className:B.a.few},V.a.createElement("b",{title:d.name,style:{color:l===0?"#333333":"#999999"},onClick:function(){return p(d.id)}},d.name),l1&&c5?h():_())};Xe.a=K},SJMd:function(ft,Xe){/** * @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 G,de,Z,M=!1,V,I;window.PR_SHOULD_USE_CONTINUATION=!0;var B,K;(function(){var W=window,L=["break,continue,do,else,for,if,return,while"],P=[L,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],b=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[b,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],_=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],h=[b,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],r="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",d=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",a=[L,"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"],u=[L,"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"],c=[L,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[p,h,_,d,l,a,u,c],O=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",A="kwd",w="com",m="typ",v="lit",s="pun",o="pln",E="tag",g="dec",C="src",N="atn",U="atv",j="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function y(Ne){for(var Be=0,Je=!1,tt=!1,it=0,rt=Ne.length;it122||(se<65||pe>90||Mt.push([Math.max(65,pe)|32,Math.min(se,90)|32]),se<97||pe>122||Mt.push([Math.max(97,pe)&~32,Math.min(se,122)&~32]))}}Mt.sort(function(De,$e){return De[0]-$e[0]||$e[1]-De[1]});for(var ce=[],Ee=[],ut=0;utAe[0]&&(Ae[1]+1>Ae[0]&&ze.push("-"),ze.push(vt(Ae[1])))}return ze.push("]"),ze.join("")}function Rt(Tt){for(var Ye=Tt.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")),Mt=Ye.length,St=[],ze=0,ut=0;ze=2&&pe==="["?Ye[ze]=at(be):pe!=="\\"&&(Ye[ze]=be.replace(/[a-zA-Z]/g,function(Ee){var Ae=Ee.charCodeAt(0);return"["+String.fromCharCode(Ae&~32,Ae|32)+"]"}))}return Ye.join("")}for(var xt=[],it=0,rt=Ne.length;it=0;)Je[xt.charAt(Tt)]=Rt;var Ye=Rt[1],Mt=""+Ye;pt.hasOwnProperty(Mt)||(gt.push(Ye),pt[Mt]=null)}gt.push(/[\0-\uffff]/),tt=y(gt)})();var it=Be.length,rt=function(qe){for(var gt=qe.sourceCode,pt=qe.basePos,vt=qe.sourceNode,at=[pt,o],Rt=0,xt=gt.match(tt)||[],Tt={},Ye=0,Mt=xt.length;Ye=5&&ze.substring(0,5)==="lang-",be&&!(ut&&typeof ut[1]=="string")&&(be=!1,ze=C),be||(Tt[St]=ze)}var se=Rt;if(Rt+=St.length,!be)at.push(pt+se,ze);else{var ce=ut[1],Ee=St.indexOf(ce),Ae=Ee+ce.length;ut[2]&&(Ae=St.length-ut[2].length,Ee=Ae-ce.length);var De=ze.substring(5);F(vt,pt+se,St.substring(0,Ee),rt,at),F(vt,pt+se+Ee,ce,ne(De,ce),at),F(vt,pt+se+Ae,St.substring(Ae),rt,at)}}qe.decorations=at};return rt}function ge(Ne){var Be=[],Je=[];Ne.tripleQuotedStrings?Be.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ne.multiLineStrings?Be.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Be.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ne.verbatimStrings&&Je.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var tt=Ne.hashComments;tt&&(Ne.cStyleComments?(tt>1?Be.push([w,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Be.push([w,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Je.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Be.push([w,/^#[^\r\n]*/,null,"#"])),Ne.cStyleComments&&(Je.push([w,/^\/\/[^\r\n]*/,null]),Je.push([w,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var it=Ne.regexLiterals;if(it){var rt=it>1?"":` \r`,qe=rt?".":"[\\S\\s]",gt="/(?=[^/*"+rt+"])(?:[^/\\x5B\\x5C"+rt+"]|\\x5C"+qe+"|\\x5B(?:[^\\x5C\\x5D"+rt+"]|\\x5C"+qe+")*(?:\\x5D|$))+/";Je.push(["lang-regex",RegExp("^"+H+"("+gt+")")])}var pt=Ne.types;pt&&Je.push([m,pt]);var vt=(""+Ne.keywords).replace(/^ | $/g,"");vt.length&&Je.push([A,new RegExp("^(?:"+vt.replace(/[\s,]+/g,"|")+")\\b"),null]),Be.push([o,/^\s+/,null,` \r \xA0`]);var at="^.[^\\s\\w.$@'\"`/\\\\]*";return Ne.regexLiterals&&(at+="(?!s*/)"),Je.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[m,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[o,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[o,/^\\[\s\S]?/,null],[s,new RegExp(at),null]),ie(Be,Je)}var fe=ge({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ue(Ne,Be,Je){for(var tt=/(?:^|\s)nocode(?:\s|$)/,it=/\r\n?|\n/,rt=Ne.ownerDocument,qe=rt.createElement("li");Ne.firstChild;)qe.appendChild(Ne.firstChild);var gt=[qe];function pt(Ye){var Mt=Ye.nodeType;if(Mt==1&&!tt.test(Ye.className))if(Ye.nodeName==="br")vt(Ye),Ye.parentNode&&Ye.parentNode.removeChild(Ye);else for(var St=Ye.firstChild;St;St=St.nextSibling)pt(St);else if((Mt==3||Mt==4)&&Je){var ze=Ye.nodeValue,ut=ze.match(it);if(ut){var be=ze.substring(0,ut.index);Ye.nodeValue=be;var xe=ze.substring(ut.index+ut[0].length);if(xe){var pe=Ye.parentNode;pe.insertBefore(rt.createTextNode(xe),Ye.nextSibling)}vt(Ye),be||Ye.parentNode.removeChild(Ye)}}}function vt(Ye){for(;!Ye.nextSibling;)if(Ye=Ye.parentNode,!Ye)return;function Mt(ut,be){var xe=be?ut.cloneNode(!1):ut,pe=ut.parentNode;if(pe){var se=Mt(pe,1),ce=ut.nextSibling;se.appendChild(xe);for(var Ee=ce;Ee;Ee=ce)ce=Ee.nextSibling,se.appendChild(Ee)}return xe}for(var St=Mt(Ye.nextSibling,0),ze;(ze=St.parentNode)&&ze.nodeType===1;)St=ze;gt.push(St)}for(var at=0;at=pe&&(pt+=2),rt>=se&&(Rt+=2)}}finally{ze&&(ze.style.display=ut)}}var _e={};function le(Ne,Be){for(var Je=Be.length;--Je>=0;){var tt=Be[Je];_e.hasOwnProperty(tt)?W.console&&console.warn("cannot override language handler %s",tt):_e[tt]=Ne}}function ne(Ne,Be){return Ne&&_e.hasOwnProperty(Ne)||(Ne=/^\s*]*(?:>|$)/],[w,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["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"]),le(ie([[o,/^[\s]+/,null,` \r `],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[N,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[s,/^[=<>\/]+/],["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"]),le(ie([],[[U,/^[\s\S]+/]]),["uq.val"]),le(ge({keywords:p,hashComments:!0,cStyleComments:!0,types:O}),["c","cc","cpp","cxx","cyc","m"]),le(ge({keywords:"null,true,false"}),["json"]),le(ge({keywords:h,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:O}),["cs"]),le(ge({keywords:_,cStyleComments:!0}),["java"]),le(ge({keywords:c,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),le(ge({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),le(ge({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),le(ge({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),le(ge({keywords:d,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),le(ge({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),le(ie([],[[T,/^[\s\S]+/]]),["regex"]);function Te(Ne){var Be=Ne.langExtension;try{var Je=x(Ne.sourceNode,Ne.pre),tt=Je.sourceCode;Ne.sourceCode=tt,Ne.spans=Je.spans,Ne.basePos=0,ne(Be,tt)(Ne),he(Ne)}catch(it){W.console&&console.log(it&&it.stack||it)}}function Fe(Ne,Be,Je){var tt=Je||!1,it=Be||null,rt=document.createElement("div");rt.innerHTML="
    "+Ne+"
    ",rt=rt.firstChild,tt&&ue(rt,tt,!0);var qe={langExtension:it,numberLines:tt,sourceNode:rt,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Te(qe),rt.innerHTML}function Ke(Ne,Be){var Je=Be||document.body,tt=Je.ownerDocument||document;function it(xe){return Je.getElementsByTagName(xe)}for(var rt=[it("pre"),it("code"),it("xmp")],qe=[],gt=0;gt=0;h--)if(this.__items[h].match(_))return!0;return!1},P.prototype.set_indent=function(_,h){this.is_empty()&&(this.__indent_count=_||0,this.__alignment_count=h||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},P.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},P.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},P.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var _=this.__parent.current_line;return _.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),_.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),_.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,_.__items[0]===" "&&(_.__items.splice(0,1),_.__character_count-=1),!0}return!1},P.prototype.is_empty=function(){return this.__items.length===0},P.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},P.prototype.push=function(_){this.__items.push(_);var h=_.lastIndexOf(` `);h!==-1?this.__character_count=_.length-h:this.__character_count+=_.length},P.prototype.pop=function(){var _=null;return this.is_empty()||(_=this.__items.pop(),this.__character_count-=_.length),_},P.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},P.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},P.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},P.prototype.toString=function(){var _="";return this.is_empty()?this.__parent.indent_empty_lines&&(_=this.__parent.get_indent_string(this.__indent_count)):(_=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),_+=this.__items.join("")),_};function b(_,h){this.__cache=[""],this.__indent_size=_.indent_size,this.__indent_string=_.indent_char,_.indent_with_tabs||(this.__indent_string=new Array(_.indent_size+1).join(_.indent_char)),h=h||"",_.indent_level>0&&(h=new Array(_.indent_level+1).join(this.__indent_string)),this.__base_string=h,this.__base_string_length=h.length}b.prototype.get_indent_size=function(_,h){var r=this.__base_string_length;return h=h||0,_<0&&(r=0),r+=_*this.__indent_size,r+=h,r},b.prototype.get_indent_string=function(_,h){var r=this.__base_string;return h=h||0,_<0&&(_=0,r=""),h+=_*this.__indent_size,this.__ensure_cache(h),r+=this.__cache[h],r},b.prototype.__ensure_cache=function(_){for(;_>=this.__cache.length;)this.__add_column()},b.prototype.__add_column=function(){var _=this.__cache.length,h=0,r="";this.__indent_size&&_>=this.__indent_size&&(h=Math.floor(_/this.__indent_size),_-=h*this.__indent_size,r=new Array(h+1).join(this.__indent_string)),_&&(r+=new Array(_+1).join(" ")),this.__cache.push(r)};function p(_,h){this.__indent_cache=new b(_,h),this.raw=!1,this._end_with_newline=_.end_with_newline,this.indent_size=_.indent_size,this.wrap_line_length=_.wrap_line_length,this.indent_empty_lines=_.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new P(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(_,h){return this.__indent_cache.get_indent_string(_,h)},p.prototype.get_indent_size=function(_,h){return this.__indent_cache.get_indent_size(_,h)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(_){return this.is_empty()||!_&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(_){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 r=this.__lines.join(` `);return _!==` `&&(r=r.replace(/[\n]/g,_)),r},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(_,h){return _=_||0,h=h||0,this.next_line.set_indent(_,h),this.__lines.length>1?(this.current_line.set_indent(_,h),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(_){for(var h=0;h<_.newlines;h++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(_.whitespace_before),this.current_line.push(_.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},p.prototype.add_token=function(_){this.__add_space_before_token(),this.current_line.push(_),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},p.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},p.prototype.remove_indent=function(_){for(var h=this.__lines.length;_1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(_,h){for(var r=this.__lines.length-2;r>=0;){var d=this.__lines[r];if(d.is_empty())break;if(d.item(0).indexOf(_)!==0&&d.item(-1)!==h){this.__lines.splice(r+1,0,new P(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},L.exports.Output=p},,,,function(L){function P(_,h){this.raw_options=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"])}P.prototype._get_array=function(_,h){var r=this.raw_options[_],d=h||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(d=r.concat()):typeof r=="string"&&(d=r.split(/[^a-zA-Z0-9_\/\-]+/)),d},P.prototype._get_boolean=function(_,h){var r=this.raw_options[_],d=r===void 0?!!h:!!r;return d},P.prototype._get_characters=function(_,h){var r=this.raw_options[_],d=h||"";return typeof r=="string"&&(d=r.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),d},P.prototype._get_number=function(_,h){var r=this.raw_options[_];h=parseInt(h,10),isNaN(h)&&(h=0);var d=parseInt(r,10);return isNaN(d)&&(d=h),d},P.prototype._get_selection=function(_,h,r){var d=this._get_selection_list(_,h,r);if(d.length!==1)throw new Error("Invalid Option Value: The option '"+_+`' can only be one of the following values: `+h+` You passed in: '`+this.raw_options[_]+"'");return d[0]},P.prototype._get_selection_list=function(_,h,r){if(!h||h.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[h[0]],!this._is_valid_selection(r,h))throw new Error("Invalid Default Value!");var d=this._get_array(_,r);if(!this._is_valid_selection(d,h))throw new Error("Invalid Option Value: The option '"+_+`' can contain only the following values: `+h+` You passed in: '`+this.raw_options[_]+"'");return d},P.prototype._is_valid_selection=function(_,h){return _.length&&h.length&&!_.some(function(r){return h.indexOf(r)===-1})};function b(_,h){var r={};_=p(_);var d;for(d in _)d!==h&&(r[d]=_[d]);if(h&&_[h])for(d in _[h])r[d]=_[h][d];return r}function p(_){var h={},r;for(r in _){var d=r.replace(/-/g,"_");h[d]=_[r]}return h}L.exports.Options=P,L.exports.normalizeOpts=p,L.exports.mergeOpts=b},,function(L){var P=RegExp.prototype.hasOwnProperty("sticky");function b(p){this.__input=p||"",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&&p=0&&_=p.length&&this.__input.substring(_-p.length,_).toLowerCase()===p},L.exports.InputScanner=b},,,,,function(L){function P(b,p){b=typeof b=="string"?b:b.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(b+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(b+/\sbeautify\signore:end\s/.source+p,"g")}P.prototype.get_directives=function(b){if(!b.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var _=this.__directive_pattern.exec(b);_;)p[_[1]]=_[2],_=this.__directive_pattern.exec(b);return p},P.prototype.readIgnored=function(b){return b.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=P},,function(L,P,b){var p=b(16).Beautifier,_=b(17).Options;function h(r,d){var l=new p(r,d);return l.beautify()}L.exports=h,L.exports.defaultOptions=function(){return new _}},function(L,P,b){var p=b(17).Options,_=b(2).Output,h=b(8).InputScanner,r=b(13).Directives,d=new r(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,u=/\s/,c=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,O=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(A,w){this._source_text=A||"",this._options=new p(w),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}T.prototype.eatString=function(A){var w="";for(this._ch=this._input.next();this._ch;){if(w+=this._ch,this._ch==="\\")w+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return w},T.prototype.eatWhitespace=function(A){for(var w=u.test(this._input.peek()),m=0;u.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===` `&&((m===0||m0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,w=this._options.eol;w==="auto"&&(w=` `,A&&l.test(A||"")&&(w=A.match(l)[0])),A=A.replace(a,` `);var m=A.match(/^[\t ]*/)[0];this._output=new _(this._options,m),this._input=new h(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var v=0,s=!1,o=!1,E=!1,g=!1,C=!1,N=!1,U=this._ch,j=!1,H,y,x;H=this._input.read(c),y=H!=="",x=U,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),U=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var F=this._input.read(R),Q=d.get_directives(F);Q&&Q.ignore==="start"&&(F+=d.readIgnored(this._input)),this.print_string(F),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(O)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(y),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);q.match(/[ :]$/)&&(q=this.eatString(": ").replace(/\s$/,""),this.print_string(q),this._output.space_before_token=!0),q=q.replace(/\s$/,""),q==="extend"?g=!0:q==="import"&&(C=!0),q in this.NESTED_AT_RULE?(this._nestedLevel+=1,q in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!s&&v===0&&q.indexOf(":")!==-1&&(o=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(y),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")o&&(o=!1,this.outdent()),E?(E=!1,s=this._indentLevel>=this._nestedLevel):s=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&s&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),C=!1,g=!1,o&&(this.outdent(),o=!1),this.print_string(this._ch),s=!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 ie=0;ie"||this._ch==="+"||this._ch==="~")&&!o&&v===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&u.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(y),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),u.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ue=x==='"'||x==="'";this.preserveSingleSpace(ue||y),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&j&&this._output.add_new_line()}var he=this._output.get_code(w);return he},L.exports.Beautifier=T},function(L,P,b){var p=b(6).Options;function _(h){p.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 r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var d=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l=15&&(p=!1,L=!0);var T=u&&(P||p&&(O==null||O<12.11)),A=M||K&&W>=9;function w(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var m=function(e,t){var i=e.className,n=w(t).exec(i);if(n){var f=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(f?n[1]+f:"")}};function v(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function s(e,t){return v(e).appendChild(t)}function o(e,t,i,n){var f=document.createElement(e);if(i&&(f.className=i),n&&(f.style.cssText=n),typeof t=="string")f.appendChild(document.createTextNode(t));else if(t)for(var k=0;k=t)return X+(t-k);X+=J-k,X+=i-X%i,k=J+1}}var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=y(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 i=+new Date+e;(!this.id||i=t)return n+Math.min(X,t-f);if(f+=k-n,f+=i-f%i,n=k+1,f>=t)return n}}var le=[""];function ne(e){for(;le.length<=e;)le.push(Te(le)+" ");return le[e]}function Te(e){return e[e.length-1]}function Fe(e,t){for(var i=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ne.test(e))}function Je(e,t){return t?t.source.indexOf("\\w")>-1&&Be(e)?!0:t.test(e):Be(e)}function tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var it=/[\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 rt(e){return e.charCodeAt(0)>=768&&it.test(e)}function qe(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var f=(t+i)/2,k=n<0?Math.ceil(f):Math.floor(f);if(k==t)return e(k)?t:i;e(k)?i=k:t=k+n}}function pt(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var f=!1,k=0;kt||t==i&&X.to==t)&&(n(Math.max(X.from,t),Math.min(X.to,i),X.level==1?"rtl":"ltr",k),f=!0)}f||n(t,i,"ltr")}var vt=null;function at(e,t,i){var n;vt=null;for(var f=0;ft)return f;k.to==t&&(k.from!=k.to&&i=="before"?n=f:vt=f),k.from==t&&(k.from!=k.to&&i!="before"?n=f:vt=f)}return n!=null?n:vt}var Rt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(ae){return ae<=247?e.charAt(ae):1424<=ae&&ae<=1524?"R":1536<=ae&&ae<=1785?t.charAt(ae-1536):1774<=ae&&ae<=2220?"r":8192<=ae&&ae<=8203?"w":ae==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,k=/[LRr]/,X=/[Lb1n]/,J=/[1n]/;function ee(ae,Se,Re){this.level=ae,this.from=Se,this.to=Re}return function(ae,Se){var Re=Se=="ltr"?"L":"R";if(ae.length==0||Se=="ltr"&&!n.test(ae))return!1;for(var Ve=ae.length,We=[],st=0;st-1&&(n[t]=f.slice(0,k).concat(f.slice(k+1)))}}}function ze(e,t){var i=Mt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),f=0;f0}function pe(e){e.prototype.on=function(t,i){Ye(this,t,i)},e.prototype.off=function(t,i){St(this,t,i)}}function se(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ce(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ee(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Ae(e){se(e),ce(e)}function De(e){return e.target||e.srcElement}function $e(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),u&&e.ctrlKey&&t==1&&(t=3),t}var lt=function(){if(K&&W<9)return!1;var e=o("div");return"draggable"in e||"dragDrop"in e}(),Bt;function tn(e){if(Bt==null){var t=o("span","\u200B");s(e,o("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Bt=t.offsetWidth<=1&&t.offsetHeight>2&&!(K&&W<8))}var i=Bt?o("span","\u200B"):o("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var nn;function _n(e){if(nn!=null)return nn;var t=s(e,document.createTextNode("A\u062EA")),i=g(t,0,1).getBoundingClientRect(),n=g(t,1,2).getBoundingClientRect();return v(e),!i||i.left==i.right?!1:nn=n.right-i.right<3}var yn=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var f=e.indexOf(` `,t);f==-1&&(f=e.length);var k=e.slice(t,e.charAt(f-1)=="\r"?f-1:f),X=k.indexOf("\r");X!=-1?(i.push(k.slice(0,X)),t+=X+1):(i.push(k),t=f+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Gt=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ii=function(){var e=o("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Dn=null;function Ci(e){if(Dn!=null)return Dn;var t=s(e,o("span","x")),i=t.getBoundingClientRect(),n=g(t,0,1).getBoundingClientRect();return Dn=Math.abs(i.left-n.left)>1}var fi={},In={};function Ri(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),fi[e]=t}function Si(e,t){In[e]=t}function Ot(e){if(typeof e=="string"&&In.hasOwnProperty(e))e=In[e];else if(e&&typeof e.name=="string"&&In.hasOwnProperty(e.name)){var t=In[e.name];typeof t=="string"&&(t={name:t}),e=He(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ot("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ot("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function bn(e,t){t=Ot(t);var i=fi[t.name];if(!i)return bn(e,"text/plain");var n=i(e,t);if(Cn.hasOwnProperty(t.name)){var f=Cn[t.name];for(var k in f){if(!f.hasOwnProperty(k))continue;n.hasOwnProperty(k)&&(n["_"+k]=n[k]),n[k]=f[k]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var X in t.modeProps)n[X]=t.modeProps[X];return n}var Cn={};function kn(e,t){var i=Cn.hasOwnProperty(e)?Cn[e]:Cn[e]={};x(t,i)}function Ai(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var f=t[n];f instanceof Array&&(f=f.concat([])),i[n]=f}return i}function Ui(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function dr(e,t,i){return e.startState?e.startState(t,i):!0}var mn=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};mn.prototype.eol=function(){return this.pos>=this.string.length},mn.prototype.sol=function(){return this.pos==this.lineStart},mn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mn.prototype.next=function(){if(this.post},mn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mn.prototype.skipToEnd=function(){this.pos=this.string.length},mn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mn.prototype.backUp=function(e){this.pos-=e},mn.prototype.column=function(){return this.lastColumnPos0?null:(k&&t!==!1&&(this.pos+=k[0].length),k)}},mn.prototype.current=function(){return this.string.slice(this.start,this.pos)},mn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Jt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var f=i.children[n],k=f.chunkSize();if(t=e.first&&ti?yt(i,Jt(e,i).text.length):D(t,Jt(e,t.line).text.length)}function D(e,t){var i=e.ch;return i==null||i>t?yt(e.line,t):i<0?yt(e.line,0):e}function z(e,t){for(var i=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},Y.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Y.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Y.fromSaved=function(e,t,i){return t instanceof te?new Y(e,Ai(e.mode,t.state),i,t.lookAhead):new Y(e,Ai(e.mode,t),i)},Y.prototype.save=function(e){var t=e!==!1?Ai(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new te(t,this.maxLookAhead):t};function Le(e,t,i,n){var f=[e.state.modeGen],k={};dt(e,t.text,e.doc.mode,i,function(ae,Se){return f.push(ae,Se)},k,n);for(var X=i.state,J=function(ae){i.baseTokens=f;var Se=e.state.overlays[ae],Re=1,Ve=0;i.state=!0,dt(e,t.text,Se.mode,i,function(We,st){for(var _t=Re;VeWe&&f.splice(Re,1,We,f[Re+1],It),Re+=2,Ve=Math.min(We,It)}if(!st)return;if(Se.opaque)f.splice(_t,Re-_t,We,"overlay "+st),Re=_t+2;else for(;_te.options.maxHighlightLength&&Ai(e.doc.mode,n.state),k=Le(e,t,n);f&&(n.state=f),t.stateAfter=n.save(!f),t.styles=k.styles,k.classes?t.styleClasses=k.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Pt(e,t,i){var n=e.doc,f=e.display;if(!n.mode.startState)return new Y(n,!0,t);var k=kt(e,t,i),X=k>n.first&&Jt(n,k-1).stateAfter,J=X?Y.fromSaved(n,X,k):new Y(n,dr(n.mode),k);return n.iter(k,t,function(ee){rn(e,ee.text,J);var ae=J.line;ee.stateAfter=ae==t-1||ae%5==0||ae>=f.viewFrom&&aet.start)return k}throw new Error("Mode "+e.name+" failed to advance stream.")}var hi=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Li(e,t,i,n){var f=e.doc,k=f.mode,X;t=S(f,t);var J=Jt(f,t.line),ee=Pt(e,t.line,i),ae=new mn(J.text,e.options.tabSize,ee),Se;for(n&&(Se=[]);(n||ae.pose.options.maxHighlightLength?(J=!1,X&&rn(e,t,n,Se.pos),Se.pos=t.length,Re=null):Re=Zt(Vt(i,Se,n.state,Ve),k),Ve){var We=Ve[0].name;We&&(Re="m-"+(Re?We+" "+Re:We))}if(!J||ae!=Re){for(;eeX;--J){if(J<=k.first)return k.first;var ee=Jt(k,J-1),ae=ee.stateAfter;if(ae&&(!i||J+(ae instanceof te?ae.lookAhead:0)<=k.modeFrontier))return J;var Se=F(ee.text,null,e.options.tabSize);(f==null||n>Se)&&(f=J-1,n=Se)}return f}function Lt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontieri;n--){var f=Jt(e,n).stateAfter;if(f&&(!(f instanceof te)||n+f.lookAhead=t:k.to>t);(n||(n=[])).push(new hn(X,k.from,ee?null:k.to))}}return n}function di(e,t,i){var n;if(e)for(var f=0;f=t:k.to>t);if(J||k.from==t&&X.type=="bookmark"&&(!i||k.marker.insertLeft)){var ee=k.from==null||(X.inclusiveLeft?k.from<=t:k.from0&&J)for(var on=0;on0)continue;var Se=[ee,1],Re=cn(ae.from,J.from),Ve=cn(ae.to,J.to);(Re<0||!X.inclusiveLeft&&!Re)&&Se.push({from:ae.from,to:J.from}),(Ve>0||!X.inclusiveRight&&!Ve)&&Se.push({from:J.to,to:ae.to}),f.splice.apply(f,Se),ee+=Se.length-3}return f}function si(e){var t=e.markedSpans;if(!t)return;for(var i=0;it)&&(!n||pn(n,k.marker)<0)&&(n=k.marker)}return n}function Yt(e,t,i,n,f){var k=Jt(e,t),X=sn&&k.markedSpans;if(X)for(var J=0;J=0&&Re<=0||Se<=0&&Re>=0)continue;if(Se<=0&&(ee.marker.inclusiveRight&&f.inclusiveLeft?cn(ae.to,i)>=0:cn(ae.to,i)>0)||Se>=0&&(ee.marker.inclusiveRight&&f.inclusiveLeft?cn(ae.from,n)<=0:cn(ae.from,n)<0))return!0}}function xn(e){for(var t;t=Nt(e);)e=t.find(-1,!0).line;return e}function pi(e){for(var t;t=Dt(e);)e=t.find(1,!0).line;return e}function On(e){for(var t,i;t=Dt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function tr(e,t){var i=Jt(e,t),n=xn(i);return i==n?t:Fn(n)}function nr(e,t){if(t>e.lastLine())return t;var i=Jt(e,t),n;if(!Fi(e,i))return t;for(;n=Dt(i);)i=n.find(1,!0).line;return Fn(i)+1}function Fi(e,t){var i=sn&&t.markedSpans;if(i)for(var n=void 0,f=0;ft.maxLineLength&&(t.maxLineLength=f,t.maxLine=n)})}var $n=function(e,t,i){this.text=e,Un(this,t),this.height=i?i(this):1};$n.prototype.lineNo=function(){return Fn(this)},pe($n);function ir(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),si(e),Un(e,i);var f=n?n(e):1;f!=e.height&&sr(e,f)}function Qt(e){e.parent=null,si(e)}var qt={},$t={};function dn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?$t:qt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Gn(e,t){var i=E("span",null,null,L?"padding-right: .1px":null),n={pre:E("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var f=0;f<=(t.rest?t.rest.length:0);f++){var k=f?t.rest[f-1]:t.line,X=void 0;n.pos=0,n.addToken=qn,_n(e.display.measure)&&(X=xt(k,e.doc.direction))&&(n.addToken=Tr(n.addToken,X)),n.map=[];var J=t!=e.display.externalMeasured&&Fn(k);$r(k,n,ct(e,k,J)),k.styleClasses&&(k.styleClasses.bgClass&&(n.bgClass=j(k.styleClasses.bgClass,n.bgClass||"")),k.styleClasses.textClass&&(n.textClass=j(k.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(tn(e.display.measure))),f==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(L){var ee=n.content.lastChild;(/\bcm-tab\b/.test(ee.className)||ee.querySelector&&ee.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ze(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function Mn(e){var t=o("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function qn(e,t,i,n,f,k,X){if(!t)return;var J=e.splitSpaces?mi(t,e.trailingSpace):t,ee=e.cm.state.specialChars,ae=!1,Se;if(!ee.test(t))e.col+=t.length,Se=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,Se),K&&W<9&&(ae=!0),e.pos+=t.length;else{Se=document.createDocumentFragment();for(var Re=0;;){ee.lastIndex=Re;var Ve=ee.exec(t),We=Ve?Ve.index-Re:t.length-Re;if(We){var st=document.createTextNode(J.slice(Re,Re+We));K&&W<9?Se.appendChild(o("span",[st])):Se.appendChild(st),e.map.push(e.pos,e.pos+We,st),e.col+=We,e.pos+=We}if(!Ve)break;Re+=We+1;var _t=void 0;if(Ve[0]==" "){var It=e.cm.options.tabSize,Wt=It-e.col%It;_t=Se.appendChild(o("span",ne(Wt),"cm-tab")),_t.setAttribute("role","presentation"),_t.setAttribute("cm-text"," "),e.col+=Wt}else Ve[0]=="\r"||Ve[0]==` `?(_t=Se.appendChild(o("span",Ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_t.setAttribute("cm-text",Ve[0]),e.col+=1):(_t=e.cm.options.specialCharPlaceholder(Ve[0]),_t.setAttribute("cm-text",Ve[0]),K&&W<9?Se.appendChild(o("span",[_t])):Se.appendChild(_t),e.col+=1);e.map.push(e.pos,e.pos+1,_t),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,i||n||f||ae||k||X){var en=i||"";n&&(en+=n),f&&(en+=f);var Ht=o("span",[Se],en,k);if(X)for(var on in X)X.hasOwnProperty(on)&&on!="style"&&on!="class"&&Ht.setAttribute(on,X[on]);return e.content.appendChild(Ht)}e.content.appendChild(Se)}function mi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",f=0;fae&&Re.from<=ae);Ve++);if(Re.to>=Se)return e(i,n,f,k,X,J,ee);e(i,n.slice(0,Re.to-ae),f,k,null,J,ee),k=null,n=n.slice(Re.to-ae),ae=Re.to}}}function Zn(e,t,i,n){var f=!n&&i.widgetNode;f&&e.map.push(e.pos,e.pos+t,f),!n&&e.cm.display.input.needsContentAttribute&&(f||(f=e.content.appendChild(document.createElement("span"))),f.setAttribute("cm-marker",i.id)),f&&(e.cm.display.input.setUneditable(f),e.content.appendChild(f)),e.pos+=t,e.trailingSpace=!1}function $r(e,t,i){var n=e.markedSpans,f=e.text,k=0;if(!n){for(var X=1;Xee||ai.collapsed&&vn.to==ee&&vn.from==ee)){if(vn.to!=null&&vn.to!=ee&&We>vn.to&&(We=vn.to,_t=""),ai.className&&(st+=" "+ai.className),ai.css&&(Ve=(Ve?Ve+";":"")+ai.css),ai.startStyle&&vn.from==ee&&(It+=" "+ai.startStyle),ai.endStyle&&vn.to==We&&(on||(on=[])).push(ai.endStyle,vn.to),ai.title&&((en||(en={})).title=ai.title),ai.attributes)for(var Ni in ai.attributes)(en||(en={}))[Ni]=ai.attributes[Ni];ai.collapsed&&(!Wt||pn(Wt.marker,ai)<0)&&(Wt=vn)}else vn.from>ee&&We>vn.from&&(We=vn.from)}if(on)for(var Er=0;Er=J)break;for(var Yr=Math.min(J,We);;){if(Se){var Fr=ee+Se.length;if(!Wt){var ur=Fr>Yr?Se.slice(0,Yr-ee):Se;t.addToken(t,ur,Re?Re+st:st,It,ee+ur.length==We?_t:"",Ve,en)}if(Fr>=Yr){Se=Se.slice(Yr-ee),ee=Yr;break}ee=Fr,It=""}Se=f.slice(k,k=i[ae++]),Re=dn(i[ae++],t.cm.options)}}}function gi(e,t,i){this.line=t,this.rest=On(t),this.size=this.rest?Fn(Te(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Fi(e,t)}function fr(e,t,i){for(var n=[],f,k=t;k2&&k.push((ee.bottom+ae.top)/2-i.top)}}k.push(i.bottom-i.top)}}function oe(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;ni)return{map:e.measure.maps[f],cache:e.measure.caches[f],before:!0}}function we(e,t){t=xn(t);var i=Fn(t),n=e.display.externalMeasured=new gi(e.doc,t,i);n.lineN=i;var f=n.built=Gn(e,n);return n.text=f.pre,s(e.display.lineMeasure,f.pre),n}function ve(e,t,i,n){return je(e,Ie(e,t),i,n)}function ke(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(k=ee-J,f=k-1,t>=ee&&(X="right")),f!=null){if(n=e[ae+2],J==ee&&i==(n.insertLeft?"left":"right")&&(X=i),i=="left"&&f==0)for(;ae&&e[ae-2]==e[ae-3]&&e[ae-1].insertLeft;)n=e[(ae-=3)+2],X="left";if(i=="right"&&f==ee-J)for(;ae=0&&!((i=e[f]).left!=i.right);f--);return i}function Ut(e,t,i,n){var f=mt(t.map,i,n),k=f.node,X=f.start,J=f.end,ee=f.collapse,ae;if(k.nodeType==3){for(var Se=0;Se<4;Se++){for(;X&&rt(t.line.text.charAt(f.coverStart+X));)--X;for(;f.coverStart+J0&&(ee=n="right");var Re;e.options.lineWrapping&&(Re=k.getClientRects()).length>1?ae=Re[n=="right"?Re.length-1:0]:ae=k.getBoundingClientRect()}if(K&&W<9&&!X&&(!ae||!ae.left&&!ae.right)){var Ve=k.parentNode.getClientRects()[0];Ve?ae={left:Ve.left,right:Ve.left+Gi(e.display),top:Ve.top,bottom:Ve.bottom}:ae=Ze}for(var We=ae.top-t.rect.top,st=ae.bottom-t.rect.top,_t=(We+st)/2,It=t.view.measure.heights,Wt=0;Wt=n.text.length?(ee=n.text.length,ae="before"):ee<=0&&(ee=0,ae="after"),!J)return X(ae=="before"?ee-1:ee,ae=="before");function Se(st,_t,It){var Wt=J[_t],en=Wt.level==1;return X(It?st-1:st,en!=It)}var Re=at(J,ee,ae),Ve=vt,We=Se(ee,Re,ae=="before");return Ve!=null&&(We.other=Se(ee,Ve,ae!="before")),We}function gn(e,t){var i=0;t=S(e.doc,t),e.options.lineWrapping||(i=Gi(e.display)*t.ch);var n=Jt(e.doc,t.line),f=Ft(n)+ba(e.display);return{left:i,right:i,top:f,bottom:f+n.height}}function fn(e,t,i,n,f){var k=yt(e,t,i);return k.xRel=f,n&&(k.outside=n),k}function Hn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return fn(n.first,0,null,-1,-1);var f=er(n,i),k=n.first+n.size-1;if(f>k)return fn(n.first+n.size-1,Jt(n,k).text.length,null,1,1);t<0&&(t=0);for(var X=Jt(n,f);;){var J=Mi(e,X,f,t,i),ee=Pe(X,J.ch+(J.xRel>0||J.outside>0?1:0));if(!ee)return J;var ae=ee.find(1);if(ae.line==f)return ae;X=Jt(n,f=ae.line)}}function ui(e,t,i,n){n-=Wn(t);var f=t.text.length,k=gt(function(X){return je(e,i,X-1).bottom<=n},f,0);return f=gt(function(X){return je(e,i,X).top>n},k,f),{begin:k,end:f}}function an(e,t,i,n){i||(i=Ie(e,t));var f=Jn(e,t,je(e,i,n),"line").top;return ui(e,t,i,f)}function ci(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Mi(e,t,i,n,f){f-=Ft(t);var k=Ie(e,t),X=Wn(t),J=0,ee=t.text.length,ae=!0,Se=xt(t,e.doc.direction);if(Se){var Re=(e.options.lineWrapping?wi:ri)(e,t,i,k,Se,n,f);ae=Re.level!=1,J=ae?Re.from:Re.to-1,ee=ae?Re.to:Re.from-1}var Ve=null,We=null,st=gt(function(Pn){var vn=je(e,k,Pn);return vn.top+=X,vn.bottom+=X,ci(vn,n,f,!1)?(vn.top<=f&&vn.left<=n&&(Ve=Pn,We=vn),!0):!1},J,ee),_t,It,Wt=!1;if(We){var en=n-We.left=on.bottom?1:0}return st=qe(t.text,st,1),fn(i,st,It,Wt,n-_t)}function ri(e,t,i,n,f,k,X){var J=gt(function(Re){var Ve=f[Re],We=Ve.level!=1;return ci(ti(e,yt(i,We?Ve.to:Ve.from,We?"before":"after"),"line",t,n),k,X,!0)},0,f.length-1),ee=f[J];if(J>0){var ae=ee.level!=1,Se=ti(e,yt(i,ae?ee.from:ee.to,ae?"after":"before"),"line",t,n);ci(Se,k,X,!0)&&Se.top>X&&(ee=f[J-1])}return ee}function wi(e,t,i,n,f,k,X){var J=ui(e,t,n,X),ee=J.begin,ae=J.end;/\s/.test(t.text.charAt(ae-1))&&ae--;for(var Se=null,Re=null,Ve=0;Ve=ae||We.to<=ee)continue;var st=We.level!=1,_t=je(e,n,st?Math.min(ae,We.to)-1:Math.max(ee,We.from)).right,It=_tIt)&&(Se=We,Re=It)}return Se||(Se=f[f.length-1]),Se.fromae&&(Se={from:Se.from,to:ae,level:Se.level}),Se}var bi;function Hi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(bi==null){bi=o("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)bi.appendChild(document.createTextNode("x")),bi.appendChild(o("br"));bi.appendChild(document.createTextNode("x"))}s(e.measure,bi);var i=bi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),v(e.measure),i||1}function Gi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=o("span","xxxxxxxxxx"),i=o("pre",[t],"CodeMirror-line-like");s(e.measure,i);var n=t.getBoundingClientRect(),f=(n.right-n.left)/10;return f>2&&(e.cachedCharWidth=f),f||10}function Bi(e){for(var t=e.display,i={},n={},f=t.gutters.clientLeft,k=t.gutters.firstChild,X=0;k;k=k.nextSibling,++X){var J=e.display.gutterSpecs[X].className;i[J]=k.offsetLeft+k.clientLeft+f,n[J]=k.clientWidth}return{fixedPos:vr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function vr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Lr(e){var t=Hi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Gi(e.display)-3);return function(f){if(Fi(e.doc,f))return 0;var k=0;if(f.widgets)for(var X=0;X0&&(ae=Jt(e.doc,ee.line).text).length==ee.ch){var Se=F(ae,ae.length,e.options.tabSize)-ae.length;ee=yt(ee.line,Math.max(0,Math.round((k-Oe(e.display).left)/Gi(e.display))-Se))}return ee}function Di(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;nt)&&(f.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=f.viewTo)sn&&tr(e.doc,t)f.viewFrom?xi(e):(f.viewFrom+=n,f.viewTo+=n);else if(t<=f.viewFrom&&i>=f.viewTo)xi(e);else if(t<=f.viewFrom){var k=Nr(e,i,i+n,1);k?(f.view=f.view.slice(k.index),f.viewFrom=k.lineN,f.viewTo+=n):xi(e)}else if(i>=f.viewTo){var X=Nr(e,t,t,-1);X?(f.view=f.view.slice(0,X.index),f.viewTo=X.lineN):xi(e)}else{var J=Nr(e,t,t,-1),ee=Nr(e,i,i+n,1);J&&ee?(f.view=f.view.slice(0,J.index).concat(fr(e,J.lineN,ee.lineN)).concat(f.view.slice(ee.index)),f.viewTo+=n):xi(e)}var ae=f.externalMeasured;ae&&(i=f.lineN&&t=n.viewTo)return;var k=n.view[Di(e,t)];if(k.node==null)return;var X=k.changes||(k.changes=[]);q(X,i)==-1&&X.push(i)}function xi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Nr(e,t,i,n){var f=Di(e,t),k,X=e.display.view;if(!sn||i==e.doc.first+e.doc.size)return{index:f,lineN:i};for(var J=e.display.viewFrom,ee=0;ee0){if(f==X.length-1)return null;k=J+X[f].size-t,f++}else k=J-t;t+=k,i+=k}for(;tr(e.doc,i)!=i;){if(f==(n<0?0:X.length-1))return null;i+=n*X[f-(n<0?1:0)].size,f+=n}return{index:f,lineN:i}}function Zr(e,t,i){var n=e.display,f=n.view;f.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=fr(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=fr(e,t,n.viewFrom).concat(n.view):n.viewFromi&&(n.view=n.view.slice(0,Di(e,i)))),n.viewTo=i}function ra(e){for(var t=e.display.view,i=0,n=0;n=e.display.viewTo||J.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Ea(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ua(e){e.state.focused||(e.display.input.focus(),ca(e))}function Za(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ea(e))},100)}function ca(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ze(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),L&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ji(e)}function Ea(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ze(e,"blur",e,t),e.state.focused=!1,m(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function $i(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n.005||Se<-.005)&&(sr(f.line,X),Xr(f.line),f.rest))for(var Re=0;Ree.display.sizerWidth){var Ve=Math.ceil(J/Gi(e.display));Ve>e.display.maxLineLength&&(e.display.maxLineLength=Ve,e.display.maxLine=f.line,e.display.maxLineChanged=!0)}}}function Xr(e){if(e.widgets)for(var t=0;t=X&&(k=er(t,Ft(Jt(t,ee))-e.wrapper.clientHeight),X=ee)}return{from:k,to:Math.max(X,k+1)}}function Po(e,t){if(ut(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),f=null;if(t.top+n.top<0?f=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(f=!1),f!=null&&!r){var k=o("div","\u200B",null,`position: absolute; top: `+(t.top-i.viewOffset-ba(e.display))+`px; height: `+(t.bottom-t.top+Me(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(k),k.scrollIntoView(f),e.display.lineSpace.removeChild(k)}}function Io(e,t,i,n){n==null&&(n=0);var f;!e.options.lineWrapping&&t==i&&(t=t.ch?yt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?yt(t.line,t.ch+1,"before"):t);for(var k=0;k<5;k++){var X=!1,J=ti(e,t),ee=!i||i==t?J:ti(e,i);f={left:Math.min(J.left,ee.left),top:Math.min(J.top,ee.top)-n,right:Math.max(J.left,ee.left),bottom:Math.max(J.bottom,ee.bottom)+n};var ae=Ja(e,f),Se=e.doc.scrollTop,Re=e.doc.scrollLeft;if(ae.scrollTop!=null&&(ha(e,ae.scrollTop),Math.abs(e.doc.scrollTop-Se)>1&&(X=!0)),ae.scrollLeft!=null&&(Dr(e,ae.scrollLeft),Math.abs(e.doc.scrollLeft-Re)>1&&(X=!0)),!X)break}return f}function mo(e,t){var i=Ja(e,t);i.scrollTop!=null&&ha(e,i.scrollTop),i.scrollLeft!=null&&Dr(e,i.scrollLeft)}function Ja(e,t){var i=e.display,n=Hi(e.display);t.top<0&&(t.top=0);var f=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,k=re(e),X={};t.bottom-t.top>k&&(t.bottom=t.top+k);var J=e.doc.height+ye(i),ee=t.topJ-n;if(t.topf+k){var Se=Math.min(t.top,(ae?J:t.bottom)-k);Se!=f&&(X.scrollTop=Se)}var Re=e.options.fixedGutter?0:i.gutters.offsetWidth,Ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Re,We=Ce(e)-i.gutters.offsetWidth,st=t.right-t.left>We;return st&&(t.right=t.left+We),t.left<10?X.scrollLeft=0:t.leftWe+Ve-3&&(X.scrollLeft=t.right+(st?0:10)-We),X}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 da(e){ja(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function xa(e,t,i){(t!=null||i!=null)&&ja(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}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 i=gn(e,t.from),n=gn(e,t.to);Ta(e,i,n,t.margin)}}function Ta(e,t,i,n){var f=Ja(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});xa(e,f.scrollLeft,f.scrollTop)}function ha(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;M||Oa(e,{top:t}),Pi(e,t,!0),M&&Oa(e),Aa(e,100)}function Pi(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Dr(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,oi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function fa(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+ye(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+Me(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var aa=function(e,t,i){this.cm=i;var n=this.vert=o("div",[o("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),f=this.horiz=o("div",[o("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=f.tabIndex=-1,e(n),e(f),Ye(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ye(f,"scroll",function(){f.clientWidth&&t(f.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,K&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};aa.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var f=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+f)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var k=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+k)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},aa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},aa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},aa.prototype.zeroWidthHack=function(){var e=u&&!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},aa.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var f=e.getBoundingClientRect(),k=i=="vert"?document.elementFromPoint(f.right-1,(f.top+f.bottom)/2):document.elementFromPoint((f.right+f.left)/2,f.bottom-1);k!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},aa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function pa(e,t){t||(t=fa(e));var i=e.display.barWidth,n=e.display.barHeight;Fa(e,t);for(var f=0;f<4&&i!=e.display.barWidth||n!=e.display.barHeight;f++)i!=e.display.barWidth&&e.options.lineWrapping&&$i(e),Fa(e,fa(e)),i=e.display.barWidth,n=e.display.barHeight}function Fa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var eo={native:aa,null:Sa};function Wa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&m(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new eo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ye(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Dr(e,t):ha(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var to=0;function qr(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},Mr(e.curOp)}function oa(e){var t=e.curOp;t&&Do(t,function(i){for(var n=0;n=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Pr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ko(e){e.updatedDisplay=e.mustUpdate&&ma(e.cm,e.update)}function Mo(e){var t=e.cm,i=t.display;e.updatedDisplay&&$i(t),e.barMeasure=fa(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ve(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Me(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ce(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ro(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Pt(e,t.highlightFrontier),f=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(k){if(n.line>=e.display.viewFrom){var X=k.styles,J=k.text.length>e.options.maxHighlightLength?Ai(t.mode,n.state):null,ee=Le(e,k,n,!0);J&&(n.state=J),k.styles=ee.styles;var ae=k.styleClasses,Se=ee.classes;Se?k.styleClasses=Se:ae&&(k.styleClasses=null);for(var Re=!X||X.length!=k.styles.length||ae!=Se&&(!ae||!Se||ae.bgClass!=Se.bgClass||ae.textClass!=Se.textClass),Ve=0;!Re&&Vei)return Aa(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),f.length&&Zi(e,function(){for(var k=0;k=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&ra(e)==0)return!1;lr(e)&&(xi(e),t.dims=Bi(e));var f=n.first+n.size,k=Math.max(t.visible.from-e.options.viewportMargin,n.first),X=Math.min(f,t.visible.to+e.options.viewportMargin);i.viewFromX&&i.viewTo-X<20&&(X=Math.min(f,i.viewTo)),sn&&(k=tr(e.doc,k),X=nr(e.doc,X));var J=k!=i.viewFrom||X!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Zr(e,k,X),i.viewOffset=Ft(Jt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var ee=ra(e);if(!J&&ee==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var ae=Ka(e);return ee>4&&(i.lineDiv.style.display="none"),_o(e,i.updateLineNumbers,t.dims),ee>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,vo(ae),v(i.cursorDiv),v(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,J&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Aa(e,400)),i.updateLineNumbers=null,!0}function za(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ce(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ye(e.display)-re(e),i.top)}),t.visible=Ba(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Ba(e.display,e.doc,i));if(!ma(e,t))break;$i(e);var f=fa(e);Ti(e),pa(e,f),_i(e,f),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Oa(e,t){var i=new Pr(e,t);if(ma(e,i)){$i(e),za(e,i);var n=fa(e);Ti(e),pa(e,n),_i(e,n),i.finish()}}function _o(e,t,i){var n=e.display,f=e.options.lineNumbers,k=n.lineDiv,X=k.firstChild;function J(st){var _t=st.nextSibling;return L&&u&&e.display.currentWheelTarget==st?st.style.display="none":st.parentNode.removeChild(st),_t}for(var ee=n.view,ae=n.viewFrom,Se=0;Se-1&&(We=!1),uo(e,Re,ae,i)),We&&(v(Re.lineNumber),Re.lineNumber.appendChild(document.createTextNode(Qr(e.options,ae)))),X=Re.node.nextSibling}ae+=Re.size}for(;X;)X=J(X)}function Ga(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _i(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+Me(e)+"px"}function oi(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=vr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,f=t.gutters.offsetWidth,k=n+"px",X=0;XX.clientWidth,ee=X.scrollHeight>X.clientHeight;if(!(n&&J||f&&ee))return;if(f&&u&&L){e:for(var ae=t.target,Se=k.view;ae!=X;ae=ae.parentNode)for(var Re=0;Re=0&&cn(e,n.to())<=0)return i}return-1};var nt=function(e,t){this.anchor=e,this.head=t};nt.prototype.from=function(){return Gr(this.anchor,this.head)},nt.prototype.to=function(){return na(this.anchor,this.head)},nt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ot(e,t,i){var n=e&&e.options.selectionsMayTouch,f=t[i];t.sort(function(Ve,We){return cn(Ve.from(),We.from())}),i=q(t,f);for(var k=1;k0:ee>=0){var ae=Gr(J.from(),X.from()),Se=na(J.to(),X.to()),Re=J.empty()?X.from()==X.head:J.from()==J.head;k<=i&&--i,t.splice(--k,2,new nt(Re?Se:ae,Re?ae:Se))}}return new Ge(t,i)}function At(e,t){return new Ge([new nt(e,t||e)],0)}function wt(e){return e.text?yt(e.from.line+e.text.length-1,Te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Et(e,t){if(cn(e,t.from)<0)return e;if(cn(e,t.to)<=0)return wt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=wt(t).ch-t.to.ch),yt(i,n)}function ln(e,t){for(var i=[],n=0;n1&&e.remove(J.line+1,st-1),e.insert(J.line+1,Wt)}Wi(e,"change",e,t)}function Ar(e,t,i){function n(f,k,X){if(f.linked)for(var J=0;J1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Te(e.done)}function Es(e,t,i,n){var f=e.history;f.undone.length=0;var k=+new Date,X,J;if((f.lastOp==n||f.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&f.lastModTime>k-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(X=pl(f,f.lastOp==n)))J=Te(X.changes),cn(t.from,t.to)==0&&cn(t.from,J.to)==0?J.to=wt(t):X.changes.push(Br(e,t));else{var ee=Te(f.done);for((!ee||!ee.ranges)&&$o(e.sel,f.done),X={changes:[Br(e,t)],generation:f.generation},f.done.push(X);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift()}f.done.push(i),f.generation=++f.maxGeneration,f.lastModTime=f.lastSelTime=k,f.lastOp=f.lastSelOp=n,f.lastOrigin=f.lastSelOrigin=t.origin,J||ze(e,"historyAdded")}function ml(e,t,i,n){var f=t.charAt(0);return f=="*"||f=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var f=e.history,k=n&&n.origin;i==f.lastSelOp||k&&f.lastSelOrigin==k&&(f.lastModTime==f.lastSelTime&&f.lastOrigin==k||ml(e,k,Te(f.done),t))?f.done[f.done.length-1]=t:$o(t,f.done),f.lastSelTime=+new Date,f.lastSelOrigin=k,f.lastSelOp=i,n&&n.clearRedo!==!1&&yo(f.undone)}function $o(e,t){var i=Te(t);i&&i.ranges&&i.equals(e)||t.push(e)}function xs(e,t,i,n){var f=t["spans_"+e.id],k=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(X){X.markedSpans&&((f||(f=t["spans_"+e.id]={}))[k]=X.markedSpans),++k})}function vl(e){if(!e)return null;for(var t,i=0;i-1&&(Te(J)[Re]=ae[Re],delete ae[Re]))}}return n}function ls(e,t,i,n){if(n){var f=e.anchor;if(i){var k=cn(t,f)<0;k!=cn(i,f)<0?(f=t,t=i):k!=cn(t,i)<0&&(t=i)}return new nt(f,t)}else return new nt(i||t,t)}function Zo(e,t,i,n,f){f==null&&(f=e.cm&&(e.cm.display.shift||e.extend)),Or(e,new Ge([ls(e.sel.primary(),t,i,f)],0),n)}function Cs(e,t,i){for(var n=[],f=e.cm&&(e.cm.display.shift||e.extend),k=0;k=t.ch:J.to>t.ch))){if(f&&(ze(ee,"beforeCursorEnter"),ee.explicitlyCleared))if(k.markedSpans){--X;continue}else break;if(!ee.atomic)continue;if(i){var Re=ee.find(n<0?1:-1),Ve=void 0;if((n<0?Se:ae)&&(Re=Ls(e,Re,-n,Re&&Re.line==t.line?k:null)),Re&&Re.line==t.line&&(Ve=cn(Re,i))&&(n<0?Ve<0:Ve>0))return Eo(e,Re,t,n,f)}var We=ee.find(n<0?-1:1);return(n<0?ae:Se)&&(We=Ls(e,We,n,We.line==t.line?k:null)),We?Eo(e,We,t,n,f):null}}return t}function qo(e,t,i,n,f){var k=n||1,X=Eo(e,t,i,k,f)||!f&&Eo(e,t,i,k,!0)||Eo(e,t,i,-k,f)||!f&&Eo(e,t,i,-k,!0);return X||(e.cantEdit=!0,yt(e.first,0))}function Ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?S(e,yt(t.line-1)):null:i>0&&t.ch==(n||Jt(e,t.line)).text.length?t.line=0;--f)Is(e,{from:n[f].from,to:n[f].to,text:f?[""]:t.text,origin:t.origin});else Is(e,t)}function Is(e,t){if(t.text.length==1&&t.text[0]==""&&cn(t.from,t.to)==0)return;var i=ln(e,t);Es(e,t,i,e.cm?e.cm.curOp.id:NaN),Uo(e,t,i,Nn(e,t));var n=[];Ar(e,function(f,k){!k&&q(n,f.history)==-1&&(Us(f.history,t),n.push(f.history)),Uo(f,t,null,Nn(f,t))})}function es(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var f=e.history,k,X=e.sel,J=t=="undo"?f.done:f.undone,ee=t=="undo"?f.undone:f.done,ae=0;ae=0;--We){var st=Ve(We);if(st)return st.v}}function ks(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ge(Fe(e.sel.ranges,function(f){return new nt(yt(f.anchor.line+t,f.anchor.ch),yt(f.head.line+t,f.head.ch))}),e.sel.primIndex),e.cm){Ei(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;ne.lastLine())return;if(t.from.linek&&(t={from:t.from,to:yt(k,Jt(e,k).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qi(e,t.from,t.to),i||(i=ln(e,t)),e.cm?bl(e.cm,t,n):mr(e,t,n),Jo(e,i,fe),e.cantEdit&&qo(e,yt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,i){var n=e.doc,f=e.display,k=t.from,X=t.to,J=!1,ee=k.line;e.options.lineWrapping||(ee=Fn(xn(Jt(n,k.line))),n.iter(ee,X.line+1,function(We){if(We==f.maxLine)return J=!0,!0})),n.sel.contains(t.from,t.to)>-1&&be(e),mr(n,t,i,Lr(e)),e.options.lineWrapping||(n.iter(ee,k.line+t.text.length,function(We){var st=yi(We);st>f.maxLineLength&&(f.maxLine=We,f.maxLineLength=st,f.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),Lt(n,k.line),Aa(e,400);var ae=t.text.length-(X.line-k.line)-1;t.full?Ei(e):k.line==X.line&&t.text.length==1&&!br(e.doc,t)?Tn(e,k.line,"text"):Ei(e,k.line,X.line+1,ae);var Se=xe(e,"changes"),Re=xe(e,"change");if(Re||Se){var Ve={from:k,to:X,text:t.text,removed:t.removed,origin:t.origin};Re&&Wi(e,"change",e,Ve),Se&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ve)}e.display.selForContextMenu=null}function To(e,t,i,n,f){var k;n||(n=i),cn(n,i)<0&&(k=[n,i],i=k[0],n=k[1]),typeof t=="string"&&(t=e.splitLines(t)),xo(e,{from:i,to:n,text:t,origin:f})}function Ms(e,t,i,n){i1||!(this.children[0]instanceof jo))){var J=[];this.collapse(J),this.children=[new jo(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var X=f.lines.length%25+25,J=X;J10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=ae,e.display.maxLineLength=Se,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ei(e,n,f+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&Wi(e,"markerCleared",e,this,n,f),t&&oa(e),this.parent&&this.parent.clear()},Va.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,f=0;f0||X==0&&k.clearWhenEmpty!==!1)return k;if(k.replacedWith&&(k.collapsed=!0,k.widgetNode=E("span",[k.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||k.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(k.widgetNode.insertLeft=!0)),k.collapsed){if(Yt(e,t.line,t,i,k)||t.line!=i.line&&Yt(e,i.line,t,i,k))throw new Error("Inserting collapsed marker partially overlapping an existing one");wn()}k.addToHistory&&Es(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var J=t.line,ee=e.cm,ae;if(e.iter(J,i.line+1,function(Re){ee&&k.collapsed&&!ee.options.lineWrapping&&xn(Re)==ee.display.maxLine&&(ae=!0),k.collapsed&&J!=t.line&&sr(Re,0),un(Re,new hn(k,J==t.line?t.ch:null,J==i.line?i.ch:null)),++J}),k.collapsed&&e.iter(t.line,i.line+1,function(Re){Fi(e,Re)&&sr(Re,0)}),k.clearOnEnter&&Ye(k,"beforeCursorEnter",function(){return k.clear()}),k.readOnly&&(En(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),k.collapsed&&(k.id=++js,k.atomic=!0),ee){if(ae&&(ee.curOp.updateMaxLine=!0),k.collapsed)Ei(ee,t.line,i.line+1);else if(k.className||k.startStyle||k.endStyle||k.css||k.attributes||k.title)for(var Se=t.line;Se<=i.line;Se++)Tn(ee,Se,"text");k.atomic&&Os(ee.doc),Wi(ee,"markerAdded",ee,k)}return k}var Ho=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;ee--)xo(this,n[ee]);J?Ss(this,J):this.cm&&da(this.cm)}),undo:Yi(function(){es(this,"undo")}),redo:Yi(function(){es(this,"redo")}),undoSelection:Yi(function(){es(this,"undo",!0)}),redoSelection:Yi(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,i=0,n=0;n=e.ch)&&t.push(f.marker.parent||f.marker)}return t},findMarks:function(e,t,i){e=S(this,e),t=S(this,t);var n=[],f=e.line;return this.iter(e.line,t.line+1,function(k){var X=k.markedSpans;if(X)for(var J=0;J=ee.to||ee.from==null&&f!=e.line||ee.from!=null&&f==t.line&&ee.from>=t.ch)&&(!i||i(ee.marker))&&n.push(ee.marker.parent||ee.marker)}++f}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;ne)return t=e,!0;e-=k,++i}),S(this,yt(i,t))},indexFromPos:function(e){e=S(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 Se=e.dataTransfer.getData("Text");if(Se){var Re;if(t.state.draggingText&&!t.state.draggingText.copy&&(Re=t.listSelections()),Jo(t.doc,At(i,i)),Re)for(var Ve=0;Ve=0;J--)To(e.doc,"",n[J].from,n[J].to,"+delete");da(e)})}function cs(e,t,i){var n=qe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function ds(e,t,i){var n=cs(e,t.ch,i);return n==null?null:new yt(t.line,n,i<0?"after":"before")}function hs(e,t,i,n,f){if(e){t.doc.direction=="rtl"&&(f=-f);var k=xt(i,t.doc.direction);if(k){var X=f<0?Te(k):k[0],J=f<0==(X.level==1),ee=J?"after":"before",ae;if(X.level>0||t.doc.direction=="rtl"){var Se=Ie(t,i);ae=f<0?i.text.length-1:0;var Re=je(t,Se,ae).top;ae=gt(function(Ve){return je(t,Se,Ve).top==Re},f<0==(X.level==1)?X.from:X.to-1,ae),ee=="before"&&(ae=cs(i,ae,1))}else ae=f<0?X.to:X.from;return new yt(n,ae,ee)}}return new yt(n,f<0?i.text.length:0,f<0?"before":"after")}function kl(e,t,i,n){var f=xt(t,e.doc.direction);if(!f)return ds(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var k=at(f,i.ch,i.sticky),X=f[k];if(e.doc.direction=="ltr"&&X.level%2==0&&(n>0?X.to>i.ch:X.from=X.from&&Ve>=Se.begin)){var We=Re?"before":"after";return new yt(i.line,Ve,We)}}var st=function(Wt,en,Ht){for(var on=function(Ni,Er){return Er?new yt(i.line,J(Ni,1),"before"):new yt(i.line,Ni,"after")};Wt>=0&&Wt0==(Pn.level!=1),ai=vn?Ht.begin:J(Ht.end,-1);if(Pn.from<=ai&&ai0?Se.end:J(Se.begin,-1);return It!=null&&!(n>0&&It==t.text.length)&&(_t=st(n>0?0:f.length-1,n,ae(It)),_t)?_t:null}var Go={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fe)},killLine:function(e){return So(e,function(t){if(t.empty()){var i=Jt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)f=new yt(f.line,f.ch+1),e.replaceRange(k.charAt(f.ch-1)+k.charAt(f.ch-2),yt(f.line,f.ch-2),f,"+transpose");else if(f.line>e.doc.first){var X=Jt(e.doc,f.line-1).text;X&&(f=new yt(f.line,1),e.replaceRange(k.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),yt(f.line-1,X.length-1),f,"+transpose"))}}i.push(new nt(f,f))}e.setSelections(i)})},newlineAndIndent:function(e){return Zi(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;ne&&cn(t,this.pos)==0&&i==this.button};var Xo,Yo;function Wl(e,t){var i=+new Date;return Yo&&Yo.compare(i,e,t)?(Xo=Yo=null,"triple"):Xo&&Xo.compare(i,e,t)?(Yo=new ps(i,e,t),Xo=null,"double"):(Xo=new ps(i,e,t),Yo=null,"single")}function tl(e){var t=this,i=t.display;if(ut(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,ia(i,e)){L||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(ms(t,e))return;var n=Vi(t,e),f=$e(e),k=n?Wl(n,f):"single";if(window.focus(),f==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,f,n,k,e))return;f==1?n?zl(t,n,k,e):De(e)==i.scroller&&se(e):f==2?(n&&Zo(t.doc,n),setTimeout(function(){return i.input.focus()},20)):f==3&&(A?t.display.input.onContextMenu(e):Za(t))}function Hl(e,t,i,n,f){var k="Click";return n=="double"?k="Double"+k:n=="triple"&&(k="Triple"+k),k=(t==1?"Left":t==2?"Middle":"Right")+k,Vo(e,Vs(k,f),f,function(X){if(typeof X=="string"&&(X=Go[X]),!X)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=X(e,i)!=ge}finally{e.state.suppressEdits=!1}return J})}function Kl(e,t,i){var n=e.getOption("configureMouse"),f=n?n(e,t,i):{};if(f.unit==null){var k=c?i.shiftKey&&i.metaKey:i.altKey;f.unit=k?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(f.extend==null||e.doc.extend)&&(f.extend=e.doc.extend||i.shiftKey),f.addNew==null&&(f.addNew=u?i.metaKey:i.ctrlKey),f.moveOnDrag==null&&(f.moveOnDrag=!(u?i.altKey:i.ctrlKey)),f}function zl(e,t,i,n){K?setTimeout(y(Ua,e),0):e.curOp.focus=N();var f=Kl(e,i,n),k=e.doc.sel,X;e.options.dragDrop&<&&!e.isReadOnly()&&i=="single"&&(X=k.contains(t))>-1&&(cn((X=k.ranges[X]).from(),t)<0||t.xRel>0)&&(cn(X.to(),t)>0||t.xRel<0)?Gl(e,n,t,f):Vl(e,n,t,f)}function Gl(e,t,i,n){var f=e.display,k=!1,X=Xi(e,function(ae){L&&(f.scroller.draggable=!1),e.state.draggingText=!1,St(f.wrapper.ownerDocument,"mouseup",X),St(f.wrapper.ownerDocument,"mousemove",J),St(f.scroller,"dragstart",ee),St(f.scroller,"drop",X),k||(se(ae),n.addNew||Zo(e.doc,i,null,null,n.extend),L&&!_||K&&W==9?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0}),f.input.focus()},20):f.input.focus())}),J=function(ae){k=k||Math.abs(t.clientX-ae.clientX)+Math.abs(t.clientY-ae.clientY)>=10},ee=function(){return k=!0};L&&(f.scroller.draggable=!0),e.state.draggingText=X,X.copy=!n.moveOnDrag,f.scroller.dragDrop&&f.scroller.dragDrop(),Ye(f.wrapper.ownerDocument,"mouseup",X),Ye(f.wrapper.ownerDocument,"mousemove",J),Ye(f.scroller,"dragstart",ee),Ye(f.scroller,"drop",X),Za(e),setTimeout(function(){return f.input.focus()},20)}function nl(e,t,i){if(i=="char")return new nt(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new nt(yt(t.line,0),S(e.doc,yt(t.line+1,0)));var n=i(e,t);return new nt(n.from,n.to)}function Vl(e,t,i,n){var f=e.display,k=e.doc;se(t);var X,J,ee=k.sel,ae=ee.ranges;if(n.addNew&&!n.extend?(J=k.sel.contains(i),J>-1?X=ae[J]:X=new nt(i,i)):(X=k.sel.primary(),J=k.sel.primIndex),n.unit=="rectangle")n.addNew||(X=new nt(i,i)),i=Vi(e,t,!0,!0),J=-1;else{var Se=nl(e,i,n.unit);n.extend?X=ls(X,Se.anchor,Se.head,n.extend):X=Se}n.addNew?J==-1?(J=ae.length,Or(k,ot(e,ae.concat([X]),J),{scroll:!1,origin:"*mouse"})):ae.length>1&&ae[J].empty()&&n.unit=="char"&&!n.extend?(Or(k,ot(e,ae.slice(0,J).concat(ae.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),ee=k.sel):us(k,J,X,ue):(J=0,Or(k,new Ge([X],0),ue),ee=k.sel);var Re=i;function Ve(Ht){if(cn(Re,Ht)==0)return;if(Re=Ht,n.unit=="rectangle"){for(var on=[],Pn=e.options.tabSize,vn=F(Jt(k,i.line).text,i.ch,Pn),ai=F(Jt(k,Ht.line).text,Ht.ch,Pn),Ni=Math.min(vn,ai),Er=Math.max(vn,ai),Qi=Math.min(i.line,Ht.line),Yr=Math.min(e.lastLine(),Math.max(i.line,Ht.line));Qi<=Yr;Qi++){var Fr=Jt(k,Qi).text,ur=_e(Fr,Ni,Pn);Ni==Er?on.push(new nt(yt(Qi,ur),yt(Qi,ur))):Fr.length>ur&&on.push(new nt(yt(Qi,ur),yt(Qi,_e(Fr,Er,Pn))))}on.length||on.push(new nt(i,i)),Or(k,ot(e,ee.ranges.slice(0,J).concat(on),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ht)}else{var Wr=X,wr=nl(e,Ht,n.unit),gr=Wr.anchor,cr;cn(wr.anchor,gr)>0?(cr=wr.head,gr=Gr(Wr.from(),wr.anchor)):(cr=wr.anchor,gr=na(Wr.to(),wr.head));var Ji=ee.ranges.slice(0);Ji[J]=Xl(e,new nt(S(k,gr),cr)),Or(k,ot(e,Ji,J),ue)}}var We=f.wrapper.getBoundingClientRect(),st=0;function _t(Ht){var on=++st,Pn=Vi(e,Ht,!0,n.unit=="rectangle");if(!Pn)return;if(cn(Pn,Re)!=0){e.curOp.focus=N(),Ve(Pn);var vn=Ba(f,k);(Pn.line>=vn.to||Pn.lineWe.bottom?20:0;ai&&setTimeout(Xi(e,function(){if(st!=on)return;f.scroller.scrollTop+=ai,_t(Ht)}),50)}}function It(Ht){e.state.selectingText=!1,st=Infinity,Ht&&(se(Ht),f.input.focus()),St(f.wrapper.ownerDocument,"mousemove",Wt),St(f.wrapper.ownerDocument,"mouseup",en),k.history.lastSelOrigin=null}var Wt=Xi(e,function(Ht){Ht.buttons===0||!$e(Ht)?It(Ht):_t(Ht)}),en=Xi(e,It);e.state.selectingText=en,Ye(f.wrapper.ownerDocument,"mousemove",Wt),Ye(f.wrapper.ownerDocument,"mouseup",en)}function Xl(e,t){var i=t.anchor,n=t.head,f=Jt(e.doc,i.line);if(cn(i,n)==0&&i.sticky==n.sticky)return t;var k=xt(f);if(!k)return t;var X=at(k,i.ch,i.sticky),J=k[X];if(J.from!=i.ch&&J.to!=i.ch)return t;var ee=X+(J.from==i.ch==(J.level!=1)?0:1);if(ee==0||ee==k.length)return t;var ae;if(n.line!=i.line)ae=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Se=at(k,n.ch,n.sticky),Re=Se-X||(n.ch-i.ch)*(J.level==1?-1:1);Se==ee-1||Se==ee?ae=Re<0:ae=Re>0}var Ve=k[ee+(ae?-1:0)],We=ae==(Ve.level==1),st=We?Ve.from:Ve.to,_t=We?"after":"before";return i.ch==st&&i.sticky==_t?t:new nt(new yt(i.line,st,_t),n)}function il(e,t,i,n){var f,k;if(t.touches)f=t.touches[0].clientX,k=t.touches[0].clientY;else try{f=t.clientX,k=t.clientY}catch(Ve){return!1}if(f>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&se(t);var X=e.display,J=X.lineDiv.getBoundingClientRect();if(k>J.bottom||!xe(e,i))return Ee(t);k-=J.top-X.viewOffset;for(var ee=0;ee=f){var Se=er(e.doc,k),Re=e.display.gutterSpecs[ee];return ze(e,i,e,Se,Re.className,t),Ee(t)}}}function ms(e,t){return il(e,t,"gutterClick",!0)}function rl(e,t){if(ia(e.display,t)||Yl(e,t))return;if(ut(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return xe(e,"gutterContextMenu")?il(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-"),Vn(e)}var Ao={toString:function(){return"CodeMirror.Init"}},ol={},rs={};function Ql(e){var t=e.optionHandlers;function i(n,f,k,X){e.defaults[n]=f,k&&(t[n]=X?function(J,ee,ae){ae!=Ao&&k(J,ee,ae)}:k)}e.defineOption=i,e.Init=Ao,i("value","",function(n,f){return n.setValue(f)},!0),i("mode",null,function(n,f){n.doc.modeOption=f,Kn(n)},!0),i("indentUnit",2,Kn,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){yr(n),Vn(n),Ei(n)},!0),i("lineSeparator",null,function(n,f){if(n.doc.lineSep=f,!f)return;var k=[],X=n.doc.first;n.doc.iter(function(ee){for(var ae=0;;){var Se=ee.text.indexOf(f,ae);if(Se==-1)break;ae=Se+f.length,k.push(yt(X,Se))}X++});for(var J=k.length-1;J>=0;J--)To(n.doc,f,k[J],yt(k[J].line,k[J].ch+f.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,f,k){n.state.specialChars=new RegExp(f.source+(f.test(" ")?"":"| "),"g"),k!=Ao&&n.refresh()}),i("specialCharPlaceholder",Mn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,f){return n.getInputField().spellcheck=f},!0),i("autocorrect",!1,function(n,f){return n.getInputField().autocorrect=f},!0),i("autocapitalize",!1,function(n,f){return n.getInputField().autocapitalize=f},!0),i("rtlMoveVisually",!R),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){al(n),ea(n)},!0),i("keyMap","default",function(n,f,k){var X=ns(f),J=k!=Ao&&ns(k);J&&J.detach&&J.detach(n,X),X.attach&&X.attach(n,J||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,f){n.display.gutterSpecs=_r(f,n.options.lineNumbers),ea(n)},!0),i("fixedGutter",!0,function(n,f){n.display.gutters.style.left=f?vr(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return pa(n)},!0),i("scrollbarStyle","native",function(n){Wa(n),pa(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,f){n.display.gutterSpecs=_r(n.options.gutters,f),ea(n)},!0),i("firstLineNumber",1,ea,!0),i("lineNumberFormatter",function(n){return n},ea,!0),i("showCursorWhenSelecting",!1,Ti,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,f){f=="nocursor"&&(Ea(n),n.display.input.blur()),n.display.input.readOnlyChanged(f)}),i("screenReaderLabel",null,function(n,f){f=f===""?null:f,n.display.input.screenReaderLabelChanged(f)}),i("disableInput",!1,function(n,f){f||n.display.input.reset()},!0),i("dragDrop",!0,$l),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Ti,!0),i("singleCursorHeightPerLine",!0,Ti,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,yr,!0),i("addModeClass",!1,yr,!0),i("pollInterval",100),i("undoDepth",200,function(n,f){return n.doc.history.undoDepth=f}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,yr,!0),i("moveInputWithCursor",!0,function(n,f){f||n.display.input.resetPosition()}),i("tabindex",null,function(n,f){return n.display.input.getField().tabIndex=f||""}),i("autofocus",null),i("direction","ltr",function(n,f){return n.doc.setDirection(f)},!0),i("phrases",null)}function $l(e,t,i){var n=i&&i!=Ao;if(!t!=!n){var f=e.display.dragFunctions,k=t?Ye:St;k(e.display.scroller,"dragstart",f.start),k(e.display.scroller,"dragenter",f.enter),k(e.display.scroller,"dragover",f.over),k(e.display.scroller,"dragleave",f.leave),k(e.display.scroller,"drop",f.drop)}}function Zl(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(m(e.display.wrapper,"CodeMirror-wrap"),li(e)),Cr(e),Ei(e),Vn(e),setTimeout(function(){return pa(e)},100)}function zi(e,t){var i=this;if(!(this instanceof zi))return new zi(e,t);this.options=t=t?x(t):{},x(ol,t,!1);var n=t.value;typeof n=="string"?n=new jr(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var f=new zi.inputStyles[t.inputStyle](this),k=this.display=new Ra(e,n,f,t);k.wrapper.CodeMirror=this,al(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wa(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!a&&k.input.focus(),K&&W<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Jl(this),Rl(),qr(this),this.curOp.forceUpdate=!0,Ki(this,n),t.autofocus&&!a||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ca(i)},20):Ea(this);for(var X in rs)rs.hasOwnProperty(X)&&rs[X](this,t[X],Ao);lr(this),t.finishInit&&t.finishInit(this);for(var J=0;J20*20}Ye(t.scroller,"touchstart",function(ee){if(!ut(e,ee)&&!k(ee)&&!ms(e,ee)){t.input.ensurePolled(),clearTimeout(i);var ae=+new Date;t.activeTouch={start:ae,moved:!1,prev:ae-n.end<=300?n:null},ee.touches.length==1&&(t.activeTouch.left=ee.touches[0].pageX,t.activeTouch.top=ee.touches[0].pageY)}}),Ye(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ye(t.scroller,"touchend",function(ee){var ae=t.activeTouch;if(ae&&!ia(t,ee)&&ae.left!=null&&!ae.moved&&new Date-ae.start<300){var Se=e.coordsChar(t.activeTouch,"page"),Re;!ae.prev||X(ae,ae.prev)?Re=new nt(Se,Se):!ae.prev.prev||X(ae,ae.prev.prev)?Re=e.findWordAt(Se):Re=new nt(yt(Se.line,0),S(e.doc,yt(Se.line+1,0))),e.setSelection(Re.anchor,Re.head),e.focus(),se(ee)}f()}),Ye(t.scroller,"touchcancel",f),Ye(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ha(e,t.scroller.scrollTop),Dr(e,t.scroller.scrollLeft,!0),ze(e,"scroll",e))}),Ye(t.scroller,"mousewheel",function(ee){return Qe(e,ee)}),Ye(t.scroller,"DOMMouseScroll",function(ee){return Qe(e,ee)}),Ye(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(ee){ut(e,ee)||Ae(ee)},over:function(ee){ut(e,ee)||(Ol(e,ee),Ae(ee))},start:function(ee){return Al(e,ee)},drop:Xi(e,Sl),leave:function(ee){ut(e,ee)||Hs(e)}};var J=t.input.getField();Ye(J,"keyup",function(ee){return qs.call(e,ee)}),Ye(J,"keydown",Xi(e,Js)),Ye(J,"keypress",Xi(e,el)),Ye(J,"focus",function(ee){return ca(e,ee)}),Ye(J,"blur",function(ee){return Ea(e,ee)})}var gs=[];zi.defineInitHook=function(e){return gs.push(e)};function Qo(e,t,i,n){var f=e.doc,k;i==null&&(i="add"),i=="smart"&&(f.mode.indent?k=Pt(e,t).state:i="prev");var X=e.options.tabSize,J=Jt(f,t),ee=F(J.text,null,X);J.stateAfter&&(J.stateAfter=null);var ae=J.text.match(/^\s*/)[0],Se;if(!n&&!/\S/.test(J.text))Se=0,i="not";else if(i=="smart"&&(Se=f.mode.indent(k,J.text.slice(ae.length),J.text),Se==ge||Se>150)){if(!n)return;i="prev"}i=="prev"?t>f.first?Se=F(Jt(f,t-1).text,null,X):Se=0:i=="add"?Se=ee+e.options.indentUnit:i=="subtract"?Se=ee-e.options.indentUnit:typeof i=="number"&&(Se=ee+i),Se=Math.max(0,Se);var Re="",Ve=0;if(e.options.indentWithTabs)for(var We=Math.floor(Se/X);We;--We)Ve+=X,Re+=" ";if(VeX,ee=yn(t),ae=null;if(J&&n.ranges.length>1)if(ga&&ga.text.join(` `)==t){if(n.ranges.length%ga.text.length==0){ae=[];for(var Se=0;Se=0;Ve--){var We=n.ranges[Ve],st=We.from(),_t=We.to();We.empty()&&(i&&i>0?st=yt(st.line,st.ch-i):e.state.overwrite&&!J?_t=yt(_t.line,Math.min(Jt(k,_t.line).text.length,_t.ch+Te(ee).length)):J&&ga&&ga.lineWise&&ga.text.join(` `)==ee.join(` `)&&(st=_t=yt(st.line,0)));var It={from:st,to:_t,text:ae?ae[Ve%ae.length]:ee,origin:f||(J?"paste":e.state.cutIncoming>X?"cut":"+input")};xo(e.doc,It),Wi(e,"inputRead",e,It)}t&&!J&&ll(e,t),da(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Re),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function sl(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Zi(t,function(){return vs(t,i,0,null,"paste")}),!0}function ll(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var f=i.ranges[n];if(f.head.ch>100||n&&i.ranges[n-1].head.line==f.head.line)continue;var k=e.getModeAt(f.head),X=!1;if(k.electricChars){for(var J=0;J-1){X=Qo(e,f.head.line,"smart");break}}else k.electricInput&&(k.electricInput.test(Jt(e.doc,f.head.line).text.slice(0,f.head.ch))&&(X=Qo(e,f.head.line,"smart")));X&&Wi(e,"electricInput",e,f.head.line)}}function ul(e){for(var t=[],i=[],n=0;nk&&(Qo(this,J.head.line,n,!0),k=J.head.line,X==this.doc.sel.primIndex&&da(this));else{var ee=J.from(),ae=J.to(),Se=Math.max(k,ee.line);k=Math.min(this.lastLine(),ae.line-(ae.ch?0:1))+1;for(var Re=Se;Re0&&us(this.doc,X,new nt(ee,Ve[X].to()),fe)}}}),getTokenAt:function(n,f){return Li(this,n,f)},getLineTokens:function(n,f){return Li(this,yt(n),f,!0)},getTokenTypeAt:function(n){n=S(this.doc,n);var f=ct(this,Jt(this.doc,n.line)),k=0,X=(f.length-1)/2,J=n.ch,ee;if(J==0)ee=f[2];else for(;;){var ae=k+X>>1;if((ae?f[ae*2-1]:0)>=J)X=ae;else if(f[ae*2+1]ee&&(n=ee,X=!0),J=Jt(this.doc,n)}else J=n;return Jn(this,J,{top:0,left:0},f||"page",k||X).top+(X?this.doc.height-Ft(J):0)},defaultTextHeight:function(){return Hi(this.display)},defaultCharWidth:function(){return Gi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,f,k,X,J){var ee=this.display;n=ti(this,S(this.doc,n));var ae=n.bottom,Se=n.left;if(f.style.position="absolute",f.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(f),ee.sizer.appendChild(f),X=="over")ae=n.top;else if(X=="above"||X=="near"){var Re=Math.max(ee.wrapper.clientHeight,this.doc.height),Ve=Math.max(ee.sizer.clientWidth,ee.lineSpace.clientWidth);(X=="above"||n.bottom+f.offsetHeight>Re)&&n.top>f.offsetHeight?ae=n.top-f.offsetHeight:n.bottom+f.offsetHeight<=Re&&(ae=n.bottom),Se+f.offsetWidth>Ve&&(Se=Ve-f.offsetWidth)}f.style.top=ae+"px",f.style.left=f.style.right="",J=="right"?(Se=ee.sizer.clientWidth-f.offsetWidth,f.style.right="0px"):(J=="left"?Se=0:J=="middle"&&(Se=(ee.sizer.clientWidth-f.offsetWidth)/2),f.style.left=Se+"px"),k&&mo(this,{left:Se,top:ae,right:Se+f.offsetWidth,bottom:ae+f.offsetHeight})},triggerOnKeyDown:pr(Js),triggerOnKeyPress:pr(el),triggerOnKeyUp:qs,triggerOnMouseDown:pr(tl),execCommand:function(n){if(Go.hasOwnProperty(n))return Go[n].call(null,this)},triggerElectric:pr(function(n){ll(this,n)}),findPosH:function(n,f,k,X){var J=1;f<0&&(J=-1,f=-f);for(var ee=S(this.doc,n),ae=0;ae0&&Se(k.charAt(X-1));)--X;for(;J.5||this.options.lineWrapping)&&Cr(this),ze(this,"refresh",this)}),swapDoc:pr(function(n){var f=this.doc;return f.cm=null,this.state.selectingText&&this.state.selectingText(),Ki(this,n),Vn(this),this.display.input.reset(),xa(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Wi(this,"swapDoc",this,f),f}),phrase:function(n){var f=this.options.phrases;return f&&Object.prototype.hasOwnProperty.call(f,n)?f[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},pe(e),e.registerHelper=function(n,f,k){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][f]=k},e.registerGlobalHelper=function(n,f,k,X){e.registerHelper(n,f,X),i[n]._global.push({pred:k,val:X})}}function _s(e,t,i,n,f){var k=t,X=i,J=Jt(e,t.line),ee=f&&e.direction=="rtl"?-i:i;function ae(){var en=t.line+ee;return en=e.first+e.size?!1:(t=new yt(en,t.ch,t.sticky),J=Jt(e,en))}function Se(en){var Ht;if(n=="codepoint"){var on=J.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(on)?Ht=null:Ht=new yt(t.line,Math.max(0,Math.min(J.text.length,t.ch+i*(on>=55296&&on<56320?2:1))),-i)}else f?Ht=kl(e.cm,J,t,i):Ht=ds(J,t,i);if(Ht==null)if(!en&&ae())t=hs(f,e.cm,J,t.line,ee);else return!1;else t=Ht;return!0}if(n=="char"||n=="codepoint")Se();else if(n=="column")Se(!0);else if(n=="word"||n=="group")for(var Re=null,Ve=n=="group",We=e.cm&&e.cm.getHelper(t,"wordChars"),st=!0;!(i<0&&!Se(!st));st=!1){var _t=J.text.charAt(t.ch)||` `,It=Je(_t,We)?"w":Ve&&_t==` `?"n":!Ve||/\s/.test(_t)?null:"p";if(Ve&&!st&&!It&&(It="s"),Re&&Re!=It){i<0&&(i=1,Se(),t.sticky="after");break}if(It&&(Re=It),i>0&&!Se(!st))break}var Wt=qo(e,t,k,X,!0);return Kr(k,Wt)&&(Wt.hitSide=!0),Wt}function hl(e,t,i,n){var f=e.doc,k=t.left,X;if(n=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ee=Math.max(J-.5*Hi(e.display),3);X=(i>0?t.bottom:t.top)+i*ee}else n=="line"&&(X=i>0?t.bottom+3:t.top-3);for(var ae;!(ae=Hn(e,k,X),!ae.outside);){if(i<0?X<=0:X>=f.height){ae.hitSide=!0;break}X+=i*5}return ae}var Ii=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};Ii.prototype.init=function(e){var t=this,i=this,n=i.cm,f=i.div=e.lineDiv;cl(f,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function k(J){for(var ee=J.target;ee;ee=ee.parentNode){if(ee==f)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ee.className))break}return!1}Ye(f,"paste",function(J){if(!k(J)||ut(n,J)||sl(J,n))return;W<=11&&setTimeout(Xi(n,function(){return t.updateFromDOM()}),20)}),Ye(f,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Ye(f,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Ye(f,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ye(f,"touchstart",function(){return i.forceCompositionEnd()}),Ye(f,"input",function(){t.composing||t.readFromDOMSoon()});function X(J){if(!k(J)||ut(n,J))return;if(n.somethingSelected())as({lineWise:!1,text:n.getSelections()}),J.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var ee=ul(n);as({lineWise:!0,text:ee.text}),J.type=="cut"&&n.operation(function(){n.setSelections(ee.ranges,0,fe),n.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var ae=ga.text.join(` `);if(J.clipboardData.setData("Text",ae),J.clipboardData.getData("Text")==ae){J.preventDefault();return}}var Se=dl(),Re=Se.firstChild;n.display.lineSpace.insertBefore(Se,n.display.lineSpace.firstChild),Re.value=ga.text.join(` `);var Ve=document.activeElement;H(Re),setTimeout(function(){n.display.lineSpace.removeChild(Se),Ve.focus(),Ve==f&&i.showPrimarySelection()},50)}Ye(f,"copy",X),Ye(f,"cut",X)},Ii.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ii.prototype.prepareSelection=function(){var e=Vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ii.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ii.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ii.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),f=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||f.line=t.display.viewFrom&&fl(t,n)||{node:J[0].measure.map[2],offset:0},ae=f.linee.firstLine()&&(n=yt(n.line-1,Jt(e.doc,n.line-1).length)),f.ch==Jt(e.doc,f.line).text.length&&f.linet.viewTo-1)return!1;var k,X,J;n.line==t.viewFrom||(k=Di(e,n.line))==0?(X=Fn(t.view[0].line),J=t.view[0].node):(X=Fn(t.view[k].line),J=t.view[k-1].node.nextSibling);var ee=Di(e,f.line),ae,Se;if(ee==t.view.length-1?(ae=t.viewTo-1,Se=t.lineDiv.lastChild):(ae=Fn(t.view[ee+1].line)-1,Se=t.view[ee+1].node.previousSibling),!J)return!1;for(var Re=e.doc.splitLines(tu(e,J,Se,X,ae)),Ve=qi(e.doc,yt(X,0),yt(ae,Jt(e.doc,ae).text.length));Re.length>1&&Ve.length>1;)if(Te(Re)==Te(Ve))Re.pop(),Ve.pop(),ae--;else if(Re[0]==Ve[0])Re.shift(),Ve.shift(),X++;else break;for(var We=0,st=0,_t=Re[0],It=Ve[0],Wt=Math.min(_t.length,It.length);Wen.ch&&en.charCodeAt(en.length-st-1)==Ht.charCodeAt(Ht.length-st-1);)We--,st++;Re[Re.length-1]=en.slice(0,en.length-st).replace(/^\u200b+/,""),Re[0]=Re[0].slice(We).replace(/\u200b+$/,"");var Pn=yt(X,We),vn=yt(ae,Ve.length?Te(Ve).length-st:0);if(Re.length>1||Re[0]||cn(Pn,vn))return To(e.doc,Re,Pn,vn,"+input"),!0},Ii.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ii.prototype.reset=function(){this.forceCompositionEnd()},Ii.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ii.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)},Ii.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Zi(this.cm,function(){return Ei(e.cm)})},Ii.prototype.setUneditable=function(e){e.contentEditable="false"},Ii.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Xi(this.cm,vs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ii.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ii.prototype.onContextMenu=function(){},Ii.prototype.resetPosition=function(){},Ii.prototype.needsContentAttribute=!0;function fl(e,t){var i=ke(e,t.line);if(!i||i.hidden)return null;var n=Jt(e.doc,t.line),f=oe(i,n,t.line),k=xt(n,e.doc.direction),X="left";if(k){var J=at(k,t.ch);X=J%2?"right":"left"}var ee=mt(f.map,t.ch,X);return ee.offset=ee.collapse=="right"?ee.end:ee.start,ee}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,i,n,f){var k="",X=!1,J=e.doc.lineSeparator(),ee=!1;function ae(We){return function(st){return st.id==We}}function Se(){X&&(k+=J,ee&&(k+=J),X=ee=!1)}function Re(We){We&&(Se(),k+=We)}function Ve(We){if(We.nodeType==1){var st=We.getAttribute("cm-text");if(st){Re(st);return}var _t=We.getAttribute("cm-marker"),It;if(_t){var Wt=e.findMarks(yt(n,0),yt(f+1,0),ae(+_t));Wt.length&&(It=Wt[0].find(0))&&Re(qi(e.doc,It.from,It.to).join(J));return}if(We.getAttribute("contenteditable")=="false")return;var en=/^(pre|div|p|li|table|br)$/i.test(We.nodeName);if(!/^br$/i.test(We.nodeName)&&We.textContent.length==0)return;en&&Se();for(var Ht=0;Ht=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ye(f,"paste",function(X){if(ut(n,X)||sl(X,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function k(X){if(ut(n,X))return;if(n.somethingSelected())as({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var J=ul(n);as({lineWise:!0,text:J.text}),X.type=="cut"?n.setSelections(J.ranges,null,fe):(i.prevInput="",f.value=J.text.join(` `),H(f))}else return;X.type=="cut"&&(n.state.cutIncoming=+new Date)}Ye(f,"cut",k),Ye(f,"copy",k),Ye(e.scroller,"paste",function(X){if(ia(e,X)||ut(n,X))return;if(!f.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var J=new Event("paste");J.clipboardData=X.clipboardData,f.dispatchEvent(J)}),Ye(e.lineSpace,"selectstart",function(X){ia(e,X)||se(X)}),Ye(f,"compositionstart",function(){var X=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:X,range:n.markText(X,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ye(f,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},or.prototype.createField=function(e){this.wrapper=dl(),this.textarea=this.wrapper.firstChild},or.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},or.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Vr(e);if(e.options.moveInputWithCursor){var f=ti(e,i.sel.primary().head,"div"),k=t.wrapper.getBoundingClientRect(),X=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,f.top+X.top-k.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,f.left+X.left-k.left))}return n},or.prototype.showSelection=function(e){var t=this.cm,i=t.display;s(i.cursorDiv,e.cursors),s(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},or.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&H(this.textarea),K&&W>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",K&&W>=9&&(this.hasSelection=null))},or.prototype.getField=function(){return this.textarea},or.prototype.supportsTouch=function(){return!1},or.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!a||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},or.prototype.blur=function(){this.textarea.blur()},or.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},or.prototype.receivedFocus=function(){this.slowPoll()},or.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()})},or.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},or.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Gt(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var f=i.value;if(f==n&&!t.somethingSelected())return!1;if(K&&W>=9&&this.hasSelection===f||u&&/[\uf700-\uf7ff]/.test(f))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var k=f.charCodeAt(0);if(k==8203&&!n&&(n="\u200B"),k==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,J=Math.min(n.length,f.length);X1e3||f.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=f,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},or.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},or.prototype.onKeyPress=function(){K&&W>=9&&(this.hasSelection=null),this.fastPoll()},or.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,f=t.textarea;t.contextMenuPending&&t.contextMenuPending();var k=Vi(i,e),X=n.scroller.scrollTop;if(!k||p)return;var J=i.options.resetSelectionOnContextMenu;J&&i.doc.sel.contains(k)==-1&&Xi(i,Or)(i.doc,At(k),fe);var ee=f.style.cssText,ae=t.wrapper.style.cssText,Se=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",f.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-Se.top-5)+"px; left: "+(e.clientX-Se.left-5)+`px; z-index: 1000; background: `+(K?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Re;L&&(Re=window.scrollY),n.input.focus(),L&&window.scrollTo(null,Re),n.input.reset(),i.somethingSelected()||(f.value=t.prevInput=" "),t.contextMenuPending=We,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Ve(){if(f.selectionStart!=null){var _t=i.somethingSelected(),It="\u200B"+(_t?f.value:"");f.value="\u21DA",f.value=It,t.prevInput=_t?"":"\u200B",f.selectionStart=1,f.selectionEnd=It.length,n.selForContextMenu=i.doc.sel}}function We(){if(t.contextMenuPending!=We)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=ae,f.style.cssText=ee,K&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=X),f.selectionStart!=null){(!K||K&&W<9)&&Ve();var _t=0,It=function(){n.selForContextMenu==i.doc.sel&&f.selectionStart==0&&f.selectionEnd>0&&t.prevInput=="\u200B"?Xi(i,Ds)(i):_t++<10?n.detectingSelectAll=setTimeout(It,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(It,200)}}if(K&&W>=9&&Ve(),A){Ae(e);var st=function(){St(window,"mouseup",st),setTimeout(We,20)};Ye(window,"mouseup",st)}else setTimeout(We,50)},or.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},or.prototype.setUneditable=function(){},or.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?x(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=N();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=J.getValue()}var f;if(e.form&&(Ye(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var k=e.form;f=k.submit;try{var X=k.submit=function(){n(),k.submit=f,k.submit(),k.submit=X}}catch(ee){}}t.finishInit=function(ee){ee.save=n,ee.getTextArea=function(){return e},ee.toTextArea=function(){ee.toTextArea=isNaN,n(),e.parentNode.removeChild(ee.getWrapperElement()),e.style.display="",e.form&&(St(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=f))}},e.style.display="none";var J=zi(function(ee){return e.parentNode.insertBefore(ee,e.nextSibling)},t);return J}function ru(e){e.off=St,e.on=Ye,e.wheelEventPixels=et,e.Doc=jr,e.splitLines=yn,e.countColumn=F,e.findColumn=_e,e.isWordChar=Be,e.Pass=ge,e.signal=ze,e.Line=$n,e.changeEnd=wt,e.scrollbarModel=eo,e.Pos=yt,e.cmpPos=cn,e.modes=fi,e.mimeModes=In,e.resolveMode=Ot,e.getMode=bn,e.modeExtensions=Cn,e.extendMode=kn,e.copyState=Ai,e.startState=dr,e.innerMode=Ui,e.commands=Go,e.keyMap=Pa,e.keyName=Xs,e.isModifierKey=Gs,e.lookupKey=wo,e.normalizeKeyMap=Il,e.StringStream=mn,e.SharedTextMarker=Ho,e.TextMarker=Va,e.LineWidget=Wo,e.e_preventDefault=se,e.e_stopPropagation=ce,e.e_stop=Ae,e.addClass=U,e.contains=C,e.rmClass=m,e.keyNames=Xa}Ql(zi),ql(zi);var au="iter insert remove copy getEditor constructor".split(" ");for(var ss in jr.prototype)jr.prototype.hasOwnProperty(ss)&&q(au,ss)<0&&(zi.prototype[ss]=function(e){return function(){return e.apply(this.doc,arguments)}}(jr.prototype[ss]));return pe(jr),zi.inputStyles={textarea:or,contenteditable:Ii},zi.defineMode=function(e){!zi.defaults.mode&&e!="null"&&(zi.defaults.mode=e),Ri.apply(this,arguments)},zi.defineMIME=Si,zi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),zi.defineMIME("text/plain","null"),zi.defineExtension=function(e,t){zi.prototype[e]=t},zi.defineDocExtension=function(e,t){jr.prototype[e]=t},zi.fromTextArea=iu,ru(zi),zi.version="5.58.2",zi})},WaYH:function(ft,Xe,G){"use strict";var de=G("rePB"),Z=G("Ff2n"),M=G("VTBJ"),V=G("1OyB"),I=G("vuIU"),B=G("JX7q"),K=G("Ji7U"),W=G("LK+K"),L=G("q1tI"),P=G("TSYQ"),b=G.n(P),p=G("sboe"),_=G("OZM5"),h=function(A){var w=A.prefixCls,m=A.level,v=A.isStart,s=A.isEnd;if(!m)return null;for(var o="".concat(w,"-indent-unit"),E=[],g=0;g1&&arguments[1]!==void 0?arguments[1]:!1,he=fe.getAttribute("id")||fe.getAttribute("data-reactid")||fe.getAttribute("name");if(ue&&N[he])return N[he];var _e=window.getComputedStyle(fe),le=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),ne=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),Te=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),Fe=C.map(function(Ue){return"".concat(Ue,":").concat(_e.getPropertyValue(Ue))}).join(";"),Ke={sizingStyle:Fe,paddingSize:ne,borderSize:Te,boxSizing:le};return ue&&he&&(N[he]=Ke),Ke}function H(fe){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),fe.getAttribute("wrap")?U.setAttribute("wrap",fe.getAttribute("wrap")):U.removeAttribute("wrap");var le=j(fe,ue),ne=le.paddingSize,Te=le.borderSize,Fe=le.boxSizing,Ke=le.sizingStyle;U.setAttribute("style","".concat(Ke,";").concat(g)),U.value=fe.value||fe.placeholder||"";var Ue=Number.MIN_SAFE_INTEGER,He=Number.MAX_SAFE_INTEGER,Ne=U.scrollHeight,Be;if(Fe==="border-box"?Ne+=Te:Fe==="content-box"&&(Ne-=ne),he!==null||_e!==null){U.value=" ";var Je=U.scrollHeight-ne;he!==null&&(Ue=Je*he,Fe==="border-box"&&(Ue=Ue+ne+Te),Ne=Math.max(Ue,Ne)),_e!==null&&(He=Je*_e,Fe==="border-box"&&(He=He+ne+Te),Be=Ne>He?"":"hidden",Ne=Math.min(He,Ne))}return{height:Ne,minHeight:Ue,maxHeight:He,overflowY:Be,resize:"none"}}var y=G("Gytx"),x=G.n(y),F;(function(fe){fe[fe.NONE=0]="NONE",fe[fe.RESIZING=1]="RESIZING",fe[fe.RESIZED=2]="RESIZED"})(F||(F={}));var Q=function(fe){Object(V.a)(he,fe);var ue=Object(I.a)(he);function he(_e){var le;return Object(Z.a)(this,he),le=ue.call(this,_e),le.nextFrameActionId=void 0,le.resizeFrameId=void 0,le.textArea=void 0,le.saveTextArea=function(ne){le.textArea=ne},le.handleResize=function(ne){var Te=le.state.resizeStatus,Fe=le.props,Ke=Fe.autoSize,Ue=Fe.onResize;if(Te!==F.NONE)return;typeof Ue=="function"&&Ue(ne),Ke&&le.resizeOnNextFrame()},le.resizeOnNextFrame=function(){cancelAnimationFrame(le.nextFrameActionId),le.nextFrameActionId=requestAnimationFrame(le.resizeTextarea)},le.resizeTextarea=function(){var ne=le.props.autoSize;if(!ne||!le.textArea)return;var Te=ne.minRows,Fe=ne.maxRows,Ke=H(le.textArea,!1,Te,Fe);le.setState({textareaStyles:Ke,resizeStatus:F.RESIZING},function(){cancelAnimationFrame(le.resizeFrameId),le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:F.RESIZED},function(){le.resizeFrameId=requestAnimationFrame(function(){le.setState({resizeStatus:F.NONE}),le.fixFirefoxAutoScroll()})})})})},le.renderTextArea=function(){var ne=le.props,Te=ne.prefixCls,Fe=Te===void 0?"rc-textarea":Te,Ke=ne.autoSize,Ue=ne.onResize,He=ne.className,Ne=ne.disabled,Be=le.state,Je=Be.textareaStyles,tt=Be.resizeStatus,it=Object(s.a)(le.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),rt=E()(Fe,He,Object(W.a)({},"".concat(Fe,"-disabled"),Ne));"value"in it&&(it.value=it.value||"");var qe=Object(K.a)(Object(K.a)(Object(K.a)({},le.props.style),Je),tt===F.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return B.createElement(v,{onResize:le.handleResize,disabled:!(Ke||Ue)},B.createElement("textarea",Object(de.a)({},it,{className:rt,style:qe,ref:le.saveTextArea})))},le.state={textareaStyles:{},resizeStatus:F.NONE},le}return Object(M.a)(he,[{key:"componentDidUpdate",value:function(le){(le.value!==this.props.value||!x()(le.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 le=this.textArea.selectionStart,ne=this.textArea.selectionEnd;this.textArea.setSelectionRange(le,ne)}}catch(Te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),he}(B.Component),q=Q,ie=function(fe){Object(V.a)(he,fe);var ue=Object(I.a)(he);function he(_e){var le;Object(Z.a)(this,he),le=ue.call(this,_e),le.resizableTextArea=void 0,le.focus=function(){le.resizableTextArea.textArea.focus()},le.saveTextArea=function(Te){le.resizableTextArea=Te},le.handleChange=function(Te){var Fe=le.props.onChange;le.setValue(Te.target.value,function(){le.resizableTextArea.resizeTextarea()}),Fe&&Fe(Te)},le.handleKeyDown=function(Te){var Fe=le.props,Ke=Fe.onPressEnter,Ue=Fe.onKeyDown;Te.keyCode===13&&Ke&&Ke(Te),Ue&&Ue(Te)};var ne=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return le.state={value:ne},le}return Object(M.a)(he,[{key:"setValue",value:function(le,ne){"value"in this.props||this.setState({value:le},ne)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return B.createElement(q,Object(de.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(le){return"value"in le?{value:le.value}:null}}]),he}(B.Component),ge=Xe.default=ie},ZW9T:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return H});var de=G("k1fw"),Z=G("miYZ"),M=G("tsqr"),V=G("rAM+"),I=G("tJVT"),B=G("PpiC"),K=G("q1tI"),W=G.n(K),L=G("bdgK"),P=G("oBTY"),b=G("9og8"),p=G("WmNS"),_=G.n(p),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"]},r={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"]},d={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(` `)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(` `)},{label:"for",content:["for( ; ; ){"," $0","}"].join(` `)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(` `)},{label:"using namespace std;",content:["using namespace std;"].join(` `)},{label:"#include ",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(` `)}]},a=G("5VLF"),u=G.n(a),c={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(x,F){return F.map(function(Q){return{label:Q,kind:x.languages.CompletionItemKind.Keyword,insertText:Q}})},O=function(x){return Object.keys(c.tables).map(function(F){return{label:F,kind:x.languages.CompletionItemKind.Variable,insertText:F}})},T=function(x,F){var Q=c.tables[x];return Q?Q.map(function(q){return{label:q,kind:F.languages.CompletionItemKind.Field,insertText:q}}):[]};function A(y,x,F,Q,q){var ie=x.getWordUntilPosition(F),ge={startLineNumber:F.lineNumber,endLineNumber:F.lineNumber,startColumn:ie.startColumn,endColumn:ie.endColumn},fe=Q.map(function(ue){return{label:ue,kind:y.languages.CompletionItemKind.Keyword,insertText:ue,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ge}});return q.map(function(ue){fe.push(Object(de.a)(Object(de.a)({},ue),{},{range:ge}))}),fe}var w=function(y){c.languages.map(function(q){return y.languages.registerDocumentFormattingEditProvider(q,{provideDocumentFormattingEdits:function(ge,fe,ue){return Object(b.a)(_.a.mark(function he(){var _e;return _.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return _e=u()(ge.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}),ne.abrupt("return",[{range:ge.getFullModelRange(),text:_e}]);case 2:case"end":return ne.stop()}},he)}))()}}),q});var x=d.quickKey.map(function(q){return{label:q.label,kind:y.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),F=l.quickKey.map(function(q){return{label:q.label,kind:y.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Q=r.quickKey.map(function(q){return{label:q.label,kind:y.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:y.languages.CompletionItemInsertTextRule.InsertAsSnippet}});y.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(P.a)(d.keywords),Object(P.a)(d.quickKey.map(function(q){return q.label}))),provideCompletionItems:function(ie,ge){var fe=ie.getValueInRange({startLineNumber:ge.lineNumber,startColumn:1,endLineNumber:ge.lineNumber,endColumn:ge.column}),ue=fe.match(/cu/gim);console.log("match:",ue,ge,fe,ie);var he=[],_e=ge.lineNumber,le=ge.column,ne=ie.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:le}),Te=ne.trim().split(/\s+/),Fe=Te[Te.length-1];if(Fe.endsWith(".")){var Ke=Fe.slice(0,Fe.length-1);Object.keys(c.tables).includes(Ke)&&(he=Object(P.a)(T(Ke,y)))}else Fe==="."?he=[]:he=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,d.keywords)),Object(P.a)(x));return{suggestions:he}}}),y.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(P.a)(h.keywords)),provideCompletionItems:function(ie,ge){var fe=ie.getValueInRange({startLineNumber:ge.lineNumber,startColumn:1,endLineNumber:ge.lineNumber,endColumn:ge.column}),ue=fe.match(/cu/gim);console.log("match:",ue,ge,fe,ie);var he=[],_e=ge.lineNumber,le=ge.column,ne=ie.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:le}),Te=ne.trim().split(/\s+/),Fe=Te[Te.length-1];if(Fe.endsWith(".")){var Ke=Fe.slice(0,Fe.length-1);Object.keys(c.tables).includes(Ke)&&(he=Object(P.a)(T(Ke,y)))}else Fe==="."?he=[]:he=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,h.keywords)));return{suggestions:he}}}),y.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(P.a)(r.keywords)),provideCompletionItems:function(ie,ge){var fe=[],ue=ge.lineNumber,he=ge.column,_e=ie.getValueInRange({startLineNumber:ue,startColumn:0,endLineNumber:ue,endColumn:he}),le=_e.trim().split(/\s+/),ne=le[le.length-1];if(ne.endsWith(".")){var Te=ne.slice(0,ne.length-1);Object.keys(c.tables).includes(Te)&&(fe=Object(P.a)(T(Te,y)))}else ne==="."?fe=[]:fe=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,r.keywords)),Object(P.a)(Q));return{suggestions:fe}}}),y.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(P.a)(l.keywords)),provideCompletionItems:function(ie,ge){var fe=[],ue=ge.lineNumber,he=ge.column,_e=ie.getValueInRange({startLineNumber:ue,startColumn:0,endLineNumber:ue,endColumn:he}),le=_e.trim().split(/\s+/),ne=le[le.length-1];if(ne.endsWith(".")){var Te=ne.slice(0,ne.length-1);Object.keys(c.tables).includes(Te)&&(fe=Object(P.a)(T(Te,y)))}else ne==="."?fe=[]:fe=[].concat(Object(P.a)(O(y)),Object(P.a)(R(y,l.keywords)),Object(P.a)(F));return{suggestions:fe}}})},m="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",v=G("LvDl"),s=G("+ua5");function o(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}function E(){}var g=!1,C={"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 N(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],x=y;if(Array.isArray(y)){for(var F=0;F0||Ai.target.offsetWidth>0)&&ze.current.instance.layout()}}catch(Ui){Cn.e(Ui)}finally{Cn.f()}}),Ot.observe(St.current)),Ot}function De(){M.b.warn(decodeURIComponent(m))}var $e=function(){var bn=ze.current.instance;if(ie!=null&&bn&&ce){var Cn=bn.getModel();Cn&&ie!==Cn.getValue()&&(g=!0,Cn.setValue(ie),bn.layout(),g=!1)}};Object(K.useEffect)(function(){ut.current&&clearTimeout(ut.current),ut.current=setTimeout(function(){$e()},500)},[ie,ce,ze.current]),Object(K.useEffect)(function(){if(xt&&ze.current&&ze.current.instance){var Ot=ze.current.instance;Ot.changeViewZones(function(Cn){var kn=document.createElement("div");kn.style.padding="10px 20px",kn.style.width="calc(100% - 20px)",kn.className="my-error-line-wrp",kn.innerHTML=Ye,Cn.addZone({afterLineNumber:xt||11,heightInLines:3,domNode:kn})});var bn={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}};Ot.addOverlayWidget(bn),Ot.revealPositionInCenter({lineNumber:20,column:1})}},[xt,ze.current,ce]);function lt(){var Ot=ze.current.instance;if(Ot){var bn=Ot.getSelection(),Cn=ze.current.pastePos||{},kn=new U.Range(Cn.startLineNumber||bn.endLineNumber,Cn.startColumn||bn.endColumn,Cn.endLineNumber||bn.endLineNumber,Cn.endColumn||bn.endColumn);setTimeout(function(){Ot.executeEdits("",[{range:kn,text:""}])},300)}}function Bt(Ot){(window.navigator.platform.match("Mac")?Ot.metaKey:Ot.ctrlKey)&&Ot.keyCode==83&&(Ot.preventDefault(),He())}var tn=function(){if(Be&&ze.current.instance){var bn=ze.current.instance.getContentHeight();Ri(bn0||qe.target.offsetWidth>0)&&Be.layout()}}catch(gt){it.e(gt)}finally{it.f()}}),Je.observe(_e.current)),Je}Object(K.useEffect)(function(){_e.current&&G.e(27).then(G.t.bind(null,"M/lh",7)).then(function(Be){U=Be;var Je=U.editor.createDiffEditor(_e.current,Object(de.a)(Object(de.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},he),{},{wordWrap:!0}));Fe(Je);var tt=Ke(Je);return function(){Je.dispose();var it=Je.getModel();it&&it.dispose(),tt.unobserve(_e.current)}})},[]),Object(K.useEffect)(function(){Te&&Te.setModel({original:U.editor.createModel(ie,fe),modified:U.editor.createModel(ge,fe)})},[ie,ge,fe,Te]);var Ue=o(F),He=o(q),Ne={width:Ue,height:He};return W.a.createElement("div",{className:"my-diff-editor",ref:_e,style:Ne})}},ZpRC:function(ft,Xe,G){"use strict";function de(b){return typeof b=="object"&&b!=null&&b.nodeType===1}function Z(b,p){return(!p||b!=="hidden")&&b!=="visible"&&b!=="clip"}function M(b,p){if(b.clientHeightp||d>b&&l=p&&a>=_?d-b-h:l>p&&a<_||d_?l-p+r:0}var I=function(b,p){var _=window,h=p.scrollMode,r=p.block,d=p.inline,l=p.boundary,a=p.skipOverflowHiddenElements,u=typeof l=="function"?l:function(Je){return Je!==l};if(!de(b))throw new TypeError("Invalid target");for(var c=document.scrollingElement||document.documentElement,R=[],O=b;de(O)&&u(O);){if((O=O.parentElement)===c){R.push(O);break}O!=null&&O===document.body&&M(O)&&!M(document.documentElement)||O!=null&&M(O,a)&&R.push(O)}for(var T=_.visualViewport?_.visualViewport.width:innerWidth,A=_.visualViewport?_.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,v=b.getBoundingClientRect(),s=v.height,o=v.width,E=v.top,g=v.right,C=v.bottom,N=v.left,U=r==="start"||r==="nearest"?E:r==="end"?C:E+s/2,j=d==="center"?N+o/2:d==="end"?g:N,H=[],y=0;y=0&&N>=0&&C<=A&&g<=T&&E>=ie&&C<=fe&&N>=ue&&g<=ge)return H;var he=getComputedStyle(x),_e=parseInt(he.borderLeftWidth,10),le=parseInt(he.borderTopWidth,10),ne=parseInt(he.borderRightWidth,10),Te=parseInt(he.borderBottomWidth,10),Fe=0,Ke=0,Ue="offsetWidth"in x?x.offsetWidth-x.clientWidth-_e-ne:0,He="offsetHeight"in x?x.offsetHeight-x.clientHeight-le-Te:0;if(c===x)Fe=r==="start"?U:r==="end"?U-A:r==="nearest"?V(m,m+A,A,le,Te,m+U,m+U+s,s):U-A/2,Ke=d==="start"?j:d==="center"?j-T/2:d==="end"?j-T:V(w,w+T,T,_e,ne,w+j,w+j+o,o),Fe=Math.max(0,Fe+m),Ke=Math.max(0,Ke+w);else{Fe=r==="start"?U-ie-le:r==="end"?U-fe+Te+He:r==="nearest"?V(ie,fe,Q,le,Te+He,U,U+s,s):U-(ie+Q/2)+He/2,Ke=d==="start"?j-ue-_e:d==="center"?j-(ue+q/2)+Ue/2:d==="end"?j-ge+ne+Ue:V(ue,ge,q,_e,ne+Ue,j,j+o,o);var Ne=x.scrollLeft,Be=x.scrollTop;U+=Be-(Fe=Math.max(0,Math.min(Be+Fe,x.scrollHeight-Q+He))),j+=Ne-(Ke=Math.max(0,Math.min(Ne+Ke,x.scrollWidth-q+Ue)))}H.push({el:x,top:Fe,left:Ke})}return H};function B(b){return b===Object(b)&&Object.keys(b).length!==0}function K(b,p){p===void 0&&(p="auto");var _="scrollBehavior"in document.body.style;b.forEach(function(h){var r=h.el,d=h.top,l=h.left;r.scroll&&_?r.scroll({top:d,left:l,behavior:p}):(r.scrollTop=d,r.scrollLeft=l)})}function W(b){return b===!1?{block:"end",inline:"nearest"}:B(b)?b:{block:"start",inline:"nearest"}}function L(b,p){var _=!b.ownerDocument.documentElement.contains(b);if(B(p)&&typeof p.behavior=="function")return p.behavior(_?[]:I(b,p));if(_)return;var h=W(p);return K(I(b,h),h.behavior)}var P=Xe.a=L},"a+yL":function(ft,Xe,G){ft.exports={search:"search___t0h96",btn:"btn___t2oDx"}},bT9E:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return Z});var de=G("VTBJ");function Z(M,V){var I=Object(de.a)({},M);return Array.isArray(V)&&V.forEach(function(B){delete I[B]}),I}},c5Ni:function(ft,Xe,G){},d5o6:function(ft,Xe,G){ft.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(ft,Xe,G){},dmUQ:function(ft,Xe,G){"use strict";var de=G("Ff2n"),Z=G("rePB"),M=G("1OyB"),V=G("vuIU"),I=G("Ji7U"),B=G("md7G"),K=G("foSv"),W=G("q1tI"),L=G.n(W),P=G("TSYQ"),b=G.n(P),p=G("4IlW");function _(s,o){var E=Object.keys(s);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(s);o&&(g=g.filter(function(C){return Object.getOwnPropertyDescriptor(s,C).enumerable})),E.push.apply(E,g)}return E}function h(s){for(var o=1;o1?q-1:0),ge=1;ge1?y-1:0),F=1;F=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var y=0;return H.indexOf(".")>=0&&(y=H.length-H.indexOf(".")-1),y},C.getInputDisplayValue=function(j){var H=j||C.state,y=H.focused,x=H.inputValue,F=H.value,Q;y?Q=x:Q=C.toPrecisionAsStep(F),Q==null&&(Q="");var q=C.formatWrapper(Q);return T(C.props.decimalSeparator)&&(q=q.toString().replace(".",C.props.decimalSeparator)),q},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(j){}},C.restoreByAfter=function(j){if(j===void 0)return!1;var H=C.input.value,y=H.lastIndexOf(j);if(y===-1)return!1;var x=C.cursorBefore.length;return C.lastKeyCode===p.a.DELETE&&C.cursorBefore.charAt(x-1)===j[0]?(C.fixCaret(x,x),!0):y+j.length===H.length?(C.fixCaret(y,y),!0):!1},C.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(H,y){var x=j.substring(y);return C.restoreByAfter(x)})},C.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(j,H,y){C.pressingUpOrDown=!0,C.step("down",j,H,y)},C.up=function(j,H,y){C.pressingUpOrDown=!0,C.step("up",j,H,y)},C.saveInput=function(j){C.input=j};var N=g.value;N===void 0&&(N=g.defaultValue),C.state={focused:g.autoFocus};var U=C.getValidValue(C.toNumber(N));return C.state=h(h({},C.state),{},{inputValue:C.toPrecisionAsStep(U),value:U}),C}return Object(V.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var N=this.props,U=N.value,j=N.onChange,H=N.max,y=N.min,x=this.state.focused;if(C){if(!A(C.value,U)||!A(C.max,H)||!A(C.min,y)){var F=x?U:this.getValidValue(U),Q;this.pressingUpOrDown?Q=F:this.inputting?Q=this.rawInput:Q=this.toPrecisionAsStep(F),this.setState({value:F,inputValue:Q})}var q="value"in this.props?U:this.state.value;"max"in this.props&&C.max!==H&&typeof q=="number"&&q>H&&j&&j(H),"min"in this.props&&C.min!==y&&typeof q=="number"&&q1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(C);return isNaN(j)?C:(jU&&(j=U),j)}},{key:"setValue",value:function(C,N){var U=this.props.precision,j=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),H=this.state.value,y=H===void 0?null:H,x=this.state.inputValue,F=x===void 0?null:x,Q=typeof j=="number"?j.toFixed(U):"".concat(j),q=j!==y||Q!=="".concat(F);return"value"in this.props?(F=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:F},N)):this.setState({value:j,inputValue:this.toPrecisionAsStep(C)},N),q&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,j=U.precision,H=U.step;if(T(j))return j;var y=this.getPrecision(N),x=this.getPrecision(H),F=this.getPrecision(C);return C?Math.max(F,y+x):y+x}},{key:"getPrecisionFactor",value:function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(C,N);return Math.pow(10,U)}},{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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var N=Math.abs(this.getMaxPrecision(C));return isNaN(N)?C.toString():Number(C).toFixed(N)}},{key:"toNumber",value:function(C){var N=this.props.precision,U=this.state.focused,j=C&&C.length>16&&U;return this.isNotCompleteNumber(C)||j?C:T(N)?Math.round(C*Math.pow(10,N))/Math.pow(10,N):Number(C)}},{key:"upStep",value:function(C,N){var U=this.props.step,j=this.getPrecisionFactor(C,N),H=Math.abs(this.getMaxPrecision(C,N)),y=((j*C+j*U*N)/j).toFixed(H);return this.toNumber(y)}},{key:"downStep",value:function(C,N){var U=this.props.step,j=this.getPrecisionFactor(C,N),H=Math.abs(this.getMaxPrecision(C,N)),y=((j*C-j*U*N)/j).toFixed(H);return this.toNumber(y)}},{key:"step",value:function(C,N){var U=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),N&&(N.persist(),N.preventDefault());var y=this.props;if(y.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var F=this["".concat(C,"Step")](x,j),Q=F>y.max||Fy.max?F=y.max:F=ie),ut=(Rt||Rt===0)&&(isNaN(Rt)||Number(Rt)<=ge),be=ze||j||H,xe=ut||j||H,pe=b()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(Z.a)({},"".concat(U,"-handler-up-disabled"),be)),se=b()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(Z.a)({},"".concat(U,"-handler-down-disabled"),xe)),ce=y?{onTouchStart:be?l:this.up,onTouchEnd:this.stop}:{onMouseDown:be?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Ee=y?{onTouchStart:xe?l:this.down,onTouchEnd:this.stop}:{onMouseDown:xe?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return L.a.createElement("div",{className:Tt,style:fe,title:ue,onMouseEnter:he,onMouseLeave:_e,onMouseOver:le,onMouseOut:ne,onFocus:function(){return null},onBlur:function(){return null}},L.a.createElement("div",{className:"".concat(U,"-handler-wrap")},L.a.createElement("span",Object.assign({unselectable:"on"},ce,{role:"button","aria-label":"Increase Value","aria-disabled":be,className:pe}),F||L.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:a})),L.a.createElement("span",Object.assign({unselectable:"on"},Ee,{role:"button","aria-label":"Decrease Value","aria-disabled":xe,className:se}),Q||L.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:a}))),L.a.createElement("div",{className:"".concat(U,"-input-wrap")},L.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ge,"aria-valuemax":ie,"aria-valuenow":Rt,required:Te,type:Ue,placeholder:He,onPaste:gt,onClick:Fe,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:Ke,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Mt?this.onKeyDown:l,onKeyUp:Mt?this.onKeyUp:l,autoFocus:rt,maxLength:it,readOnly:H,disabled:j,max:ie,min:ge,step:tt,name:qe,title:ue,id:Ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(St),pattern:Je,inputMode:Be,onInput:pt},Ye))))}}]),E}(L.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:O,min:-O,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:u,required:!1,autoComplete:"off"};var m=w,v=Xe.a=m},fAei:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return c.a});var de=G("rePB"),Z=G("VTBJ"),M=G("KQm4"),V=G("1OyB"),I=G("vuIU"),B=G("Ji7U"),K=G("LK+K"),W=G("q1tI"),L=G("4IlW"),P=G("Kwbf"),b=G("TSYQ"),p=G.n(b),_=G("sboe"),h=G("OZM5"),r=G("815F"),d=G("ODXe"),l=G("Ff2n"),a=G("+nKL"),u=G("8XRh"),c=G("WaYH"),R=function(ge,fe){var ue=ge.className,he=ge.style,_e=ge.motion,le=ge.motionNodes,ne=ge.motionType,Te=ge.onMotionStart,Fe=ge.onMotionEnd,Ke=ge.active,Ue=ge.treeNodeRequiredProps,He=Object(l.a)(ge,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),Ne=W.useState(!0),Be=Object(d.a)(Ne,2),Je=Be[0],tt=Be[1],it=W.useContext(_.a),rt=it.prefixCls,qe=W.useRef(!1),gt=function(){qe.current||Fe(),qe.current=!0};return Object(W.useEffect)(function(){le&&ne==="hide"&&Je&&tt(!1)},[le]),Object(W.useEffect)(function(){return le&&Te(),function(){le&>()}},[]),le?W.createElement(u.default,Object.assign({ref:fe,visible:Je},_e,{motionAppear:ne==="show",onAppearEnd:gt,onLeaveEnd:gt}),function(pt,vt){var at=pt.className,Rt=pt.style;return W.createElement("div",{ref:vt,className:p()("".concat(rt,"-treenode-motion"),at),style:Rt},le.map(function(xt){var Tt=xt.data,Ye=Tt.key,Mt=Object(l.a)(Tt,["key"]),St=xt.isStart,ze=xt.isEnd;delete Mt.children;var ut=Object(r.f)(Ye,Ue);return W.createElement(c.a,Object.assign({},Mt,ut,{active:Ke,data:xt.data,key:Ye,isStart:St,isEnd:ze}))}))}):W.createElement(c.a,Object.assign({domRef:fe,className:ue,style:he},He,{active:Ke}))};R.displayName="MotionTreeNode";var O=W.forwardRef(R),T=O;function A(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],fe=ie.length,ue=ge.length;if(Math.abs(fe-ue)!==1)return{add:!1,key:null};function he(_e,le){var ne=new Map;_e.forEach(function(Fe){ne.set(Fe,!0)});var Te=le.filter(function(Fe){return!ne.has(Fe)});return Te.length===1?Te[0]:null}return fe ").concat(ge);return ge}var j=function(ge,fe){var ue=ge.prefixCls,he=ge.data,_e=ge.selectable,le=ge.checkable,ne=ge.expandedKeys,Te=ge.selectedKeys,Fe=ge.checkedKeys,Ke=ge.loadedKeys,Ue=ge.loadingKeys,He=ge.halfCheckedKeys,Ne=ge.keyEntities,Be=ge.disabled,Je=ge.dragging,tt=ge.dragOverNodeKey,it=ge.dropPosition,rt=ge.motion,qe=ge.height,gt=ge.itemHeight,pt=ge.virtual,vt=ge.focusable,at=ge.activeItem,Rt=ge.focused,xt=ge.tabIndex,Tt=ge.onKeyDown,Ye=ge.onFocus,Mt=ge.onBlur,St=ge.onActiveChange,ze=ge.onListChangeStart,ut=ge.onListChangeEnd,be=Object(l.a)(ge,["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"]),xe=W.useRef(null);W.useImperativeHandle(fe,function(){return{scrollTo:function(kn){xe.current.scrollTo(kn)}}});var pe=W.useState(ne),se=Object(d.a)(pe,2),ce=se[0],Ee=se[1],Ae=W.useState(he),De=Object(d.a)(Ae,2),$e=De[0],lt=De[1],Bt=W.useState(he),tn=Object(d.a)(Bt,2),nn=tn[0],_n=tn[1],yn=W.useState([]),Gt=Object(d.a)(yn,2),ii=Gt[0],Dn=Gt[1],Ci=W.useState(null),fi=Object(d.a)(Ci,2),In=fi[0],Ri=fi[1];function Si(){lt(he),_n(he),Dn([]),Ri(null),ut()}W.useEffect(function(){Ee(ne);var Cn=A(ce,ne);if(Cn.key!==null)if(Cn.add){var kn=$e.findIndex(function(qi){var hr=qi.data.key;return hr===Cn.key}),Ai=C(w($e,he,Cn.key),pt,qe,gt),Ui=$e.slice();Ui.splice(kn+1,0,g),_n(Ui),Dn(Ai),Ri("show")}else{var dr=he.findIndex(function(qi){var hr=qi.data.key;return hr===Cn.key}),mn=C(w(he,$e,Cn.key),pt,qe,gt),Jt=he.slice();Jt.splice(dr+1,0,g),_n(Jt),Dn(mn),Ri("hide")}else $e!==he&&(lt(he),_n(he))},[ne,he]),W.useEffect(function(){Je||Si()},[Je]);var Ot=rt?nn:he,bn={expandedKeys:ne,selectedKeys:Te,loadedKeys:Ke,loadingKeys:Ue,checkedKeys:Fe,halfCheckedKeys:He,dragOverNodeKey:tt,dropPosition:it,keyEntities:Ne};return W.createElement(W.Fragment,null,Rt&&at&&W.createElement("span",{style:m,"aria-live":"assertive"},U(at)),W.createElement("div",{role:"tree"},W.createElement("input",{style:m,disabled:vt===!1||Be,tabIndex:vt!==!1?xt:null,onKeyDown:Tt,onFocus:Ye,onBlur:Mt,value:"",onChange:v})),W.createElement(a.a,Object.assign({},be,{data:Ot,itemKey:N,height:qe,fullHeight:!1,virtual:pt,itemHeight:gt,prefixCls:"".concat(ue,"-list"),ref:xe}),function(Cn){var kn=Cn.pos,Ai=Cn.data,Ui=Ai.key,dr=Object(l.a)(Ai,["key"]),mn=Cn.isStart,Jt=Cn.isEnd,qi=Object(r.e)(Ui,kn);delete dr.children;var hr=Object(r.f)(qi,bn);return W.createElement(T,Object.assign({},dr,hr,{active:at&&Ui===at.data.key,pos:kn,data:Cn.data,isStart:mn,isEnd:Jt,motion:rt,motionNodes:Ui===s?ii:null,motionType:In,onMotionStart:ze,onMotionEnd:Si,treeNodeRequiredProps:bn,onMouseMove:function(){St(null)}}))}))},H=W.forwardRef(j);H.displayName="NodeList";var y=H,x=G("NvD2"),F=function(ie){Object(B.a)(fe,ie);var ge=Object(K.a)(fe);function fe(){var ue;return Object(V.a)(this,fe),ue=ge.apply(this,arguments),ue.destroyed=!1,ue.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ue.listRef=W.createRef(),ue.onNodeDragStart=function(he,_e){var le=ue.state,ne=le.expandedKeys,Te=le.keyEntities,Fe=ue.props.onDragStart,Ke=_e.props.eventKey;ue.dragNode=_e;var Ue=Object(h.b)(ne,Ke);ue.setState({dragging:!0,dragNodesKeys:Object(h.g)(Ke,Te)}),ue.setExpandedKeys(Ue),Fe&&Fe({event:he,node:Object(r.b)(_e.props)})},ue.onNodeDragEnter=function(he,_e){var le=ue.state,ne=le.expandedKeys,Te=le.keyEntities,Fe=le.dragNodesKeys,Ke=ue.props.onDragEnter,Ue=_e.props,He=Ue.pos,Ne=Ue.eventKey;if(!ue.dragNode||Fe.indexOf(Ne)!==-1)return;var Be=Object(h.c)(he,_e);if(ue.dragNode.props.eventKey===Ne&&Be===0){ue.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ue.setState({dragOverNodeKey:Ne,dropPosition:Be}),ue.delayedDragEnterLogic||(ue.delayedDragEnterLogic={}),Object.keys(ue.delayedDragEnterLogic).forEach(function(Je){clearTimeout(ue.delayedDragEnterLogic[Je])}),ue.delayedDragEnterLogic[He]=window.setTimeout(function(){if(!ue.state.dragging)return;var Je=Object(M.a)(ne),tt=Te[Ne];tt&&(tt.children||[]).length&&(Je=Object(h.a)(ne,Ne)),"expandedKeys"in ue.props||ue.setExpandedKeys(Je),Ke&&Ke({event:he,node:Object(r.b)(_e.props),expandedKeys:Je})},400)},0)},ue.onNodeDragOver=function(he,_e){var le=ue.state.dragNodesKeys,ne=ue.props.onDragOver,Te=_e.props.eventKey;if(le.indexOf(Te)!==-1)return;if(ue.dragNode&&Te===ue.state.dragOverNodeKey){var Fe=Object(h.c)(he,_e);if(Fe===ue.state.dropPosition)return;ue.setState({dropPosition:Fe})}ne&&ne({event:he,node:Object(r.b)(_e.props)})},ue.onNodeDragLeave=function(he,_e){var le=ue.props.onDragLeave;ue.setState({dragOverNodeKey:""}),le&&le({event:he,node:Object(r.b)(_e.props)})},ue.onNodeDragEnd=function(he,_e){var le=ue.props.onDragEnd;ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),le&&le({event:he,node:Object(r.b)(_e.props)}),ue.dragNode=null},ue.onNodeDrop=function(he,_e){var le=ue.state,ne=le.dragNodesKeys,Te=ne===void 0?[]:ne,Fe=le.dropPosition,Ke=ue.props.onDrop,Ue=_e.props,He=Ue.eventKey,Ne=Ue.pos;if(ue.setState({dragOverNodeKey:""}),ue.cleanDragState(),Te.indexOf(He)!==-1){Object(P.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Be=Object(h.k)(Ne),Je={event:he,node:Object(r.b)(_e.props),dragNode:ue.dragNode?Object(r.b)(ue.dragNode.props):null,dragNodesKeys:Te.slice(),dropPosition:Fe+Number(Be[Be.length-1]),dropToGap:!1};Fe!==0&&(Je.dropToGap=!0),Ke&&Ke(Je),ue.dragNode=null},ue.cleanDragState=function(){var he=ue.state.dragging;he&&ue.setState({dragging:!1})},ue.onNodeClick=function(he,_e){var le=ue.props.onClick;le&&le(he,_e)},ue.onNodeDoubleClick=function(he,_e){var le=ue.props.onDoubleClick;le&&le(he,_e)},ue.onNodeSelect=function(he,_e){var le=ue.state.selectedKeys,ne=ue.state.keyEntities,Te=ue.props,Fe=Te.onSelect,Ke=Te.multiple,Ue=_e.selected,He=_e.key,Ne=!Ue;Ne?Ke?le=Object(h.a)(le,He):le=[He]:le=Object(h.b)(le,He);var Be=le.map(function(Je){var tt=ne[Je];return tt?tt.node:null}).filter(function(Je){return Je});ue.setUncontrolledState({selectedKeys:le}),Fe&&Fe(le,{event:"select",selected:Ne,node:_e,selectedNodes:Be,nativeEvent:he.nativeEvent})},ue.onNodeCheck=function(he,_e,le){var ne=ue.state,Te=ne.keyEntities,Fe=ne.checkedKeys,Ke=ne.halfCheckedKeys,Ue=ue.props,He=Ue.checkStrictly,Ne=Ue.onCheck,Be=_e.key,Je,tt={event:"check",node:_e,checked:le,nativeEvent:he.nativeEvent};if(He){var it=le?Object(h.a)(Fe,Be):Object(h.b)(Fe,Be),rt=Object(h.b)(Ke,Be);Je={checked:it,halfChecked:rt},tt.checkedNodes=it.map(function(Rt){return Te[Rt]}).filter(function(Rt){return Rt}).map(function(Rt){return Rt.node}),ue.setUncontrolledState({checkedKeys:it})}else{var qe=Object(x.a)([].concat(Object(M.a)(Fe),[Be]),!0,Te),gt=qe.checkedKeys,pt=qe.halfCheckedKeys;if(!le){var vt=new Set(gt);vt.delete(Be);var at=Object(x.a)(Array.from(vt),{checked:!1,halfCheckedKeys:pt},Te);gt=at.checkedKeys,pt=at.halfCheckedKeys}Je=gt,tt.checkedNodes=[],tt.checkedNodesPositions=[],tt.halfCheckedKeys=pt,gt.forEach(function(Rt){var xt=Te[Rt];if(!xt)return;var Tt=xt.node,Ye=xt.pos;tt.checkedNodes.push(Tt),tt.checkedNodesPositions.push({node:Tt,pos:Ye})}),ue.setUncontrolledState({checkedKeys:gt},!1,{halfCheckedKeys:pt})}Ne&&Ne(Je,tt)},ue.onNodeLoad=function(he){return new Promise(function(_e){ue.setState(function(le){var ne=le.loadedKeys,Te=ne===void 0?[]:ne,Fe=le.loadingKeys,Ke=Fe===void 0?[]:Fe,Ue=ue.props,He=Ue.loadData,Ne=Ue.onLoad,Be=he.key;if(!He||Te.indexOf(Be)!==-1||Ke.indexOf(Be)!==-1)return{};var Je=He(he);return Je.then(function(){var tt=ue.state,it=tt.loadedKeys,rt=tt.loadingKeys,qe=Object(h.a)(it,Be),gt=Object(h.b)(rt,Be);Ne&&Ne(qe,{event:"load",node:he}),ue.setUncontrolledState({loadedKeys:qe}),ue.setState({loadingKeys:gt}),_e()}),{loadingKeys:Object(h.a)(Ke,Be)}})})},ue.onNodeMouseEnter=function(he,_e){var le=ue.props.onMouseEnter;le&&le({event:he,node:_e})},ue.onNodeMouseLeave=function(he,_e){var le=ue.props.onMouseLeave;le&&le({event:he,node:_e})},ue.onNodeContextMenu=function(he,_e){var le=ue.props.onRightClick;le&&(he.preventDefault(),le({event:he,node:_e}))},ue.onFocus=function(){var he=ue.props.onFocus;ue.setState({focused:!0}),he&&he.apply(void 0,arguments)},ue.onBlur=function(){var he=ue.props.onBlur;ue.setState({focused:!1}),ue.onActiveChange(null),he&&he.apply(void 0,arguments)},ue.getTreeNodeRequiredProps=function(){var he=ue.state,_e=he.expandedKeys,le=he.selectedKeys,ne=he.loadedKeys,Te=he.loadingKeys,Fe=he.checkedKeys,Ke=he.halfCheckedKeys,Ue=he.dragOverNodeKey,He=he.dropPosition,Ne=he.keyEntities;return{expandedKeys:_e||[],selectedKeys:le||[],loadedKeys:ne||[],loadingKeys:Te||[],checkedKeys:Fe||[],halfCheckedKeys:Ke||[],dragOverNodeKey:Ue,dropPosition:He,keyEntities:Ne}},ue.setExpandedKeys=function(he){var _e=ue.state.treeData,le=Object(r.d)(_e,he);ue.setUncontrolledState({expandedKeys:he,flattenNodes:le},!0)},ue.onNodeExpand=function(he,_e){var le=ue.state.expandedKeys,ne=ue.state.listChanging,Te=ue.props,Fe=Te.onExpand,Ke=Te.loadData,Ue=_e.key,He=_e.expanded;if(ne)return;var Ne=le.indexOf(Ue),Be=!He;if(Object(P.a)(He&&Ne!==-1||!He&&Ne===-1,"Expand state not sync with index check"),Be?le=Object(h.a)(le,Ue):le=Object(h.b)(le,Ue),ue.setExpandedKeys(le),Fe&&Fe(le,{node:_e,expanded:Be,nativeEvent:he.nativeEvent}),Be&&Ke){var Je=ue.onNodeLoad(_e);Je&&Je.then(function(){var tt=Object(r.d)(ue.state.treeData,le);ue.setUncontrolledState({flattenNodes:tt})})}},ue.onListChangeStart=function(){ue.setUncontrolledState({listChanging:!0})},ue.onListChangeEnd=function(){setTimeout(function(){ue.setUncontrolledState({listChanging:!1})})},ue.onActiveChange=function(he){var _e=ue.state.activeKey,le=ue.props.onActiveChange;if(_e===he)return;ue.setState({activeKey:he}),he!==null&&ue.scrollTo({key:he}),le&&le(he)},ue.getActiveItem=function(){var he=ue.state,_e=he.activeKey,le=he.flattenNodes;return _e===null?null:le.find(function(ne){var Te=ne.data.key;return Te===_e})||null},ue.offsetActiveKey=function(he){var _e=ue.state,le=_e.flattenNodes,ne=_e.activeKey,Te=le.findIndex(function(Ue){var He=Ue.data.key;return He===ne});Te===-1&&he<0&&(Te=le.length),Te=(Te+he+le.length)%le.length;var Fe=le[Te];if(Fe){var Ke=Fe.data.key;ue.onActiveChange(Ke)}else ue.onActiveChange(null)},ue.onKeyDown=function(he){var _e=ue.state,le=_e.activeKey,ne=_e.expandedKeys,Te=_e.checkedKeys,Fe=ue.props,Ke=Fe.onKeyDown,Ue=Fe.checkable,He=Fe.selectable;switch(he.which){case L.a.UP:{ue.offsetActiveKey(-1),he.preventDefault();break}case L.a.DOWN:{ue.offsetActiveKey(1),he.preventDefault();break}}var Ne=ue.getActiveItem();if(Ne&&Ne.data){var Be=ue.getTreeNodeRequiredProps(),Je=Ne.data.isLeaf===!1||!!(Ne.data.children||[]).length,tt=Object(r.b)(Object(Z.a)(Object(Z.a)({},Object(r.f)(le,Be)),{},{data:Ne.data,active:!0}));switch(he.which){case L.a.LEFT:{Je&&ne.includes(le)?ue.onNodeExpand({},tt):Ne.parent&&ue.onActiveChange(Ne.parent.data.key),he.preventDefault();break}case L.a.RIGHT:{Je&&!ne.includes(le)?ue.onNodeExpand({},tt):Ne.children&&Ne.children.length&&ue.onActiveChange(Ne.children[0].data.key),he.preventDefault();break}case L.a.ENTER:case L.a.SPACE:{Ue&&!tt.disabled&&tt.checkable!==!1&&!tt.disableCheckbox?ue.onNodeCheck({},tt,!Te.includes(le)):!Ue&&He&&!tt.disabled&&tt.selectable!==!1&&ue.onNodeSelect({},tt);break}}}Ke&&Ke(he)},ue.setUncontrolledState=function(he){var _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ue.destroyed)return;var ne=!1,Te=!0,Fe={};Object.keys(he).forEach(function(Ke){if(Ke in ue.props){Te=!1;return}ne=!0,Fe[Ke]=he[Ke]}),ne&&(!_e||Te)&&ue.setState(Object(Z.a)(Object(Z.a)({},Fe),le))},ue.scrollTo=function(he){ue.listRef.current.scrollTo(he)},ue}return Object(I.a)(fe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var he,_e=this.state,le=_e.focused,ne=_e.flattenNodes,Te=_e.keyEntities,Fe=_e.dragging,Ke=_e.activeKey,Ue=this.props,He=Ue.prefixCls,Ne=Ue.className,Be=Ue.style,Je=Ue.showLine,tt=Ue.focusable,it=Ue.tabIndex,rt=it===void 0?0:it,qe=Ue.selectable,gt=Ue.showIcon,pt=Ue.icon,vt=Ue.switcherIcon,at=Ue.draggable,Rt=Ue.checkable,xt=Ue.checkStrictly,Tt=Ue.disabled,Ye=Ue.motion,Mt=Ue.loadData,St=Ue.filterTreeNode,ze=Ue.height,ut=Ue.itemHeight,be=Ue.virtual,xe=Ue.titleRender,pe=Ue.onContextMenu,se=Object(h.f)(this.props);return W.createElement(_.a.Provider,{value:{prefixCls:He,selectable:qe,showIcon:gt,icon:pt,switcherIcon:vt,draggable:at,checkable:Rt,checkStrictly:xt,disabled:Tt,keyEntities:Te,loadData:Mt,filterTreeNode:St,titleRender:xe,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}},W.createElement("div",{className:p()(He,Ne,(he={},Object(de.a)(he,"".concat(He,"-show-line"),Je),Object(de.a)(he,"".concat(He,"-focused"),le),Object(de.a)(he,"".concat(He,"-active-focused"),Ke!==null),he))},W.createElement(y,Object.assign({ref:this.listRef,prefixCls:He,style:Be,data:ne,disabled:Tt,selectable:qe,checkable:!!Rt,motion:Ye,dragging:Fe,height:ze,itemHeight:ut,virtual:be,focusable:tt,focused:le,tabIndex:rt,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:pe},this.getTreeNodeRequiredProps(),se))))}}],[{key:"getDerivedStateFromProps",value:function(he,_e){var le=_e.prevProps,ne={prevProps:he};function Te(pt){return!le&&pt in he||le&&le[pt]!==he[pt]}var Fe;if(Te("treeData")?Fe=he.treeData:Te("children")&&(Object(P.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Fe=Object(r.c)(he.children)),Fe){ne.treeData=Fe;var Ke=Object(r.a)(Fe);ne.keyEntities=Object(Z.a)(Object(de.a)({},s,E),Ke.keyEntities)}var Ue=ne.keyEntities||_e.keyEntities;if(Te("expandedKeys")||le&&Te("autoExpandParent"))ne.expandedKeys=he.autoExpandParent||!le&&he.defaultExpandParent?Object(h.e)(he.expandedKeys,Ue):he.expandedKeys;else if(!le&&he.defaultExpandAll){var He=Object(Z.a)({},Ue);delete He[s],ne.expandedKeys=Object.keys(He).map(function(pt){return He[pt].key})}else!le&&he.defaultExpandedKeys&&(ne.expandedKeys=he.autoExpandParent||he.defaultExpandParent?Object(h.e)(he.defaultExpandedKeys,Ue):he.defaultExpandedKeys);if(ne.expandedKeys||delete ne.expandedKeys,Fe||ne.expandedKeys){var Ne=Object(r.d)(Fe||_e.treeData,ne.expandedKeys||_e.expandedKeys);ne.flattenNodes=Ne}if(he.selectable&&(Te("selectedKeys")?ne.selectedKeys=Object(h.d)(he.selectedKeys,he):!le&&he.defaultSelectedKeys&&(ne.selectedKeys=Object(h.d)(he.defaultSelectedKeys,he))),he.checkable){var Be;if(Te("checkedKeys")?Be=Object(h.j)(he.checkedKeys)||{}:!le&&he.defaultCheckedKeys?Be=Object(h.j)(he.defaultCheckedKeys)||{}:Fe&&(Be=Object(h.j)(he.checkedKeys)||{checkedKeys:_e.checkedKeys,halfCheckedKeys:_e.halfCheckedKeys}),Be){var Je=Be,tt=Je.checkedKeys,it=tt===void 0?[]:tt,rt=Je.halfCheckedKeys,qe=rt===void 0?[]:rt;if(!he.checkStrictly){var gt=Object(x.a)(it,!0,Ue);it=gt.checkedKeys,qe=gt.halfCheckedKeys}ne.checkedKeys=it,ne.halfCheckedKeys=qe}}return Te("loadedKeys")&&(ne.loadedKeys=he.loadedKeys),ne}}]),fe}(W.Component);F.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:[]},F.TreeNode=c.a;var Q=F,q=Xe.b=Q},fcSX:function(ft,Xe,G){"use strict";var de=G("Ff2n"),Z=G("1OyB"),M=G("vuIU"),V=G("Ji7U"),I=G("md7G"),B=G("foSv"),K=G("1W/9"),W=G("q1tI"),L=G("rePB"),P=G("JX7q"),b=G("TSYQ"),p=G.n(b),_=G("qx4F"),h=G("4IlW");function r(j){return Array.isArray(j)?j:[j]}var d={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},l=Object.keys(d).filter(function(j){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return j in(H?H.style:{})})[0],a=d[l];function u(j,H,y,x){j.addEventListener?j.addEventListener(H,y,x):j.attachEvent&&j.attachEvent("on".concat(H),y)}function c(j,H,y,x){j.removeEventListener?j.removeEventListener(H,y,x):j.attachEvent&&j.detachEvent("on".concat(H),y)}function R(j,H){var y=typeof j=="function"?j(H):j;return Array.isArray(y)?y.length===2?y:[y[0],y[1]]:[y]}var O=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function j(H,y,x,F){if(!y||y===document||y instanceof Document)return!1;if(y===H.parentNode)return!0;var Q=Math.max(Math.abs(x),Math.abs(F))===Math.abs(F),q=Math.max(Math.abs(x),Math.abs(F))===Math.abs(x),ie=y.scrollHeight-y.clientHeight,ge=y.scrollWidth-y.clientWidth,fe=document.defaultView.getComputedStyle(y),ue=fe.overflowY==="auto"||fe.overflowY==="scroll",he=fe.overflowX==="auto"||fe.overflowX==="scroll",_e=ie&&ue,le=ge&&he;return Q&&(!_e||_e&&(y.scrollTop>=ie&&F<0||y.scrollTop<=0&&F>0))||q&&(!le||le&&(y.scrollLeft>=ge&&x<0||y.scrollLeft<=0&&x>0))?j(H,y.parentNode,x,F):!1};function w(j){var H=m();return function(){var x=Object(B.a)(j),F;if(H){var Q=Object(B.a)(this).constructor;F=Reflect.construct(x,arguments,Q)}else F=x.apply(this,arguments);return Object(I.a)(this,F)}}function m(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(j){return!1}}var v={},s=function(j){Object(V.a)(y,j);var H=w(y);function y(x){var F;return Object(Z.a)(this,y),F=H.call(this,x),F.domFocus=function(){F.dom&&F.dom.focus()},F.removeStartHandler=function(Q){if(Q.touches.length>1)return;F.startPos={x:Q.touches[0].clientX,y:Q.touches[0].clientY}},F.removeMoveHandler=function(Q){if(Q.changedTouches.length>1)return;var q=Q.currentTarget,ie=Q.changedTouches[0].clientX-F.startPos.x,ge=Q.changedTouches[0].clientY-F.startPos.y;(q===F.maskDom||q===F.handlerDom||q===F.contentDom&&A(q,Q.target,ie,ge))&&Q.cancelable&&Q.preventDefault()},F.transitionEnd=function(Q){var q=Q.target;c(q,a,F.transitionEnd),q.style.transition=""},F.onKeyDown=function(Q){if(Q.keyCode===h.a.ESC){var q=F.props.onClose;Q.stopPropagation(),q&&q(Q)}},F.onWrapperTransitionEnd=function(Q){var q=F.props,ie=q.open,ge=q.afterVisibleChange;Q.target===F.contentWrapper&&Q.propertyName.match(/transform$/)&&(F.dom.style.transition="",!ie&&F.getCurrentDrawerSome()&&(document.body.style.overflowX="",F.maskDom&&(F.maskDom.style.left="",F.maskDom.style.width="")),ge&&ge(!!ie))},F.openLevelTransition=function(){var Q=F.props,q=Q.open,ie=Q.width,ge=Q.height,fe=F.getHorizontalBoolAndPlacementName(),ue=fe.isHorizontal,he=fe.placementName,_e=F.contentDom?F.contentDom.getBoundingClientRect()[ue?"width":"height"]:0,le=(ue?ie:ge)||_e;F.setLevelAndScrolling(q,he,le)},F.setLevelTransform=function(Q,q,ie,ge){var fe=F.props,ue=fe.placement,he=fe.levelMove,_e=fe.duration,le=fe.ease,ne=fe.showMask;F.levelDom.forEach(function(Te){Te.style.transition="transform ".concat(_e," ").concat(le),u(Te,a,F.transitionEnd);var Fe=Q?ie:0;if(he){var Ke=R(he,{target:Te,open:Q});Fe=Q?Ke[0]:Ke[1]||0}var Ue=typeof Fe=="number"?"".concat(Fe,"px"):Fe,He=ue==="left"||ue==="top"?Ue:"-".concat(Ue);He=ne&&ue==="right"&&ge?"calc(".concat(He," + ").concat(ge,"px)"):He,Te.style.transform=Fe?"".concat(q,"(").concat(He,")"):""})},F.setLevelAndScrolling=function(Q,q,ie){var ge=F.props.onChange;if(!T){var fe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(_.a)(!0):0;F.setLevelTransform(Q,q,ie,fe),F.toggleScrollingToDrawerAndBody(fe)}ge&&ge(Q)},F.toggleScrollingToDrawerAndBody=function(Q){var q=F.props,ie=q.getOpenCount,ge=q.getContainer,fe=q.showMask,ue=q.open,he=ge&&ge(),_e=ie&&ie();if(he&&he.parentNode===document.body&&fe){var le=["touchstart"],ne=[document.body,F.maskDom,F.handlerDom,F.contentDom];ue&&document.body.style.overflow!=="hidden"?(Q&&F.addScrollingEffect(Q),_e===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ne.forEach(function(Te,Fe){if(!Te)return;u(Te,le[Fe]||"touchmove",Fe?F.removeMoveHandler:F.removeStartHandler,F.passive)})):F.getCurrentDrawerSome()&&(_e||(document.body.style.overflow=""),document.body.style.touchAction="",Q&&F.remScrollingEffect(Q),ne.forEach(function(Te,Fe){if(!Te)return;c(Te,le[Fe]||"touchmove",Fe?F.removeMoveHandler:F.removeStartHandler,F.passive)}))}},F.addScrollingEffect=function(Q){var q=F.props,ie=q.placement,ge=q.duration,fe=q.ease,ue=q.getOpenCount,he=q.switchScrollingEffect,_e=ue&&ue();_e===1&&he();var le="width ".concat(ge," ").concat(fe),ne="transform ".concat(ge," ").concat(fe);F.dom.style.transition="none";switch(ie){case"right":F.dom.style.transform="translateX(-".concat(Q,"px)");break;case"top":case"bottom":F.dom.style.width="calc(100% - ".concat(Q,"px)"),F.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(F.timeout),F.timeout=setTimeout(function(){F.dom&&(F.dom.style.transition="".concat(ne,",").concat(le),F.dom.style.width="",F.dom.style.transform="")})},F.remScrollingEffect=function(Q){var q=F.props,ie=q.placement,ge=q.duration,fe=q.ease,ue=q.getOpenCount,he=q.switchScrollingEffect,_e=ue&&ue();_e||he(!0),l&&(document.body.style.overflowX="hidden"),F.dom.style.transition="none";var le,ne="width ".concat(ge," ").concat(fe),Te="transform ".concat(ge," ").concat(fe);switch(ie){case"left":{F.dom.style.width="100%",ne="width 0s ".concat(fe," ").concat(ge);break}case"right":{F.dom.style.transform="translateX(".concat(Q,"px)"),F.dom.style.width="100%",ne="width 0s ".concat(fe," ").concat(ge),F.maskDom&&(F.maskDom.style.left="-".concat(Q,"px"),F.maskDom.style.width="calc(100% + ".concat(Q,"px)"));break}case"top":case"bottom":{F.dom.style.width="calc(100% + ".concat(Q,"px)"),F.dom.style.height="100%",F.dom.style.transform="translateZ(0)",le="height 0s ".concat(fe," ").concat(ge);break}default:break}clearTimeout(F.timeout),F.timeout=setTimeout(function(){F.dom&&(F.dom.style.transition="".concat(Te,",").concat(le?"".concat(le,","):"").concat(ne),F.dom.style.transform="",F.dom.style.width="",F.dom.style.height="")})},F.getCurrentDrawerSome=function(){return!Object.keys(v).some(function(Q){return v[Q]})},F.getLevelDom=function(Q){var q=Q.level,ie=Q.getContainer;if(T)return;var ge=ie&&ie(),fe=ge?ge.parentNode:null;if(F.levelDom=[],q==="all"){var ue=fe?Array.prototype.slice.call(fe.children):[];ue.forEach(function(he){he.nodeName!=="SCRIPT"&&he.nodeName!=="STYLE"&&he.nodeName!=="LINK"&&he!==ge&&F.levelDom.push(he)})}else q&&r(q).forEach(function(he){document.querySelectorAll(he).forEach(function(_e){F.levelDom.push(_e)})})},F.getHorizontalBoolAndPlacementName=function(){var Q=F.props.placement,q=Q==="left"||Q==="right",ie="translate".concat(q?"X":"Y");return{isHorizontal:q,placementName:ie}},F.state={_self:Object(P.a)(F)},F}return Object(M.a)(y,[{key:"componentDidMount",value:function(){var F=this;if(!T){var Q=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Q=!0,null}}))}catch(ue){}this.passive=Q?{passive:!1}:!1}var q=this.props,ie=q.open,ge=q.getContainer,fe=ge&&ge();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ie&&(fe&&fe.parentNode===document.body&&(v[this.drawerId]=ie),this.openLevelTransition(),this.forceUpdate(function(){F.domFocus()}))}},{key:"componentDidUpdate",value:function(F){var Q=this.props,q=Q.open,ie=Q.getContainer,ge=ie&&ie();q!==F.open&&(q&&this.domFocus(),ge&&ge.parentNode===document.body&&(v[this.drawerId]=!!q),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var F=this.props,Q=F.getOpenCount,q=F.open,ie=F.switchScrollingEffect,ge=typeof Q=="function"&&Q();delete v[this.drawerId],q&&(this.setLevelTransform(!1),document.body.style.touchAction=""),ge||(document.body.style.overflow="",ie(!0))}},{key:"render",value:function(){var F,Q=this,q=this.props,ie=q.className,ge=q.children,fe=q.style,ue=q.width,he=q.height,_e=q.defaultOpen,le=q.open,ne=q.prefixCls,Te=q.placement,Fe=q.level,Ke=q.levelMove,Ue=q.ease,He=q.duration,Ne=q.getContainer,Be=q.handler,Je=q.onChange,tt=q.afterVisibleChange,it=q.showMask,rt=q.maskClosable,qe=q.maskStyle,gt=q.onClose,pt=q.onHandleClick,vt=q.keyboard,at=q.getOpenCount,Rt=q.switchScrollingEffect,xt=Object(de.a)(q,["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"]),Tt=this.dom?le:!1,Ye=p()(ne,(F={},Object(L.a)(F,"".concat(ne,"-").concat(Te),!0),Object(L.a)(F,"".concat(ne,"-open"),Tt),Object(L.a)(F,ie||"",!!ie),Object(L.a)(F,"no-mask",!it),F)),Mt=this.getHorizontalBoolAndPlacementName(),St=Mt.placementName,ze=Te==="left"||Te==="top"?"-100%":"100%",ut=Tt?"":"".concat(St,"(").concat(ze,")"),be=Be&&W.cloneElement(Be,{onClick:function(pe){Be.props.onClick&&Be.props.onClick(),pt&&pt(pe)},ref:function(pe){Q.handlerDom=pe}});return W.createElement("div",Object.assign({},xt,{tabIndex:-1,className:Ye,style:fe,ref:function(pe){Q.dom=pe},onKeyDown:Tt&&vt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),it&&W.createElement("div",{className:"".concat(ne,"-mask"),onClick:rt?gt:void 0,style:qe,ref:function(pe){Q.maskDom=pe}}),W.createElement("div",{className:"".concat(ne,"-content-wrapper"),style:{transform:ut,msTransform:ut,width:O(ue)?"".concat(ue,"px"):ue,height:O(he)?"".concat(he,"px"):he},ref:function(pe){Q.contentWrapper=pe}},W.createElement("div",{className:"".concat(ne,"-content"),ref:function(pe){Q.contentDom=pe},onTouchStart:Tt&&it?this.removeStartHandler:void 0,onTouchMove:Tt&&it?this.removeMoveHandler:void 0},ge),be))}}],[{key:"getDerivedStateFromProps",value:function(F,Q){var q=Q.prevProps,ie=Q._self,ge={prevProps:F};if(q!==void 0){var fe=F.placement,ue=F.level;fe!==q.placement&&(ie.contentDom=null),ue!==q.level&&ie.getLevelDom(F)}return ge}}]),y}(W.Component);s.defaultProps={switchScrollingEffect:function(){}};var o=s;function E(j){var H=g();return function(){var x=Object(B.a)(j),F;if(H){var Q=Object(B.a)(this).constructor;F=Reflect.construct(x,arguments,Q)}else F=x.apply(this,arguments);return Object(I.a)(this,F)}}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(j){return!1}}var C=function(j){Object(V.a)(y,j);var H=E(y);function y(x){var F;Object(Z.a)(this,y),F=H.call(this,x),F.onHandleClick=function(q){var ie=F.props,ge=ie.onHandleClick,fe=ie.open;if(ge&&ge(q),typeof fe=="undefined"){var ue=F.state.open;F.setState({open:!ue})}},F.onClose=function(q){var ie=F.props,ge=ie.onClose,fe=ie.open;ge&&ge(q),typeof fe=="undefined"&&F.setState({open:!1})};var Q=typeof x.open!="undefined"?x.open:!!x.defaultOpen;return F.state={open:Q},"onMaskClick"in x&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),F}return Object(M.a)(y,[{key:"render",value:function(){var F=this,Q=this.props,q=Q.defaultOpen,ie=Q.getContainer,ge=Q.wrapperClassName,fe=Q.forceRender,ue=Q.handler,he=Object(de.a)(Q,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),_e=this.state.open;if(!ie)return W.createElement("div",{className:ge,ref:function(Te){F.dom=Te}},W.createElement(o,Object.assign({},he,{open:_e,handler:ue,getContainer:function(){return F.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var le=!!ue||fe;return W.createElement(K.a,{visible:_e,forceRender:le,getContainer:ie,wrapperClassName:ge},function(ne){var Te=ne.visible,Fe=ne.afterClose,Ke=Object(de.a)(ne,["visible","afterClose"]);return W.createElement(o,Object.assign({},he,Ke,{open:Te!==void 0?Te:_e,afterVisibleChange:Fe!==void 0?Fe:he.afterVisibleChange,handler:ue,onClose:F.onClose,onHandleClick:F.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(F,Q){var q=Q.prevProps,ie={prevProps:F};return typeof q!="undefined"&&F.open!==q.open&&(ie.open=F.open),ie}}]),y}(W.Component);C.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:W.createElement("div",{className:"drawer-handle"},W.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var N=C,U=Xe.a=N},i8i3:function(ft,Xe,G){ft.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(ft,Xe,G){ft.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"}},iris:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return _});var de=G("qVdP"),Z=G("jsC+"),M=G("lUTK"),V=G("BvKs"),I=G("tJVT"),B=G("q1tI"),K=G.n(B),W=G("Q0Vu"),L=G.n(W),P=[{name:"\u7F16\u7A0B\u9898",value:"PROGRAM"},{name:"\u5355\u9009\u9898",value:"SINGLE"},{name:"\u591A\u9009\u9898",value:"MULTIPLE"},{name:"\u5224\u65AD\u9898",value:"JUDGMENT"},{name:"\u586B\u7A7A\u9898",value:"COMPLETION"},{name:"\u7B80\u7B54\u9898",value:"SUBJECTIVE"},{name:"\u7EC4\u5408\u9898",value:"COMBINATION"}],b=[{name:"\u7B80\u5355",value:1},{name:"\u9002\u4E2D",value:2},{name:"\u56F0\u96BE",value:3}],p=[{name:"\u968F\u673A\u7EC4\u5377",value:1},{name:"\u4EBA\u5DE5\u7EC4\u5377",value:2}],_=function(r){var d=r.showSelectAll,l=d===void 0?!1:d,a=r.disciplinesData,u=a===void 0?[]:a,c=r.knowledgeData,R=c===void 0?[]:c,O=r.directionValue,T=r.subDisciplineValue,A=r.typeValue,w=r.knowledgeValue,m=r.showKnowledge,v=m===void 0?!1:m,s=r.showRandomType,o=s===void 0?!1:s,E=r.difficultyValue,g=r.randomValue,C=r.selectAll,N=r.languagesvalue,U=r.className,j=r.languages,H=j===void 0?[]:j,y=r.isprogram_homework,x=r.showShixun,F=x===void 0?!1:x,Q=r.showItemType,q=Q===void 0?!0:Q,ie=r.onShixunChange,ge=ie===void 0?function(){}:ie,fe=r.onDirectionChange,ue=fe===void 0?function(){}:fe,he=r.onTypeChange,_e=he===void 0?function(){}:he,le=r.onDifficultyChange,ne=le===void 0?function(){}:le,Te=r.handlelanguagesChange,Fe=Te===void 0?function(){}:Te,Ke=r.onKnowledgeChange,Ue=Ke===void 0?function(){}:Ke,He=r.onRandomChange,Ne=He===void 0?function(){}:He,Be=r.showTeachGroup,Je=Be===void 0?!1:Be,tt=r.teachGroupData,it=tt===void 0?[]:tt,rt=r.onTeachGroupChange,qe=rt===void 0?function(){}:rt,gt=r.teachGroupValue,pt=Object(B.useState)(0),vt=Object(I.a)(pt,2),at=vt[0],Rt=vt[1],xt=Object(B.useRef)(null),Tt=Object(B.useState)(0),Ye=Object(I.a)(Tt,2),Mt=Ye[0],St=Ye[1],ze=Object(B.useRef)(null);Object(B.useEffect)(function(){if(u.length!==0){var be;(xt==null||((be=xt.current)===null||be===void 0)?void 0:be.clientHeight)>108?Rt(1):Rt(0)}u.length===0&&Rt(0)},[u]),Object(B.useEffect)(function(){if(console.log(R.length===0,"\u6570\u91CF"),R.length!==0){var be,xe;console.log(ze==null||((be=ze.current)===null||be===void 0)?void 0:be.clientHeight,"\u9AD8\u5EA6"),(ze==null||((xe=ze.current)===null||xe===void 0)?void 0:xe.clientHeight)>108?St(1):St(0)}R.length===0&&St(0)},[R]);var ut=function(){var xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],pe=arguments.length>1?arguments[1]:void 0;return K.a.createElement(V.a,{className:L.a.subMenu},xe.map(function(se){return K.a.createElement(V.a.Item,{key:se.id},K.a.createElement("a",{className:"".concat(L.a.subItem," ").concat(T===se.id?L.a.subActive:""),onClick:function(){return ue(pe,se.id)}},se.name))}))};return K.a.createElement("aside",{className:U?"".concat(L.a.main," ").concat(U):L.a.main},K.a.createElement("div",{className:L.a.wrap},y&&K.a.createElement("div",{className:L.a.programName},"\u8BD5\u9898\u5E93-\u7F16\u7A0B\u9898"),Je&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u56E2\u961F"),K.a.createElement("div",{className:L.a.directionContentWrap},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(gt?"":L.a.active," "),onClick:function(){return qe(null)}},"\u5168\u90E8"),it==null?void 0:it.map(function(be){return K.a.createElement("li",{key:be.group_id,className:"".concat(L.a.directionItem," ").concat(gt===be.group_id?L.a.active:""," "),onClick:function(){return qe(be.group_id)}},be.name)}))),K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u65B9\u5411"),K.a.createElement("span",null),K.a.createElement("div",{className:L.a.directionContentWrap,style:{overflow:"hidden",height:at===1?88:"auto"}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O?"":L.a.active," "),onClick:function(){return ue(null)}},"\u5168\u90E8"),u.map(function(be){var xe;return K.a.createElement(K.a.Fragment,{key:be.id},((xe=be.sub_disciplines)===null||xe===void 0?void 0:xe.length)>0?K.a.createElement(Z.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(se){return se.parentNode},overlay:function(){return ut(be.sub_disciplines,be.id)}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name)):K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name))})),K.a.createElement("div",{className:L.a.directionContentWrap,ref:xt,style:{height:"auto",position:"fixed",left:0,top:0,width:1024,visibility:"hidden"}},u.map(function(be){var xe;return K.a.createElement(K.a.Fragment,{key:be.id},((xe=be.sub_disciplines)===null||xe===void 0?void 0:xe.length)>0?K.a.createElement(Z.a,{placement:"bottomLeft",overlayStyle:{width:600},getPopupContainer:function(se){return se.parentNode},overlay:function(){return ut(be.sub_disciplines,be.id)}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name)):K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(O===be.id?L.a.active:""," "),onClick:function(){return ue(be.id)}},be.name))})),!!at&&K.a.createElement("div",{className:L.a.action},at===1&&K.a.createElement("span",{onClick:function(){return Rt(2)}},"\u5C55\u5F00",K.a.createElement("i",{className:"iconfont icon-xiala"})),at===2&&K.a.createElement("span",{onClick:function(){return Rt(1)}},"\u6536\u8D77",K.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),v&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u77E5\u8BC6\u70B9"),K.a.createElement("div",{className:L.a.directionContentWrap,style:{overflow:"hidden",height:Mt===1?106:"auto"}},K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(w===-1?L.a.active:""," "),onClick:function(){return Ue(-1)}},"\u5168\u90E8"),R.map(function(be){return K.a.createElement("li",{key:be.id,className:"".concat(L.a.directionItem," ").concat(w===be.id?L.a.active:""," "),onClick:function(){return Ue(be.id)}},be.name)})),K.a.createElement("div",{ref:ze,className:L.a.directionContentWrap,style:{height:"auto",position:"fixed",left:0,top:0,width:1010,visibility:"hidden"}},R.map(function(be){return K.a.createElement("li",{key:be.id,className:"".concat(L.a.directionItem," ").concat(w===be.id?L.a.active:""," "),onClick:function(){return Ue(be.id)}},be.name)})),!!Mt&&K.a.createElement("div",{className:L.a.action},Mt===1&&K.a.createElement("span",{onClick:function(){return St(2)}},"\u5C55\u5F00",K.a.createElement("i",{className:"iconfont icon-xiala"})),Mt===2&&K.a.createElement("span",{onClick:function(){return St(1)}},"\u6536\u8D77",K.a.createElement("i",{style:{transform:"scale(0.5) rotate(180deg) translateY(2px)"},className:"iconfont icon-xiala"})))),q&&!y&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u9898\u578B"),K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(A?"":L.a.active," "),onClick:function(){return _e(null)}},"\u5168\u90E8"),K.a.createElement("div",{className:L.a.directionContentWrap},P.map(function(be){return K.a.createElement("li",{key:be.name,className:"".concat(L.a.directionItem," ").concat(A===be.value?L.a.active:""," "),onClick:function(){return _e(be.value)}},be.name)}),F&&K.a.createElement("li",{key:"\u5B9E\u8BAD\u9898",className:L.a.directionItem,onClick:function(){return ge()}},"\u5B9E\u8BAD\u9898"))),K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u96BE\u5EA6"),K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(E?"":L.a.active," "),onClick:function(){return ne(null)}},"\u5168\u90E8"),K.a.createElement("div",{className:L.a.directionContentWrap},b.map(function(be){return K.a.createElement("li",{key:be.name,className:"".concat(L.a.directionItem," ").concat(E===be.value?L.a.active:""," "),onClick:function(){return ne(be.value)}},be.name)}))),o&&K.a.createElement("div",{className:L.a.content},K.a.createElement("span",{className:L.a.name},"\u7C7B\u578B"),K.a.createElement("li",{className:"".concat(L.a.directionItem," ").concat(g?"":L.a.active," "),onClick:function(){return Ne(null)}},"\u5168\u90E8"),K.a.createElement("div",{className:L.a.directionContentWrap},p.map(function(be){return K.a.createElement("li",{key:be.name,className:"".concat(L.a.directionItem," ").concat(g===be.value?L.a.active:""," "),onClick:function(){return Ne(be.value)}},be.name)})))))}},jcZT:function(ft,Xe,G){"use strict";var de=G("2qtc"),Z=G("kLXV"),M=G("5NDa"),V=G("5rEg"),I=G("miYZ"),B=G("tsqr"),K=G("9og8"),W=G("tJVT"),L=G("WmNS"),P=G.n(L),b=G("q1tI"),p=G.n(b),_=G("d5o6"),h=G.n(_),r=G("P/tu"),d=G("WCUW"),l=G("9kvl"),a=function(c){var R=c.problemset,O=c.dispatch,T=c.onOk,A=Object(b.useState)(""),w=Object(W.a)(A,2),m=w[0],v=w[1],s=Object(b.useState)([0]),o=Object(W.a)(s,2),E=o[0],g=o[1],C=function(){O({type:"problemset/setActionTabs",payload:{}})};Object(b.useEffect)(function(){if(R.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939"){var U,j;g([(U=R.actionTabs)===null||U===void 0||((j=U.params)===null||j===void 0)?void 0:j.group_id]),v("")}},[R.actionTabs.key]);var N=function(){var U=Object(K.a)(P.a.mark(function j(){var H,y,x;return P.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:if(H=["\uFF1F","\u3001","/","\u2572","*","<",">","|"],m.trim()){Q.next=4;break}return B.b.warn("\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0"),Q.abrupt("return");case 4:if(!(m.charAt(0)===" ")){Q.next=7;break}return B.b.warn("\u9996\u5B57\u7B26\u4E0D\u80FD\u4E3A\u7A7A\u683C"),Q.abrupt("return");case 7:y=0;case 8:if(!(y0?E[0]:0,name:m});case 17:x=Q.sent,x.status===0&&(C(),T(x==null?void 0:x.id));case 19:case"end":return Q.stop()}},j)}));return function(){return U.apply(this,arguments)}}();return p.a.createElement(Z.a,{centered:!0,title:"\u65B0\u5EFA\u6587\u4EF6\u5939",visible:R.actionTabs.key==="\u65B0\u5EFA\u6587\u4EF6\u5939",width:500,onCancel:C,onOk:N,destroyOnClose:!0},p.a.createElement("div",{className:h.a.addModal},p.a.createElement("div",{className:h.a.row},p.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u540D\u79F0: "),p.a.createElement(V.a,{placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5939\u540D\u79F0",value:m,onChange:function(j){return v(j.target.value)}})),p.a.createElement("div",{className:h.a.row,style:{alignItems:"start",maxHeight:500,overflow:"auto"}},p.a.createElement("span",{className:h.a.label},"\u6587\u4EF6\u5939\u4F4D\u7F6E: "),p.a.createElement(r.a,{value:E,onChange:function(j){return g(j)}}))))};Xe.a=Object(l.a)(function(u){var c=u.problemset;return{problemset:c}})(a)},k3GJ:function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return fo});var de=G("rePB"),Z=G("ODXe"),M=G("Ff2n"),V=G("VTBJ"),I=G("q1tI"),B=G("TSYQ"),K=G.n(B),W=G("Zm9Q"),L=G("6cGi"),P=G("KQm4"),b=G("xEkU"),p=G.n(b),_=G("t23M");function h(ye){var Oe=Object(I.useRef)(),Me=Object(I.useRef)(!1);function Ce(){for(var re=arguments.length,me=new Array(re),oe=0;oeje&&(bt=je-mt),Object(I.useMemo)(function(){if(!me.length)return[0,0];for(var Ut=me.length,Rn=Ut,Qn=0;QnIe+bt){Rn=Qn-1;break}}for(var Vn=0,Yn=Ut-1;Yn>=0;Yn-=1){var Xn=ye.get(me[Yn].key)||R;if(Xn[ke]1&&arguments[1]!==void 0?arguments[1]:!1,Ce=Oe&&typeof Oe.getBoundingClientRect=="function"&&Oe.getBoundingClientRect().width;if(Ce){if(Me){var re=getComputedStyle(Oe),me=re.marginLeft,oe=re.marginRight;Ce+=+me.replace("px","")+ +oe.replace("px","")}Ce=+Ce.toFixed(6)}return Ce||0},rt=function(Oe,Me,Ce){Oe&&Object(U.a)(Oe.style)==="object"&&(Oe.style[Me]=Ce)},qe=function(){return Ke.any},gt=G("bdgK"),pt=G("i8i4"),vt=G.n(pt),at=G("wgJM"),Rt=G("l4aY"),xt=G("m+aA"),Tt=G("c+Xe"),Ye=G("zT1h"),Mt=G("QC+M");function St(ye,Oe,Me){return Me?ye[0]===Oe[0]:ye[0]===Oe[0]&&ye[1]===Oe[1]}function ze(ye,Oe,Me){var Ce=ye[Oe]||{};return Object(V.a)(Object(V.a)({},Ce),Me)}function ut(ye,Oe,Me,Ce){for(var re=Me.points,me=Object.keys(ye),oe=0;oe1&&arguments[1]!==void 0?arguments[1]:2;Oe();var me=Object(at.a)(function(){re<=1?Ce({isCanceled:function(){return me!==ye.current}}):Me(Ce,re-1)});ye.current=me}return I.useEffect(function(){return function(){Oe()}},[]),[Me,Oe]},Ui=[In,Ri,Si,Ot],dr=!1,mn=!0;function Jt(ye){return ye===Si||ye===Ot}var qi=function(ye,Oe){var Me=I.useState(fi),Ce=Object(Z.a)(Me,2),re=Ce[0],me=Ce[1],oe=Ai(),we=Object(Z.a)(oe,2),ve=we[0],ke=we[1];function Ie(){me(In)}return kn(function(){if(re!==fi&&re!==Ot){var je=Ui.indexOf(re),Ze=Ui[je+1],mt=Oe(re);mt===dr?me(Ze):ve(function(bt){function Ut(){if(bt.isCanceled())return;me(Ze)}mt===!0?Ut():Promise.resolve(mt).then(Ut)})}},[ye,re]),I.useEffect(function(){return function(){ke()}},[]),[Ie,re]},hr=function(ye){var Oe=Object(I.useRef)(),Me=Object(I.useRef)(ye);Me.current=ye;var Ce=I.useCallback(function(oe){Me.current(oe)},[]);function re(oe){oe&&(oe.removeEventListener(_n,Ce),oe.removeEventListener(nn,Ce))}function me(oe){Oe.current&&Oe.current!==oe&&re(Oe.current),oe&&oe!==Oe.current&&(oe.addEventListener(_n,Ce),oe.addEventListener(nn,Ce),Oe.current=oe)}return I.useEffect(function(){return function(){re(Oe.current)}},[]),[me,re]};function sr(ye,Oe,Me,Ce){var re=Ce.motionEnter,me=re===void 0?!0:re,oe=Ce.motionAppear,we=oe===void 0?!0:oe,ve=Ce.motionLeave,ke=ve===void 0?!0:ve,Ie=Ce.motionDeadline,je=Ce.motionLeaveImmediately,Ze=Ce.onAppearPrepare,mt=Ce.onEnterPrepare,bt=Ce.onLeavePrepare,Ut=Ce.onAppearStart,Rn=Ce.onEnterStart,Qn=Ce.onLeaveStart,jn=Ce.onAppearActive,Vn=Ce.onEnterActive,Yn=Ce.onLeaveActive,Xn=Ce.onAppearEnd,Wn=Ce.onEnterEnd,Jn=Ce.onLeaveEnd,ei=Ce.onVisibleChanged,ki=bn(),ti=Object(Z.a)(ki,2),gn=ti[0],fn=ti[1],Hn=bn(Gt),ui=Object(Z.a)(Hn,2),an=ui[0],ci=ui[1],Mi=bn(null),ri=Object(Z.a)(Mi,2),wi=ri[0],bi=ri[1],Hi=Object(I.useRef)(!1),Gi=Object(I.useRef)(null),Bi=Object(I.useRef)(!1),vr=Object(I.useRef)(null);function Lr(){var Oi=Me();return Oi||vr.current}var Cr=Object(I.useRef)(!1);function Vi(Oi){var vi=Lr();if(Oi&&!Oi.deadline&&Oi.target!==vi)return;var ji;an===ii&&Cr.current?ji=Xn==null?void 0:Xn(vi,Oi):an===Dn&&Cr.current?ji=Wn==null?void 0:Wn(vi,Oi):an===Ci&&Cr.current&&(ji=Jn==null?void 0:Jn(vi,Oi)),ji!==!1&&!Bi.current&&(ci(Gt),bi(null))}var Di=hr(Vi),Ei=Object(Z.a)(Di,1),Tn=Ei[0],xi=I.useMemo(function(){var Oi,vi,ji;switch(an){case"appear":return Oi={},Object(de.a)(Oi,In,Ze),Object(de.a)(Oi,Ri,Ut),Object(de.a)(Oi,Si,jn),Oi;case"enter":return vi={},Object(de.a)(vi,In,mt),Object(de.a)(vi,Ri,Rn),Object(de.a)(vi,Si,Vn),vi;case"leave":return ji={},Object(de.a)(ji,In,bt),Object(de.a)(ji,Ri,Qn),Object(de.a)(ji,Si,Yn),ji;default:return{}}},[an]),Nr=qi(an,function(Oi){if(Oi===In){var vi=xi[In];return vi?vi(Lr()):dr}if(Ti in xi){var ji;bi(((ji=xi[Ti])===null||ji===void 0?void 0:ji.call(xi,Lr(),null))||null)}return Ti===Si&&(Tn(Lr()),Ie>0&&(clearTimeout(Gi.current),Gi.current=setTimeout(function(){Vi({deadline:!0})},Ie))),mn}),Zr=Object(Z.a)(Nr,2),ra=Zr[0],Ti=Zr[1],Vr=Jt(Ti);Cr.current=Vr,kn(function(){fn(Oe);var Oi=Hi.current;if(Hi.current=!0,!ye)return;var vi;!Oi&&Oe&&we&&(vi=ii),Oi&&Oe&&me&&(vi=Dn),(Oi&&!Oe&&ke||!Oi&&je&&!Oe&&ke)&&(vi=Ci),vi&&(ci(vi),ra())},[Oe]),Object(I.useEffect)(function(){(an===ii&&!we||an===Dn&&!me||an===Ci&&!ke)&&ci(Gt)},[we,me,ke]),Object(I.useEffect)(function(){return function(){clearTimeout(Gi.current),Bi.current=!0}},[]),Object(I.useEffect)(function(){gn!==void 0&&an===Gt&&(ei==null||ei(gn))},[gn,an]);var Jr=wi;return xi[In]&&Ti===Ri&&(Jr=Object(V.a)({transition:"none"},Jr)),[an,Ti,Jr,gn!=null?gn:Oe]}var Fn=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){return Object(A.a)(this,Me),Oe.apply(this,arguments)}return Object(w.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(I.Component),er=Fn;function kr(ye){var Oe=ye;Object(U.a)(ye)==="object"&&(Oe=ye.transitionSupport);function Me(re){return!!(re.motionName&&Oe)}var Ce=I.forwardRef(function(re,me){var oe=re.visible,we=oe===void 0?!0:oe,ve=re.removeOnLeave,ke=ve===void 0?!0:ve,Ie=re.forceRender,je=re.children,Ze=re.motionName,mt=re.leavedClassName,bt=re.eventProps,Ut=Me(re),Rn=Object(I.useRef)(),Qn=Object(I.useRef)();function jn(){try{return Object(xt.a)(Rn.current||Qn.current)}catch(ci){return null}}var Vn=sr(Ut,we,jn,re),Yn=Object(Z.a)(Vn,4),Xn=Yn[0],Wn=Yn[1],Jn=Yn[2],ei=Yn[3],ki=I.useRef(ei);ei&&(ki.current=!0);var ti=Object(I.useRef)(me);ti.current=me;var gn=I.useCallback(function(ci){Rn.current=ci,Object(Tt.b)(ti.current,ci)},[]),fn,Hn=Object(V.a)(Object(V.a)({},bt),{},{visible:we});if(!je)fn=null;else if(Xn===Gt||!Me(re))ei?fn=je(Object(V.a)({},Hn),gn):!ke&&ki.current?fn=je(Object(V.a)(Object(V.a)({},Hn),{},{className:mt}),gn):Ie?fn=je(Object(V.a)(Object(V.a)({},Hn),{},{style:{display:"none"}}),gn):fn=null;else{var ui,an;Wn===In?an="prepare":Jt(Wn)?an="active":Wn===Ri&&(an="start"),fn=je(Object(V.a)(Object(V.a)({},Hn),{},{className:K()(yn(Ze,Xn),(ui={},Object(de.a)(ui,yn(Ze,"".concat(Xn,"-").concat(an)),an),Object(de.a)(ui,Ze,typeof Ze=="string"),ui)),style:Jn}),gn)}return I.createElement(er,{ref:Qn},fn)});return Ce.displayName="CSSMotion",Ce}var Qr=kr(tn),yt="add",cn="keep",Kr="remove",zr="removed";function na(ye){var Oe;return ye&&Object(U.a)(ye)==="object"&&"key"in ye?Oe=ye:Oe={key:ye},Object(V.a)(Object(V.a)({},Oe),{},{key:String(Oe.key)})}function Gr(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return ye.map(na)}function $(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Me=[],Ce=0,re=Oe.length,me=Gr(ye),oe=Gr(Oe);me.forEach(function(ke){for(var Ie=!1,je=Ce;je1});return ve.forEach(function(ke){Me=Me.filter(function(Ie){var je=Ie.key,Ze=Ie.status;return je!==ke||Ze!==Kr}),Me.forEach(function(Ie){Ie.key===ke&&(Ie.status=cn)})}),Me}var S=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function D(ye){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qr,Me=function(Ce){Object(v.a)(me,Ce);var re=Object(s.a)(me);function me(){var oe;return Object(A.a)(this,me),oe=re.apply(this,arguments),oe.state={keyEntities:[]},oe.removeKey=function(we){oe.setState(function(ve){var ke=ve.keyEntities;return{keyEntities:ke.map(function(Ie){return Ie.key!==we?Ie:Object(V.a)(Object(V.a)({},Ie),{},{status:zr})})}})},oe}return Object(w.a)(me,[{key:"render",value:function(){var we=this,ve=this.state.keyEntities,ke=this.props,Ie=ke.component,je=ke.children,Ze=ke.onVisibleChanged,mt=Object(M.a)(ke,["component","children","onVisibleChanged"]),bt=Ie||I.Fragment,Ut={};return S.forEach(function(Rn){Ut[Rn]=mt[Rn],delete mt[Rn]}),delete mt.keys,I.createElement(bt,mt,ve.map(function(Rn){var Qn=Rn.status,jn=Object(M.a)(Rn,["status"]),Vn=Qn===yt||Qn===cn;return I.createElement(Oe,Object(T.a)({},Ut,{key:jn.key,visible:Vn,eventProps:jn,onVisibleChanged:function(Xn){Ze==null||Ze(Xn,{key:jn.key}),Xn||we.removeKey(jn.key)}}),je)}))}}],[{key:"getDerivedStateFromProps",value:function(we,ve){var ke=we.keys,Ie=ve.keyEntities,je=Gr(ke),Ze=$(Ie,je);return{keyEntities:Ze.filter(function(mt){var bt=Ie.find(function(Ut){var Rn=Ut.key;return mt.key===Rn});return!(bt&&bt.status===zr&&mt.status===Kr)})}}}]),me}(I.Component);return Me.defaultProps={component:"div"},Me}var z=D(tn),te=Qr;function Y(ye){var Oe=ye.prefixCls,Me=ye.motion,Ce=ye.animation,re=ye.transitionName;return Me||(Ce?{motionName:"".concat(Oe,"-").concat(Ce)}:re?{motionName:re}:null)}function Le(ye){var Oe=ye.prefixCls,Me=ye.visible,Ce=ye.zIndex,re=ye.mask,me=ye.maskMotion,oe=ye.maskAnimation,we=ye.maskTransitionName;if(!re)return null;var ve={};return(me||we||oe)&&(ve=Object(V.a)({motionAppear:!0},Y({motion:me,prefixCls:Oe,transitionName:we,animation:oe}))),I.createElement(te,Object(T.a)({},ve,{visible:Me,removeOnLeave:!0}),function(ke){var Ie=ke.className;return I.createElement("div",{style:{zIndex:Ce},className:K()("".concat(Oe,"-mask"),Ie)})})}var ct=G("9mu1"),Pt=G("o0o1"),rn=G.n(Pt),ht=G("HaE+"),Vt=["measure","align",null,"motion"],hi=function(ye,Oe){var Me=Object(I.useState)(null),Ce=Object(Z.a)(Me,2),re=Ce[0],me=Ce[1],oe=Object(I.useRef)(),we=Object(I.useRef)(!1);function ve(je){we.current||me(je)}function ke(){at.a.cancel(oe.current)}function Ie(je){ke(),oe.current=Object(at.a)(function(){ve(function(Ze){switch(re){case"align":return"motion";case"motion":return"stable";default:}return Ze}),je==null||je()})}return Object(I.useEffect)(function(){ve("measure")},[ye]),Object(I.useEffect)(function(){switch(re){case"measure":Oe();break;default:}re&&(oe.current=Object(at.a)(Object(ht.a)(rn.a.mark(function je(){var Ze,mt;return rn.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:Ze=Vt.indexOf(re),mt=Vt[Ze+1],mt&&Ze!==-1&&ve(mt);case 3:case"end":return Ut.stop()}},je)}))))},[re]),Object(I.useEffect)(function(){return function(){we.current=!0,ke()}},[]),[re,Ie]},Li=function(ye){var Oe=I.useState({width:0,height:0}),Me=Object(Z.a)(Oe,2),Ce=Me[0],re=Me[1];function me(we){re({width:we.offsetWidth,height:we.offsetHeight})}var oe=I.useMemo(function(){var we={};if(ye){var ve=Ce.width,ke=Ce.height;ye.indexOf("height")!==-1&&ke?we.height=ke:ye.indexOf("minHeight")!==-1&&ke&&(we.minHeight=ke),ye.indexOf("width")!==-1&&ve?we.width=ve:ye.indexOf("minWidth")!==-1&&ve&&(we.minWidth=ve)}return we},[ye,Ce]);return[oe,me]},Zt=I.forwardRef(function(ye,Oe){var Me=ye.visible,Ce=ye.prefixCls,re=ye.className,me=ye.style,oe=ye.children,we=ye.zIndex,ve=ye.stretch,ke=ye.destroyPopupOnHide,Ie=ye.forceRender,je=ye.align,Ze=ye.point,mt=ye.getRootDomNode,bt=ye.getClassNameFromAlign,Ut=ye.onAlign,Rn=ye.onMouseEnter,Qn=ye.onMouseLeave,jn=ye.onMouseDown,Vn=ye.onTouchStart,Yn=Object(I.useRef)(),Xn=Object(I.useRef)(),Wn=Object(I.useState)(),Jn=Object(Z.a)(Wn,2),ei=Jn[0],ki=Jn[1],ti=Li(ve),gn=Object(Z.a)(ti,2),fn=gn[0],Hn=gn[1];function ui(){ve&&Hn(mt())}var an=hi(Me,ui),ci=Object(Z.a)(an,2),Mi=ci[0],ri=ci[1],wi=Object(I.useRef)();function bi(){return Ze||mt}function Hi(){var Di;(Di=Yn.current)===null||Di===void 0||Di.forceAlign()}function Gi(Di,Ei){var Tn=bt(Ei);ei!==Tn&&ki(Tn),Mi==="align"&&(ei!==Tn?Promise.resolve().then(function(){Hi()}):ri(function(){var xi;(xi=wi.current)===null||xi===void 0||xi.call(wi)}),Ut==null||Ut(Di,Ei))}var Bi=Object(V.a)({},Y(ye));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(Di){var Ei=Bi[Di];Bi[Di]=function(Tn,xi){return ri(),Ei==null?void 0:Ei(Tn,xi)}});function vr(){return new Promise(function(Di){wi.current=Di})}I.useEffect(function(){!Bi.motionName&&Mi==="motion"&&ri()},[Bi.motionName,Mi]),I.useImperativeHandle(Oe,function(){return{forceAlign:Hi,getElement:function(){return Xn.current}}});var Lr=Object(V.a)(Object(V.a)({},fn),{},{zIndex:we,opacity:Mi==="motion"||Mi==="stable"||!Me?void 0:0,pointerEvents:Mi==="stable"?void 0:"none"},me),Cr=!0;(je==null?void 0:je.points)&&(Mi==="align"||Mi==="stable")&&(Cr=!1);var Vi=oe;return I.Children.count(oe)>1&&(Vi=I.createElement("div",{className:"".concat(Ce,"-content")},oe)),I.createElement(te,Object(T.a)({visible:Me,ref:Xn,leavedClassName:"".concat(Ce,"-hidden")},Bi,{onAppearPrepare:vr,onEnterPrepare:vr,removeOnLeave:ke,forceRender:Ie}),function(Di,Ei){var Tn=Di.className,xi=Di.style,Nr=K()(Ce,re,ei,Tn);return I.createElement(ct.a,{target:bi(),key:"popup",ref:Yn,monitorWindowResize:!0,disabled:Cr,align:je,onAlign:Gi},I.createElement("div",{ref:Ei,className:Nr,onMouseEnter:Rn,onMouseLeave:Qn,onMouseDownCapture:jn,onTouchStartCapture:Vn,style:Object(V.a)(Object(V.a)({},xi),Lr)},Vi))})});Zt.displayName="PopupInner";var dt=Zt,kt=I.forwardRef(function(ye,Oe){var Me=ye.prefixCls,Ce=ye.visible,re=ye.zIndex,me=ye.children,oe=ye.mobile;oe=oe===void 0?{}:oe;var we=oe.popupClassName,ve=oe.popupStyle,ke=oe.popupMotion,Ie=ke===void 0?{}:ke,je=oe.popupRender,Ze=I.useRef();I.useImperativeHandle(Oe,function(){return{forceAlign:function(){},getElement:function(){return Ze.current}}});var mt=Object(V.a)({zIndex:re},ve),bt=me;return I.Children.count(me)>1&&(bt=I.createElement("div",{className:"".concat(Me,"-content")},me)),je&&(bt=je(bt)),I.createElement(te,Object(T.a)({visible:Ce,ref:Ze,removeOnLeave:!0},Ie),function(Ut,Rn){var Qn=Ut.className,jn=Ut.style,Vn=K()(Me,we,Qn);return I.createElement("div",{ref:Rn,className:Vn,style:Object(V.a)(Object(V.a)({},jn),mt)},bt)})});kt.displayName="MobilePopupInner";var Lt=kt,Kt=["visible","mobile"],sn=I.forwardRef(function(ye,Oe){var Me=ye.visible,Ce=ye.mobile,re=Object(M.a)(ye,Kt),me=Object(I.useState)(Me),oe=Object(Z.a)(me,2),we=oe[0],ve=oe[1],ke=Object(I.useState)(!1),Ie=Object(Z.a)(ke,2),je=Ie[0],Ze=Ie[1],mt=Object(V.a)(Object(V.a)({},re),{},{visible:we});Object(I.useEffect)(function(){ve(Me),Me&&Ce&&Ze(be())},[Me,Ce]);var bt=je?I.createElement(Lt,Object(T.a)({},mt,{mobile:Ce,ref:Oe})):I.createElement(dt,Object(T.a)({},mt,{ref:Oe}));return I.createElement("div",null,I.createElement(Le,mt),bt)});sn.displayName="Popup";var En=sn,wn=I.createContext(null),hn=wn;function Ln(){}function zn(){return""}function un(ye){return ye?ye.ownerDocument:window.document}var Sn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function di(ye){var Oe=function(Me){Object(v.a)(re,Me);var Ce=Object(s.a)(re);function re(me){var oe;Object(A.a)(this,re),oe=Ce.call(this,me),oe.popupRef=I.createRef(),oe.triggerRef=I.createRef(),oe.attachId=void 0,oe.clickOutsideHandler=void 0,oe.touchOutsideHandler=void 0,oe.contextMenuOutsideHandler1=void 0,oe.contextMenuOutsideHandler2=void 0,oe.mouseDownTimeout=void 0,oe.focusTime=void 0,oe.preClickTime=void 0,oe.preTouchTime=void 0,oe.delayTimer=void 0,oe.hasPopupMouseDown=void 0,oe.onMouseEnter=function(ve){var ke=oe.props.mouseEnterDelay;oe.fireEvents("onMouseEnter",ve),oe.delaySetPopupVisible(!0,ke,ke?null:ve)},oe.onMouseMove=function(ve){oe.fireEvents("onMouseMove",ve),oe.setPoint(ve)},oe.onMouseLeave=function(ve){oe.fireEvents("onMouseLeave",ve),oe.delaySetPopupVisible(!1,oe.props.mouseLeaveDelay)},oe.onPopupMouseEnter=function(){oe.clearDelayTimer()},oe.onPopupMouseLeave=function(ve){var ke;if(ve.relatedTarget&&!ve.relatedTarget.setTimeout&&Object(Rt.a)((ke=oe.popupRef.current)===null||ke===void 0?void 0:ke.getElement(),ve.relatedTarget))return;oe.delaySetPopupVisible(!1,oe.props.mouseLeaveDelay)},oe.onFocus=function(ve){oe.fireEvents("onFocus",ve),oe.clearDelayTimer(),oe.isFocusToShow()&&(oe.focusTime=Date.now(),oe.delaySetPopupVisible(!0,oe.props.focusDelay))},oe.onMouseDown=function(ve){oe.fireEvents("onMouseDown",ve),oe.preClickTime=Date.now()},oe.onTouchStart=function(ve){oe.fireEvents("onTouchStart",ve),oe.preTouchTime=Date.now()},oe.onBlur=function(ve){oe.fireEvents("onBlur",ve),oe.clearDelayTimer(),oe.isBlurToHide()&&oe.delaySetPopupVisible(!1,oe.props.blurDelay)},oe.onContextMenu=function(ve){ve.preventDefault(),oe.fireEvents("onContextMenu",ve),oe.setPopupVisible(!0,ve)},oe.onContextMenuClose=function(){oe.isContextMenuToShow()&&oe.close()},oe.onClick=function(ve){if(oe.fireEvents("onClick",ve),oe.focusTime){var ke;if(oe.preClickTime&&oe.preTouchTime?ke=Math.min(oe.preClickTime,oe.preTouchTime):oe.preClickTime?ke=oe.preClickTime:oe.preTouchTime&&(ke=oe.preTouchTime),Math.abs(ke-oe.focusTime)<20)return;oe.focusTime=0}oe.preClickTime=0,oe.preTouchTime=0,oe.isClickToShow()&&(oe.isClickToHide()||oe.isBlurToHide())&&ve&&ve.preventDefault&&ve.preventDefault();var Ie=!oe.state.popupVisible;(oe.isClickToHide()&&!Ie||Ie&&oe.isClickToShow())&&oe.setPopupVisible(!oe.state.popupVisible,ve)},oe.onPopupMouseDown=function(){if(oe.hasPopupMouseDown=!0,clearTimeout(oe.mouseDownTimeout),oe.mouseDownTimeout=window.setTimeout(function(){oe.hasPopupMouseDown=!1},0),oe.context){var ve;(ve=oe.context).onPopupMouseDown.apply(ve,arguments)}},oe.onDocumentClick=function(ve){if(oe.props.mask&&!oe.props.maskClosable)return;var ke=ve.target,Ie=oe.getRootDomNode(),je=oe.getPopupDomNode();(!Object(Rt.a)(Ie,ke)||oe.isContextMenuOnly())&&!Object(Rt.a)(je,ke)&&!oe.hasPopupMouseDown&&oe.close()},oe.getRootDomNode=function(){var ve=oe.props.getTriggerDOMNode;if(ve)return ve(oe.triggerRef.current);try{var ke=Object(xt.a)(oe.triggerRef.current);if(ke)return ke}catch(Ie){}return vt.a.findDOMNode(Object(m.a)(oe))},oe.getPopupClassNameFromAlign=function(ve){var ke=[],Ie=oe.props,je=Ie.popupPlacement,Ze=Ie.builtinPlacements,mt=Ie.prefixCls,bt=Ie.alignPoint,Ut=Ie.getPopupClassNameFromAlign;return je&&Ze&&ke.push(ut(Ze,mt,ve,bt)),Ut&&ke.push(Ut(ve)),ke.join(" ")},oe.getComponent=function(){var ve=oe.props,ke=ve.prefixCls,Ie=ve.destroyPopupOnHide,je=ve.popupClassName,Ze=ve.onPopupAlign,mt=ve.popupMotion,bt=ve.popupAnimation,Ut=ve.popupTransitionName,Rn=ve.popupStyle,Qn=ve.mask,jn=ve.maskAnimation,Vn=ve.maskTransitionName,Yn=ve.maskMotion,Xn=ve.zIndex,Wn=ve.popup,Jn=ve.stretch,ei=ve.alignPoint,ki=ve.mobile,ti=ve.forceRender,gn=oe.state,fn=gn.popupVisible,Hn=gn.point,ui=oe.getPopupAlign(),an={};return oe.isMouseEnterToShow()&&(an.onMouseEnter=oe.onPopupMouseEnter),oe.isMouseLeaveToHide()&&(an.onMouseLeave=oe.onPopupMouseLeave),an.onMouseDown=oe.onPopupMouseDown,an.onTouchStart=oe.onPopupMouseDown,I.createElement(En,Object(T.a)({prefixCls:ke,destroyPopupOnHide:Ie,visible:fn,point:ei&&Hn,className:je,align:ui,onAlign:Ze,animation:bt,getClassNameFromAlign:oe.getPopupClassNameFromAlign},an,{stretch:Jn,getRootDomNode:oe.getRootDomNode,style:Rn,mask:Qn,zIndex:Xn,transitionName:Ut,maskAnimation:jn,maskTransitionName:Vn,maskMotion:Yn,ref:oe.popupRef,motion:mt,mobile:ki,forceRender:ti}),typeof Wn=="function"?Wn():Wn)},oe.attachParent=function(ve){at.a.cancel(oe.attachId);var ke=oe.props,Ie=ke.getPopupContainer,je=ke.getDocument,Ze=oe.getRootDomNode(),mt;Ie?(Ze||Ie.length===0)&&(mt=Ie(Ze)):mt=je(oe.getRootDomNode()).body,mt?mt.appendChild(ve):oe.attachId=Object(at.a)(function(){oe.attachParent(ve)})},oe.getContainer=function(){var ve=oe.props.getDocument,ke=ve(oe.getRootDomNode()).createElement("div");return ke.style.position="absolute",ke.style.top="0",ke.style.left="0",ke.style.width="100%",oe.attachParent(ke),ke},oe.setPoint=function(ve){var ke=oe.props.alignPoint;if(!ke||!ve)return;oe.setState({point:{pageX:ve.pageX,pageY:ve.pageY}})},oe.handlePortalUpdate=function(){oe.state.prevPopupVisible!==oe.state.popupVisible&&oe.props.afterPopupVisibleChange(oe.state.popupVisible)},oe.triggerContextValue={onPopupMouseDown:oe.onPopupMouseDown};var we;return"popupVisible"in me?we=!!me.popupVisible:we=!!me.defaultPopupVisible,oe.state={prevPopupVisible:we,popupVisible:we},Sn.forEach(function(ve){oe["fire".concat(ve)]=function(ke){oe.fireEvents(ve,ke)}}),oe}return Object(w.a)(re,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var oe=this.props,we=this.state;if(we.popupVisible){var ve;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(ve=oe.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ye.a)(ve,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(ve=ve||oe.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ye.a)(ve,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(ve=ve||oe.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ye.a)(ve,"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),at.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var oe;return((oe=this.popupRef.current)===null||oe===void 0?void 0:oe.getElement())||null}},{key:"getPopupAlign",value:function(){var oe=this.props,we=oe.popupPlacement,ve=oe.popupAlign,ke=oe.builtinPlacements;return we&&ke?ze(ke,we,ve):ve}},{key:"setPopupVisible",value:function(oe,we){var ve=this.props.alignPoint,ke=this.state.popupVisible;this.clearDelayTimer(),ke!==oe&&("popupVisible"in this.props||this.setState({popupVisible:oe,prevPopupVisible:ke}),this.props.onPopupVisibleChange(oe)),ve&&we&&oe&&this.setPoint(we)}},{key:"delaySetPopupVisible",value:function(oe,we,ve){var ke=this,Ie=we*1e3;if(this.clearDelayTimer(),Ie){var je=ve?{pageX:ve.pageX,pageY:ve.pageY}:null;this.delayTimer=window.setTimeout(function(){ke.setPopupVisible(oe,je),ke.clearDelayTimer()},Ie)}else this.setPopupVisible(oe,ve)}},{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(oe){var we=this.props.children.props,ve=this.props;return we[oe]&&ve[oe]?this["fire".concat(oe)]:we[oe]||ve[oe]}},{key:"isClickToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var oe=this.props.action;return oe==="contextMenu"||oe.length===1&&oe[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("contextMenu")!==-1||ve.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var oe=this.props,we=oe.action,ve=oe.hideAction;return we.indexOf("click")!==-1||ve.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("hover")!==-1||ve.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var oe=this.props,we=oe.action,ve=oe.hideAction;return we.indexOf("hover")!==-1||ve.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var oe=this.props,we=oe.action,ve=oe.showAction;return we.indexOf("focus")!==-1||ve.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var oe=this.props,we=oe.action,ve=oe.hideAction;return we.indexOf("focus")!==-1||ve.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var oe;(oe=this.popupRef.current)===null||oe===void 0||oe.forceAlign()}}},{key:"fireEvents",value:function(oe,we){var ve=this.props.children.props[oe];ve&&ve(we);var ke=this.props[oe];ke&&ke(we)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var oe=this.state.popupVisible,we=this.props,ve=we.children,ke=we.forceRender,Ie=we.alignPoint,je=we.className,Ze=we.autoDestroy,mt=I.Children.only(ve),bt={key:"trigger"};this.isContextMenuToShow()?bt.onContextMenu=this.onContextMenu:bt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(bt.onClick=this.onClick,bt.onMouseDown=this.onMouseDown,bt.onTouchStart=this.onTouchStart):(bt.onClick=this.createTwoChains("onClick"),bt.onMouseDown=this.createTwoChains("onMouseDown"),bt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(bt.onMouseEnter=this.onMouseEnter,Ie&&(bt.onMouseMove=this.onMouseMove)):bt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?bt.onMouseLeave=this.onMouseLeave:bt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(bt.onFocus=this.onFocus,bt.onBlur=this.onBlur):(bt.onFocus=this.createTwoChains("onFocus"),bt.onBlur=this.createTwoChains("onBlur"));var Ut=K()(mt&&mt.props&&mt.props.className,je);Ut&&(bt.className=Ut);var Rn=Object(V.a)({},bt);Object(Tt.c)(mt)&&(Rn.ref=Object(Tt.a)(this.triggerRef,mt.ref));var Qn=I.cloneElement(mt,Rn),jn;return(oe||this.popupRef.current||ke)&&(jn=I.createElement(ye,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!oe&&Ze&&(jn=null),I.createElement(hn.Provider,{value:this.triggerContextValue},Qn,jn)}}],[{key:"getDerivedStateFromProps",value:function(oe,we){var ve=oe.popupVisible,ke={};return ve!==void 0&&we.popupVisible!==ve&&(ke.popupVisible=ve,ke.prevPopupVisible=we.popupVisible),ke}}]),re}(I.Component);return Oe.contextType=hn,Oe.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:zn,getDocument:un,onPopupVisibleChange:Ln,afterPopupVisibleChange:Ln,onPopupAlign:Ln,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},Oe}var Nn=di(Mt.a),zt={adjustX:1,adjustY:1},An={topLeft:{points:["bl","tl"],overflow:zt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:zt,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:zt,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:zt,offset:[4,0]}},si={topLeft:{points:["bl","tl"],overflow:zt,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:zt,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:zt,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:zt,offset:[4,0]}},Un=An,Xt=0,jt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},pn=function(Oe,Me,Ce){var re=Ne(Me),me=Oe.getState();Oe.setState({defaultActiveFirst:Object(V.a)(Object(V.a)({},me.defaultActiveFirst),{},Object(de.a)({},re,Ce))})},Ct=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(Ce){var re;Object(A.a)(this,Me),re=Oe.call(this,Ce),re.onDestroy=function(Ie){re.props.onDestroy(Ie)},re.onKeyDown=function(Ie){var je=Ie.keyCode,Ze=re.menuInstance,mt=re.props.store,bt=re.getVisible();if(je===d.a.ENTER)return re.onTitleClick(Ie),pn(mt,re.props.eventKey,!0),!0;if(je===d.a.RIGHT)return bt?Ze.onKeyDown(Ie):(re.triggerOpenChange(!0),pn(mt,re.props.eventKey,!0)),!0;if(je===d.a.LEFT){var Ut;if(bt)Ut=Ze.onKeyDown(Ie);else return;return Ut||(re.triggerOpenChange(!1),Ut=!0),Ut}return bt&&(je===d.a.UP||je===d.a.DOWN)?Ze.onKeyDown(Ie):void 0},re.onOpenChange=function(Ie){re.props.onOpenChange(Ie)},re.onPopupVisibleChange=function(Ie){re.triggerOpenChange(Ie,Ie?"mouseenter":"mouseleave")},re.onMouseEnter=function(Ie){var je=re.props,Ze=je.eventKey,mt=je.onMouseEnter,bt=je.store;pn(bt,re.props.eventKey,!1),mt({key:Ze,domEvent:Ie})},re.onMouseLeave=function(Ie){var je=re.props,Ze=je.parentMenu,mt=je.eventKey,bt=je.onMouseLeave;Ze.subMenuInstance=Object(m.a)(re),bt({key:mt,domEvent:Ie})},re.onTitleMouseEnter=function(Ie){var je=re.props,Ze=je.eventKey,mt=je.onItemHover,bt=je.onTitleMouseEnter;mt({key:Ze,hover:!0}),bt({key:Ze,domEvent:Ie})},re.onTitleMouseLeave=function(Ie){var je=re.props,Ze=je.parentMenu,mt=je.eventKey,bt=je.onItemHover,Ut=je.onTitleMouseLeave;Ze.subMenuInstance=Object(m.a)(re),bt({key:mt,hover:!1}),Ut({key:mt,domEvent:Ie})},re.onTitleClick=function(Ie){var je=Object(m.a)(re),Ze=je.props;if(Ze.onTitleClick({key:Ze.eventKey,domEvent:Ie}),Ze.triggerSubMenuAction==="hover")return;re.triggerOpenChange(!re.getVisible(),"click"),pn(Ze.store,re.props.eventKey,!1)},re.onSubMenuClick=function(Ie){typeof re.props.onClick=="function"&&re.props.onClick(re.addKeyPath(Ie))},re.onSelect=function(Ie){re.props.onSelect(Ie)},re.onDeselect=function(Ie){re.props.onDeselect(Ie)},re.getPrefixCls=function(){return"".concat(re.props.rootPrefixCls,"-submenu")},re.getActiveClassName=function(){return"".concat(re.getPrefixCls(),"-active")},re.getDisabledClassName=function(){return"".concat(re.getPrefixCls(),"-disabled")},re.getSelectedClassName=function(){return"".concat(re.getPrefixCls(),"-selected")},re.getOpenClassName=function(){return"".concat(re.props.rootPrefixCls,"-submenu-open")},re.getVisible=function(){return re.state.isOpen},re.getMode=function(){return re.state.mode},re.saveMenuInstance=function(Ie){re.menuInstance=Ie},re.addKeyPath=function(Ie){return Object(V.a)(Object(V.a)({},Ie),{},{keyPath:(Ie.keyPath||[]).concat(re.props.eventKey)})},re.triggerOpenChange=function(Ie,je){var Ze=re.props.eventKey,mt=function(){re.onOpenChange({key:Ze,item:Object(m.a)(re),trigger:je,open:Ie})};je==="mouseenter"?re.mouseenterTimeout=setTimeout(function(){mt()},0):mt()},re.isChildrenSelected=function(){var Ie={find:!1};return Je(re.props.children,re.props.selectedKeys,Ie),Ie.find},re.isInlineMode=function(){return re.getMode()==="inline"},re.adjustWidth=function(){if(!re.subMenuTitle||!re.menuInstance)return;var Ie=pt.findDOMNode(re.menuInstance);if(Ie.offsetWidth>=re.subMenuTitle.offsetWidth)return;Ie.style.minWidth="".concat(re.subMenuTitle.offsetWidth,"px")},re.saveSubMenuTitle=function(Ie){re.subMenuTitle=Ie},re.getBaseProps=function(){var Ie=Object(m.a)(re),je=Ie.props,Ze=re.getMode();return{mode:Ze==="horizontal"?"vertical":Ze,visible:re.getVisible(),level:je.level+1,inlineIndent:je.inlineIndent,focusable:!1,onClick:re.onSubMenuClick,onSelect:re.onSelect,onDeselect:re.onDeselect,onDestroy:re.onDestroy,selectedKeys:je.selectedKeys,eventKey:"".concat(je.eventKey,"-menu-"),openKeys:je.openKeys,motion:je.motion,onOpenChange:re.onOpenChange,subMenuOpenDelay:je.subMenuOpenDelay,parentMenu:Object(m.a)(re),subMenuCloseDelay:je.subMenuCloseDelay,forceSubMenuRender:je.forceSubMenuRender,triggerSubMenuAction:je.triggerSubMenuAction,builtinPlacements:je.builtinPlacements,defaultActiveFirst:je.store.getState().defaultActiveFirst[Ne(je.eventKey)],multiple:je.multiple,prefixCls:je.rootPrefixCls,id:re.internalMenuId,manualRef:re.saveMenuInstance,itemIcon:je.itemIcon,expandIcon:je.expandIcon,direction:je.direction}},re.getMotion=function(Ie,je){var Ze=Object(m.a)(re),mt=Ze.haveRendered,bt=re.props,Ut=bt.motion,Rn=bt.rootPrefixCls,Qn=Object(V.a)(Object(V.a)({},Ut),{},{leavedClassName:"".concat(Rn,"-hidden"),removeOnLeave:!1,motionAppear:mt||!je||Ie!=="inline"});return Qn};var me=Ce.store,oe=Ce.eventKey,we=me.getState(),ve=we.defaultActiveFirst;re.isRootMenu=!1;var ke=!1;return ve&&(ke=ve[oe]),pn(me,oe,ke),re.state={mode:Ce.mode,isOpen:Ce.isOpen},re}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var re=this,me=this.props,oe=me.mode,we=me.parentMenu,ve=me.manualRef,ke=me.isOpen,Ie=function(){re.setState({mode:oe,isOpen:ke})},je=ke!==this.state.isOpen,Ze=oe!==this.state.mode;if((Ze||je)&&(at.a.cancel(this.updateStateRaf),Ze?this.updateStateRaf=Object(at.a)(Ie):Ie()),ve&&ve(this),oe!=="horizontal"||!(we==null?void 0:we.isRootMenu)||!ke)return;this.minWidthTimeout=setTimeout(function(){return re.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var re=this.props,me=re.onDestroy,oe=re.eventKey;me&&me(oe),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),at.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(re,me){var oe=this.getBaseProps();return I.createElement(li,Object(T.a)({},oe,{id:this.internalMenuId,className:re,style:me}),this.props.children)}},{key:"renderChildren",value:function(){var re=this,me=this.getBaseProps(),oe=me.mode,we=me.visible,ve=me.forceSubMenuRender,ke=me.direction,Ie=this.getMotion(oe,we);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||we||ve,!this.haveOpened)return I.createElement("div",null);var je=K()("".concat(me.prefixCls,"-sub"),Object(de.a)({},"".concat(me.prefixCls,"-rtl"),ke==="rtl"));return this.isInlineMode()?I.createElement(te,Object(T.a)({visible:me.visible,forceRender:ve},Ie),function(Ze){var mt=Ze.className,bt=Ze.style,Ut=K()(je,mt);return re.renderPopupMenu(Ut,bt)}):this.renderPopupMenu(je)}},{key:"render",value:function(){var re,me,oe,we=Object(V.a)({},this.props),ve=this.getVisible(),ke=this.getPrefixCls(),Ie=this.isInlineMode(),je=this.getMode(),Ze=K()(ke,"".concat(ke,"-").concat(je),(re={},Object(de.a)(re,we.className,!!we.className),Object(de.a)(re,this.getOpenClassName(),ve),Object(de.a)(re,this.getActiveClassName(),we.active||ve&&!Ie),Object(de.a)(re,this.getDisabledClassName(),we.disabled),Object(de.a)(re,this.getSelectedClassName(),this.isChildrenSelected()),re));this.internalMenuId||(we.eventKey?this.internalMenuId="".concat(we.eventKey,"$Menu"):(Xt+=1,this.internalMenuId="$__$".concat(Xt,"$Menu")));var mt={},bt={},Ut={};we.disabled||(mt={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},bt={onClick:this.onTitleClick},Ut={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Rn={},Qn=we.direction,jn=Qn==="rtl";Ie&&(jn?Rn.paddingRight=we.inlineIndent*we.level:Rn.paddingLeft=we.inlineIndent*we.level);var Vn={};this.getVisible()&&(Vn={"aria-owns":this.internalMenuId});var Yn=null;je!=="horizontal"&&(Yn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Yn=I.createElement(this.props.expandIcon,Object(V.a)({},this.props))));var Xn=I.createElement("div",Object(T.a)({ref:this.saveSubMenuTitle,style:Rn,className:"".concat(ke,"-title"),role:"button"},Ut,bt,{"aria-expanded":ve},Vn,{"aria-haspopup":"true",title:typeof we.title=="string"?we.title:void 0}),we.title,Yn||I.createElement("i",{className:"".concat(ke,"-arrow")})),Wn=this.renderChildren(),Jn=((me=we.parentMenu)===null||me===void 0?void 0:me.isRootMenu)?we.parentMenu.props.getPopupContainer:function(bi){return bi.parentNode},ei=jt[je],ki=we.popupOffset?{offset:we.popupOffset}:{},ti=K()((oe={},Object(de.a)(oe,we.popupClassName,we.popupClassName&&!Ie),Object(de.a)(oe,"".concat(ke,"-rtl"),jn),oe)),gn=we.disabled,fn=we.triggerSubMenuAction,Hn=we.subMenuOpenDelay,ui=we.forceSubMenuRender,an=we.subMenuCloseDelay,ci=we.builtinPlacements;tt.forEach(function(bi){return delete we[bi]}),delete we.onClick;var Mi=jn?Object(V.a)(Object(V.a)({},si),ci):Object(V.a)(Object(V.a)({},An),ci);delete we.direction;var ri=this.getBaseProps(),wi=Ie?null:this.getMotion(ri.mode,ri.visible);return I.createElement("li",Object(T.a)({},we,mt,{className:Ze,role:"menuitem"}),I.createElement(Nn,{prefixCls:ke,popupClassName:K()("".concat(ke,"-popup"),ti),getPopupContainer:Jn,builtinPlacements:Mi,popupPlacement:ei,popupVisible:Ie?!1:ve,popupAlign:ki,popup:Ie?null:Wn,action:gn||Ie?[]:[fn],mouseEnterDelay:Hn,mouseLeaveDelay:an,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ui,popupMotion:wi},Xn),Ie?Wn:null)}}]),Me}(I.Component);Ct.defaultProps={onMouseEnter:Ue,onMouseLeave:Ue,onTitleMouseEnter:Ue,onTitleMouseLeave:Ue,onTitleClick:Ue,manualRef:Ue,mode:"vertical",title:""};var Nt=Object(o.b)(function(ye,Oe){var Me=ye.openKeys,Ce=ye.activeKey,re=ye.selectedKeys,me=Oe.eventKey,oe=Oe.subMenuKey;return{isOpen:Me.indexOf(me)>-1,active:Ce[oe]===me,selectedKeys:re}})(Ct);Nt.isSubMenu=!0;var Dt=Nt,Pe="menuitem-overflowed",Yt=.5,xn=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){var Ce;return Object(A.a)(this,Me),Ce=Oe.apply(this,arguments),Ce.resizeObserver=null,Ce.mutationObserver=null,Ce.originalTotalWidth=0,Ce.overflowedItems=[],Ce.menuItemSizes=[],Ce.cancelFrameId=null,Ce.state={lastVisibleIndex:void 0},Ce.childRef=I.createRef(),Ce.getMenuItemNodes=function(){var re=Ce.props.prefixCls,me=Ce.childRef.current;return me?[].slice.call(me.children).filter(function(oe){return oe.className.split(" ").indexOf("".concat(re,"-overflowed-submenu"))<0}):[]},Ce.getOverflowedSubMenuItem=function(re,me,oe){var we=Ce.props,ve=we.overflowedIndicator,ke=we.level,Ie=we.mode,je=we.prefixCls,Ze=we.theme;if(ke!==1||Ie!=="horizontal")return null;var mt=Ce.props.children[0],bt=mt.props,Ut=bt.children,Rn=bt.title,Qn=bt.style,jn=Object(M.a)(bt,["children","title","style"]),Vn=Object(V.a)({},Qn),Yn="".concat(re,"-overflowed-indicator"),Xn="".concat(re,"-overflowed-indicator");me.length===0&&oe!==!0?Vn=Object(V.a)(Object(V.a)({},Vn),{},{display:"none"}):oe&&(Vn=Object(V.a)(Object(V.a)({},Vn),{},{visibility:"hidden",position:"absolute"}),Yn="".concat(Yn,"-placeholder"),Xn="".concat(Xn,"-placeholder"));var Wn=Ze?"".concat(je,"-").concat(Ze):"",Jn={};return tt.forEach(function(ei){jn[ei]!==void 0&&(Jn[ei]=jn[ei])}),I.createElement(Dt,Object(T.a)({title:ve,className:"".concat(je,"-overflowed-submenu"),popupClassName:Wn},Jn,{key:Yn,eventKey:Xn,disabled:!1,style:Vn}),me)},Ce.setChildrenWidthAndResize=function(){if(Ce.props.mode!=="horizontal")return;var re=Ce.childRef.current;if(!re)return;var me=re.children;if(!me||me.length===0)return;var oe=re.children[me.length-1];rt(oe,"display","inline-block");var we=Ce.getMenuItemNodes(),ve=we.filter(function(ke){return ke.className.split(" ").indexOf(Pe)>=0});ve.forEach(function(ke){rt(ke,"display","inline-block")}),Ce.menuItemSizes=we.map(function(ke){return it(ke,!0)}),ve.forEach(function(ke){rt(ke,"display","none")}),Ce.overflowedIndicatorWidth=it(re.children[re.children.length-1],!0),Ce.originalTotalWidth=Ce.menuItemSizes.reduce(function(ke,Ie){return ke+Ie},0),Ce.handleResize(),rt(oe,"display","none")},Ce.handleResize=function(){if(Ce.props.mode!=="horizontal")return;var re=Ce.childRef.current;if(!re)return;var me=it(re);Ce.overflowedItems=[];var oe=0,we;Ce.originalTotalWidth>me+Yt&&(we=-1,Ce.menuItemSizes.forEach(function(ve){oe+=ve,oe+Ce.overflowedIndicatorWidth<=me&&(we+=1)})),Ce.setState({lastVisibleIndex:we})},Ce}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){var re=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var me=this.childRef.current;if(!me)return;this.resizeObserver=new gt.default(function(oe){oe.forEach(function(){var we=re.cancelFrameId;cancelAnimationFrame(we),re.cancelFrameId=requestAnimationFrame(re.setChildrenWidthAndResize)})}),[].slice.call(me.children).concat(me).forEach(function(oe){re.resizeObserver.observe(oe)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){re.resizeObserver.disconnect(),[].slice.call(me.children).concat(me).forEach(function(oe){re.resizeObserver.observe(oe)}),re.setChildrenWidthAndResize()}),this.mutationObserver.observe(me,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(re){var me=this,oe=this.state.lastVisibleIndex;return(re||[]).reduce(function(we,ve,ke){var Ie=ve;if(me.props.mode==="horizontal"){var je=me.getOverflowedSubMenuItem(ve.props.eventKey,[]);oe!==void 0&&me.props.className.indexOf("".concat(me.props.prefixCls,"-root"))!==-1&&(ke>oe&&(Ie=I.cloneElement(ve,{style:{display:"none"},eventKey:"".concat(ve.props.eventKey,"-hidden"),className:"".concat(Pe)})),ke===oe+1&&(me.overflowedItems=re.slice(oe+1).map(function(mt){return I.cloneElement(mt,{key:mt.props.eventKey,mode:"vertical-left"})}),je=me.getOverflowedSubMenuItem(ve.props.eventKey,me.overflowedItems)));var Ze=[].concat(Object(P.a)(we),[je,Ie]);return ke===re.length-1&&Ze.push(me.getOverflowedSubMenuItem(ve.props.eventKey,[],!0)),Ze}return[].concat(Object(P.a)(we),[Ie])},[])}},{key:"render",value:function(){var re=this.props,me=re.visible,oe=re.prefixCls,we=re.overflowedIndicator,ve=re.mode,ke=re.level,Ie=re.tag,je=re.children,Ze=re.theme,mt=Object(M.a)(re,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),bt=Ie;return I.createElement(bt,Object(T.a)({ref:this.childRef},mt),this.renderChildren(je))}}]),Me}(I.Component);xn.defaultProps={tag:"div",className:""};var pi=xn;function On(ye){return ye.length?ye.every(function(Oe){return!!Oe.props.disabled}):!0}function tr(ye,Oe,Me){var Ce=ye.getState();ye.setState({activeKey:Object(V.a)(Object(V.a)({},Ce.activeKey),{},Object(de.a)({},Oe,Me))})}function nr(ye){return ye.eventKey||"0-menu-"}function Fi(ye,Oe){var Me=Oe,Ce=ye.children,re=ye.eventKey;if(Me){var me;if(Be(Ce,function(oe,we){oe&&oe.props&&!oe.props.disabled&&Me===He(oe,re,we)&&(me=!0)}),me)return Me}return Me=null,ye.defaultActiveFirst&&Be(Ce,function(oe,we){!Me&&oe&&!oe.props.disabled&&(Me=He(oe,re,we))}),Me}function Bn(ye){if(!ye)return;var Oe=this.instanceArray.indexOf(ye);Oe!==-1?this.instanceArray[Oe]=ye:this.instanceArray.push(ye)}var Ft=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(Ce){var re;return Object(A.a)(this,Me),re=Oe.call(this,Ce),re.onKeyDown=function(me,oe){var we=me.keyCode,ve;if(re.getFlatInstanceArray().forEach(function(Ie){Ie&&Ie.props.active&&Ie.onKeyDown&&(ve=Ie.onKeyDown(me))}),ve)return 1;var ke=null;return(we===d.a.UP||we===d.a.DOWN)&&(ke=re.step(we===d.a.UP?-1:1)),ke?(me.preventDefault(),tr(re.props.store,nr(re.props),ke.props.eventKey),typeof oe=="function"&&oe(ke),1):void 0},re.onItemHover=function(me){var oe=me.key,we=me.hover;tr(re.props.store,nr(re.props),we?oe:null)},re.onDeselect=function(me){re.props.onDeselect(me)},re.onSelect=function(me){re.props.onSelect(me)},re.onClick=function(me){re.props.onClick(me)},re.onOpenChange=function(me){re.props.onOpenChange(me)},re.onDestroy=function(me){re.props.onDestroy(me)},re.getFlatInstanceArray=function(){return re.instanceArray},re.step=function(me){var oe=re.getFlatInstanceArray(),we=re.props.store.getState().activeKey[nr(re.props)],ve=oe.length;if(!ve)return null;me<0&&(oe=oe.concat().reverse());var ke=-1;if(oe.every(function(mt,bt){return mt&&mt.props.eventKey===we?(ke=bt,!1):!0}),!re.props.defaultActiveFirst&&ke!==-1&&On(oe.slice(ke,ve-1)))return;var Ie=(ke+1)%ve,je=Ie;do{var Ze=oe[je];if(!Ze||Ze.props.disabled)je=(je+1)%ve;else return Ze}while(je!==Ie);return null},re.renderCommonMenuItem=function(me,oe,we){var ve=re.props.store.getState(),ke=Object(m.a)(re),Ie=ke.props,je=He(me,Ie.eventKey,oe),Ze=me.props;if(!Ze||typeof me.type=="string")return me;var mt=je===ve.activeKey,bt=Object(V.a)(Object(V.a)({mode:Ze.mode||Ie.mode,level:Ie.level,inlineIndent:Ie.inlineIndent,renderMenuItem:re.renderMenuItem,rootPrefixCls:Ie.prefixCls,index:oe,parentMenu:Ie.parentMenu,manualRef:Ze.disabled?void 0:Object(g.a)(me.ref,Bn.bind(Object(m.a)(re))),eventKey:je,active:!Ze.disabled&&mt,multiple:Ie.multiple,onClick:function(Rn){(Ze.onClick||Ue)(Rn),re.onClick(Rn)},onItemHover:re.onItemHover,motion:Ie.motion,subMenuOpenDelay:Ie.subMenuOpenDelay,subMenuCloseDelay:Ie.subMenuCloseDelay,forceSubMenuRender:Ie.forceSubMenuRender,onOpenChange:re.onOpenChange,onDeselect:re.onDeselect,onSelect:re.onSelect,builtinPlacements:Ie.builtinPlacements,itemIcon:Ze.itemIcon||re.props.itemIcon,expandIcon:Ze.expandIcon||re.props.expandIcon},we),{},{direction:Ie.direction});return(Ie.mode==="inline"||qe())&&(bt.triggerSubMenuAction="click"),I.cloneElement(me,Object(V.a)(Object(V.a)({},bt),{},{key:je||oe}))},re.renderMenuItem=function(me,oe,we){if(!me)return null;var ve=re.props.store.getState(),ke={openKeys:ve.openKeys,selectedKeys:ve.selectedKeys,triggerSubMenuAction:re.props.triggerSubMenuAction,subMenuKey:we};return re.renderCommonMenuItem(me,oe,ke)},Ce.store.setState({activeKey:Object(V.a)(Object(V.a)({},Ce.store.getState().activeKey),{},Object(de.a)({},Ce.eventKey,Fi(Ce,Ce.activeKey)))}),re.instanceArray=[],re}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(re){return this.props.visible||re.visible||this.props.className!==re.className||!N()(this.props.style,re.style)}},{key:"componentDidUpdate",value:function(re){var me=this.props,oe="activeKey"in me?me.activeKey:me.store.getState().activeKey[nr(me)],we=Fi(me,oe);if(we!==oe)tr(me.store,nr(me),we);else if("activeKey"in re){var ve=Fi(re,re.activeKey);we!==ve&&tr(me.store,nr(me),we)}}},{key:"render",value:function(){var re=this,me=Object(T.a)({},this.props);this.instanceArray=[];var oe=K()(me.prefixCls,me.className,"".concat(me.prefixCls,"-").concat(me.mode)),we={className:oe,role:me.role||"menu"};me.id&&(we.id=me.id),me.focusable&&(we.tabIndex=0,we.onKeyDown=this.onKeyDown);var ve=me.prefixCls,ke=me.eventKey,Ie=me.visible,je=me.level,Ze=me.mode,mt=me.overflowedIndicator,bt=me.theme;return tt.forEach(function(Ut){return delete me[Ut]}),delete me.onClick,I.createElement(pi,Object(T.a)({},me,{prefixCls:ve,mode:Ze,tag:"ul",level:je,theme:bt,visible:Ie,overflowedIndicator:mt},we),Object(W.a)(me.children).map(function(Ut,Rn){return re.renderMenuItem(Ut,Rn,ke||"0-menu-")}))}}]),Me}(I.Component);Ft.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ue};var yi=Object(o.b)()(Ft),li=yi,$n=G("Kwbf");function ir(ye,Oe,Me){var Ce=ye.prefixCls,re=ye.motion,me=ye.defaultMotions,oe=me===void 0?{}:me,we=ye.openAnimation,ve=ye.openTransitionName,ke=Oe.switchingModeFromInline;if(re)return re;if(Object(U.a)(we)==="object"&&we)Object($n.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof we=="string")return{motionName:"".concat(Ce,"-open-").concat(we)};if(ve)return{motionName:ve};var Ie=oe[Me];return Ie||(ke?null:oe.other)}var Qt=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(Ce){var re;Object(A.a)(this,Me),re=Oe.call(this,Ce),re.onSelect=function(we){var ve=Object(m.a)(re),ke=ve.props;if(ke.selectable){var Ie=re.store.getState(),je=Ie.selectedKeys,Ze=we.key;ke.multiple?je=je.concat([Ze]):je=[Ze],"selectedKeys"in ke||re.store.setState({selectedKeys:je}),ke.onSelect(Object(V.a)(Object(V.a)({},we),{},{selectedKeys:je}))}},re.onClick=function(we){var ve=re.getRealMenuMode(),ke=Object(m.a)(re),Ie=ke.store,je=ke.props.onOpenChange;ve!=="inline"&&!("openKeys"in re.props)&&(Ie.setState({openKeys:[]}),je([])),re.props.onClick(we)},re.onKeyDown=function(we,ve){re.innerMenu.getWrappedInstance().onKeyDown(we,ve)},re.onOpenChange=function(we){var ve=Object(m.a)(re),ke=ve.props,Ie=re.store.getState().openKeys.concat(),je=!1,Ze=function(bt){var Ut=!1;if(bt.open)Ut=Ie.indexOf(bt.key)===-1,Ut&&Ie.push(bt.key);else{var Rn=Ie.indexOf(bt.key);Ut=Rn!==-1,Ut&&Ie.splice(Rn,1)}je=je||Ut};Array.isArray(we)?we.forEach(Ze):Ze(we),je&&("openKeys"in re.props||re.store.setState({openKeys:Ie}),ke.onOpenChange(Ie))},re.onDeselect=function(we){var ve=Object(m.a)(re),ke=ve.props;if(ke.selectable){var Ie=re.store.getState().selectedKeys.concat(),je=we.key,Ze=Ie.indexOf(je);Ze!==-1&&Ie.splice(Ze,1),"selectedKeys"in ke||re.store.setState({selectedKeys:Ie}),ke.onDeselect(Object(V.a)(Object(V.a)({},we),{},{selectedKeys:Ie}))}},re.onMouseEnter=function(we){re.restoreModeVerticalFromInline();var ve=re.props.onMouseEnter;ve&&ve(we)},re.onTransitionEnd=function(we){var ve=we.propertyName==="width"&&we.target===we.currentTarget,ke=we.target.className,Ie=Object.prototype.toString.call(ke)==="[object SVGAnimatedString]"?ke.animVal:ke,je=we.propertyName==="font-size"&&Ie.indexOf("anticon")>=0;(ve||je)&&re.restoreModeVerticalFromInline()},re.setInnerMenu=function(we){re.innerMenu=we},re.isRootMenu=!0;var me=Ce.defaultSelectedKeys,oe=Ce.defaultOpenKeys;return"selectedKeys"in Ce&&(me=Ce.selectedKeys||[]),"openKeys"in Ce&&(oe=Ce.openKeys||[]),re.store=Object(o.c)({selectedKeys:me,openKeys:oe,activeKey:{"0-menu-":Fi(Ce,Ce.activeKey)}}),re.state={switchingModeFromInline:!1,prevProps:Ce,inlineOpenKeys:[],store:re.store},re}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(re){var me=this.props,oe=me.siderCollapsed,we=me.inlineCollapsed,ve=me.onOpenChange;(!re.inlineCollapsed&&we||!re.siderCollapsed&&oe)&&ve([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var re=this.props.collapsedWidth,me=this.store,oe=this.prevOpenKeys,we=this.getInlineCollapsed()&&(re===0||re==="0"||re==="0px");we?(this.prevOpenKeys=me.getState().openKeys.concat(),this.store.setState({openKeys:[]})):oe&&(this.store.setState({openKeys:oe}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var re=this.props.mode,me=this.state.switchingModeFromInline,oe=this.getInlineCollapsed();return me&&oe?"inline":oe?"vertical":re}},{key:"getInlineCollapsed",value:function(){var re=this.props,me=re.inlineCollapsed,oe=re.siderCollapsed;return oe!==void 0?oe:me}},{key:"restoreModeVerticalFromInline",value:function(){var re=this.state.switchingModeFromInline;re&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var re=Object(V.a)({},Object(E.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),me=this.getRealMenuMode();return re.className+=" ".concat(re.prefixCls,"-root"),re.direction==="rtl"&&(re.className+=" ".concat(re.prefixCls,"-rtl")),re=Object(V.a)(Object(V.a)({},re),{},{mode:me,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ir(this.props,this.state,me)}),delete re.openAnimation,delete re.openTransitionName,I.createElement(o.a,{store:this.store},I.createElement(li,Object(T.a)({},re,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(re,me){var oe=me.prevProps,we=me.store,ve=we.getState(),ke={},Ie={prevProps:re};return oe.mode==="inline"&&re.mode!=="inline"&&(Ie.switchingModeFromInline=!0),"openKeys"in re?ke.openKeys=re.openKeys||[]:((re.inlineCollapsed&&!oe.inlineCollapsed||re.siderCollapsed&&!oe.siderCollapsed)&&(Ie.switchingModeFromInline=!0,Ie.inlineOpenKeys=ve.openKeys,ke.openKeys=[]),(!re.inlineCollapsed&&oe.inlineCollapsed||!re.siderCollapsed&&oe.siderCollapsed)&&(ke.openKeys=me.inlineOpenKeys,Ie.inlineOpenKeys=[])),Object.keys(ke).length&&we.setState(ke),Ie}}]),Me}(I.Component);Qt.defaultProps={selectable:!0,onClick:Ue,onSelect:Ue,onOpenChange:Ue,onDeselect:Ue,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 qt=Qt,$t=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){var Ce;return Object(A.a)(this,Me),Ce=Oe.apply(this,arguments),Ce.onKeyDown=function(re){var me=re.keyCode;return me===d.a.ENTER?(Ce.onClick(re),!0):void 0},Ce.onMouseLeave=function(re){var me=Ce.props,oe=me.eventKey,we=me.onItemHover,ve=me.onMouseLeave;we({key:oe,hover:!1}),ve({key:oe,domEvent:re})},Ce.onMouseEnter=function(re){var me=Ce.props,oe=me.eventKey,we=me.onItemHover,ve=me.onMouseEnter;we({key:oe,hover:!0}),ve({key:oe,domEvent:re})},Ce.onClick=function(re){var me=Ce.props,oe=me.eventKey,we=me.multiple,ve=me.onClick,ke=me.onSelect,Ie=me.onDeselect,je=me.isSelected,Ze={key:oe,keyPath:[oe],item:Object(m.a)(Ce),domEvent:re};ve(Ze),we?je?Ie(Ze):ke(Ze):je||ke(Ze)},Ce.saveNode=function(re){Ce.node=re},Ce}return Object(w.a)(Me,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var re=this.props;re.onDestroy&&re.onDestroy(re.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var re,me=Object(V.a)({},this.props),oe=K()(this.getPrefixCls(),me.className,(re={},Object(de.a)(re,this.getActiveClassName(),!me.disabled&&me.active),Object(de.a)(re,this.getSelectedClassName(),me.isSelected),Object(de.a)(re,this.getDisabledClassName(),me.disabled),re)),we=Object(V.a)(Object(V.a)({},me.attribute),{},{title:typeof me.title=="string"?me.title:void 0,className:oe,role:me.role||"menuitem","aria-disabled":me.disabled});me.role==="option"?we=Object(V.a)(Object(V.a)({},we),{},{role:"option","aria-selected":me.isSelected}):(me.role===null||me.role==="none")&&(we.role="none");var ve={onClick:me.disabled?null:this.onClick,onMouseLeave:me.disabled?null:this.onMouseLeave,onMouseEnter:me.disabled?null:this.onMouseEnter},ke=Object(V.a)({},me.style);me.mode==="inline"&&(me.direction==="rtl"?ke.paddingRight=me.inlineIndent*me.level:ke.paddingLeft=me.inlineIndent*me.level),tt.forEach(function(je){return delete me[je]}),delete me.direction;var Ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Ie=I.createElement(this.props.itemIcon,this.props)),I.createElement("li",Object(T.a)({},Object(E.a)(me,["onClick","onMouseEnter","onMouseLeave","onSelect"]),we,ve,{style:ke,ref:this.saveNode}),me.children,Ie)}}]),Me}(I.Component);$t.isMenuItem=!0,$t.defaultProps={onSelect:Ue,onMouseEnter:Ue,onMouseLeave:Ue,manualRef:Ue};var dn=Object(o.b)(function(ye,Oe){var Me=ye.activeKey,Ce=ye.selectedKeys,re=Oe.eventKey,me=Oe.subMenuKey;return{active:Me[me]===re,isSelected:Array.isArray(Ce)?Ce.indexOf(re)!==-1:Ce===re}})($t),Gn=dn,Mn=function(ye){Object(v.a)(Me,ye);var Oe=Object(s.a)(Me);function Me(){var Ce;return Object(A.a)(this,Me),Ce=Oe.apply(this,arguments),Ce.renderInnerMenuItem=function(re){var me=Ce.props,oe=me.renderMenuItem,we=me.index;return oe(re,we,Ce.props.subMenuKey)},Ce}return Object(w.a)(Me,[{key:"render",value:function(){var re=Object(T.a)({},this.props),me=re.className,oe=me===void 0?"":me,we=re.rootPrefixCls,ve="".concat(we,"-item-group-title"),ke="".concat(we,"-item-group-list"),Ie=re.title,je=re.children;return tt.forEach(function(Ze){return delete re[Ze]}),delete re.direction,I.createElement("li",Object(T.a)({},re,{onClick:function(mt){return mt.stopPropagation()},className:"".concat(oe," ").concat(we,"-item-group")}),I.createElement("div",{className:ve,title:typeof Ie=="string"?Ie:void 0},Ie),I.createElement("ul",{className:ke},I.Children.map(je,this.renderInnerMenuItem)))}}]),Me}(I.Component);Mn.isMenuItemGroup=!0,Mn.defaultProps={disabled:!0};var qn=Mn,mi=function(Oe){var Me=Oe.className,Ce=Oe.rootPrefixCls,re=Oe.style;return I.createElement("li",{className:"".concat(Me," ").concat(Ce,"-item-divider"),style:re})};mi.defaultProps={disabled:!0,className:"",style:{}};var Tr=mi,Zn=qt,$r=G("eDIo");function gi(ye,Oe){var Me=ye.prefixCls,Ce=ye.editable,re=ye.locale,me=ye.style;return!Ce||Ce.showAdd===!1?null:I.createElement("button",{ref:Oe,type:"button",className:"".concat(Me,"-nav-add"),style:me,"aria-label":(re==null?void 0:re.addAriaLabel)||"Add tab",onClick:function(we){Ce.onEdit("add",{event:we})}},Ce.addIcon||"+")}var fr=I.forwardRef(gi);function rr(ye,Oe){var Me=ye.prefixCls,Ce=ye.id,re=ye.tabs,me=ye.locale,oe=ye.mobile,we=ye.moreIcon,ve=we===void 0?"More":we,ke=ye.moreTransitionName,Ie=ye.style,je=ye.className,Ze=ye.editable,mt=ye.tabBarGutter,bt=ye.rtl,Ut=ye.onTabClick,Rn=Object(I.useState)(!1),Qn=Object(Z.a)(Rn,2),jn=Qn[0],Vn=Qn[1],Yn=Object(I.useState)(null),Xn=Object(Z.a)(Yn,2),Wn=Xn[0],Jn=Xn[1],ei="".concat(Ce,"-more-popup"),ki="".concat(Me,"-dropdown"),ti=Wn!==null?"".concat(ei,"-").concat(Wn):null,gn=me==null?void 0:me.dropdownAriaLabel,fn=I.createElement(Zn,{onClick:function(wi){var bi=wi.key,Hi=wi.domEvent;Ut(bi,Hi),Vn(!1)},id:ei,tabIndex:-1,role:"listbox","aria-activedescendant":ti,selectedKeys:[Wn],"aria-label":gn!==void 0?gn:"expanded dropdown"},re.map(function(ri){return I.createElement(Gn,{key:ri.key,id:"".concat(ei,"-").concat(ri.key),role:"option","aria-controls":Ce&&"".concat(Ce,"-panel-").concat(ri.key),disabled:ri.disabled},ri.tab)}));function Hn(ri){for(var wi=re.filter(function(vr){return!vr.disabled}),bi=wi.findIndex(function(vr){return vr.key===Wn})||0,Hi=wi.length,Gi=0;Gici?(ui=fn,ei.current="x"):(ui=Hn,ei.current="y");var Mi=Date.now();Mi-Wn.current>100&&(Jn.current=!1),(Oe(-ui,-ui)||Jn.current)&&(gn.preventDefault(),Jn.current=!0),Wn.current=Mi}var ti=Object(I.useRef)(null);ti.current={onTouchStart:Vn,onTouchMove:Yn,onTouchEnd:Xn,onWheel:ki},I.useEffect(function(){function gn(an){ti.current.onTouchStart(an)}function fn(an){ti.current.onTouchMove(an)}function Hn(an){ti.current.onTouchEnd(an)}function ui(an){ti.current.onWheel(an)}return document.addEventListener("touchmove",fn,{passive:!1}),document.addEventListener("touchend",Hn,{passive:!1}),ye.current.addEventListener("touchstart",gn,{passive:!1}),ye.current.addEventListener("wheel",ui),function(){document.removeEventListener("touchmove",fn),document.removeEventListener("touchend",Hn)}},[])}function _a(){var ye=Object(I.useRef)(new Map);function Oe(Ce){return ye.current.has(Ce)||ye.current.set(Ce,I.createRef()),ye.current.get(Ce)}function Me(Ce){ye.current.delete(Ce)}return[Oe,Me]}function Qa(ye,Oe){var Me=I.useRef(ye),Ce=I.useState({}),re=Object(Z.a)(Ce,2),me=re[1];function oe(we){var ve=typeof we=="function"?we(Me.current):we;ve!==Me.current&&Oe(ve,Me.current),Me.current=ve,me({})}return[Me.current,oe]}var co=function(Oe){var Me=Oe.position,Ce=Oe.prefixCls,re=Oe.extra;if(!re)return null;var me,oe=re;return Me==="right"&&(me=oe.right||!oe.left&&oe||null),Me==="left"&&(me=oe.left||null),me?I.createElement("div",{className:"".concat(Ce,"-extra-content")},me):null};function Ma(ye,Oe){var Me,Ce=I.useContext(ka),re=Ce.prefixCls,me=Ce.tabs,oe=ye.className,we=ye.style,ve=ye.id,ke=ye.animated,Ie=ye.activeKey,je=ye.rtl,Ze=ye.extra,mt=ye.editable,bt=ye.locale,Ut=ye.tabPosition,Rn=ye.tabBarGutter,Qn=ye.children,jn=ye.onTabClick,Vn=ye.onTabScroll,Yn=Object(I.useRef)(),Xn=Object(I.useRef)(),Wn=Object(I.useRef)(),Jn=Object(I.useRef)(),ei=_a(),ki=Object(Z.a)(ei,2),ti=ki[0],gn=ki[1],fn=Ut==="top"||Ut==="bottom",Hn=Qa(0,function(_i,oi){fn&&Vn&&Vn({direction:_i>oi?"left":"right"})}),ui=Object(Z.a)(Hn,2),an=ui[0],ci=ui[1],Mi=Qa(0,function(_i,oi){!fn&&Vn&&Vn({direction:_i>oi?"top":"bottom"})}),ri=Object(Z.a)(Mi,2),wi=ri[0],bi=ri[1],Hi=Object(I.useState)(0),Gi=Object(Z.a)(Hi,2),Bi=Gi[0],vr=Gi[1],Lr=Object(I.useState)(0),Cr=Object(Z.a)(Lr,2),Vi=Cr[0],Di=Cr[1],Ei=Object(I.useState)(0),Tn=Object(Z.a)(Ei,2),xi=Tn[0],Nr=Tn[1],Zr=Object(I.useState)(0),ra=Object(Z.a)(Zr,2),Ti=ra[0],Vr=ra[1],Jr=Object(I.useState)(null),Oi=Object(Z.a)(Jr,2),vi=Oi[0],ji=Oi[1],Ua=Object(I.useState)(null),Za=Object(Z.a)(Ua,2),ca=Za[0],Ea=Za[1],$i=Object(I.useState)(0),Xr=Object(Z.a)($i,2),Ba=Xr[0],Po=Xr[1],Io=Object(I.useState)(0),mo=Object(Z.a)(Io,2),Ja=mo[0],qa=mo[1],da=r(new Map),xa=Object(Z.a)(da,2),go=xa[0],ja=xa[1],Ta=c(me,go,Bi),ha="".concat(re,"-nav-operations-hidden"),Pi=0,Dr=0;fn?je?(Pi=0,Dr=Math.max(0,Bi-vi)):(Pi=Math.min(0,vi-Bi),Dr=0):(Pi=Math.min(0,ca-Vi),Dr=0);function fa(_i){return _iDr?[Dr,!1]:[_i,!0]}var aa=Object(I.useRef)(),Sa=Object(I.useState)(),pa=Object(Z.a)(Sa,2),Fa=pa[0],eo=pa[1];function Wa(){eo(Date.now())}function to(){window.clearTimeout(aa.current)}va(Yn,function(_i,oi){var lr=!1;function _r(sa,ea){sa(function(Ra){var la=fa(Ra+ea),ar=Object(Z.a)(la,2),La=ar[0],et=ar[1];return lr=et,La})}if(fn){if(vi>=Bi)return lr;_r(ci,_i)}else{if(ca>=Vi)return lr;_r(bi,oi)}return to(),Wa(),lr}),Object(I.useEffect)(function(){return to(),Fa&&(aa.current=window.setTimeout(function(){eo(0)},100)),to},[Fa]);function qr(){var _i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ie,oi=Ta.get(_i);if(!oi)return;if(fn){var lr=an;je?oi.rightan+vi&&(lr=oi.right+oi.width-vi):oi.left<-an?lr=-oi.left:oi.left+oi.width>-an+vi&&(lr=-(oi.left+oi.width-vi)),bi(0),ci(fa(lr)[0])}else{var _r=wi;oi.top<-wi?_r=-oi.top:oi.top+oi.height>-wi+ca&&(_r=-(oi.top+oi.height-ca)),ci(0),bi(fa(_r)[0])}}var oa=O(Ta,{width:vi,height:ca,left:an,top:wi},{width:xi,height:Ti},{width:Ba,height:Ja},Object(V.a)(Object(V.a)({},ye),{},{tabs:me})),no=Object(Z.a)(oa,2),io=no[0],ko=no[1],Mo=me.map(function(_i){var oi=_i.key;return I.createElement(a,{id:ve,prefixCls:re,key:oi,rtl:je,tab:_i,closable:_i.closable,editable:mt,active:oi===Ie,tabPosition:Ut,tabBarGutter:Rn,renderWrapper:Qn,removeAriaLabel:bt==null?void 0:bt.removeAriaLabel,ref:ti(oi),onClick:function(_r){jn(oi,_r)},onRemove:function(){gn(oi)},onFocus:function(){qr(oi),Wa(),je||(Yn.current.scrollLeft=0),Yn.current.scrollTop=0}})}),ro=h(function(){var _i,oi,lr,_r,sa,ea,Ra,la,ar,La=((_i=Yn.current)===null||_i===void 0?void 0:_i.offsetWidth)||0,et=((oi=Yn.current)===null||oi===void 0?void 0:oi.offsetHeight)||0,Qe=((lr=Jn.current)===null||lr===void 0?void 0:lr.offsetWidth)||0,Ge=((_r=Jn.current)===null||_r===void 0?void 0:_r.offsetHeight)||0,nt=((sa=Wn.current)===null||sa===void 0?void 0:sa.offsetWidth)||0,ot=((ea=Wn.current)===null||ea===void 0?void 0:ea.offsetHeight)||0;ji(La),Ea(et),Po(Qe),qa(Ge);var At=(((Ra=Xn.current)===null||Ra===void 0?void 0:Ra.offsetWidth)||0)-Qe,wt=(((la=Xn.current)===null||la===void 0?void 0:la.offsetHeight)||0)-Ge;vr(At),Di(wt);var Et=(ar=Wn.current)===null||ar===void 0?void 0:ar.className.includes(ha);Nr(At-(Et?0:nt)),Vr(wt-(Et?0:ot)),ja(function(){var ln=new Map;return me.forEach(function(ni){var Sr=ni.key,Kn=ti(Sr).current;Kn&&ln.set(Sr,{width:Kn.offsetWidth,height:Kn.offsetHeight,left:Kn.offsetLeft,top:Kn.offsetTop})}),ln})}),No=me.slice(0,io),Zi=me.slice(ko+1),Xi=[].concat(Object(P.a)(No),Object(P.a)(Zi)),pr=Object(I.useState)(),Yi=Object(Z.a)(pr,2),Aa=Yi[0],Ha=Yi[1],Pr=Ta.get(Ie),ao=Object(I.useRef)();function Ka(){p.a.cancel(ao.current)}Object(I.useEffect)(function(){var _i={};return Pr&&(fn?(je?_i.right=Pr.right:_i.left=Pr.left,_i.width=Pr.width):(_i.top=Pr.top,_i.height=Pr.height)),Ka(),ao.current=p()(function(){Ha(_i)}),Ka},[Pr,fn,je]),Object(I.useEffect)(function(){qr()},[Ie,Pr,Ta,fn]),Object(I.useEffect)(function(){ro()},[je,Rn,Ie,me.map(function(_i){return _i.key}).join("_")]);var vo=!!Xi.length,ma="".concat(re,"-nav-wrap"),za,Oa,_o,Ga;return fn?je?(Oa=an>0,za=an+vi` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,d=/^\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]/,a=" ";function u(y,x,F){return x.f=x.inline=F,F(y,x)}function c(y,x,F){return x.f=x.block=F,F(y,x)}function R(y){return!y||!/\S/.test(y.string)}function O(y){if(y.linkTitle=!1,y.linkHref=!1,y.linkText=!1,y.em=!1,y.strong=!1,y.strikethrough=!1,y.quote=0,y.indentedCode=!1,y.f==A){var x=I;if(!x){var F=de.innerMode(V,y.htmlState);x=F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText}x&&(y.f=s,y.block=T,y.htmlState=null)}return y.trailingSpace=0,y.trailingSpaceNewLine=!1,y.prevLine=y.thisLine,y.thisLine={stream:null},null}function T(y,x){var F=y.column()===x.indentation,Q=R(x.prevLine.stream),q=x.indentedCode,ie=x.prevLine.hr,ge=x.list!==!1,fe=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var ue=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,ge)){for(x.list=null;ue=4&&(q||x.prevLine.fencedCodeEnd||x.prevLine.header||Q))return y.skipToEnd(),x.indentedCode=!0,K.code;if(y.eatSpace())return null;if(F&&x.indentation<=fe&&(le=y.match(p))&&le[1].length<=6)return x.quote=0,x.header=le[1].length,x.thisLine.header=!0,M.highlightFormatting&&(x.formatting="header"),x.f=x.inline,m(x);if(x.indentation<=fe&&y.eat(">"))return x.quote=F?1:x.quote+1,M.highlightFormatting&&(x.formatting="quote"),y.eatSpace(),m(x);if(!_e&&!x.setext&&F&&x.indentation<=fe&&(le=y.match(P))){var ne=le[1]?"ol":"ul";return x.indentation=ue+y.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,M.taskLists&&y.match(b,!1)&&(x.taskList=!0),x.f=x.inline,M.highlightFormatting&&(x.formatting=["list","list-"+ne]),m(x)}else{if(F&&x.indentation<=fe&&(le=y.match(r,!0)))return x.quote=0,x.fencedEndRE=new RegExp(le[1]+"+ *$"),x.localMode=M.fencedCodeBlockHighlighting&&B(le[2]||M.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=de.startState(x.localMode)),x.f=x.block=w,M.highlightFormatting&&(x.formatting="code-block"),x.code=-1,m(x);if(x.setext||(!he||!ge)&&!x.quote&&x.list===!1&&!x.code&&!_e&&!d.test(y.string)&&(le=y.lookAhead(1))&&(le=le.match(_)))return x.setext?(x.header=x.setext,x.setext=0,y.skipToEnd(),M.highlightFormatting&&(x.formatting="header")):(x.header=le[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,m(x);if(_e)return y.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,K.hr;if(y.peek()==="[")return u(y,x,N)}return u(y,x,x.inline)}function A(y,x){var F=V.token(y,x.htmlState);if(!I){var Q=de.innerMode(V,x.htmlState);(Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText||x.md_inside&&y.current().indexOf(">")>-1)&&(x.f=s,x.block=T,x.htmlState=null)}return F}function w(y,x){var F=x.listStack[x.listStack.length-1]||0,Q=x.indentation=y.quote?x.push(K.formatting+"-"+y.formatting[F]+"-"+y.quote):x.push("error"))}if(y.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(y.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(y.linkHref?x.push(K.linkHref,"url"):(y.strong&&x.push(K.strong),y.em&&x.push(K.em),y.strikethrough&&x.push(K.strikethrough),y.emoji&&x.push(K.emoji),y.linkText&&x.push(K.linkText),y.code&&x.push(K.code),y.image&&x.push(K.image),y.imageAltText&&x.push(K.imageAltText,"link"),y.imageMarker&&x.push(K.imageMarker)),y.header&&x.push(K.header,K.header+"-"+y.header),y.quote&&(x.push(K.quote),!M.maxBlockquoteDepth||M.maxBlockquoteDepth>=y.quote?x.push(K.quote+"-"+y.quote):x.push(K.quote+"-"+M.maxBlockquoteDepth)),y.list!==!1){var Q=(y.listStack.length-1)%3;Q?Q===1?x.push(K.list2):x.push(K.list3):x.push(K.list1)}return y.trailingSpaceNewLine?x.push("trailing-space-new-line"):y.trailingSpace&&x.push("trailing-space-"+(y.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function v(y,x){return y.match(h,!0)?m(x):void 0}function s(y,x){var F=x.text(y,x);if(typeof F!="undefined")return F;if(x.list)return x.list=null,m(x);if(x.taskList){var Q=y.match(b,!0)[1]===" ";return Q?x.taskOpen=!0:x.taskClosed=!0,M.highlightFormatting&&(x.formatting="task"),x.taskList=!1,m(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&y.match(/^#+$/,!0))return M.highlightFormatting&&(x.formatting="header"),m(x);var q=y.next();if(x.linkTitle){x.linkTitle=!1;var ie=q;q==="("&&(ie=")"),ie=(ie+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ge="^\\s*(?:[^"+ie+"\\\\]+|\\\\\\\\|\\\\.)"+ie;if(y.match(new RegExp(ge),!0))return K.linkHref}if(q==="`"){var fe=x.formatting;M.highlightFormatting&&(x.formatting="code"),y.eatWhile("`");var ue=y.current().length;if(x.code==0&&(!x.quote||ue==1))return x.code=ue,m(x);if(ue==x.code){var he=m(x);return x.code=0,he}else return x.formatting=fe,m(x)}else if(x.code)return m(x);if(q==="\\"&&(y.next(),M.highlightFormatting)){var _e=m(x),le=K.formatting+"-escape";return _e?_e+" "+le:le}if(q==="!"&&y.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,M.highlightFormatting&&(x.formatting="image"),m(x);if(q==="["&&x.imageMarker&&y.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,M.highlightFormatting&&(x.formatting="image"),m(x);if(q==="]"&&x.imageAltText){M.highlightFormatting&&(x.formatting="image");var _e=m(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=E,_e}if(q==="["&&!x.image)return x.linkText&&y.match(/^.*?\]/)||(x.linkText=!0,M.highlightFormatting&&(x.formatting="link")),m(x);if(q==="]"&&x.linkText){M.highlightFormatting&&(x.formatting="link");var _e=m(x);return x.linkText=!1,x.inline=x.f=y.match(/\(.*?\)| ?\[.*?\]/,!1)?E:s,_e}if(q==="<"&&y.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=o,M.highlightFormatting&&(x.formatting="link");var _e=m(x);return _e?_e+=" ":_e="",_e+K.linkInline}if(q==="<"&&y.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=o,M.highlightFormatting&&(x.formatting="link");var _e=m(x);return _e?_e+=" ":_e="",_e+K.linkEmail}if(M.xml&&q==="<"&&y.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ne=y.string.indexOf(">",y.pos);if(ne!=-1){var Te=y.string.substring(y.start,ne);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Te)&&(x.md_inside=!0)}return y.backUp(1),x.htmlState=de.startState(V),c(y,x,A)}if(M.xml&&q==="<"&&y.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(q==="*"||q==="_"){for(var Fe=1,Ke=y.pos==1?" ":y.string.charAt(y.pos-2);Fe<3&&y.eat(q);)Fe++;var Ue=y.peek()||" ",He=!/\s/.test(Ue)&&(!l.test(Ue)||/\s/.test(Ke)||l.test(Ke)),Ne=!/\s/.test(Ke)&&(!l.test(Ke)||/\s/.test(Ue)||l.test(Ue)),Be=null,Je=null;if(Fe%2&&(!x.em&&He&&(q==="*"||!Ne||l.test(Ke))?Be=!0:x.em==q&&Ne&&(q==="*"||!He||l.test(Ue))&&(Be=!1)),Fe>1&&(!x.strong&&He&&(q==="*"||!Ne||l.test(Ke))?Je=!0:x.strong==q&&Ne&&(q==="*"||!He||l.test(Ue))&&(Je=!1)),Je!=null||Be!=null){M.highlightFormatting&&(x.formatting=Be==null?"strong":Je==null?"em":"strong em"),Be===!0&&(x.em=q),Je===!0&&(x.strong=q);var he=m(x);return Be===!1&&(x.em=!1),Je===!1&&(x.strong=!1),he}}else if(q===" "&&(y.eat("*")||y.eat("_"))){if(y.peek()===" ")return m(x);y.backUp(1)}if(M.strikethrough){if(q==="~"&&y.eatWhile(q)){if(x.strikethrough){M.highlightFormatting&&(x.formatting="strikethrough");var he=m(x);return x.strikethrough=!1,he}else if(y.match(/^[^\s]/,!1))return x.strikethrough=!0,M.highlightFormatting&&(x.formatting="strikethrough"),m(x)}else if(q===" "&&y.match(/^~~/,!0)){if(y.peek()===" ")return m(x);y.backUp(2)}}if(M.emoji&&q===":"&&y.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,M.highlightFormatting&&(x.formatting="emoji");var tt=m(x);return x.emoji=!1,tt}return q===" "&&(y.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),m(x)}function o(y,x){var F=y.next();if(F===">"){x.f=x.inline=s,M.highlightFormatting&&(x.formatting="link");var Q=m(x);return Q?Q+=" ":Q="",Q+K.linkInline}return y.match(/^[^>]+/,!0),K.linkInline}function E(y,x){if(y.eatSpace())return null;var F=y.next();return F==="("||F==="["?(x.f=x.inline=C(F==="("?")":"]"),M.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,m(x)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(y){return function(x,F){var Q=x.next();if(Q===y){F.f=F.inline=s,M.highlightFormatting&&(F.formatting="link-string");var q=m(F);return F.linkHref=!1,q}return x.match(g[y]),F.linkHref=!0,m(F)}}function N(y,x){return y.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=U,y.next(),M.highlightFormatting&&(x.formatting="link"),x.linkText=!0,m(x)):u(y,x,s)}function U(y,x){if(y.match(/^\]:/,!0)){x.f=x.inline=j,M.highlightFormatting&&(x.formatting="link");var F=m(x);return x.linkText=!1,F}return y.match(/^([^\]\\]|\\.)+/,!0),K.linkText}function j(y,x){return y.eatSpace()?null:(y.match(/^[^\s]+/,!0),y.peek()===void 0?x.linkTitle=!0:y.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),x.f=x.inline=s,K.linkHref+" url")}var H={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:s,text:v,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(y){return{f:y.f,prevLine:y.prevLine,thisLine:y.thisLine,block:y.block,htmlState:y.htmlState&&de.copyState(V,y.htmlState),indentation:y.indentation,localMode:y.localMode,localState:y.localMode?de.copyState(y.localMode,y.localState):null,inline:y.inline,text:y.text,formatting:!1,linkText:y.linkText,linkTitle:y.linkTitle,linkHref:y.linkHref,code:y.code,em:y.em,strong:y.strong,strikethrough:y.strikethrough,emoji:y.emoji,header:y.header,setext:y.setext,hr:y.hr,taskList:y.taskList,list:y.list,listStack:y.listStack.slice(0),quote:y.quote,indentedCode:y.indentedCode,trailingSpace:y.trailingSpace,trailingSpaceNewLine:y.trailingSpaceNewLine,md_inside:y.md_inside,fencedEndRE:y.fencedEndRE}},token:function(y,x){if(x.formatting=!1,y!=x.thisLine.stream){if(x.header=0,x.hr=!1,y.match(/^\s*$/,!0))return O(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:y},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=A)){var F=y.match(/^\s*/,!0)[0].replace(/\t/g,a).length;if(x.indentation=F,x.indentationDiff=null,F>0)return null}}return x.f(y,x)},innerMode:function(y){return y.block==A?{state:y.htmlState,mode:V}:y.localState?{state:y.localState,mode:y.localMode}:{state:y,mode:H}},indent:function(y,x,F){return y.block==A&&V.indent?V.indent(y.htmlState,x,F):y.localState&&y.localMode.indent?y.localMode.indent(y.localState,x,F):de.Pass},blankLine:O,getType:m,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),de.defineMIME("text/markdown","markdown"),de.defineMIME("text/x-markdown","markdown")})},mgmH:function(ft,Xe,G){"use strict";G.d(Xe,"d",function(){return _}),G.d(Xe,"b",function(){return h}),G.d(Xe,"e",function(){return r}),G.d(Xe,"c",function(){return d}),G.d(Xe,"n",function(){return l}),G.d(Xe,"g",function(){return a}),G.d(Xe,"h",function(){return u}),G.d(Xe,"j",function(){return R}),G.d(Xe,"a",function(){return O}),G.d(Xe,"l",function(){return T}),G.d(Xe,"f",function(){return A}),G.d(Xe,"k",function(){return w}),G.d(Xe,"m",function(){return m}),G.d(Xe,"i",function(){return v}),G.d(Xe,"o",function(){return s}),G.d(Xe,"t",function(){return o}),G.d(Xe,"s",function(){return E}),G.d(Xe,"p",function(){return g}),G.d(Xe,"q",function(){return C}),G.d(Xe,"r",function(){return N}),G.d(Xe,"v",function(){return U}),G.d(Xe,"u",function(){return j});var de=G("miYZ"),Z=G("tsqr"),M=G("k1fw"),V=G("9og8"),I=G("WmNS"),B=G.n(I),K=G("oUNq"),W=G("9kvl"),L=G("1vsH"),P=G("m3rI"),b=function(){Object(W.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u751F\u6210\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u540E..."}})},p=function(){Object(W.c)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}})},_=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return b(),q.next=3,Object(K.t)(Object(M.a)({},x));case 3:if(F=q.sent,!(F.status===0)){q.next=7;break}return q.next=7,Object(L.w)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_couser_info.json"),query:x}));case 7:p();case 8:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),h=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.r)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_member_act_score")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),r=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.u)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_score")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),d=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.s)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),l=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.z)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_exercise_and_other")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),a=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.v)(Object(M.a)({},x));case 2:if(F=q.sent,!(F.status===0)){q.next=8;break}Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")),q.next=13;break;case 8:if(!(F.status===-2)){q.next=12;break}return q.abrupt("return",F);case 12:F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/course_total_homework")));case 13:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),u=function(){var H=Object(V.a)(B.a.mark(function y(x,F){var Q;return B.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(K.x)(Object(M.a)({},x));case 2:Q=ie.sent,Q.status===0?(Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(F))):Q.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/").concat(F)));case 4:case"end":return ie.stop()}},y)}));return function(x,F){return H.apply(this,arguments)}}(),c=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return b(),q.next=3,Object(K.w)(Object(M.a)({},x));case 3:if(F=q.sent,!(F.status===0)){q.next=7;break}return q.next=7,Object(L.w)("",Object(L.Y)({url:P.a.API_SERVER+"/api/homework_commons/".concat(x.categoryId,"/works_list.zip"),query:x}));case 7:p();case 8:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),R=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return b(),q.next=3,Object(K.A)(Object(M.a)({},x));case 3:if(F=q.sent,!(F.status===0)){q.next=7;break}return q.next=7,Object(L.w)("",Object(L.Y)({url:P.a.API_SERVER+"/api/polls/".concat(x.categoryId,"/commit_result.xlsx"),query:x}));case 7:p();case 8:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),O=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/attendances/export_xlsx_data.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),T=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/video_study_statics.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),A=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/".concat(x.coursesId,"/export_course_students_info.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),w=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/item_banks/export.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),m=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/competitions/region_reports.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),v=function(){var H=Object(V.a)(B.a.mark(function y(x){var F;return B.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:return q.next=2,Object(K.y)(Object(M.a)({},x));case 2:F=q.sent,F.status===0?(Z.b.info("\u5BFC\u51FA\u4EFB\u52A1\u751F\u6210\u6210\u529F"),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score"))):F.status===-3&&(Object(W.c)()._store.dispatch({type:"classroomList/setActionTabs",payload:{key:"\u5BFC\u51FA\u63D0\u9192"}}),W.d.push("/classrooms/".concat(x.coursesId,"/exportlist/exercise_score")));case 4:case"end":return q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),s=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return console.log("----------","\u8C03\u7528\u4E0B\u8F7D"),Q.next=3,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/export_records/".concat(x.id,".xlsx"),query:x}));case 3:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),o=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_major_schools/0/ec_years.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),E=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_training_objectives.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),g=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)(x==null?void 0:x.name,Object(L.Y)({url:P.a.API_SERVER+"/api/attachments/get_ecs_attachment.docx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),C=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_courses.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),N=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/ec_years/".concat(x==null?void 0:x.ec_year_id,"/ec_graduation_requirements.xlsx"),query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),U=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/rank_list.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}(),j=function(){var H=Object(V.a)(B.a.mark(function y(x){return B.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(L.v)("",Object(L.Y)({url:P.a.API_SERVER+"/api/courses/question_rank_list.xlsx",query:x}));case 2:case"end":return Q.stop()}},y)}));return function(x){return H.apply(this,arguments)}}()},nSDg:function(ft,Xe,G){ft.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"}},osHv:function(ft,Xe,G){(function(de){de(G("VrN/"))})(function(de){"use strict";var Z=de.Pos;function M(l,a){return l.line-a.line||l.ch-a.ch}var V="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=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",B=new RegExp("<(/?)(["+V+"]["+I+"]*)","g");function K(l,a,u,c){this.line=a,this.ch=u,this.cm=l,this.text=l.getLine(a),this.min=c?Math.max(c.from,l.firstLine()):l.firstLine(),this.max=c?Math.min(c.to-1,l.lastLine()):l.lastLine()}function W(l,a){var u=l.cm.getTokenTypeAt(Z(l.line,a));return u&&/\btag\b/.test(u)}function L(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function P(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function b(l){for(;;){var a=l.text.indexOf(">",l.ch);if(a==-1){if(L(l))continue;return}if(!W(l,a+1)){l.ch=a+1;continue}var u=l.text.lastIndexOf("/",a),c=u>-1&&!/\S/.test(l.text.slice(u+1,a));return l.ch=a+1,c?"selfClose":"regular"}}function p(l){for(;;){var a=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(a==-1){if(P(l))continue;return}if(!W(l,a+1)){l.ch=a;continue}B.lastIndex=a,l.ch=a;var u=B.exec(l.text);if(u&&u.index==a)return u}}function _(l){for(;;){B.lastIndex=l.ch;var a=B.exec(l.text);if(!a){if(L(l))continue;return}if(!W(l,a.index+1)){l.ch=a.index+1;continue}return l.ch=a.index+a[0].length,a}}function h(l){for(;;){var a=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(a==-1){if(P(l))continue;return}if(!W(l,a+1)){l.ch=a;continue}var u=l.text.lastIndexOf("/",a),c=u>-1&&!/\S/.test(l.text.slice(u+1,a));return l.ch=a+1,c?"selfClose":"regular"}}function r(l,a){for(var u=[];;){var c=_(l),R,O=l.line,T=l.ch-(c?c[0].length:0);if(!c||!(R=b(l)))return;if(R=="selfClose")continue;if(c[1]){for(var A=u.length-1;A>=0;--A)if(u[A]==c[2]){u.length=A;break}if(A<0&&(!a||a==c[2]))return{tag:c[2],from:Z(O,T),to:Z(l.line,l.ch)}}else u.push(c[2])}}function d(l,a){for(var u=[];;){var c=h(l);if(!c)return;if(c=="selfClose"){p(l);continue}var R=l.line,O=l.ch,T=p(l);if(!T)return;if(T[1])u.push(T[2]);else{for(var A=u.length-1;A>=0;--A)if(u[A]==T[2]){u.length=A;break}if(A<0&&(!a||a==T[2]))return{tag:T[2],from:Z(l.line,l.ch),to:Z(R,O)}}}}de.registerHelper("fold","xml",function(l,a){for(var u=new K(l,a.line,0);;){var c=_(u);if(!c||u.line!=a.line)return;var R=b(u);if(!R)return;if(!c[1]&&R!="selfClose"){var O=Z(u.line,u.ch),T=r(u,c[2]);return T&&M(T.from,O)>0?{from:O,to:T.from}:null}}}),de.findMatchingTag=function(l,a,u){var c=new K(l,a.line,a.ch,u);if(c.text.indexOf(">")==-1&&c.text.indexOf("<")==-1)return;var R=b(c),O=R&&Z(c.line,c.ch),T=R&&p(c);if(!R||!T||M(c,a)>0)return;var A={from:Z(c.line,c.ch),to:O,tag:T[2]};return R=="selfClose"?{open:A,close:null,at:"open"}:T[1]?{open:d(c,T[2]),close:A,at:"close"}:(c=new K(l,O.line,O.ch,u),{open:A,close:r(c,T[2]),at:"open"})},de.findEnclosingTag=function(l,a,u,c){for(var R=new K(l,a.line,a.ch,u);;){var O=d(R,c);if(!O)break;var T=new K(l,a.line,a.ch,u),A=r(T,O.tag);if(A)return{open:O,close:A}}},de.scanForClosingTag=function(l,a,u,c){var R=new K(l,a.line,a.ch,c?{from:0,to:c}:null);return r(R,u)}})},p5ED:function(ft,Xe,G){"use strict";var de=G("+L6B"),Z=G("2/Rp"),M=G("5Dmo"),V=G("3S7+"),I=G("k1fw"),B=G("tJVT"),K=G("q1tI"),W=G.n(K),L=G("vHTk"),P=G.n(L),b=G("yEEn"),p=G("ZW9T"),_=G("1vsH");Xe.a=function(h){var r=h.name,d=h.data,l=h.theme,a=h.type,u=h.filename,c=h.monacoEditor,R=h.className,O=h.style,T=h.close,A=h.onClose,w=h.hasMask,m=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),v=Object(B.a)(m,2),s=v[0],o=v[1],E=Object(K.useState)(""),g=Object(B.a)(E,2),C=g[0],N=g[1],U,j=1024*1024,H=10*j,y=Object(K.useRef)();a==="office"&&(U=Object(_.T)(d).filesize,U>H&&(a="other")),u&&(c.filename=u),Object(K.useEffect)(function(){var Q,q,ie=(Q=document.cookie)===null||Q===void 0||((q=Q.replace(/\s/g,""))===null||q===void 0)?void 0:q.split(";");ie==null||ie.map(function(ge){var fe=ge.split("=");fe[0]==="_educoder_session"&&N(fe[1])})},[]);var x=function(){if(d.startsWith("http")||d.startsWith("/")){F();return}Object(_.z)(u||"educoder",d,u)},F=function(){Object(_.x)(u||r,d)};return console.log("data:",d,"fileanme:",u," name:",r),W.a.createElement("div",{style:Object(I.a)({},O||{}),className:"".concat(w&&P.a.bgBlack," ").concat(a?P.a.wrp:"hide")},T&&W.a.createElement("div",{className:P.a.close,ref:y},W.a.createElement(V.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return y.current}},W.a.createElement("span",{onClick:F},W.a.createElement("i",{className:"icon-quxiaozhiding"}))),W.a.createElement(V.a,{title:"\u5173\u95ED",getPopupContainer:function(){return y.current}},W.a.createElement("span",{className:"",onClick:A},W.a.createElement("i",{className:"icon-guanbi1"})))),W.a.createElement("div",{className:"".concat(P.a[R]," ").concat(R," ").concat(P.a.monaco," ").concat(a==="txt"?"show":"hide")},a==="txt"&&W.a.createElement(p.b,c)),a==="audio"&&W.a.createElement("audio",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?d:"data:audio/mp3;base64,").concat(d),autoPlay:!0}),a==="video"&&W.a.createElement(W.a.Fragment,null,d!=null&&d.startsWith("/")?W.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):W.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),a==="html"&&W.a.createElement("iframe",{src:d+"&disposition=inline"}),a==="pdf"&&W.a.createElement("embed",{className:P.a.embed,src:d}),a==="image"&&W.a.createElement(W.a.Fragment,null,W.a.createElement("img",{src:"".concat(d!=null&&d.startsWith("/")||(d==null?void 0:d.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(d)})),a==="other"&&W.a.createElement("div",null,W.a.createElement(Z.a,{type:"primary",size:"large",onClick:x},W.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(a==="download"||a==="office")&&W.a.createElement(Z.a,{type:"primary",size:"large",onClick:x},W.a.createElement(b.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ft,Xe,G){},psGv:function(ft,Xe,G){var de,Z;(function(){var M;(function(){"use strict";var K=[,,function(b){function p(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var r=new p(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},p.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},p.prototype.has_match=function(r){for(var d=this.__items.length-1;d>=0;d--)if(this.__items[d].match(r))return!0;return!1},p.prototype.set_indent=function(r,d){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(r){this.__items.push(r);var d=r.lastIndexOf(` `);d!==-1?this.__character_count=r.length-d:this.__character_count+=r.length},p.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function _(r,d){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),d=d||"",r.indent_level>0&&(d=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}_.prototype.get_indent_size=function(r,d){var l=this.__base_string_length;return d=d||0,r<0&&(l=0),l+=r*this.__indent_size,l+=d,l},_.prototype.get_indent_string=function(r,d){var l=this.__base_string;return d=d||0,r<0&&(r=0,l=""),d+=r*this.__indent_size,this.__ensure_cache(d),l+=this.__cache[d],l},_.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},_.prototype.__add_column=function(){var r=this.__cache.length,d=0,l="";this.__indent_size&&r>=this.__indent_size&&(d=Math.floor(r/this.__indent_size),r-=d*this.__indent_size,l=new Array(d+1).join(this.__indent_string)),r&&(l+=new Array(r+1).join(" ")),this.__cache.push(l)};function h(r,d){this.__indent_cache=new _(r,d),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}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(r,d){return this.__indent_cache.get_indent_string(r,d)},h.prototype.get_indent_size=function(r,d){return this.__indent_cache.get_indent_size(r,d)},h.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},h.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},h.prototype.get_code=function(r){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===` `&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var l=this.__lines.join(` `);return r!==` `&&(l=l.replace(/[\n]/g,r)),l},h.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},h.prototype.set_indent=function(r,d){return r=r||0,d=d||0,this.next_line.set_indent(r,d),this.__lines.length>1?(this.current_line.set_indent(r,d),!0):(this.current_line.set_indent(),!1)},h.prototype.add_raw_token=function(r){for(var d=0;d1&&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(r,d){for(var l=this.__lines.length-2;l>=0;){var a=this.__lines[l];if(a.is_empty())break;if(a.item(0).indexOf(r)!==0&&a.item(-1)!==d){this.__lines.splice(l+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},b.exports.Output=h},function(b){function p(_,h,r,d){this.type=_,this.text=h,this.comments_before=null,this.newlines=r||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=p},,,function(b){function p(r,d){this.raw_options=_(r,d),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}p.prototype._get_array=function(r,d){var l=this.raw_options[r],a=d||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(a=l.concat()):typeof l=="string"&&(a=l.split(/[^a-zA-Z0-9_\/\-]+/)),a},p.prototype._get_boolean=function(r,d){var l=this.raw_options[r],a=l===void 0?!!d:!!l;return a},p.prototype._get_characters=function(r,d){var l=this.raw_options[r],a=d||"";return typeof l=="string"&&(a=l.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),a},p.prototype._get_number=function(r,d){var l=this.raw_options[r];d=parseInt(d,10),isNaN(d)&&(d=0);var a=parseInt(l,10);return isNaN(a)&&(a=d),a},p.prototype._get_selection=function(r,d,l){var a=this._get_selection_list(r,d,l);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values: `+d+` You passed in: '`+this.raw_options[r]+"'");return a[0]},p.prototype._get_selection_list=function(r,d,l){if(!d||d.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[d[0]],!this._is_valid_selection(l,d))throw new Error("Invalid Default Value!");var a=this._get_array(r,l);if(!this._is_valid_selection(a,d))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values: `+d+` You passed in: '`+this.raw_options[r]+"'");return a},p.prototype._is_valid_selection=function(r,d){return r.length&&d.length&&!r.some(function(l){return d.indexOf(l)===-1})};function _(r,d){var l={};r=h(r);var a;for(a in r)a!==d&&(l[a]=r[a]);if(d&&r[d])for(a in r[d])l[a]=r[d][a];return l}function h(r){var d={},l;for(l in r){var a=l.replace(/-/g,"_");d[a]=r[l]}return d}b.exports.Options=p,b.exports.normalizeOpts=h,b.exports.mergeOpts=_},,function(b){var p=RegExp.prototype.hasOwnProperty("sticky");function _(h){this.__input=h||"",this.__input_length=this.__input.length,this.__position=0}_.prototype.restart=function(){this.__position=0},_.prototype.back=function(){this.__position>0&&(this.__position-=1)},_.prototype.hasNext=function(){return this.__position=0&&h=0&&r=h.length&&this.__input.substring(r-h.length,r).toLowerCase()===h},b.exports.InputScanner=_},function(b,p,_){var h=_(8).InputScanner,r=_(3).Token,d=_(10).TokenStream,l=_(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(c,R){this._input=new h(c),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var c,R=new r(a.START,""),O=null,T=[],A=new d;R.type!==a.EOF;){for(c=this._get_next_token(R,O);this._is_comment(c);)A.add(c),c=this._get_next_token(R,O);A.isEmpty()||(c.comments_before=A,A=new d),c.parent=O,this._is_opening(c)?(T.push(O),O=c):O&&this._is_closing(c,O)&&(c.opened=O,O.closed=c,O=T.pop(),c.parent=O),c.previous=R,R.next=c,this.__tokens.add(c),R=c}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(c,R){this._readWhitespace();var O=this._input.read(/.+/g);return O?this._create_token(a.RAW,O):this._create_token(a.EOF,"")},u.prototype._is_comment=function(c){return!1},u.prototype._is_opening=function(c){return!1},u.prototype._is_closing=function(c,R){return!1},u.prototype._create_token=function(c,R){var O=new r(c,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return O},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=u,b.exports.TOKEN=a},function(b){function p(_){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=_}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position=0&&_/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new h,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(l){var a=this._create();return a._disabled[l]=!0,a._update(),a},d.prototype.read_options=function(l){var a=this._create();for(var u in r)a._disabled[u]=l.templating.indexOf(u)===-1;return a._update(),a},d.prototype.exclude=function(l){var a=this._create();return a._excluded[l]=!0,a._update(),a},d.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 a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),l+=a,a=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},d.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("|")+")")},d.prototype._read_template=function(){var l="",a=this._input.peek();if(a==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(l=l||this.__patterns.erb.read())}else a==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},b.exports.TemplatablePattern=d},,,,function(b,p,_){var h=_(19).Beautifier,r=_(20).Options;function d(l,a,u,c){var R=new h(l,a,u,c);return R.beautify()}b.exports=d,b.exports.defaultOptions=function(){return new r}},function(b,p,_){var h=_(20).Options,r=_(2).Output,d=_(21).Tokenizer,l=_(21).TOKEN,a=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,c=function(E,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new r(E,g)};c.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},c.prototype.set_space_before_token=function(E,g){this._output.space_before_token=E,this._output.non_breaking_space=g},c.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},c.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},c.prototype.print_preserved_newlines=function(E){var g=0;E.type!==l.TEXT&&E.previous.type!==l.TEXT&&(g=E.newlines?1:0),this.preserve_newlines&&(g=E.newlines0);return g!==0},c.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},c.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},c.prototype.print_newline=function(E){this._output.add_new_line(E)},c.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},c.prototype.indent=function(){this.indent_level++},c.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var R=function(E){for(var g=null,C=E.next;C.type!==l.EOF&&E.closed!==C;){if(C.type===l.ATTRIBUTE&&C.text==="type"){C.next&&C.next.type===l.EQUALS&&C.next.next&&C.next.next.type===l.VALUE&&(g=C.next.next.text);break}C=C.next}return g},O=function(E,g){var C=null,N=null;return g.closed?(E==="script"?C="text/javascript":E==="style"&&(C="text/css"),C=R(g)||C,C.search("text/css")>-1?N="css":C.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":C.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":C.search(/test\/null/)>-1&&(N="null"),N):null};function T(E,g){return g.indexOf(E)!==-1}function A(E,g,C){this.parent=E||null,this.tag=g?g.tag_name:"",this.indent_level=C||0,this.parser_token=g||null}function w(E){this._printer=E,this._current_frame=null}w.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},w.prototype.record_tag=function(E){var g=new A(this._current_frame,E,this._printer.indent_level);this._current_frame=g},w.prototype._try_pop_frame=function(E){var g=null;return E&&(g=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),g},w.prototype._get_frame=function(E,g){for(var C=this._current_frame;C&&!(E.indexOf(C.tag)!==-1);){if(g&&g.indexOf(C.tag)!==-1){C=null;break}C=C.parent}return C},w.prototype.try_pop=function(E,g){var C=this._get_frame([E],g);return this._try_pop_frame(C)},w.prototype.indent_to_tag=function(E){var g=this._get_frame(E);g&&(this._printer.indent_level=g.indent_level)};function m(E,g,C,N){this._source_text=E||"",g=g||{},this._js_beautify=C,this._css_beautify=N,this._tag_stack=null;var U=new h(g,"html");this._options=U,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,"force".length)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,"preserve".length)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=` `,E&&a.test(E)&&(g=E.match(a)[0])),E=E.replace(u,` `);var C=E.match(/^[\t ]*/)[0],N={text:"",type:""},U=new v,j=new c(this._options,C),H=new d(E,this._options).tokenize();this._tag_stack=new w(j);for(var y=null,x=H.next();x.type!==l.EOF;)x.type===l.TAG_OPEN||x.type===l.COMMENT?(y=this._handle_tag_open(j,x,U,N),U=y):x.type===l.ATTRIBUTE||x.type===l.EQUALS||x.type===l.VALUE||x.type===l.TEXT&&!U.tag_complete?y=this._handle_inside_tag(j,x,U,H):x.type===l.TAG_CLOSE?y=this._handle_tag_close(j,x,U):x.type===l.TEXT?y=this._handle_text(j,x,U):j.add_raw_token(x),N=y,x=H.next();var F=j._output.get_code(g);return F},m.prototype._handle_tag_close=function(E,g,C){var N={text:g.text,type:g.type};return E.alignment_size=0,C.tag_complete=!0,E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),C.is_unformatted?E.add_raw_token(g):(C.tag_start_char==="<"&&(E.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&C.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(g)),C.indent_content&&!(C.is_unformatted||C.is_content_unformatted)&&(E.indent(),C.indent_content=!1),!C.is_inline_element&&!(C.is_unformatted||C.is_content_unformatted)&&E.set_wrap_point(),N},m.prototype._handle_inside_tag=function(E,g,C,N){var U=C.has_wrapped_attrs,j={text:g.text,type:g.type};if(E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),C.is_unformatted)E.add_raw_token(g);else if(C.tag_start_char==="{"&&g.type===l.TEXT)E.print_preserved_newlines(g)?(g.newlines=0,E.add_raw_token(g)):E.print_token(g);else{if(g.type===l.ATTRIBUTE?(E.set_space_before_token(!0),C.attr_count+=1):(g.type===l.EQUALS||g.type===l.VALUE&&g.previous.type===l.EQUALS)&&E.set_space_before_token(!1),g.type===l.ATTRIBUTE&&C.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(g),U=U||g.newlines!==0),this._is_wrap_attributes_force)){var H=C.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&C.attr_count===1){var y=!0,x=0,F;do{if(F=N.peek(x),F.type===l.ATTRIBUTE){y=!1;break}x+=1}while(x<4&&F.type!==l.EOF&&F.type!==l.TAG_CLOSE);H=!y}H&&(E.print_newline(!1),U=!0)}E.print_token(g),U=U||E.previous_token_wrapped(),C.has_wrapped_attrs=U}return j},m.prototype._handle_text=function(E,g,C){var N={text:g.text,type:"TK_CONTENT"};return C.custom_beautifier_name?this._print_custom_beatifier_text(E,g,C):C.is_unformatted||C.is_content_unformatted?E.add_raw_token(g):(E.traverse_whitespace(g),E.print_token(g)),N},m.prototype._print_custom_beatifier_text=function(E,g,C){var N=this;if(g.text!==""){var U=g.text,j,H=1,y="",x="";C.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?j=this._js_beautify:C.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?j=this._css_beautify:C.custom_beautifier_name==="html"&&(j=function(fe,ue){var he=new m(fe,ue,N._js_beautify,N._css_beautify);return he.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-E.indent_level);var F=E.get_full_indent(H);if(U=U.replace(/\n[ \t]*$/,""),C.custom_beautifier_name!=="html"&&U[0]==="<"&&U.match(/^(|]]>)$/.exec(U);if(!Q){E.add_raw_token(g);return}y=F+Q[1]+` `,U=Q[4],Q[5]&&(x=F+Q[5]),U=U.replace(/\n[ \t]*$/,""),(Q[2]||Q[3].indexOf(` `)!==-1)&&(Q=Q[3].match(/[ \t]+$/),Q&&(g.whitespace_before=Q[0]))}if(U)if(j){var q=function(){this.eol=` `};q.prototype=this._options.raw_options;var ie=new q;U=j(F+U,ie)}else{var ge=g.whitespace_before;ge&&(U=U.replace(new RegExp(` (`+ge+")?","g"),` `)),U=F+U.replace(/\n/g,` `+F)}y&&(U?U=y+U+` `+x:U=y+x),E.print_newline(!1),U&&(g.text=U,g.whitespace_before="",g.newlines=0,E.add_raw_token(g),E.print_newline(!0))}},m.prototype._handle_tag_open=function(E,g,C,N){var U=this._get_tag_open_token(g);return(C.is_unformatted||C.is_content_unformatted)&&!C.is_empty_element&&g.type===l.TAG_OPEN&&g.text.indexOf("]*)/),this.tag_check=C?C[1]:""):(C=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=C?C[1]:"",(g.text.startsWith("{{#>")||g.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&g.next!==null?this.tag_check=g.next.text.split(" ")[0]:this.tag_check=g.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),g.type===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||g.closed&&g.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(N=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};m.prototype._get_tag_open_token=function(E){var g=new v(this._tag_stack.get_parser_token(),E);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||T(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&T(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&T(g.tag_check,this._options.content_unformatted),g.is_inline_element=T(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},m.prototype._set_tag_position=function(E,g,C,N,U){if(C.is_empty_element||(C.is_end_tag?C.start_tag_token=this._tag_stack.try_pop(C.tag_name):(this._do_optional_end_element(C)&&(C.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(C),(C.tag_name==="script"||C.tag_name==="style")&&!(C.is_unformatted||C.is_content_unformatted)&&(C.custom_beautifier_name=O(C.tag_check,g)))),T(C.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),C.is_empty_element){if(C.tag_start_char==="{"&&C.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),C.indent_content=!0;var j=E.current_line_has_match(/{{#if/);j||E.print_newline(!1)}C.tag_name==="!--"&&U.type===l.TAG_CLOSE&&N.is_end_tag&&C.text.indexOf(` `)===-1||(C.is_inline_element||C.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,C))}else if(C.is_end_tag){var H=!1;H=C.start_tag_token&&C.start_tag_token.multiline_content,H=H||!C.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(U.type===l.TAG_CLOSE&&C.start_tag_token===N)&&U.type!=="TK_CONTENT",(C.is_content_unformatted||C.is_unformatted)&&(H=!1),H&&E.print_newline(!1)}else C.indent_content=!C.custom_beautifier_name,C.tag_start_char==="<"&&(C.tag_name==="html"?C.indent_content=this._options.indent_inner_html:C.tag_name==="head"?C.indent_content=this._options.indent_head_inner_html:C.tag_name==="body"&&(C.indent_content=this._options.indent_body_inner_html)),!(C.is_inline_element||C.is_unformatted)&&(U.type!=="TK_CONTENT"||C.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,C)},m.prototype._calcluate_parent_multiline=function(E,g){g.parent&&E._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var s=["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"],o=["a","audio","del","ins","map","noscript","video"];m.prototype._do_optional_end_element=function(E){var g=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(E.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&s.indexOf(E.tag_name)!==-1){var C=E.parent.parent;(!C||o.indexOf(C.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),g},b.exports.Beautifier=m},function(b,p,_){var h=_(6).Options;function r(d){h.call(this,d,"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"])}r.prototype=new h,b.exports.Options=r},function(b,p,_){var h=_(9).Tokenizer,r=_(9).TOKEN,d=_(13).Directives,l=_(14).TemplatablePattern,a=_(12).Pattern,u={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:r.START,RAW:r.RAW,EOF:r.EOF},c=new d(/<\!--/,/-->/),R=function(O,T){h.call(this,O,T),this._current_tag_name="";var A=new l(this._input).read_options(this._options),w=new a(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:w.starting_with(/{{!--/).until_after(/--}}/),handlebars:w.starting_with(/{{/).until_after(/}}/),handlebars_open:w.until(/[\n\r\t }]/),handlebars_raw_close:w.until(/}}/),comment:w.starting_with(//),cdata:w.starting_with(//),conditional_comment:w.starting_with(//),processing:w.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var m=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=w.matching(m).until_after(m)}};R.prototype=new h,R.prototype._is_comment=function(O){return!1},R.prototype._is_opening=function(O){return O.type===u.TAG_OPEN},R.prototype._is_closing=function(O,T){return O.type===u.TAG_CLOSE&&T&&((O.text===">"||O.text==="/>")&&T.text[0]==="<"||O.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(O,T){var A=null;this._readWhitespace();var w=this._input.peek();return w===null?this._create_token(u.EOF,""):(A=A||this._read_open_handlebars(w,T),A=A||this._read_attribute(w,O,T),A=A||this._read_close(w,T),A=A||this._read_raw_content(w,O,T),A=A||this._read_content_word(w),A=A||this._read_comment_or_cdata(w),A=A||this._read_processing(w),A=A||this._read_open(w,T),A=A||this._create_token(u.UNKNOWN,this._input.next()),A)},R.prototype._read_comment_or_cdata=function(O){var T=null,A=null,w=null;if(O==="<"){var m=this._input.peek(1);m==="!"&&(A=this.__patterns.comment.read(),A?(w=c.get_directives(A),w&&w.ignore==="start"&&(A+=c.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(T=this._create_token(u.COMMENT,A),T.directives=w)}return T},R.prototype._read_processing=function(O){var T=null,A=null,w=null;if(O==="<"){var m=this._input.peek(1);(m==="!"||m==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(T=this._create_token(u.COMMENT,A),T.directives=w)}return T},R.prototype._read_open=function(O,T){var A=null,w=null;return T||O==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),w=this._create_token(u.TAG_OPEN,A)),w},R.prototype._read_open_handlebars=function(O,T){var A=null,w=null;return T||this._options.indent_handlebars&&O==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),w=this._create_token(u.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),w=this._create_token(u.TAG_OPEN,A))),w},R.prototype._read_close=function(O,T){var A=null,w=null;return T&&(T.text[0]==="<"&&(O===">"||O==="/"&&this._input.peek(1)===">")?(A=this._input.next(),O==="/"&&(A+=this._input.next()),w=this._create_token(u.TAG_CLOSE,A)):T.text[0]==="{"&&O==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),w=this._create_token(u.TAG_CLOSE,"}}"))),w},R.prototype._read_attribute=function(O,T,A){var w=null,m="";if(A&&A.text[0]==="<")if(O==="=")w=this._create_token(u.EQUALS,this._input.next());else if(O==='"'||O==="'"){var v=this._input.next();O==='"'?v+=this.__patterns.double_quote.read():v+=this.__patterns.single_quote.read(),w=this._create_token(u.VALUE,v)}else m=this.__patterns.attribute.read(),m&&(T.type===u.EQUALS?w=this._create_token(u.VALUE,m):w=this._create_token(u.ATTRIBUTE,m));return w},R.prototype._is_content_unformatted=function(O){return this._options.void_elements.indexOf(O)===-1&&(this._options.content_unformatted.indexOf(O)!==-1||this._options.unformatted.indexOf(O)!==-1)},R.prototype._read_raw_content=function(O,T,A){var w="";if(A&&A.text[0]==="{")w=this.__patterns.handlebars_raw_close.read();else if(T.type===u.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var m=T.opened.text.substr(1).toLowerCase();if(m==="script"||m==="style"){var v=this._read_comment_or_cdata(O);if(v)return v.type=u.TEXT,v;w=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(m)&&(w=this._input.readUntil(new RegExp("","ig")))}return w?this._create_token(u.TEXT,w):null},R.prototype._read_content_word=function(O){var T="";if(this._options.unformatted_content_delimiter&&(O===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(u.TEXT,T)},b.exports.Tokenizer=R,b.exports.TOKEN=u}],W={};function L(b){var p=W[b];if(p!==void 0)return p.exports;var _=W[b]={exports:{}};return K[b](_,_.exports,L),_.exports}var P=L(18);M=P})();var V=M;if(!0)!(de=[G,G("6UM0"),G("TXwP")],Z=function(K){var W=G("6UM0"),L=G("TXwP");return{html_beautify:function(P,b){return V(P,b,W.js_beautify,L.css_beautify)}}}.apply(Xe,de),Z!==void 0&&(ft.exports=Z));else var I,B})()},"rAM+":function(ft,Xe,G){"use strict";G.d(Xe,"a",function(){return Z});var de=G("Qw5x");function Z(M,V){var I;if(typeof Symbol=="undefined"||M[Symbol.iterator]==null){if(Array.isArray(M)||(I=Object(de.a)(M))||V&&M&&typeof M.length=="number"){I&&(M=I);var B=0,K=function(){};return{s:K,n:function(){return B>=M.length?{done:!0}:{done:!1,value:M[B++]}},e:function(p){throw p},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,L=!1,P;return{s:function(){I=M[Symbol.iterator]()},n:function(){var p=I.next();return W=p.done,p},e:function(p){L=!0,P=p},f:function(){try{!W&&I.return!=null&&I.return()}finally{if(L)throw P}}}}},rUJ1:function(ft,Xe){const G=/[&<>"']/,de=/[&<>"']/g,Z=/[<>"']|&(?!#?\w+;)/,M=/[<>"']|&(?!#?\w+;)/g,V={"&":"&","<":"<",">":">",'"':""","'":"'"},I=w=>V[w];function B(w,m){if(m){if(G.test(w))return w.replace(de,I)}else if(Z.test(w))return w.replace(M,I);return w}const K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(w){return w.replace(K,(m,v)=>(v=v.toLowerCase(),v==="colon"?":":v.charAt(0)==="#"?v.charAt(1)==="x"?String.fromCharCode(parseInt(v.substring(2),16)):String.fromCharCode(+v.substring(1)):""))}const L=/(^|[^\[])\^/g;function P(w,m){w=w.source||w,m=m||"";const v={replace:(s,o)=>(o=o.source||o,o=o.replace(L,"$1"),w=w.replace(s,o),v),getRegex:()=>new RegExp(w,m)};return v}const b=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(w,m,v){if(w){let s;try{s=decodeURIComponent(W(v)).replace(b,"").toLowerCase()}catch(o){return null}if(s.indexOf("javascript:")===0||s.indexOf("vbscript:")===0||s.indexOf("data:")===0)return null}m&&!p.test(v)&&(v=a(m,v));try{v=encodeURI(v).replace(/%25/g,"%")}catch(s){return null}return v}const h={},r=/^[^:]+:\/*[^/]*$/,d=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(w,m){h[" "+w]||(r.test(w)?h[" "+w]=w+"/":h[" "+w]=O(w,"/",!0)),w=h[" "+w];const v=w.indexOf(":")===-1;return m.substring(0,2)==="//"?v?m:w.replace(d,"$1")+m:m.charAt(0)==="/"?v?m:w.replace(l,"$1")+m:w+m}const u={exec:function(){}};function c(w){let m=1,v,s;for(;m{let N=!1,U=g;for(;--U>=0&&C[U]==="\\";)N=!N;return N?"|":" |"}),s=v.split(/ \|/);let o=0;if(s.length>m)s.splice(m);else for(;s.length1)Object(P.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(c.length===0)return Object(P.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=c[0];if(B.isValidElement(R)&&Object(b.c)(R)){var O=R.ref;c[0]=B.cloneElement(R,{ref:Object(b.a)(O,this.setChildNode)})}return c.length===1?c[0]:c.map(function(T,A){return!B.isValidElement(T)||"key"in T&&T.key!==null?T:B.cloneElement(T,{key:"".concat(_,"-").concat(A)})})}}]),l}(B.Component);h.displayName="ResizeObserver",Xe.a=h},tK3L:function(ft,Xe,G){ft.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(ft,Xe,G){typeof window!="undefined"&&function(Z,M){ft.exports=M()}(this,function(){return function(de){var Z={};function M(V){if(Z[V])return Z[V].exports;var I=Z[V]={i:V,l:!1,exports:{}};return de[V].call(I.exports,I,I.exports,M),I.l=!0,I.exports}return M.m=de,M.c=Z,M.d=function(V,I,B){M.o(V,I)||Object.defineProperty(V,I,{enumerable:!0,get:B})},M.r=function(V){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(V,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(V,"__esModule",{value:!0})},M.t=function(V,I){if(I&1&&(V=M(V)),I&8)return V;if(I&4&&typeof V=="object"&&V&&V.__esModule)return V;var B=Object.create(null);if(M.r(B),Object.defineProperty(B,"default",{enumerable:!0,value:V}),I&2&&typeof V!="string")for(var K in V)M.d(B,K,function(W){return V[W]}.bind(null,K));return B},M.n=function(V){var I=V&&V.__esModule?function(){return V.default}:function(){return V};return M.d(I,"a",I),I},M.o=function(V,I){return Object.prototype.hasOwnProperty.call(V,I)},M.p="/dist/",M(M.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(de,Z,M){"use strict";var V=Object.prototype.hasOwnProperty,I="~";function B(){}Object.create&&(B.prototype=Object.create(null),new B().__proto__||(I=!1));function K(b,p,_){this.fn=b,this.context=p,this.once=_||!1}function W(b,p,_,h,r){if(typeof _!="function")throw new TypeError("The listener must be a function");var d=new K(_,h||b,r),l=I?I+p:p;return b._events[l]?b._events[l].fn?b._events[l]=[b._events[l],d]:b._events[l].push(d):(b._events[l]=d,b._eventsCount++),b}function L(b,p){--b._eventsCount===0?b._events=new B:delete b._events[p]}function P(){this._events=new B,this._eventsCount=0}P.prototype.eventNames=function(){var p=[],_,h;if(this._eventsCount===0)return p;for(h in _=this._events)V.call(_,h)&&p.push(I?h.slice(1):h);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(_)):p},P.prototype.listeners=function(p){var _=I?I+p:p,h=this._events[_];if(!h)return[];if(h.fn)return[h.fn];for(var r=0,d=h.length,l=new Array(d);r0},!1)}function b(p,_){for(var h={main:[_]},r={main:[]},d={main:{}};P(h);)for(var l=Object.keys(h),a=0;a=2*A/m||C<=U)return;var j=Number.POSITIVE_INFINITY,H;for(H=l.level-1;H>s;H--){var y=v[H].maxBitrate;if(j=A*y/(8*.8*g),j=C)return;var x=this.bwEstimator.getEstimate();P.logger.warn("Fragment "+l.sn+(a?" part "+a.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+` Current BW estimate: `+(Object(V.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+C.toFixed(3)+` s Estimated load time for the next fragment: `+j.toFixed(3)+` s Time to underbuffer: `+U.toFixed(3)+" s"),u.nextLoadLevel=H,this.bwEstimator.sample(w,T.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),u.trigger(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:a,stats:T})},r.onFragLoaded=function(l,a){var u=a.frag,c=a.part;if(u.type===L.PlaylistLevelType.MAIN&&Object(V.isFiniteNumber)(u.sn)){var R=c?c.stats:u.stats,O=c?c.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[u.level],A=(T.loaded?T.loaded.bytes:0)+R.loaded,w=(T.loaded?T.loaded.duration:0)+O;T.loaded={bytes:A,duration:w},T.realBitrate=Math.round(8*A/w)}if(u.bitrateTest){var m={stats:R,frag:u,part:c,id:u.type};this.onFragBuffered(B.Events.FRAG_BUFFERED,m),u.bitrateTest=!1}}},r.onFragBuffered=function(l,a){var u=a.frag,c=a.part,R=c?c.stats:u.stats;if(R.aborted)return;if(u.type!==L.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var O=R.parsing.end-R.loading.start;this.bwEstimator.sample(O,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=O/1e3:this.bitrateTestDelay=0},r.onError=function(l,a){switch(a.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var l=this.fragCurrent,a=this.partCurrent,u=this.hls,c=u.maxAutoLevel,R=u.config,O=u.minAutoLevel,T=u.media,A=a?a.duration:l?l.duration:0,w=T?T.currentTime:0,m=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,v=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,s=(K.BufferHelper.bufferInfo(T,w,R.maxBufferHole).end-w)/m,o=this.findBestLevel(v,O,c,s,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(o>=0)return o;P.logger.trace((s?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=A?Math.min(A,R.maxStarvationDelay):R.maxStarvationDelay,g=R.abrBandWidthFactor,C=R.abrBandWidthUpFactor;if(!s){var N=this.bitrateTestDelay;if(N){var U=A?Math.min(A,R.maxLoadingDelay):R.maxLoadingDelay;E=U-N,P.logger.trace("bitrate test took "+Math.round(1e3*N)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),g=C=1}}return o=this.findBestLevel(v,O,c,s+E,g,C),Math.max(o,0)},r.findBestLevel=function(l,a,u,c,R,O){for(var T,A=this.fragCurrent,w=this.partCurrent,m=this.lastLoadedFragLevel,v=this.hls.levels,s=v[m],o=!!(s!=null&&(T=s.details)!==null&&T!==void 0&&T.live),E=s==null?void 0:s.codecSet,g=w?w.duration:A?A.duration:0,C=u;C>=a;C--){var N=v[C];if(!N||E&&N.codecSet!==E)continue;var U=N.details,j=(w?U==null?void 0:U.partTarget:U==null?void 0:U.averagetargetduration)||g,H=void 0;C<=m?H=R*l:H=O*l;var y=v[C].maxBitrate,x=y*j/H;if(P.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+C+"/"+Math.round(H)+"/"+y+"/"+j+"/"+c+"/"+x),H>y&&(!x||o&&!this.bitrateTestDelay||x0&&s===-1?(this.log("Override startPosition with lastCurrentTime @"+o.toFixed(3)),this.state=I.State.IDLE):(this.loadedmetadata=!1,this.state=I.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=s,this.tick()},m.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var s,o=this.levels,E=this.trackId,g=o==null||((s=o[E])===null||s===void 0)?void 0:s.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var C,N=performance.now(),U=this.retryDate;(!U||N>=U||(C=this.media)!==null&&C!==void 0&&C.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=I.State.IDLE);break}case I.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var H=j.frag,y=j.part,x=j.cache,F=j.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var Q=x.flush(),q={frag:H,part:y,payload:Q,networkDetails:null};this._handleFragmentLoadProgress(q),F&&A.prototype._handleFragmentLoadComplete.call(this,q)}else if(this.videoTrackCC!==this.waitingVideoCC)a.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),ge=K.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),fe=Object(r.fragmentWithinToleranceTest)(ge.end,this.config.maxFragLookUpTolerance,H);fe<0&&(a.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+ge.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},m.clearWaitingFragment=function(){var s=this.waitingData;s&&(this.fragmentTracker.removeFragment(s.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},m.onTickEnd=function(){var s=this.media;if(!s||!s.readyState)return;var o=this.mediaBuffer?this.mediaBuffer:s,E=o.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=s.currentTime},m.doTickIdle=function(){var s,o,E=this.hls,g=this.levels,C=this.media,N=this.trackId,U=E.config;if(!g||!g[N])return;if(!C&&(this.startFragRequested||!U.startFragPrefetch))return;var j=g[N],H=j.details;if(!H||H.live&&this.levelLastLoaded!==N||this.waitForCdnTuneIn(H)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,b.ElementaryStreamTypes.AUDIO,P.PlaylistLevelType.AUDIO));var y=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,P.PlaylistLevelType.AUDIO);if(y===null)return;var x=y.len,F=this.getMaxBufferLength(),Q=this.audioSwitch;if(x>=F&&!Q)return;if(!Q&&this._streamEnded(y,H)){E.trigger(B.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var q=H.fragments,ie=q[0].start,ge=y.end;if(Q){var fe=this.getLoadPosition();ge=fe,H.PTSKnown&&feie||y.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),C.currentTime=ie+.05))}var ue=this.getNextFragment(ge,H);if(!ue){this.bufferFlushed=!0;return}((s=ue.decryptdata)===null||s===void 0?void 0:s.keyFormat)==="identity"&&!((o=ue.decryptdata)!==null&&o!==void 0&&o.key)?this.loadKey(ue,H):this.loadFragment(ue,H,ge)},m.getMaxBufferLength=function(){var s=A.prototype.getMaxBufferLength.call(this),o=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,P.PlaylistLevelType.MAIN);return o===null?s:Math.max(s,o.len)},m.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},m.onAudioTracksUpdated=function(s,o){var E=o.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(g){return new L.Level(g)})},m.onAudioTrackSwitching=function(s,o){var E=!!o.url;this.trackId=o.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(O):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},m.onLevelLoaded=function(s,o){this.mainDetails=o.details},m.onAudioTrackLoaded=function(s,o){var E,g=this.levels,C=o.details,N=o.id;if(!g){this.warn("Audio tracks were reset while loading level "+N);return}this.log("Track "+N+" loaded ["+C.startSN+","+C.endSN+"],duration:"+C.totalduration);var U=g[N],j=0;if(C.live||(E=U.details)!==null&&E!==void 0&&E.live){var H=this.mainDetails;if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed||!H)return;!U.details&&C.hasProgramDateTime&&H.hasProgramDateTime?(Object(d.alignMediaPlaylistByPDT)(C,H),j=C.fragments[0].start):j=this.alignPlaylists(C,U.details)}U.details=C,this.levelLastLoaded=N,!this.startFragRequested&&(this.mainDetails||!C.live)&&this.setStartPosition(U.details,j),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(C)&&(this.state=I.State.IDLE),this.tick()},m._handleFragmentLoadProgress=function(s){var o,E=s.frag,g=s.part,C=s.payload,N=this.config,U=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var H=j[U];console.assert(H,"Audio track is defined on fragment load progress");var y=H.details;console.assert(y,"Audio track details are defined on fragment load progress");var x=N.defaultAudioCodec||H.audioCodec||"mp4a.40.2",F=this.transmuxer;F||(F=this.transmuxer=new _.default(this.hls,P.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Q=this.initPTS[E.cc],q=(o=E.initSegment)===null||o===void 0?void 0:o.data;if(Q!==void 0){var ie=!1,ge=g?g.index:-1,fe=ge!==-1,ue=new h.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,C.byteLength,ge,fe);F.push(C,q,x,"",E,g,y.totalduration,ie,ue,Q)}else{a.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+y.startSN+" ,"+y.endSN+"],track "+U);var he=this.waitingData=this.waitingData||{frag:E,part:g,cache:new p.default,complete:!1},_e=he.cache;_e.push(new Uint8Array(C)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},m._handleFragmentLoadComplete=function(s){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,s)},m.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},m.onBufferCreated=function(s,o){var E=o.tracks.audio;E&&(this.mediaBuffer=E.buffer),o.tracks.video&&(this.videoBuffer=o.tracks.video.buffer)},m.onFragBuffered=function(s,o){var E=o.frag,g=o.part;if(E.type!==P.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(g?" p: "+g.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,g)},m.onError=function(s,o){switch(o.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(P.PlaylistLevelType.AUDIO,o);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=o.fatal?I.State.ERROR:I.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(o.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var E=!0,g=this.getFwdBufferInfo(this.mediaBuffer,P.PlaylistLevelType.AUDIO);g&&g.len>.5&&(E=!this.reduceMaxBufferLength(g.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},m.onBufferFlushed=function(s,o){var E=o.type;E===b.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},m._handleTransmuxComplete=function(s){var o,E="audio",g=this.hls,C=s.remuxResult,N=s.chunkMeta,U=this.getCurrentContext(N);if(!U){this.warn("The loading context changed while buffering fragment "+N.sn+" of level "+N.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(N.level);return}var j=U.frag,H=U.part,y=C.audio,x=C.text,F=C.id3,Q=C.initSegment;if(this.fragContextChanged(j))return;if(this.state=I.State.PARSING,this.audioSwitch&&y&&this.completeAudioSwitch(),Q!=null&&Q.tracks&&(this._bufferInitSegment(Q.tracks,j,N),g.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:E,tracks:Q.tracks})),y){var q=y.startPTS,ie=y.endPTS,ge=y.startDTS,fe=y.endDTS;H&&(H.elementaryStreams[b.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:ie,startDTS:ge,endDTS:fe}),j.setElementaryStreamInfo(b.ElementaryStreamTypes.AUDIO,q,ie,ge,fe),this.bufferFragmentData(y,j,H,N)}if(F!=null&&(o=F.samples)!==null&&o!==void 0&&o.length){var ue=u({frag:j,id:E},F);g.trigger(B.Events.FRAG_PARSING_METADATA,ue)}if(x){var he=u({frag:j,id:E},x);g.trigger(B.Events.FRAG_PARSING_USERDATA,he)}},m._bufferInitSegment=function(s,o,E){if(this.state!==I.State.PARSING)return;s.video&&delete s.video;var g=s.audio;if(!g)return;g.levelCodec=g.codec,g.id="audio",this.log("Init audio buffer, container:"+g.container+", codecs[parsed]=["+g.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,s);var C=g.initSegment;if(C!=null&&C.byteLength){var N={type:"audio",frag:o,part:null,chunkMeta:E,parent:o.type,data:C};this.hls.trigger(B.Events.BUFFER_APPENDING,N)}this.tick()},m.loadFragment=function(s,o,E){var g=this.fragmentTracker.getState(s);this.fragCurrent=s,(this.audioSwitch||g===W.FragmentState.NOT_LOADED||g===W.FragmentState.PARTIAL)&&(s.sn==="initSegment"?this._loadInitSegment(s):o.live&&!Object(V.isFiniteNumber)(this.initPTS[s.cc])?(this.log("Waiting for video PTS in continuity counter "+s.cc+" of live stream before loading audio fragment "+s.sn+" of level "+this.trackId),this.state=I.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,s,o,E)))},m.completeAudioSwitch=function(){var s=this.hls,o=this.media,E=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,s.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:E})},w}(I.default);Z.default=T},"./src/controller/audio-track-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/controller/base-playlist-controller.ts"),K=M("./src/types/loader.ts");function W(_,h){for(var r=0;r=a.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=a[this.trackId];this.log("Now switching to audio-track index "+l);var c=a[l],R=c.id,O=c.groupId,T=O===void 0?"":O,A=c.name,w=c.type,m=c.url;if(this.trackId=l,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(V.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:T,name:A,type:w,url:m}),c.details&&!c.details.live)return;var v=this.switchParams(c.url,u==null?void 0:u.details);this.loadPlaylist(v)},r.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var a=this.trackName,u=this.findTrackId(a)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(l){for(var a=this.tracksInGroup,u=0;uh.partTarget&&(c+=1)}if(Object(V.isFiniteNumber)(u))return new I.HlsUrlParameters(u,Object(V.isFiniteNumber)(c)?c:void 0,I.HlsSkip.No)}}},b.loadPlaylist=function(_){},b.shouldLoadTrack=function(_){return this.canLoad&&_&&!!_.url&&(!_.details||_.details.live)},b.playlistLoaded=function(_,h,r){var d=this,l=h.details,a=h.stats,u=a.loading.end?Math.max(0,self.performance.now()-a.loading.end):0;if(l.advancedDateTime=Date.now()-u,l.live||r!=null&&r.live){if(l.reloaded(r),r&&this.log("live playlist "+_+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),r&&l.fragments.length>0&&Object(B.mergeDetails)(r,l),!this.canLoad||!l.live)return;var c,R=void 0,O=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var T=this.hls.config.lowLatencyMode,A=l.lastPartSn,w=l.endSN,m=l.lastPartIndex,v=m!==-1,s=A===w,o=T?0:m;v?(R=s?w+1:A,O=s?o:m+1):R=w+1;var E=l.age,g=E+l.ageHeader,C=Math.min(g-l.partTarget,l.targetduration*1.5);if(C>0){if(r&&C>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+C+" with playlist age: "+l.age),C=0;else{var N=Math.floor(C/l.targetduration);if(R+=N,O!==void 0){var U=Math.round(C%l.targetduration/l.partTarget);O+=U}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+C+" skip sn "+N+" to part "+O)}l.tuneInGoal=C}if(c=this.getDeliveryDirectives(l,h.deliveryDirectives,R,O),T||!s){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(l,h.deliveryDirectives,R,O);var j=Object(B.computeReloadInterval)(l,a);R!==void 0&&l.canBlockReload&&(j-=l.partTarget||1),this.log("reload live playlist "+_+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return d.loadPlaylist(c)},j)}else this.clearTimer()},b.getDeliveryDirectives=function(_,h,r,d){var l=Object(I.getSkipValue)(_,r);return h!=null&&h.skip&&_.deltaUpdateFailed&&(r=h.msn,d=h.part,l=I.HlsSkip.No),new I.HlsUrlParameters(r,d,l)},b.retryLoadingOrFail=function(_){var h=this,r=this.hls.config,d=this.retryCount-1&&(l=_.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+_.details+'"'),this.loadPlaylist();else{var a=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return h.loadPlaylist()},a),this.warn("retry playlist loading #"+this.retryCount+" in "+a+' ms after "'+_.details+'"')}}else this.warn('cannot recover from error "'+_.details+'"'),this.clearTimer(),_.fatal=!0;return d},P}()},"./src/controller/base-stream-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"State",function(){return w}),M.d(Z,"default",function(){return m});var V=M("./src/polyfills/number.ts"),I=M("./src/task-loop.ts"),B=M("./src/controller/fragment-tracker.ts"),K=M("./src/utils/buffer-helper.ts"),W=M("./src/utils/logger.ts"),L=M("./src/events.ts"),P=M("./src/errors.ts"),b=M("./src/types/transmuxer.ts"),p=M("./src/utils/mp4-tools.ts"),_=M("./src/utils/discontinuities.ts"),h=M("./src/controller/fragment-finders.ts"),r=M("./src/controller/level-helper.ts"),d=M("./src/loader/fragment-loader.ts"),l=M("./src/crypt/decrypter.ts"),a=M("./src/utils/time-ranges.ts"),u=M("./src/types/loader.ts");function c(v,s){for(var o=0;oQ;(H0&&H&&H.key&&H.iv&&H.method==="AES-128"){var y=self.performance.now();return C.decrypter.webCryptoDecrypt(new Uint8Array(j),H.key.buffer,H.iv.buffer).then(function(x){var F=self.performance.now();return U.trigger(L.Events.FRAG_DECRYPTED,{frag:g,payload:x,stats:{tstart:y,tdecrypt:F}}),N.payload=x,N})}return N}).then(function(N){var U=C.fragCurrent,j=C.hls,H=C.levels;if(!H)throw new Error("init load aborted, missing levels");var y=H[g.level].details;console.assert(y,"Level details are defined when init segment is loaded");var x=g.stats;C.state=w.IDLE,C.fragLoadError=0,g.data=new Uint8Array(N.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),N.frag===U&&j.trigger(L.Events.FRAG_BUFFERED,{stats:x,frag:U,part:null,id:g.type}),C.tick()}).catch(function(N){C.warn(N),C.resetFragmentLoading(g)})},o.fragContextChanged=function(g){var C=this.fragCurrent;return!g||!C||g.level!==C.level||g.sn!==C.sn||g.urlId!==C.urlId},o.fragBufferedComplete=function(g,C){var N=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(C?" part: "+C.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+a.default.toString(K.BufferHelper.getBuffered(N))),this.state=w.IDLE,this.tick()},o._handleFragmentLoadComplete=function(g){var C=this.transmuxer;if(!C)return;var N=g.frag,U=g.part,j=g.partsLoaded,H=!j||j.length===0||j.some(function(x){return!x}),y=new b.ChunkMetadata(N.level,N.sn,N.stats.chunkCount+1,0,U?U.index:-1,!H);C.flush(y)},o._handleFragmentLoadProgress=function(g){},o._doFragLoad=function(g,C,N,U){var j=this;if(N===void 0&&(N=null),!this.levels)throw new Error("frag load aborted, missing levels");if(N=Math.max(g.start,N||0),this.config.lowLatencyMode&&C){var H=C.partList;if(H&&U){N>g.end&&C.fragmentHint&&(g=C.fragmentHint);var y=this.getNextPart(H,g,N);if(y>-1){var x=H[y];return this.log("Loading part sn: "+g.sn+" p: "+x.index+" cc: "+g.cc+" of playlist ["+C.startSN+"-"+C.endSN+"] parts [0-"+y+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=w.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:g,part:H[y],targetBufferTime:N}),this.doFragPartsLoad(g,H,y,U).catch(function(F){return j.handleFragLoadError(F)})}else if(!g.url||this.loadedEndOfParts(H,N))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(C?"of ["+C.startSN+"-"+C.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(N.toFixed(3))),Object(V.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=w.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:g,targetBufferTime:N}),this.fragmentLoader.load(g,U).catch(function(F){return j.handleFragLoadError(F)})},o.doFragPartsLoad=function(g,C,N,U){var j=this;return new Promise(function(H,y){var x=[],F=function Q(q){var ie=C[q];j.fragmentLoader.loadPart(g,ie,U).then(function(ge){x[ie.index]=ge;var fe=ge.part;j.hls.trigger(L.Events.FRAG_LOADED,ge);var ue=C[q+1];if(ue&&ue.fragment===g)Q(q+1);else return H({frag:g,part:fe,partsLoaded:x})}).catch(y)};F(N)})},o.handleFragLoadError=function(g){var C=g.data;return C&&C.details===P.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(C.frag,C.part):this.hls.trigger(L.Events.ERROR,C),null},o._handleTransmuxerFlush=function(g){var C=this.getCurrentContext(g);if(!C||this.state!==w.PARSING){this.fragCurrent||(this.state=w.IDLE);return}var N=C.frag,U=C.part,j=C.level,H=self.performance.now();N.stats.parsing.end=H,U&&(U.stats.parsing.end=H),this.updateLevelTiming(N,U,j,g.partial)},o.getCurrentContext=function(g){var C=this.levels,N=g.level,U=g.sn,j=g.part;if(!C||!C[N])return this.warn("Levels object was unset while buffering fragment "+U+" of level "+N+". The current chunk will not be buffered."),null;var H=C[N],y=j>-1?Object(r.getPartWith)(H,U,j):null,x=y?y.fragment:Object(r.getFragmentWithSN)(H,U,this.fragCurrent);return x?{frag:x,part:y,level:H}:null},o.bufferFragmentData=function(g,C,N,U){if(!g||this.state!==w.PARSING)return;var j=g.data1,H=g.data2,y=j;if(j&&H&&(y=Object(p.appendUint8Array)(j,H)),!y||!y.length)return;var x={type:g.type,frag:C,part:N,chunkMeta:U,parent:C.type,data:y};this.hls.trigger(L.Events.BUFFER_APPENDING,x),g.dropped&&g.independent&&!N&&this.flushBufferGap(C)},o.flushBufferGap=function(g){var C=this.media;if(!C)return;if(!K.BufferHelper.isBuffered(C,C.currentTime)){this.flushMainBuffer(0,g.start);return}var N=C.currentTime,U=K.BufferHelper.bufferInfo(C,N,0),j=g.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),y=Math.max(Math.min(g.start-H,U.end-H),N+H);g.start-y>H&&this.flushMainBuffer(y,g.start)},o.getFwdBufferInfo=function(g,C){var N=this.config,U=this.getLoadPosition();if(!Object(V.isFiniteNumber)(U))return null;var j=K.BufferHelper.bufferInfo(g,U,N.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(U,C);if(H&&j.nextStart=N?(C.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+C.maxMaxBufferLength+"s"),!0):!1},o.getNextFragment=function(g,C){var N,U,j=C.fragments,H=j.length;if(!H)return null;var y=this.config,x=j[0].start,F;if(C.live){var Q=y.initialLiveManifestSize;if(H-1&&NN.start&&N.loaded},o.getInitialLiveFragment=function(g,C){var N=this.fragPrevious,U=null;if(N){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+N.programDateTime),U=Object(h.findFragmentByPDT)(C,N.endProgramDateTime,this.config.maxFragLookUpTolerance)),!U){var j=N.sn+1;if(j>=g.startSN&&j<=g.endSN){var H=C[j-g.startSN];N.cc===H.cc&&(U=H,this.log("Live playlist, switching playlist, load frag with next SN: "+U.sn))}U||(U=Object(h.findFragWithCC)(C,N.cc),U&&this.log("Live playlist, switching playlist, load frag with same CC: "+U.sn))}}else{var y=this.hls.liveSyncPosition;y!==null&&(U=this.getFragmentAtPosition(y,this.bitrateTest?g.fragmentEnd:g.edge,g))}return U},o.getFragmentAtPosition=function(g,C,N){var U=this.config,j=this.fragPrevious,H=N.fragments,y=N.endSN,x=N.fragmentHint,F=U.maxFragLookUpTolerance,Q=!!(U.lowLatencyMode&&N.partList&&x);Q&&x&&!this.bitrateTest&&(H=H.concat(x),y=x.sn);var q;if(gC-F?0:F;q=Object(h.findFragmentByPTS)(j,H,g,ie)}else q=H[H.length-1];if(q){var ge=q.sn-N.startSN,fe=j&&q.level===j.level,ue=H[ge+1],he=this.fragmentTracker.getState(q);if(he===B.FragmentState.BACKTRACKED){q=null;for(var _e=ge;H[_e]&&this.fragmentTracker.getState(H[_e])===B.FragmentState.BACKTRACKED;)j?q=H[_e--]:q=H[--_e];q||(q=ue)}else j&&q.sn===j.sn&&!Q&&(fe&&(q.sn=H-C.maxFragLookUpTolerance&&j<=y;if(U!==null&&N.duration>U&&(j"+g.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+y),q}return x},o.waitForCdnTuneIn=function(g){var C=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*C)},o.setStartPosition=function(g,C){var N=this.startPosition;if(N"+g))}}]),s}(I.default)},"./src/controller/buffer-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h});var V=M("./src/polyfills/number.ts"),I=M("./src/events.ts"),B=M("./src/utils/logger.ts"),K=M("./src/errors.ts"),W=M("./src/utils/buffer-helper.ts"),L=M("./src/utils/mediasource-helper.ts"),P=M("./src/loader/fragment.ts"),b=M("./src/controller/buffer-operation-queue.ts"),p=Object(L.getMediaSource)(),_=/([ha]vc.)(?:\.[^.,]+)+/,h=function(){function r(l){var a=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 u=a.hls,c=a.media,R=a.mediaSource;B.logger.log("[buffer-controller]: Media source opened"),c&&(a.updateMediaElementDuration(),u.trigger(I.Events.MEDIA_ATTACHED,{media:c})),R&&R.removeEventListener("sourceopen",a._onMediaSourceOpen),a.checkPendingTracks()},this._onMediaSourceClose=function(){B.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){B.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var d=r.prototype;return d.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},d.destroy=function(){this.unregisterListeners(),this.details=null},d.registerListeners=function(){var a=this.hls;a.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(I.Events.BUFFER_RESET,this.onBufferReset,this),a.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(I.Events.BUFFER_EOS,this.onBufferEos,this),a.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.on(I.Events.FRAG_PARSED,this.onFragParsed,this),a.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},d.unregisterListeners=function(){var a=this.hls;a.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),a.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(I.Events.BUFFER_RESET,this.onBufferReset,this),a.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),a.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(I.Events.BUFFER_EOS,this.onBufferEos,this),a.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),a.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),a.off(I.Events.FRAG_PARSED,this.onFragParsed,this),a.off(I.Events.FRAG_CHANGED,this.onFragChanged,this)},d._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new b.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},d.onManifestParsed=function(a,u){var c=2;(u.audio&&!u.video||!u.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,B.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},d.onMediaAttaching=function(a,u){var c=this.media=u.media;if(c&&p){var R=this.mediaSource=new p;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(R),this._objectUrl=c.src}},d.onMediaDetaching=function(){var a=this.media,u=this.mediaSource,c=this._objectUrl;if(u){if(B.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(R){B.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),a&&(c&&self.URL.revokeObjectURL(c),a.src===c?(a.removeAttribute("src"),a.load()):B.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)},d.onBufferReset=function(){var a=this;this.getSourceBufferTypes().forEach(function(u){var c=a.sourceBuffer[u];try{c&&(a.removeBufferListeners(u),a.mediaSource&&a.mediaSource.removeSourceBuffer(c),a.sourceBuffer[u]=void 0)}catch(R){B.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",R)}}),this._initSourceBuffer()},d.onBufferCodecs=function(a,u){var c=this,R=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(O){if(R){var T=c.tracks[O];if(T&&typeof T.buffer.changeType=="function"){var A=u[O],w=A.codec,m=A.levelCodec,v=A.container,s=(T.levelCodec||T.codec).replace(_,"$1"),o=(m||w).replace(_,"$1");if(s!==o){var E=v+";codecs="+(m||w);c.appendChangeType(O,E)}}}else c.pendingTracks[O]=u[O]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},d.appendChangeType=function(a,u){var c=this,R=this.operationQueue,O={execute:function(){var A=c.sourceBuffer[a];A&&(B.logger.log("[buffer-controller]: changing "+a+" sourceBuffer type to "+u),A.changeType(u)),R.shiftAndExecuteNext(a)},onStart:function(){},onComplete:function(){},onError:function(A){B.logger.warn("[buffer-controller]: Failed to change "+a+" SourceBuffer type",A)}};R.append(O,a)},d.onBufferAppending=function(a,u){var c=this,R=this.hls,O=this.operationQueue,T=this.tracks,A=u.data,w=u.type,m=u.frag,v=u.part,s=u.chunkMeta,o=s.buffering[w],E=self.performance.now();o.start=E;var g=m.stats.buffering,C=v?v.stats.buffering:null;g.start===0&&(g.start=E),C&&C.start===0&&(C.start=E);var N=T.audio,U=w==="audio"&&s.id===1&&(N==null?void 0:N.container)==="audio/mpeg",j={execute:function(){if(o.executeStart=self.performance.now(),U){var y=c.sourceBuffer[w];if(y){var x=m.start-y.timestampOffset;Math.abs(x)>=.1&&(B.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+m.start+" (delta: "+x+") sn: "+m.sn+")"),y.timestampOffset=m.start)}}c.appendExecutor(A,w)},onStart:function(){},onComplete:function(){var y=self.performance.now();o.executeEnd=o.end=y,g.first===0&&(g.first=y),C&&C.first===0&&(C.first=y);var x=c.sourceBuffer,F={};for(var Q in x)F[Q]=W.BufferHelper.getBuffered(x[Q]);c.appendError=0,c.hls.trigger(I.Events.BUFFER_APPENDED,{type:w,frag:m,part:v,chunkMeta:s,parent:m.type,timeRanges:F})},onError:function(y){B.logger.error("[buffer-controller]: Error encountered while trying to append to the "+w+" SourceBuffer",y);var x={type:K.ErrorTypes.MEDIA_ERROR,parent:m.type,details:K.ErrorDetails.BUFFER_APPEND_ERROR,err:y,fatal:!1};y.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=K.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,x.details=K.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>R.config.appendErrorMaxRetry&&(B.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),R.trigger(I.Events.ERROR,x)}};O.append(j,w)},d.onBufferFlushing=function(a,u){var c=this,R=this.operationQueue,O=function(A){return{execute:c.removeExecutor.bind(c,A,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(I.Events.BUFFER_FLUSHED,{type:A})},onError:function(m){B.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",m)}}};u.type?R.append(O(u.type),u.type):this.getSourceBufferTypes().forEach(function(T){R.append(O(T),T)})},d.onFragParsed=function(a,u){var c=this,R=u.frag,O=u.part,T=[],A=O?O.elementaryStreams:R.elementaryStreams;A[P.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[P.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[P.ElementaryStreamTypes.VIDEO]&&T.push("video"));var w=function(){var v=self.performance.now();R.stats.buffering.end=v,O&&(O.stats.buffering.end=v);var s=O?O.stats:R.stats;c.hls.trigger(I.Events.FRAG_BUFFERED,{frag:R,part:O,stats:s,id:R.type})};T.length===0&&B.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(w,T)},d.onFragChanged=function(a,u){this.flushBackBuffer()},d.onBufferEos=function(a,u){var c=this,R=this.getSourceBufferTypes().reduce(function(O,T){var A=c.sourceBuffer[T];return(!u.type||u.type===T)&&(A&&!A.ended&&(A.ended=!0,B.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),O&&!!(!A||A.ended)},!0);R&&this.blockBuffers(function(){var O=c.mediaSource;if(!O||O.readyState!=="open")return;O.endOfStream()})},d.onLevelUpdated=function(a,u){var c=u.details;if(!c.fragments.length)return;this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},d.flushBackBuffer=function(){var a=this.hls,u=this.details,c=this.media,R=this.sourceBuffer;if(!c||u===null)return;var O=this.getSourceBufferTypes();if(!O.length)return;var T=u.live&&a.config.liveBackBufferLength!==null?a.config.liveBackBufferLength:a.config.backBufferLength;if(!Object(V.isFiniteNumber)(T)||T<0)return;var A=c.currentTime,w=u.levelTargetDuration,m=Math.max(T,w),v=Math.floor(A/w)*w-m;O.forEach(function(s){var o=R[s];if(o){var E=W.BufferHelper.getBuffered(o);E.length>0&&v>E.start(0)&&(a.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:v}),u.live&&a.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:v}),a.trigger(I.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:v,type:s}))}})},d.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var a=this.details,u=this.hls,c=this.media,R=this.mediaSource,O=a.fragments[0].start+a.totalduration,T=c.duration,A=Object(V.isFiniteNumber)(R.duration)?R.duration:0;a.live&&u.config.liveDurationInfinity?(B.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(a)):(O>A&&O>T||!Object(V.isFiniteNumber)(T))&&(B.logger.log("[buffer-controller]: Updating Media Source duration to "+O.toFixed(3)),R.duration=O)},d.updateSeekableRange=function(a){var u=this.mediaSource,c=a.fragments,R=c.length;if(R&&a.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var O=Math.max(0,c[0].start),T=Math.max(O,O+a.totalduration);u.setLiveSeekableRange(O,T)}},d.checkPendingTracks=function(){var a=this.bufferCodecEventsExpected,u=this.operationQueue,c=this.pendingTracks,R=Object.keys(c).length;if(R&&!a||R===2){this.createSourceBuffers(c),this.pendingTracks={};var O=this.getSourceBufferTypes();if(O.length===0){this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}O.forEach(function(T){u.executeNext(T)})}},d.createSourceBuffers=function(a){var u=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var O in a)if(!u[O]){var T=a[O];if(!T)throw Error("source buffer exists for track "+O+", however track does not");var A=T.levelCodec||T.codec,w=T.container+";codecs="+A;B.logger.log("[buffer-controller]: creating sourceBuffer("+w+")");try{var m=u[O]=c.addSourceBuffer(w),v=O;this.addBufferListener(v,"updatestart",this._onSBUpdateStart),this.addBufferListener(v,"updateend",this._onSBUpdateEnd),this.addBufferListener(v,"error",this._onSBUpdateError),this.tracks[O]={buffer:m,codec:A,container:T.container,levelCodec:T.levelCodec,id:T.id},R++}catch(s){B.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+s.message),this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:s,mimeType:w})}}R&&this.hls.trigger(I.Events.BUFFER_CREATED,{tracks:this.tracks})},d._onSBUpdateStart=function(a){var u=this.operationQueue,c=u.current(a);c.onStart()},d._onSBUpdateEnd=function(a){var u=this.operationQueue,c=u.current(a);c.onComplete(),u.shiftAndExecuteNext(a)},d._onSBUpdateError=function(a,u){B.logger.error("[buffer-controller]: "+a+" SourceBuffer error",u),this.hls.trigger(I.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(a);c&&c.onError(u)},d.removeExecutor=function(a,u,c){var R=this.media,O=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,w=A[a];if(!R||!O||!w){B.logger.warn("[buffer-controller]: Attempting to remove from the "+a+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(a);return}var m=Object(V.isFiniteNumber)(R.duration)?R.duration:Infinity,v=Object(V.isFiniteNumber)(O.duration)?O.duration:Infinity,s=Math.max(0,u),o=Math.min(c,m,v);o>s?(B.logger.log("[buffer-controller]: Removing ["+s+","+o+"] from the "+a+" SourceBuffer"),console.assert(!w.updating,a+" sourceBuffer must not be updating"),w.remove(s,o)):T.shiftAndExecuteNext(a)},d.appendExecutor=function(a,u){var c=this.operationQueue,R=this.sourceBuffer,O=R[u];if(!O){B.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(u);return}O.ended=!1,console.assert(!O.updating,u+" sourceBuffer must not be updating"),O.appendBuffer(a)},d.blockBuffers=function(a,u){var c=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){B.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(a);return}var R=this.operationQueue,O=u.map(function(T){return R.appendBlocker(T)});Promise.all(O).then(function(){a(),u.forEach(function(T){var A=c.sourceBuffer[T];(!A||!A.updating)&&R.shiftAndExecuteNext(T)})})},d.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},d.addBufferListener=function(a,u,c){var R=this.sourceBuffer[a];if(!R)return;var O=c.bind(this,a);this.listeners[a].push({event:u,listener:O}),R.addEventListener(u,O)},d.removeBufferListeners=function(a){var u=this.sourceBuffer[a];if(!u)return;this.listeners[a].forEach(function(c){u.removeEventListener(c.event,c.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return I});var V=M("./src/utils/logger.ts"),I=function(){function B(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var K=B.prototype;return K.append=function(L,P){var b=this.queues[P];b.push(L),b.length===1&&this.buffers[P]&&this.executeNext(P)},K.insertAbort=function(L,P){var b=this.queues[P];b.unshift(L),this.executeNext(P)},K.appendBlocker=function(L){var P,b=new Promise(function(_){P=_}),p={execute:P,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,L),b},K.executeNext=function(L){var P=this.buffers,b=this.queues,p=P[L],_=b[L];if(_.length){var h=_[0];try{h.execute()}catch(r){V.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),h.onError(r),(!p||!p.updating)&&(_.shift(),this.executeNext(L))}}},K.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},K.current=function(L){return this.queues[L][0]},B}()},"./src/controller/cap-level-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts");function I(W,L){for(var P=0;P0&&this.mediaWidth>0){var b=this.hls.levels;if(b.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(b.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},L.getMaxLevel=function(b){var p=this,_=this.hls.levels;if(!_.length)return-1;var h=_.filter(function(r,d){return W.isLevelAllowed(d,p.restrictedLevels)&&d<=b});return this.clientRect=null,W.getMaxLevelByMediaSize(h,this.mediaWidth,this.mediaHeight)},L.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()},L.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},L.getDimensions=function(){if(this.clientRect)return this.clientRect;var b=this.media,p={width:0,height:0};if(b){var _=b.getBoundingClientRect();p.width=_.width,p.height=_.height,!p.width&&!p.height&&(p.width=_.right-_.left||b.width||0,p.height=_.bottom-_.top||b.height||0)}return this.clientRect=p,p},W.isLevelAllowed=function(b,p){return p===void 0&&(p=[]),p.indexOf(b)===-1},W.getMaxLevelByMediaSize=function(b,p,_){if(!b||!b.length)return-1;for(var h=function(u,c){return c?u.width!==c.width||u.height!==c.height:!0},r=b.length-1,d=0;d=p||l.height>=_)&&h(l,b[d+1])){r=d;break}}return r},B(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var b=1;try{b=self.devicePixelRatio}catch(p){}return b}}]),W}();Z.default=K},"./src/controller/cmcd-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h});var V=M("./src/events.ts"),I=M("./src/types/cmcd.ts"),B=M("./src/utils/buffer-helper.ts"),K=M("./src/utils/logger.ts");function W(r,d){for(var l=0;l=r.length?{done:!0}:{done:!1,value:r[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b(r,d){if(!r)return;if(typeof r=="string")return p(r,d);var l=Object.prototype.toString.call(r).slice(8,-1);if(l==="Object"&&r.constructor&&(l=r.constructor.name),l==="Map"||l==="Set")return Array.from(r);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return p(r,d)}function p(r,d){(d==null||d>r.length)&&(d=r.length);for(var l=0,a=new Array(d);lu&&(u=T.bitrate)}return u>0?u:NaN},d.getBufferLength=function(a){var u=this.hls.media,c=a===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!c||!u)return NaN;var R=B.BufferHelper.bufferInfo(c,u.currentTime,this.config.maxBufferHole);return R.len*1e3},d.createPlaylistLoader=function(){var a=this.config.pLoader,u=this.applyPlaylistData,c=a||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new c(T)}var O=R.prototype;return O.destroy=function(){this.loader.destroy()},O.abort=function(){this.loader.abort()},O.load=function(A,w,m){u(A),this.loader.load(A,w,m)},L(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},d.createFragmentLoader=function(){var a=this.config.fLoader,u=this.applyFragmentData,c=a||this.config.loader;return function(){function R(T){this.loader=void 0,this.loader=new c(T)}var O=R.prototype;return O.destroy=function(){this.loader.destroy()},O.abort=function(){this.loader.abort()},O.load=function(A,w,m){u(A),this.loader.load(A,w,m)},L(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},r.uuid=function(){var a=URL.createObjectURL(new Blob),u=a.toString();return URL.revokeObjectURL(a),u.substr(u.lastIndexOf("/")+1)},r.serialize=function(a){for(var u=[],c=function(U){return!Number.isNaN(U)&&U!=null&&U!==""&&U!==!1},R=function(U){return Math.round(U)},O=function(U){return R(U/100)*100},T=function(U){return encodeURIComponent(U)},A={br:R,d:R,bl:O,dl:O,mtp:O,nor:T,rtp:O,tb:R},w=Object.keys(a||{}).sort(),m=P(w),v;!(v=m()).done;){var s=v.value,o=a[s];if(!c(o))continue;if(s==="v"&&o===1)continue;if(s=="pr"&&o===1)continue;var E=A[s];E&&(o=E(o));var g=typeof o,C=void 0;s==="ot"||s==="sf"||s==="st"?C=s+"="+o:g==="boolean"?C=s:g==="number"?C=s+"="+o:C=s+"="+JSON.stringify(o),u.push(C)}return u.join(",")},r.toHeaders=function(a){for(var u=Object.keys(a),c={},R=["Object","Request","Session","Status"],O=[{},{},{},{}],T={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},A=0,w=u;AP){this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=P-this._requestLicenseFailureCount+1;B.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(u,c)}break}},r._generateLicenseRequestChallenge=function(l,a){switch(l.mediaKeySystemDomain){case K.KeySystems.WIDEVINE:return a}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},r._requestLicense=function(l,a){B.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){B.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var c=this.getLicenseServerUrl(u.mediaKeySystemDomain),R=this._createLicenseXhr(c,l,a);B.logger.log("Sending license request to URL: "+c);var O=this._generateLicenseRequestChallenge(u,l);R.send(O)}catch(T){B.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(l,a){if(!this._emeEnabled)return;var u=a.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var l=this._media,a=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(a.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(l,a){if(!this._emeEnabled)return;var u=a.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),c=a.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess(K.KeySystems.WIDEVINE,u,c)},L(h,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),h}();Z.default=_},"./src/controller/fps-controller.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/events.ts"),I=M("./src/utils/logger.ts"),B=function(){function K(L){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=L,this.registerListeners()}var W=K.prototype;return W.setStreamController=function(P){this.streamController=P},W.registerListeners=function(){this.hls.on(V.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(V.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(P,b){var p=this.hls.config;if(p.capLevelOnFPSDrop){var _=b.media instanceof self.HTMLVideoElement?b.media:null;this.media=_,_&&typeof _.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(P,b,p){var _=performance.now();if(b){if(this.lastTime){var h=_-this.lastTime,r=p-this.lastDroppedFrames,d=b-this.lastDecodedFrames,l=1e3*r/h,a=this.hls;if(a.trigger(V.Events.FPS_DROP,{currentDropped:r,currentDecoded:d,totalDroppedFrames:p}),l>0&&r>a.config.fpsDroppedMonitoringThreshold*d){var u=a.currentLevel;I.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(a.autoLevelCapping===-1||a.autoLevelCapping>=u)&&(u=u-1,a.trigger(V.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:a.currentLevel}),a.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=_,this.lastDroppedFrames=p,this.lastDecodedFrames=b}},W.checkFPSInterval=function(){var P=this.media;if(P)if(this.isVideoPlaybackQualityAvailable){var b=P.getVideoPlaybackQuality();this.checkFPS(P,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(P,P.webkitDecodedFrameCount,P.webkitDroppedFrameCount)},K}();Z.default=B},"./src/controller/fragment-finders.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"findFragmentByPDT",function(){return B}),M.d(Z,"findFragmentByPTS",function(){return K}),M.d(Z,"fragmentWithinToleranceTest",function(){return W}),M.d(Z,"pdtWithinToleranceTest",function(){return L}),M.d(Z,"findFragWithCC",function(){return P});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/binary-search.ts");function B(b,p,_){if(p===null||!Array.isArray(b)||!b.length||!Object(V.isFiniteNumber)(p))return null;var h=b[0].programDateTime;if(p<(h||0))return null;var r=b[b.length-1].endProgramDateTime;if(p>=(r||0))return null;_=_||0;for(var d=0;db&&_.start?-1:0}function L(b,p,_){var h=Math.min(p,_.duration+(_.deltaPTS?_.deltaPTS:0))*1e3,r=_.endProgramDateTime||0;return r-h>b}function P(b,p){return I.default.search(b,function(_){return _.ccp?-1:0})}},"./src/controller/fragment-tracker.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"FragmentState",function(){return B}),M.d(Z,"FragmentTracker",function(){return K});var V=M("./src/events.ts"),I=M("./src/types/loader.ts"),B;(function(P){P.NOT_LOADED="NOT_LOADED",P.BACKTRACKED="BACKTRACKED",P.APPENDING="APPENDING",P.PARTIAL="PARTIAL",P.OK="OK"})(B||(B={}));var K=function(){function P(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var b=P.prototype;return b._registerListeners=function(){var _=this.hls;_.on(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.on(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.on(V.Events.FRAG_LOADED,this.onFragLoaded,this)},b._unregisterListeners=function(){var _=this.hls;_.off(V.Events.BUFFER_APPENDED,this.onBufferAppended,this),_.off(V.Events.FRAG_BUFFERED,this.onFragBuffered,this),_.off(V.Events.FRAG_LOADED,this.onFragLoaded,this)},b.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},b.getAppendedFrag=function(_,h){if(h===I.PlaylistLevelType.MAIN){var r=this.activeFragment,d=this.activeParts;if(!r)return null;if(d)for(var l=d.length;l--;){var a=d[l],u=a?a.end:r.appendedPTS;if(a.start<=_&&u!==void 0&&_<=u)return l>9&&(this.activeParts=d.slice(l-9)),a}else if(r.start<=_&&r.appendedPTS!==void 0&&_<=r.appendedPTS)return r}return this.getBufferedFrag(_,h)},b.getBufferedFrag=function(_,h){for(var r=this.fragments,d=Object.keys(r),l=d.length;l--;){var a=r[d[l]];if((a==null?void 0:a.body.type)===h&&a.buffered){var u=a.body;if(u.start<=_&&_<=u.end)return u}}return null},b.detectEvictedFragments=function(_,h,r){var d=this;Object.keys(this.fragments).forEach(function(l){var a=d.fragments[l];if(!a)return;if(!a.buffered){a.body.type===r&&d.removeFragment(a.body);return}var u=a.range[_];if(!u)return;u.time.some(function(c){var R=!d.isTimeBuffered(c.startPTS,c.endPTS,h);return R&&d.removeFragment(a.body),R})})},b.detectPartialFragments=function(_){var h=this,r=this.timeRanges,d=_.frag,l=_.part;if(!r||d.sn==="initSegment")return;var a=L(d),u=this.fragments[a];if(!u)return;Object.keys(r).forEach(function(c){var R=d.elementaryStreams[c];if(!R)return;var O=r[c],T=l!==null||R.partial===!0;u.range[c]=h.getBufferedTimes(d,l,T,O)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},b.fragBuffered=function(_){var h=L(_),r=this.fragments[h];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},b.getBufferedTimes=function(_,h,r,d){for(var l={time:[],partial:r},a=h?h.start:_.start,u=h?h.end:_.end,c=_.minEndPTS||u,R=_.maxStartPTS||a,O=0;O=T&&c<=A){l.time.push({startPTS:Math.max(a,d.start(O)),endPTS:Math.min(u,d.end(O))});break}else if(aT)l.partial=!0,l.time.push({startPTS:Math.max(a,d.start(O)),endPTS:Math.min(u,d.end(O))});else if(u<=T)break}return l},b.getPartialFragment=function(_){var h=null,r,d,l,a=0,u=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(R){var O=c[R];if(!O)return;W(O)&&(d=O.body.start-u,l=O.body.end+u,_>=d&&_<=l&&(r=Math.min(_-d,l-_),a<=r&&(h=O.body,a=r)))}),h},b.getState=function(_){var h=L(_),r=this.fragments[h];return r?r.buffered?W(r)?B.PARTIAL:B.OK:r.backtrack?B.BACKTRACKED:B.APPENDING:B.NOT_LOADED},b.backtrack=function(_,h){var r=L(_),d=this.fragments[r];if(!d||d.backtrack)return null;var l=d.backtrack=h||d.loaded;return d.loaded=null,l},b.getBacktrackData=function(_){var h=L(_),r=this.fragments[h];if(r){var d,l=r.backtrack;if(l!=null&&(d=l.payload)!==null&&d!==void 0&&d.byteLength)return l;this.removeFragment(_)}return null},b.isTimeBuffered=function(_,h,r){for(var d,l,a=0;a=d&&h<=l)return!0;if(h<=d)return!1}return!1},b.onFragLoaded=function(_,h){var r=h.frag,d=h.part;if(r.sn==="initSegment"||r.bitrateTest||d)return;var l=L(r);this.fragments[l]={body:r,loaded:h,backtrack:null,buffered:!1,range:Object.create(null)}},b.onBufferAppended=function(_,h){var r=this,d=h.frag,l=h.part,a=h.timeRanges;if(d.type===I.PlaylistLevelType.MAIN)if(this.activeFragment=d,l){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(l)}else this.activeParts=null;this.timeRanges=a,Object.keys(a).forEach(function(c){var R=a[c];if(r.detectEvictedFragments(c,R),!l)for(var O=0;O_&&d.removeFragment(u)}})},b.removeFragment=function(_){var h=L(_);_.stats.loaded=0,_.clearElementaryStreamInfo(),delete this.fragments[h]},b.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},P}();function W(P){var b,p;return P.buffered&&(((b=P.range.video)===null||b===void 0?void 0:b.partial)||((p=P.range.audio)===null||p===void 0?void 0:p.partial))}function L(P){return P.type+"_"+P.level+"_"+P.urlId+"_"+P.sn}},"./src/controller/gap-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"STALL_MINIMUM_DURATION_MS",function(){return W}),M.d(Z,"MAX_START_GAP_JUMP",function(){return L}),M.d(Z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return P}),M.d(Z,"SKIP_BUFFER_RANGE_START",function(){return b}),M.d(Z,"default",function(){return p});var V=M("./src/utils/buffer-helper.ts"),I=M("./src/errors.ts"),B=M("./src/events.ts"),K=M("./src/utils/logger.ts"),W=250,L=2,P=.1,b=.05,p=function(){function _(r,d,l,a){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=r,this.media=d,this.fragmentTracker=l,this.hls=a}var h=_.prototype;return h.destroy=function(){this.hls=this.fragmentTracker=this.media=null},h.poll=function(d){var l=this.config,a=this.media,u=this.stalled,c=a.currentTime,R=a.seeking,O=this.seeking&&!R,T=!this.seeking&&R;if(this.seeking=R,c!==d){if(this.moved=!0,u!==null){if(this.stallReported){var A=self.performance.now()-u;K.logger.warn("playback not stuck anymore @"+c+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||O)&&(this.stalled=null),a.paused||a.ended||a.playbackRate===0||!V.BufferHelper.getBuffered(a).length)return;var w=V.BufferHelper.bufferInfo(a,c,0),m=w.len>0,v=w.nextStart||0;if(!m&&!v)return;if(R){var s=w.len>L,o=!v||v-c>L&&!this.fragmentTracker.getPartialFragment(c);if(s||o)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,g=Math.max(v,w.start||0)-c,C=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,N=C==null||((E=C.details)===null||E===void 0)?void 0:E.live,U=N?C.details.targetduration*2:L;if(g>0&&g<=U){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(u===null){this.stalled=j;return}var H=j-u;!R&&H>=W&&this._reportStall(w.len);var y=V.BufferHelper.bufferInfo(a,c,l.maxBufferHole);this._tryFixBufferStall(y,H)},h._tryFixBufferStall=function(d,l){var a=this.config,u=this.fragmentTracker,c=this.media,R=c.currentTime,O=u.getPartialFragment(R);if(O){var T=this._trySkipBufferHole(O);if(T)return}d.len>a.maxBufferHole&&l>a.highBufferWatchdogPeriod*1e3&&(K.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},h._reportStall=function(d){var l=this.hls,a=this.media,u=this.stallReported;u||(this.stallReported=!0,K.logger.warn("Playback stalling at @"+a.currentTime+" due to low buffer (buffer="+d+")"),l.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:d}))},h._trySkipBufferHole=function(d){for(var l=this.config,a=this.hls,u=this.media,c=u.currentTime,R=0,O=V.BufferHelper.getBuffered(u),T=0;T=R&&c.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,a)),A=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20;_.playbackRate=Math.min(T,Math.max(1,A))}else _.playbackRate!==1&&_.playbackRate!==0&&(_.playbackRate=1)},b.estimateLiveEdge=function(){var _=this.levelDetails;return _===null?null:_.edge+_.age},b.computeLatency=function(){var _=this.estimateLiveEdge();return _===null?null:_-this.currentTime},W(P,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var _=this.config,h=this.levelDetails;return _.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:h?_.liveMaxLatencyDurationCount*h.targetduration:0}},{key:"targetLatency",get:function(){var _=this.levelDetails;if(_===null)return null;var h=_.holdBack,r=_.partHoldBack,d=_.targetduration,l=this.config,a=l.liveSyncDuration,u=l.liveSyncDurationCount,c=l.lowLatencyMode,R=this.hls.userConfig,O=c&&r||h;(R.liveSyncDuration||R.liveSyncDurationCount||O===0)&&(O=a!==void 0?a:u*d);var T=d,A=1;return O+Math.min(this.stallCount*A,T)}},{key:"liveSyncPosition",get:function(){var _=this.estimateLiveEdge(),h=this.targetLatency,r=this.levelDetails;if(_===null||h===null||r===null)return null;var d=r.edge,l=_-h-this.edgeStalled,a=d-r.totalduration,u=d-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(a,l),u)}},{key:"drift",get:function(){var _=this.levelDetails;return _===null?1:_.drift}},{key:"edgeStalled",get:function(){var _=this.levelDetails;if(_===null)return 0;var h=(this.config.lowLatencyMode&&_.partTarget||_.targetduration)*3;return Math.max(_.age-h,0)}},{key:"forwardBufferLength",get:function(){var _=this.media,h=this.levelDetails;if(!_||!h)return 0;var r=_.buffered.length;return r?_.buffered.end(r-1):h.edge-this.currentTime}}]),P}()},"./src/controller/level-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return l});var V=M("./src/types/level.ts"),I=M("./src/events.ts"),B=M("./src/errors.ts"),K=M("./src/utils/codecs.ts"),W=M("./src/controller/level-helper.ts"),L=M("./src/controller/base-playlist-controller.ts"),P=M("./src/types/loader.ts");function b(){return b=Object.assign||function(a){for(var u=1;u0){v=A[0].bitrate,A.sort(function(H,y){return H.bitrate-y.bitrate}),this._levels=A;for(var N=0;Nthis.hls.config.fragLoadingMaxRetry&&(s=T.frag.level)):s=T.frag.level}break;case B.ErrorDetails.LEVEL_LOAD_ERROR:case B.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(v=!1),s=A.level),m=!0;break;case B.ErrorDetails.REMUX_ALLOC_ERROR:s=T.level,m=!0;break}s!==void 0&&this.recoverLevel(T,s,m,v)},c.recoverLevel=function(O,T,A,w){var m=O.details,v=this._levels[T];if(v.loadError++,A){var s=this.retryLoadingOrFail(O);if(s)O.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(w){var o=v.url.length;if(o>1&&v.loadError1){var w=(T.urlId+1)%A;this.warn("Switching to redundant URL-id "+w),this._levels.forEach(function(m){m.urlId=w}),this.level=O}},c.onFragLoaded=function(O,T){var A=T.frag;if(A!==void 0&&A.type===P.PlaylistLevelType.MAIN){var w=this._levels[A.level];w!==void 0&&(w.fragmentError=0,w.loadError=0)}},c.onLevelLoaded=function(O,T){var A,w=T.level,m=T.details,v=this._levels[w];if(!v){var s;this.warn("Invalid level index "+w),(s=T.deliveryDirectives)!==null&&s!==void 0&&s.skip&&(m.deltaUpdateFailed=!0);return}w===this.currentLevelIndex?(v.fragmentError===0&&(v.loadError=0,this.retryCount=0),this.playlistLoaded(w,T,v.details)):(A=T.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(m.deltaUpdateFailed=!0)},c.onAudioTrackSwitched=function(O,T){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var w=-1,m=this.hls.audioTracks[T.id].groupId,v=0;v0){var w=A.urlId,m=A.url[w];if(O)try{m=O.addDirectives(m)}catch(v){this.warn("Could not construct new URL with HLS Delivery Directives: "+v)}this.log("Attempt loading level index "+T+(O?" at sn "+O.msn+" part "+O.part:"")+" with URL-id "+w+" "+m),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:m,level:T,id:w,deliveryDirectives:O||null})}},c.removeLevel=function(O,T){var A=function(v,s){return s!==T},w=this._levels.filter(function(m,v){return v!==O?!0:m.url.length>1&&T!==void 0?(m.url=m.url.filter(A),m.audioGroupIds&&(m.audioGroupIds=m.audioGroupIds.filter(A)),m.textGroupIds&&(m.textGroupIds=m.textGroupIds.filter(A)),m.urlId=0,!0):!1}).map(function(m,v){var s=m.details;return s!=null&&s.fragments&&s.fragments.forEach(function(o){o.level=v}),m});this._levels=w,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:w})},_(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(O){var T,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===O&&(T=A[O])!==null&&T!==void 0&&T.details)return;if(O<0||O>=A.length){var w=O<0;if(this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.OTHER_ERROR,details:B.ErrorDetails.LEVEL_SWITCH_ERROR,level:O,fatal:w,reason:"invalid level idx"}),w)return;O=Math.min(O,A.length-1)}this.clearTimer();var m=this.currentLevelIndex,v=A[m],s=A[O];this.log("switching to level "+O+" from "+m),this.currentLevelIndex=O;var o=b({},s,{level:O,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete o._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,o);var E=s.details;if(!E||E.live){var g=this.switchParams(s.uri,v==null?void 0:v.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(O){this.manualLevelIndex=O,this._startLevel===void 0&&(this._startLevel=O),O!==-1&&(this.level=O)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(O){this._firstLevel=O}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var O=this.hls.config.startLevel;return O!==void 0?O:this._firstLevel}else return this._startLevel},set:function(O){this._startLevel=O}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(O){this.level=O,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=O)}}]),u}(L.default)},"./src/controller/level-helper.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"addGroupId",function(){return B}),M.d(Z,"assignTrackIdsByGroup",function(){return K}),M.d(Z,"updatePTS",function(){return W}),M.d(Z,"updateFragPTSDTS",function(){return P}),M.d(Z,"mergeDetails",function(){return b}),M.d(Z,"mapPartIntersection",function(){return p}),M.d(Z,"mapFragmentIntersection",function(){return _}),M.d(Z,"adjustSliding",function(){return h}),M.d(Z,"addSliding",function(){return r}),M.d(Z,"computeReloadInterval",function(){return d}),M.d(Z,"getFragmentWithSN",function(){return l}),M.d(Z,"getPartWith",function(){return a});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/logger.ts");function B(u,c,R){switch(c){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(R);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(R);break}}function K(u){var c={};u.forEach(function(R){var O=R.groupId||"";R.id=c[O]=c[O]||0,c[O]++})}function W(u,c,R){var O=u[c],T=u[R];L(O,T)}function L(u,c){var R=c.startPTS;if(Object(V.isFiniteNumber)(R)){var O=0,T;c.sn>u.sn?(O=R-u.start,T=u):(O=u.start-R,T=c),T.duration!==O&&(T.duration=O)}else if(c.sn>u.sn){var A=u.cc===c.cc;A&&u.minEndPTS?c.start=u.start+(u.minEndPTS-u.start):c.start=u.start+u.duration}else c.start=Math.max(u.start-c.duration,0)}function P(u,c,R,O,T,A){var w=O-R;w<=0&&(I.logger.warn("Fragment should have a positive duration",c),O=R+c.duration,A=T+c.duration);var m=R,v=O,s=c.startPTS,o=c.endPTS;if(Object(V.isFiniteNumber)(s)){var E=Math.abs(s-R);Object(V.isFiniteNumber)(c.deltaPTS)?c.deltaPTS=Math.max(E,c.deltaPTS):c.deltaPTS=E,m=Math.max(R,s),R=Math.min(R,s),T=Math.min(T,c.startDTS),v=Math.min(O,o),O=Math.max(O,o),A=Math.max(A,c.endDTS)}c.duration=O-R;var g=R-c.start;c.appendedPTS=O,c.start=c.startPTS=R,c.maxStartPTS=m,c.startDTS=T,c.endPTS=O,c.minEndPTS=v,c.endDTS=A;var C=c.sn;if(!u||Cu.endSN)return 0;var N,U=C-u.startSN,j=u.fragments;for(j[U]=c,N=U;N>0;N--)L(j[N],j[N-1]);for(N=U;N=0;T--){var A=O[T].initSegment;if(A){R=A;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var w=0,m;if(_(u,c,function(N,U){N.relurl&&(w=N.cc-U.cc),Object(V.isFiniteNumber)(N.startPTS)&&Object(V.isFiniteNumber)(N.endPTS)&&(U.start=U.startPTS=N.startPTS,U.startDTS=N.startDTS,U.appendedPTS=N.appendedPTS,U.maxStartPTS=N.maxStartPTS,U.endPTS=N.endPTS,U.endDTS=N.endDTS,U.minEndPTS=N.minEndPTS,U.duration=N.endPTS-N.startPTS,U.duration&&(m=U),c.PTSKnown=c.alignedSliding=!0),U.elementaryStreams=N.elementaryStreams,U.loader=N.loader,U.stats=N.stats,U.urlId=N.urlId,N.initSegment&&(U.initSegment=N.initSegment,R=N.initSegment)}),R){var v=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments;v.forEach(function(N){var U;(!N.initSegment||N.initSegment.relurl===((U=R)===null||U===void 0?void 0:U.relurl))&&(N.initSegment=R)})}if(c.skippedSegments&&(c.deltaUpdateFailed=c.fragments.some(function(N){return!N}),c.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var s=c.skippedSegments;s--;)c.fragments.shift();c.startSN=c.fragments[0].sn,c.startCC=c.fragments[0].cc}var o=c.fragments;if(w){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E=O.length)return;r(c,O[R].start)}function r(u,c){if(c){for(var R=u.fragments,O=u.skippedSegments;O0&&T0&&v===-1&&(this.log("Override startPosition with lastCurrentTime @"+s.toFixed(3)),v=s),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=v,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var v,s=this.levels,o=this.level,E=s==null||((v=s[o])===null||v===void 0)?void 0:v.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var g,C=self.performance.now(),N=this.retryDate;(!N||C>=N||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},w.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var v,s,o=this.hls,E=this.levelLastLoaded,g=this.levels,C=this.media,N=o.config,U=o.nextLoadLevel;if(E===null||!C&&(this.startFragRequested||!N.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[U])return;var j=g[U];this.level=o.nextLoadLevel=U;var H=j.details;if(!H||this.state===I.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==U){this.state=I.State.WAITING_LEVEL;return}var y=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:C,P.PlaylistLevelType.MAIN);if(y===null)return;var x=y.len,F=this.getMaxBufferLength(j.maxBitrate);if(x>=F)return;if(this._streamEnded(y,H)){var Q={};this.altAudio&&(Q.type="video"),this.hls.trigger(K.Events.BUFFER_EOS,Q),this.state=I.State.ENDED;return}var q=y.end,ie=this.getNextFragment(q,H);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"){var ge=ie.sn-H.startSN;ge>1&&(ie=H.fragments[ge-1],this.fragmentTracker.removeFragment(ie))}if(ie&&this.fragmentTracker.getState(ie)===L.FragmentState.OK&&this.nextLoadPosition>q){var fe=this.audioOnly&&!this.altAudio?b.ElementaryStreamTypes.AUDIO:b.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(C,fe,P.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,H)}if(!ie)return;ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),((v=ie.decryptdata)===null||v===void 0?void 0:v.keyFormat)==="identity"&&!((s=ie.decryptdata)!==null&&s!==void 0&&s.key)?this.loadKey(ie,H):this.loadFragment(ie,H,q)},w.loadFragment=function(v,s,o){var E,g=this.fragmentTracker.getState(v);if(this.fragCurrent=v,g===L.FragmentState.BACKTRACKED){var C=this.fragmentTracker.getBacktrackData(v);if(C){this._handleFragmentLoadProgress(C),this._handleFragmentLoadComplete(C);return}else g=L.FragmentState.NOT_LOADED}g===L.FragmentState.NOT_LOADED||g===L.FragmentState.PARTIAL?v.sn==="initSegment"?this._loadInitSegment(v):this.bitrateTest?(v.bitrateTest=!0,this.log("Fragment "+v.sn+" of level "+v.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(v)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,v,s,o)):g===L.FragmentState.APPENDING?this.reduceMaxBufferLength(v.duration)&&this.fragmentTracker.removeFragment(v):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(v){var s=this.fragmentTracker.getAppendedFrag(v,P.PlaylistLevelType.MAIN);return s&&"fragment"in s?s.fragment:s},w.getBufferedFrag=function(v){return this.fragmentTracker.getBufferedFrag(v,P.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(v){return v?this.getBufferedFrag(v.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var v=this.levels,s=this.media;if(s!=null&&s.readyState){var o,E=this.getAppendedFrag(s.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!s.paused&&v){var g=this.hls.nextLoadLevel,C=v[g],N=this.fragLastKbps;N&&this.fragCurrent?o=this.fragCurrent.duration*C.maxBitrate/(1e3*N)+1:o=0}else o=0;var U=this.getBufferedFrag(s.currentTime+o);if(U){var j=this.followingBufferedFrag(U);if(j){this.abortCurrentFrag();var H=j.maxStartPTS?j.maxStartPTS:j.start,y=j.duration,x=Math.max(U.end,H+Math.min(Math.max(y-this.config.maxFragLookUpTolerance,y*.5),y*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var v=this.fragCurrent;this.fragCurrent=null,v!=null&&v.loader&&v.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(v,s){T.prototype.flushMainBuffer.call(this,v,s,this.altAudio?"video":null)},w.onMediaAttached=function(v,s){T.prototype.onMediaAttached.call(this,v,s);var o=s.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),o.addEventListener("playing",this.onvplaying),o.addEventListener("seeked",this.onvseeked),this.gapController=new h.default(this.config,o,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var v=this.media;v&&(v.removeEventListener("playing",this.onvplaying),v.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var v=this.media,s=v?v.currentTime:null;Object(V.isFiniteNumber)(s)&&this.log("Media seeked to "+s.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(K.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(v,s){var o=!1,E=!1,g;s.levels.forEach(function(C){g=C.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(o=!0),g.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=o&&E&&!Object(B.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=s.levels,this.startFragRequested=!1},w.onLevelLoading=function(v,s){var o=this.levels;if(!o||this.state!==I.State.IDLE)return;var E=o[s.level];(!E.details||E.details.live&&this.levelLastLoaded!==s.level||this.waitForCdnTuneIn(E.details))&&(this.state=I.State.WAITING_LEVEL)},w.onLevelLoaded=function(v,s){var o,E=this.levels,g=s.level,C=s.details,N=C.totalduration;if(!E){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+C.startSN+","+C.endSN+"], cc ["+C.startCC+", "+C.endCC+"] duration:"+N);var U=this.fragCurrent;U&&(this.state===I.State.FRAG_LOADING||this.state===I.State.FRAG_LOADING_WAITING_RETRY)&&(U.level!==s.level&&U.loader&&(this.state=I.State.IDLE,U.loader.abort()));var j=E[g],H=0;if(C.live||(o=j.details)!==null&&o!==void 0&&o.live){if(C.fragments[0]||(C.deltaUpdateFailed=!0),C.deltaUpdateFailed)return;H=this.alignPlaylists(C,j.details)}if(j.details=C,this.levelLastLoaded=g,this.hls.trigger(K.Events.LEVEL_UPDATED,{details:C,level:g}),this.state===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(C))return;this.state=I.State.IDLE}this.startFragRequested?C.live&&this.synchronizeToLiveEdge(C):this.setStartPosition(C,H),this.tick()},w._handleFragmentLoadProgress=function(v){var s,o=v.frag,E=v.part,g=v.payload,C=this.levels;if(!C){this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered");return}var N=C[o.level],U=N.details;if(!U){this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset");return}var j=N.videoCodec,H=U.PTSKnown||!U.live,y=(s=o.initSegment)===null||s===void 0?void 0:s.data,x=this._getAudioCodec(N),F=this.transmuxer=this.transmuxer||new p.default(this.hls,P.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Q=E?E.index:-1,q=Q!==-1,ie=new _.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,g.byteLength,Q,q),ge=this.initPTS[o.cc];F.push(g,y,x,j,o,E,U.totalduration,H,ie,ge)},w.onAudioTrackSwitching=function(v,s){var o=this.altAudio,E=!!s.url,g=s.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var C=this.fragCurrent;C!=null&&C.loader&&(this.log("Switching to main audio track, cancel main fragment load"),C.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var N=this.hls;o&&N.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),N.trigger(K.Events.AUDIO_TRACK_SWITCHED,{id:g})}},w.onAudioTrackSwitched=function(v,s){var o=s.id,E=!!this.hls.audioTracks[o].url;if(E){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=E,this.tick()},w.onBufferCreated=function(v,s){var o=s.tracks,E,g,C=!1;for(var N in o){var U=o[N];if(U.id==="main"){if(g=N,E=U,N==="video"){var j=o[N];j&&(this.videoBuffer=j.buffer)}}else C=!0}C&&E?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(v,s){var o=s.frag,E=s.part;if(o&&o.type!==P.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(o)){this.warn("Fragment "+o.sn+(E?" p: "+E.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var g=E?E.stats:o.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),o.sn!=="initSegment"&&(this.fragPrevious=o),this.fragBufferedComplete(o,E)},w.onError=function(v,s){switch(s.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(P.PlaylistLevelType.MAIN,s);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==I.State.ERROR&&(s.fatal?(this.warn(""+s.details),this.state=I.State.ERROR):!s.levelRetry&&this.state===I.State.WAITING_LEVEL&&(this.state=I.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(s.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var o=!0,E=this.getFwdBufferInfo(this.media,P.PlaylistLevelType.MAIN);E&&E.len>.5&&(o=!this.reduceMaxBufferLength(E.len)),o&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},w.checkBuffer=function(){var v=this.media,s=this.gapController;if(!v||!s||!v.readyState)return;var o=W.BufferHelper.getBuffered(v);!this.loadedmetadata&&o.length?(this.loadedmetadata=!0,this.seekToStartPos()):s.poll(this.lastCurrentTime),this.lastCurrentTime=v.currentTime},w.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(v,s){var o=s.type;if(o!==b.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(o===b.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,o,P.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(v,s){this.levels=s.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var v=this.media,s=v.currentTime,o=this.startPosition;if(o>=0&&s0&&(C1&&v.seeking===!1){var o=v.currentTime;if(W.BufferHelper.isBuffered(v,o)?s=this.getAppendedFrag(o):W.BufferHelper.isBuffered(v,o+.1)&&(s=this.getAppendedFrag(o+.1)),s){var E=this.fragPlaying,g=s.level;(!E||s.sn!==E.sn||E.level!==g||s.urlId!==E.urlId)&&(this.hls.trigger(K.Events.FRAG_CHANGED,{frag:s}),(!E||E.level!==g)&&this.hls.trigger(K.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=s)}}},a(A,[{key:"nextLevel",get:function(){var v=this.nextBufferedFrag;return v?v.level:-1}},{key:"currentLevel",get:function(){var v=this.media;if(v){var s=this.getAppendedFrag(v.currentTime);if(s)return s.level}return-1}},{key:"nextBufferedFrag",get:function(){var v=this.media;if(v){var s=this.getAppendedFrag(v.currentTime);return this.followingBufferedFrag(s)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"SubtitleStreamController",function(){return u});var V=M("./src/events.ts"),I=M("./src/utils/logger.ts"),B=M("./src/utils/buffer-helper.ts"),K=M("./src/controller/fragment-finders.ts"),W=M("./src/utils/discontinuities.ts"),L=M("./src/controller/level-helper.ts"),P=M("./src/controller/fragment-tracker.ts"),b=M("./src/controller/base-stream-controller.ts"),p=M("./src/types/loader.ts"),_=M("./src/types/level.ts");function h(c,R){for(var O=0;O=s[g].start&&E<=s[g].end){o=s[g];break}var C=m.start+m.duration;o?o.end=C:(o={start:E,end:C},s.push(o)),this.fragmentTracker.fragBuffered(m)},O.onBufferFlushing=function(A,w){var m=w.startOffset,v=w.endOffset;if(m===0&&v!==Number.POSITIVE_INFINITY){var s=this.currentTrackId,o=this.levels;if(!o.length||!o[s]||!o[s].details)return;var E=o[s].details,g=E.targetduration,C=v-g;if(C<=0)return;w.endOffsetSubtitles=Math.max(0,C),this.tracksBuffered.forEach(function(N){for(var U=0;U=E.length||s!==o||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,v.live||(m=g.details)!==null&&m!==void 0&&m.live){var C=this.mainDetails;if(v.deltaUpdateFailed||!C)return;var N=C.fragments[0];if(!g.details)v.hasProgramDateTime&&C.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(v,C):N&&Object(L.addSliding)(v,N.start);else{var U=this.alignPlaylists(v,g.details);U===0&&N&&Object(L.addSliding)(v,N.start)}}if(g.details=v,this.levelLastLoaded=s,this.tick(),v.live&&!this.fragCurrent&&this.media&&this.state===b.State.IDLE){var j=Object(K.findFragmentByPTS)(null,v.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},O._handleFragmentLoadComplete=function(A){var w=A.frag,m=A.payload,v=w.decryptdata,s=this.hls;if(this.fragContextChanged(w))return;if(m&&m.byteLength>0&&v&&v.key&&v.iv&&v.method==="AES-128"){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(m),v.key.buffer,v.iv.buffer).then(function(E){var g=performance.now();s.trigger(V.Events.FRAG_DECRYPTED,{frag:w,payload:E,stats:{tstart:o,tdecrypt:g}})})}},O.doTick=function(){if(!this.media){this.state=b.State.IDLE;return}if(this.state===b.State.IDLE){var A,w=this.currentTrackId,m=this.levels;if(!m.length||!m[w]||!m[w].details)return;var v=m[w].details,s=v.targetduration,o=this.config,E=this.media,g=B.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-s,o.maxBufferHole),C=g.end,N=g.len,U=this.getMaxBufferLength()+s;if(N>U)return;console.assert(v,"Subtitle track details are defined on idle subtitle stream controller tick");var j=v.fragments,H=j.length,y=v.edge,x,F=this.fragPrevious;if(C-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)},d.pollTrackChange=function(a){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,a)},d.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 a=_(this.media.textTracks);a.forEach(function(u){Object(I.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},d.onManifestParsed=function(a,u){this.tracks=u.subtitleTracks},d.onSubtitleTrackLoaded=function(a,u){var c=u.id,R=u.details,O=this.trackId,T=this.tracksInGroup[O];if(!T){this.warn("Invalid subtitle track id "+c);return}var A=T.details;T.details=u.details,this.log("subtitle track "+c+" loaded ["+R.startSN+"-"+R.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,u,A))},d.onLevelLoading=function(a,u){this.switchLevel(u.level)},d.onLevelSwitching=function(a,u){this.switchLevel(u.level)},d.switchLevel=function(a){var u=this.hls.levels[a];if(!(u!=null&&u.textGroupIds))return;var c=u.textGroupIds[u.urlId];if(this.groupId!==c){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,O=this.tracks.filter(function(w){return!c||w.groupId===c});this.tracksInGroup=O;var T=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=c;var A={subtitleTracks:O};this.log("Updating subtitle tracks, "+O.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(V.Events.SUBTITLE_TRACKS_UPDATED,A),T!==-1&&this.setSubtitleTrack(T,R)}},d.findTrackId=function(a){for(var u=this.tracksInGroup,c=0;c=R.length)return;this.clearTimer();var O=R[a];if(this.log("Switching to subtitle track "+a),this.trackId=a,O){var T=O.id,A=O.groupId,w=A===void 0?"":A,m=O.name,v=O.type,s=O.url;this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:w,name:m,type:v,url:s});var o=this.switchParams(O.url,u==null?void 0:u.details);this.loadPlaylist(o)}else this.hls.trigger(V.Events.SUBTITLE_TRACK_SWITCH,{id:a})},d.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var a=-1,u=_(this.media.textTracks),c=0;c=0&&(v[0]=Math.min(v[0],R),v[1]=Math.max(v[1],O),w=!0,s/(O-R)>.5))return}if(w||A.push([R,O]),this.config.renderTextTracksNatively){var o=this.captionsTracks[c];this.Cues.newCue(o,R,O,T)}else{var E=this.Cues.newCue(null,R,O,T);this.hls.trigger(I.Events.CUES_PARSED,{type:"captions",cues:E,track:c})}},a.onInitPtsFound=function(c,R){var O=this,T=R.frag,A=R.id,w=R.initPTS,m=R.timescale,v=this.unparsedVttFrags;A==="main"&&(this.initPTS[T.cc]=w,this.timescale[T.cc]=m),v.length&&(this.unparsedVttFrags=[],v.forEach(function(s){O.onFragLoaded(I.Events.FRAG_LOADED,s)}))},a.getExistingTrack=function(c){var R=this.media;if(R)for(var O=0;O>>8^m&255^99,P[T]=m,b[m]=T;var v=O[T],s=O[v],o=O[s],E=O[m]*257^m*16843008;_[T]=E<<24|E>>>8,h[T]=E<<16|E>>>16,r[T]=E<<8|E>>>24,d[T]=E,E=o*16843009^s*65537^v*257^T*16843008,a[m]=E<<24|E>>>8,u[m]=E<<16|E>>>16,c[m]=E<<8|E>>>24,R[m]=E,T?(T=v^O[O[O[o^v]]],A^=O[O[A]]):T=A=1}},W.expandKey=function(P){for(var b=this.uint8ArrayToUint32Array_(P),p=!0,_=0;_>>6)+1;var E=(c[R+2]&60)>>>2;if(E>o.length-1){u.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return w=(c[R+2]&1)<<2,w|=(c[R+3]&192)>>>6,V.logger.log("manifest codec:"+O+", ADTS type:"+T+", samplingIndex:"+E),/firefox/i.test(v)?E>=6?(T=5,m=new Array(4),A=E-3):(T=2,m=new Array(2),A=E):v.indexOf("android")!==-1?(T=2,m=new Array(2),A=E):(T=5,m=new Array(4),O&&(O.indexOf("mp4a.40.29")!==-1||O.indexOf("mp4a.40.5")!==-1)||!O&&E>=6?A=E-3:((O&&O.indexOf("mp4a.40.2")!==-1&&(E>=6&&w===1||/vivaldi/i.test(v))||!O&&w===1)&&(T=2,m=new Array(2)),A=E)),m[0]=T<<3,m[0]|=(E&14)>>1,m[1]|=(E&1)<<7,m[1]|=w<<3,T===5&&(m[1]|=(A&14)>>1,m[2]=(A&1)<<7,m[2]|=2<<2,m[3]=0),{config:m,samplerate:o[E],channelCount:w,codec:"mp4a.40."+T,manifestCodec:s}}function W(u,c){return u[c]===255&&(u[c+1]&246)===240}function L(u,c){return u[c+1]&1?7:9}function P(u,c){return(u[c+3]&3)<<11|u[c+4]<<3|(u[c+5]&224)>>>5}function b(u,c){return c+5=u.length)return!1;var O=P(u,c);if(O<=R)return!1;var T=c+O;return T===u.length||p(u,T)}return!1}function r(u,c,R,O,T){if(!u.samplerate){var A=K(c,R,O,T);if(!A)return;u.config=A.config,u.samplerate=A.samplerate,u.channelCount=A.channelCount,u.codec=A.codec,u.manifestCodec=A.manifestCodec,V.logger.log("parsed codec:"+u.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function d(u){return 1024*9e4/u}function l(u,c,R,O,T){var A=L(u,c),w=P(u,c);if(w-=A,w>0){var m=R+O*T;return{headerLength:A,frameLength:w,stamp:m}}}function a(u,c,R,O,T){var A=d(u.samplerate),w=l(c,R,O,T,A);if(w){var m=w.frameLength,v=w.headerLength,s=w.stamp,o=v+m,E=Math.max(0,R+o-c.length),g;E?(g=new Uint8Array(o-v),g.set(c.subarray(R+v,c.length),0)):g=c.subarray(R+v,R+o);var C={unit:g,pts:s};return E||u.samples.push(C),{sample:C,length:o,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"initPTSFn",function(){return P});var V=M("./src/polyfills/number.ts"),I=M("./src/demux/id3.ts"),B=M("./src/demux/dummy-demuxed-track.ts"),K=M("./src/utils/mp4-tools.ts"),W=M("./src/utils/typed-array.ts"),L=function(){function b(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=b.prototype;return p.resetInitSegment=function(h,r,d){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(h,r){return!1},p.appendFrame=function(h,r,d){},p.demux=function(h,r){this.cachedData&&(h=Object(K.appendUint8Array)(this.cachedData,h),this.cachedData=null);var d=I.getID3Data(h,0),l=d?d.length:0,a,u,c=this._audioTrack,R=this._id3Track,O=d?I.getTimeStamp(d):void 0,T=h.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=P(O,r)),d&&d.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:d}),u=this.initPTS;lL?(this.word<<=L,this.bitsAvailable-=L):(L-=this.bitsAvailable,P=L>>3,L-=P>>3,this.bytesAvailable-=P,this.loadWord(),this.word<<=L,this.bitsAvailable-=L)},K.readBits=function(L){var P=Math.min(this.bitsAvailable,L),b=this.word>>>32-P;return L>32&&V.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=P,this.bitsAvailable>0?this.word<<=P:this.bytesAvailable>0&&this.loadWord(),P=L-P,P>0&&this.bitsAvailable?b<>>L)!==0)return this.word<<=L,this.bitsAvailable-=L,L;return this.loadWord(),L+this.skipLZ()},K.skipUEG=function(){this.skipBits(1+this.skipLZ())},K.skipEG=function(){this.skipBits(1+this.skipLZ())},K.readUEG=function(){var L=this.skipLZ();return this.readBits(L+1)-1},K.readEG=function(){var L=this.readUEG();return 1&L?1+L>>>1:-1*(L>>>1)},K.readBoolean=function(){return this.readBits(1)===1},K.readUByte=function(){return this.readBits(8)},K.readUShort=function(){return this.readBits(16)},K.readUInt=function(){return this.readBits(32)},K.skipScalingList=function(L){for(var P=8,b=8,p,_=0;_0?T.subarray(w,w+m):void 0},K=function(T,A){var w=0;return w=(T[A]&127)<<21,w|=(T[A+1]&127)<<14,w|=(T[A+2]&127)<<7,w|=T[A+3]&127,w},W=function(T,A){return V(T,A)&&K(T,A+6)+10<=T.length-A},L=function(T){for(var A=p(T),w=0;w>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:C+=String.fromCharCode(o);break;case 12:case 13:E=T[N++],C+=String.fromCharCode((o&31)<<6|E&63);break;case 14:E=T[N++],g=T[N++],C+=String.fromCharCode((o&15)<<12|(E&63)<<6|(g&63)<<0);break;default:}}return C},u={decodeTextFrame:r},c;function R(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/demux/base-audio-demuxer.ts"),I=M("./src/demux/id3.ts"),B=M("./src/utils/logger.ts"),K=M("./src/demux/mpegaudio.ts");function W(b,p){b.prototype=Object.create(p.prototype),b.prototype.constructor=b,L(b,p)}function L(b,p){return L=Object.setPrototypeOf||function(h,r){return h.__proto__=r,h},L(b,p)}var P=function(b){W(p,b);function p(){return b.apply(this,arguments)||this}var _=p.prototype;return _.resetInitSegment=function(r,d,l){b.prototype.resetInitSegment.call(this,r,d,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(r){if(!r)return!1;for(var d=I.getID3Data(r,0)||[],l=d.length,a=r.length;l0},W.demux=function(P){var b=P,p=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(b=Object(V.appendUint8Array)(this.remainderData,P));var _=Object(V.segmentValidRange)(b);this.remainderData=_.remainder,p.samples=_.valid||new Uint8Array}else p.samples=b;return{audioTrack:Object(I.dummyTrack)(),avcTrack:p,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},W.flush=function(){var P=Object(I.dummyTrack)();return P.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:P,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},W.demuxSampleAes=function(P,b,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},K}();B.minProbeByteLength=1024,Z.default=B},"./src/demux/mpegaudio.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"appendFrame",function(){return L}),M.d(Z,"parseHeader",function(){return P}),M.d(Z,"isHeaderPattern",function(){return b}),M.d(Z,"isHeader",function(){return p}),M.d(Z,"canParse",function(){return _}),M.d(Z,"probe",function(){return h});var V=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],B=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],K=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function L(r,d,l,a,u){if(l+24>d.length)return;var c=P(d,l);if(c&&l+c.frameLength<=d.length){var R=c.samplesPerFrame*9e4/c.sampleRate,O=a+u*R,T={unit:d.subarray(l,l+c.frameLength),pts:O,dts:O};return r.config=[],r.channelCount=c.channelCount,r.samplerate=c.sampleRate,r.samples.push(T),{sample:T,length:c.frameLength,missing:0}}}function P(r,d){var l=r[d+1]>>3&3,a=r[d+1]>>1&3,u=r[d+2]>>4&15,c=r[d+2]>>2&3;if(l!==1&&u!==0&&u!==15&&c!==3){var R=r[d+2]>>1&1,O=r[d+3]>>6,T=l===3?3-a:a===3?3:4,A=I[T*14+u-1]*1e3,w=l===3?0:l===2?1:2,m=B[w*3+c],v=O===3?1:2,s=K[l][a],o=W[a],E=s*8*o,g=Math.floor(s*A/m+R)*o;if(V===null){var C=navigator.userAgent||"",N=C.match(/Chrome\/(\d+)/i);V=N?parseInt(N[1]):0}var U=!!V&&V<=87;return U&&a===2&&A>=224e3&&O===0&&(r[d+3]=r[d+3]|128),{sampleRate:m,channelCount:v,frameLength:g,samplesPerFrame:E}}}function b(r,d){return r[d]===255&&(r[d+1]&224)===224&&(r[d+1]&6)!==0}function p(r,d){return d+1=P.length){p();return}if(P[b].unit.length<32)continue;var _=this.decrypter.isSync();if(this.decryptAacSample(P,b,p,_),!_)return}},W.getAvcEncryptedData=function(P){for(var b=Math.floor((P.length-48)/160)*16+16,p=new Int8Array(b),_=0,h=32;h<=P.length-16;h+=160,_+=16)p.set(P.subarray(h,h+16),_);return p},W.getAvcDecryptedUnit=function(P,b){for(var p=new Uint8Array(b),_=0,h=32;h<=P.length-16;h+=160,_+=16)P.set(p.subarray(_,_+16),h);return P},W.decryptAvcSample=function(P,b,p,_,h,r){var d=Object(I.discardEPB)(h.data),l=this.getAvcEncryptedData(d),a=this;this.decryptBuffer(l.buffer,function(u){h.data=a.getAvcDecryptedUnit(d,u),r||a.decryptAvcSamples(P,b,p+1,_)})},W.decryptAvcSamples=function(P,b,p,_){if(P instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;b++,p=0){if(b>=P.length){_();return}for(var h=P[b].units;!(p>=h.length);p++){var r=h[p];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var d=this.decrypter.isSync();if(this.decryptAvcSample(P,b,p,_,r,d),!d)return}}},K}();Z.default=B},"./src/demux/transmuxer-interface.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h});var V=M("./node_modules/webworkify-webpack/index.js"),I=M.n(V),B=M("./src/events.ts"),K=M("./src/demux/transmuxer.ts"),W=M("./src/utils/logger.ts"),L=M("./src/errors.ts"),P=M("./src/utils/mediasource-helper.ts"),b=M("./node_modules/eventemitter3/index.js"),p=M.n(b),_=Object(P.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function r(l,a,u,c){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=l,this.id=a,this.onTransmuxComplete=u,this.onFlush=c;var O=l.config,T=function(s,o){o=o||{},o.frag=R.frag,o.id=R.id,l.trigger(s,o)};this.observer=new b.EventEmitter,this.observer.on(B.Events.FRAG_DECRYPTED,T),this.observer.on(B.Events.ERROR,T);var A={mp4:_.isTypeSupported("video/mp4"),mpeg:_.isTypeSupported("audio/mpeg"),mp3:_.isTypeSupported('audio/mp4; codecs="mp3"')},w=navigator.vendor;if(O.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var m;try{m=this.worker=V("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),m.addEventListener("message",this.onwmsg),m.onerror=function(v){l.trigger(B.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(v.message+" ("+v.filename+":"+v.lineno+")")})},m.postMessage({cmd:"init",typeSupported:A,vendor:w,id:a,config:JSON.stringify(O)})}catch(v){W.logger.warn("Error in worker:",v),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),m&&self.URL.revokeObjectURL(m.objectURL),this.transmuxer=new K.default(this.observer,A,O,w,a),this.worker=null}}else this.transmuxer=new K.default(this.observer,A,O,w,a)}var d=r.prototype;return d.destroy=function(){var a=this.worker;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var c=this.observer;c&&c.removeAllListeners(),this.observer=null},d.push=function(a,u,c,R,O,T,A,w,m,v){var s=this;m.transmuxing.start=self.performance.now();var o=this.transmuxer,E=this.worker,g=T?T.start:O.start,C=O.decryptdata,N=this.frag,U=!(N&&O.cc===N.cc),j=!(N&&m.level===N.level),H=N?m.sn-N.sn:-1,y=this.part?m.part-this.part.index:1,x=!j&&(H===1||H===0&&y===1),F=self.performance.now();(j||H||O.stats.parsing.start===0)&&(O.stats.parsing.start=F),T&&(y||!x)&&(T.stats.parsing.start=F);var Q=new K.TransmuxState(U,x,w,j,g);if(!x||U){W.logger.log("[transmuxer-interface, "+O.type+"]: Starting new transmux session for sn: "+m.sn+" p: "+m.part+" level: "+m.level+" id: "+m.id+` discontinuity: `+U+` trackSwitch: `+j+` contiguous: `+x+` accurateTimeOffset: `+w+` timeOffset: `+g);var q=new K.TransmuxConfig(c,R,u,A,v);this.configureTransmuxer(q)}if(this.frag=O,this.part=T,E)E.postMessage({cmd:"demux",data:a,decryptdata:C,chunkMeta:m,state:Q},a instanceof ArrayBuffer?[a]:[]);else if(o){var ie=o.push(a,C,m,Q);Object(K.isPromise)(ie)?ie.then(function(ge){s.handleTransmuxComplete(ge)}):this.handleTransmuxComplete(ie)}},d.flush=function(a){var u=this;a.transmuxing.start=self.performance.now();var c=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:a});else if(c){var O=c.flush(a);Object(K.isPromise)(O)?O.then(function(T){u.handleFlushResult(T,a)}):this.handleFlushResult(O,a)}},d.handleFlushResult=function(a,u){var c=this;a.forEach(function(R){c.handleTransmuxComplete(R)}),this.onFlush(u)},d.onWorkerMessage=function(a){var u=a.data,c=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,c.trigger(u.event,u.data);break}}},d.configureTransmuxer=function(a){var u=this.worker,c=this.transmuxer;u?u.postMessage({cmd:"configure",config:a}):c&&c.configure(a)},d.handleTransmuxComplete=function(a){a.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(a)},r}()},"./src/demux/transmuxer-worker.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return L});var V=M("./src/demux/transmuxer.ts"),I=M("./src/events.ts"),B=M("./src/utils/logger.ts"),K=M("./node_modules/eventemitter3/index.js"),W=M.n(K);function L(h){var r=new K.EventEmitter,d=function(a,u){h.postMessage({event:a,data:u})};r.on(I.Events.FRAG_DECRYPTED,d),r.on(I.Events.ERROR,d),h.addEventListener("message",function(l){var a=l.data;switch(a.cmd){case"init":{var u=JSON.parse(a.config);h.transmuxer=new V.default(r,a.typeSupported,u,a.vendor,a.id),Object(B.enableLogs)(u.debug),d("init",null);break}case"configure":{h.transmuxer.configure(a.config);break}case"demux":{var c=h.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);Object(V.isPromise)(c)?c.then(function(T){P(h,T)}):P(h,c);break}case"flush":{var R=a.chunkMeta,O=h.transmuxer.flush(R);Object(V.isPromise)(O)?O.then(function(T){p(h,T,R)}):p(h,O,R);break}default:break}})}function P(h,r){if(_(r.remuxResult))return;var d=[],l=r.remuxResult,a=l.audio,u=l.video;a&&b(d,a),u&&b(d,u),h.postMessage({event:"transmuxComplete",data:r},d)}function b(h,r){r.data1&&h.push(r.data1.buffer),r.data2&&h.push(r.data2.buffer)}function p(h,r,d){r.forEach(function(l){P(h,l)}),h.postMessage({event:"flush",data:d})}function _(h){return!h.audio&&!h.video&&!h.text&&!h.id3&&!h.initSegment}},"./src/demux/transmuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return u}),M.d(Z,"isPromise",function(){return O}),M.d(Z,"TransmuxConfig",function(){return T}),M.d(Z,"TransmuxState",function(){return A});var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/crypt/decrypter.ts"),K=M("./src/demux/aacdemuxer.ts"),W=M("./src/demux/mp4demuxer.ts"),L=M("./src/demux/tsdemuxer.ts"),P=M("./src/demux/mp3demuxer.ts"),b=M("./src/remux/mp4-remuxer.ts"),p=M("./src/remux/passthrough-remuxer.ts"),_=M("./src/demux/chunk-cache.ts"),h=M("./src/utils/mp4-tools.ts"),r=M("./src/utils/logger.ts"),d;try{d=self.performance.now.bind(self.performance)}catch(w){r.logger.debug("Unable to use Performance API on this environment"),d=self.Date.now}var l=[{demux:L.default,remux:b.default},{demux:W.default,remux:p.default},{demux:K.default,remux:b.default},{demux:P.default,remux:b.default}],a=1024;l.forEach(function(w){var m=w.demux;a=Math.max(a,m.minProbeByteLength)});var u=function(){function w(v,s,o,E,g){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new _.default,this.observer=v,this.typeSupported=s,this.config=o,this.vendor=E,this.id=g}var m=w.prototype;return m.configure=function(s){this.transmuxConfig=s,this.decrypter&&this.decrypter.reset()},m.push=function(s,o,E,g){var C=this,N=E.transmuxing;N.executeStart=d();var U=new Uint8Array(s),j=this.cache,H=this.config,y=this.currentTransmuxState,x=this.transmuxConfig;g&&(this.currentTransmuxState=g);var F=c(U,o);if(F&&F.method==="AES-128"){var Q=this.getDecrypter();if(H.enableSoftwareAES){var q=Q.softwareDecrypt(U,F.key.buffer,F.iv.buffer);if(!q)return N.executeEnd=d(),R(E);U=new Uint8Array(q)}else return this.decryptionPromise=Q.webCryptoDecrypt(U,F.key.buffer,F.iv.buffer).then(function(Be){var Je=C.push(Be,null,E);return C.decryptionPromise=null,Je}),this.decryptionPromise}var ie=g||y,ge=ie.contiguous,fe=ie.discontinuity,ue=ie.trackSwitch,he=ie.accurateTimeOffset,_e=ie.timeOffset,le=x.audioCodec,ne=x.videoCodec,Te=x.defaultInitPts,Fe=x.duration,Ke=x.initSegmentData;if((fe||ue)&&this.resetInitSegment(Ke,le,ne,Fe),fe&&this.resetInitialTimestamp(Te),ge||this.resetContiguity(),this.needsProbing(U,fe,ue)){if(j.dataLength){var Ue=j.flush();U=Object(h.appendUint8Array)(Ue,U)}this.configureTransmuxer(U,x)}var He=this.transmux(U,F,_e,he,E),Ne=this.currentTransmuxState;return Ne.contiguous=!0,Ne.discontinuity=!1,Ne.trackSwitch=!1,N.executeEnd=d(),He},m.flush=function(s){var o=this,E=s.transmuxing;E.executeStart=d();var g=this.decrypter,C=this.cache,N=this.currentTransmuxState,U=this.decryptionPromise;if(U)return U.then(function(){return o.flush(s)});var j=[],H=N.timeOffset;if(g){var y=g.flush();y&&j.push(this.push(y,null,s))}var x=C.dataLength;C.reset();var F=this.demuxer,Q=this.remuxer;if(!F||!Q)return x>=a&&this.observer.emit(V.Events.ERROR,V.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=d(),[R(s)];var q=F.flush(H);return O(q)?q.then(function(ie){return o.flushRemux(j,ie,s),j}):(this.flushRemux(j,q,s),j)},m.flushRemux=function(s,o,E){var g=o.audioTrack,C=o.avcTrack,N=o.id3Track,U=o.textTrack,j=this.currentTransmuxState,H=j.accurateTimeOffset,y=j.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var x=this.remuxer.remux(g,C,N,U,y,H,!0,this.id);s.push({remuxResult:x,chunkMeta:E}),E.transmuxing.executeEnd=d()},m.resetInitialTimestamp=function(s){var o=this.demuxer,E=this.remuxer;if(!o||!E)return;o.resetTimeStamp(s),E.resetTimeStamp(s)},m.resetContiguity=function(){var s=this.demuxer,o=this.remuxer;if(!s||!o)return;s.resetContiguity(),o.resetNextTimestamp()},m.resetInitSegment=function(s,o,E,g){var C=this.demuxer,N=this.remuxer;if(!C||!N)return;C.resetInitSegment(o,E,g),N.resetInitSegment(s,o,E)},m.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},m.transmux=function(s,o,E,g,C){var N;return o&&o.method==="SAMPLE-AES"?N=this.transmuxSampleAes(s,o,E,g,C):N=this.transmuxUnencrypted(s,E,g,C),N},m.transmuxUnencrypted=function(s,o,E,g){var C=this.demuxer.demux(s,o,!1,!this.config.progressive),N=C.audioTrack,U=C.avcTrack,j=C.id3Track,H=C.textTrack,y=this.remuxer.remux(N,U,j,H,o,E,!1,this.id);return{remuxResult:y,chunkMeta:g}},m.transmuxSampleAes=function(s,o,E,g,C){var N=this;return this.demuxer.demuxSampleAes(s,o,E).then(function(U){var j=N.remuxer.remux(U.audioTrack,U.avcTrack,U.id3Track,U.textTrack,E,g,!1,N.id);return{remuxResult:j,chunkMeta:C}})},m.configureTransmuxer=function(s,o){for(var E=this.config,g=this.observer,C=this.typeSupported,N=this.vendor,U=o.audioCodec,j=o.defaultInitPts,H=o.duration,y=o.initSegmentData,x=o.videoCodec,F,Q=0,q=l.length;Q0&&m!=null&&m.key!=null&&m.iv!==null&&m.method!=null&&(v=m),v}var R=function(m){return{remuxResult:{},chunkMeta:m}};function O(w){return"then"in w&&w.then instanceof Function}var T=function(m,v,s,o,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=m,this.videoCodec=v,this.initSegmentData=s,this.duration=o,this.defaultInitPts=E},A=function(m,v,s,o,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=m,this.contiguous=v,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"discardEPB",function(){return R});var V=M("./src/demux/adts.ts"),I=M("./src/demux/mpegaudio.ts"),B=M("./src/demux/exp-golomb.ts"),K=M("./src/demux/id3.ts"),W=M("./src/demux/sample-aes.ts"),L=M("./src/events.ts"),P=M("./src/utils/mp4-tools.ts"),b=M("./src/utils/logger.ts"),p=M("./src/errors.ts"),_={video:1,audio:2,id3:3,text:4},h=function(){function O(A,w,m){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=A,this.config=w,this.typeSupported=m}O.probe=function(w){var m=O.syncOffset(w);return m<0?!1:(m&&b.logger.warn("MPEG2-TS detected but first sync word found @ offset "+m+", junk ahead ?"),!0)},O.syncOffset=function(w){for(var m=Math.min(1e3,w.length-3*188),v=0;v>4,le=void 0;if(_e>1){if(le=fe+5+w[fe+4],le===fe+188)continue}else le=fe+4;switch(he){case N:ue&&(U&&(o=a(U))&&this.parseAVCPES(o,!1),U={data:[],size:0}),U&&(U.data.push(w.subarray(le,fe+188)),U.size+=fe+188-le);break;case j:ue&&(y&&(o=a(y))&&(g.isAAC?this.parseAACPES(o):this.parseMPEGPES(o)),y={data:[],size:0}),y&&(y.data.push(w.subarray(le,fe+188)),y.size+=fe+188-le);break;case H:ue&&(x&&(o=a(x))&&this.parseID3PES(o),x={data:[],size:0}),x&&(x.data.push(w.subarray(le,fe+188)),x.size+=fe+188-le);break;case 0:ue&&(le+=w[le]+1),q=this._pmtId=d(w,le);break;case q:{ue&&(le+=w[le]+1);var ne=l(w,le,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,v);N=ne.avc,N>0&&(E.pid=N),j=ne.audio,j>0&&(g.pid=j,g.isAAC=ne.isAAC),H=ne.id3,H>0&&(C.pid=H),F&&!Q&&(b.logger.log("reparse from beginning"),F=!1,fe=ge-188),Q=this.pmtParsed=!0;break}case 17:case 8191:break;default:F=!0;break}}else this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=U,g.pesData=y,C.pesData=x;var Te={audioTrack:g,avcTrack:E,id3Track:C,textTrack:this._txtTrack};return s&&this.extractRemainingSamples(Te),Te},T.flush=function(){var w=this.remainderData;this.remainderData=null;var m;return w?m=this.demux(w,-1,!1,!0):m={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(m),this.sampleAes?this.decrypt(m,this.sampleAes):m},T.extractRemainingSamples=function(w){var m=w.audioTrack,v=w.avcTrack,s=w.id3Track,o=v.pesData,E=m.pesData,g=s.pesData,C;o&&(C=a(o))?(this.parseAVCPES(C,!0),v.pesData=null):v.pesData=o,E&&(C=a(E))?(m.isAAC?this.parseAACPES(C):this.parseMPEGPES(C),m.pesData=null):(E!=null&&E.size&&b.logger.log("last AAC PES packet truncated,might overlap between fragments"),m.pesData=E),g&&(C=a(g))?(this.parseID3PES(C),s.pesData=null):s.pesData=g},T.demuxSampleAes=function(w,m,v){var s=this.demux(w,v,!0,!this.config.progressive),o=this.sampleAes=new W.default(this.observer,this.config,m);return this.decrypt(s,o)},T.decrypt=function(w,m){return new Promise(function(v){var s=w.audioTrack,o=w.avcTrack;s.samples&&s.isAAC?m.decryptAacSamples(s.samples,0,function(){o.samples?m.decryptAvcSamples(o.samples,0,0,function(){v(w)}):v(w)}):o.samples&&m.decryptAvcSamples(o.samples,0,0,function(){v(w)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(w,m){var v=this,s=this._avcTrack,o=this.parseAVCNALu(w.data),E=!1,g=this.avcSample,C,N=!1;w.data=null,g&&o.length&&!s.audFound&&(u(g,s),g=this.avcSample=r(!1,w.pts,w.dts,"")),o.forEach(function(U){switch(U.type){case 1:{C=!0,g||(g=v.avcSample=r(!0,w.pts,w.dts,"")),E&&(g.debug+="NDR "),g.frame=!0;var j=U.data;if(N&&j.length>4){var H=new B.default(j).readSliceType();(H===2||H===4||H===7||H===9)&&(g.key=!0)}break}case 5:C=!0,g||(g=v.avcSample=r(!0,w.pts,w.dts,"")),E&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{C=!0,E&&g&&(g.debug+="SEI ");var y=new B.default(R(U.data));y.readUByte();for(var x=0,F=0,Q=!1,q=0;!Q&&y.bytesAvailable>1;){x=0;do q=y.readUByte(),x+=q;while(q===255);F=0;do q=y.readUByte(),F+=q;while(q===255);if(x===4&&y.bytesAvailable!==0){Q=!0;var ie=y.readUByte();if(ie===181){var ge=y.readUShort();if(ge===49){var fe=y.readUInt();if(fe===1195456820){var ue=y.readUByte();if(ue===3){for(var he=y.readUByte(),_e=y.readUByte(),le=31&he,ne=[he,_e],Te=0;Te16){for(var Fe=[],Ke=0;Ke<16;Ke++)Fe.push(y.readUByte().toString(16)),(Ke===3||Ke===5||Ke===7||Ke===9)&&Fe.push("-");for(var Ue=F-16,He=new Uint8Array(Ue),Ne=0;Ne=0){var y={data:w.subarray(j,g-s-1),type:H};E.push(y)}else{var x=this.getLastNalUnit();if(x&&(o&&g<=4-o&&(x.state&&(x.data=x.data.subarray(0,x.data.byteLength-o))),N=g-s-1,N>0)){var F=new Uint8Array(x.data.byteLength+N);F.set(x.data,0),F.set(w.subarray(0,N),x.data.byteLength),x.data=F,x.state=0}}g=0&&s>=0){var Q={data:w.subarray(j,m),type:H,state:s};E.push(Q)}if(E.length===0){var q=this.getLastNalUnit();if(q){var ie=new Uint8Array(q.data.byteLength+w.byteLength);ie.set(q.data,0),ie.set(w,q.data.byteLength),q.data=ie}}return v.naluState=s,E},T.parseAACPES=function(w){var m=0,v=this._audioTrack,s=this.aacOverFlow,o=w.data;if(s){this.aacOverFlow=null;var E=s.sample.unit.byteLength,g=Math.min(s.missing,E),C=E-g;s.sample.unit.set(o.subarray(0,g),C),v.samples.push(s.sample),m=s.missing}var N,U;for(N=m,U=o.length;N1;){var E=new Uint8Array(o[0].length+o[1].length);E.set(o[0]),E.set(o[1],o[0].length),o[0]=E,o.splice(1,1)}A=o[0];var g=(A[0]<<16)+(A[1]<<8)+A[2];if(g===1){if(w=(A[4]<<8)+A[5],w&&w>O.size-6)return null;var C=A[7];C&192&&(v=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,C&64?(s=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,v-s>60*9e4&&(b.logger.warn(Math.round((v-s)/9e4)+"s delta between PTS and DTS, align them"),v=s)):s=v),m=A[8];var N=m+9;if(O.size<=N)return null;O.size-=N;for(var U=new Uint8Array(O.size),j=0,H=o.length;jy){N-=y;continue}else A=A.subarray(N),y-=N,N=0;U.set(A,T),T+=y}return w&&(w-=m+3),{data:U,pts:v,dts:s,len:w}}return null}function u(O,T){if(O.units.length&&O.frame){if(O.pts===void 0){var A=T.samples,w=A.length;if(w){var m=A[w-1];O.pts=m.pts,O.dts=m.dts}else{T.dropped++;return}}T.samples.push(O)}O.debug.length&&b.logger.log(O.pts+"/"+O.dts+":"+O.debug)}function c(O,T){var A=O.length;if(A>0){if(T.pts>=O[A-1].pts)O.push(T);else for(var w=A-1;w>=0;w--)if(T.ptsv)return o;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,v=this.autoLevelCapping,s;return v===-1&&m&&m.length?s=m.length-1:s=v,s}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var v=this.audioTrackController;v&&(v.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var v=this.subtitleTrackController;v&&(v.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return a.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:r.hlsDefaultConfig},set:function(m){T.defaultConfig=m}}]),T}();O.defaultConfig=void 0},"./src/is-supported.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"isSupported",function(){return B}),M.d(Z,"changeTypeSupported",function(){return K});var V=M("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function B(){var W=Object(V.getMediaSource)();if(!W)return!1;var L=I(),P=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),b=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!P&&!!b}function K(){var W,L=I();return typeof(L==null||((W=L.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return h}),M.d(Z,"LoadError",function(){return d});var V=M("./src/polyfills/number.ts"),I=M("./src/errors.ts");function B(l,a){l.prototype=Object.create(a.prototype),l.prototype.constructor=l,b(l,a)}function K(l){var a=typeof Map=="function"?new Map:void 0;return K=function(c){if(c===null||!P(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof a!="undefined"){if(a.has(c))return a.get(c);a.set(c,R)}function R(){return W(c,arguments,p(this).constructor)}return R.prototype=Object.create(c.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),b(R,c)},K(l)}function W(l,a,u){return L()?W=Reflect.construct:W=function(R,O,T){var A=[null];A.push.apply(A,O);var w=Function.bind.apply(R,A),m=new w;return T&&b(m,T.prototype),m},W.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(l){return!1}}function P(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function b(l,a){return b=Object.setPrototypeOf||function(c,R){return c.__proto__=R,c},b(l,a)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},p(l)}var _=Math.pow(2,17),h=function(){function l(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var a=l.prototype;return a.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},a.abort=function(){this.loader&&this.loader.abort()},a.load=function(c,R){var O=this,T=c.url;if(!T)return Promise.reject(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var A=this.config,w=A.fLoader,m=A.loader;return new Promise(function(v,s){O.loader&&O.loader.destroy();var o=O.loader=c.loader=w?new w(A):new m(A),E=r(c),g={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:_};c.stats=o.stats,o.load(E,g,{onSuccess:function(N,U,j,H){O.resetLoader(c,o),v({frag:c,part:null,payload:N.data,networkDetails:H})},onError:function(N,U,j){O.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:N,networkDetails:j}))},onAbort:function(N,U,j){O.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:j}))},onTimeout:function(N,U,j){O.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:j}))},onProgress:function(N,U,j,H){R&&R({frag:c,part:null,payload:j,networkDetails:H})}})})},a.loadPart=function(c,R,O){var T=this;this.abort();var A=this.config,w=A.fLoader,m=A.loader;return new Promise(function(v,s){T.loader&&T.loader.destroy();var o=T.loader=c.loader=w?new w(A):new m(A),E=r(c,R),g={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:_};R.stats=o.stats,o.load(E,g,{onSuccess:function(N,U,j,H){T.resetLoader(c,o),T.updateStatsFromPart(c,R);var y={frag:c,part:R,payload:N.data,networkDetails:H};O(y),v(y)},onError:function(N,U,j){T.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:R,response:N,networkDetails:j}))},onAbort:function(N,U,j){c.stats.aborted=R.stats.aborted,T.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:R,networkDetails:j}))},onTimeout:function(N,U,j){T.resetLoader(c,o),s(new d({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:R,networkDetails:j}))}})})},a.updateStatsFromPart=function(c,R){var O=c.stats,T=R.stats,A=T.total;if(O.loaded+=T.loaded,A){var w=Math.round(c.duration/R.duration),m=Math.min(Math.round(O.loaded/A),w),v=w-m,s=v*Math.round(O.loaded/m);O.total=O.loaded+s}else O.total=Math.max(O.loaded,O.total);var o=O.loading,E=T.loading;o.start?o.first+=E.first-E.start:(o.start=E.start,o.first=E.first),o.end=E.end},a.resetLoader=function(c,R){c.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},l}();function r(l,a){a===void 0&&(a=null);var u=a||l,c={frag:l,part:a,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},R=u.byteRangeStartOffset,O=u.byteRangeEndOffset;return Object(V.isFiniteNumber)(R)&&Object(V.isFiniteNumber)(O)&&(c.rangeStart=R,c.rangeEnd=O),c}var d=function(l){B(a,l);function a(u){for(var c,R=arguments.length,O=new Array(R>1?R-1:0),T=1;T>8*(15-A)&255;return T},c.setDecryptDataFromLevelKey=function(O,T){var A=O;return(O==null?void 0:O.method)==="AES-128"&&O.uri&&!O.iv&&(A=W.LevelKey.fromURI(O.uri),A.method=O.method,A.iv=this.createInitializationVector(T),A.keyFormat="identity"),A},c.setElementaryStreamInfo=function(O,T,A,w,m,v){v===void 0&&(v=!1);var s=this.elementaryStreams,o=s[O];if(!o){s[O]={startPTS:T,endPTS:A,startDTS:w,endDTS:m,partial:v};return}o.startPTS=Math.min(o.startPTS,T),o.endPTS=Math.max(o.endPTS,A),o.startDTS=Math.min(o.startDTS,w),o.endDTS=Math.max(o.endDTS,m)},c.clearElementaryStreamInfo=function(){var O=this.elementaryStreams;O[h.AUDIO]=null,O[h.VIDEO]=null,O[h.AUDIOVIDEO]=null},_(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var O=this.sn;typeof O!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&K.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),O=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,O)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(V.isFiniteNumber)(this.programDateTime))return null;var O=Object(V.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+O*1e3}},{key:"encrypted",get:function(){var O;return!!((O=this.decryptdata)!==null&&O!==void 0&&O.keyFormat&&this.decryptdata.uri)}}]),u}(r),l=function(a){P(u,a);function u(c,R,O,T,A){var w;w=a.call(this,O)||this,w.fragOffset=0,w.duration=0,w.gap=!1,w.independent=!1,w.relurl=void 0,w.fragment=void 0,w.index=void 0,w.stats=new L.LoadStats,w.duration=c.decimalFloatingPoint("DURATION"),w.gap=c.bool("GAP"),w.independent=c.bool("INDEPENDENT"),w.relurl=c.enumeratedString("URI"),w.fragment=R,w.index=T;var m=c.enumeratedString("BYTERANGE");return m&&w.setByteRange(m,A),A&&(w.fragOffset=A.fragOffset+A.duration),w}return _(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),u}(r)},"./src/loader/key-loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return K});var V=M("./src/events.ts"),I=M("./src/errors.ts"),B=M("./src/utils/logger.ts"),K=function(){function W(P){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=P,this._registerListeners()}var L=W.prototype;return L._registerListeners=function(){this.hls.on(V.Events.KEY_LOADING,this.onKeyLoading,this)},L._unregisterListeners=function(){this.hls.off(V.Events.KEY_LOADING,this.onKeyLoading)},L.destroy=function(){this._unregisterListeners();for(var b in this.loaders){var p=this.loaders[b];p&&p.destroy()}this.loaders={}},L.onKeyLoading=function(b,p){var _=p.frag,h=_.type,r=this.loaders[h];if(!_.decryptdata){B.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var d=_.decryptdata.uri;if(d!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(r&&(B.logger.warn("abort previous key loader for type:"+h),r.abort()),!d){B.logger.warn("key uri is falsy");return}var a=l.loader,u=_.loader=this.loaders[h]=new a(l);this.decrypturl=d,this.decryptkey=null;var c={url:d,frag:_,responseType:"arraybuffer"},R={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},O={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(c,R,O)}else this.decryptkey&&(_.decryptdata.key=this.decryptkey,this.hls.trigger(V.Events.KEY_LOADED,{frag:_}))},L.loadsuccess=function(b,p,_){var h=_.frag;if(!h.decryptdata){B.logger.error("after key load, decryptdata unset");return}this.decryptkey=h.decryptdata.key=new Uint8Array(b.data),h.loader=null,delete this.loaders[h.type],this.hls.trigger(V.Events.KEY_LOADED,{frag:h})},L.loaderror=function(b,p){var _=p.frag,h=_.loader;h&&h.abort(),delete this.loaders[_.type],this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:_,response:b})},L.loadtimeout=function(b,p){var _=p.frag,h=_.loader;h&&h.abort(),delete this.loaders[_.type],this.hls.trigger(V.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:_})},W}()},"./src/loader/level-details.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"LevelDetails",function(){return W});var V=M("./src/polyfills/number.ts");function I(L,P){for(var b=0;bp.endSN||_>0||_===0&&h>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},B(L,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(V.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||K}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var _=this.driftEnd-this.driftStart;return _*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),L}()},"./src/loader/level-key.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"LevelKey",function(){return W});var V=M("./node_modules/url-toolkit/src/url-toolkit.js"),I=M.n(V);function B(L,P){for(var b=0;b2){var s=v.shift()+".";return s+=parseInt(v.shift()).toString(16),s+=("000"+parseInt(v.shift()).toString(16)).substr(-4),s}return m},A.resolve=function(m,v){return I.buildAbsoluteURL(v,m,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(m,v){var s=[],o={},E=!1;_.lastIndex=0;for(var g;(g=_.exec(m))!=null;)if(g[1]){var C=new P.AttrList(g[1]),N={attrs:C,bitrate:C.decimalInteger("AVERAGE-BANDWIDTH")||C.decimalInteger("BANDWIDTH"),name:C.NAME,url:A.resolve(g[2],v)},U=C.decimalResolution("RESOLUTION");U&&(N.width=U.width,N.height=U.height),c((C.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),N),N.videoCodec&&N.videoCodec.indexOf("avc1")!==-1&&(N.videoCodec=A.convertAVC1ToAVCOTI(N.videoCodec)),s.push(N)}else if(g[3]){var j=new P.AttrList(g[3]);j["DATA-ID"]&&(E=!0,o[j["DATA-ID"]]=j)}return{levels:s,sessionData:E?o:null}},A.parseMasterPlaylistMedia=function(m,v,s,o){o===void 0&&(o=[]);var E,g=[],C=0;for(h.lastIndex=0;(E=h.exec(m))!==null;){var N=new P.AttrList(E[1]);if(N.TYPE===s){var U={attrs:N,bitrate:0,id:C++,groupId:N["GROUP-ID"],instreamId:N["INSTREAM-ID"],name:N.NAME||N.LANGUAGE||"",type:s,default:N.bool("DEFAULT"),autoselect:N.bool("AUTOSELECT"),forced:N.bool("FORCED"),lang:N.LANGUAGE,url:N.URI?A.resolve(N.URI,v):""};if(o.length){var j=A.findGroup(o,U.groupId)||o[0];R(U,j,"audioCodec"),R(U,j,"textCodec")}g.push(U)}}return g},A.parseLevelPlaylist=function(m,v,s,o,E){var g=new W.LevelDetails(v),C=g.fragments,N=null,U=0,j=0,H=0,y=0,x=null,F=new K.Fragment(o,v),Q,q,ie,ge=-1,fe=!1;for(r.lastIndex=0,g.m3u8=m;(Q=r.exec(m))!==null;){fe&&(fe=!1,F=new K.Fragment(o,v),F.start=H,F.sn=U,F.cc=y,F.level=s,N&&(F.initSegment=N,F.rawProgramDateTime=N.rawProgramDateTime));var ue=Q[1];if(ue){F.duration=parseFloat(ue);var he=(" "+Q[2]).slice(1);F.title=he||null,F.tagList.push(he?["INF",ue,he]:["INF",ue])}else if(Q[3])Object(V.isFiniteNumber)(F.duration)&&(F.start=H,ie&&(F.levelkey=ie),F.sn=U,F.level=s,F.cc=y,F.urlId=E,C.push(F),F.relurl=(" "+Q[3]).slice(1),T(F,x),x=F,H+=F.duration,U++,j=0,fe=!0);else if(Q[4]){var _e=(" "+Q[4]).slice(1);x?F.setByteRange(_e,x):F.setByteRange(_e)}else if(Q[5])F.rawProgramDateTime=(" "+Q[5]).slice(1),F.tagList.push(["PROGRAM-DATE-TIME",F.rawProgramDateTime]),ge===-1&&(ge=C.length);else{if(Q=Q[0].match(d),!Q){b.logger.warn("No matches on slow regex match for level playlist!");continue}for(q=1;q-1){b.logger.warn("Keyformat "+gt+" is not supported from the manifest");continue}else if(gt!=="identity")continue;Je&&(ie=L.LevelKey.fromURL(v,tt),tt&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Je)>=0&&(ie.method=Je,ie.keyFormat=gt,qe&&(ie.keyID=qe),rt&&(ie.keyFormatVersions=rt),ie.iv=it));break}case"START":{var vt=new P.AttrList(ne),at=vt.decimalFloatingPoint("TIME-OFFSET");Object(V.isFiniteNumber)(at)&&(g.startTimeOffset=at);break}case"MAP":{var Rt=new P.AttrList(ne);F.relurl=Rt.URI,Rt.BYTERANGE&&F.setByteRange(Rt.BYTERANGE),F.level=s,F.sn="initSegment",ie&&(F.levelkey=ie),F.initSegment=null,N=F,fe=!0;break}case"SERVER-CONTROL":{var xt=new P.AttrList(ne);g.canBlockReload=xt.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=xt.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&xt.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=xt.optionalFloat("PART-HOLD-BACK",0),g.holdBack=xt.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Tt=new P.AttrList(ne);g.partTarget=Tt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ye=g.partList;Ye||(Ye=g.partList=[]);var Mt=j>0?Ye[Ye.length-1]:void 0,St=j++,ze=new K.Part(new P.AttrList(ne),F,v,St,Mt);Ye.push(ze),F.duration+=ze.duration;break}case"PRELOAD-HINT":{var ut=new P.AttrList(ne);g.preloadHint=ut;break}case"RENDITION-REPORT":{var be=new P.AttrList(ne);g.renditionReports=g.renditionReports||[],g.renditionReports.push(be);break}default:b.logger.warn("line parsed but not handled: "+Q);break}}}x&&!x.relurl?(C.pop(),H-=x.duration,g.partList&&(g.fragmentHint=x)):g.partList&&(T(F,x),F.cc=y,g.fragmentHint=F);var xe=C.length,pe=C[0],se=C[xe-1];if(H+=g.skippedSegments*g.targetduration,H>0&&xe&&se){g.averagetargetduration=H/xe;var ce=se.sn;g.endSN=ce!=="initSegment"?ce:0,pe&&(g.startCC=pe.cc,pe.initSegment||g.fragments.every(function(Ee){return Ee.relurl&&a(Ee.relurl)})&&(b.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),F=new K.Fragment(o,v),F.relurl=se.relurl,F.level=s,F.sn="initSegment",pe.initSegment=F,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(H+=g.fragmentHint.duration),g.totalduration=H,g.endCC=y,ge>0&&O(C,ge),g},A}();function c(A,w){["video","audio","text"].forEach(function(m){var v=A.filter(function(o){return Object(p.isCodecType)(o,m)});if(v.length){var s=v.filter(function(o){return o.lastIndexOf("avc1",0)===0||o.lastIndexOf("mp4a",0)===0});w[m+"Codec"]=s.length>0?s[0]:v[0],A=A.filter(function(o){return v.indexOf(o)===-1})}}),w.unknownCodecs=A}function R(A,w,m){var v=w[m];v&&(A[m]=v)}function O(A,w){for(var m=A[w],v=w;v--;){var s=A[v];if(!s)return;s.programDateTime=m.programDateTime-s.duration*1e3,m=s}}function T(A,w){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):w!=null&&w.programDateTime&&(A.programDateTime=w.endProgramDateTime),Object(V.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/polyfills/number.ts"),I=M("./src/events.ts"),B=M("./src/errors.ts"),K=M("./src/utils/logger.ts"),W=M("./src/utils/mp4-tools.ts"),L=M("./src/loader/m3u8-parser.ts"),P=M("./src/types/loader.ts"),b=M("./src/utils/attr-list.ts");function p(r){var d=r.type;switch(d){case P.PlaylistContextType.AUDIO_TRACK:return P.PlaylistLevelType.AUDIO;case P.PlaylistContextType.SUBTITLE_TRACK:return P.PlaylistLevelType.SUBTITLE;default:return P.PlaylistLevelType.MAIN}}function _(r,d){var l=r.url;return(l===void 0||l.indexOf("data:")===0)&&(l=d.url),l}var h=function(){function r(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var d=r.prototype;return d.registerListeners=function(){var a=this.hls;a.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.unregisterListeners=function(){var a=this.hls;a.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),a.off(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},d.createInternalLoader=function(a){var u=this.hls.config,c=u.pLoader,R=u.loader,O=c||R,T=new O(u);return a.loader=T,this.loaders[a.type]=T,T},d.getInternalLoader=function(a){return this.loaders[a.type]},d.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},d.destroyInternalLoaders=function(){for(var a in this.loaders){var u=this.loaders[a];u&&u.destroy(),this.resetInternalLoader(a)}},d.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},d.onManifestLoading=function(a,u){var c=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:P.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},d.onLevelLoading=function(a,u){var c=u.id,R=u.level,O=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:null,level:R,responseType:"text",type:P.PlaylistContextType.LEVEL,url:O,deliveryDirectives:T})},d.onAudioTrackLoading=function(a,u){var c=u.id,R=u.groupId,O=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:R,level:null,responseType:"text",type:P.PlaylistContextType.AUDIO_TRACK,url:O,deliveryDirectives:T})},d.onSubtitleTrackLoading=function(a,u){var c=u.id,R=u.groupId,O=u.url,T=u.deliveryDirectives;this.load({id:c,groupId:R,level:null,responseType:"text",type:P.PlaylistContextType.SUBTITLE_TRACK,url:O,deliveryDirectives:T})},d.load=function(a){var u,c=this.hls.config,R=this.getInternalLoader(a);if(R){var O=R.context;if(O&&O.url===a.url){K.logger.trace("[playlist-loader]: playlist request ongoing");return}K.logger.log("[playlist-loader]: aborting previous loader for type: "+a.type),R.abort()}var T,A,w,m;switch(a.type){case P.PlaylistContextType.MANIFEST:T=c.manifestLoadingMaxRetry,A=c.manifestLoadingTimeOut,w=c.manifestLoadingRetryDelay,m=c.manifestLoadingMaxRetryTimeout;break;case P.PlaylistContextType.LEVEL:case P.PlaylistContextType.AUDIO_TRACK:case P.PlaylistContextType.SUBTITLE_TRACK:T=0,A=c.levelLoadingTimeOut;break;default:T=c.levelLoadingMaxRetry,A=c.levelLoadingTimeOut,w=c.levelLoadingRetryDelay,m=c.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(a),(u=a.deliveryDirectives)!==null&&u!==void 0&&u.part){var v;if(a.type===P.PlaylistContextType.LEVEL&&a.level!==null?v=this.hls.levels[a.level].details:a.type===P.PlaylistContextType.AUDIO_TRACK&&a.id!==null?v=this.hls.audioTracks[a.id].details:a.type===P.PlaylistContextType.SUBTITLE_TRACK&&a.id!==null&&(v=this.hls.subtitleTracks[a.id].details),v){var s=v.partTarget,o=v.targetduration;s&&o&&(A=Math.min(Math.max(s*3,o*.8)*1e3,A))}}var E={timeout:A,maxRetry:T,retryDelay:w,maxRetryDelay:m,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(a,E,g)},d.loadsuccess=function(a,u,c,R){if(R===void 0&&(R=null),c.isSidxRequest){this.handleSidxRequest(a,c),this.handlePlaylistLoaded(a,u,c,R);return}this.resetInternalLoader(c.type);var O=a.data;if(O.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(a,c,"no EXTM3U delimiter",R);return}u.parsing.start=performance.now(),O.indexOf("#EXTINF:")>0||O.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(a,u,c,R):this.handleMasterPlaylist(a,u,c,R)},d.loaderror=function(a,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!1,a)},d.loadtimeout=function(a,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!0)},d.handleMasterPlaylist=function(a,u,c,R){var O=this.hls,T=a.data,A=_(a,c),w=L.default.parseMasterPlaylist(T,A),m=w.levels,v=w.sessionData;if(!m.length){this.handleManifestParsingError(a,c,"no level found in manifest",R);return}var s=m.map(function(U){return{id:U.attrs.AUDIO,audioCodec:U.audioCodec}}),o=m.map(function(U){return{id:U.attrs.SUBTITLES,textCodec:U.textCodec}}),E=L.default.parseMasterPlaylistMedia(T,A,"AUDIO",s),g=L.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",o),C=L.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(E.length){var N=E.some(function(U){return!U.url});!N&&m[0].audioCodec&&!m[0].attrs.AUDIO&&(K.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new b.AttrList({}),bitrate:0,url:""}))}O.trigger(I.Events.MANIFEST_LOADED,{levels:m,audioTracks:E,subtitles:g,captions:C,url:A,stats:u,networkDetails:R,sessionData:v})},d.handleTrackOrLevelPlaylist=function(a,u,c,R){var O=this.hls,T=c.id,A=c.level,w=c.type,m=_(a,c),v=Object(V.isFiniteNumber)(T)?T:0,s=Object(V.isFiniteNumber)(A)?A:v,o=p(c),E=L.default.parseLevelPlaylist(a.data,m,s,o,v);if(!E.fragments.length){O.trigger(I.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(w===P.PlaylistContextType.MANIFEST){var g={attrs:new b.AttrList({}),bitrate:0,details:E,name:"",url:m};O.trigger(I.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:m,stats:u,networkDetails:R,sessionData:null})}if(u.parsing.end=performance.now(),E.needSidxRanges){var C,N=(C=E.fragments[0].initSegment)===null||C===void 0?void 0:C.url;this.load({url:N,isSidxRequest:!0,type:w,level:A,levelDetails:E,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}c.levelDetails=E,this.handlePlaylistLoaded(a,u,c,R)},d.handleSidxRequest=function(a,u){var c=Object(W.parseSegmentIndex)(new Uint8Array(a.data));if(!c)return;var R=c.references,O=u.levelDetails;R.forEach(function(T,A){var w=T.info,m=O.fragments[A];m.byteRange.length===0&&m.setByteRange(String(1+w.end-w.start)+"@"+String(w.start)),m.initSegment&&m.initSegment.setByteRange(String(c.moovEndOffset)+"@0")})},d.handleManifestParsingError=function(a,u,c,R){this.hls.trigger(I.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===P.PlaylistContextType.MANIFEST,url:a.url,reason:c,response:a,context:u,networkDetails:R})},d.handleNetworkError=function(a,u,c,R){c===void 0&&(c=!1),K.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+a.type+" level: "+a.level+" id: "+a.id+' group-id: "'+a.groupId+'"');var O=B.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(a);switch(a.type){case P.PlaylistContextType.MANIFEST:O=c?B.ErrorDetails.MANIFEST_LOAD_TIMEOUT:B.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case P.PlaylistContextType.LEVEL:O=c?B.ErrorDetails.LEVEL_LOAD_TIMEOUT:B.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.AUDIO_TRACK:O=c?B.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case P.PlaylistContextType.SUBTITLE_TRACK:O=c?B.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:B.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(a.type);var w={type:B.ErrorTypes.NETWORK_ERROR,details:O,fatal:T,url:a.url,loader:A,context:a,networkDetails:u};R&&(w.response=R),this.hls.trigger(I.Events.ERROR,w)},d.handlePlaylistLoaded=function(a,u,c,R){var O=c.type,T=c.level,A=c.id,w=c.groupId,m=c.loader,v=c.levelDetails,s=c.deliveryDirectives;if(!(v!=null&&v.targetduration)){this.handleManifestParsingError(a,c,"invalid target duration",R);return}if(!m)return;v.live&&(m.getCacheAge&&(v.ageHeader=m.getCacheAge()||0),(!m.getCacheAge||isNaN(v.ageHeader))&&(v.ageHeader=0));switch(O){case P.PlaylistContextType.MANIFEST:case P.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:v,level:T||0,id:A||0,stats:u,networkDetails:R,deliveryDirectives:s});break;case P.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:v,id:A||0,groupId:w||"",stats:u,networkDetails:R,deliveryDirectives:s});break;case P.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:v,id:A||0,groupId:w||"",stats:u,networkDetails:R,deliveryDirectives:s});break}},r}();Z.default=h},"./src/polyfills/number.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"isFiniteNumber",function(){return V}),M.d(Z,"MAX_SAFE_INTEGER",function(){return I});var V=Number.isFinite||function(B){return typeof B=="number"&&isFinite(B)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(de,Z,M){"use strict";M.r(Z);var V=function(){function I(){}return I.getSilentFrame=function(K,W){switch(K){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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}();Z.default=V},"./src/remux/mp4-generator.ts":function(de,Z,M){"use strict";M.r(Z);var V=Math.pow(2,32)-1,I=function(){function B(){}return B.init=function(){B.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 W;for(W in B.types)B.types.hasOwnProperty(W)&&(B.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var L=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]),P=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]);B.HDLR_TYPES={video:L,audio:P};var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);B.STTS=B.STSC=B.STCO=p,B.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),B.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),B.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var _=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);B.FTYP=B.box(B.types.ftyp,_,r,_,h),B.DINF=B.box(B.types.dinf,B.box(B.types.dref,b))},B.box=function(W){for(var L=8,P=arguments.length,b=new Array(P>1?P-1:0),p=1;p>24&255,r[1]=L>>16&255,r[2]=L>>8&255,r[3]=L&255,r.set(W,4),_=0,L=8;_>24&255,W>>16&255,W>>8&255,W&255,P>>24,P>>16&255,P>>8&255,P&255,b>>24,b>>16&255,b>>8&255,b&255,85,196,0,0]))},B.mdia=function(W){return B.box(B.types.mdia,B.mdhd(W.timescale,W.duration),B.hdlr(W.type),B.minf(W))},B.mfhd=function(W){return B.box(B.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},B.minf=function(W){return W.type==="audio"?B.box(B.types.minf,B.box(B.types.smhd,B.SMHD),B.DINF,B.stbl(W)):B.box(B.types.minf,B.box(B.types.vmhd,B.VMHD),B.DINF,B.stbl(W))},B.moof=function(W,L,P){return B.box(B.types.moof,B.mfhd(W),B.traf(P,L))},B.moov=function(W){for(var L=W.length,P=[];L--;)P[L]=B.trak(W[L]);return B.box.apply(null,[B.types.moov,B.mvhd(W[0].timescale,W[0].duration)].concat(P).concat(B.mvex(W)))},B.mvex=function(W){for(var L=W.length,P=[];L--;)P[L]=B.trex(W[L]);return B.box.apply(null,[B.types.mvex].concat(P))},B.mvhd=function(W,L){L*=W;var P=Math.floor(L/(V+1)),b=Math.floor(L%(V+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,P>>24,P>>16&255,P>>8&255,P&255,b>>24,b>>16&255,b>>8&255,b&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return B.box(B.types.mvhd,p)},B.sdtp=function(W){var L=W.samples||[],P=new Uint8Array(4+L.length),b,p;for(b=0;b>>8&255),L.push(_&255),L=L.concat(Array.prototype.slice.call(p));for(b=0;b>>8&255),P.push(_&255),P=P.concat(Array.prototype.slice.call(p));var h=B.box(B.types.avcC,new Uint8Array([1,L[3],L[4],L[5],252|3,224|W.sps.length].concat(L).concat([W.pps.length]).concat(P))),r=W.width,d=W.height,l=W.pixelRatio[0],a=W.pixelRatio[1];return B.box(B.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,r>>8&255,r&255,d>>8&255,d&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,B.box(B.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),B.box(B.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,a>>24,a>>16&255,a>>8&255,a&255])))},B.esds=function(W){var L=W.config.length;return new Uint8Array([0,0,0,0,3,23+L,0,1,0,4,15+L,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([L]).concat(W.config).concat([6,1,2]))},B.mp4a=function(W){var L=W.samplerate;return B.box(B.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]),B.box(B.types.esds,B.esds(W)))},B.mp3=function(W){var L=W.samplerate;return B.box(B.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]))},B.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?B.box(B.types.stsd,B.STSD,B.mp3(W)):B.box(B.types.stsd,B.STSD,B.mp4a(W)):B.box(B.types.stsd,B.STSD,B.avc1(W))},B.tkhd=function(W){var L=W.id,P=W.duration*W.timescale,b=W.width,p=W.height,_=Math.floor(P/(V+1)),h=Math.floor(P%(V+1));return B.box(B.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,0,0,0,0,_>>24,_>>16&255,_>>8&255,_&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,b>>8&255,b&255,0,0,p>>8&255,p&255,0,0]))},B.traf=function(W,L){var P=B.sdtp(W),b=W.id,p=Math.floor(L/(V+1)),_=Math.floor(L%(V+1));return B.box(B.types.traf,B.box(B.types.tfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,b&255])),B.box(B.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,_>>24,_>>16&255,_>>8&255,_&255])),B.trun(W,P.length+16+20+8+16+8+8),P)},B.trak=function(W){return W.duration=W.duration||4294967295,B.box(B.types.trak,B.tkhd(W),B.mdia(W))},B.trex=function(W){var L=W.id;return B.box(B.types.trex,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},B.trun=function(W,L){var P=W.samples||[],b=P.length,p=12+16*b,_=new Uint8Array(p),h,r,d,l,a,u;for(L+=8+p,_.set([0,0,15,1,b>>>24&255,b>>>16&255,b>>>8&255,b&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255],0),h=0;h>>24&255,d>>>16&255,d>>>8&255,d&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,a.degradPrio&240<<8,a.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*h);return B.box(B.types.trun,_)},B.initSegment=function(W){B.types||B.init();var L=B.moov(W),P=new Uint8Array(B.FTYP.byteLength+L.byteLength);return P.set(B.FTYP),P.set(L,B.FTYP.byteLength),P},B}();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,Z.default=I},"./src/remux/mp4-remuxer.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return u}),M.d(Z,"normalizePts",function(){return c});var V=M("./src/polyfills/number.ts"),I=M("./src/remux/aac-helper.ts"),B=M("./src/remux/mp4-generator.ts"),K=M("./src/events.ts"),W=M("./src/errors.ts"),L=M("./src/utils/logger.ts"),P=M("./src/types/loader.ts"),b=M("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(A){for(var w=1;w0?E:g.pts},v[0].pts);return s&&L.logger.debug("PTS rollover detected"),o},w.remux=function(v,s,o,E,g,C,N,U){var j,H,y,x,F,Q,q=g,ie=g,ge=v.pid>-1,fe=s.pid>-1,ue=s.samples.length,he=v.samples.length>0,_e=ue>1,le=(!ge||he)&&(!fe||_e)||this.ISGenerated||N;if(le){this.ISGenerated||(y=this.generateIS(v,s,g));var ne=this.isVideoContiguous,Te=-1;if(_e&&(Te=R(s.samples),!ne&&this.config.forceKeyFrameOnDiscontinuity))if(Q=!0,Te>0){L.logger.warn("[mp4-remuxer]: Dropped "+Te+" out of "+ue+" video samples due to a missing keyframe");var Fe=this.getVideoStartPts(s.samples);s.samples=s.samples.slice(Te),s.dropped+=Te,ie+=(s.samples[0].pts-Fe)/(s.timescale||9e4)}else Te===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+ue+" video samples"),Q=!1);if(this.ISGenerated){if(he&&_e){var Ke=this.getVideoStartPts(s.samples),Ue=c(v.samples[0].pts,Ke)-Ke,He=Ue/s.inputTimeScale;q+=Math.max(0,He),ie+=Math.max(0,-He)}if(he){if(v.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),y=this.generateIS(v,s,g)),H=this.remuxAudio(v,q,this.isAudioContiguous,C,fe||_e||U===P.PlaylistLevelType.AUDIO?ie:void 0),_e){var Ne=H?H.endPTS-H.startPTS:0;s.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),y=this.generateIS(v,s,g)),j=this.remuxVideo(s,ie,ne,Ne)}}else _e&&(j=this.remuxVideo(s,ie,ne,0));j&&(j.firstKeyFrame=Te,j.independent=Te!==-1)}}return this.ISGenerated&&(o.samples.length&&(F=this.remuxID3(o,g)),E.samples.length&&(x=this.remuxText(E,g))),{audio:H,video:j,initSegment:y,independent:Q,text:x,id3:F}},w.generateIS=function(v,s,o){var E=v.samples,g=s.samples,C=this.typeSupported,N={},U=!Object(V.isFiniteNumber)(this._initPTS),j="audio/mp4",H,y,x;if(U&&(H=y=Infinity),v.config&&E.length&&(v.timescale=v.samplerate,v.isAAC||(C.mpeg?(j="audio/mpeg",v.codec=""):C.mp3&&(v.codec="mp3")),N.audio={id:"audio",container:j,codec:v.codec,initSegment:!v.isAAC&&C.mpeg?new Uint8Array(0):B.default.initSegment([v]),metadata:{channelCount:v.channelCount}},U&&(x=v.inputTimeScale,H=y=E[0].pts-Math.round(x*o))),s.sps&&s.pps&&g.length&&(s.timescale=s.inputTimeScale,N.video={id:"main",container:"video/mp4",codec:s.codec,initSegment:B.default.initSegment([s]),metadata:{width:s.width,height:s.height}},U)){x=s.inputTimeScale;var F=this.getVideoStartPts(g),Q=Math.round(x*o);y=Math.min(y,c(g[0].dts,F)-Q),H=Math.min(H,F-Q)}if(Object.keys(N).length)return this.ISGenerated=!0,U&&(this._initPTS=H,this._initDTS=y),{tracks:N,initPTS:H,timescale:x}},w.remuxVideo=function(v,s,o,E){var g=v.inputTimeScale,C=v.samples,N=[],U=C.length,j=this._initPTS,H=this.nextAvcDts,y=8,x,F,Q,q=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,ge=0,fe=!1;if(!o||H===null){var ue=s*g,he=C[0].pts-c(C[0].dts,C[0].pts);H=ue-he}for(var _e=0;_ele.pts){var ne=9e4*.2;ge=Math.max(Math.min(ge,le.pts-le.dts),-1*ne)}le.dts0?_e-1:_e].dts&&(fe=!0)}fe&&C.sort(function(_n,yn){var Gt=_n.dts-yn.dts,ii=_n.pts-yn.pts;return Gt||ii}),F=C[0].dts,Q=C[C.length-1].dts;var Te=Math.round((Q-F)/(U-1));if(ge<0){if(geTe,Be=He<-1;if(Ne||Be){Ne?L.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(He,!0)+" ms ("+He+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+Object(b.toMsFromMpegTsClock)(-He,!0)+" ms ("+He+"dts) overlapping between fragments detected"),F=H;var Je=C[0].pts-He;C[0].dts=F,C[0].pts=Je,L.logger.log("Video: First PTS/DTS adjusted: "+Object(b.toMsFromMpegTsClock)(Je,!0)+"/"+Object(b.toMsFromMpegTsClock)(F,!0)+", delta: "+Object(b.toMsFromMpegTsClock)(He,!0)+" ms")}}a&&(F=Math.max(0,F));for(var tt=0,it=0,rt=0;rt0?Ye-1:Ye].dts;if(ce.stretchShortVideoTrack&&this.nextAudioPts!==null){var Ae=Math.floor(ce.maxBufferHole*g),De=(E?q+E*g:this.nextAudioPts)-Mt.pts;De>Ae?(x=De-Ee,x<0&&(x=Ee),L.logger.log("[mp4-remuxer]: It is approximately "+De/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=Ee}else x=Ee}var $e=Math.round(Mt.pts-Mt.dts);N.push(new O(Mt.key,x,ze,$e))}if(N.length&&d&&d<70){var lt=N[0].flags;lt.dependsOn=2,lt.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=Q+x,this.isVideoContiguous=!0;var Bt=B.default.moof(v.sequenceNumber++,F,p({},v,{samples:N})),tn="video",nn={data1:Bt,data2:xt,startPTS:q/g,endPTS:(ie+x)/g,startDTS:F/g,endDTS:H/g,type:tn,hasAudio:!1,hasVideo:!0,nb:N.length,dropped:v.dropped};return v.samples=[],v.dropped=0,console.assert(xt.length,"MDAT length must not be zero"),nn},w.remuxAudio=function(v,s,o,E,g){var C=v.inputTimeScale,N=v.samplerate?v.samplerate:C,U=C/N,j=v.isAAC?h:r,H=j*U,y=this._initPTS,x=!v.isAAC&&this.typeSupported.mpeg,F=[],Q=v.samples,q=x?0:8,ie=this.nextAudioPts||-1,ge=s*C;if(this.isAudioContiguous=o=o||Q.length&&ie>0&&(E&&Math.abs(ge-ie)<9e3||Math.abs(c(Q[0].pts-y,ge)-ie)<20*H),Q.forEach(function(pe){pe.pts=c(pe.pts-y,ge)}),!o||ie<0){if(Q=Q.filter(function(pe){return pe.pts>=0}),!Q.length)return;g===0?ie=0:E?ie=Math.max(0,ge):ie=Q[0].pts}if(v.isAAC)for(var fe=g!==void 0,ue=this.config.maxAudioFramesDrift,he=0,_e=ie;he=ue*H&&Fe<_&&fe){var Ke=Math.round(Te/H);_e=ne-Ke*H,_e<0&&(Ke--,_e+=H),he===0&&(this.nextAudioPts=ie=_e),L.logger.warn("[mp4-remuxer]: Injecting "+Ke+" audio frame @ "+(_e/C).toFixed(3)+"s due to "+Math.round(1e3*Te/C)+" ms gap.");for(var Ue=0;Ue0){it+=q;try{tt=new Uint8Array(it)}catch(pe){this.observer.emit(K.Events.ERROR,K.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:it,reason:"fail allocating audio mdat "+it});return}if(!x){var xt=new DataView(tt.buffer);xt.setUint32(0,it),tt.set(B.default.types.mdat,4)}}else return;tt.set(vt,q);var Tt=vt.byteLength;q+=Tt,F.push(new O(!0,j,Tt,0)),Je=at}var Ye=F.length;if(!Ye)return;var Mt=F[F.length-1];this.nextAudioPts=ie=Je+U*Mt.duration;var St=x?new Uint8Array(0):B.default.moof(v.sequenceNumber++,Be/U,p({},v,{samples:F}));v.samples=[];var ze=Be/C,ut=ie/C,be="audio",xe={data1:St,data2:tt,startPTS:ze,endPTS:ut,startDTS:ze,endDTS:ut,type:be,hasAudio:!0,hasVideo:!1,nb:Ye};return this.isAudioContiguous=!0,console.assert(tt.length,"MDAT length must not be zero"),xe},w.remuxEmptyAudio=function(v,s,o,E){var g=v.inputTimeScale,C=v.samplerate?v.samplerate:g,N=g/C,U=this.nextAudioPts,j=(U!==null?U:E.startDTS*g)+this._initDTS,H=E.endDTS*g+this._initDTS,y=N*h,x=Math.ceil((H-j)/y),F=I.default.getSilentFrame(v.manifestCodec||v.codec,v.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!F){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Q=[],q=0;q4294967296;)A+=m;return A}function R(A){for(var w=0;w0?this.lastEndDTS=v:(K.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var s=!!A.audio,o=!!A.video,E="";s&&(E+="audio"),o&&(E+="video");var g={data1:O,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:E,hasAudio:s,hasVideo:o,nb:1,dropped:0};return R.audio=g.type==="audio"?g:void 0,R.video=g.type!=="audio"?g:void 0,R.text=l,R.id3=d,R.initSegment=T,R},b}(),L=function(p,_,h){return Object(I.getStartDTS)(p,_)-h};function P(b,p){var _=b==null?void 0:b.codec;return _&&_.length>4?_:_==="hvc1"?"hvc1.1.c.L120.90":_==="av01"?"av01.0.04M.08":_==="avc1"||p===B.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Z.default=W},"./src/task-loop.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"default",function(){return V});var V=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var B=I.prototype;return B.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},B.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},B.onHandlerDestroyed=function(){},B.hasInterval=function(){return!!this._tickInterval},B.hasNextTick=function(){return!!this._tickTimer},B.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},B.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},B.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},B.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},B.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},B.doTick=function(){},I}()},"./src/types/cmcd.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"CMCDVersion",function(){return V}),M.d(Z,"CMCDObjectType",function(){return I}),M.d(Z,"CMCDStreamingFormat",function(){return B}),M.d(Z,"CMCDStreamType",function(){return K});var V=1,I;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(I||(I={}));var B;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(B||(B={}));var K;(function(W){W.VOD="v",W.LIVE="l"})(K||(K={}))},"./src/types/level.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"HlsSkip",function(){return B}),M.d(Z,"getSkipValue",function(){return K}),M.d(Z,"HlsUrlParameters",function(){return W}),M.d(Z,"Level",function(){return L});function V(P,b){for(var p=0;pNumber.MAX_SAFE_INTEGER?Infinity:b},W.hexadecimalInteger=function(P){if(this[P]){var b=(this[P]||"0x").slice(2);b=(b.length&1?"0":"")+b;for(var p=new Uint8Array(b.length/2),_=0;_Number.MAX_SAFE_INTEGER?Infinity:b},W.decimalFloatingPoint=function(P){return parseFloat(this[P])},W.optionalFloat=function(P,b){var p=this[P];return p?parseFloat(p):b},W.enumeratedString=function(P){return this[P]},W.bool=function(P){return this[P]==="YES"},W.decimalResolution=function(P){var b=V.exec(this[P]);return b===null?void 0:{width:parseInt(b[1],10),height:parseInt(b[2],10)}},K.parseAttrList=function(P){var b,p={},_='"';for(I.lastIndex=0;(b=I.exec(P))!==null;){var h=b[2];h.indexOf(_)===0&&h.lastIndexOf(_)===h.length-1&&(h=h.slice(1,-1)),p[b[1]]=h}return p},K}()},"./src/utils/binary-search.ts":function(de,Z,M){"use strict";M.r(Z);var V={search:function(B,K){for(var W=0,L=B.length-1,P=null,b=null;W<=L;){P=(W+L)/2|0,b=B[P];var p=K(b);if(p>0)W=P+1;else if(p<0)L=P-1;else return b}return null}};Z.default=V},"./src/utils/buffer-helper.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"BufferHelper",function(){return B});var V=M("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},B=function(){function K(){}return K.isBuffered=function(L,P){try{if(L){for(var b=K.getBuffered(L),p=0;p=b.start(p)&&P<=b.end(p))return!0}}catch(_){}return!1},K.bufferInfo=function(L,P,b){try{if(L){var p=K.getBuffered(L),_=[],h;for(h=0;hr&&(p[h-1].end=L[_].end):p.push(L[_])}else p.push(L[_])}else p=L;for(var d=0,l,a=P,u=P,c=0;c=R&&P=o&&V.logger.log(this.time+" ["+o+"] "+E)},m}(),d=function(v){for(var s=[],o=0;oW&&(this.logger.log(h.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},v.moveCursor=function(o){var E=this.pos+o;if(o>1)for(var g=this.pos+1;g=144&&this.backSpace();var E=B(o);if(this.pos>=W){this.logger.log(h.ERROR,"Cannot insert "+o.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},v.clearFromPos=function(o){var E;for(E=o;E0&&(o?g="["+E.join(" | ")+"]":g=E.join(` `)),g},v.getTextAndFormat=function(){return this.rows},m}(),R=function(){function m(s,o,E){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=s,this.outputFilter=o,this.mode=null,this.verbose=0,this.displayedMemory=new c(E),this.nonDisplayedMemory=new c(E),this.lastOutputScreen=new c(E),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var v=m.prototype;return v.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[K-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},v.getHandler=function(){return this.outputFilter},v.setHandler=function(o){this.outputFilter=o},v.setPAC=function(o){this.writeScreen.setPAC(o)},v.setBkgData=function(o){this.writeScreen.setBkgData(o)},v.setMode=function(o){if(o===this.mode)return;this.mode=o,this.logger.log(h.INFO,"MODE="+o),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=o},v.insertChars=function(o){for(var E=0;E=46,E.italics)E.foreground="white";else{var g=Math.floor(o/2)-16,C=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=C[g]}this.logger.log(h.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},v.outputDataUpdate=function(o){o===void 0&&(o=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),o&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},v.cueSplitAtTime=function(o){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,o,this.displayedMemory),this.cueStartTime=o))},m}(),O=function(){function m(s,o,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new r;this.channels=[null,new R(s,o,g),new R(s+1,E,g)],this.cmdHistory=w(),this.logger=g}var v=m.prototype;return v.getHandler=function(o){return this.channels[o].getHandler()},v.setHandler=function(o,E){this.channels[o].setHandler(E)},v.addData=function(o,E){var g,C,N,U=!1;this.logger.time=o;for(var j=0;j ("+d([C,N])+")"),g=this.parseCmd(C,N),g||(g=this.parseMidrow(C,N)),g||(g=this.parsePAC(C,N)),g||(g=this.parseBackgroundAttributes(C,N)),!g&&(U=this.parseChars(C,N),U)){var H=this.currentChannel;if(H&&H>0){var y=this.channels[H];y.insertChars(U)}else this.logger.log(h.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!U&&this.logger.log(h.WARNING,"Couldn't parse cleaned data "+d([C,N])+" orig: "+d([E[j],E[j+1]]))}},v.parseCmd=function(o,E){var g=this.cmdHistory,C=(o===20||o===28||o===21||o===29)&&E>=32&&E<=47,N=(o===23||o===31)&&E>=33&&E<=35;if(!(C||N))return!1;if(A(o,E,g))return T(null,null,g),this.logger.log(h.DEBUG,"Repeated command ("+d([o,E])+") is dropped"),!0;var U=o===20||o===21||o===23?1:2,j=this.channels[U];return o===20||o===21||o===28||o===29?E===32?j.ccRCL():E===33?j.ccBS():E===34?j.ccAOF():E===35?j.ccAON():E===36?j.ccDER():E===37?j.ccRU(2):E===38?j.ccRU(3):E===39?j.ccRU(4):E===40?j.ccFON():E===41?j.ccRDC():E===42?j.ccTR():E===43?j.ccRTD():E===44?j.ccEDM():E===45?j.ccCR():E===46?j.ccENM():E===47&&j.ccEOC():j.ccTO(E-32),T(o,E,g),this.currentChannel=U,!0},v.parseMidrow=function(o,E){var g=0;if((o===17||o===25)&&E>=32&&E<=47){if(o===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(h.ERROR,"Mismatch channel in midrow parsing"),!1;var C=this.channels[g];return C?(C.ccMIDROW(E),this.logger.log(h.DEBUG,"MIDROW ("+d([o,E])+")"),!0):!1}return!1},v.parsePAC=function(o,E){var g,C=this.cmdHistory,N=(o>=17&&o<=23||o>=25&&o<=31)&&E>=64&&E<=127,U=(o===16||o===24)&&E>=64&&E<=95;if(!(N||U))return!1;if(A(o,E,C))return T(null,null,C),!0;var j=o<=23?1:2;E>=64&&E<=95?g=j===1?L[o]:b[o]:g=j===1?P[o]:p[o];var H=this.channels[j];return H?(H.setPAC(this.interpretPAC(g,E)),T(o,E,C),this.currentChannel=j,!0):!1},v.interpretPAC=function(o,E){var g,C={color:null,italics:!1,indent:null,underline:!1,row:o};return E>95?g=E-96:g=E-64,C.underline=(g&1)===1,g<=13?C.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(C.italics=!0,C.color="white"):C.indent=Math.floor((g-16)/2)*4,C},v.parseChars=function(o,E){var g,C=null,N=null;if(o>=25?(g=2,N=o-8):(g=1,N=o),N>=17&&N<=19){var U;N===17?U=E+80:N===18?U=E+112:U=E+144,this.logger.log(h.INFO,"Special char '"+B(U)+"' in channel "+g),C=[U]}else o>=32&&o<=127&&(C=E===0?[o]:[o,E]);if(C){var j=d(C);this.logger.log(h.DEBUG,"Char codes = "+j.join(",")),T(o,E,this.cmdHistory)}return C},v.parseBackgroundAttributes=function(o,E){var g=(o===16||o===24)&&E>=32&&E<=47,C=(o===23||o===31)&&E>=45&&E<=47;if(!(g||C))return!1;var N,U={};o===16||o===24?(N=Math.floor((E-32)/2),U.background=_[N],E%2===1&&(U.background=U.background+"_semi")):E===45?U.background="transparent":(U.foreground="black",E===47&&(U.underline=!0));var j=o<=23?1:2,H=this.channels[j];return H.setBkgData(U),T(o,E,this.cmdHistory),!0},v.reset=function(){for(var o=0;o=16?a--:a++;var T=Object(V.fixLineBreaks)(u.trim()),A=Object(I.generateCueId)(b,p,T);(!P||!P.cues||!P.cues.getCueById(A))&&(d=new c(b,p,T),d.id=A,d.line=R+1,d.align="left",d.position=10+Math.min(80,Math.floor(a*8/32)*10),h.push(d))}return P&&h.length&&(h.sort(function(w,m){return w.line==="auto"||m.line==="auto"?0:w.line>8&&m.line>8?m.line-w.line:w.line-m.line}),h.forEach(function(w){return Object(B.addCueToTrack)(P,w)})),h}};Z.default=W},"./src/utils/discontinuities.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"findFirstFragWithCC",function(){return K}),M.d(Z,"shouldAlignOnDiscontinuities",function(){return W}),M.d(Z,"findDiscontinuousReferenceFrag",function(){return L}),M.d(Z,"adjustSlidingStart",function(){return b}),M.d(Z,"alignStream",function(){return p}),M.d(Z,"alignPDT",function(){return h}),M.d(Z,"alignFragmentByPDTDelta",function(){return r}),M.d(Z,"alignMediaPlaylistByPDT",function(){return d});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/logger.ts"),B=M("./src/controller/level-helper.ts");function K(l,a){for(var u=null,c=0,R=l.length;cu.startCC||l&&l.cc=this.minWeight_},K.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},K.destroy=function(){},B}();Z.default=I},"./src/utils/ewma.ts":function(de,Z,M){"use strict";M.r(Z);var V=function(){function I(K,W,L){W===void 0&&(W=0),L===void 0&&(L=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=K,this.alpha_=K?Math.exp(Math.log(.5)/K):0,this.estimate_=W,this.totalWeight_=L}var B=I.prototype;return B.sample=function(W,L){var P=Math.pow(this.alpha_,W);this.estimate_=L*(1-P)+P*this.estimate_,this.totalWeight_+=W},B.getTotalWeight=function(){return this.totalWeight_},B.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},I}();Z.default=V},"./src/utils/fetch-loader.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"fetchSupported",function(){return r});var V=M("./src/polyfills/number.ts"),I=M("./src/loader/load-stats.ts"),B=M("./src/demux/chunk-cache.ts");function K(c,R){c.prototype=Object.create(R.prototype),c.prototype.constructor=c,p(c,R)}function W(c){var R=typeof Map=="function"?new Map:void 0;return W=function(T){if(T===null||!b(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(T))return R.get(T);R.set(T,A)}function A(){return L(T,arguments,_(this).constructor)}return A.prototype=Object.create(T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p(A,T)},W(c)}function L(c,R,O){return P()?L=Reflect.construct:L=function(A,w,m){var v=[null];v.push.apply(v,w);var s=Function.bind.apply(A,v),o=new s;return m&&p(o,m.prototype),o},L.apply(null,arguments)}function P(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(c){return!1}}function b(c){return Function.toString.call(c).indexOf("[native code]")!==-1}function p(c,R){return p=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},p(c,R)}function _(c){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},_(c)}function h(){return h=Object.assign||function(c){for(var R=1;R=m&&v(A,w,s.flush(),T)):v(A,w,N,T),g()}).catch(function(){return Promise.reject()})};return E()},c}();function l(c,R){var O={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(h({},c.headers))};return c.rangeEnd&&O.headers.set("Range","bytes="+c.rangeStart+"-"+String(c.rangeEnd-1)),O}function a(c,R){return new self.Request(c.url,R)}var u=function(c){K(R,c);function R(O,T,A){var w;return w=c.call(this,O)||this,w.code=void 0,w.details=void 0,w.code=T,w.details=A,w}return R}(W(Error));Z.default=d},"./src/utils/imsc1-ttml-parser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"IMSC1_CODEC",function(){return b}),M.d(Z,"parseIMSC1",function(){return r});var V=M("./src/utils/mp4-tools.ts"),I=M("./src/utils/vttparser.ts"),B=M("./src/utils/vttcue.ts"),K=M("./src/demux/id3.ts"),W=M("./src/utils/timescale-conversion.ts"),L=M("./src/utils/webvtt-parser.ts");function P(){return P=Object.assign||function(m){for(var v=1;v"):V}function W(b){for(var p=arguments.length,_=new Array(p>1?p-1:0),h=1;h>24,R[O+1]=T>>16&255,R[O+2]=T>>8&255,R[O+3]=T&255}function p(R,O){var T=[];if(!O.length)return T;var A,w,m;"data"in R?(A=R.data,w=R.start,m=R.end):(A=R,w=0,m=A.byteLength);for(var v=w;v1?v+s:m;if(o===O[0])if(O.length===1)T.push({data:A,start:v+8,end:E});else{var g=p({data:A,start:v+8,end:E},O.slice(1));g.length&&K.apply(T,g)}v=E}return T}function _(R){var O=p(R,["moov"]),T=O[0],A=T?T.end:null,w=p(R,["sidx"]);if(!w||!w[0])return null;var m=[],v=w[0],s=v.data[0],o=s===0?8:16,E=P(v,o);o+=4;var g=0,C=0;s===0?o+=8:o+=16,o+=2;var N=v.end+C,U=L(v,o);o+=2;for(var j=0;j>>31;if(F===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Q=P(v,H);H+=4,m.push({referenceSize:x,subsegmentDuration:Q,info:{duration:Q/E,start:N,end:N+x-1}}),N+=x,H+=4,o=H}return{earliestPresentationTime:g,timescale:E,version:s,referencesCount:U,references:m,moovEndOffset:A}}function h(R){for(var O=[],T=p(R,["moov","trak"]),A=0;AW)&&(this.startTime=W),this.endTime=L,this.screen=P,this.timelineController.createCaptionsTrack(this.trackName)},B.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"sendAddTrackEvent",function(){return I}),M.d(Z,"addCueToTrack",function(){return B}),M.d(Z,"clearCurrentCues",function(){return K}),M.d(Z,"removeCuesInRange",function(){return W}),M.d(Z,"getCuesInRange",function(){return P});var V=M("./src/utils/logger.ts");function I(b,p){var _;try{_=new Event("addtrack")}catch(h){_=document.createEvent("Event"),_.initEvent("addtrack",!1,!1)}_.track=b,p.dispatchEvent(_)}function B(b,p){var _=b.mode;if(_==="disabled"&&(b.mode="hidden"),b.cues&&!b.cues.getCueById(p.id))try{if(b.addCue(p),!b.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(r){V.logger.debug("[texttrack-utils]: "+r);var h=new self.TextTrackCue(p.startTime,p.endTime,p.text);h.id=p.id,b.addCue(h)}_==="disabled"&&(b.mode=_)}function K(b){var p=b.mode;if(p==="disabled"&&(b.mode="hidden"),b.cues)for(var _=b.cues.length;_--;)b.removeCue(b.cues[_]);p==="disabled"&&(b.mode=p)}function W(b,p,_){var h=b.mode;if(h==="disabled"&&(b.mode="hidden"),b.cues&&b.cues.length>0)for(var r=P(b.cues,p,_),d=0;db[_].endTime)return-1;for(var h=0,r=_;h<=r;){var d=Math.floor((r+h)/2);if(pb[d].startTime&&h<_)h=d+1;else return d}return b[h].startTime-p-1)for(var d=r,l=b.length;d=p&&a.endTime<=_)h.push(a);else if(a.startTime>_)return h}return h}},"./src/utils/time-ranges.ts":function(de,Z,M){"use strict";M.r(Z);var V={toString:function(B){for(var K="",W=B.length,L=0;L1?p-1:0),h=1;h100)throw new Error("Position must be between 0 and 100.");m=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",L({},r,{get:function(){return v},set:function(g){var C=W(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");v=C,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",L({},r,{get:function(){return s},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");s=g,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",L({},r,{get:function(){return o},set:function(g){var C=W(g);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");o=C,this.hasBeenReset=!0}})),h.displayState=void 0}return P.prototype.getCueAsHTML=function(){var b=self.WebVTT;return b.convertCueToDOMTree(self,this.text)},P}()},"./src/utils/vttparser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"parseTimeStamp",function(){return B}),M.d(Z,"fixLineBreaks",function(){return p}),M.d(Z,"VTTParser",function(){return _});var V=M("./src/utils/vttcue.ts"),I=function(){function h(){}var r=h.prototype;return r.decode=function(l,a){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},h}();function B(h){function r(l,a,u,c){return(l|0)*3600+(a|0)*60+(u|0)+parseFloat(c||0)}var d=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return d?parseFloat(d[2])>59?r(d[2],d[3],0,d[4]):r(d[1],d[2],d[3],d[4]):null}var K=function(){function h(){this.values=Object.create(null)}var r=h.prototype;return r.set=function(l,a){!this.get(l)&&a!==""&&(this.values[l]=a)},r.get=function(l,a,u){return u?this.has(l)?this.values[l]:a[u]:this.has(l)?this.values[l]:a},r.has=function(l){return l in this.values},r.alt=function(l,a,u){for(var c=0;c=0&&u<=100)return this.set(l,u),!0}return!1},h}();function W(h,r,d,l){var a=l?h.split(l):[h];for(var u in a){if(typeof a[u]!="string")continue;var c=a[u].split(d);if(c.length!==2)continue;var R=c[0],O=c[1];r(R,O)}}var L=new V.default(0,0,""),P=L.align==="middle"?"middle":"center";function b(h,r,d){var l=h;function a(){var R=B(h);if(R===null)throw new Error("Malformed timestamp: "+l);return h=h.replace(/^[^\sa-zA-Z-]+/,""),R}function u(R,O){var T=new K;W(R,function(m,v){var s;switch(m){case"region":for(var o=d.length-1;o>=0;o--)if(d[o].id===v){T.set(m,d[o].region);break}break;case"vertical":T.alt(m,v,["rl","lr"]);break;case"line":s=v.split(","),T.integer(m,s[0]),T.percent(m,s[0])&&T.set("snapToLines",!1),T.alt(m,s[0],["auto"]),s.length===2&&T.alt("lineAlign",s[1],["start",P,"end"]);break;case"position":s=v.split(","),T.percent(m,s[0]),s.length===2&&T.alt("positionAlign",s[1],["start",P,"end","line-left","line-right","auto"]);break;case"size":T.percent(m,v);break;case"align":T.alt(m,v,["start",P,"end","left","right"]);break}},/:/,/\s/),O.region=T.get("region",null),O.vertical=T.get("vertical","");var A=T.get("line","auto");A==="auto"&&L.line===-1&&(A=-1),O.line=A,O.lineAlign=T.get("lineAlign","start"),O.snapToLines=T.get("snapToLines",!0),O.size=T.get("size",100),O.align=T.get("align",P);var w=T.get("position","auto");w==="auto"&&L.position===50&&(w=O.align==="start"||O.align==="left"?0:O.align==="end"||O.align==="right"?100:50),O.position=w}function c(){h=h.replace(/^\s+/,"")}if(c(),r.startTime=a(),c(),h.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);h=h.substr(3),c(),r.endTime=a(),c(),u(h,r)}function p(h){return h.replace(//gi,` `)}var _=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 r=h.prototype;return r.parse=function(l){var a=this;l&&(a.buffer+=a.decoder.decode(l,{stream:!0}));function u(){var w=a.buffer,m=0;for(w=p(w);m")===-1){a.cue.id=R;continue}case"CUE":if(!a.cue){a.state="BADCUE";continue}try{b(R,a.cue,a.regionList)}catch(w){a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":{var A=R.indexOf("-->")!==-1;if(!R||A&&(T=!0)){a.oncue&&a.cue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}if(a.cue===null)continue;a.cue.text&&(a.cue.text+=` `),a.cue.text+=R}continue;case"BADCUE":R||(a.state="ID")}}}catch(w){a.state==="CUETEXT"&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state=a.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.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(a){l.onparsingerror&&l.onparsingerror(a)}return l.onflush&&l.onflush(),this},h}()},"./src/utils/webvtt-parser.ts":function(de,Z,M){"use strict";M.r(Z),M.d(Z,"generateCueId",function(){return _}),M.d(Z,"parseWebVTT",function(){return r});var V=M("./src/polyfills/number.ts"),I=M("./src/utils/vttparser.ts"),B=M("./src/demux/id3.ts"),K=M("./src/utils/timescale-conversion.ts"),W=M("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,P=function(l,a,u){return u===void 0&&(u=0),l.substr(u,a.length)===a},b=function(l){var a=parseInt(l.substr(-3)),u=parseInt(l.substr(-6,2)),c=parseInt(l.substr(-9,2)),R=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(V.isFiniteNumber)(a)||!Object(V.isFiniteNumber)(u)||!Object(V.isFiniteNumber)(c)||!Object(V.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return a+=1e3*u,a+=60*1e3*c,a+=60*60*1e3*R,a},p=function(l){for(var a=5381,u=l.length;u;)a=a*33^l.charCodeAt(--u);return(a>>>0).toString()};function _(d,l,a){return p(d.toString())+p(l.toString())+p(a)}var h=function(l,a,u){var c=l[a],R=l[c.prevCC];if(!R||!R.new&&c.new){l.ccOffset=l.presentationOffset=c.start,c.new=!1;return}for(;(O=R)!==null&&O!==void 0&&O.new;){var O;l.ccOffset+=c.start-R.start,c.new=!1,c=R,R=l[c.prevCC]}l.presentationOffset=u};function r(d,l,a,u,c,R,O,T){var A=new I.VTTParser,w=Object(B.utf8ArrayToStr)(new Uint8Array(d)).trim().replace(L,` `).split(` `),m=[],v=Object(K.toMpegTsClockFromTimescale)(l,a),s="00:00.000",o=0,E=0,g,C=!0,N=!1;A.oncue=function(U){var j=u[c],H=u.ccOffset,y=(o-v)/9e4;if(j!=null&&j.new&&(E!==void 0?H=u.ccOffset=j.start:h(u,c,y)),y&&(H=y-u.presentationOffset),N){var x=U.endTime-U.startTime,F=Object(W.normalizePts)((U.startTime+H-E)*9e4,R*9e4)/9e4;U.startTime=F,U.endTime=F+x}var Q=U.text.trim();U.text=decodeURIComponent(encodeURIComponent(Q)),U.id||(U.id=_(U.startTime,U.endTime,Q)),U.endTime>0&&m.push(U)},A.onparsingerror=function(U){g=U},A.onflush=function(){if(g){T(g);return}O(m)},w.forEach(function(U){if(C)if(P(U,"X-TIMESTAMP-MAP=")){C=!1,N=!0,U.substr(16).split(",").forEach(function(j){P(j,"LOCAL:")?s=j.substr(6):P(j,"MPEGTS:")&&(o=parseInt(j.substr(7)))});try{E=b(s)/1e3}catch(j){N=!1,g=j}return}else U===""&&(C=!1);A.parse(U+` `)}),A.flush()}},"./src/utils/xhr-loader.ts":function(de,Z,M){"use strict";M.r(Z);var V=M("./src/utils/logger.ts"),I=M("./src/loader/load-stats.ts"),B=/^age:\s*[\d.]+\s*$/m,K=function(){function W(P){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=P?P.xhrSetup:null,this.stats=new I.LoadStats,this.retryDelay=0}var L=W.prototype;return L.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},L.abortInternal=function(){var b=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),b&&(b.onreadystatechange=null,b.onprogress=null,b.readyState!==4&&(this.stats.aborted=!0,b.abort()))},L.abort=function(){var b;this.abortInternal(),(b=this.callbacks)!==null&&b!==void 0&&b.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},L.load=function(b,p,_){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=b,this.config=p,this.callbacks=_,this.retryDelay=p.retryDelay,this.loadInternal()},L.loadInternal=function(){var b=this.config,p=this.context;if(!b)return;var _=this.loader=new self.XMLHttpRequest,h=this.stats;h.loading.first=0,h.loaded=0;var r=this.xhrSetup;try{if(r)try{r(_,p.url)}catch(a){_.open("GET",p.url,!0),r(_,p.url)}_.readyState||_.open("GET",p.url,!0);var d=this.context.headers;if(d)for(var l in d)_.setRequestHeader(l,d[l])}catch(a){this.callbacks.onError({code:_.status,text:a.message},p,_);return}p.rangeEnd&&_.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),_.onreadystatechange=this.readystatechange.bind(this),_.onprogress=this.loadprogress.bind(this),_.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),b.timeout),_.send()},L.readystatechange=function(){var b=this.context,p=this.loader,_=this.stats;if(!b||!p)return;var h=p.readyState,r=this.config;if(_.aborted)return;if(h>=2)if(self.clearTimeout(this.requestTimeout),_.loading.first===0&&(_.loading.first=Math.max(self.performance.now(),_.loading.start)),h===4){p.onreadystatechange=null,p.onprogress=null;var d=p.status;if(d>=200&&d<300){_.loading.end=Math.max(self.performance.now(),_.loading.first);var l,a;if(b.responseType==="arraybuffer"?(l=p.response,a=l.byteLength):(l=p.responseText,a=l.length),_.loaded=_.total=a,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(_,b,l,p),!this.callbacks)return;var c={url:p.responseURL,data:l};this.callbacks.onSuccess(c,_,b,p)}else _.retry>=r.maxRetry||d>=400&&d<499?(V.logger.error(d+" while loading "+b.url),this.callbacks.onError({code:d,text:p.statusText},b,p)):(V.logger.warn(d+" while loading "+b.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,r.maxRetryDelay),_.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},L.loadtimeout=function(){V.logger.warn("timeout while loading "+this.context.url);var b=this.callbacks;b&&(this.abortInternal(),b.onTimeout(this.stats,this.context,this.loader))},L.loadprogress=function(b){var p=this.stats;p.loaded=b.loaded,b.lengthComputable&&(p.total=b.total)},L.getCacheAge=function(){var b=null;if(this.loader&&B.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");b=p?parseFloat(p):null}return b},W}();Z.default=K}}).default})},vHTk:function(ft,Xe,G){ft.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vkP9:function(ft,Xe,G){"use strict";var de=G("+L6B"),Z=G("2/Rp"),M=G("5NDa"),V=G("5rEg"),I=G("y8nQ"),B=G("Vl3Y"),K=G("tJVT"),W=G("q1tI"),L=G.n(W),P=G("a+yL"),b=G.n(P),p=function(h){var r=h.value,d=h.onChange,l=B.a.useForm(),a=Object(K.a)(l,1),u=a[0];Object(W.useEffect)(function(){r&&u.setFieldsValue(r)},r);var c=function(O){d(O)};return L.a.createElement("div",{className:b.a.search},L.a.createElement(B.a,{className:b.a.formWrap,colon:!1,form:u,size:"large",layout:"inline",onFinish:c},L.a.createElement(B.a.Item,{label:"\u5B9E\u8BAD\u4FE1\u606F",name:"keyword",initialValue:""},L.a.createElement(V.a,{style:{width:280,height:40}})),L.a.createElement(B.a.Item,{label:"\u5B66\u6821/\u5355\u4F4D",name:"schools",initialValue:"",style:{margin:"0 40px"}},L.a.createElement(V.a,{style:{width:280,height:40}})),L.a.createElement(B.a.Item,{label:"\u521B\u5EFA\u8005",name:"creator",initialValue:""},L.a.createElement(V.a,{style:{width:200,height:40}})),L.a.createElement(Z.a,{className:b.a.btn,type:"primary",htmlType:"submit"},"\u641C\u7D22")))};Xe.a=p},wNkr:function(ft,Xe){ft.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(ft,Xe){ft.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(ft,Xe,G){ft.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(ft,Xe,G){ft.exports=G.p+"static/AssistantCode3.fdd8db3c.jpeg"}}]);